diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 73fe1f0a373e..000000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,275 +0,0 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details -# -version: 2 -jobs: - build: - docker: - # specify the version you desire here - # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - - image: circleci/python:2.7.13 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - environment: - TEST_PLATFORM: "-e megaatmega2560" - - working_directory: ~/Marlin - - steps: - - checkout - - - restore_cache: - paths: - - ~/.platformio - - ~/Marlin/.piolibdeps - keys: - - v1-dependencies-{{ checksum "~/Marlin/platformio.ini" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: - name: install dependencies - command: | - sudo pip install -U platformio - - # run tests! - - run: - name: run tests - command: | - # - # - # Fetch the tag information for the current branch - ls -la - git fetch origin --tags - # - # Publish the buildroot script folder - chmod +x buildroot/bin/* - export PATH=`pwd`/buildroot/bin/:${PATH} - - # Generate custom version include - generate_version ./Marlin/src/inc - cat ./Marlin/src/inc/_Version.h - # - # Backup pins_RAMPS.h - # - cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup - # - - env_backup - - ################################# - # Build all sample configurations - ################################# - - echo testing megaatmega2560 targets... - export TEST_PLATFORM="-e megaatmega2560" - echo use_example_configs adafruit/ST7565 - use_example_configs adafruit/ST7565 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs BQ/Hephestos - use_example_configs BQ/Hephestos - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs BQ/Hephestos_2 - use_example_configs BQ/Hephestos_2 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs BQ/WITBOX - use_example_configs BQ/WITBOX - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs AliExpress/CL-260 - use_example_configs AliExpress/CL-260 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - #echo use_example_configs Cartesio - #use_example_configs Cartesio - #build_marlin_pio ./ ${TEST_PLATFORM} - #restore_configs - echo use_example_configs delta/FLSUN/auto_calibrate - use_example_configs delta/FLSUN/auto_calibrate - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs delta/FLSUN/kossel_mini - use_example_configs delta/FLSUN/kossel_mini - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs delta/generic - use_example_configs delta/generic - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs delta/kossel_mini - use_example_configs delta/kossel_mini - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs delta/kossel_xl - use_example_configs delta/kossel_xl - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Felix - use_example_configs Felix - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Felix/DUAL - use_example_configs Felix/DUAL - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs FolgerTech/i3-2020 - use_example_configs FolgerTech/i3-2020 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs gCreate/gMax1.5+ - use_example_configs gCreate/gMax1.5+ - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Geeetech/GT2560 - use_example_configs Geeetech/GT2560 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - #echo use_example_configs Geeetech/I3_Pro_X-GT2560 - #use_example_configs Geeetech/I3_Pro_X-GT2560 - #build_marlin_pio ./ ${TEST_PLATFORM} - #restore_configs - echo use_example_configs Infitary/i3-M508 - use_example_configs Infitary/i3-M508 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - use_example_configs Malyan/M200 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Micromake/C1/basic - use_example_configs Micromake/C1/basic - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Micromake/C1/enhanced - use_example_configs Micromake/C1/enhanced - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs RepRapWorld/Megatronics - use_example_configs RepRapWorld/Megatronics - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs RigidBot - use_example_configs RigidBot - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs SCARA - use_example_configs SCARA - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Velleman/K8200 - use_example_configs Velleman/K8200 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Velleman/K8400/Dual-head - use_example_configs Velleman/K8400/Dual-head - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Velleman/K8400 - use_example_configs Velleman/K8400 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Wanhao/Duplicator6 - use_example_configs Wanhao/Duplicator6 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - # Requires manual load of https://github.com/stawel/SlowSoftI2CMaster - #use_example_configs wt150 - #build_marlin_pio ./ ${TEST_PLATFORM} - #restore_configs - echo testing melzi targets... - export TEST_PLATFORM="-e melzi" - echo use_example_configs Anet/A6 - use_example_configs Anet/A6 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Anet/A8 - use_example_configs Anet/A8 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Creality/CR-10 - use_example_configs Creality/CR-10 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Malyan/M150 - use_example_configs Malyan/M150 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs Sanguinololu - use_example_configs Sanguinololu - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs TinyBoy2 - use_example_configs TinyBoy2 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - - echo testing rambo targets... - export TEST_PLATFORM="-e rambo" - echo use_example_configs AlephObjects/TAZ4 - use_example_configs AlephObjects/TAZ4 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - - echo testing at90usb1286_* targets... - export TEST_PLATFORM="-e at90usb1286_dfu" - #echo se_example_configs delta/kossel_pro - #use_example_configs delta/kossel_pro - #build_marlin_pio ./ ${TEST_PLATFORM} - #restore_configs - echo use_example_configs makibox - use_example_configs makibox - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - - echo testing sanguino_atmega644p targets... - export TEST_PLATFORM="-e sanguino_atmega644p" - echo use_example_configs tvrrug/Round2 - use_example_configs tvrrug/Round2 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - - echo testing LPC1768 targets... - export TEST_PLATFORM="-e LPC1768" - echo use_example_configs Mks/Sbase - use_example_configs Mks/Sbase - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo testing STM32F1 targets... - export TEST_PLATFORM="-e STM32F1" - restore_configs - echo use_example_configs STM32F10 - use_example_configs STM32F10 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - echo use_example_configs stm32f103ret6 - use_example_configs stm32f103ret6 - build_marlin_pio ./ ${TEST_PLATFORM} - restore_configs - - echo testing DUE targets... - export TEST_PLATFORM="-e DUE" - #echo use_example_configs UltiMachine/Archim2 - #use_example_configs UltiMachine/Archim2 - #build_marlin_pio ./ ${TEST_PLATFORM} - #restore_configs - - # - # Remove temp files from dependencies tree prior to caching - rm -rf ~/Marlin/.piolibdeps/_tmp_* - - # - # Restore the environment - # - env_restore - - - save_cache: - paths: - - ~/.platformio - - ~/Marlin/.piolibdeps - key: v1-dependencies-{{ checksum "~/Marlin/platformio.ini" }} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000000..946acca2d7f4 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: http://www.thinkyhead.com/donate-to-marlin diff --git a/.github/issue_template.md b/.github/issue_template.md index d67fb817cad3..ecfb36f0d580 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -2,7 +2,7 @@ Have you read Marlin's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/.github/code_of_conduct.md -Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use the Marlin Firmware forum at http://forums.reprap.org/list.php?415 or the Marlin Facebook Group https://www.facebook.com/groups/1049718498464482/. +Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use the Marlin Firmware forum at http://forums.reprap.org/list.php?415 or the Marlin Facebook Group https://www.facebook.com/groups/1049718498464482/ or the Marlin Discord Server https://discord.gg/n5NJ59y. Before filing an issue be sure to test the 1.1 and/or 2.0 "bugfix" branches to see whether the issue is already addressed. diff --git a/.travis.yml b/.travis.yml index c869f027a8fb..f9841e8916cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,39 +1,61 @@ -dist: xenial -sudo: require +dist: bionic +sudo: false language: python python: - - "2.7" + - "3.7" notifications: email: false -# Cache PlatformIO packages using Travis CI container-based infrastructure -sudo: false -cache: - pip: true - directories: - - "~/.platformio" - env: - - TEST_PLATFORM="megaatmega2560" + # Base Environments - TEST_PLATFORM="DUE" + - TEST_PLATFORM="esp32" + - TEST_PLATFORM="linux_native" + - TEST_PLATFORM="megaatmega2560" + - TEST_PLATFORM="teensy31" + - TEST_PLATFORM="teensy35" + + # Extended AVR Environments + - TEST_PLATFORM="FYSETC_F6_13" + - TEST_PLATFORM="megaatmega1280" + - TEST_PLATFORM="rambo" + - TEST_PLATFORM="sanguino_atmega1284p" + - TEST_PLATFORM="sanguino_atmega644p" + + # Extended STM32 Environments + - TEST_PLATFORM="STM32F103RC_bigtree" + - TEST_PLATFORM="STM32F103RC_bigtree_USB" + - TEST_PLATFORM="STM32F103RE_bigtree" + - TEST_PLATFORM="STM32F103RE_bigtree_USB" + - TEST_PLATFORM="STM32F103RC_fysetc" + - TEST_PLATFORM="jgaurora_a5s_a1" + - TEST_PLATFORM="STM32F103VE_longer" + - TEST_PLATFORM="STM32F407VE_black" + - TEST_PLATFORM="BIGTREE_SKR_PRO" + - TEST_PLATFORM="mks_robin" + - TEST_PLATFORM="ARMED" + + # STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working. + #- TEST_PLATFORM="STM32F4" + #- TEST_PLATFORM="STM32F7" + + # Put lengthy tests last - TEST_PLATFORM="LPC1768" - TEST_PLATFORM="LPC1769" - - TEST_PLATFORM="STM32F1" - - TEST_PLATFORM="teensy35" - - TEST_PLATFORM="linux_native" - - TEST_PLATFORM="esp32" -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 + # Non-working environment tests + #- TEST_PLATFORM="BIGTREE_BTT002" this board isn't released yet. we need pinout to be sure about what we do + #- TEST_PLATFORM="at90usb1286_cdc" + #- TEST_PLATFORM="at90usb1286_dfu" + #- TEST_PLATFORM="STM32F103CB_malyan" + #- TEST_PLATFORM="mks_robin_lite" + #- TEST_PLATFORM="mks_robin_mini" + #- TEST_PLATFORM="mks_robin_nano" + #- TEST_PLATFORM="SAMD51_grandcentral_m4" before_install: - - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90 # # Fetch the tag information for the current branch - git fetch origin --tags @@ -55,8 +77,8 @@ before_script: - cd ${TRAVIS_BUILD_DIR} # # Generate custom version include - - generate_version ${TRAVIS_BUILD_DIR}/Marlin/src/inc - - cat ${TRAVIS_BUILD_DIR}/Marlin/src/inc/_Version.h + - generate_version ${TRAVIS_BUILD_DIR}/Marlin/ + - cat ${TRAVIS_BUILD_DIR}/Marlin/Version.h # script: - run_tests ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c2ff9b061068..c862dbe057ef 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -70,13 +70,9 @@ // @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 "(Ben Hess, Ender-3)" // 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 +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,11 +85,14 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. -#define SHOW_CUSTOM_BOOTSCREEN +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. -#define CUSTOM_STATUS_SCREEN_IMAGE +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. +//#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,8 +128,7 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_BIGTREE_SKR_V1_3 #endif @@ -139,8 +137,8 @@ // Displayed in the LCD "Ready" message #define CUSTOM_MACHINE_NAME "Ender-3" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +275,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,13 +326,14 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin + //#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_FANS // Turn on PSU if fans need power #define AUTO_POWER_E_FANS #define AUTO_POWER_CONTROLLERFAN #define AUTO_POWER_CHAMBER_FAN @@ -348,17 +354,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +379,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +405,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -712,25 +721,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -744,35 +763,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -887,11 +909,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -903,10 +924,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -44 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -14 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -44, -14, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -941,7 +962,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1199,12 +1220,6 @@ #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 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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1258,19 +1273,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1515,7 +1517,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1525,8 +1527,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1571,10 +1576,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1683,6 +1688,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1910,31 +1923,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1968,6 +1962,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1978,16 +2007,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2003,6 +2030,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2014,27 +2047,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2120,8 +2160,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2160,7 +2202,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 1a968039410d..12fffc69ec25 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -834,6 +889,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -848,8 +912,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -863,6 +954,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -874,23 +977,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -923,8 +1009,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1004,17 +1093,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1036,7 +1139,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1129,14 +1232,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1167,7 +1370,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 10 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 725 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 725 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 725 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 725 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 725 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 725 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 900 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 900 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/Marlin/Makefile b/Marlin/Makefile index 222e60d62060..b0ada2616b5a 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -92,6 +92,9 @@ U8GLIB ?= 1 # this defines whether to include the Trinamic TMCStepper library TMC ?= 1 +# this defines whether to include the AdaFruit NeoPixel library +NEOPIXEL ?= 0 + ############ # Try to automatically determine whether RELOC_WORKAROUND is needed based # on GCC versions: @@ -237,7 +240,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1134) else ifeq ($(HARDWARE_MOTHERBOARD),1135) # Dagoma F5 else ifeq ($(HARDWARE_MOTHERBOARD),1136) -# Fysetc F6 +# FYSETC F6 else ifeq ($(HARDWARE_MOTHERBOARD),1137) # Duplicator i3 Plus else ifeq ($(HARDWARE_MOTHERBOARD),1138) @@ -247,69 +250,92 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1139) else ifeq ($(HARDWARE_MOTHERBOARD),1140) # Z-Bolt X Series else ifeq ($(HARDWARE_MOTHERBOARD),1141) +# TT OSCAR +else ifeq ($(HARDWARE_MOTHERBOARD),1142) +# Overlord/Overlord Pro +else ifeq ($(HARDWARE_MOTHERBOARD),1143) +# ADIMLab Gantry v1 +else ifeq ($(HARDWARE_MOTHERBOARD),1144) +# ADIMLab Gantry v2 +else ifeq ($(HARDWARE_MOTHERBOARD),1145) +# BIQU Tango V1 +else ifeq ($(HARDWARE_MOTHERBOARD),1146) +# MKS GEN L V2 +else ifeq ($(HARDWARE_MOTHERBOARD),1147) + +# +# RAMBo and derivatives +# + +# Rambo +else ifeq ($(HARDWARE_MOTHERBOARD),1200) +# Mini-Rambo +else ifeq ($(HARDWARE_MOTHERBOARD),1201) +# Mini-Rambo 1.0a +else ifeq ($(HARDWARE_MOTHERBOARD),1202) +# Einsy Rambo +else ifeq ($(HARDWARE_MOTHERBOARD),1203) +# Einsy Retro +else ifeq ($(HARDWARE_MOTHERBOARD),1204) +# abee Scoovo X9H +else ifeq ($(HARDWARE_MOTHERBOARD),1205) # # Other ATmega1280, ATmega2560 # # Cartesio CN Controls V11 -else ifeq ($(HARDWARE_MOTHERBOARD),1200) +else ifeq ($(HARDWARE_MOTHERBOARD),1300) # Cartesio CN Controls V12 -else ifeq ($(HARDWARE_MOTHERBOARD),1201) +else ifeq ($(HARDWARE_MOTHERBOARD),1301) +# Cartesio CN Controls V15 +else ifeq ($(HARDWARE_MOTHERBOARD),1302) # Cheaptronic v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1202) +else ifeq ($(HARDWARE_MOTHERBOARD),1303) # Cheaptronic v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1203) +else ifeq ($(HARDWARE_MOTHERBOARD),1304) # Makerbot Mightyboard Revision E -else ifeq ($(HARDWARE_MOTHERBOARD),1204) +else ifeq ($(HARDWARE_MOTHERBOARD),1305) # Megatronics -else ifeq ($(HARDWARE_MOTHERBOARD),1205) +else ifeq ($(HARDWARE_MOTHERBOARD),1306) # Megatronics v2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1206) +else ifeq ($(HARDWARE_MOTHERBOARD),1307) # Megatronics v3.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1207) +else ifeq ($(HARDWARE_MOTHERBOARD),1308) # Megatronics v3.1 -else ifeq ($(HARDWARE_MOTHERBOARD),1208) +else ifeq ($(HARDWARE_MOTHERBOARD),1309) # Megatronics v3.2 -else ifeq ($(HARDWARE_MOTHERBOARD),1209) -# Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),1210) -# Mini-Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),1211) -# Mini-Rambo 1.0a -else ifeq ($(HARDWARE_MOTHERBOARD),1212) -# Einsy Rambo -else ifeq ($(HARDWARE_MOTHERBOARD),1213) -# Einsy Retro -else ifeq ($(HARDWARE_MOTHERBOARD),1214) +else ifeq ($(HARDWARE_MOTHERBOARD),1310) # Elefu Ra Board (v3) -else ifeq ($(HARDWARE_MOTHERBOARD),1215) +else ifeq ($(HARDWARE_MOTHERBOARD),1311) # Leapfrog -else ifeq ($(HARDWARE_MOTHERBOARD),1216) +else ifeq ($(HARDWARE_MOTHERBOARD),1312) # Mega controller -else ifeq ($(HARDWARE_MOTHERBOARD),1217) -# abee Scoovo X9H -else ifeq ($(HARDWARE_MOTHERBOARD),1218) +else ifeq ($(HARDWARE_MOTHERBOARD),1313) # Geeetech GT2560 Rev B for Mecreator2 -else ifeq ($(HARDWARE_MOTHERBOARD),1219) +else ifeq ($(HARDWARE_MOTHERBOARD),1314) # Geeetech GT2560 Rev. A -else ifeq ($(HARDWARE_MOTHERBOARD),1220) +else ifeq ($(HARDWARE_MOTHERBOARD),1315) # Geeetech GT2560 Rev. A+ (with auto level probe) -else ifeq ($(HARDWARE_MOTHERBOARD),1221) +else ifeq ($(HARDWARE_MOTHERBOARD),1316) # Geeetech GT2560 Rev B for A10(M/D) -else ifeq ($(HARDWARE_MOTHERBOARD),1222) +else ifeq ($(HARDWARE_MOTHERBOARD),1317) # Geeetech GT2560 Rev B for A20(M/D) -else ifeq ($(HARDWARE_MOTHERBOARD),1223) +else ifeq ($(HARDWARE_MOTHERBOARD),1318) # Einstart retrofit -else ifeq ($(HARDWARE_MOTHERBOARD),1224) +else ifeq ($(HARDWARE_MOTHERBOARD),1319) +# Wanhao 0ne+ i3 Mini +else ifeq ($(HARDWARE_MOTHERBOARD),1320) # # ATmega1281, ATmega2561 # -else ifeq ($(HARDWARE_MOTHERBOARD),1300) +# Minitronics v1.0/1.1 +else ifeq ($(HARDWARE_MOTHERBOARD),1400) MCU ?= atmega1281 -else ifeq ($(HARDWARE_MOTHERBOARD),1310) +# Silvergate v1.0 +else ifeq ($(HARDWARE_MOTHERBOARD),1401) MCU ?= atmega1281 # @@ -317,43 +343,43 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1310) # # Sanguinololu < 1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),1400) +else ifeq ($(HARDWARE_MOTHERBOARD),1500) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega644p # Sanguinololu 1.2 and above -else ifeq ($(HARDWARE_MOTHERBOARD),1401) +else ifeq ($(HARDWARE_MOTHERBOARD),1501) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega644p # Melzi -else ifeq ($(HARDWARE_MOTHERBOARD),1402) +else ifeq ($(HARDWARE_MOTHERBOARD),1502) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega644p # Melzi with ATmega1284 (MaKr3d version) -else ifeq ($(HARDWARE_MOTHERBOARD),1403) +else ifeq ($(HARDWARE_MOTHERBOARD),1503) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p # Melzi Creality3D board (for CR-10 etc) -else ifeq ($(HARDWARE_MOTHERBOARD),1404) +else ifeq ($(HARDWARE_MOTHERBOARD),1504) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p # Melzi Malyan M150 board -else ifeq ($(HARDWARE_MOTHERBOARD),1405) +else ifeq ($(HARDWARE_MOTHERBOARD),1505) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p # Tronxy X5S -else ifeq ($(HARDWARE_MOTHERBOARD),1406) +else ifeq ($(HARDWARE_MOTHERBOARD),1506) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p # STB V1.1 -else ifeq ($(HARDWARE_MOTHERBOARD),1407) +else ifeq ($(HARDWARE_MOTHERBOARD),1507) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p # Azteeg X1 -else ifeq ($(HARDWARE_MOTHERBOARD),1408) +else ifeq ($(HARDWARE_MOTHERBOARD),1508) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p # Anet 1.0 (Melzi clone) -else ifeq ($(HARDWARE_MOTHERBOARD),1409) +else ifeq ($(HARDWARE_MOTHERBOARD),1509) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega1284p @@ -362,51 +388,51 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1409) # # Gen3 Monolithic Electronics -else ifeq ($(HARDWARE_MOTHERBOARD),1500) +else ifeq ($(HARDWARE_MOTHERBOARD),1600) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega644p # Gen3+ -else ifeq ($(HARDWARE_MOTHERBOARD),1501) +else ifeq ($(HARDWARE_MOTHERBOARD),1601) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega644p # Gen6 -else ifeq ($(HARDWARE_MOTHERBOARD),1502) +else ifeq ($(HARDWARE_MOTHERBOARD),1602) HARDWARE_VARIANT ?= Gen6 MCU ?= atmega644p # Gen6 deluxe -else ifeq ($(HARDWARE_MOTHERBOARD),1503) +else ifeq ($(HARDWARE_MOTHERBOARD),1603) HARDWARE_VARIANT ?= Gen6 MCU ?= atmega644p # Gen7 custom (Alfons3 Version) -else ifeq ($(HARDWARE_MOTHERBOARD),1504) +else ifeq ($(HARDWARE_MOTHERBOARD),1604) HARDWARE_VARIANT ?= Gen7 MCU ?= atmega644 F_CPU ?= 20000000 # Gen7 v1.1, v1.2 -else ifeq ($(HARDWARE_MOTHERBOARD),1505) +else ifeq ($(HARDWARE_MOTHERBOARD),1605) HARDWARE_VARIANT ?= Gen7 MCU ?= atmega644p F_CPU ?= 20000000 # Gen7 v1.3 -else ifeq ($(HARDWARE_MOTHERBOARD),1506) +else ifeq ($(HARDWARE_MOTHERBOARD),1606) HARDWARE_VARIANT ?= Gen7 MCU ?= atmega644p F_CPU ?= 20000000 # Gen7 v1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),1507) +else ifeq ($(HARDWARE_MOTHERBOARD),1607) HARDWARE_VARIANT ?= Gen7 MCU ?= atmega1284p F_CPU ?= 20000000 # Alpha OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),1508) +else ifeq ($(HARDWARE_MOTHERBOARD),1608) HARDWARE_VARIANT ?= SanguinoA MCU ?= atmega644 # Final OMCA board -else ifeq ($(HARDWARE_MOTHERBOARD),1509) +else ifeq ($(HARDWARE_MOTHERBOARD),1609) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega644p # Sethi 3D_1 -else ifeq ($(HARDWARE_MOTHERBOARD),1510) +else ifeq ($(HARDWARE_MOTHERBOARD),1610) HARDWARE_VARIANT ?= Sanguino MCU ?= atmega644p @@ -415,35 +441,35 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1510) # # Teensylu -else ifeq ($(HARDWARE_MOTHERBOARD),1600) +else ifeq ($(HARDWARE_MOTHERBOARD),1700) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 # Printrboard (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1601) +else ifeq ($(HARDWARE_MOTHERBOARD),1701) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 # Printrboard Revision F (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1602) +else ifeq ($(HARDWARE_MOTHERBOARD),1702) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 # Brainwave (AT90USB646) -else ifeq ($(HARDWARE_MOTHERBOARD),1603) +else ifeq ($(HARDWARE_MOTHERBOARD),1703) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb646 # Brainwave Pro (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1604) +else ifeq ($(HARDWARE_MOTHERBOARD),1704) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 # SAV Mk-I (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1605) +else ifeq ($(HARDWARE_MOTHERBOARD),1705) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 # Teensy++2.0 (AT90USB1286) -else ifeq ($(HARDWARE_MOTHERBOARD),1606) +else ifeq ($(HARDWARE_MOTHERBOARD),1706) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 # 5DPrint D8 Driver Board -else ifeq ($(HARDWARE_MOTHERBOARD),1607) +else ifeq ($(HARDWARE_MOTHERBOARD),1707) HARDWARE_VARIANT ?= Teensy MCU ?= at90usb1286 @@ -674,7 +700,7 @@ CXXSTANDARD = -std=gnu++11 CDEBUG = -g$(DEBUG) CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter CXXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter -CTUNING = -fsigned-char -funsigned-bitfields -fpack-struct -fno-exceptions \ +CTUNING = -fsigned-char -funsigned-bitfields -fno-exceptions \ -fshort-enums -ffunction-sections -fdata-sections ifneq ($(HARDWARE_MOTHERBOARD),) CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD} diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino index 842b2a14b923..ae5bca1dfed1 100644 --- a/Marlin/Marlin.ino +++ b/Marlin/Marlin.ino @@ -3,7 +3,7 @@ Marlin Firmware - (c) 2011-2018 MarlinFirmware + (c) 2011-2019 MarlinFirmware Portions of Marlin are (c) by their respective authors. All code complies with GPLv2 and/or GPLv3 diff --git a/Marlin/Version.h b/Marlin/Version.h new file mode 100644 index 000000000000..d18176f27f74 --- /dev/null +++ b/Marlin/Version.h @@ -0,0 +1,76 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +//////////////////////////// +// VENDOR VERSION EXAMPLE // +//////////////////////////// + +/** + * Marlin release version identifier + */ +//#define SHORT_BUILD_VERSION "bugfix-2.0.x" + +/** + * Verbose version identifier which should contain a reference to the location + * from where the binary was downloaded or the source code was compiled. + */ +//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" + +/** + * The 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-07-10" + +/** + * Defines a generic printer name to be output to the LCD after booting Marlin. + */ +//#define MACHINE_NAME "3D Printer" + +/** + * The SOURCE_CODE_URL is the location where users will find the Marlin Source + * Code which is installed on the device. In most cases —unless the manufacturer + * has a distinct Github fork— the Source Code URL should just be the main + * Marlin repository. + */ +//#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" + +/** + * Default generic printer UUID. + */ +//#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" + +/** + * The WEBSITE_URL is the location where users can get more information such as + * documentation about a specific Marlin release. + */ +//#define WEBSITE_URL "http://marlinfw.org" + +/** + * Set the vendor info the serial USB interface, if changable + * Currently only supported by DUE platform + */ +//#define USB_DEVICE_VENDOR_ID 0x0000 +//#define USB_DEVICE_PRODUCT_ID 0x0000 +//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h new file mode 100644 index 000000000000..5ad13931106d --- /dev/null +++ b/Marlin/src/HAL/HAL.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include "platforms.h" + +#include HAL_PATH(.,HAL.h) + +#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION) + +inline void watchdog_refresh() { + #if ENABLED(USE_WATCHDOG) + HAL_watchdog_refresh(); + #endif +} diff --git a/Marlin/src/HAL/HAL_AVR/HAL.cpp b/Marlin/src/HAL/HAL_AVR/HAL.cpp index adc441cb61d7..4a10f73dcfab 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL.cpp +++ b/Marlin/src/HAL/HAL_AVR/HAL.cpp @@ -22,64 +22,33 @@ #ifdef __AVR__ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../../inc/MarlinConfig.h" #include "HAL.h" -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ //uint8_t MCUSR; -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ -void HAL_init(void) { +void HAL_init() { // Init Servo Pins - #if PIN_EXISTS(SERVO0) - OUT_WRITE(SERVO0_PIN, LOW); + #define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW) + #if HAS_SERVO_0 + INIT_SERVO(0); #endif - #if PIN_EXISTS(SERVO1) - OUT_WRITE(SERVO1_PIN, LOW); + #if HAS_SERVO_1 + INIT_SERVO(1); #endif - #if PIN_EXISTS(SERVO2) - OUT_WRITE(SERVO2_PIN, LOW); + #if HAS_SERVO_2 + INIT_SERVO(2); #endif - #if PIN_EXISTS(SERVO3) - OUT_WRITE(SERVO3_PIN, LOW); + #if HAS_SERVO_3 + INIT_SERVO(3); #endif } diff --git a/Marlin/src/HAL/HAL_AVR/HAL.h b/Marlin/src/HAL/HAL_AVR/HAL.h index 38405e944159..e6d9683675d8 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL.h +++ b/Marlin/src/HAL/HAL_AVR/HAL.h @@ -18,33 +18,37 @@ */ #pragma once -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include - #include "../shared/Marduino.h" #include "../shared/HAL_SPI.h" -#include "fastio_AVR.h" -#include "watchdog_AVR.h" -#include "math_AVR.h" +#include "fastio.h" +#include "watchdog.h" +#include "math.h" #ifdef USBCON - #include "HardwareSerial.h" + #include #else + #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion #include "MarlinSerial.h" #endif +#include #include #include #include #include #include -// -------------------------------------------------------------------------- +#ifndef pgm_read_ptr + // Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for + // Windows Subsystem for Linux on Windows 10 as of 10/18/2019 + #define pgm_read_ptr_far(address_long) (void*)__ELPM_word((uint32_t)(address_long)) + #define pgm_read_ptr_near(address_short) (void*)__LPM_word((uint16_t)(address_short)) + #define pgm_read_ptr(address_short) pgm_read_ptr_near(address_short) +#endif + +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ //#define analogInputToDigitalPin(IO) IO @@ -59,9 +63,9 @@ // On AVR this is in math.h? //#define square(x) ((x)*(x)) -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ typedef uint16_t hal_timer_t; #define HAL_TIMER_TYPE_MAX 0xFFFF @@ -71,9 +75,9 @@ typedef int8_t pin_t; #define SHARED_SERVOS HAS_SERVOS #define HAL_SERVO_LIB Servo -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ //extern uint8_t MCUSR; @@ -105,22 +109,25 @@ typedef int8_t pin_t; #endif #endif -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ -void HAL_init(void); +void HAL_init(); -//void cli(void); +//void cli(); //void _delay_ms(const int delay); -inline void HAL_clear_reset_source(void) { MCUSR = 0; } -inline uint8_t HAL_get_reset_source(void) { return MCUSR; } +inline void HAL_clear_reset_source() { MCUSR = 0; } +inline uint8_t HAL_get_reset_source() { return MCUSR; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" extern "C" { - int freeMemory(void); + int freeMemory(); } +#pragma GCC diagnostic pop // timers #define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz @@ -147,8 +154,7 @@ extern "C" { #define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B) #define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B) -FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - UNUSED(frequency); +FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) { switch (timer_num) { case STEP_TIMER_NUM: // waveform generation = 0100 = CTC @@ -200,9 +206,9 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t freque /* 18 cycles maximum latency */ #define HAL_STEP_TIMER_ISR() \ -extern "C" void TIMER1_COMPA_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \ -extern "C" void TIMER1_COMPA_vect_bottom (void) asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ -void TIMER1_COMPA_vect (void) { \ +extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \ +extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ +void TIMER1_COMPA_vect() { \ __asm__ __volatile__ ( \ A("push r16") /* 2 Save R16 */ \ A("in r16, __SREG__") /* 1 Get SREG */ \ @@ -269,13 +275,13 @@ void TIMER1_COMPA_vect (void) { \ : \ ); \ } \ -void TIMER1_COMPA_vect_bottom(void) +void TIMER1_COMPA_vect_bottom() /* 14 cycles maximum latency */ #define HAL_TEMP_TIMER_ISR() \ -extern "C" void TIMER0_COMPB_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \ -extern "C" void TIMER0_COMPB_vect_bottom(void) asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ -void TIMER0_COMPB_vect (void) { \ +extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \ +extern "C" void TIMER0_COMPB_vect_bottom() asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ +void TIMER0_COMPB_vect() { \ __asm__ __volatile__ ( \ A("push r16") /* 2 Save R16 */ \ A("in r16, __SREG__") /* 1 Get SREG */ \ @@ -335,7 +341,7 @@ void TIMER0_COMPB_vect (void) { \ : \ ); \ } \ -void TIMER0_COMPB_vect_bottom(void) +void TIMER0_COMPB_vect_bottom() // ADC #ifdef DIDR2 @@ -344,7 +350,7 @@ void TIMER0_COMPB_vect_bottom(void) #define HAL_ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0) #endif -inline void HAL_adc_init(void) { +inline void HAL_adc_init() { ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07; DIDR0 = 0; #ifdef DIDR2 @@ -359,6 +365,7 @@ inline void HAL_adc_init(void) { #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin) #endif +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() ADC #define HAL_ADC_READY() !TEST(ADCSRA, ADSC) diff --git a/Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp b/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp similarity index 90% rename from Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp rename to Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp index 54825237565f..7a0f7246ee13 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp @@ -31,13 +31,9 @@ #ifdef __AVR__ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../../inc/MarlinConfig.h" -void spiBegin(void) { +void spiBegin() { OUT_WRITE(SS_PIN, HIGH); SET_OUTPUT(SCK_PIN); SET_INPUT(MISO_PIN); @@ -57,9 +53,9 @@ void spiBegin(void) { #if NONE(SOFTWARE_SPI, FORCE_SOFT_SPI) - //------------------------------------------------------------------------------ + // ------------------------ // Hardware SPI - //------------------------------------------------------------------------------ + // ------------------------ // make sure SPCR rate is in expected bits #if (SPR0 != 0 || SPR1 != 1) @@ -85,7 +81,7 @@ void spiBegin(void) { } /** SPI receive a byte */ - uint8_t spiRec(void) { + uint8_t spiRec() { SPDR = 0xFF; while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } return SPDR; @@ -181,22 +177,17 @@ void spiBegin(void) { #else // SOFTWARE_SPI || FORCE_SOFT_SPI - //------------------------------------------------------------------------------ + // ------------------------ // Software SPI - //------------------------------------------------------------------------------ + // ------------------------ // nop to tune soft SPI timing #define nop asm volatile ("\tnop\n") - // Set SPI rate - void spiInit(uint8_t spiRate) { - UNUSED(spiRate); // nothing to do - } + void spiInit(uint8_t) { /* do nothing */ } // Begin SPI transaction, set clock, bit order, data mode - void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { - UNUSED(spiBeginTransaction); // nothing to do - } + void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { /* do nothing */ } // Soft SPI receive byte uint8_t spiRec() { diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp index 57c1ed955022..3502aa6b0c36 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp @@ -271,7 +271,7 @@ // (called with TX irqs disabled) template - FORCE_INLINE void MarlinSerial::_tx_udr_empty_irq(void) { + FORCE_INLINE void MarlinSerial::_tx_udr_empty_irq() { if (Cfg::TX_SIZE > 0) { // Read positions uint8_t t = tx_buffer.tail; @@ -363,13 +363,13 @@ } template - int MarlinSerial::peek(void) { + int MarlinSerial::peek() { const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; return h == t ? -1 : rx_buffer.buffer[t]; } template - int MarlinSerial::read(void) { + int MarlinSerial::read() { const ring_buffer_pos_t h = atomic_read_rx_head(); // Read the tail. Main thread owns it, so it is safe to directly read it @@ -412,13 +412,13 @@ } template - typename MarlinSerial::ring_buffer_pos_t MarlinSerial::available(void) { + typename MarlinSerial::ring_buffer_pos_t MarlinSerial::available() { const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1); } template - void MarlinSerial::flush(void) { + void MarlinSerial::flush() { // Set the tail to the head: // - Read the RX head index in a safe way. (See atomic_read_rx_head.) @@ -505,7 +505,7 @@ } template - void MarlinSerial::flushTX(void) { + void MarlinSerial::flushTX() { if (Cfg::TX_SIZE == 0) { // No bytes written, no need to flush. This special case is needed since there's @@ -595,7 +595,7 @@ } template - void MarlinSerial::println(void) { + void MarlinSerial::println() { print('\r'); print('\n'); } diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h index 8849212d978d..7560d880e314 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h @@ -205,18 +205,18 @@ public: FORCE_INLINE static void store_rxd_char(); - FORCE_INLINE static void _tx_udr_empty_irq(void); + FORCE_INLINE static void _tx_udr_empty_irq(); public: MarlinSerial() {}; static void begin(const long); static void end(); - static int peek(void); - static int read(void); - static void flush(void); - static ring_buffer_pos_t available(void); + static int peek(); + static int read(); + static void flush(); + static ring_buffer_pos_t available(); static void write(const uint8_t c); - static void flushTX(void); + static void flushTX(); FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; } FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; } @@ -245,7 +245,7 @@ static void println(long, int = DEC); static void println(unsigned long, int = DEC); static void println(double, int = 2); - static void println(void); + static void println(); operator bool() { return true; } private: @@ -275,7 +275,6 @@ #endif // !USBCON - #ifdef INTERNAL_SERIAL_PORT template struct MarlinInternalSerialCfg { diff --git a/Marlin/src/HAL/HAL_AVR/servo_AVR.cpp b/Marlin/src/HAL/HAL_AVR/Servo.cpp similarity index 99% rename from Marlin/src/HAL/HAL_AVR/servo_AVR.cpp rename to Marlin/src/HAL/HAL_AVR/Servo.cpp index 58e220cbafbe..33818edb96f9 100644 --- a/Marlin/src/HAL/HAL_AVR/servo_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/Servo.cpp @@ -131,7 +131,7 @@ void initISR(timer16_Sequence_t timer) { TCCR1A = 0; // normal counting mode TCCR1B = _BV(CS11); // set prescaler of 8 TCNT1 = 0; // clear the timer count - #if defined(__AVR_ATmega8__)|| defined(__AVR_ATmega128__) + #if defined(__AVR_ATmega8__) || defined(__AVR_ATmega128__) SBI(TIFR, OCF1A); // clear any pending interrupts; SBI(TIMSK, OCIE1A); // enable the output compare interrupt #else diff --git a/Marlin/src/HAL/HAL_AVR/ServoTimers.h b/Marlin/src/HAL/HAL_AVR/ServoTimers.h index 07d307029791..4991caefe6fd 100644 --- a/Marlin/src/HAL/HAL_AVR/ServoTimers.h +++ b/Marlin/src/HAL/HAL_AVR/ServoTimers.h @@ -53,8 +53,8 @@ * -------------------- */ -#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays -#define PRESCALER 8 // timer prescaler +#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays +#define SERVO_TIMER_PRESCALER 8 // timer prescaler // Say which 16 bit timers can be used and in what order #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) diff --git a/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h b/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h index 4446367d15d7..77fa581632ac 100644 --- a/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h @@ -36,50 +36,65 @@ * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) */ -#include "../../core/macros.h" #include "../../module/endstops.h" #include // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } /** * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h) * - * These macros for the Arduino MEGA do not include the two connected pins on Port J (D13, D14). + * These macros for the Arduino MEGA do not include the two connected pins on Port J (D14, D15). * So we extend them here because these are the normal pins for Y_MIN and Y_MAX on RAMPS. * There are more PCI-enabled processor pins on Port J, but they are not connected to Arduino MEGA. */ #if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA) + + #define digitalPinHasPCICR(p) (WITHIN(p, 10, 15) || WITHIN(p, 50, 53) || WITHIN(p, 62, 69)) + #undef digitalPinToPCICR - #define digitalPinToPCICR(p) ( WITHIN(p, 10, 15) || \ - WITHIN(p, 50, 53) || \ - WITHIN(p, 62, 69) ? &PCICR : nullptr ) + #define digitalPinToPCICR(p) (digitalPinHasPCICR(p) ? (&PCICR) : nullptr) + #undef digitalPinToPCICRbit - #define digitalPinToPCICRbit(p) ( WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? 0 : \ - WITHIN(p, 14, 15) ? 1 : \ - WITHIN(p, 62, 69) ? 2 : \ - 0 ) + #define digitalPinToPCICRbit(p) (WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? 0 : \ + WITHIN(p, 14, 15) ? 1 : \ + WITHIN(p, 62, 69) ? 2 : \ + 0) + #undef digitalPinToPCMSK - #define digitalPinToPCMSK(p) ( WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? &PCMSK0 : \ - WITHIN(p, 14, 15) ? &PCMSK1 : \ - WITHIN(p, 62, 69) ? &PCMSK2 : \ - nullptr ) + #define digitalPinToPCMSK(p) (WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? (&PCMSK0) : \ + WITHIN(p, 14, 15) ? (&PCMSK1) : \ + WITHIN(p, 62, 69) ? (&PCMSK2) : \ + nullptr) + #undef digitalPinToPCMSKbit - #define digitalPinToPCMSKbit(p) ( WITHIN(p, 10, 13) ? ((p) - 6) : \ - (p) == 14 || (p) == 51 ? 2 : \ - (p) == 15 || (p) == 52 ? 1 : \ - (p) == 50 ? 3 : \ - (p) == 53 ? 0 : \ - WITHIN(p, 62, 69) ? ((p) - 62) : \ - 0 ) + #define digitalPinToPCMSKbit(p) (WITHIN(p, 10, 13) ? ((p) - 6) : \ + (p) == 14 || (p) == 51 ? 2 : \ + (p) == 15 || (p) == 52 ? 1 : \ + (p) == 50 ? 3 : \ + (p) == 53 ? 0 : \ + WITHIN(p, 62, 69) ? ((p) - 62) : \ + 0) + +#elif defined(__AVR_ATmega164A__) || defined(__AVR_ATmega164P__) || defined(__AVR_ATmega324A__) || \ + defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega324PB__) || \ + defined(__AVR_ATmega644A__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || \ + defined(__AVR_ATmega1284P__) + + #define digitalPinHasPCICR(p) WITHIN(p, 0, NUM_DIGITAL_PINS) + +#else + + #error "Unsupported AVR variant!" + #endif // Install Pin change interrupt for a pin. Can be called multiple times. void pciSetup(const int8_t pin) { - if (digitalPinToPCMSK(pin) != nullptr) { + if (digitalPinHasPCICR(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 @@ -103,154 +118,125 @@ void pciSetup(const int8_t pin) { ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect)); #endif -void setup_endstop_interrupts( void ) { - +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - #if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT) // if pin has an external interrupt - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + #if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT) + _ATTACH(X_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable"); // if pin has no pin change interrupt - error - pciSetup(X_MAX_PIN); // assign it + static_assert(digitalPinHasPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable"); + pciSetup(X_MAX_PIN); #endif #endif - #if HAS_X_MIN #if (digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable"); pciSetup(X_MIN_PIN); #endif #endif - #if HAS_Y_MAX #if (digitalPinToInterrupt(Y_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Y_MAX_PIN), "Y_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Y_MAX_PIN), "Y_MAX_PIN is not interrupt-capable"); pciSetup(Y_MAX_PIN); #endif #endif - #if HAS_Y_MIN #if (digitalPinToInterrupt(Y_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable"); pciSetup(Y_MIN_PIN); #endif #endif - #if HAS_Z_MAX #if (digitalPinToInterrupt(Z_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Z_MAX_PIN), "Z_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z_MAX_PIN), "Z_MAX_PIN is not interrupt-capable"); pciSetup(Z_MAX_PIN); #endif #endif - #if HAS_Z_MIN #if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Z_MIN_PIN), "Z_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z_MIN_PIN), "Z_MIN_PIN is not interrupt-capable"); pciSetup(Z_MIN_PIN); #endif #endif - #if HAS_X2_MAX #if (digitalPinToInterrupt(X2_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(X2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(X2_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(X2_MAX_PIN), "X2_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(X2_MAX_PIN), "X2_MAX_PIN is not interrupt-capable"); pciSetup(X2_MAX_PIN); #endif #endif - #if HAS_X2_MIN #if (digitalPinToInterrupt(X2_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(X2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X2_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(X2_MIN_PIN), "X2_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(X2_MIN_PIN), "X2_MIN_PIN is not interrupt-capable"); pciSetup(X2_MIN_PIN); #endif #endif - #if HAS_Y2_MAX #if (digitalPinToInterrupt(Y2_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Y2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y2_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Y2_MAX_PIN), "Y2_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Y2_MAX_PIN), "Y2_MAX_PIN is not interrupt-capable"); pciSetup(Y2_MAX_PIN); #endif #endif - #if HAS_Y2_MIN #if (digitalPinToInterrupt(Y2_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Y2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y2_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Y2_MIN_PIN), "Y2_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Y2_MIN_PIN), "Y2_MIN_PIN is not interrupt-capable"); pciSetup(Y2_MIN_PIN); #endif #endif - #if HAS_Z2_MAX #if (digitalPinToInterrupt(Z2_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Z2_MAX_PIN), "Z2_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z2_MAX_PIN), "Z2_MAX_PIN is not interrupt-capable"); pciSetup(Z2_MAX_PIN); #endif #endif - #if HAS_Z2_MIN #if (digitalPinToInterrupt(Z2_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Z2_MIN_PIN), "Z2_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z2_MIN_PIN), "Z2_MIN_PIN is not interrupt-capable"); pciSetup(Z2_MIN_PIN); #endif #endif - #if HAS_Z3_MAX #if (digitalPinToInterrupt(Z3_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Z3_MAX_PIN), "Z3_MAX_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z3_MAX_PIN), "Z3_MAX_PIN is not interrupt-capable"); pciSetup(Z3_MAX_PIN); #endif #endif - #if HAS_Z3_MIN #if (digitalPinToInterrupt(Z3_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Z3_MIN_PIN), "Z3_MIN_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z3_MIN_PIN), "Z3_MIN_PIN is not interrupt-capable"); pciSetup(Z3_MIN_PIN); #endif #endif - #if HAS_Z_MIN_PROBE_PIN #if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable"); + static_assert(digitalPinHasPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable"); pciSetup(Z_MIN_PROBE_PIN); #endif #endif diff --git a/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp b/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp index 7923968fd2ee..4884ede63fbe 100644 --- a/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp @@ -23,7 +23,7 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(FAST_PWM_FAN) +#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM #include "HAL.h" @@ -59,19 +59,19 @@ Timer get_pwm_timer(const pin_t pin) { #ifdef TCCR2 case TIMER2: { Timer timer = { - /*TCCRnQ*/ { &TCCR2, nullptr, nullptr}, - /*OCRnQ*/ { (uint16_t*)&OCR2, nullptr, nullptr}, + /*TCCRnQ*/ { &TCCR2, nullptr, nullptr }, + /*OCRnQ*/ { (uint16_t*)&OCR2, nullptr, nullptr }, /*ICRn*/ nullptr, /*n, q*/ 2, 0 }; } - #elif defined TCCR2A + #elif defined(TCCR2A) #if ENABLED(USE_OCR2A_AS_TOP) case TIMER2A: break; // protect TIMER2A case TIMER2B: { Timer timer = { - /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr}, - /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr}, + /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr }, + /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, /*ICRn*/ nullptr, /*n, q*/ 2, 1 }; @@ -81,8 +81,8 @@ Timer get_pwm_timer(const pin_t pin) { case TIMER2B: ++q; case TIMER2A: { Timer timer = { - /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr}, - /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr}, + /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr }, + /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, /*ICRn*/ nullptr, 2, q }; @@ -91,13 +91,24 @@ Timer get_pwm_timer(const pin_t pin) { #endif #endif #endif - #ifdef TCCR3A + #ifdef OCR3C case TIMER3C: ++q; case TIMER3B: ++q; case TIMER3A: { Timer timer = { - /*TCCRnQ*/ { &TCCR3A, &TCCR3B, &TCCR3C}, - /*OCRnQ*/ { &OCR3A, &OCR3B, &OCR3C}, + /*TCCRnQ*/ { &TCCR3A, &TCCR3B, &TCCR3C }, + /*OCRnQ*/ { &OCR3A, &OCR3B, &OCR3C }, + /*ICRn*/ &ICR3, + /*n, q*/ 3, q + }; + return timer; + } + #elif defined(OCR3B) + case TIMER3B: ++q; + case TIMER3A: { + Timer timer = { + /*TCCRnQ*/ { &TCCR3A, &TCCR3B, nullptr }, + /*OCRnQ*/ { &OCR3A, &OCR3B, nullptr }, /*ICRn*/ &ICR3, /*n, q*/ 3, q }; @@ -109,8 +120,8 @@ Timer get_pwm_timer(const pin_t pin) { case TIMER4B: ++q; case TIMER4A: { Timer timer = { - /*TCCRnQ*/ { &TCCR4A, &TCCR4B, &TCCR4C}, - /*OCRnQ*/ { &OCR4A, &OCR4B, &OCR4C}, + /*TCCRnQ*/ { &TCCR4A, &TCCR4B, &TCCR4C }, + /*OCRnQ*/ { &OCR4A, &OCR4B, &OCR4C }, /*ICRn*/ &ICR4, /*n, q*/ 4, q }; @@ -122,7 +133,7 @@ Timer get_pwm_timer(const pin_t pin) { case TIMER5B: ++q; case TIMER5A: { Timer timer = { - /*TCCRnQ*/ { &TCCR5A, &TCCR5B, &TCCR5C}, + /*TCCRnQ*/ { &TCCR5A, &TCCR5B, &TCCR5C }, /*OCRnQ*/ { &OCR5A, &OCR5B, &OCR5C }, /*ICRn*/ &ICR5, /*n, q*/ 5, q @@ -132,8 +143,8 @@ Timer get_pwm_timer(const pin_t pin) { #endif } Timer timer = { - /*TCCRnQ*/ { nullptr, nullptr, nullptr}, - /*OCRnQ*/ { nullptr, nullptr, nullptr}, + /*TCCRnQ*/ { nullptr, nullptr, nullptr }, + /*OCRnQ*/ { nullptr, nullptr, nullptr }, /*ICRn*/ nullptr, 0, 0 }; @@ -267,5 +278,5 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 } } -#endif // FAST_PWM_FAN +#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM #endif // __AVR__ diff --git a/Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp b/Marlin/src/HAL/HAL_AVR/fastio.cpp similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp rename to Marlin/src/HAL/HAL_AVR/fastio.cpp index 8f79555f691e..f0f7688f1b06 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/fastio.cpp @@ -26,7 +26,7 @@ #ifdef __AVR__ -#include "fastio_AVR.h" +#include "fastio.h" #ifdef FASTIO_EXT_START diff --git a/Marlin/src/HAL/HAL_AVR/fastio_AVR.h b/Marlin/src/HAL/HAL_AVR/fastio.h similarity index 98% rename from Marlin/src/HAL/HAL_AVR/fastio_AVR.h rename to Marlin/src/HAL/HAL_AVR/fastio.h index 1f2e820bdcfe..501a7cdf0616 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_AVR.h +++ b/Marlin/src/HAL/HAL_AVR/fastio.h @@ -27,8 +27,6 @@ * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. */ -#include "../../core/macros.h" - #include #define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__)) @@ -41,15 +39,15 @@ * Include Ports and Functions */ #if AVR_ATmega328_FAMILY - #include "fastio_168.h" + #include "fastio/fastio_168.h" #elif AVR_ATmega1284_FAMILY - #include "fastio_644.h" + #include "fastio/fastio_644.h" #elif AVR_ATmega2560_FAMILY - #include "fastio_1280.h" + #include "fastio/fastio_1280.h" #elif AVR_AT90USB1286_FAMILY - #include "fastio_AT90USB.h" + #include "fastio/fastio_AT90USB.h" #elif AVR_ATmega2561_FAMILY - #include "fastio_1281.h" + #include "fastio/fastio_1281.h" #else #error "No FastIO definition for the selected AVR Board." #endif @@ -274,6 +272,8 @@ enum ClockSource2 : char { #define SET_FOCB(T,V) SET_FOC(T,B,V) #define SET_FOCC(T,V) SET_FOC(T,C,V) +#if 0 + /** * PWM availability macros */ @@ -337,6 +337,8 @@ enum ClockSource2 : char { #define PWM_CHK(P) (PWM_CHK_HEATER(P) || PWM_CHK_SERVO(P) || PWM_CHK_MOTOR_CURRENT(P) || PWM_CHK_FAN_A(P) || PWM_CHK_FAN_B(P)) +#endif // PWM_CHK is not used in Marlin + // 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 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_1280.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_1280.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h index 84ceffcda04c..62de534d5371 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_1280.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h @@ -29,7 +29,7 @@ * 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 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 72 75 76 77 74 xx xx xx xx xx */ -#include "fastio_AVR.h" +#include "../fastio.h" // change for your board #define DEBUG_LED DIO21 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_1281.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_1281.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h index 153d1fd7d2e8..e3d2f12851b9 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_1281.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h @@ -28,7 +28,7 @@ * 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 */ -#include "fastio_AVR.h" +#include "../fastio.h" // change for your board #define DEBUG_LED DIO46 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_168.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_168.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h index 7e5a1ec79510..f6ee7a5d0016 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_168.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h @@ -28,7 +28,7 @@ * Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 */ -#include "fastio_AVR.h" +#include "../fastio.h" #define DEBUG_LED AIO5 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_644.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_644.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h index f62a0a35b4b3..180a3c4e3202 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_644.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h @@ -54,7 +54,7 @@ * +--------+ */ -#include "fastio_AVR.h" +#include "../fastio.h" #define DEBUG_LED DIO0 diff --git a/Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h rename to Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h index c7bf5f6b5a2f..3f17a2e26109 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h @@ -29,7 +29,7 @@ * The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3 */ -#include "fastio_AVR.h" +#include "../fastio.h" // change for your board #define DEBUG_LED DIO31 /* led D5 red */ diff --git a/Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.h b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h similarity index 91% rename from Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.h rename to Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h index cc02fda24f41..85f26f40162e 100644 --- a/Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.h +++ b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h @@ -20,8 +20,3 @@ * */ #pragma once - -extern IWDG_HandleTypeDef hiwdg; - -void watchdog_init(); -void watchdog_reset(); diff --git a/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_AVR/SanityCheck.h b/Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_AVR/SanityCheck.h rename to Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_AVR/math_AVR.h b/Marlin/src/HAL/HAL_AVR/math.h similarity index 100% rename from Marlin/src/HAL/HAL_AVR/math_AVR.h rename to Marlin/src/HAL/HAL_AVR/math.h diff --git a/Marlin/src/HAL/HAL_AVR/pinsDebug.h b/Marlin/src/HAL/HAL_AVR/pinsDebug.h index 4737c3517a87..e4738e0332e9 100644 --- a/Marlin/src/HAL/HAL_AVR/pinsDebug.h +++ b/Marlin/src/HAL/HAL_AVR/pinsDebug.h @@ -227,18 +227,9 @@ static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin"); void com_print(uint8_t N, uint8_t Z) { const uint8_t *TCCRA = (uint8_t*)TCCR_A(N); SERIAL_ECHOPGM(" COM"); - SERIAL_CHAR(N + '0'); - switch (Z) { - case 'A': - SERIAL_ECHOPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6)); - break; - case 'B': - SERIAL_ECHOPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4)); - break; - case 'C': - SERIAL_ECHOPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2)); - break; - } + SERIAL_CHAR('0' + N); + SERIAL_CHAR('A' + Z); + SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03)); } void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout @@ -353,6 +344,8 @@ static void pwm_details(uint8_t pin) { timer_prefix(0, 'A', 3); #endif } + #else + UNUSED(print_is_also_tied); #endif } // pwm_details @@ -400,4 +393,4 @@ static void pwm_details(uint8_t pin) { #endif -#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer);} while (0) +#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0) diff --git a/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h b/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h index 2a2a7bce8a86..e5bb82f226b5 100644 --- a/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h +++ b/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h @@ -47,7 +47,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = { // PORTLIST - // ------------------------------------------- + // ------------------------ PE , // PE 0 ** 0 ** USART0_RX PE , // PE 1 ** 1 ** USART0_TX PE , // PE 4 ** 2 ** PWM2 @@ -140,7 +140,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = { const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = { // PIN IN PORT - // ------------------------------------------- + // ------------------------ _BV( 0 ) , // PE 0 ** 0 ** USART0_RX _BV( 1 ) , // PE 1 ** 1 ** USART0_TX _BV( 4 ) , // PE 4 ** 2 ** PWM2 @@ -234,7 +234,7 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = { const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = { // TIMERS - // ------------------------------------------- + // ------------------------ NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX TIMER3B , // PE 4 ** 2 ** PWM2 diff --git a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp b/Marlin/src/HAL/HAL_AVR/watchdog.cpp similarity index 99% rename from Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp rename to Marlin/src/HAL/HAL_AVR/watchdog.cpp index 3ea44e7dce76..63a503196631 100644 --- a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/watchdog.cpp @@ -26,7 +26,7 @@ #if ENABLED(USE_WATCHDOG) -#include "watchdog_AVR.h" +#include "watchdog.h" #include "../../Marlin.h" diff --git a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.h b/Marlin/src/HAL/HAL_AVR/watchdog.h similarity index 95% rename from Marlin/src/HAL/HAL_AVR/watchdog_AVR.h rename to Marlin/src/HAL/HAL_AVR/watchdog.h index 5190d2c55af5..efd725d7d7a3 100644 --- a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.h +++ b/Marlin/src/HAL/HAL_AVR/watchdog.h @@ -28,4 +28,4 @@ void watchdog_init(); // Reset watchdog. MUST be called at least every 4 seconds after the // first watchdog_init or AVR will go into emergency procedures. -inline void watchdog_reset() { wdt_reset(); } +inline void HAL_watchdog_refresh() { wdt_reset(); } diff --git a/Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp b/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp similarity index 95% rename from Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp rename to Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp index 3b68faac1523..20f10ce40530 100644 --- a/Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp @@ -42,7 +42,7 @@ #define sw_barrier() __asm__ volatile("": : :"memory"); // (re)initialize UART0 as a monitor output to 250000,n,8,1 -static void TXBegin(void) { +static void TXBegin() { // Disable UART interrupt in NVIC NVIC_DisableIRQ( UART_IRQn ); @@ -235,7 +235,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause for (;;) WDT_Restart(WDT); } -__attribute__((naked)) void NMI_Handler(void) { +__attribute__((naked)) void NMI_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -248,7 +248,7 @@ __attribute__((naked)) void NMI_Handler(void) { ); } -__attribute__((naked)) void HardFault_Handler(void) { +__attribute__((naked)) void HardFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -261,7 +261,7 @@ __attribute__((naked)) void HardFault_Handler(void) { ); } -__attribute__((naked)) void MemManage_Handler(void) { +__attribute__((naked)) void MemManage_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -274,7 +274,7 @@ __attribute__((naked)) void MemManage_Handler(void) { ); } -__attribute__((naked)) void BusFault_Handler(void) { +__attribute__((naked)) void BusFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -287,7 +287,7 @@ __attribute__((naked)) void BusFault_Handler(void) { ); } -__attribute__((naked)) void UsageFault_Handler(void) { +__attribute__((naked)) void UsageFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -300,7 +300,7 @@ __attribute__((naked)) void UsageFault_Handler(void) { ); } -__attribute__((naked)) void DebugMon_Handler(void) { +__attribute__((naked)) void DebugMon_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -314,7 +314,7 @@ __attribute__((naked)) void DebugMon_Handler(void) { } /* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */ -__attribute__((naked)) void WDT_Handler(void) { +__attribute__((naked)) void WDT_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -327,7 +327,7 @@ __attribute__((naked)) void WDT_Handler(void) { ); } -__attribute__((naked)) void RSTC_Handler(void) { +__attribute__((naked)) void RSTC_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") diff --git a/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp b/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp similarity index 99% rename from Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp rename to Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp index 73421c3a37d2..c7b7007053ac 100644 --- a/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp @@ -31,12 +31,12 @@ #ifdef ARDUINO_ARCH_SAM -#include "../shared/persistent_store_api.h" #include "../../inc/MarlinConfig.h" #if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM) #include "../shared/Marduino.h" +#include "../shared/persistent_store_api.h" #define EEPROMSize 4096 #define PagesPerGroup 128 @@ -922,8 +922,7 @@ static void ee_Init() { if (!ee_IsPageClean(grp * PagesPerGroup + page)) { #ifdef EE_EMU_DEBUG SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("EEPROM Page ",page); - SERIAL_ECHOLNPAIR(" not clean on group ",grp); + SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp); SERIAL_FLUSH(); #endif ee_PageErase(grp * PagesPerGroup + page); @@ -944,7 +943,7 @@ static void ee_Init() { #ifdef EE_EMU_DEBUG SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Active page: ",curPage); + SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage); SERIAL_FLUSH(); #endif @@ -953,8 +952,7 @@ static void ee_Init() { if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) { #ifdef EE_EMU_DEBUG SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("EEPROM Page ",page); - SERIAL_ECHOLNPAIR(" not clean on active group ",curGroup); + SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup); SERIAL_FLUSH(); ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page)); #endif @@ -993,7 +991,7 @@ void eeprom_read_block(void* __dst, const void* __src, size_t __n) { } } -void eeprom_flush(void) { +void eeprom_flush() { ee_Flush(); } diff --git a/Marlin/src/HAL/HAL_DUE/HAL.cpp b/Marlin/src/HAL/HAL_DUE/HAL.cpp index dfe42f6ca307..130779896d3c 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL.cpp +++ b/Marlin/src/HAL/HAL_DUE/HAL.cpp @@ -25,56 +25,24 @@ #ifdef ARDUINO_ARCH_SAM -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../../inc/MarlinConfig.h" #include "HAL.h" #include #include "usb/usb_task.h" -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ uint16_t HAL_adc_result; -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ // HAL initialization task -void HAL_init(void) { +void HAL_init() { // Initialize the USB stack #if ENABLED(SDSUPPORT) OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up @@ -83,20 +51,20 @@ void HAL_init(void) { } // HAL idle task -void HAL_idletask(void) { +void HAL_idletask() { // Perform USB stack housekeeping usb_task_idle(); } // Disable interrupts -void cli(void) { noInterrupts(); } +void cli() { noInterrupts(); } // Enable interrupts -void sei(void) { interrupts(); } +void sei() { interrupts(); } -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { switch ((RSTC->RSTC_SR >> 8) & 0x07) { case 0: return RST_POWER_ON; case 1: return RST_BACKUP; @@ -119,18 +87,18 @@ extern "C" { // Return free memory between end of heap (or end bss) and whatever is current int freeMemory() { int free_memory, heap_end = (int)_sbrk(0); - return (int)&free_memory - (heap_end ? heap_end : (int)&_ebss); + return (int)&free_memory - (heap_end ?: (int)&_ebss); } -// -------------------------------------------------------------------------- +// ------------------------ // ADC -// -------------------------------------------------------------------------- +// ------------------------ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } -uint16_t HAL_adc_get_result(void) { +uint16_t HAL_adc_get_result() { // nop return HAL_adc_result; } diff --git a/Marlin/src/HAL/HAL_DUE/HAL.h b/Marlin/src/HAL/HAL_DUE/HAL.h index 943076973428..64cff24665c2 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL.h +++ b/Marlin/src/HAL/HAL_DUE/HAL.h @@ -32,34 +32,51 @@ #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_Due.h" -#include "watchdog_Due.h" -#include "HAL_timers_Due.h" +#include "fastio.h" +#include "watchdog.h" +#include "timers.h" #include -// Serial ports -#if !WITHIN(SERIAL_PORT, -1, 3) - #error "SERIAL_PORT must be from -1 to 3" +// Define MYSERIAL0/1 before MarlinSerial includes! +#if SERIAL_PORT == -1 + #define MYSERIAL0 customizedSerial1 +#elif SERIAL_PORT == 0 + #define MYSERIAL0 Serial +#elif SERIAL_PORT == 1 + #define MYSERIAL0 Serial1 +#elif SERIAL_PORT == 2 + #define MYSERIAL0 Serial2 +#elif SERIAL_PORT == 3 + #define MYSERIAL0 Serial3 +#else + #error "The required SERIAL_PORT must be from -1 to 3. Please update your configuration." #endif -// MYSERIAL0 required before MarlinSerial includes! -#define MYSERIAL0 customizedSerial1 - #ifdef SERIAL_PORT_2 - #if !WITHIN(SERIAL_PORT_2, -1, 3) - #error "SERIAL_PORT_2 must be from -1 to 3" - #elif SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different than SERIAL_PORT" + #if SERIAL_PORT_2 == SERIAL_PORT + #error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration." + #endif + #if SERIAL_PORT_2 == -1 + #define MYSERIAL1 customizedSerial2 + #elif SERIAL_PORT_2 == 0 + #define MYSERIAL1 Serial + #elif SERIAL_PORT_2 == 1 + #define MYSERIAL1 Serial1 + #elif SERIAL_PORT_2 == 2 + #define MYSERIAL1 Serial2 + #elif SERIAL_PORT_2 == 3 + #define MYSERIAL1 Serial3 + #else + #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration." #endif #define NUM_SERIAL 2 - #define MYSERIAL1 customizedSerial2 #else #define NUM_SERIAL 1 #endif -#include "MarlinSerial_Due.h" -#include "MarlinSerialUSB_Due.h" +#include "MarlinSerial.h" +#include "MarlinSerialUSB.h" // On AVR this is in math.h? #define square(x) ((x)*(x)) @@ -68,10 +85,6 @@ #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) #endif -#ifndef vsnprintf_P - #define vsnprintf_P vsnprintf -#endif - // Fix bug in pgm_read_ptr #undef pgm_read_ptr #define pgm_read_ptr(addr) (*((void**)(addr))) @@ -92,22 +105,11 @@ typedef int8_t pin_t; #define ENABLE_ISRS() __enable_irq() #define DISABLE_ISRS() __disable_irq() -void cli(void); // Disable interrupts -void sei(void); // Enable interrupts +void cli(); // Disable interrupts +void sei(); // Enable interrupts -void HAL_clear_reset_source(void); // clear reset reason -uint8_t HAL_get_reset_source(void); // get reset reason - -// -// SPI: Extended functions taking a channel number (Hardware SPI only) -// - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); +void HAL_clear_reset_source(); // clear reset reason +uint8_t HAL_get_reset_source(); // get reset reason // // EEPROM @@ -128,14 +130,15 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion #define HAL_ANALOG_SELECT(pin) -inline void HAL_adc_init(void) {}//todo +inline void HAL_adc_init() {}//todo #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); // // Pin Map @@ -153,19 +156,23 @@ void noTone(const pin_t _pin); // Enable hooks into idle and setup for HAL #define HAL_IDLETASK 1 -void HAL_idletask(void); -void HAL_init(void); +void HAL_idletask(); +void HAL_init(); // // Utility functions // void _delay_ms(const int delay); -int freeMemory(void); + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +int freeMemory(); +#pragma GCC diagnostic pop #ifdef __cplusplus extern "C" { #endif -char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s); +char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s); #ifdef __cplusplus } #endif diff --git a/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp b/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp rename to Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp index 82eae9b01e0d..35763a5ec713 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp @@ -37,27 +37,18 @@ #ifdef ARDUINO_ARCH_SAM -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../../inc/MarlinConfig.h" #include "../shared/Delay.h" -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ #if EITHER(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI) - // -------------------------------------------------------------------------- - // software SPI - // -------------------------------------------------------------------------- + // ------------------------ + // Software SPI + // ------------------------ // Make sure GCC optimizes this file. // Note that this line triggers a bug in GCC which is fixed by casting. @@ -160,13 +151,12 @@ (((uint32_t)(addr) & 0xF0000000) + 0x02000000 + ((uint32_t)(addr)&0xFFFFF)*32 + (bit)*4) // run at ~8 .. ~10Mhz - Rx version (Tx line not altered) - static uint8_t spiTransferRx0(uint8_t bout) { // using Mode 0 + static uint8_t spiTransferRx0(uint8_t) { // using Mode 0 uint32_t bin = 0; uint32_t work = 0; uint32_t BITBAND_MISO_PORT = BITBAND_ADDRESS( ((uint32_t)PORT(MISO_PIN))+0x3C, PIN_SHIFT(MISO_PIN)); /* PDSR of port in bitband area */ uint32_t SCK_PORT_PLUS30 = ((uint32_t) PORT(SCK_PIN)) + 0x30; /* SODR of port */ uint32_t SCK_MASK = PIN_MASK(SCK_PIN); - UNUSED(bout); /* The software SPI routine */ __asm__ __volatile__( @@ -437,7 +427,7 @@ static void spiTxBlockX(const uint8_t* buf, uint32_t todo) { do { - (void) spiTransferTx(*buf++); + (void)spiTransferTx(*buf++); } while (--todo); } @@ -551,9 +541,9 @@ // slave selects controlled by SPI controller // doesn't support changing SPI speeds for SD card - // -------------------------------------------------------------------------- + // ------------------------ // hardware SPI - // -------------------------------------------------------------------------- + // ------------------------ static bool spiInitialized = false; void spiInit(uint8_t spiRate) { diff --git a/Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.cpp b/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.cpp rename to Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp index c92736f69edc..b9f14823f68c 100644 --- a/Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp @@ -34,7 +34,7 @@ #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "InterruptVectors_Due.h" +#include "InterruptVectors.h" /* The relocated Exception/Interrupt Table - According to the ARM reference manual, alignment to 128 bytes should suffice, but in @@ -48,7 +48,7 @@ static DeviceVectors ram_tab = { nullptr }; * If it is not, then it copies the ROM table to the SRAM and relocates the table * by reprogramming the NVIC registers */ -static pfnISR_Handler* get_relocated_table_addr(void) { +static pfnISR_Handler* get_relocated_table_addr() { // Get the address of the interrupt/exception table uint32_t isrtab = SCB->VTOR; diff --git a/Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.h b/Marlin/src/HAL/HAL_DUE/InterruptVectors.h similarity index 97% rename from Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.h rename to Marlin/src/HAL/HAL_DUE/InterruptVectors.h index 592fb2f4cf5f..87dd04962496 100644 --- a/Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.h +++ b/Marlin/src/HAL/HAL_DUE/InterruptVectors.h @@ -37,7 +37,7 @@ #ifdef ARDUINO_ARCH_SAM // ISR handler type -typedef void (*pfnISR_Handler)(void); +typedef void (*pfnISR_Handler)(); // Install a new interrupt vector handler for the given irq, returning the old one pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler); diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp b/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp similarity index 98% rename from Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp rename to Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp index db5c93d8b451..7b88b6d43e14 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp @@ -29,8 +29,8 @@ #include "../../inc/MarlinConfig.h" -#include "MarlinSerial_Due.h" -#include "InterruptVectors_Due.h" +#include "MarlinSerial.h" +#include "InterruptVectors.h" #include "../../Marlin.h" template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0, 0, { 0 } }; @@ -178,7 +178,7 @@ FORCE_INLINE void MarlinSerial::store_rxd_char() { } template -FORCE_INLINE void MarlinSerial::_tx_thr_empty_irq(void) { +FORCE_INLINE void MarlinSerial::_tx_thr_empty_irq() { if (Cfg::TX_SIZE > 0) { // Read positions uint8_t t = tx_buffer.tail; @@ -221,7 +221,7 @@ FORCE_INLINE void MarlinSerial::_tx_thr_empty_irq(void) { } template -void MarlinSerial::UART_ISR(void) { +void MarlinSerial::UART_ISR() { const uint32_t status = HWUART->UART_SR; // Data received? @@ -308,13 +308,13 @@ void MarlinSerial::end() { } template -int MarlinSerial::peek(void) { +int MarlinSerial::peek() { const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail]; return v; } template -int MarlinSerial::read(void) { +int MarlinSerial::read() { const ring_buffer_pos_t h = rx_buffer.head; ring_buffer_pos_t t = rx_buffer.tail; @@ -354,13 +354,13 @@ int MarlinSerial::read(void) { } template -typename MarlinSerial::ring_buffer_pos_t MarlinSerial::available(void) { +typename MarlinSerial::ring_buffer_pos_t MarlinSerial::available() { const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail; return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1); } template -void MarlinSerial::flush(void) { +void MarlinSerial::flush() { rx_buffer.tail = rx_buffer.head; if (Cfg::XONOFF) { @@ -431,7 +431,7 @@ void MarlinSerial::write(const uint8_t c) { } template -void MarlinSerial::flushTX(void) { +void MarlinSerial::flushTX() { // TX if (Cfg::TX_SIZE == 0) { @@ -520,7 +520,7 @@ void MarlinSerial::print(double n, int digits) { } template -void MarlinSerial::println(void) { +void MarlinSerial::println() { print('\r'); print('\n'); } diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h b/Marlin/src/HAL/HAL_DUE/MarlinSerial.h similarity index 96% rename from Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h rename to Marlin/src/HAL/HAL_DUE/MarlinSerial.h index 1ba8d82df8f2..92806f15b405 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerial.h @@ -108,19 +108,19 @@ class MarlinSerial { static ring_buffer_pos_t rx_max_enqueued; FORCE_INLINE static void store_rxd_char(); - FORCE_INLINE static void _tx_thr_empty_irq(void); - static void UART_ISR(void); + FORCE_INLINE static void _tx_thr_empty_irq(); + static void UART_ISR(); public: MarlinSerial() {}; static void begin(const long); static void end(); - static int peek(void); - static int read(void); - static void flush(void); - static ring_buffer_pos_t available(void); + static int peek(); + static int read(); + static void flush(); + static ring_buffer_pos_t available(); static void write(const uint8_t c); - static void flushTX(void); + static void flushTX(); FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; } FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; } @@ -149,7 +149,7 @@ class MarlinSerial { static void println(long, int = DEC); static void println(unsigned long, int = DEC); static void println(double, int = 2); - static void println(void); + static void println(); operator bool() { return true; } private: diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp similarity index 92% rename from Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp rename to Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp index 58cc8460029d..f7f48d5f4246 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp @@ -31,7 +31,7 @@ #if SERIAL_PORT == -1 -#include "MarlinSerialUSB_Due.h" +#include "MarlinSerialUSB.h" #if ENABLED(EMERGENCY_PARSER) #include "../../feature/emergency_parser.h" @@ -39,11 +39,11 @@ // Imports from Atmel USB Stack/CDC implementation extern "C" { - bool usb_task_cdc_isenabled(void); - bool usb_task_cdc_dtr_active(void); - bool udi_cdc_is_rx_ready(void); - int udi_cdc_getc(void); - bool udi_cdc_is_tx_ready(void); + bool usb_task_cdc_isenabled(); + bool usb_task_cdc_dtr_active(); + bool udi_cdc_is_rx_ready(); + int udi_cdc_getc(); + bool udi_cdc_is_tx_ready(); int udi_cdc_putc(int value); }; @@ -55,14 +55,11 @@ static int pending_char = -1; #endif // Public Methods -void MarlinSerialUSB::begin(const long baud_setting) { - UNUSED(baud_setting); -} +void MarlinSerialUSB::begin(const long) {} -void MarlinSerialUSB::end() { -} +void MarlinSerialUSB::end() {} -int MarlinSerialUSB::peek(void) { +int MarlinSerialUSB::peek() { if (pending_char >= 0) return pending_char; @@ -83,7 +80,7 @@ int MarlinSerialUSB::peek(void) { return pending_char; } -int MarlinSerialUSB::read(void) { +int MarlinSerialUSB::read() { if (pending_char >= 0) { int ret = pending_char; pending_char = -1; @@ -107,7 +104,7 @@ int MarlinSerialUSB::read(void) { return c; } -bool MarlinSerialUSB::available(void) { +bool MarlinSerialUSB::available() { /* If Pending chars */ return pending_char >= 0 || /* or USB CDC enumerated and configured on the PC side and some @@ -115,8 +112,8 @@ bool MarlinSerialUSB::available(void) { (usb_task_cdc_isenabled() && udi_cdc_is_rx_ready()); } -void MarlinSerialUSB::flush(void) { } -void MarlinSerialUSB::flushTX(void) { } +void MarlinSerialUSB::flush() { } +void MarlinSerialUSB::flushTX() { } void MarlinSerialUSB::write(const uint8_t c) { @@ -186,7 +183,7 @@ void MarlinSerialUSB::print(double n, int digits) { printFloat(n, digits); } -void MarlinSerialUSB::println(void) { +void MarlinSerialUSB::println() { print('\r'); print('\n'); } diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h similarity index 94% rename from Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h rename to Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h index cc63232f29a1..3d9d4bafaadb 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h @@ -43,11 +43,11 @@ class MarlinSerialUSB { MarlinSerialUSB() {}; static void begin(const long); static void end(); - static int peek(void); - static int read(void); - static void flush(void); - static void flushTX(void); - static bool available(void); + static int peek(); + static int read(); + static void flush(); + static void flushTX(); + static bool available(); static void write(const uint8_t c); #if ENABLED(SERIAL_STATS_DROPPED_RX) @@ -80,7 +80,7 @@ class MarlinSerialUSB { static void println(long, int = DEC); static void println(unsigned long, int = DEC); static void println(double, int = 2); - static void println(void); + static void println(); operator bool() { return true; } private: diff --git a/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp b/Marlin/src/HAL/HAL_DUE/Servo.cpp similarity index 89% rename from Marlin/src/HAL/HAL_DUE/Servo_Due.cpp rename to Marlin/src/HAL/HAL_DUE/Servo.cpp index 2dd9d4c45efc..f48fdf57966c 100644 --- a/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/Servo.cpp @@ -50,25 +50,25 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval) -//------------------------------------------------------------------------------ +// ------------------------ /// Interrupt handler for the TC0 channel 1. -//------------------------------------------------------------------------------ +// ------------------------ void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel); #ifdef _useTimer1 - void HANDLER_FOR_TIMER1(void) { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); } + void HANDLER_FOR_TIMER1() { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); } #endif #ifdef _useTimer2 - void HANDLER_FOR_TIMER2(void) { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); } + void HANDLER_FOR_TIMER2() { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); } #endif #ifdef _useTimer3 - void HANDLER_FOR_TIMER3(void) { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); } + void HANDLER_FOR_TIMER3() { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); } #endif #ifdef _useTimer4 - void HANDLER_FOR_TIMER4(void) { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); } + void HANDLER_FOR_TIMER4() { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); } #endif #ifdef _useTimer5 - void HANDLER_FOR_TIMER5(void) { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); } + void HANDLER_FOR_TIMER5() { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); } #endif void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) { @@ -137,7 +137,7 @@ void initISR(timer16_Sequence_t timer) { #endif } -void finISR(timer16_Sequence_t timer) { +void finISR(timer16_Sequence_t) { #ifdef _useTimer1 TC_Stop(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); #endif diff --git a/Marlin/src/HAL/HAL_DUE/ServoTimers.h b/Marlin/src/HAL/HAL_DUE/ServoTimers.h index 84129ef2b619..c32c93825399 100644 --- a/Marlin/src/HAL/HAL_DUE/ServoTimers.h +++ b/Marlin/src/HAL/HAL_DUE/ServoTimers.h @@ -36,8 +36,8 @@ //!#define _useTimer4 #define _useTimer5 -#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays -#define PRESCALER 32 // timer prescaler +#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays +#define SERVO_TIMER_PRESCALER 32 // timer prescaler /* TC0, chan 0 => TC0_Handler diff --git a/Marlin/src/HAL/HAL_DUE/Tone.cpp b/Marlin/src/HAL/HAL_DUE/Tone.cpp index f7549c4472ae..2af97aac611f 100644 --- a/Marlin/src/HAL/HAL_DUE/Tone.cpp +++ b/Marlin/src/HAL/HAL_DUE/Tone.cpp @@ -5,6 +5,8 @@ * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * * 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 @@ -29,7 +31,7 @@ #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "HAL_timers_Due.h" +#include "timers.h" static pin_t tone_pin; volatile static int32_t toggles; diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp similarity index 65% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp index f90d24dae0bb..5e5a4e5fc185 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp @@ -21,58 +21,57 @@ */ -/* - - based on u8g_com_msp430_hw_spi.c - - Universal 8bit Graphics Library - - Copyright (c) 2012, olikraus@gmail.com - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or other - materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ +/** + * Based on u8g_com_msp430_hw_spi.c + * + * Universal 8bit Graphics Library + * + * Copyright (c) 2012, olikraus@gmail.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list + * of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ #ifdef __SAM3X8E__ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_GRAPHICAL_LCD #include -#include "../../Marlin.h" +#include "../../../Marlin.h" void spiBegin(); void spiInit(uint8_t spiRate); void spiSend(uint8_t b); void spiSend(const uint8_t* buf, size_t n); -#include "../shared/Marduino.h" -#include "fastio_Due.h" +#include "../../shared/Marduino.h" +#include "../fastio.h" void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) { PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1, diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp index 8af460954aa5..47e56fddb084 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp @@ -55,11 +55,11 @@ #ifdef ARDUINO_ARCH_SAM -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ENABLED(U8GLIB_ST7920) -#include "../shared/Delay.h" +#include "../../shared/Delay.h" #include @@ -145,8 +145,8 @@ uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va } #if ENABLED(LIGHTWEIGHT_UI) - #include "../../lcd/ultralcd.h" - #include "../shared/HAL_ST7920.h" + #include "../../../lcd/ultralcd.h" + #include "../../shared/HAL_ST7920.h" #define ST7920_CS_PIN LCD_PINS_RS diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi.cpp rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp index c7929c5c140e..e078bc420f57 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp @@ -55,7 +55,7 @@ #ifdef ARDUINO_ARCH_SAM -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920) @@ -64,8 +64,8 @@ #include "u8g_com_HAL_DUE_sw_spi_shared.h" -#include "../shared/Marduino.h" -#include "../shared/Delay.h" +#include "../../shared/Marduino.h" +#include "../../shared/Delay.h" #include diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp similarity index 98% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.cpp rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp index 673ef4fac266..d3609f60ef12 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp @@ -55,11 +55,11 @@ #ifdef ARDUINO_ARCH_SAM -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_GRAPHICAL_LCD -#include "../shared/Delay.h" +#include "../../shared/Delay.h" #include diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.h b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h similarity index 92% rename from Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.h rename to Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h index a7e2432d9840..b83247415033 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_sw_spi_shared.h +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h @@ -21,8 +21,9 @@ */ #pragma once -#include "../../inc/MarlinConfigPre.h" -#include "../shared/Marduino.h" +#include "../../../inc/MarlinConfigPre.h" +#include "../../shared/Marduino.h" +#include void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index); void u8g_SetPILevel_DUE(u8g_t *u8g, uint8_t pin_index, uint8_t level); diff --git a/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h b/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h index d97b8453cc1f..daa2b3c15e9c 100644 --- a/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h @@ -38,45 +38,46 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } /** * Endstop interrupts for Due based targets. * On Due, all pins support external interrupt capability. */ -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_DUE/fastio_Due.h b/Marlin/src/HAL/HAL_DUE/fastio.h similarity index 99% rename from Marlin/src/HAL/HAL_DUE/fastio_Due.h rename to Marlin/src/HAL/HAL_DUE/fastio.h index e44d1d1ee642..a97a944e33f1 100644 --- a/Marlin/src/HAL/HAL_DUE/fastio_Due.h +++ b/Marlin/src/HAL/HAL_DUE/fastio.h @@ -39,6 +39,8 @@ #include +#include "../../inc/MarlinConfigPre.h" + /** * Utility functions */ @@ -68,14 +70,14 @@ const uint32_t mask = MASK(DIO ## IO ## _PIN); \ if (V) port->PIO_SODR = mask; \ else port->PIO_CODR = mask; \ -} while(0) +}while(0) // Toggle a pin #define _TOGGLE(IO) _WRITE(IO, !READ(IO)) #if MB(PRINTRBOARD_G2) - #include "G2_pins.h" + #include "fastio/G2_pins.h" // Set pin as input #define _SET_INPUT(IO) do{ \ diff --git a/Marlin/src/HAL/HAL_DUE/G2_PWM.cpp b/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp similarity index 99% rename from Marlin/src/HAL/HAL_DUE/G2_PWM.cpp rename to Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp index 1e08332a4e59..4afd83ad4bdc 100644 --- a/Marlin/src/HAL/HAL_DUE/G2_PWM.cpp +++ b/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp @@ -40,7 +40,7 @@ * Some jitter in the Vref signal is OK so the interrupt priority is left at its default value. */ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if MB(PRINTRBOARD_G2) diff --git a/Marlin/src/HAL/HAL_DUE/G2_PWM.h b/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h similarity index 97% rename from Marlin/src/HAL/HAL_DUE/G2_PWM.h rename to Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h index 8086648bcffd..4a84dfe64a7b 100644 --- a/Marlin/src/HAL/HAL_DUE/G2_PWM.h +++ b/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h @@ -26,8 +26,8 @@ * PR #7500. It is hardwired for the PRINTRBOARD_G2 Motor Current needs. */ -#include "../../inc/MarlinConfigPre.h" -#include "../../module/stepper.h" +#include "../../../inc/MarlinConfigPre.h" +#include "../../../module/stepper.h" //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\module\stepper.h //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\HAL\HAL_DUE\G2_PWM.h diff --git a/Marlin/src/HAL/HAL_DUE/G2_pins.h b/Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h similarity index 100% rename from Marlin/src/HAL/HAL_DUE/G2_pins.h rename to Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h diff --git a/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_DUE/SanityCheck.h b/Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_DUE/SanityCheck.h rename to Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp index 4814620b9e38..fc1baa22ac8b 100644 --- a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp @@ -29,11 +29,11 @@ #include "../../inc/MarlinConfig.h" #include "../shared/persistent_store_api.h" -#if NONE(I2C_EEPROM, SPI_EEPROM) +#if !defined(E2END) && NONE(I2C_EEPROM, SPI_EEPROM) #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp) #endif -extern void eeprom_flush(void); +extern void eeprom_flush(); bool PersistentStore::access_start() { return true; } diff --git a/Marlin/src/HAL/HAL_DUE/pinsDebug.h b/Marlin/src/HAL/HAL_DUE/pinsDebug.h index 23677960f010..ed78f8adbb6b 100644 --- a/Marlin/src/HAL/HAL_DUE/pinsDebug.h +++ b/Marlin/src/HAL/HAL_DUE/pinsDebug.h @@ -62,9 +62,8 @@ #define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin #define PRINT_PORT(p) -#define NAME_FORMAT(p) PSTR("%-##p##s") -#define PRINT_ARRAY_NAME(x) do {sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer);} while (0) -#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer);} while (0) +#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) +#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0) #define GET_ARRAY_PIN(p) pin_array[p].pin #define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital #define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0) diff --git a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp b/Marlin/src/HAL/HAL_DUE/timers.cpp similarity index 70% rename from Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp rename to Marlin/src/HAL/HAL_DUE/timers.cpp index df51c22d6016..6925f93498bb 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/timers.cpp @@ -28,42 +28,29 @@ #ifdef ARDUINO_ARCH_SAM -// -------------------------------------------------------------------------- +// ------------------------ // Includes -// -------------------------------------------------------------------------- +// ------------------------ #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "HAL_timers_Due.h" +#include "timers.h" -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Local defines -// -------------------------------------------------------------------------- +// ------------------------ #define NUM_HARDWARE_TIMERS 9 -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Private Variables -// -------------------------------------------------------------------------- +// ------------------------ const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = { { TC0, 0, TC0_IRQn, 3}, // 0 - [servo timer5] { TC0, 1, TC1_IRQn, 0}, // 1 { TC0, 2, TC2_IRQn, 2}, // 2 - stepper - { TC1, 0, TC3_IRQn, 0}, // 3 + { TC1, 0, TC3_IRQn, 0}, // 3 - stepper for BOARD_ARCHIM1 { TC1, 1, TC4_IRQn, 15}, // 4 - temperature { TC1, 2, TC5_IRQn, 3}, // 5 - [servo timer3] { TC2, 0, TC6_IRQn, 14}, // 6 - tone @@ -71,17 +58,9 @@ const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = { { TC2, 2, TC8_IRQn, 0}, // 8 }; -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ /* Timer_clock1: Prescaler 2 -> 42MHz diff --git a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h b/Marlin/src/HAL/HAL_DUE/timers.h similarity index 82% rename from Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h rename to Marlin/src/HAL/HAL_DUE/timers.h index 2c758f3a1195..b7b2cf7341e0 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h +++ b/Marlin/src/HAL/HAL_DUE/timers.h @@ -26,15 +26,11 @@ * For ARDUINO_ARCH_SAM */ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define FORCE_INLINE __attribute__((always_inline)) inline @@ -43,7 +39,9 @@ typedef uint32_t hal_timer_t; #define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals +#ifndef STEP_TIMER_NUM #define STEP_TIMER_NUM 2 // index of timer to use for stepper +#endif #define TEMP_TIMER_NUM 4 // index of timer to use for temperature #define PULSE_TIMER_NUM STEP_TIMER_NUM #define TONE_TIMER_NUM 6 // index of timer to use for beeper tones @@ -65,13 +63,15 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() void TC2_Handler() +#ifndef HAL_STEP_TIMER_ISR + #define HAL_STEP_TIMER_ISR() void TC2_Handler() +#endif #define HAL_TEMP_TIMER_ISR() void TC4_Handler() #define HAL_TONE_TIMER_ISR() void TC6_Handler() -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ typedef struct { Tc *pTimerRegs; @@ -80,15 +80,15 @@ typedef struct { uint8_t priority; } tTimerConfig; -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ extern const tTimerConfig TimerConfig[]; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/HAL_DUE/usb/compiler.h b/Marlin/src/HAL/HAL_DUE/usb/compiler.h index d9ecd3f0fef9..33df080e2f89 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/compiler.h +++ b/Marlin/src/HAL/HAL_DUE/usb/compiler.h @@ -112,7 +112,7 @@ * \def unused * \brief Marking \a v as a unused parameter or value. */ -#define unused(v) do { (void)(v); } while(0) +#define unused(v) do { (void)(v); }while(0) /** * \def barrier @@ -169,7 +169,7 @@ * heuristics and inline the function no matter how big it thinks it * becomes. */ -#if defined(__CC_ARM) +#ifdef __CC_ARM # define __always_inline __forceinline #elif (defined __GNUC__) #ifdef __always_inline @@ -187,7 +187,7 @@ * This annotation instructs the compiler to ignore its inlining * heuristics and not inline the function. */ -#if defined(__CC_ARM) +#ifdef __CC_ARM # define __no_inline __attribute__((noinline)) #elif (defined __GNUC__) # define __no_inline __attribute__((__noinline__)) @@ -204,7 +204,7 @@ * * \param expr Expression to evaluate and supposed to be nonzero. */ -#if defined(_ASSERT_ENABLE_) +#ifdef _ASSERT_ENABLE_ # if defined(TEST_SUITE_DEFINE_ASSERT_MACRO) // Assert() is defined in unit_test/suite.h # include "unit_test/suite.h" @@ -230,7 +230,7 @@ /* Define NO_INIT attribute */ #if 0 //ndef NO_INIT -#if defined ( __CC_ARM ) +#ifdef __CC_ARM # define NO_INIT __attribute__((zero_init)) #elif defined ( __ICCARM__ ) # define NO_INIT __no_init @@ -262,7 +262,7 @@ //! @{ typedef unsigned char Bool; //!< Boolean. #ifndef __cplusplus -#if !defined(__bool_true_false_are_defined) +#ifndef __bool_true_false_are_defined typedef unsigned char bool; //!< Boolean. #endif #endif @@ -443,9 +443,9 @@ typedef struct #define DISABLE 0 #define ENABLE 1 #ifndef __cplusplus -#if !defined(__bool_true_false_are_defined) -#define false 0 -#define true 1 +#ifndef __bool_true_false_are_defined +#define false (1==0) +#define true (1==1) #endif #endif #ifndef PASS @@ -998,14 +998,14 @@ typedef U8 Byte; //!< 8-bit unsigned integer. #endif // #ifndef __ASSEMBLY__ -#if defined(__ICCARM__) +#ifdef __ICCARM__ #define SHORTENUM __packed #elif defined(__GNUC__) #define SHORTENUM __attribute__((packed)) #endif /* No operation */ -#if defined(__ICCARM__) +#ifdef __ICCARM__ #define nop() __no_operation() #elif defined(__GNUC__) #define nop() (__NOP()) diff --git a/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h b/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h index 6934494e57de..8d5924d375e8 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h @@ -48,9 +48,7 @@ #define _CONF_USB_H_ #undef UNUSED /* To avoid a macro clash as macros.h already defines it */ -#include "../../../core/macros.h" /* For ENABLED()/DISABLED() */ -#include "../../../core/boards.h" /* For MB() */ -#include "../../../../Configuration.h" /* For CUSTOM_MACHINE_NAME definition - We just need the name, no C++ allowed! */ +#include "../../../inc/MarlinConfigPre.h" #include "compiler.h" /** @@ -59,8 +57,6 @@ */ //! Device definition (mandatory) -#define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */ -#define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */ #define USB_DEVICE_MAJOR_VERSION 1 #define USB_DEVICE_MINOR_VERSION 0 #define USB_DEVICE_POWER 100 // Consumption on Vbus line (mA) @@ -70,15 +66,6 @@ // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED) // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) -//! USB Device string definitions (Optional) -#define USB_DEVICE_MANUFACTURE_NAME "marlinfw.org" -#ifdef CUSTOM_MACHINE_NAME - #define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME -#else - #define USB_DEVICE_PRODUCT_NAME "3D Printer" -#endif -#define USB_DEVICE_SERIAL_NAME "123985739853" - /** * Device speeds support * Low speed not supported by CDC and MSC diff --git a/Marlin/src/HAL/HAL_DUE/usb/osc.h b/Marlin/src/HAL/HAL_DUE/usb/osc.h index fe09d6fd3eec..3a9543507bb8 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/osc.h +++ b/Marlin/src/HAL/HAL_DUE/usb/osc.h @@ -61,27 +61,27 @@ extern "C" { * Below BOARD_XXX macros are related to the specific board, and * should be defined by the board code, otherwise default value are used. */ -#if !defined(BOARD_FREQ_SLCK_XTAL) +#ifndef BOARD_FREQ_SLCK_XTAL # warning The board slow clock xtal frequency has not been defined. # define BOARD_FREQ_SLCK_XTAL (32768UL) #endif -#if !defined(BOARD_FREQ_SLCK_BYPASS) +#ifndef BOARD_FREQ_SLCK_BYPASS # warning The board slow clock bypass frequency has not been defined. # define BOARD_FREQ_SLCK_BYPASS (32768UL) #endif -#if !defined(BOARD_FREQ_MAINCK_XTAL) +#ifndef BOARD_FREQ_MAINCK_XTAL # warning The board main clock xtal frequency has not been defined. # define BOARD_FREQ_MAINCK_XTAL (12000000UL) #endif -#if !defined(BOARD_FREQ_MAINCK_BYPASS) +#ifndef BOARD_FREQ_MAINCK_BYPASS # warning The board main clock bypass frequency has not been defined. # define BOARD_FREQ_MAINCK_BYPASS (12000000UL) #endif -#if !defined(BOARD_OSC_STARTUP_US) +#ifndef BOARD_OSC_STARTUP_US # warning The board main clock xtal startup time has not been defined. # define BOARD_OSC_STARTUP_US (15625UL) #endif diff --git a/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp index 6f777d8f9e85..ea2936359d81 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp @@ -15,11 +15,14 @@ extern "C" { #define SD_MMC_BLOCK_SIZE 512 -void sd_mmc_spi_mem_init(void) { +void sd_mmc_spi_mem_init() { } -Ctrl_status sd_mmc_spi_test_unit_ready(void) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) +Ctrl_status sd_mmc_spi_test_unit_ready() { + #ifdef DISABLE_DUE_SD_MMC + return CTRL_NO_PRESENT; + #endif + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return CTRL_NO_PRESENT; return CTRL_GOOD; } @@ -27,25 +30,18 @@ Ctrl_status sd_mmc_spi_test_unit_ready(void) { // NOTE: This function is defined as returning the address of the last block // in the card, which is cardSize() - 1 Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return CTRL_NO_PRESENT; *nb_sector = card.getSd2Card().cardSize() - 1; return CTRL_GOOD; } -bool sd_mmc_spi_unload(bool unload) { - UNUSED(unload); - return true; -} +bool sd_mmc_spi_unload(bool) { return true; } -bool sd_mmc_spi_wr_protect(void) { - return false; -} +bool sd_mmc_spi_wr_protect() { return false; } -bool sd_mmc_spi_removal(void) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) - return true; - return false; +bool sd_mmc_spi_removal() { + return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()); } #if ACCESS_USB == true @@ -62,7 +58,10 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE]; // #define DEBUG_MMC Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) + #ifdef DISABLE_DUE_SD_MMC + return CTRL_NO_PRESENT; + #endif + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC @@ -99,7 +98,10 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { } Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) + #ifdef DISABLE_DUE_SD_MMC + return CTRL_NO_PRESENT; + #endif + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC diff --git a/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h b/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h index e5e7603c9a9e..6fadb9f36caa 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h +++ b/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h @@ -43,12 +43,12 @@ * \asf_license_stop * */ + /* * Support and FAQ: visit Atmel Support */ -#ifndef _SPC_PROTOCOL_H_ -#define _SPC_PROTOCOL_H_ - +#ifndef _SPC_PROTOCOL_H_ +#define _SPC_PROTOCOL_H_ /** * \ingroup usb_msc_protocol diff --git a/Marlin/src/HAL/HAL_DUE/usb/udd.h b/Marlin/src/HAL/HAL_DUE/usb/udd.h index 10807f43d79e..c87763de23fa 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udd.h +++ b/Marlin/src/HAL/HAL_DUE/usb/udd.h @@ -94,11 +94,11 @@ typedef struct { uint16_t payload_size; //! Callback called after reception of ZLP from setup request - void (*callback) (void); + void (*callback)(void); //! Callback called when the buffer given (.payload) is full or empty. //! This one return false to abort data transfer, or true with a new buffer in .payload. - bool(*over_under_run) (void); + bool (*over_under_run)(void); } udd_ctrl_request_t; extern udd_ctrl_request_t udd_g_ctrlreq; @@ -123,7 +123,7 @@ extern udd_ctrl_request_t udd_g_ctrlreq; * Registered by routine udd_ep_wait_stall_clear() * Callback called when endpoint stall is cleared. */ -typedef void (*udd_callback_halt_cleared_t) (void); +typedef void (*udd_callback_halt_cleared_t)(void); /** * \brief End of transfer callback function type. diff --git a/Marlin/src/HAL/HAL_DUE/usb/udi.h b/Marlin/src/HAL/HAL_DUE/usb/udi.h index 1fc7ae5d01a4..709908cad947 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udi.h +++ b/Marlin/src/HAL/HAL_DUE/usb/udi.h @@ -82,7 +82,7 @@ typedef struct { * * \return \c 1 if function was successfully done, otherwise \c 0. */ - bool(*enable) (void); + bool (*enable)(void); /** * \brief Disable the interface. @@ -95,7 +95,7 @@ typedef struct { * - the device is detached from the host (i.e. Vbus is no * longer present) */ - void (*disable) (void); + void (*disable)(void); /** * \brief Handle a control request directed at an interface. @@ -108,7 +108,7 @@ typedef struct { * * \return \c 1 if this interface supports the SETUP request, otherwise \c 0. */ - bool(*setup) (void); + bool (*setup)(void); /** * \brief Returns the current setting of the selected interface. @@ -117,12 +117,12 @@ typedef struct { * * \return alternate setting of selected interface */ - uint8_t(*getsetting) (void); + uint8_t (*getsetting)(void); /** * \brief To signal that a SOF is occurred */ - void(*sof_notify) (void); + void (*sof_notify)(void); } udi_api_t; //@} diff --git a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c index e54ee570fa4b..60c9546ce236 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c +++ b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c @@ -458,7 +458,7 @@ void udi_cdc_data_sof_notify(void) } -//------------------------------------------------- +// ------------------------ //------- Internal routines to control serial line static uint8_t udi_cdc_setup_to_port(void) @@ -579,7 +579,7 @@ static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, } -//------------------------------------------------- +// ------------------------ //------- Internal routines to process data transfer @@ -781,7 +781,7 @@ static void udi_cdc_tx_send(uint8_t port) } -//--------------------------------------------- +// ------------------------ //------- Application interface diff --git a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h index 45c5cef5ae58..526419c86002 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h +++ b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h @@ -55,7 +55,7 @@ #include "udi.h" // Check the number of port -#ifndef UDI_CDC_PORT_NB +#ifndef UDI_CDC_PORT_NB # define UDI_CDC_PORT_NB 1 #endif #if (UDI_CDC_PORT_NB < 1) || (UDI_CDC_PORT_NB > 7) diff --git a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h index b99d6111713a..cbd3eb00ae71 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h +++ b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h @@ -50,7 +50,7 @@ #include "usb_protocol_cdc.h" #include "conf_usb.h" -#ifndef UDI_CDC_PORT_NB +#ifndef UDI_CDC_PORT_NB # define UDI_CDC_PORT_NB 1 #endif diff --git a/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c b/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c index 97d3f2990b96..627bca0d4f5a 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c +++ b/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c @@ -457,7 +457,7 @@ uint8_t udi_msc_getsetting(void) } -//--------------------------------------------- +// ------------------------ //------- Routines to process CBW packet static void udi_msc_cbw_invalid(void) @@ -613,7 +613,7 @@ static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag) } -//--------------------------------------------- +// ------------------------ //------- Routines to process small data packet static void udi_msc_data_send(uint8_t * buffer, uint8_t buf_size) @@ -645,7 +645,7 @@ static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent, } -//--------------------------------------------- +// ------------------------ //------- Routines to process CSW packet static void udi_msc_csw_process(void) @@ -691,7 +691,7 @@ static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent, } -//--------------------------------------------- +// ------------------------ //------- Routines manage sense data static void udi_msc_clear_sense(void) @@ -757,7 +757,7 @@ static void udi_msc_sense_command_invalid(void) } -//--------------------------------------------- +// ------------------------ //------- Routines manage SCSI Commands static void udi_msc_spc_requestsense(void) diff --git a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c index 6512abffb553..9bac29276c75 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c +++ b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c @@ -40,6 +40,7 @@ * \asf_license_stop * */ + /* * Support and FAQ: visit Atmel Support */ @@ -505,7 +506,7 @@ static bool udd_ep_interrupt(void); //@} -//-------------------------------------------------------- +// ------------------------ //--- INTERNAL ROUTINES TO MANAGED GLOBAL EVENTS /** @@ -1306,7 +1307,7 @@ void udd_test_mode_packet(void) -//-------------------------------------------------------- +// ------------------------ //--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT static void udd_reset_ep_ctrl(void) @@ -1728,7 +1729,7 @@ static bool udd_ctrl_interrupt(void) } -//-------------------------------------------------------- +// ------------------------ //--- INTERNAL ROUTINES TO MANAGED THE BULK/INTERRUPT/ISOCHRONOUS ENDPOINTS #if (0 != USB_DEVICE_MAX_EP) @@ -1904,7 +1905,7 @@ static void udd_ep_in_sent(udd_ep_id_t ep) ptr_src = &ptr_job->buf[ptr_job->buf_cnt]; nb_remain = ptr_job->buf_size - ptr_job->buf_cnt; // Fill a bank even if no data (ZLP) - nb_data = _MIN(nb_remain, pkt_size); + nb_data = min(nb_remain, pkt_size); // Modify job information ptr_job->buf_cnt += nb_data; ptr_job->buf_load = nb_data; diff --git a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h index 9e1793f9ba0b..97877994bf66 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h +++ b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h @@ -291,7 +291,7 @@ extern "C" { //! available greater size, then applies register format of UOTGHS controller //! for endpoint size bit-field. #undef udd_format_endpoint_size -#define udd_format_endpoint_size(size) (32 - clz(((uint32_t)_MIN(_MAX(size, 8), 1024) << 1) - 1) - 1 - 3) +#define udd_format_endpoint_size(size) (32 - clz(((uint32_t)min(max(size, 8), 1024) << 1) - 1) - 1 - 3) //! Configures the selected endpoint size #define udd_configure_endpoint_size(ep, size) (Wr_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTCFG[0], ep), UOTGHS_DEVEPTCFG_EPSIZE_Msk, udd_format_endpoint_size(size))) //! Gets the configured selected endpoint size diff --git a/Marlin/src/HAL/HAL_DUE/usb/usb_task.c b/Marlin/src/HAL/HAL_DUE/usb/usb_task.c index b735858018df..29d02faef703 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/usb_task.c +++ b/Marlin/src/HAL/HAL_DUE/usb/usb_task.c @@ -45,11 +45,12 @@ #ifdef ARDUINO_ARCH_SAM -#include "conf_usb.h" -#include "udc.h" #include #include +#include "conf_usb.h" +#include "udc.h" + #if ENABLED(SDSUPPORT) static volatile bool main_b_msc_enable = false; #endif diff --git a/Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp b/Marlin/src/HAL/HAL_DUE/watchdog.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp rename to Marlin/src/HAL/HAL_DUE/watchdog.cpp index f1df75eaa6f5..1f51b75c18e1 100644 --- a/Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/watchdog.cpp @@ -24,7 +24,7 @@ #include "../../inc/MarlinConfig.h" #include "../../Marlin.h" -#include "watchdog_Due.h" +#include "watchdog.h" // Override Arduino runtime to either config or disable the watchdog // @@ -32,7 +32,7 @@ // process, because watchdog initialization at hardware reset on SAM3X8E // is unreliable, and there is risk of unintended resets if we delay // that initialization to a later time. -void watchdogSetup(void) { +void watchdogSetup() { #if ENABLED(USE_WATCHDOG) @@ -106,7 +106,7 @@ void watchdogSetup(void) { // Initialize watchdog - On SAM3X, Watchdog was already configured // and enabled or disabled at startup, so no need to reconfigure it // here. - void watchdog_init(void) { + void watchdog_init() { // Reset watchdog to start clean WDT_Restart(WDT); } diff --git a/Marlin/src/HAL/HAL_DUE/watchdog_Due.h b/Marlin/src/HAL/HAL_DUE/watchdog.h similarity index 95% rename from Marlin/src/HAL/HAL_DUE/watchdog_Due.h rename to Marlin/src/HAL/HAL_DUE/watchdog.h index 14832a9c3cdf..6e70adef81a4 100644 --- a/Marlin/src/HAL/HAL_DUE/watchdog_Due.h +++ b/Marlin/src/HAL/HAL_DUE/watchdog.h @@ -30,4 +30,4 @@ void watchdog_init(); // Reset watchdog. MUST be called at least every 4 seconds after the // first watchdog_init or AVR will go into emergency procedures. -inline void watchdog_reset() { watchdogReset(); } +inline void HAL_watchdog_refresh() { watchdogReset(); } diff --git a/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h b/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h index 66bdbd7aaea0..9fca4fcbea39 100644 --- a/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h +++ b/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h @@ -29,7 +29,7 @@ class FlushableHardwareSerial : public HardwareSerial { public: FlushableHardwareSerial(int uart_nr); - inline void flushTX(void) { /* No need to flush the hardware serial, but defined here for compatibility. */ } + inline void flushTX() { /* No need to flush the hardware serial, but defined here for compatibility. */ } }; extern FlushableHardwareSerial flushableSerial; diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.cpp b/Marlin/src/HAL/HAL_ESP32/HAL.cpp index 299aee46fe37..81567eeede8f 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.cpp +++ b/Marlin/src/HAL/HAL_ESP32/HAL.cpp @@ -22,11 +22,8 @@ #ifdef ARDUINO_ARCH_ESP32 -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "HAL.h" +#include "timers.h" #include #include #include @@ -48,55 +45,44 @@ #endif #endif -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- +// ------------------------ +// Externs +// ------------------------ portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; -// -------------------------------------------------------------------------- +// ------------------------ // Local defines -// -------------------------------------------------------------------------- +// ------------------------ #define V_REF 1100 -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ uint16_t HAL_adc_result; -// -------------------------------------------------------------------------- +// ------------------------ // Private Variables -// -------------------------------------------------------------------------- +// ------------------------ -esp_adc_cal_characteristics_t characteristics; +esp_adc_cal_characteristics_t characteristics[ADC_ATTEN_MAX]; +adc_atten_t attenuations[ADC1_CHANNEL_MAX] = {}; +uint32_t thresholds[ADC_ATTEN_MAX]; +volatile int numPWMUsed = 0, + pwmPins[MAX_PWM_PINS], + pwmValues[MAX_PWM_PINS]; -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ -void HAL_init(void) { +void HAL_init() { i2s_init(); } -void HAL_init_board(void) { +void HAL_init_board() { #if EITHER(EEPROM_SETTINGS, WEBSUPPORT) spiffs_init(); #endif @@ -113,24 +99,24 @@ void HAL_init_board(void) { #endif } -void HAL_idletask(void) { +void HAL_idletask() { #if ENABLED(OTASUPPORT) OTA_handle(); #endif } -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } -uint8_t HAL_get_reset_source(void) { return rtc_get_reset_reason(1); } +uint8_t HAL_get_reset_source() { return rtc_get_reset_reason(1); } void _delay_ms(int delay_ms) { delay(delay_ms); } // return free memory between end of heap (or end bss) and whatever is current int freeMemory() { return ESP.getFreeHeap(); } -// -------------------------------------------------------------------------- +// ------------------------ // ADC -// -------------------------------------------------------------------------- +// ------------------------ #define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL adc1_channel_t get_channel(int pin) { @@ -145,68 +131,134 @@ adc1_channel_t get_channel(int pin) { return ADC1_CHANNEL_MAX; } +void adc1_set_attenuation(adc1_channel_t chan, adc_atten_t atten) { + if (attenuations[chan] != atten) { + adc1_config_channel_atten(chan, atten); + attenuations[chan] = atten; + } +} + void HAL_adc_init() { // Configure ADC adc1_config_width(ADC_WIDTH_12Bit); // Configure channels only if used as (re-)configuring a pin for ADC that is used elsewhere might have adverse effects #if HAS_TEMP_ADC_0 - adc1_config_channel_atten(get_channel(TEMP_0_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db); #endif #if HAS_TEMP_ADC_1 - adc1_config_channel_atten(get_channel(TEMP_1_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db); #endif #if HAS_TEMP_ADC_2 - adc1_config_channel_atten(get_channel(TEMP_2_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db); #endif #if HAS_TEMP_ADC_3 - adc1_config_channel_atten(get_channel(TEMP_3_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db); #endif #if HAS_TEMP_ADC_4 - adc1_config_channel_atten(get_channel(TEMP_4_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db); #endif #if HAS_TEMP_ADC_5 - adc1_config_channel_atten(get_channel(TEMP_5_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db); #endif #if HAS_HEATED_BED - adc1_config_channel_atten(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db); #endif #if HAS_TEMP_CHAMBER - adc1_config_channel_atten(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db); #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - adc1_config_channel_atten(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db); + adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db); #endif // Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail. // That's why we're not setting it up here. - // Calculate ADC characteristics i.e. gain and offset factors - esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, ADC_WIDTH_BIT_12, V_REF, &characteristics); + // Calculate ADC characteristics (i.e., gain and offset factors for each attenuation level) + for (int i = 0; i < ADC_ATTEN_MAX; i++) { + esp_adc_cal_characterize(ADC_UNIT_1, (adc_atten_t)i, ADC_WIDTH_BIT_12, V_REF, &characteristics[i]); + + // Change attenuation 100mV below the calibrated threshold + thresholds[i] = esp_adc_cal_raw_to_voltage(4095, &characteristics[i]); + } } void HAL_adc_start_conversion(uint8_t adc_pin) { + const adc1_channel_t chan = get_channel(adc_pin); uint32_t mv; - esp_adc_cal_get_voltage((adc_channel_t)get_channel(adc_pin), &characteristics, &mv); - - HAL_adc_result = mv*1023.0/3300.0; + esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv); + HAL_adc_result = mv * 1023.0 / 3300.0; + + // Change the attenuation level based on the new reading + adc_atten_t atten; + if (mv < thresholds[ADC_ATTEN_DB_0] - 100) + atten = ADC_ATTEN_DB_0; + else if (mv > thresholds[ADC_ATTEN_DB_0] - 50 && mv < thresholds[ADC_ATTEN_DB_2_5] - 100) + atten = ADC_ATTEN_DB_2_5; + else if (mv > thresholds[ADC_ATTEN_DB_2_5] - 50 && mv < thresholds[ADC_ATTEN_DB_6] - 100) + atten = ADC_ATTEN_DB_6; + else if (mv > thresholds[ADC_ATTEN_DB_6] - 50) + atten = ADC_ATTEN_DB_11; + else return; + + adc1_set_attenuation(chan, atten); } void analogWrite(pin_t pin, int value) { + // Use ledc hardware for internal pins + if (pin < 34) { + static int cnt_channel = 1, pin_to_channel[40] = { 0 }; + if (pin_to_channel[pin] == 0) { + ledcAttachPin(pin, cnt_channel); + ledcSetup(cnt_channel, 490, 8); + ledcWrite(cnt_channel, value); + pin_to_channel[pin] = cnt_channel++; + } + ledcWrite(pin_to_channel[pin], value); + return; + } + + int idx = -1; + + // Search Pin + for (int i = 0; i < numPWMUsed; ++i) + if (pwmPins[i] == pin) { idx = i; break; } + + // not found ? + if (idx < 0) { + // No slots remaining + if (numPWMUsed >= MAX_PWM_PINS) return; + + // Take new slot for pin + idx = numPWMUsed; + pwmPins[idx] = pin; + // Start timer on first use + if (idx == 0) HAL_timer_start(PWM_TIMER_NUM, PWM_TIMER_FREQUENCY); - if (!PWM_PIN(pin)) return; + ++numPWMUsed; + } + + // Use 7bit internal value - add 1 to have 100% high at 255 + pwmValues[idx] = (value + 1) / 2; +} - static int cnt_channel = 1, - pin_to_channel[40] = {}; - if (pin_to_channel[pin] == 0) { - ledcAttachPin(pin, cnt_channel); - ledcSetup(cnt_channel, 490, 8); - ledcWrite(cnt_channel, value); +// Handle PWM timer interrupt +HAL_PWM_TIMER_ISR() { + HAL_timer_isr_prologue(PWM_TIMER_NUM); - pin_to_channel[pin] = cnt_channel++; + static uint8_t count = 0; + + for (int i = 0; i < numPWMUsed; ++i) { + if (count == 0) // Start of interval + WRITE(pwmPins[i], pwmValues[i] ? HIGH : LOW); + else if (pwmValues[i] == count) // End of duration + WRITE(pwmPins[i], LOW); } - ledcWrite(pin_to_channel[pin], value); + // 128 for 7 Bit resolution + count = (count + 1) & 0x7F; + + HAL_timer_isr_epilogue(PWM_TIMER_NUM); } #endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.h b/Marlin/src/HAL/HAL_ESP32/HAL.h index 0fc1d71bc40c..df9a5648c8bd 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.h +++ b/Marlin/src/HAL/HAL_ESP32/HAL.h @@ -24,28 +24,24 @@ #define CPU_32_BIT -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_ESP32.h" -#include "watchdog_ESP32.h" +#include "fastio.h" +#include "watchdog.h" #include "i2s.h" -#include "HAL_timers_ESP32.h" +#include "timers.h" #include "WebSocketSerial.h" #include "FlushableHardwareSerial.h" -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ extern portMUX_TYPE spinlock; @@ -69,34 +65,37 @@ extern portMUX_TYPE spinlock; #undef pgm_read_ptr #define pgm_read_ptr(addr) (*(addr)) -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ typedef int16_t pin_t; #define HAL_SERVO_LIB Servo -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ /** result of last ADC conversion */ extern uint16_t HAL_adc_result; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ // clear reset reason -void HAL_clear_reset_source (void); +void HAL_clear_reset_source(); // reset reason -uint8_t HAL_get_reset_source(void); +uint8_t HAL_get_reset_source(); void _delay_ms(int delay); -int freeMemory(void); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +int freeMemory(); +#pragma GCC diagnostic pop void analogWrite(pin_t pin, int value); @@ -109,9 +108,10 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); // ADC #define HAL_ANALOG_SELECT(pin) -void HAL_adc_init(void); +void HAL_adc_init(); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true @@ -124,6 +124,6 @@ void HAL_adc_start_conversion(uint8_t adc_pin); // Enable hooks into idle and setup for HAL #define HAL_IDLETASK 1 #define BOARD_INIT() HAL_init_board(); -void HAL_idletask(void); -void HAL_init(void); -void HAL_init_board(void); +void HAL_idletask(); +void HAL_init(); +void HAL_init_board(); diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp b/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp similarity index 77% rename from Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp rename to Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp index 67d7e25972a1..eba880b4fdfe 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp +++ b/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp @@ -23,39 +23,36 @@ #ifdef ARDUINO_ARCH_ESP32 -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "HAL.h" #include "../shared/HAL_SPI.h" #include #include "spi_pins.h" -#include "../../core/macros.h" #include -// -------------------------------------------------------------------------- +#include "../../core/macros.h" + +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ static SPISettings spiConfig; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ #if ENABLED(SOFTWARE_SPI) - // -------------------------------------------------------------------------- + // ------------------------ // Software SPI - // -------------------------------------------------------------------------- + // ------------------------ #error "Software SPI not supported for ESP32. Use Hardware SPI." #else -// -------------------------------------------------------------------------- +// ------------------------ // Hardware SPI -// -------------------------------------------------------------------------- +// ------------------------ void spiBegin() { #if !PIN_EXISTS(SS) @@ -83,7 +80,7 @@ void spiInit(uint8_t spiRate) { SPI.begin(); } -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.cpp b/Marlin/src/HAL/HAL_ESP32/Servo.cpp similarity index 70% rename from Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.cpp rename to Marlin/src/HAL/HAL_ESP32/Servo.cpp index e702539ca92d..3c3b8fa704bf 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.cpp +++ b/Marlin/src/HAL/HAL_ESP32/Servo.cpp @@ -25,32 +25,32 @@ #if HAS_SERVOS -#include "HAL_Servo_ESP32.h" +#include "Servo.h" // Adjacent channels (0/1, 2/3 etc.) share the same timer and therefore the same frequency and resolution settings on ESP32, // so we only allocate servo channels up high to avoid side effects with regards to analogWrite (fans, leds, laser pwm etc.) int Servo::channel_next_free = 12; Servo::Servo() { - this->channel = channel_next_free++; + channel = channel_next_free++; } -int8_t Servo::attach(const int pin) { - if (this->channel >= CHANNEL_MAX_NUM) return -1; - if (pin > 0) this->pin = pin; +int8_t Servo::attach(const int inPin) { + if (channel >= CHANNEL_MAX_NUM) return -1; + if (pin > 0) pin = inPin; - ledcSetup(this->channel, 50, 16); // channel X, 50 Hz, 16-bit depth - ledcAttachPin(this->pin, this->channel); + ledcSetup(channel, 50, 16); // channel X, 50 Hz, 16-bit depth + ledcAttachPin(pin, channel); return true; } -void Servo::detach() { ledcDetachPin(this->pin); } +void Servo::detach() { ledcDetachPin(pin); } -int Servo::read() { return this->degrees; } +int Servo::read() { return degrees; } -void Servo::write(int degrees) { - this->degrees = constrain(degrees, MIN_ANGLE, MAX_ANGLE); - int us = map(this->degrees, MIN_ANGLE, MAX_ANGLE, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); +void Servo::write(int inDegrees) { + degrees = constrain(inDegrees, MIN_ANGLE, MAX_ANGLE); + int us = map(degrees, MIN_ANGLE, MAX_ANGLE, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); int duty = map(us, 0, TAU_USEC, 0, MAX_COMPARE); ledcWrite(channel, duty); } @@ -58,11 +58,11 @@ void Servo::write(int degrees) { void Servo::move(const 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->channel]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[channel]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.h b/Marlin/src/HAL/HAL_ESP32/Servo.h similarity index 100% rename from Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.h rename to Marlin/src/HAL/HAL_ESP32/Servo.h diff --git a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp index ce2692e2d200..9a38d3996a65 100644 --- a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp +++ b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp @@ -66,15 +66,15 @@ ring_buffer_pos_t RingBuffer::write(const uint8_t *buffer, ring_buffer_pos_t siz return written; } -int RingBuffer::available(void) { +int RingBuffer::available() { return (size - read_index + write_index) & (size - 1); } -int RingBuffer::peek(void) { +int RingBuffer::peek() { return available() ? data[read_index] : -1; } -int RingBuffer::read(void) { +int RingBuffer::read() { if (available()) { const int ret = data[read_index]; read_index = NEXT_INDEX(read_index, size); @@ -94,7 +94,7 @@ ring_buffer_pos_t RingBuffer::read(uint8_t *buffer) { return len; } -void RingBuffer::flush(void) { read_index = write_index; } +void RingBuffer::flush() { read_index = write_index; } // WebSocketSerial impl WebSocketSerial::WebSocketSerial() @@ -120,10 +120,10 @@ void WebSocketSerial::begin(const long baud_setting) { } void WebSocketSerial::end() { } -int WebSocketSerial::peek(void) { return rx_buffer.peek(); } -int WebSocketSerial::read(void) { return rx_buffer.read(); } -int WebSocketSerial::available(void) { return rx_buffer.available(); } -void WebSocketSerial::flush(void) { rx_buffer.flush(); } +int WebSocketSerial::peek() { return rx_buffer.peek(); } +int WebSocketSerial::read() { return rx_buffer.read(); } +int WebSocketSerial::available() { return rx_buffer.available(); } +void WebSocketSerial::flush() { rx_buffer.flush(); } size_t WebSocketSerial::write(const uint8_t c) { size_t ret = tx_buffer.write(c); @@ -145,7 +145,7 @@ size_t WebSocketSerial::write(const uint8_t* buffer, size_t size) { return written; } -void WebSocketSerial::flushTX(void) { +void WebSocketSerial::flushTX() { // No need to do anything as there's no benefit to sending partial lines over the websocket connection. } diff --git a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h index 6470f941d147..85436d151b7b 100644 --- a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h +++ b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h @@ -23,7 +23,7 @@ #include "../../inc/MarlinConfig.h" -#include "Stream.h" +#include #ifndef RX_BUFFER_SIZE #define RX_BUFFER_SIZE 128 @@ -45,11 +45,11 @@ class RingBuffer { RingBuffer(ring_buffer_pos_t size); ~RingBuffer(); - int available(void); - int peek(void); - int read(void); + int available(); + int peek(); + int read(); ring_buffer_pos_t read(uint8_t *buffer); - void flush(void); + void flush(); ring_buffer_pos_t write(const uint8_t c); ring_buffer_pos_t write(const uint8_t* buffer, ring_buffer_pos_t size); }; @@ -62,11 +62,11 @@ class WebSocketSerial: public Stream { WebSocketSerial(); void begin(const long); void end(); - int available(void); - int peek(void); - int read(void); - void flush(void); - void flushTX(void); + int available(); + int peek(); + int read(); + void flush(); + void flushTX(); size_t write(const uint8_t c); size_t write(const uint8_t* buffer, size_t size); diff --git a/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h b/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h index 9e5fc8a66510..31a3e4d6678f 100644 --- a/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h @@ -38,40 +38,41 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void ICACHE_RAM_ATTR endstop_ISR(void) { endstops.update(); } +void ICACHE_RAM_ATTR endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_ESP32/fastio_ESP32.h b/Marlin/src/HAL/HAL_ESP32/fastio.h similarity index 94% rename from Marlin/src/HAL/HAL_ESP32/fastio_ESP32.h rename to Marlin/src/HAL/HAL_ESP32/fastio.h index 364777409587..1641116b9023 100644 --- a/Marlin/src/HAL/HAL_ESP32/fastio_ESP32.h +++ b/Marlin/src/HAL/HAL_ESP32/fastio.h @@ -66,7 +66,7 @@ #define extDigitalWrite(IO,V) digitalWrite(IO,V) // PWM outputs -#define PWM_PIN(P) (P < 34) // NOTE Pins >= 34 are input only on ESP32, so they can't be used for output. +#define PWM_PIN(P) (P < 34 || P > 127) // NOTE Pins >= 34 are input only on ESP32, so they can't be used for output. // Toggle pin value #define TOGGLE(IO) WRITE(IO, !READ(IO)) diff --git a/Marlin/src/HAL/HAL_ESP32/i2s.cpp b/Marlin/src/HAL/HAL_ESP32/i2s.cpp index 557714f870f8..33a503455c82 100644 --- a/Marlin/src/HAL/HAL_ESP32/i2s.cpp +++ b/Marlin/src/HAL/HAL_ESP32/i2s.cpp @@ -26,10 +26,10 @@ #include "i2s.h" #include "../shared/Marduino.h" -#include "driver/periph_ctrl.h" -#include "rom/lldesc.h" -#include "soc/i2s_struct.h" -#include "freertos/queue.h" +#include +#include +#include +#include #include "../../module/stepper.h" #define DMA_BUF_COUNT 8 // number of DMA buffers to store data @@ -56,7 +56,7 @@ static i2s_dev_t* I2S[I2S_NUM_MAX] = {&I2S0, &I2S1}; static i2s_dma_t dma; // output value -uint32_t i2s_port_data; +uint32_t i2s_port_data = 0; #define I2S_ENTER_CRITICAL() portENTER_CRITICAL(&i2s_spinlock[i2s_num]) #define I2S_EXIT_CRITICAL() portEXIT_CRITICAL(&i2s_spinlock[i2s_num]) @@ -140,13 +140,13 @@ static void IRAM_ATTR i2s_intr_handler_default(void *arg) { } void stepperTask(void* parameter) { - uint32_t i, remaining = 0; + uint32_t remaining = 0; while (1) { xQueueReceive(dma.queue, &dma.current, portMAX_DELAY); dma.rw_pos = 0; - for (i = 0; i < DMA_SAMPLE_COUNT; i++) { + while (dma.rw_pos < DMA_SAMPLE_COUNT) { // Fill with the port data post pulse_phase until the next step if (remaining) { i2s_push_sample(); @@ -254,7 +254,13 @@ int i2s_init() { I2S0.fifo_conf.dscr_en = 0; - I2S0.conf_chan.tx_chan_mod = 0; + I2S0.conf_chan.tx_chan_mod = ( + #if ENABLED(I2S_STEPPER_SPLIT_STREAM) + 4 + #else + 0 + #endif + ); I2S0.fifo_conf.tx_fifo_mod = 0; I2S0.conf.tx_mono = 0; @@ -314,10 +320,19 @@ int i2s_init() { } void i2s_write(uint8_t pin, uint8_t val) { + #if ENABLED(I2S_STEPPER_SPLIT_STREAM) + if (pin >= 16) { + SET_BIT_TO(I2S0.conf_single_data, pin, val); + return; + } + #endif SET_BIT_TO(i2s_port_data, pin, val); } uint8_t i2s_state(uint8_t pin) { + #if ENABLED(I2S_STEPPER_SPLIT_STREAM) + if (pin >= 16) return TEST(I2S0.conf_single_data, pin); + #endif return TEST(i2s_port_data, pin); } diff --git a/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_ESP32/SanityCheck.h b/Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_ESP32/SanityCheck.h rename to Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_ESP32/ota.cpp b/Marlin/src/HAL/HAL_ESP32/ota.cpp index 98ea3b5eb7ea..377856f8d8b6 100644 --- a/Marlin/src/HAL/HAL_ESP32/ota.cpp +++ b/Marlin/src/HAL/HAL_ESP32/ota.cpp @@ -27,7 +27,7 @@ #include #include #include -#include "driver/timer.h" +#include void OTA_init() { ArduinoOTA diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.cpp b/Marlin/src/HAL/HAL_ESP32/timers.cpp similarity index 66% rename from Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.cpp rename to Marlin/src/HAL/HAL_ESP32/timers.cpp index fb95e36e2770..543889760e04 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.cpp +++ b/Marlin/src/HAL/HAL_ESP32/timers.cpp @@ -22,86 +22,61 @@ #ifdef ARDUINO_ARCH_ESP32 -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -#include "esp_types.h" -#include "soc/timer_group_struct.h" -#include "driver/periph_ctrl.h" -#include "driver/timer.h" +#include +#include +#include +#include #include "HAL.h" -#include "HAL_timers_ESP32.h" - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- +#include "timers.h" -// -------------------------------------------------------------------------- +// ------------------------ // Local defines -// -------------------------------------------------------------------------- +// ------------------------ #define NUM_HARDWARE_TIMERS 4 -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Private Variables -// -------------------------------------------------------------------------- +// ------------------------ static timg_dev_t *TG[2] = {&TIMERG0, &TIMERG1}; const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = { { TIMER_GROUP_0, TIMER_0, STEPPER_TIMER_PRESCALE, stepTC_Handler }, // 0 - Stepper { TIMER_GROUP_0, TIMER_1, TEMP_TIMER_PRESCALE, tempTC_Handler }, // 1 - Temperature - { TIMER_GROUP_1, TIMER_0, 1, nullptr }, // 2 + { TIMER_GROUP_1, TIMER_0, PWM_TIMER_PRESCALE, pwmTC_Handler }, // 2 - PWM { TIMER_GROUP_1, TIMER_1, 1, nullptr }, // 3 }; -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ -void IRAM_ATTR timer_group0_isr(void *para) { - const int timer_idx = (int)para; +void IRAM_ATTR timer_isr(void *para) { + const tTimerConfig& timer = TimerConfig[(int)para]; // Retrieve the interrupt status and the counter value // from the timer that reported the interrupt - uint32_t intr_status = TIMERG0.int_st_timers.val; - TIMERG0.hw_timer[timer_idx].update = 1; + uint32_t intr_status = TG[timer.group]->int_st_timers.val; + TG[timer.group]->hw_timer[timer.idx].update = 1; // Clear the interrupt - if (intr_status & BIT(timer_idx)) { - switch (timer_idx) { - case TIMER_0: TIMERG0.int_clr_timers.t0 = 1; break; - case TIMER_1: TIMERG0.int_clr_timers.t1 = 1; break; + if (intr_status & BIT(timer.idx)) { + switch (timer.idx) { + case TIMER_0: TG[timer.group]->int_clr_timers.t0 = 1; break; + case TIMER_1: TG[timer.group]->int_clr_timers.t1 = 1; break; + case TIMER_MAX: break; } } - const tTimerConfig timer = TimerConfig[timer_idx]; timer.fn(); // After the alarm has been triggered // Enable it again so it gets triggered the next time - TIMERG0.hw_timer[timer_idx].config.alarm_en = TIMER_ALARM_EN; + TG[timer.group]->hw_timer[timer.idx].config.alarm_en = TIMER_ALARM_EN; } /** @@ -131,8 +106,7 @@ void HAL_timer_start(const uint8_t timer_num, uint32_t frequency) { timer_enable_intr(timer.group, timer.idx); - // TODO need to deal with timer_group1_isr - timer_isr_register(timer.group, timer.idx, timer_group0_isr, (void*)timer.idx, 0, nullptr); + timer_isr_register(timer.group, timer.idx, timer_isr, (void*)timer_num, 0, nullptr); timer_start(timer.group, timer.idx); } diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.h b/Marlin/src/HAL/HAL_ESP32/timers.h similarity index 74% rename from Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.h rename to Marlin/src/HAL/HAL_ESP32/timers.h index 1a05c04a084f..e6e3495bea7b 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.h +++ b/Marlin/src/HAL/HAL_ESP32/timers.h @@ -21,21 +21,17 @@ */ #pragma once -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -#include "driver/timer.h" +#include // Includes needed to get I2S_STEPPER_STREAM. Note that pins.h // is included in case this header is being included early. #include "../../inc/MarlinConfig.h" #include "../../pins/pins.h" -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ // #define FORCE_INLINE __attribute__((always_inline)) inline @@ -44,6 +40,7 @@ typedef uint64_t hal_timer_t; #define STEP_TIMER_NUM 0 // index of timer to use for stepper #define TEMP_TIMER_NUM 1 // index of timer to use for temperature +#define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs #define PULSE_TIMER_NUM STEP_TIMER_NUM #define HAL_TIMER_RATE APB_CLK_FREQ // frequency of timer peripherals @@ -54,8 +51,8 @@ typedef uint64_t hal_timer_t; #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs // wrong would be 0.25 #else #define STEPPER_TIMER_PRESCALE 40 - #define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // frequency of stepper timer, 2MHz - #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs + #define STEPPER_TIMER_RATE ((HAL_TIMER_RATE) / (STEPPER_TIMER_PRESCALE)) // frequency of stepper timer, 2MHz + #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs #endif #define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts @@ -63,6 +60,14 @@ typedef uint64_t hal_timer_t; #define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency +#define PWM_TIMER_PRESCALE 10 +#if ENABLED(FAST_PWM_FAN) + #define PWM_TIMER_FREQUENCY FAST_PWM_FAN_FREQUENCY +#else + #define PWM_TIMER_FREQUENCY (50*128) // 50Hz and 7bit resolution +#endif +#define MAX_PWM_PINS 32 // Number of PWM pin-slots + #define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer #define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE #define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US @@ -74,33 +79,34 @@ typedef uint64_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void) -#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void) - -extern "C" void tempTC_Handler(void); -extern "C" void stepTC_Handler(void); +#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() +#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() +#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler() +extern "C" void tempTC_Handler(); +extern "C" void stepTC_Handler(); +extern "C" void pwmTC_Handler(); -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ typedef struct { timer_group_t group; timer_idx_t idx; uint32_t divider; - void (*fn)(void); + void (*fn)(); } tTimerConfig; -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ extern const tTimerConfig TimerConfig[]; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ void HAL_timer_start (const uint8_t timer_num, uint32_t frequency); void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t count); diff --git a/Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.cpp b/Marlin/src/HAL/HAL_ESP32/watchdog.cpp similarity index 92% rename from Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.cpp rename to Marlin/src/HAL/HAL_ESP32/watchdog.cpp index cbd5d989cd3f..d05e67c856a3 100644 --- a/Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.cpp +++ b/Marlin/src/HAL/HAL_ESP32/watchdog.cpp @@ -26,13 +26,13 @@ #if ENABLED(USE_WATCHDOG) -#include "watchdog_ESP32.h" +#include "watchdog.h" -void watchdogSetup(void) { +void watchdogSetup() { // do whatever. don't remove this function. } -void watchdog_init(void) { +void watchdog_init() { // TODO } diff --git a/Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.h b/Marlin/src/HAL/HAL_ESP32/watchdog.h similarity index 96% rename from Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.h rename to Marlin/src/HAL/HAL_ESP32/watchdog.h index e5dd3b46d33f..6647ecefe660 100644 --- a/Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.h +++ b/Marlin/src/HAL/HAL_ESP32/watchdog.h @@ -25,4 +25,4 @@ void watchdog_init(); // Reset watchdog. -inline void watchdog_reset() { } +inline void HAL_watchdog_refresh() {} diff --git a/Marlin/src/HAL/HAL_ESP32/web.cpp b/Marlin/src/HAL/HAL_ESP32/web.cpp index b2bb03d714d9..c593fc024216 100644 --- a/Marlin/src/HAL/HAL_ESP32/web.cpp +++ b/Marlin/src/HAL/HAL_ESP32/web.cpp @@ -22,16 +22,18 @@ #ifdef ARDUINO_ARCH_ESP32 +#include +#undef DISABLED // esp32-hal-gpio.h + #include "../../inc/MarlinConfigPre.h" #if ENABLED(WEBSUPPORT) -#include #include "wifi.h" AsyncEventSource events("/events"); // event source (Server-Sent events) -void onNotFound(AsyncWebServerRequest *request){ +void onNotFound(AsyncWebServerRequest *request) { request->send(404); } diff --git a/Marlin/src/HAL/HAL_LINUX/HAL.cpp b/Marlin/src/HAL/HAL_LINUX/HAL.cpp index 854d7247f65b..316f6b452a4b 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL.cpp +++ b/Marlin/src/HAL/HAL_LINUX/HAL.cpp @@ -31,10 +31,10 @@ HalSerial usb_serial; extern "C" void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); } -extern "C" void u8g_MicroDelay(void) { +extern "C" void u8g_MicroDelay() { u8g_xMicroDelay(1); } -extern "C" void u8g_10MicroDelay(void) { +extern "C" void u8g_10MicroDelay() { u8g_xMicroDelay(10); } extern "C" void u8g_Delay(uint16_t val) { @@ -47,11 +47,11 @@ int freeMemory() { return 0; } -// -------------------------------------------------------------------------- +// ------------------------ // ADC -// -------------------------------------------------------------------------- +// ------------------------ -void HAL_adc_init(void) { +void HAL_adc_init() { } @@ -64,18 +64,18 @@ void HAL_adc_start_conversion(const uint8_t ch) { active_ch = ch; } -bool HAL_adc_finished(void) { +bool HAL_adc_finished() { return true; } -uint16_t HAL_adc_get_result(void) { +uint16_t HAL_adc_get_result() { pin_t pin = analogInputToDigitalPin(active_ch); if (!VALID_PIN(pin)) return 0; uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF); return data; // return 10bit value as Marlin expects } -void HAL_pwm_init(void) { +void HAL_pwm_init() { } diff --git a/Marlin/src/HAL/HAL_LINUX/HAL.h b/Marlin/src/HAL/HAL_LINUX/HAL.h index a87e40039433..37b3b479bcdf 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL.h +++ b/Marlin/src/HAL/HAL_LINUX/HAL.h @@ -23,10 +23,6 @@ #define CPU_32_BIT -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #define F_CPU 100000000 #define SystemCoreClock F_CPU #include @@ -60,7 +56,7 @@ uint8_t _getc(); #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" -#include "HAL_timers.h" +#include "timers.h" #include "serial.h" #define SHARED_SERVOS HAS_SERVOS @@ -82,29 +78,29 @@ extern HalSerial usb_serial; #define ENABLE_ISRS() #define DISABLE_ISRS() -inline void HAL_init(void) { } +inline void HAL_init() {} // Utility functions -int freeMemory(void); - -// SPI: Extended functions which take a channel number (hardware SPI only) -/** Write single byte to specified SPI channel */ -void spiSend(uint32_t chan, byte b); -/** Write buffer to specified SPI channel */ -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -/** Read single byte from specified SPI channel */ -uint8_t spiRec(uint32_t chan); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +int freeMemory(); +#pragma GCC diagnostic pop // ADC #define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin) #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_get_result() #define HAL_ADC_READY() true -void HAL_adc_init(void); +void HAL_adc_init(); void HAL_adc_enable_channel(int pin); void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); + +// Reset source +inline void HAL_clear_reset_source(void) {} +inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } /* ---------------- Delay in cycles */ FORCE_INLINE static void DELAY_CYCLES(uint64_t x) { diff --git a/Marlin/src/HAL/HAL_LINUX/arduino.cpp b/Marlin/src/HAL/HAL_LINUX/arduino.cpp index a7e451ebcc1d..88128dd91a17 100644 --- a/Marlin/src/HAL/HAL_LINUX/arduino.cpp +++ b/Marlin/src/HAL/HAL_LINUX/arduino.cpp @@ -28,8 +28,8 @@ #include "../shared/Delay.h" // Interrupts -void cli(void) { } // Disable -void sei(void) { } // Enable +void cli() { } // Disable +void sei() { } // Enable // Time functions void _delay_ms(const int delay_ms) { @@ -90,7 +90,7 @@ void eeprom_read_block(void *__dst, const void *__src, size_t __n) { } void eeprom_update_block(const void *__src, void *__dst, size_t __n) { } -char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) { +char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) { char format_string[20]; snprintf(format_string, 20, "%%%d.%df", __width, __prec); sprintf(__s, format_string, __val); diff --git a/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LINUX/SanityCheck.h b/Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_LINUX/SanityCheck.h rename to Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_LINUX/include/Arduino.h b/Marlin/src/HAL/HAL_LINUX/include/Arduino.h index f73a9c91613e..13a8206e1b1c 100644 --- a/Marlin/src/HAL/HAL_LINUX/include/Arduino.h +++ b/Marlin/src/HAL/HAL_LINUX/include/Arduino.h @@ -43,16 +43,12 @@ #define FALLING 0x03 #define RISING 0x04 -#define E2END 0xFFF // EEPROM end address - typedef uint8_t byte; #define PROGMEM #define PSTR(v) (v) #define PGM_P const char * // Used for libraries, preprocessor, and constants -#define min(a,b) ((a)<(b)?(a):(b)) -#define max(a,b) ((a)>(b)?(a):(b)) #define abs(x) ((x)>0?(x):-(x)) #ifndef isnan @@ -67,9 +63,9 @@ typedef uint8_t byte; #define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value))) //Interrupts -void cli(void); // Disable -void sei(void); // Enable -void attachInterrupt(uint32_t pin, void (*callback)(void), uint32_t mode); +void cli(); // Disable +void sei(); // Enable +void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode); void detachInterrupt(uint32_t pin); extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode); extern "C" void GpioDisableInt(uint32_t port, uint32_t pin); @@ -113,13 +109,13 @@ uint16_t analogRead(pin_t); // EEPROM void eeprom_write_byte(unsigned char *pos, unsigned char value); unsigned char eeprom_read_byte(unsigned char *pos); -void eeprom_read_block (void *__dst, const void *__src, size_t __n); -void eeprom_update_block (const void *__src, void *__dst, size_t __n); +void eeprom_read_block(void *__dst, const void *__src, size_t __n); +void eeprom_update_block(const void *__src, void *__dst, size_t __n); int32_t random(int32_t); int32_t random(int32_t, int32_t); void randomSeed(uint32_t); -char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s); +char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s); int map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max); diff --git a/Marlin/src/HAL/HAL_LINUX/include/serial.h b/Marlin/src/HAL/HAL_LINUX/include/serial.h index dd57d997497f..c6da82ad5a3f 100644 --- a/Marlin/src/HAL/HAL_LINUX/include/serial.h +++ b/Marlin/src/HAL/HAL_LINUX/include/serial.h @@ -83,8 +83,9 @@ class HalSerial { HalSerial() { host_connected = true; } - void begin(int32_t baud) { - } + void begin(int32_t) {} + + void end() {} int peek() { uint8_t value; @@ -107,11 +108,11 @@ class HalSerial { void flush() { receive_buffer.clear(); } - uint8_t availableForWrite(void){ + uint8_t availableForWrite() { return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free(); } - void flushTX(void){ + void flushTX() { if (host_connected) while (transmit_buffer.available()) { /* nada */ } } @@ -141,10 +142,10 @@ class HalSerial { void print_bin(uint32_t value, uint8_t num_digits) { uint32_t mask = 1 << (num_digits -1); for (uint8_t i = 0; i < num_digits; i++) { - if (!(i % 4) && i) write(' '); - if (!(i % 16) && i) write(' '); - if (value & mask) write('1'); - else write('0'); + if (!(i % 4) && i) write(' '); + if (!(i % 16) && i) write(' '); + if (value & mask) write('1'); + else write('0'); value <<= 1; } } @@ -199,7 +200,7 @@ class HalSerial { void println(unsigned long value, int nbase = 0) { print(value, nbase); println(); } void println(float value, int round = 6) { printf("%f\n" , value); } void println(double value, int round = 6) { printf("%f\n" , value); } - void println(void) { print('\n'); } + void println() { print('\n'); } volatile RingBuffer receive_buffer; volatile RingBuffer transmit_buffer; diff --git a/Marlin/src/HAL/HAL_LINUX/main.cpp b/Marlin/src/HAL/HAL_LINUX/main.cpp index 01b0eee34ddd..4231affba778 100644 --- a/Marlin/src/HAL/HAL_LINUX/main.cpp +++ b/Marlin/src/HAL/HAL_LINUX/main.cpp @@ -104,7 +104,7 @@ void simulation_loop() { } } -int main(void) { +int main() { std::thread write_serial (write_serial_thread); std::thread read_serial (read_serial_thread); diff --git a/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp index aba664d9f983..c4965d90e3ad 100644 --- a/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp @@ -29,7 +29,8 @@ #include "../shared/persistent_store_api.h" #include -uint8_t buffer[E2END]; +#define LINUX_EEPROM_SIZE (E2END + 1) +uint8_t buffer[LINUX_EEPROM_SIZE]; char filename[] = "eeprom.dat"; bool PersistentStore::access_start() { @@ -40,8 +41,8 @@ bool PersistentStore::access_start() { fseek(eeprom_file, 0L, SEEK_END); std::size_t file_size = ftell(eeprom_file); - if (file_size < E2END) { - memset(buffer + file_size, eeprom_erase_value, E2END - file_size); + if (file_size < LINUX_EEPROM_SIZE) { + memset(buffer + file_size, eeprom_erase_value, LINUX_EEPROM_SIZE - file_size); } else { fseek(eeprom_file, 0L, SEEK_SET); @@ -60,7 +61,7 @@ bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { std::size_t bytes_written = 0; for (std::size_t i = 0; i < size; i++) { diff --git a/Marlin/src/HAL/HAL_LINUX/pinsDebug.h b/Marlin/src/HAL/HAL_LINUX/pinsDebug.h index be4765a5718d..a28d2b60b928 100644 --- a/Marlin/src/HAL/HAL_LINUX/pinsDebug.h +++ b/Marlin/src/HAL/HAL_LINUX/pinsDebug.h @@ -32,9 +32,8 @@ #define digitalRead_mod(p) digitalRead(p) #define PRINT_PORT(p) #define GET_ARRAY_PIN(p) pin_array[p].pin -#define NAME_FORMAT(p) PSTR("%-##p##s") -#define PRINT_ARRAY_NAME(x) do {sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer);} while (0) -#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer);} while (0) +#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) +#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0) #define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin // active ADC function/mode/code values for PINSEL registers diff --git a/Marlin/src/HAL/HAL_LINUX/spi_pins.h b/Marlin/src/HAL/HAL_LINUX/spi_pins.h index 5b6f88ac6d7d..fdd09b1c037b 100644 --- a/Marlin/src/HAL/HAL_LINUX/spi_pins.h +++ b/Marlin/src/HAL/HAL_LINUX/spi_pins.h @@ -24,9 +24,9 @@ #include "../../core/macros.h" #include "../../inc/MarlinConfigPre.h" -#if BOTH(SDSUPPORT, DOGLCD) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN) +#if HAS_GRAPHICAL_LCD && ENABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN) #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently - // needed due to the speed and mode requred for communicating with each device being different. + // needed due to the speed and mode required for communicating with each device being different. // This requirement can be removed if the SPI access to these devices is updated to use // spiBeginTransaction. #endif diff --git a/Marlin/src/HAL/HAL_LINUX/HAL_timers.cpp b/Marlin/src/HAL/HAL_LINUX/timers.cpp similarity index 97% rename from Marlin/src/HAL/HAL_LINUX/HAL_timers.cpp rename to Marlin/src/HAL/HAL_LINUX/timers.cpp index 48c033d87eef..f293d7f40884 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL_timers.cpp +++ b/Marlin/src/HAL/HAL_LINUX/timers.cpp @@ -25,7 +25,7 @@ #include "hardware/Timer.h" #include "../../inc/MarlinConfig.h" -#include "HAL_timers.h" +#include "timers.h" /** * Use POSIX signals to attempt to emulate Interrupts @@ -37,7 +37,7 @@ HAL_TEMP_TIMER_ISR(); Timer timers[2]; -void HAL_timer_init(void) { +void HAL_timer_init() { timers[0].init(0, STEPPER_TIMER_RATE, TIMER0_IRQHandler); timers[1].init(1, TEMP_TIMER_RATE, TIMER1_IRQHandler); } diff --git a/Marlin/src/HAL/HAL_LINUX/HAL_timers.h b/Marlin/src/HAL/HAL_LINUX/timers.h similarity index 90% rename from Marlin/src/HAL/HAL_LINUX/HAL_timers.h rename to Marlin/src/HAL/HAL_LINUX/timers.h index b7d0f9b2da36..8022aabd264d 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL_timers.h +++ b/Marlin/src/HAL/HAL_LINUX/timers.h @@ -24,15 +24,11 @@ * HAL timers for Linux X86_64 */ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define FORCE_INLINE __attribute__((always_inline)) inline @@ -63,16 +59,16 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler(void) -#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler(void) +#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler() +#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler() // PWM timer #define HAL_PWM_TIMER -#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler(void) +#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler() #define HAL_PWM_TIMER_IRQn -void HAL_timer_init(void); +void HAL_timer_init(); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare); diff --git a/Marlin/src/HAL/HAL_LINUX/watchdog.cpp b/Marlin/src/HAL/HAL_LINUX/watchdog.cpp index f96a05e5b89c..6338ea3b1d7b 100644 --- a/Marlin/src/HAL/HAL_LINUX/watchdog.cpp +++ b/Marlin/src/HAL/HAL_LINUX/watchdog.cpp @@ -28,19 +28,9 @@ #include "watchdog.h" -void watchdog_init(void) {} +void watchdog_init() {} +void HAL_watchdog_refresh() {} -void HAL_clear_reset_source(void) {} - -uint8_t HAL_get_reset_source(void) { - return RST_POWER_ON; -} - -void watchdog_reset() {} - -#else - void HAL_clear_reset_source(void) {} - uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } -#endif // USE_WATCHDOG +#endif #endif // __PLAT_LINUX__ diff --git a/Marlin/src/HAL/HAL_LINUX/watchdog.h b/Marlin/src/HAL/HAL_LINUX/watchdog.h index 04ce17fe9d52..51d30c8437a1 100644 --- a/Marlin/src/HAL/HAL_LINUX/watchdog.h +++ b/Marlin/src/HAL/HAL_LINUX/watchdog.h @@ -23,7 +23,5 @@ #define WDT_TIMEOUT 4000000 // 4 second timeout -void watchdog_init(void); -void watchdog_reset(void); -void HAL_clear_reset_source(void); -uint8_t HAL_get_reset_source(void); +void watchdog_init(); +void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp b/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp similarity index 94% rename from Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp rename to Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp index 0196253df21a..fefee386e590 100644 --- a/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp @@ -44,7 +44,7 @@ #define sw_barrier() __asm__ volatile("": : :"memory"); // (re)initialize UART0 as a monitor output to 250000,n,8,1 -static void TXBegin(void) { +static void TXBegin() { } // Send character through UART with no interrupts @@ -210,7 +210,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause } extern "C" { -__attribute__((naked)) void NMI_Handler(void) { +__attribute__((naked)) void NMI_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -223,7 +223,7 @@ __attribute__((naked)) void NMI_Handler(void) { ); } -__attribute__((naked)) void HardFault_Handler(void) { +__attribute__((naked)) void HardFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -236,7 +236,7 @@ __attribute__((naked)) void HardFault_Handler(void) { ); } -__attribute__((naked)) void MemManage_Handler(void) { +__attribute__((naked)) void MemManage_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -249,7 +249,7 @@ __attribute__((naked)) void MemManage_Handler(void) { ); } -__attribute__((naked)) void BusFault_Handler(void) { +__attribute__((naked)) void BusFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -262,7 +262,7 @@ __attribute__((naked)) void BusFault_Handler(void) { ); } -__attribute__((naked)) void UsageFault_Handler(void) { +__attribute__((naked)) void UsageFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -275,7 +275,7 @@ __attribute__((naked)) void UsageFault_Handler(void) { ); } -__attribute__((naked)) void DebugMon_Handler(void) { +__attribute__((naked)) void DebugMon_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -289,7 +289,7 @@ __attribute__((naked)) void DebugMon_Handler(void) { } /* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */ -__attribute__((naked)) void WDT_IRQHandler(void) { +__attribute__((naked)) void WDT_IRQHandler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -302,7 +302,7 @@ __attribute__((naked)) void WDT_IRQHandler(void) { ); } -__attribute__((naked)) void RSTC_Handler(void) { +__attribute__((naked)) void RSTC_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.cpp b/Marlin/src/HAL/HAL_LPC1768/HAL.cpp index aed7a7855c26..4da55c2f3d53 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.cpp @@ -26,14 +26,20 @@ #include "../shared/Delay.h" #include "../../../gcode/parser.h" +#if ENABLED(USE_WATCHDOG) + #include "watchdog.h" +#endif + +uint32_t HAL_adc_reading = 0; + // U8glib required functions extern "C" void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); } -extern "C" void u8g_MicroDelay(void) { +extern "C" void u8g_MicroDelay() { u8g_xMicroDelay(1); } -extern "C" void u8g_10MicroDelay(void) { +extern "C" void u8g_10MicroDelay() { u8g_xMicroDelay(10); } extern "C" void u8g_Delay(uint16_t val) { @@ -57,7 +63,7 @@ int freeMemory() { // return dval if not found or not a valid pin. int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { const uint16_t val = (uint16_t)parser.intval(code, -1), port = val / 100, pin = val % 100; - const int16_t ind = (port < ((NUM_DIGITAL_PINS) >> 5) && pin < 32) ? GET_PIN_MAP_INDEX((port << 5) | pin) : -2; + const int16_t ind = (port < ((NUM_DIGITAL_PINS) >> 5) && pin < 32) ? ((port << 5) | pin) : -2; return ind > -1 ? ind : dval; } @@ -65,4 +71,17 @@ void flashFirmware(int16_t value) { NVIC_SystemReset(); } +void HAL_clear_reset_source(void) { + #if ENABLED(USE_WATCHDOG) + watchdog_clear_timeout_flag(); + #endif +} + +uint8_t HAL_get_reset_source(void) { + #if ENABLED(USE_WATCHDOG) + if (watchdog_timed_out()) return RST_WATCHDOG; + #endif + return RST_POWER_ON; +} + #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.h b/Marlin/src/HAL/HAL_LPC1768/HAL.h index 32765bd0ea5a..1648905453e7 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.h +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.h @@ -28,20 +28,20 @@ #define CPU_32_BIT -void HAL_init(void); +void HAL_init(); #include #include #include -extern "C" volatile millis_t _millis; +extern "C" volatile uint32_t _millis; #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" -#include "HAL_timers.h" +#include "timers.h" #include "MarlinSerial.h" #include @@ -111,18 +111,10 @@ extern "C" volatile millis_t _millis; // // Utility functions // -int freeMemory(void); - -// -// SPI: Extended functions taking a channel number (Hardware SPI only) -// - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +int freeMemory(); +#pragma GCC diagnostic pop // // ADC API @@ -133,21 +125,49 @@ uint8_t spiRec(uint32_t chan); // Memory usage per ADC channel (bytes): (6 * ADC_MEDIAN_FILTER_SIZE) + 16 // 8 * ((6 * 23) + 16 ) = 1232 Bytes for 8 channels -#define ADC_LOWPASS_K_VALUE (6) // Higher values increase rise time +#define ADC_LOWPASS_K_VALUE (2) // Higher values increase rise time // Rise time sample delays for 100% signal convergence on full range step // (1 : 13, 2 : 32, 3 : 67, 4 : 139, 5 : 281, 6 : 565, 7 : 1135, 8 : 2273) // K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step // Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels) +#define HAL_ADC_RESOLUTION 12 // 15 bit maximum, raw temperature is stored as int16_t +#define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL + using FilteredADC = LPC176x::ADC; -#define HAL_adc_init() FilteredADC::init() +extern uint32_t HAL_adc_reading; +[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) { + HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits +} +[[gnu::always_inline]] inline uint16_t HAL_read_adc() { + return HAL_adc_reading; +} + +#define HAL_adc_init() #define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin) -#define HAL_START_ADC(pin) FilteredADC::start_conversion(pin) -#define HAL_READ_ADC() FilteredADC::get_result() -#define HAL_ADC_READY() FilteredADC::finished_conversion() - -// A grace period to allow ADC readings to stabilize, preventing false alarms -#define THERMAL_PROTECTION_GRACE_PERIOD 1000 +#define HAL_START_ADC(pin) HAL_start_adc(pin) +#define HAL_READ_ADC() HAL_read_adc() +#define HAL_ADC_READY() (true) + +// Test whether the pin is valid +constexpr bool VALID_PIN(const pin_t pin) { + return LPC176x::pin_is_valid(pin); +} + +// Get the analog index for a digital pin +constexpr int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t pin) { + return (LPC176x::pin_is_valid(pin) && LPC176x::pin_has_adc(pin)) ? pin : -1; +} + +// Return the index of a pin number +constexpr int16_t GET_PIN_MAP_INDEX(const pin_t pin) { + return LPC176x::pin_index(pin); +} + +// Get the pin number at the given index +constexpr pin_t GET_PIN_MAP_PIN(const int16_t index) { + return LPC176x::pin_index(index); +} // Parse a G-code word into a pin index int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); @@ -155,7 +175,7 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); #define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09 #define HAL_IDLETASK 1 -void HAL_idletask(void); +void HAL_idletask(); #define PLATFORM_M997_SUPPORT void flashFirmware(int16_t value); @@ -175,3 +195,7 @@ void set_pwm_frequency(const pin_t pin, int f_desired); * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] */ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); + +// Reset source +void HAL_clear_reset_source(void); +uint8_t HAL_get_reset_source(void); diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp similarity index 91% rename from Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp rename to Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp index 78f1672dcc41..5f32c7874d02 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp @@ -49,18 +49,14 @@ #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfig.h" -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ #if ENABLED(LPC_SOFTWARE_SPI) - #include "SoftwareSPI.h" + #include // Software SPI @@ -129,18 +125,18 @@ PinCfg.Funcnum = 2; PinCfg.OpenDrain = 0; PinCfg.Pinmode = 0; - PinCfg.Pinnum = LPC1768_PIN_PIN(SCK_PIN); - PinCfg.Portnum = LPC1768_PIN_PORT(SCK_PIN); + PinCfg.Pinnum = LPC176x::pin_bit(SCK_PIN); + PinCfg.Portnum = LPC176x::pin_port(SCK_PIN); PINSEL_ConfigPin(&PinCfg); SET_OUTPUT(SCK_PIN); - PinCfg.Pinnum = LPC1768_PIN_PIN(MISO_PIN); - PinCfg.Portnum = LPC1768_PIN_PORT(MISO_PIN); + PinCfg.Pinnum = LPC176x::pin_bit(MISO_PIN); + PinCfg.Portnum = LPC176x::pin_port(MISO_PIN); PINSEL_ConfigPin(&PinCfg); SET_INPUT(MISO_PIN); - PinCfg.Pinnum = LPC1768_PIN_PIN(MOSI_PIN); - PinCfg.Portnum = LPC1768_PIN_PORT(MOSI_PIN); + PinCfg.Pinnum = LPC176x::pin_bit(MOSI_PIN); + PinCfg.Portnum = LPC176x::pin_port(MOSI_PIN); PINSEL_ConfigPin(&PinCfg); SET_OUTPUT(MOSI_PIN); // divide PCLK by 2 for SSP0 diff --git a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp index 2379300512a8..a8778f7446b8 100644 --- a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp @@ -27,28 +27,28 @@ #if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) MarlinSerial MSerial(LPC_UART0); - extern "C" void UART0_IRQHandler(void) { + extern "C" void UART0_IRQHandler() { MSerial.IRQHandler(); } #endif #if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1) MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1); - extern "C" void UART1_IRQHandler(void) { + extern "C" void UART1_IRQHandler() { MSerial1.IRQHandler(); } #endif #if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2) MarlinSerial MSerial2(LPC_UART2); - extern "C" void UART2_IRQHandler(void) { + extern "C" void UART2_IRQHandler() { MSerial2.IRQHandler(); } #endif #if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3) MarlinSerial MSerial3(LPC_UART3); - extern "C" void UART3_IRQHandler(void) { + extern "C" void UART3_IRQHandler() { MSerial3.IRQHandler(); } #endif diff --git a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h index 4807356d739d..80506855384b 100644 --- a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h +++ b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h @@ -49,6 +49,8 @@ class MarlinSerial : public HardwareSerial { { } + void end() {} + #if ENABLED(EMERGENCY_PARSER) bool recv_callback(const char c) override { emergency_parser.update(emergency_state, c); diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_Servo_LPC1768.h b/Marlin/src/HAL/HAL_LPC1768/Servo.h similarity index 91% rename from Marlin/src/HAL/HAL_LPC1768/HAL_Servo_LPC1768.h rename to Marlin/src/HAL/HAL_LPC1768/Servo.h index 8b511032cb9c..1bbf84c73e99 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_Servo_LPC1768.h +++ b/Marlin/src/HAL/HAL_LPC1768/Servo.h @@ -57,11 +57,11 @@ class libServo: public Servo { 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(servo_info[this->servoIndex].Pin.nbr) >= 0) { // try to reattach - this->write(value); - safe_delay(servo_delay[this->servoIndex]); // delay to allow servo to reach position + if (attach(servo_info[servoIndex].Pin.nbr) >= 0) { // try to reattach + write(value); + safe_delay(servo_delay[servoIndex]); // delay to allow servo to reach position #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } diff --git a/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h b/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h index a1d9aba167aa..f1d4fc754f3e 100644 --- a/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h @@ -38,73 +38,76 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } + +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) + #define LPC1768_PIN_INTERRUPT_M(pin) ((pin >> 0x5 & 0x7) == 0 || (pin >> 0x5 & 0x7) == 2) -void setup_endstop_interrupts(void) { #if HAS_X_MAX #if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN) - #error "X_MAX_PIN is not an INTERRUPT capable pin." + #error "X_MAX_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN #if !LPC1768_PIN_INTERRUPT_M(X_MIN_PIN) - #error "X_MIN_PIN is not an INTERRUPT capable pin." + #error "X_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX #if !LPC1768_PIN_INTERRUPT_M(Y_MAX_PIN) - #error "Y_MAX_PIN is not an INTERRUPT capable pin." + #error "Y_MAX_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN #if !LPC1768_PIN_INTERRUPT_M(Y_MIN_PIN) - #error "Y_MIN_PIN is not an INTERRUPT capable pin." + #error "Y_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX #if !LPC1768_PIN_INTERRUPT_M(Z_MAX_PIN) - #error "Z_MAX_PIN is not an INTERRUPT capable pin." + #error "Z_MAX_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN) - #error "Z_MIN_PIN is not an INTERRUPT capable pin." + #error "Z_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX #if !LPC1768_PIN_INTERRUPT_M(Z2_MAX_PIN) - #error "Z2_MAX_PIN is not an INTERRUPT capable pin." + #error "Z2_MAX_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN #if !LPC1768_PIN_INTERRUPT_M(Z2_MIN_PIN) - #error "Z2_MIN_PIN is not an INTERRUPT capable pin." + #error "Z2_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN) - #error "Z3_MIN_PIN is not an INTERRUPT capable pin." + #error "Z3_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN) - #error "Z3_MIN_PIN is not an INTERRUPT capable pin." + #error "Z3_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PROBE_PIN) - #error "Z_MIN_PROBE_PIN is not an INTERRUPT capable pin." + #error "Z_MIN_PROBE_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp b/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp index 7af3a07eeae0..6c7de9bb1d5e 100644 --- a/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp @@ -24,17 +24,17 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(FAST_PWM_FAN) +#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM #include void set_pwm_frequency(const pin_t pin, int f_desired) { - pwm_set_frequency(pin, f_desired); + LPC176x::pwm_set_frequency(pin, f_desired); } void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { - pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size); + LPC176x::pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size); } -#endif // FAST_PWM_FAN +#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/fastio.h b/Marlin/src/HAL/HAL_LPC1768/fastio.h index a00a4946c165..8b90ec20d30c 100644 --- a/Marlin/src/HAL/HAL_LPC1768/fastio.h +++ b/Marlin/src/HAL/HAL_LPC1768/fastio.h @@ -37,19 +37,19 @@ #define PWM_PIN(P) true // all pins are PWM capable -#define LPC_PIN(pin) gpio_pin(pin) -#define LPC_GPIO(port) gpio_port(port) +#define LPC_PIN(pin) LPC176x::gpio_pin(pin) +#define LPC_GPIO(port) LPC176x::gpio_port(port) -#define SET_DIR_INPUT(IO) gpio_set_input(IO) -#define SET_DIR_OUTPUT(IO) gpio_set_output(IO) +#define SET_DIR_INPUT(IO) LPC176x::gpio_set_input(IO) +#define SET_DIR_OUTPUT(IO) LPC176x::gpio_set_output(IO) #define SET_MODE(IO, mode) pinMode(IO, mode) -#define WRITE_PIN_SET(IO) gpio_set(IO) -#define WRITE_PIN_CLR(IO) gpio_clear(IO) +#define WRITE_PIN_SET(IO) LPC176x::gpio_set(IO) +#define WRITE_PIN_CLR(IO) LPC176x::gpio_clear(IO) -#define READ_PIN(IO) gpio_get(IO) -#define WRITE_PIN(IO,V) gpio_set(IO, V) +#define READ_PIN(IO) LPC176x::gpio_get(IO) +#define WRITE_PIN(IO,V) LPC176x::gpio_set(IO, V) /** * Magic I/O routines @@ -81,10 +81,10 @@ #define _PULLDOWN(IO,V) pinMode(IO, (V) ? INPUT_PULLDOWN : INPUT) /// check if pin is an input -#define _IS_INPUT(IO) (!gpio_get_dir(IO)) +#define _IS_INPUT(IO) (!LPC176x::gpio_get_dir(IO)) /// check if pin is an output -#define _IS_OUTPUT(IO) (gpio_get_dir(IO)) +#define _IS_OUTPUT(IO) (LPC176x::gpio_get_dir(IO)) /// Read a pin wrapper #define READ(IO) _READ(IO) diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h new file mode 100644 index 000000000000..17cbf20ef076 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h @@ -0,0 +1,70 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#if PIO_PLATFORM_VERSION < 1001 + #error "nxplpc-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries. You may need to remove the platform and let it reinstall automatically." +#endif +#if PIO_FRAMEWORK_VERSION < 2002 + #error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries." +#endif + +/** + * Detect an old pins file by checking for old ADC pins values. + */ +#define _OLD_TEMP_PIN(P) PIN_EXISTS(P) && _CAT(P,_PIN) <= 7 && _CAT(P,_PIN) != 2 && _CAT(P,_PIN) != 3 +#if _OLD_TEMP_PIN(TEMP_BED) + #error "TEMP_BED_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_0) + #error "TEMP_0_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_1) + #error "TEMP_1_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_2) + #error "TEMP_2_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_3) + #error "TEMP_3_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_4) + #error "TEMP_4_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_5) + #error "TEMP_5_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#endif +#undef _OLD_TEMP_PIN + +/** + * Because PWM hardware channels all share the same frequency, along with the + * fallback software channels, FAST_PWM_FAN is incompatible with Servos. + */ +#if NUM_SERVOS > 0 && ENABLED(FAST_PWM_FAN) + #error "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards." +#endif + +/** + * Test LPC176x-specific configuration values for errors at compile-time. + */ + +//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) +// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" +//#endif + +#if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) + #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI" +#endif diff --git a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c index 28c1e01792e3..3ad1aff01719 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c +++ b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c @@ -89,7 +89,7 @@ uint8_t digipot_mcp4451_start(uint8_t sla) { // send slave address and write bi return 1; } -void digipot_mcp4451_init(void) { +void digipot_mcp4451_init() { /** * Init I2C pin connect */ diff --git a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h index 13712e2ae0ba..d7e4b0dc7a43 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h @@ -45,7 +45,7 @@ #include uint8_t digipot_mcp4451_start(uint8_t sla); -void digipot_mcp4451_init(void); +void digipot_mcp4451_init(); uint8_t digipot_mcp4451_send_byte(uint8_t data); #ifdef __cplusplus diff --git a/Marlin/src/HAL/HAL_LPC1768/main.cpp b/Marlin/src/HAL/HAL_LPC1768/main.cpp index 3f22b0d36d3f..b20841bdeb9c 100644 --- a/Marlin/src/HAL/HAL_LPC1768/main.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/main.cpp @@ -38,17 +38,15 @@ extern "C" { #include "../../sd/cardreader.h" #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "HAL_timers.h" +#include "timers.h" extern uint32_t MSC_SD_Init(uint8_t pdrv); extern "C" int isLPC1769(); -extern "C" void disk_timerproc(void); +extern "C" void disk_timerproc(); -void SysTick_Callback() { - disk_timerproc(); -} +void SysTick_Callback() { disk_timerproc(); } -void HAL_init(void) { +void HAL_init() { // Init LEDs #if PIN_EXISTS(LED) @@ -75,17 +73,18 @@ void HAL_init(void) { #endif // Init Servo Pins - #if PIN_EXISTS(SERVO0) - OUT_WRITE(SERVO0_PIN, LOW); + #define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW) + #if HAS_SERVO_0 + INIT_SERVO(0); #endif - #if PIN_EXISTS(SERVO1) - OUT_WRITE(SERVO1_PIN, LOW); + #if HAS_SERVO_1 + INIT_SERVO(1); #endif - #if PIN_EXISTS(SERVO2) - OUT_WRITE(SERVO2_PIN, LOW); + #if HAS_SERVO_2 + INIT_SERVO(2); #endif - #if PIN_EXISTS(SERVO3) - OUT_WRITE(SERVO3_PIN, LOW); + #if HAS_SERVO_3 + INIT_SERVO(3); #endif //debug_frmwrk_init(); @@ -99,6 +98,26 @@ void HAL_init(void) { OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); #endif + #ifdef LPC1768_ENABLE_CLKOUT_12M + /** + * CLKOUTCFG register + * bit 8 (CLKOUT_EN) = enables CLKOUT signal. Disabled for now to prevent glitch when enabling GPIO. + * bits 7:4 (CLKOUTDIV) = set to 0 for divider setting of /1 + * bits 3:0 (CLKOUTSEL) = set to 1 to select main crystal oscillator as CLKOUT source + */ + LPC_SC->CLKOUTCFG = (0<<8)|(0<<4)|(1<<0); + // set P1.27 pin to function 01 (CLKOUT) + PINSEL_CFG_Type PinCfg; + PinCfg.Portnum = 1; + PinCfg.Pinnum = 27; + PinCfg.Funcnum = 1; // function 01 (CLKOUT) + PinCfg.OpenDrain = 0; // not open drain + PinCfg.Pinmode = 2; // no pull-up/pull-down + PINSEL_ConfigPin(&PinCfg); + // now set CLKOUT_EN bit + LPC_SC->CLKOUTCFG |= (1<<8); + #endif + USB_Init(); // USB Initialization USB_Connect(FALSE); // USB clear connection delay(1000); // Give OS time to notice @@ -130,16 +149,16 @@ void HAL_init(void) { } // HAL idle task -void HAL_idletask(void) { +void HAL_idletask() { #if ENABLED(SHARED_SD_CARD) // If Marlin is using the SD card we need to lock it to prevent access from // a PC via USB. // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but // this will not reliably detect delete operations. To be safe we will lock - // the disk if Marlin has it mounted. Unfortuately there is currently no way + // the disk if Marlin has it mounted. Unfortunately there is currently no way // to unmount the disk from the LCD menu. // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) - if (card.isDetected()) + if (card.isMounted()) MSC_Aquire_Lock(); else MSC_Release_Lock(); diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp index dac7d7a3a93a..3de02022eb65 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp @@ -46,7 +46,7 @@ #if ENABLED(FLASH_EEPROM_EMULATION) extern "C" { - #include "lpc17xx_iap.h" + #include } #define SECTOR_START(sector) ((sector < 16) ? (sector * 0x1000) : ((sector - 14) * 0x8000)) diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp index b12076904103..2454dea19577 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp @@ -125,7 +125,7 @@ static void debug_rw(const bool write, int &pos, const uint8_t *value, const siz // FR_INVALID_PARAMETER /* (19) Given parameter is invalid */ // } FRESULT; -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { if (!eeprom_file_open) return true; FRESULT s; UINT bytes_written = 0; diff --git a/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h b/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h index d14b14385c22..133cd11be26e 100644 --- a/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h +++ b/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h @@ -32,54 +32,22 @@ #define digitalRead_mod(p) extDigitalRead(p) #define PRINT_PORT(p) #define GET_ARRAY_PIN(p) pin_array[p].pin -#define NAME_FORMAT(p) PSTR("%-##p##s") -#define PRINT_ARRAY_NAME(x) do {sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer);} while (0) -#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%d.%02d"), LPC1768_PIN_PORT(p), LPC1768_PIN_PIN(p)); SERIAL_ECHO(buffer);} while (0) +#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) +#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%d.%02d"), LPC176x::pin_port(p), LPC176x::pin_bit(p)); SERIAL_ECHO(buffer); }while(0) #define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin // pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities -// uses pin index #ifndef M43_NEVER_TOUCH - #define M43_NEVER_TOUCH(Q) ((Q) == 29 || (Q) == 30 || (Q) == 73) // USB pins + #define M43_NEVER_TOUCH(Q) ((Q) == P0_29 || (Q) == P0_30 || (Q) == P2_09) // USB pins #endif -// active ADC function/mode/code values for PINSEL registers -constexpr int8_t ADC_pin_mode(pin_t pin) { - return (LPC1768_PIN_PORT(pin) == 0 && LPC1768_PIN_PIN(pin) == 2 ? 2 : - LPC1768_PIN_PORT(pin) == 0 && LPC1768_PIN_PIN(pin) == 3 ? 2 : - LPC1768_PIN_PORT(pin) == 0 && LPC1768_PIN_PIN(pin) == 23 ? 1 : - LPC1768_PIN_PORT(pin) == 0 && LPC1768_PIN_PIN(pin) == 24 ? 1 : - LPC1768_PIN_PORT(pin) == 0 && LPC1768_PIN_PIN(pin) == 25 ? 1 : - LPC1768_PIN_PORT(pin) == 0 && LPC1768_PIN_PIN(pin) == 26 ? 1 : - LPC1768_PIN_PORT(pin) == 1 && LPC1768_PIN_PIN(pin) == 30 ? 3 : - LPC1768_PIN_PORT(pin) == 1 && LPC1768_PIN_PIN(pin) == 31 ? 3 : -1); -} - -int8_t get_pin_mode(pin_t pin) { - if (!VALID_PIN(pin)) return -1; - uint8_t pin_port = LPC1768_PIN_PORT(pin); - uint8_t pin_port_pin = LPC1768_PIN_PIN(pin); - //get appropriate PINSEL register - volatile uint32_t * pinsel_reg = (pin_port == 0 && pin_port_pin <= 15) ? &LPC_PINCON->PINSEL0 : - (pin_port == 0) ? &LPC_PINCON->PINSEL1 : - (pin_port == 1 && pin_port_pin <= 15) ? &LPC_PINCON->PINSEL2 : - pin_port == 1 ? &LPC_PINCON->PINSEL3 : - pin_port == 2 ? &LPC_PINCON->PINSEL4 : - pin_port == 3 ? &LPC_PINCON->PINSEL7 : &LPC_PINCON->PINSEL9; - uint8_t pinsel_start_bit = pin_port_pin > 15 ? 2 * (pin_port_pin - 16) : 2 * pin_port_pin; - int8_t pin_mode = (int8_t) ((*pinsel_reg >> pinsel_start_bit) & 0x3); - return pin_mode; -} - -bool GET_PINMODE(pin_t pin) { - int8_t pin_mode = get_pin_mode(pin); - if (pin_mode == -1 || pin_mode == ADC_pin_mode(pin)) // found an invalid pin or active analog pin +bool GET_PINMODE(const pin_t pin) { + if (!LPC176x::pin_is_valid(pin) || LPC176x::pin_adc_enabled(pin)) // found an invalid pin or active analog pin return false; - uint32_t * FIO_reg[5] PROGMEM = {(uint32_t*) 0x2009C000,(uint32_t*) 0x2009C020,(uint32_t*) 0x2009C040,(uint32_t*) 0x2009C060,(uint32_t*) 0x2009C080}; - return ((*FIO_reg[LPC1768_PIN_PORT(pin)] >> LPC1768_PIN_PIN(pin) & 1) != 0); //input/output state + return LPC176x::gpio_direction(pin); } -bool GET_ARRAY_IS_DIGITAL(pin_t pin) { - return (!IS_ANALOG(pin) || get_pin_mode(pin) != ADC_pin_mode(pin)); +bool GET_ARRAY_IS_DIGITAL(const pin_t pin) { + return (!LPC176x::pin_has_adc(pin) || !LPC176x::pin_adc_enabled(pin)); } diff --git a/Marlin/src/HAL/HAL_LPC1768/spi_pins.h b/Marlin/src/HAL/HAL_LPC1768/spi_pins.h index 2e17abd31c7c..acf991a9d790 100644 --- a/Marlin/src/HAL/HAL_LPC1768/spi_pins.h +++ b/Marlin/src/HAL/HAL_LPC1768/spi_pins.h @@ -25,7 +25,7 @@ #if ENABLED(SDSUPPORT) && HAS_GRAPHICAL_LCD && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN) #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently - // needed due to the speed and mode requred for communicating with each device being different. + // needed due to the speed and mode required for communicating with each device being different. // This requirement can be removed if the SPI access to these devices is updated to use // spiBeginTransaction. #endif diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.cpp b/Marlin/src/HAL/HAL_LPC1768/timers.cpp similarity index 97% rename from Marlin/src/HAL/HAL_LPC1768/HAL_timers.cpp rename to Marlin/src/HAL/HAL_LPC1768/timers.cpp index 2274630ca88b..7bf7ff388051 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/timers.cpp @@ -29,9 +29,9 @@ #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfig.h" -#include "HAL_timers.h" +#include "timers.h" -void HAL_timer_init(void) { +void HAL_timer_init() { SBI(LPC_SC->PCONP, SBIT_TIMER0); // Power ON Timer 0 LPC_TIM0->PR = (HAL_TIMER_RATE) / (STEPPER_TIMER_RATE) - 1; // Use prescaler to set frequency if needed diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h b/Marlin/src/HAL/HAL_LPC1768/timers.h similarity index 89% rename from Marlin/src/HAL/HAL_LPC1768/HAL_timers.h rename to Marlin/src/HAL/HAL_LPC1768/timers.h index 1d68ee8478f9..5f4e06265eab 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h +++ b/Marlin/src/HAL/HAL_LPC1768/timers.h @@ -25,10 +25,6 @@ * HAL For LPC1768 */ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include #include "../../core/macros.h" @@ -51,19 +47,19 @@ #define SBIT_MR3R 10 #define SBIT_MR3S 11 -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define _HAL_TIMER(T) _CAT(LPC_TIM, T) #define _HAL_TIMER_IRQ(T) TIMER##T##_IRQn -#define __HAL_TIMER_ISR(T) extern "C" void TIMER##T##_IRQHandler(void) +#define __HAL_TIMER_ISR(T) extern "C" void TIMER##T##_IRQHandler() #define _HAL_TIMER_ISR(T) __HAL_TIMER_ISR(T) typedef uint32_t hal_timer_t; #define HAL_TIMER_TYPE_MAX 0xFFFFFFFF -#define HAL_TIMER_RATE ((SystemCoreClock) / 4) // frequency of timers peripherals +#define HAL_TIMER_RATE ((F_CPU) / 4) // frequency of timers peripherals #define STEP_TIMER_NUM 0 // Timer Index for Stepper #define TEMP_TIMER_NUM 1 // Timer Index for Temperature @@ -95,10 +91,10 @@ typedef uint32_t hal_timer_t; #define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM) #define TEMP_TIMER _HAL_TIMER(TEMP_TIMER_NUM) -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- -void HAL_timer_init(void); +// ------------------------ +void HAL_timer_init(); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) { diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp similarity index 96% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp index 41a19d430f84..9a95b1b66024 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp @@ -25,6 +25,8 @@ #ifdef TARGET_LPC1768 +extern int millis(); + #ifdef __cplusplus extern "C" { #endif @@ -35,6 +37,7 @@ #include "../../../core/millis_t.h" + ////////////////////////////////////////////////////////////////////////////////////// // These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to @@ -151,19 +154,18 @@ void u8g_i2c_init(uint8_t clock_option) { u8g_i2c_start(0); // send slave address and write bit } -volatile extern millis_t _millis; uint8_t u8g_i2c_send_byte(uint8_t data) { #define I2C_TIMEOUT 3 LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data LPC_I2C1->I2CONSET = I2C_I2CONSET_AA; LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC; - const millis_t timeout = _millis + I2C_TIMEOUT; - while ((I2C_status != I2C_I2STAT_M_TX_DAT_ACK) && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK) && PENDING(_millis, timeout)); // wait for xmit to finish + const millis_t timeout = millis() + I2C_TIMEOUT; + while ((I2C_status != I2C_I2STAT_M_TX_DAT_ACK) && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK) && PENDING(millis(), timeout)); // wait for xmit to finish // had hangs with SH1106 so added time out - have seen temporary screen corruption when this happens return 1; } -void u8g_i2c_stop(void) { +void u8g_i2c_stop() { } diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h similarity index 97% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.h rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h index 11e05ba0d0b6..9dd594cd9ef7 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.h +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h @@ -25,4 +25,4 @@ void u8g_i2c_init(uint8_t options); uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos); uint8_t u8g_i2c_start(uint8_t sla); uint8_t u8g_i2c_send_byte(uint8_t data); -void u8g_i2c_stop(void); +void u8g_i2c_stop(); diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_defines.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_defines.h rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_delay.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h similarity index 95% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_delay.h rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h index f37773d21cbe..8806e8747704 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_delay.h +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h @@ -35,8 +35,8 @@ #endif void U8g_delay(int msec); -void u8g_MicroDelay(void); -void u8g_10MicroDelay(void); +void u8g_MicroDelay(); +void u8g_10MicroDelay(); #ifdef __cplusplus } diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.c b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.c rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.h rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction index e93ff8b08dce..0222c62280e1 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction @@ -138,7 +138,7 @@ uint8_t u8g_i2c_start_sw(uint8_t sla) { // assert start condition and then send } -void u8g_i2c_stop_sw(void) { } +void u8g_i2c_stop_sw() { } void u8g_i2c_init_sw(uint8_t clock_option) { u8g_i2c_start(0); } // send slave address and write bit diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp index 59414e896b1e..0a1bd84875cf 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp @@ -60,7 +60,7 @@ #if ENABLED(U8GLIB_ST7920) #include -#include "SoftwareSPI.h" +#include #include "../../shared/Delay.h" #undef SPI_SPEED diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp index e243d4001367..7b6557148ada 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp @@ -59,7 +59,7 @@ #if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920) -#include "SoftwareSPI.h" +#include #undef SPI_SPEED #define SPI_SPEED 2 // About 2 MHz @@ -75,25 +75,25 @@ uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t sck for (uint8_t i = 0; i < 8; i++) { if (spi_speed == 0) { - gpio_set(mosi_pin, !!(b & 0x80)); - gpio_set(sck_pin, HIGH); + LPC176x::gpio_set(mosi_pin, !!(b & 0x80)); + LPC176x::gpio_set(sck_pin, HIGH); b <<= 1; - if (miso_pin >= 0 && gpio_get(miso_pin)) b |= 1; - gpio_set(sck_pin, LOW); + if (miso_pin >= 0 && LPC176x::gpio_get(miso_pin)) b |= 1; + LPC176x::gpio_set(sck_pin, LOW); } else { const uint8_t state = (b & 0x80) ? HIGH : LOW; for (uint8_t j = 0; j < spi_speed; j++) - gpio_set(mosi_pin, state); + LPC176x::gpio_set(mosi_pin, state); for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++) - gpio_set(sck_pin, HIGH); + LPC176x::gpio_set(sck_pin, HIGH); b <<= 1; - if (miso_pin >= 0 && gpio_get(miso_pin)) b |= 1; + if (miso_pin >= 0 && LPC176x::gpio_get(miso_pin)) b |= 1; for (uint8_t j = 0; j < spi_speed; j++) - gpio_set(sck_pin, LOW); + LPC176x::gpio_set(sck_pin, LOW); } } @@ -105,23 +105,23 @@ uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t sck for (uint8_t i = 0; i < 8; i++) { const uint8_t state = (b & 0x80) ? HIGH : LOW; if (spi_speed == 0) { - gpio_set(sck_pin, LOW); - gpio_set(mosi_pin, state); - gpio_set(mosi_pin, state); // need some setup time - gpio_set(sck_pin, HIGH); + LPC176x::gpio_set(sck_pin, LOW); + LPC176x::gpio_set(mosi_pin, state); + LPC176x::gpio_set(mosi_pin, state); // need some setup time + LPC176x::gpio_set(sck_pin, HIGH); } else { for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++) - gpio_set(sck_pin, LOW); + LPC176x::gpio_set(sck_pin, LOW); for (uint8_t j = 0; j < spi_speed; j++) - gpio_set(mosi_pin, state); + LPC176x::gpio_set(mosi_pin, state); for (uint8_t j = 0; j < spi_speed; j++) - gpio_set(sck_pin, HIGH); + LPC176x::gpio_set(sck_pin, HIGH); } b <<= 1; - if (miso_pin >= 0 && gpio_get(miso_pin)) b |= 1; + if (miso_pin >= 0 && LPC176x::gpio_get(miso_pin)) b |= 1; } return b; @@ -130,7 +130,7 @@ uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t sck static uint8_t SPI_speed = 0; static void u8g_sw_spi_HAL_LPC1768_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val) { - #if ENABLED(FYSETC_MINI_12864) + #if EITHER(FYSETC_MINI_12864, MKS_MINI_12864) swSpiTransfer_mode_3(val, SPI_speed, clockPin, -1, dataPin); #else swSpiTransfer_mode_0(val, SPI_speed, clockPin, -1, dataPin); @@ -158,10 +158,10 @@ uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, break; case U8G_COM_MSG_CHIP_SELECT: - #if ENABLED(FYSETC_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0 - if (arg_val) { // SCK idle state needs to be set to the proper idle state before - // the next chip select goes active - u8g_SetPILevel(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active + #if EITHER(FYSETC_MINI_12864, MKS_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0 + if (arg_val) { // SCK idle state needs to be set to the proper idle state before + // the next chip select goes active + u8g_SetPILevel(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active u8g_SetPILevel(u8g, U8G_PI_CS, LOW); } else { diff --git a/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py b/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py old mode 100644 new mode 100755 index 36242c96059d..b3ab59026eb4 --- a/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py +++ b/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py @@ -17,7 +17,7 @@ def print_error(e): print('\nUnable to find destination disk (' + e + ')\n' \ 'Please select it in platformio.ini using the upload_port keyword ' \ '(https://docs.platformio.org/en/latest/projectconf/section_env_upload.html) ' \ - 'or copy the firmware (.pioenvs/' + env.get('PIOENV') + '/firmware.bin) manually to the appropriate disk\n') + 'or copy the firmware (.pio/build/' + env.get('PIOENV') + '/firmware.bin) manually to the appropriate disk\n') try: if current_OS == 'Windows': @@ -31,9 +31,11 @@ def print_error(e): # import subprocess # typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\' - driveStr = subprocess.check_output("fsutil fsinfo drives") + driveStr = str(subprocess.check_output("fsutil fsinfo drives")) # typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\' - driveStr = driveStr.strip().lstrip('Drives: ') + # driveStr = driveStr.strip().lstrip('Drives: ') <- Doesn't work in other Languages as English. In German is "Drives:" = "Laufwerke:" + FirstFound = driveStr.find(':',0,-1) # Find the first ":" and + driveStr = driveStr[FirstFound + 1 : -1] # truncate to the rest # typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\', # 'G:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\', 'L:\\', 'M:\\', 'Y:\\', 'Z:\\'] drives = driveStr.split() @@ -44,7 +46,7 @@ def print_error(e): for drive in drives: final_drive_name = drive.strip().rstrip('\\') # typical result (string): 'C:' try: - volume_info = subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT) + volume_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT)) except Exception as e: continue else: diff --git a/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp b/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp index d143bae7098b..c83931745aa3 100644 --- a/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp @@ -1,13 +1,37 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + #ifdef TARGET_LPC1768 + #include "../../inc/MarlinConfigPre.h" #if ENABLED(EMERGENCY_PARSER) - #include "../../feature/emergency_parser.h" - EmergencyParser::State emergency_state; - bool CDC_RecvCallback(const char buffer) { - emergency_parser.update(emergency_state, buffer); - return true; - } -#endif // ENABLED(EMERGENCY_PARSER) +#include "../../feature/emergency_parser.h" +EmergencyParser::State emergency_state; +bool CDC_RecvCallback(const char buffer) { + emergency_parser.update(emergency_state, buffer); + return true; +} + +#endif // EMERGENCY_PARSER #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp b/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp index e6729ff58fcc..6d0200e9f1e9 100644 --- a/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp @@ -26,10 +26,10 @@ #if ENABLED(USE_WATCHDOG) -#include "lpc17xx_wdt.h" +#include #include "watchdog.h" -void watchdog_init(void) { +void watchdog_init() { #if ENABLED(WATCHDOG_RESET_MANUAL) // We enable the watchdog timer, but only for the interrupt. @@ -56,28 +56,16 @@ void watchdog_init(void) { WDT_Start(WDT_TIMEOUT); } -void HAL_clear_reset_source(void) { - WDT_ClrTimeOutFlag(); -} - -uint8_t HAL_get_reset_source(void) { - if (TEST(WDT_ReadTimeOutFlag(), 0)) return RST_WATCHDOG; - return RST_POWER_ON; -} - -void watchdog_reset() { +void HAL_watchdog_refresh() { WDT_Feed(); #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) TOGGLE(LED_PIN); // heartbeat indicator #endif } -#else - -void watchdog_init(void) {} -void watchdog_reset(void) {} -void HAL_clear_reset_source(void) {} -uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } +// Timeout state +bool watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); } +void watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); } #endif // USE_WATCHDOG diff --git a/Marlin/src/HAL/HAL_LPC1768/watchdog.h b/Marlin/src/HAL/HAL_LPC1768/watchdog.h index 04ce17fe9d52..dd6617ea315a 100644 --- a/Marlin/src/HAL/HAL_LPC1768/watchdog.h +++ b/Marlin/src/HAL/HAL_LPC1768/watchdog.h @@ -23,7 +23,8 @@ #define WDT_TIMEOUT 4000000 // 4 second timeout -void watchdog_init(void); -void watchdog_reset(void); -void HAL_clear_reset_source(void); -uint8_t HAL_get_reset_source(void); +void watchdog_init(); +void HAL_watchdog_refresh(); + +bool watchdog_timed_out(); +void watchdog_clear_timeout_flag(); diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL.cpp b/Marlin/src/HAL/HAL_SAMD51/HAL.cpp new file mode 100644 index 000000000000..1c53042f8d5e --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/HAL.cpp @@ -0,0 +1,478 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ + +#ifdef __SAMD51__ + +#include "../../inc/MarlinConfig.h" +#include +#include + +// ------------------------ +// Local defines +// ------------------------ + +#if HAS_TEMP_ADC_0 + #define GET_TEMP_0_ADC() PIN_TO_ADC(TEMP_0_PIN) +#else + #define GET_TEMP_0_ADC() -1 +#endif +#if HAS_TEMP_ADC_1 + #define GET_TEMP_1_ADC() PIN_TO_ADC(TEMP_1_PIN) +#else + #define GET_TEMP_1_ADC() -1 +#endif +#if HAS_TEMP_ADC_2 + #define GET_TEMP_2_ADC() PIN_TO_ADC(TEMP_2_PIN) +#else + #define GET_TEMP_2_ADC() -1 +#endif +#if HAS_TEMP_ADC_3 + #define GET_TEMP_3_ADC() PIN_TO_ADC(TEMP_3_PIN) +#else + #define GET_TEMP_3_ADC() -1 +#endif +#if HAS_TEMP_ADC_4 + #define GET_TEMP_4_ADC() PIN_TO_ADC(TEMP_4_PIN) +#else + #define GET_TEMP_4_ADC() -1 +#endif +#if HAS_TEMP_ADC_5 + #define GET_TEMP_5_ADC() PIN_TO_ADC(TEMP_5_PIN) +#else + #define GET_TEMP_5_ADC() -1 +#endif +#if HAS_TEMP_ADC_BED + #define GET_BED_ADC() PIN_TO_ADC(TEMP_BED_PIN) +#else + #define GET_BED_ADC() -1 +#endif +#if HAS_TEMP_ADC_CHAMBER + #define GET_CHAMBER_ADC() PIN_TO_ADC(TEMP_CHAMBER_PIN) +#else + #define GET_CHAMBER_ADC() -1 +#endif +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define GET_FILAMENT_WIDTH_ADC() PIN_TO_ADC(FILWIDTH_PIN) +#else + #define GET_FILAMENT_WIDTH_ADC() -1 +#endif +#if HAS_ADC_BUTTONS + #define GET_BUTTONS_ADC() PIN_TO_ADC(ADC_KEYPAD_PIN) +#else + #define GET_BUTTONS_ADC() -1 +#endif + +#define IS_ADC_REQUIRED(n) (GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n \ + || GET_TEMP_3_ADC() == n || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n \ + || GET_BED_ADC() == n \ + || GET_CHAMBER_ADC() == n \ + || GET_FILAMENT_WIDTH_ADC() == n \ + || GET_BUTTONS_ADC() == n) + +#define ADC0_IS_REQUIRED IS_ADC_REQUIRED(0) +#define ADC1_IS_REQUIRED IS_ADC_REQUIRED(1) +#define ADC_IS_REQUIRED (ADC0_IS_REQUIRED || ADC1_IS_REQUIRED) +#if ADC0_IS_REQUIRED + #define FIRST_ADC 0 +#else + #define FIRST_ADC 1 +#endif +#if ADC1_IS_REQUIRED + #define LAST_ADC 1 +#else + #define LAST_ADC 0 +#endif + +#define DMA_IS_REQUIRED ADC_IS_REQUIRED + +// ------------------------ +// Types +// ------------------------ + +#if DMA_IS_REQUIRED + + // Struct must be 32 bits aligned because of DMA accesses but fields needs to be 8 bits packed + typedef struct __attribute__((aligned(4), packed)) { + ADC_INPUTCTRL_Type INPUTCTRL; + } HAL_DMA_DAC_Registers; // DMA transfered registers + +#endif + +// ------------------------ +// Private Variables +// ------------------------ + +uint16_t HAL_adc_result; + +#if ADC_IS_REQUIRED + + // Pins used by ADC inputs. Order must be ADC0 inputs first then ADC1 + const uint8_t adc_pins[] = { + // ADC0 pins + #if GET_TEMP_0_ADC() == 0 + TEMP_0_PIN, + #endif + #if GET_TEMP_1_ADC() == 0 + TEMP_1_PIN, + #endif + #if GET_TEMP_2_ADC() == 0 + TEMP_2_PIN, + #endif + #if GET_TEMP_3_ADC() == 0 + TEMP_3_PIN, + #endif + #if GET_TEMP_4_ADC() == 0 + TEMP_4_PIN, + #endif + #if GET_TEMP_5_ADC() == 0 + TEMP_5_PIN, + #endif + #if GET_BED_ADC() == 0 + TEMP_BED_PIN, + #endif + #if GET_CHAMBER_ADC() == 0 + TEMP_CHAMBER_PIN, + #endif + #if GET_FILAMENT_WIDTH_ADC() == 0 + FILWIDTH_PIN, + #endif + #if GET_BUTTONS_ADC() == 0 + ADC_KEYPAD_PIN, + #endif + // ADC1 pins + #if GET_TEMP_0_ADC() == 1 + TEMP_0_PIN, + #endif + #if GET_TEMP_1_ADC() == 1 + TEMP_1_PIN, + #endif + #if GET_TEMP_2_ADC() == 1 + TEMP_2_PIN, + #endif + #if GET_TEMP_3_ADC() == 1 + TEMP_3_PIN, + #endif + #if GET_TEMP_4_ADC() == 1 + TEMP_4_PIN, + #endif + #if GET_TEMP_5_ADC() == 1 + TEMP_5_PIN, + #endif + #if GET_BED_ADC() == 1 + TEMP_BED_PIN, + #endif + #if GET_CHAMBER_ADC() == 1 + TEMP_CHAMBER_PIN, + #endif + #if GET_FILAMENT_WIDTH_ADC() == 1 + FILWIDTH_PIN, + #endif + #if GET_BUTTONS_ADC() == 1 + ADC_KEYPAD_PIN, + #endif + }; + + uint16_t HAL_adc_results[COUNT(adc_pins)]; + + #if ADC0_IS_REQUIRED + Adafruit_ZeroDMA adc0DMAProgram, + adc0DMARead; + + const HAL_DMA_DAC_Registers adc0_dma_regs_list[] = { + #if GET_TEMP_0_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_0_PIN) }, + #endif + #if GET_TEMP_1_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_1_PIN) }, + #endif + #if GET_TEMP_2_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_2_PIN) }, + #endif + #if GET_TEMP_3_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_3_PIN) }, + #endif + #if GET_TEMP_4_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_4_PIN) }, + #endif + #if GET_TEMP_5_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_5_PIN) }, + #endif + #if GET_BED_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_BED_PIN) }, + #endif + #if GET_CHAMBER_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_CHAMBER_PIN) }, + #endif + #if GET_FILAMENT_WIDTH_ADC() == 0 + { PIN_TO_INPUTCTRL(FILWIDTH_PIN) }, + #endif + #if GET_BUTTONS_ADC() == 0 + { PIN_TO_INPUTCTRL(ADC_KEYPAD_PIN) }, + #endif + }; + + #define ADC0_AINCOUNT COUNT(adc0_dma_regs_list) + #endif // ADC0_IS_REQUIRED + + #if ADC1_IS_REQUIRED + Adafruit_ZeroDMA adc1DMAProgram, + adc1DMARead; + + const HAL_DMA_DAC_Registers adc1_dma_regs_list[] = { + #if GET_TEMP_0_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_0_PIN) }, + #endif + #if GET_TEMP_1_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_1_PIN) }, + #endif + #if GET_TEMP_2_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_2_PIN) }, + #endif + #if GET_TEMP_3_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_3_PIN) }, + #endif + #if GET_TEMP_4_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_4_PIN) }, + #endif + #if GET_TEMP_5_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_5_PIN) }, + #endif + #if GET_BED_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_BED_PIN) }, + #endif + #if GET_CHAMBER_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_CHAMBER_PIN) }, + #endif + #if GET_FILAMENT_WIDTH_ADC() == 1 + { PIN_TO_INPUTCTRL(FILWIDTH_PIN) }, + #endif + #if GET_BUTTONS_ADC() == 1 + { PIN_TO_INPUTCTRL(ADC_KEYPAD_PIN) }, + #endif + }; + + #define ADC1_AINCOUNT COUNT(adc1_dma_regs_list) + #endif // ADC1_IS_REQUIRED + +#endif // ADC_IS_REQUIRED + +// ------------------------ +// Private functions +// ------------------------ + +#if DMA_IS_REQUIRED + + void dma_init() { + DmacDescriptor *descriptor; + + #if ADC0_IS_REQUIRED + adc0DMAProgram.setTrigger(ADC0_DMAC_ID_SEQ); + adc0DMAProgram.setAction(DMA_TRIGGER_ACTON_BEAT); + adc0DMAProgram.loop(true); + if (adc0DMAProgram.allocate() == DMA_STATUS_OK) { + descriptor = adc0DMAProgram.addDescriptor( + (void *)adc0_dma_regs_list, // SRC + (void *)&ADC0->DSEQDATA.reg, // DEST + sizeof(adc0_dma_regs_list) / 4, // CNT + DMA_BEAT_SIZE_WORD, + true, // SRCINC + false, // DSTINC + DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE + DMA_STEPSEL_SRC // STEPSEL + ); + if (descriptor != nullptr) + descriptor->BTCTRL.bit.EVOSEL = DMA_EVENT_OUTPUT_BEAT; + adc0DMAProgram.startJob(); + } + + adc0DMARead.setTrigger(ADC0_DMAC_ID_RESRDY); + adc0DMARead.setAction(DMA_TRIGGER_ACTON_BEAT); + adc0DMARead.loop(true); + if (adc0DMARead.allocate() == DMA_STATUS_OK) { + adc0DMARead.addDescriptor( + (void *)&ADC0->RESULT.reg, // SRC + &HAL_adc_results, // DEST + ADC0_AINCOUNT, // CNT + DMA_BEAT_SIZE_HWORD, + false, // SRCINC + true, // DSTINC + DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE + DMA_STEPSEL_DST // STEPSEL + ); + adc0DMARead.startJob(); + } + #endif + #if ADC1_IS_REQUIRED + adc1DMAProgram.setTrigger(ADC1_DMAC_ID_SEQ); + adc1DMAProgram.setAction(DMA_TRIGGER_ACTON_BEAT); + adc1DMAProgram.loop(true); + if (adc1DMAProgram.allocate() == DMA_STATUS_OK) { + descriptor = adc1DMAProgram.addDescriptor( + (void *)adc1_dma_regs_list, // SRC + (void *)&ADC1->DSEQDATA.reg, // DEST + sizeof(adc1_dma_regs_list) / 4, // CNT + DMA_BEAT_SIZE_WORD, + true, // SRCINC + false, // DSTINC + DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE + DMA_STEPSEL_SRC // STEPSEL + ); + if (descriptor != nullptr) + descriptor->BTCTRL.bit.EVOSEL = DMA_EVENT_OUTPUT_BEAT; + adc1DMAProgram.startJob(); + } + + adc1DMARead.setTrigger(ADC1_DMAC_ID_RESRDY); + adc1DMARead.setAction(DMA_TRIGGER_ACTON_BEAT); + adc1DMARead.loop(true); + if (adc1DMARead.allocate() == DMA_STATUS_OK) { + adc1DMARead.addDescriptor( + (void *)&ADC1->RESULT.reg, // SRC + &HAL_adc_results[ADC0_AINCOUNT], // DEST + ADC1_AINCOUNT, // CNT + DMA_BEAT_SIZE_HWORD, + false, // SRCINC + true, // DSTINC + DMA_ADDRESS_INCREMENT_STEP_SIZE_1, // STEPSIZE + DMA_STEPSEL_DST // STEPSEL + ); + adc1DMARead.startJob(); + } + #endif + + DMAC->PRICTRL0.bit.RRLVLEN0 = true; // Activate round robin for DMA channels required by ADCs + } + +#endif // DMA_IS_REQUIRED + +// ------------------------ +// Public functions +// ------------------------ + +// HAL initialization task +void HAL_init() { + #if DMA_IS_REQUIRED + dma_init(); + #endif + #if ENABLED(SDSUPPORT) + // SD_DETECT_PIN may be removed if NO_SD_HOST_DRIVE is not defined in Configuration_adv.h + #if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT) + SET_INPUT_PULLUP(SD_DETECT_PIN); + #endif + OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up + #endif +} + +// HAL idle task +/* +void HAL_idletask() { +} +*/ + +void HAL_clear_reset_source() { } + +#pragma push_macro("WDT") +#undef WDT // Required to be able to use '.bit.WDT'. Compiler wrongly replace struct field with WDT define +uint8_t HAL_get_reset_source() { + RSTC_RCAUSE_Type resetCause; + + resetCause.reg = REG_RSTC_RCAUSE; + if (resetCause.bit.POR) return RST_POWER_ON; + else if (resetCause.bit.EXT) return RST_EXTERNAL; + else if (resetCause.bit.BODCORE || resetCause.bit.BODVDD) return RST_BROWN_OUT; + else if (resetCause.bit.WDT) return RST_WATCHDOG; + else if (resetCause.bit.SYST || resetCause.bit.NVM) return RST_SOFTWARE; + else if (resetCause.bit.BACKUP) return RST_BACKUP; + return 0; +} +#pragma pop_macro("WDT") + +extern "C" { + void * _sbrk(int incr); + + extern unsigned int __bss_end__; // end of bss section +} + +// Return free memory between end of heap (or end bss) and whatever is current +int freeMemory() { + int free_memory, heap_end = (int)_sbrk(0); + return (int)&free_memory - (heap_end ?: (int)&__bss_end__); +} + +// ------------------------ +// ADC +// ------------------------ + +void HAL_adc_init() { + #if ADC_IS_REQUIRED + memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results)); // Fill result with invalid values + + for (uint8_t pi = 0; pi < COUNT(adc_pins); ++pi) + pinPeripheral(adc_pins[pi], PIO_ANALOG); + + for (uint8_t ai = FIRST_ADC; ai <= LAST_ADC; ++ai) { + Adc* adc = ((Adc*[])ADC_INSTS)[ai]; + + // ADC clock setup + GCLK->PCHCTRL[ADC0_GCLK_ID + ai].bit.CHEN = false; + SYNC(GCLK->PCHCTRL[ADC0_GCLK_ID + ai].bit.CHEN); + GCLK->PCHCTRL[ADC0_GCLK_ID + ai].reg = GCLK_PCHCTRL_GEN_GCLK1 | GCLK_PCHCTRL_CHEN; // 48MHz startup code programmed + SYNC(!GCLK->PCHCTRL[ADC0_GCLK_ID + ai].bit.CHEN); + adc->CTRLA.bit.PRESCALER = ADC_CTRLA_PRESCALER_DIV32_Val; // 1.5MHZ adc clock + + // ADC setup + // Preloaded data (fixed for all ADC instances hence not loaded by DMA) + adc->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_AREFA_Val; // VRefA pin + SYNC(adc->SYNCBUSY.bit.REFCTRL); + adc->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_12BIT_Val; + SYNC(adc->SYNCBUSY.bit.CTRLB); + adc->SAMPCTRL.bit.SAMPLEN = (6 - 1); // Sampling clocks + adc->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_16 | ADC_AVGCTRL_ADJRES(4); // 16 Accumulated conversions and shift 4 to get oversampled 12 bits result + SYNC(adc->SYNCBUSY.bit.AVGCTRL); + // Registers loaded by DMA + adc->DSEQCTRL.bit.INPUTCTRL = true; + + adc->DSEQCTRL.bit.AUTOSTART = true; // Start conversion after DMA sequence + + adc->CTRLA.bit.ENABLE = true; // Enable ADC + SYNC(adc->SYNCBUSY.bit.ENABLE); + } + #endif // ADC_IS_REQUIRED +} + +void HAL_adc_start_conversion(const uint8_t adc_pin) { + #if ADC_IS_REQUIRED + for (uint8_t pi = 0; pi < COUNT(adc_pins); ++pi) { + if (adc_pin == adc_pins[pi]) { + HAL_adc_result = HAL_adc_results[pi]; + return; + } + } + #endif + + HAL_adc_result = 0xFFFF; +} + +uint16_t HAL_adc_get_result() { + return HAL_adc_result; +} + +#endif // __SAMD51__ diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL.h b/Marlin/src/HAL/HAL_SAMD51/HAL.h new file mode 100644 index 000000000000..dea84da5d1e8 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/HAL.h @@ -0,0 +1,158 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +#define CPU_32_BIT + +#include "../shared/Marduino.h" +#include "../shared/math_32bit.h" +#include "../shared/HAL_SPI.h" +#include "fastio.h" +#include "watchdog.h" +#include "timers.h" + +#ifdef ADAFRUIT_GRAND_CENTRAL_M4 + #include "MarlinSerial_AGCM4.h" + + // Serial ports + #if !WITHIN(SERIAL_PORT, -1, 3) + #error "SERIAL_PORT must be from -1 to 3" + #endif + + // MYSERIAL0 required before MarlinSerial includes! + #if SERIAL_PORT == -1 + #define MYSERIAL0 Serial + #elif SERIAL_PORT == 0 + #define MYSERIAL0 Serial1 + #elif SERIAL_PORT == 1 + #define MYSERIAL0 Serial2 + #elif SERIAL_PORT == 2 + #define MYSERIAL0 Serial3 + #else + #define MYSERIAL0 Serial4 + #endif + + #ifdef SERIAL_PORT_2 + #if !WITHIN(SERIAL_PORT_2, -1, 3) + #error "SERIAL_PORT_2 must be from -1 to 3" + #elif SERIAL_PORT_2 == SERIAL_PORT + #error "SERIAL_PORT_2 must be different than SERIAL_PORT" + #endif + #define NUM_SERIAL 2 + #if SERIAL_PORT_2 == -1 + #define MYSERIAL1 Serial + #elif SERIAL_PORT_2 == 0 + #define MYSERIAL1 Serial1 + #elif SERIAL_PORT_2 == 1 + #define MYSERIAL1 Serial2 + #elif SERIAL_PORT_2 == 2 + #define MYSERIAL1 Serial3 + #else + #define MYSERIAL1 Serial4 + #endif + #else + #define NUM_SERIAL 1 + #endif + +#endif // ADAFRUIT_GRAND_CENTRAL_M4 + +typedef int8_t pin_t; + +#define SHARED_SERVOS HAS_SERVOS +#define HAL_SERVO_LIB Servo + +// +// Interrupts +// +#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() +#define CRITICAL_SECTION_END if (!primask) __enable_irq() +#define ISRS_ENABLED() (!__get_PRIMASK()) +#define ENABLE_ISRS() __enable_irq() +#define DISABLE_ISRS() __disable_irq() + +#define cli() __disable_irq() // Disable interrupts +#define sei() __enable_irq() // Enable interrupts + +void HAL_clear_reset_source(); // clear reset reason +uint8_t HAL_get_reset_source(); // get reset reason + +// +// EEPROM +// +void eeprom_write_byte(uint8_t *pos, unsigned char value); +uint8_t eeprom_read_byte(uint8_t *pos); + +// +// ADC +// +extern uint16_t HAL_adc_result; // result of last ADC conversion + +#define HAL_ANALOG_SELECT(pin) + +void HAL_adc_init(); + +#define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL +#define HAL_ADC_RESOLUTION 12 +#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_READ_ADC() HAL_adc_result +#define HAL_ADC_READY() true + +void HAL_adc_start_conversion(const uint8_t adc_pin); +uint16_t HAL_adc_get_result(); + +// +// Pin Map +// +#define GET_PIN_MAP_PIN(index) index +#define GET_PIN_MAP_INDEX(pin) pin +#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + +// +// Tone +// +void toneInit(); +void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); +void noTone(const pin_t _pin); + +// Enable hooks into idle and setup for HAL +void HAL_init(); +/* +#define HAL_IDLETASK 1 +void HAL_idletask(); +*/ + +// +// Utility functions +// +FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +int freeMemory(); +#pragma GCC diagnostic pop + +#ifdef __cplusplus + extern "C" { +#endif +char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s); +#ifdef __cplusplus + } +#endif diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp b/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp new file mode 100644 index 000000000000..bbd12912a2c1 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp @@ -0,0 +1,151 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ + +/** + * Hardware and software SPI implementations are included in this file. + * + * Control of the slave select pin(s) is handled by the calling routines and + * SAMD51 let hardware SPI handling to remove SS from its logic. + */ + +#ifdef __SAMD51__ + +// -------------------------------------------------------------------------- +// Includes +// -------------------------------------------------------------------------- + +#include "../../inc/MarlinConfig.h" +#include + +// -------------------------------------------------------------------------- +// Public functions +// -------------------------------------------------------------------------- + +#if EITHER(SOFTWARE_SPI, FORCE_SOFT_SPI) + + // ------------------------ + // Software SPI + // ------------------------ + #error "Software SPI not supported for SAMD51. Use Hardware SPI." + + #if SD_CONNECTION_IS(ONBOARD) + #endif + +#else // !SOFTWARE_SPI + + #ifdef ADAFRUIT_GRAND_CENTRAL_M4 + #if SD_CONNECTION_IS(ONBOARD) + #define sdSPI SDCARD_SPI + #else + #define sdSPI SPI + #endif + #endif + + static SPISettings spiConfig; + + // ------------------------ + // Hardware SPI + // ------------------------ + void spiBegin() { + spiInit(SPI_HALF_SPEED); + } + + void spiInit(uint8_t spiRate) { + // Use datarates Marlin uses + uint32_t clock; + switch (spiRate) { + case SPI_FULL_SPEED: clock = 8000000; break; + case SPI_HALF_SPEED: clock = 4000000; break; + case SPI_QUARTER_SPEED: clock = 2000000; break; + case SPI_EIGHTH_SPEED: clock = 1000000; break; + case SPI_SIXTEENTH_SPEED: clock = 500000; break; + case SPI_SPEED_5: clock = 250000; break; + case SPI_SPEED_6: clock = 125000; break; + default: clock = 4000000; break; // Default from the SPI library + } + spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); + sdSPI.begin(); + } + + /** + * @brief Receives a single byte from the SPI port. + * + * @return Byte received + * + * @details + */ + uint8_t spiRec() { + sdSPI.beginTransaction(spiConfig); + uint8_t returnByte = sdSPI.transfer(0xFF); + sdSPI.endTransaction(); + return returnByte; + } + + /** + * @brief Receives a number of bytes from the SPI port to a buffer + * + * @param buf Pointer to starting address of buffer to write to. + * @param nbyte Number of bytes to receive. + * @return Nothing + */ + void spiRead(uint8_t* buf, uint16_t nbyte) { + if (nbyte == 0) return; + memset(buf, 0xFF, nbyte); + sdSPI.beginTransaction(spiConfig); + sdSPI.transfer(buf, nbyte); + sdSPI.endTransaction(); + } + + /** + * @brief Sends a single byte on SPI port + * + * @param b Byte to send + * + * @details + */ + void spiSend(uint8_t b) { + sdSPI.beginTransaction(spiConfig); + sdSPI.transfer(b); + sdSPI.endTransaction(); + } + + /** + * @brief Write token and then write from 512 byte buffer to SPI (for SD card) + * + * @param buf Pointer with buffer start address + * @return Nothing + * + * @details Uses DMA + */ + void spiSendBlock(uint8_t token, const uint8_t* buf) { + sdSPI.beginTransaction(spiConfig); + sdSPI.transfer(token); + sdSPI.transfer((uint8_t*)buf, nullptr, 512); + sdSPI.endTransaction(); + } + + void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { + spiConfig = SPISettings(spiClock, (BitOrder)bitOrder, dataMode); + sdSPI.beginTransaction(spiConfig); + } +#endif // !SOFTWARE_SPI + +#endif // __SAMD51__ diff --git a/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp b/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp new file mode 100644 index 000000000000..2da4d8c07e00 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp @@ -0,0 +1,55 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ + +#ifdef ADAFRUIT_GRAND_CENTRAL_M4 + +/** + * Framework doesn't define some serial to save sercom resources + * hence if these are used I need to define them + */ + +#include "../../inc/MarlinConfig.h" + +#if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 + Uart Serial2(&sercom4, PIN_SERIAL2_RX, PIN_SERIAL2_TX, PAD_SERIAL2_RX, PAD_SERIAL2_TX); + void SERCOM4_0_Handler() { Serial2.IrqHandler(); } + void SERCOM4_1_Handler() { Serial2.IrqHandler(); } + void SERCOM4_2_Handler() { Serial2.IrqHandler(); } + void SERCOM4_3_Handler() { Serial2.IrqHandler(); } +#endif + +#if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 + Uart Serial3(&sercom1, PIN_SERIAL3_RX, PIN_SERIAL3_TX, PAD_SERIAL3_RX, PAD_SERIAL3_TX); + void SERCOM1_0_Handler() { Serial3.IrqHandler(); } + void SERCOM1_1_Handler() { Serial3.IrqHandler(); } + void SERCOM1_2_Handler() { Serial3.IrqHandler(); } + void SERCOM1_3_Handler() { Serial3.IrqHandler(); } +#endif + +#if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 + Uart Serial4(&sercom5, PIN_SERIAL4_RX, PIN_SERIAL4_TX, PAD_SERIAL4_RX, PAD_SERIAL4_TX); + void SERCOM5_0_Handler() { Serial4.IrqHandler(); } + void SERCOM5_1_Handler() { Serial4.IrqHandler(); } + void SERCOM5_2_Handler() { Serial4.IrqHandler(); } + void SERCOM5_3_Handler() { Serial4.IrqHandler(); } +#endif + +#endif // ADAFRUIT_GRAND_CENTRAL_M4 diff --git a/Marlin/src/HAL/HAL_STM32F7/spi_pins.h b/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h similarity index 85% rename from Marlin/src/HAL/HAL_STM32F7/spi_pins.h rename to Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h index 267cba6fd00b..0768d8a04eff 100644 --- a/Marlin/src/HAL/HAL_STM32F7/spi_pins.h +++ b/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h @@ -1,6 +1,8 @@ /** * Marlin 3D Printer Firmware + * * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) * * 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 @@ -18,10 +20,6 @@ */ #pragma once -/** - * Define SPI Pins: SCK, MISO, MOSI, SS - */ -#define SCK_PIN PA5 -#define MISO_PIN PA6 -#define MOSI_PIN PA7 -#define SS_PIN PA8 +extern Uart Serial2; +extern Uart Serial3; +extern Uart Serial4; diff --git a/Marlin/src/HAL/HAL_SAMD51/SAMD51.h b/Marlin/src/HAL/HAL_SAMD51/SAMD51.h new file mode 100644 index 000000000000..d29d134c0056 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/SAMD51.h @@ -0,0 +1,70 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +#define SYNC(sc) while (sc) { \ + asm(""); \ + } + +// Get SAMD port/pin from specified arduino pin +#define GET_SAMD_PORT(P) _GET_SAMD_PORT(PIN_TO_SAMD_PIN(P)) +#define GET_SAMD_PIN(P) _GET_SAMD_PIN(PIN_TO_SAMD_PIN(P)) + +// Get external interrupt line associated to specified arduino pin +#define PIN_TO_EILINE(P) _SAMDPORTPIN_TO_EILINE(GET_SAMD_PORT(P), GET_SAMD_PIN(P)) + +// Get adc/ain associated to specified arduino pin +#define PIN_TO_ADC(P) (ANAPIN_TO_ADCAIN(P) >> 8) +#define PIN_TO_AIN(P) (ANAPIN_TO_ADCAIN(P) & 0xFF) + +// Private defines +#define PIN_TO_SAMD_PIN(P) DIO##P##_PIN + +#define _GET_SAMD_PORT(P) ((P) >> 5) +#define _GET_SAMD_PIN(P) ((P) & 0x1F) + +// Get external interrupt line +#define _SAMDPORTPIN_TO_EILINE(P,B) ((P == 0 && WITHIN(B, 0, 31) && B != 8 && B != 26 && B != 28 && B != 29) ? (B) & 0xF \ + : (P == 1 && (WITHIN(B, 0, 25) || WITHIN(B, 30, 31))) ? (B) & 0xF \ + : (P == 1 && WITHIN(B, 26, 29)) ? 12 + (B) - 26 \ + : (P == 2 && (WITHIN(B, 0, 6) || WITHIN(B, 10, 31)) && B != 29) ? (B) & 0xF \ + : (P == 2 && B == 7) ? 9 \ + : (P == 3 && WITHIN(B, 0, 1)) ? (B) \ + : (P == 3 && WITHIN(B, 8, 12)) ? 3 + (B) - 8 \ + : (P == 3 && WITHIN(B, 20, 21)) ? 10 + (B) - 20 \ + : -1) + +// Get adc/ain +#define ANAPIN_TO_ADCAIN(P) _PIN_TO_ADCAIN(ANAPIN_TO_SAMDPIN(P)) +#define _PIN_TO_ADCAIN(P) _SAMDPORTPIN_TO_ADCAIN(_GET_SAMD_PORT(P), _GET_SAMD_PIN(P)) + +#define _SAMDPORTPIN_TO_ADCAIN(P,B) ((P == 0 && WITHIN(B, 2, 3)) ? 0x000 + (B) - 2 \ + : (P == 0 && WITHIN(B, 4, 7)) ? 0x000 + (B) \ + : (P == 0 && WITHIN(B, 8, 9)) ? 0x100 + 2 + (B) - 8 \ + : (P == 0 && WITHIN(B, 10, 11)) ? 0x000 + (B) \ + : (P == 1 && WITHIN(B, 0, 3)) ? 0x000 + 12 + (B) \ + : (P == 1 && WITHIN(B, 4, 7)) ? 0x100 + 6 + (B) - 4 \ + : (P == 1 && WITHIN(B, 8, 9)) ? 0x100 + (B) - 8 \ + : (P == 2 && WITHIN(B, 0, 1)) ? 0x100 + 10 + (B) \ + : (P == 2 && WITHIN(B, 2, 3)) ? 0x100 + 4 + (B) - 2 \ + : (P == 2 && WITHIN(B, 30, 31)) ? 0x100 + 12 + (B) - 30 \ + : (P == 3 && WITHIN(B, 0, 1)) ? 0x100 + 14 + (B) \ + : -1) diff --git a/Marlin/src/HAL/HAL_SAMD51/Servo.cpp b/Marlin/src/HAL/HAL_SAMD51/Servo.cpp new file mode 100644 index 000000000000..dbae75042513 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/Servo.cpp @@ -0,0 +1,226 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ + +/** + * This comes from Arduino library which at the moment is buggy and uncompilable + */ + +#ifdef __SAMD51__ + +#include "../../inc/MarlinConfig.h" + +#if HAS_SERVOS + +#include "../shared/Marduino.h" +#include "../shared/servo.h" +#include "../shared/servo_private.h" +#include "SAMD51.h" +#include "timers.h" + +#define __TC_GCLK_ID(t) TC##t##_GCLK_ID +#define _TC_GCLK_ID(t) __TC_GCLK_ID(t) +#define TC_GCLK_ID _TC_GCLK_ID(SERVO_TC) + +#define _TC_PRESCALER(d) TC_CTRLA_PRESCALER_DIV##d##_Val +#define TC_PRESCALER(d) _TC_PRESCALER(d) + +#define __SERVO_IRQn(t) TC##t##_IRQn +#define _SERVO_IRQn(t) __SERVO_IRQn(t) +#define SERVO_IRQn _SERVO_IRQn(SERVO_TC) + +#define HAL_SERVO_TIMER_ISR() TC_HANDLER(SERVO_TC) + +#define TIMER_TCCHANNEL(t) ((t) & 1) +#define TC_COUNTER_START_VAL 0xFFFF + + +static volatile int8_t currentServoIndex[_Nbr_16timers]; // index for the servo being pulsed for each timer (or -1 if refresh interval) + +FORCE_INLINE static uint16_t getTimerCount() { + Tc * const tc = TimerConfig[SERVO_TC].pTimer; + + tc->COUNT16.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC; + SYNC(tc->COUNT16.SYNCBUSY.bit.CTRLB || tc->COUNT16.SYNCBUSY.bit.COUNT); + + return tc->COUNT16.COUNT.reg; +} + +// ---------------------------- +// Interrupt handler for the TC +// ---------------------------- +HAL_SERVO_TIMER_ISR() { + Tc * const tc = TimerConfig[SERVO_TC].pTimer; + const timer16_Sequence_t timer = + #ifndef _useTimer1 + _timer2 + #elif !defined(_useTimer2) + _timer1 + #else + (tc->COUNT16.INTFLAG.reg & tc->COUNT16.INTENSET.reg & TC_INTFLAG_MC0) ? _timer1 : _timer2 + #endif + ; + const uint8_t tcChannel = TIMER_TCCHANNEL(timer); + + if (currentServoIndex[timer] < 0) { + #if defined(_useTimer1) && defined(_useTimer2) + if (currentServoIndex[timer ^ 1] >= 0) { + // Wait for both channels + // Clear the interrupt + tc->COUNT16.INTFLAG.reg = (tcChannel == 0) ? TC_INTFLAG_MC0 : TC_INTFLAG_MC1; + return; + } + #endif + tc->COUNT16.COUNT.reg = TC_COUNTER_START_VAL; + SYNC(tc->COUNT16.SYNCBUSY.bit.COUNT); + } + else if (SERVO_INDEX(timer, currentServoIndex[timer]) < ServoCount && SERVO(timer, currentServoIndex[timer]).Pin.isActive) + digitalWrite(SERVO(timer, currentServoIndex[timer]).Pin.nbr, LOW); // pulse this channel low if activated + + // Select the next servo controlled by this timer + currentServoIndex[timer]++; + + if (SERVO_INDEX(timer, currentServoIndex[timer]) < ServoCount && currentServoIndex[timer] < SERVOS_PER_TIMER) { + if (SERVO(timer, currentServoIndex[timer]).Pin.isActive) // check if activated + digitalWrite(SERVO(timer, currentServoIndex[timer]).Pin.nbr, HIGH); // it's an active channel so pulse it high + + tc->COUNT16.CC[tcChannel].reg = getTimerCount() - (uint16_t)SERVO(timer, currentServoIndex[timer]).ticks; + } + else { + // finished all channels so wait for the refresh period to expire before starting over + currentServoIndex[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel + + const uint16_t tcCounterValue = getTimerCount(); + + if ((TC_COUNTER_START_VAL - tcCounterValue) + 4UL < usToTicks(REFRESH_INTERVAL)) // allow a few ticks to ensure the next OCR1A not missed + tc->COUNT16.CC[tcChannel].reg = TC_COUNTER_START_VAL - (uint16_t)usToTicks(REFRESH_INTERVAL); + else + tc->COUNT16.CC[tcChannel].reg = (uint16_t)(tcCounterValue - 4UL); // at least REFRESH_INTERVAL has elapsed + } + if (tcChannel == 0) { + SYNC(tc->COUNT16.SYNCBUSY.bit.CC0); + // Clear the interrupt + tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC0; + } + else { + SYNC(tc->COUNT16.SYNCBUSY.bit.CC1); + // Clear the interrupt + tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC1; + } +} + +void initISR(timer16_Sequence_t timer) { + Tc * const tc = TimerConfig[SERVO_TC].pTimer; + const uint8_t tcChannel = TIMER_TCCHANNEL(timer); + + static bool initialized = false; // Servo TC has been initialized + if (!initialized) { + NVIC_DisableIRQ(SERVO_IRQn); + + // Disable the timer + tc->COUNT16.CTRLA.bit.ENABLE = false; + SYNC(tc->COUNT16.SYNCBUSY.bit.ENABLE); + + // Select GCLK0 as timer/counter input clock source + GCLK->PCHCTRL[TC_GCLK_ID].bit.CHEN = false; + SYNC(GCLK->PCHCTRL[TC_GCLK_ID].bit.CHEN); + GCLK->PCHCTRL[TC_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK0 | GCLK_PCHCTRL_CHEN; // 120MHz startup code programmed + SYNC(!GCLK->PCHCTRL[TC_GCLK_ID].bit.CHEN); + + // Reset the timer + tc->COUNT16.CTRLA.bit.SWRST = true; + SYNC(tc->COUNT16.SYNCBUSY.bit.SWRST); + SYNC(tc->COUNT16.CTRLA.bit.SWRST); + + // Set timer counter mode to 16 bits + tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16; + + // Set timer counter mode as normal PWM + tc->COUNT16.WAVE.bit.WAVEGEN = TCC_WAVE_WAVEGEN_NPWM_Val; + + // Set the prescaler factor + tc->COUNT16.CTRLA.bit.PRESCALER = TC_PRESCALER(SERVO_TIMER_PRESCALER); + + // Count down + tc->COUNT16.CTRLBSET.reg = TC_CTRLBCLR_DIR; + SYNC(tc->COUNT16.SYNCBUSY.bit.CTRLB); + + // Reset all servo indexes + memset((void *)currentServoIndex, 0xFF, sizeof(currentServoIndex)); + + // Configure interrupt request + NVIC_ClearPendingIRQ(SERVO_IRQn); + NVIC_SetPriority(SERVO_IRQn, 5); + NVIC_EnableIRQ(SERVO_IRQn); + + initialized = true; + } + + if (!tc->COUNT16.CTRLA.bit.ENABLE) { + // Reset the timer counter + tc->COUNT16.COUNT.reg = TC_COUNTER_START_VAL; + SYNC(tc->COUNT16.SYNCBUSY.bit.COUNT); + + // Enable the timer and start it + tc->COUNT16.CTRLA.bit.ENABLE = true; + SYNC(tc->COUNT16.SYNCBUSY.bit.ENABLE); + } + // First interrupt request after 1 ms + tc->COUNT16.CC[tcChannel].reg = getTimerCount() - (uint16_t)usToTicks(1000UL); + + if (tcChannel == 0 ) { + SYNC(tc->COUNT16.SYNCBUSY.bit.CC0); + + // Clear pending match interrupt + tc->COUNT16.INTFLAG.reg = TC_INTENSET_MC0; + // Enable the match channel interrupt request + tc->COUNT16.INTENSET.reg = TC_INTENSET_MC0; + } + else { + SYNC(tc->COUNT16.SYNCBUSY.bit.CC1); + + // Clear pending match interrupt + tc->COUNT16.INTFLAG.reg = TC_INTENSET_MC1; + // Enable the match channel interrupt request + tc->COUNT16.INTENSET.reg = TC_INTENSET_MC1; + } +} + +void finISR(timer16_Sequence_t timer) { + Tc * const tc = TimerConfig[SERVO_TC].pTimer; + const uint8_t tcChannel = TIMER_TCCHANNEL(timer); + + // Disable the match channel interrupt request + tc->COUNT16.INTENCLR.reg = (tcChannel == 0) ? TC_INTENCLR_MC0 : TC_INTENCLR_MC1; + + if (true + #if defined(_useTimer1) && defined(_useTimer2) + && (tc->COUNT16.INTENCLR.reg & (TC_INTENCLR_MC0|TC_INTENCLR_MC1)) == 0 + #endif + ) { + // Disable the timer if not used + tc->COUNT16.CTRLA.bit.ENABLE = false; + SYNC(tc->COUNT16.SYNCBUSY.bit.ENABLE); + } +} + +#endif // HAS_SERVOS + +#endif // __SAMD51__ diff --git a/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h b/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h new file mode 100644 index 000000000000..8b77d5b50334 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h @@ -0,0 +1,39 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +#define _useTimer1 +#define _useTimer2 + +#define TRIM_DURATION 5 // compensation ticks to trim adjust for digitalWrite delays +#define SERVO_TIMER_PRESCALER 64 // timer prescaler factor to 64 (avoid overflowing 16-bit clock counter, at 120MHz this is 1831 ticks per millisecond + +#define SERVO_TC 3 + +typedef enum { + #ifdef _useTimer1 + _timer1, + #endif + #ifdef _useTimer2 + _timer2, + #endif + _Nbr_16timers +} timer16_Sequence_t; diff --git a/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h b/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h new file mode 100644 index 000000000000..1f66e02e3129 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h @@ -0,0 +1,184 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +/** + * Endstop interrupts for ATMEL SAMD51 based targets. + * + * On SAMD51, all pins support external interrupt capability. + * Any pin can be used for external interrupts, but there are some restrictions. + * At most 16 different external interrupts can be used at one time. + * Further, you can’t just pick any 16 pins to use. This is because every pin on the SAMD51 + * connects to what is called an EXTINT line, and only one pin per EXTINT line can be used for external + * interrupts at a time + */ + +/** + * 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. + * With this feature endstops.update() is called only when we know that at + * least one endstop has changed state, saving valuable CPU cycles. + * + * This feature only works when all used endstop pins can generate an 'external interrupt'. + * + * Test whether pins issue interrupts on your board by flashing 'pin_interrupt_test.ino'. + * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) + */ + +#include "../../module/endstops.h" + +#define MATCH_EILINE(P1,P2) (P1 != P2 && PIN_TO_EILINE(P1) == PIN_TO_EILINE(P2)) +#if HAS_X_MAX + #define MATCH_X_MAX_EILINE(P) MATCH_EILINE(P, X_MAX_PIN) +#else + #define MATCH_X_MAX_EILINE(P) false +#endif +#if HAS_X_MIN + #define MATCH_X_MIN_EILINE(P) MATCH_EILINE(P, X_MIN_PIN) +#else + #define MATCH_X_MIN_EILINE(P) false +#endif +#if HAS_Y_MAX + #define MATCH_Y_MAX_EILINE(P) MATCH_EILINE(P, Y_MAX_PIN) +#else + #define MATCH_Y_MAX_EILINE(P) false +#endif +#if HAS_Y_MIN + #define MATCH_Y_MIN_EILINE(P) MATCH_EILINE(P, Y_MIN_PIN) +#else + #define MATCH_Y_MIN_EILINE(P) false +#endif +#if HAS_Z_MAX + #define MATCH_Z_MAX_EILINE(P) MATCH_EILINE(P, Z_MAX_PIN) +#else + #define MATCH_Z_MAX_EILINE(P) false +#endif +#if HAS_Z_MIN + #define MATCH_Z_MIN_EILINE(P) MATCH_EILINE(P, Z_MIN_PIN) +#else + #define MATCH_Z_MIN_EILINE(P) false +#endif +#if HAS_Z2_MAX + #define MATCH_Z2_MAX_EILINE(P) MATCH_EILINE(P, Z2_MAX_PIN) +#else + #define MATCH_Z2_MAX_EILINE(P) false +#endif +#if HAS_Z2_MIN + #define MATCH_Z2_MIN_EILINE(P) MATCH_EILINE(P, Z2_MIN_PIN) +#else + #define MATCH_Z2_MIN_EILINE(P) false +#endif +#if HAS_Z3_MAX + #define MATCH_Z3_MAX_EILINE(P) MATCH_EILINE(P, Z3_MAX_PIN) +#else + #define MATCH_Z3_MAX_EILINE(P) false +#endif +#if HAS_Z3_MIN + #define MATCH_Z3_MIN_EILINE(P) MATCH_EILINE(P, Z3_MIN_PIN) +#else + #define MATCH_Z3_MIN_EILINE(P) false +#endif +#if HAS_Z_MIN_PROBE_PIN + #define MATCH_Z_MIN_PROBE_EILINE(P) MATCH_EILINE(P, Z_MIN_PROBE_PIN) +#else + #define MATCH_Z_MIN_PROBE_EILINE(P) false +#endif +#define AVAILABLE_EILINE(P) (PIN_TO_EILINE(P) != -1 \ + && !MATCH_X_MAX_EILINE(P) && !MATCH_X_MIN_EILINE(P) \ + && !MATCH_Y_MAX_EILINE(P) && !MATCH_Y_MIN_EILINE(P) \ + && !MATCH_Z_MAX_EILINE(P) && !MATCH_Z_MIN_EILINE(P) \ + && !MATCH_Z2_MAX_EILINE(P) && !MATCH_Z2_MIN_EILINE(P) \ + && !MATCH_Z3_MAX_EILINE(P) && !MATCH_Z3_MIN_EILINE(P) \ + && !MATCH_Z_MIN_PROBE_EILINE(P)) + +// One ISR for all EXT-Interrupts +void endstop_ISR() { endstops.update(); } + +void setup_endstop_interrupts() { + #if HAS_X_MAX + #if !AVAILABLE_EILINE(X_MAX_PIN) + static_assert(false, "X_MAX_PIN has no EXTINT line available."); + #endif + attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_X_MIN + #if !AVAILABLE_EILINE(X_MIN_PIN) + static_assert(false, "X_MIN_PIN has no EXTINT line available."); + #endif + attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Y_MAX + #if !AVAILABLE_EILINE(Y_MAX_PIN) + static_assert(false, "Y_MAX_PIN has no EXTINT line available."); + #endif + attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Y_MIN + #if !AVAILABLE_EILINE(Y_MIN_PIN) + static_assert(false, "Y_MIN_PIN has no EXTINT line available."); + #endif + attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Z_MAX + #if !AVAILABLE_EILINE(Z_MAX_PIN) + static_assert(false, "Z_MAX_PIN has no EXTINT line available."); + #endif + attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Z_MIN + #if !AVAILABLE_EILINE(Z_MIN_PIN) + static_assert(false, "Z_MIN_PIN has no EXTINT line available."); + #endif + attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Z2_MAX + #if !AVAILABLE_EILINE(Z2_MAX_PIN) + static_assert(false, "Z2_MAX_PIN has no EXTINT line available."); + #endif + attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Z2_MIN + #if !AVAILABLE_EILINE(Z2_MIN_PIN) + static_assert(false, "Z2_MIN_PIN has no EXTINT line available."); + #endif + attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Z3_MAX + #if !AVAILABLE_EILINE(Z3_MAX_PIN) + static_assert(false, "Z3_MAX_PIN has no EXTINT line available."); + #endif + attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Z3_MIN + #if !AVAILABLE_EILINE(Z3_MIN_PIN) + static_assert(false, "Z3_MIN_PIN has no EXTINT line available."); + #endif + attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Z_MIN_PROBE_PIN + #if !AVAILABLE_EILINE(Z_MIN_PROBE_PIN) + static_assert(false, "Z_MIN_PROBE_PIN has no EXTINT line available."); + #endif + attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); + #endif +} diff --git a/Marlin/src/HAL/HAL_SAMD51/fastio.h b/Marlin/src/HAL/HAL_SAMD51/fastio.h new file mode 100644 index 000000000000..ecd9acea44dc --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/fastio.h @@ -0,0 +1,252 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +/** + * Fast IO functions for SAMD51 + */ + +#include "SAMD51.h" + +/** + * Utility functions + */ + +#ifndef MASK + #define MASK(PIN) (1 << PIN) +#endif + +/** + * Magic I/O routines + * + * Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW); + */ + +// Read a pin +#define READ(IO) ((PORT->Group[(EPortType)GET_SAMD_PORT(IO)].IN.reg & MASK(GET_SAMD_PIN(IO))) != 0) + +// Write to a pin +#define WRITE(IO,V) do{ \ + const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ + const uint32_t mask = MASK(GET_SAMD_PIN(IO)); \ + \ + if (V) PORT->Group[port].OUTSET.reg = mask; \ + else PORT->Group[port].OUTCLR.reg = mask; \ + }while(0) + +// Toggle a pin +#define TOGGLE(IO) PORT->Group[(EPortType)GET_SAMD_PORT(IO)].OUTTGL.reg = MASK(GET_SAMD_PIN(IO)); + +// Set pin as input +#define SET_INPUT(IO) do{ \ + const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ + const uint32_t pin = GET_SAMD_PIN(IO); \ + \ + PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN); \ + PORT->Group[port].DIRCLR.reg = MASK(pin); \ + }while(0) +// Set pin as input with pullup +#define SET_INPUT_PULLUP(IO) do{ \ + const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ + const uint32_t pin = GET_SAMD_PIN(IO); \ + const uint32_t mask = MASK(pin); \ + \ + PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN | PORT_PINCFG_PULLEN); \ + PORT->Group[port].DIRCLR.reg = mask; \ + PORT->Group[port].OUTSET.reg = mask; \ + }while(0) +// Set pin as input with pulldown +#define SET_INPUT_PULLDOWN(IO) do{ \ + const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ + const uint32_t pin = GET_SAMD_PIN(IO); \ + const uint32_t mask = MASK(pin); \ + \ + PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN | PORT_PINCFG_PULLEN); \ + PORT->Group[port].DIRCLR.reg = mask; \ + PORT->Group[port].OUTCLR.reg = mask; \ + }while(0) +// Set pin as output (push pull) +#define SET_OUTPUT(IO) do{ \ + const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ + const uint32_t pin = GET_SAMD_PIN(IO); \ + \ + PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN); \ + PORT->Group[port].DIRSET.reg = MASK(pin); \ + }while(0) +// Set pin as output (open drain) +#define SET_OUTPUT_OD(IO) do{ \ + const EPortType port = (EPortType)GET_SAMD_PORT(IO); \ + const uint32_t pin = GET_SAMD_PIN(IO); \ + \ + PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_PULLEN); \ + PORT->Group[port].DIRCLR.reg = MASK(pin); \ + }while(0) +// Set pin as PWM (push pull) +#define SET_PWM(IO) SET_OUTPUT(IO) +// Set pin as PWM (open drain) +#define SET_PWM_OD(IO) SET_OUTPUT_OD(IO) + +// check if pin is an output +#define IS_OUTPUT(IO) ((PORT->Group[(EPortType)GET_SAMD_PORT(IO)].DIR.reg & MASK(GET_SAMD_PIN(IO))) \ + || (PORT->Group[(EPortType)GET_SAMD_PORT(IO)].PINCFG[GET_SAMD_PIN(IO)].reg & (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN)) == PORT_PINCFG_PULLEN) +// check if pin is an input +#define IS_INPUT(IO) !IS_OUTPUT(IO) + +// Shorthand +#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) +#define OUT_WRITE_OD(IO,V) do{ SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0) + +// digitalRead/Write wrappers +#define extDigitalRead(IO) digitalRead(IO) +#define extDigitalWrite(IO,V) digitalWrite(IO,V) + +/** + * Ports and functions + * Added as necessary or if I feel like it- not a comprehensive list! + */ + +#ifdef ADAFRUIT_GRAND_CENTRAL_M4 + + /* + * Adafruit Grand Central M4 has a lot of PWMs the availables are listed here. + * Some of these share the same source and so can't be used in the same time + */ + #define PWM_PIN(P) (WITHIN(P, 2, 13) || WITHIN(P, 22, 23) || WITHIN(P, 44, 45) || P == 48) + + // Return fullfilled ADCx->INPUTCTRL.reg + #define PIN_TO_INPUTCTRL(P) ( (PIN_TO_AIN(P) == 0) ? ADC_INPUTCTRL_MUXPOS_AIN0 \ + : (PIN_TO_AIN(P) == 1) ? ADC_INPUTCTRL_MUXPOS_AIN1 \ + : (PIN_TO_AIN(P) == 2) ? ADC_INPUTCTRL_MUXPOS_AIN2 \ + : (PIN_TO_AIN(P) == 3) ? ADC_INPUTCTRL_MUXPOS_AIN3 \ + : (PIN_TO_AIN(P) == 4) ? ADC_INPUTCTRL_MUXPOS_AIN4 \ + : (PIN_TO_AIN(P) == 5) ? ADC_INPUTCTRL_MUXPOS_AIN5 \ + : (PIN_TO_AIN(P) == 6) ? ADC_INPUTCTRL_MUXPOS_AIN6 \ + : (PIN_TO_AIN(P) == 7) ? ADC_INPUTCTRL_MUXPOS_AIN7 \ + : (PIN_TO_AIN(P) == 8) ? ADC_INPUTCTRL_MUXPOS_AIN8 \ + : (PIN_TO_AIN(P) == 9) ? ADC_INPUTCTRL_MUXPOS_AIN9 \ + : (PIN_TO_AIN(P) == 10) ? ADC_INPUTCTRL_MUXPOS_AIN10 \ + : (PIN_TO_AIN(P) == 11) ? ADC_INPUTCTRL_MUXPOS_AIN11 \ + : (PIN_TO_AIN(P) == 12) ? ADC_INPUTCTRL_MUXPOS_AIN12 \ + : (PIN_TO_AIN(P) == 13) ? ADC_INPUTCTRL_MUXPOS_AIN13 \ + : (PIN_TO_AIN(P) == 14) ? ADC_INPUTCTRL_MUXPOS_AIN14 \ + : ADC_INPUTCTRL_MUXPOS_AIN15) + + #define ANAPIN_TO_SAMDPIN(P) ( (P == 0) ? PIN_TO_SAMD_PIN(67) \ + : (P == 1) ? PIN_TO_SAMD_PIN(68) \ + : (P == 2) ? PIN_TO_SAMD_PIN(69) \ + : (P == 3) ? PIN_TO_SAMD_PIN(70) \ + : (P == 4) ? PIN_TO_SAMD_PIN(71) \ + : (P == 5) ? PIN_TO_SAMD_PIN(72) \ + : (P == 6) ? PIN_TO_SAMD_PIN(73) \ + : (P == 7) ? PIN_TO_SAMD_PIN(74) \ + : (P == 8) ? PIN_TO_SAMD_PIN(54) \ + : (P == 9) ? PIN_TO_SAMD_PIN(55) \ + : (P == 10) ? PIN_TO_SAMD_PIN(56) \ + : (P == 11) ? PIN_TO_SAMD_PIN(57) \ + : (P == 12) ? PIN_TO_SAMD_PIN(58) \ + : (P == 13) ? PIN_TO_SAMD_PIN(59) \ + : (P == 14) ? PIN_TO_SAMD_PIN(60) \ + : (P == 15) ? PIN_TO_SAMD_PIN(61) \ + : (P == 16) ? PIN_TO_SAMD_PIN(12) \ + : (P == 17) ? PIN_TO_SAMD_PIN(13) \ + : PIN_TO_SAMD_PIN(9)) + + #define digitalPinToAnalogInput(P) (WITHIN(P, 67, 74) ? (P) - 67 : WITHIN(P, 54, 61) ? 8 + (P) - 54 : WITHIN(P, 12, 13) ? 16 + (P) - 12 : P == 9 ? 18 : -1) + + /* + * pins + */ + + // PORTA + #define DIO67_PIN PIN_PA02 // A0 + #define DIO59_PIN PIN_PA04 // A13 + #define DIO68_PIN PIN_PA05 // A1 + #define DIO60_PIN PIN_PA06 // A14 + #define DIO61_PIN PIN_PA07 // A15 + #define DIO26_PIN PIN_PA12 + #define DIO27_PIN PIN_PA13 + #define DIO28_PIN PIN_PA14 + #define DIO23_PIN PIN_PA15 + #define DIO37_PIN PIN_PA16 + #define DIO36_PIN PIN_PA17 + #define DIO35_PIN PIN_PA18 + #define DIO34_PIN PIN_PA19 + #define DIO33_PIN PIN_PA20 + #define DIO32_PIN PIN_PA21 + #define DIO31_PIN PIN_PA22 + #define DIO30_PIN PIN_PA23 + // PORTB + #define DIO12_PIN PIN_PB00 // A16 + #define DIO13_PIN PIN_PB01 // A17 + #define DIO9_PIN PIN_PB02 // A18 + #define DIO69_PIN PIN_PB03 // A2 + #define DIO74_PIN PIN_PB04 // A7 + #define DIO54_PIN PIN_PB05 // A8 + #define DIO55_PIN PIN_PB06 // A9 + #define DIO56_PIN PIN_PB07 // A10 + #define DIO57_PIN PIN_PB08 // A11 + #define DIO58_PIN PIN_PB09 // A12 + #define DIO18_PIN PIN_PB12 + #define DIO19_PIN PIN_PB13 + #define DIO39_PIN PIN_PB14 + #define DIO38_PIN PIN_PB15 + #define DIO14_PIN PIN_PB16 + #define DIO15_PIN PIN_PB17 + #define DIO8_PIN PIN_PB18 + #define DIO29_PIN PIN_PB19 + #define DIO20_PIN PIN_PB20 + #define DIO21_PIN PIN_PB21 + #define DIO10_PIN PIN_PB22 + #define DIO11_PIN PIN_PB23 + #define DIO1_PIN PIN_PB24 + #define DIO0_PIN PIN_PB25 + #define DIO83_PIN PIN_PB28 // SD_CS + #define DIO95_PIN PIN_PB31 // SD_CD + // PORTC + #define DIO70_PIN PIN_PC00 // A3 + #define DIO71_PIN PIN_PC01 // A4 + #define DIO72_PIN PIN_PC02 // A5 + #define DIO73_PIN PIN_PC03 // A6 + #define DIO48_PIN PIN_PC04 + #define DIO49_PIN PIN_PC05 + #define DIO46_PIN PIN_PC06 + #define DIO47_PIN PIN_PC07 + #define DIO45_PIN PIN_PC10 + #define DIO44_PIN PIN_PC11 + #define DIO41_PIN PIN_PC12 + #define DIO40_PIN PIN_PC13 + #define DIO43_PIN PIN_PC14 + #define DIO42_PIN PIN_PC15 + #define DIO25_PIN PIN_PC16 + #define DIO24_PIN PIN_PC17 + #define DIO2_PIN PIN_PC18 + #define DIO3_PIN PIN_PC19 + #define DIO4_PIN PIN_PC20 + #define DIO5_PIN PIN_PC21 + #define DIO16_PIN PIN_PC22 + #define DIO17_PIN PIN_PC23 + #define DIO88_PIN PIN_PC24 // NEOPIXEL + // PORTD + #define DIO22_PIN PIN_PD12 + #define DIO6_PIN PIN_PD20 + #define DIO7_PIN PIN_PD21 + +#endif // ADAFRUIT_GRAND_CENTRAL_M4 diff --git a/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h b/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h new file mode 100644 index 000000000000..0f27d8bf355c --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h @@ -0,0 +1,48 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ + +/** + * Test SAMD51 specific configuration values for errors at compile-time. + */ + +#if defined(ADAFRUIT_GRAND_CENTRAL_M4) && SD_CONNECTION_IS(CUSTOM_CABLE) + #error "No custom SD drive cable defined for this board." +#endif + +#if defined(MAX6675_SCK_PIN) && defined(MAX6675_DO_PIN) && (MAX6675_SCK_PIN == SCK1 || MAX6675_DO_PIN == MISO1) + #error "OnBoard SPI BUS can't be shared with other devices." +#endif + +#if ENABLED(EMERGENCY_PARSER) + #error "EMERGENCY_PARSER is not yet implemented for SAMD51. Disable EMERGENCY_PARSER to continue." +#endif + +#if ENABLED(SDIO_SUPPORT) + #error "SDIO_SUPPORT is not supported." +#endif + +#if ENABLED(FAST_PWM_FAN) + #error "FAST_PWM_FAN is not yet implemented for this platform." +#endif + +#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM) + #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Activator" +#endif diff --git a/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp new file mode 100644 index 000000000000..e41dd85c8556 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp @@ -0,0 +1,129 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ + +#ifdef __SAMD51__ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(EEPROM_SETTINGS) + +#include "../shared/persistent_store_api.h" + +#if NONE(SPI_EEPROM, I2C_EEPROM) + #define NVMCTRL_CMD(c) do{ \ + SYNC(!NVMCTRL->STATUS.bit.READY); \ + NVMCTRL->INTFLAG.bit.DONE = true; \ + NVMCTRL->CTRLB.reg = c | NVMCTRL_CTRLB_CMDEX_KEY; \ + SYNC(NVMCTRL->INTFLAG.bit.DONE); \ + }while(0) + #define NVMCTRL_FLUSH() do{ \ + if (NVMCTRL->SEESTAT.bit.LOAD) \ + NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_SEEFLUSH); \ + }while(0) +#endif + +bool PersistentStore::access_start() { + #if NONE(SPI_EEPROM, I2C_EEPROM) + NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED; // Buffered mode and segment reallocation active + #endif + + return true; +} + +bool PersistentStore::access_finish() { + #if NONE(SPI_EEPROM, I2C_EEPROM) + NVMCTRL_FLUSH(); + if (!NVMCTRL->SEESTAT.bit.LOCK) + NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE); // Lock E2P data write access + #endif + + return true; +} + +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { + #if NONE(SPI_EEPROM, I2C_EEPROM) + if (NVMCTRL->SEESTAT.bit.RLOCK) + NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access + #endif + + while (size--) { + const uint8_t v = *value; + #if ANY(SPI_EEPROM, I2C_EEPROM) + uint8_t * const p = (uint8_t * const)pos; + if (v != eeprom_read_byte(p)) { + eeprom_write_byte(p, v); + delay(2); + if (eeprom_read_byte(p) != v) { + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + return true; + } + } + #else + SYNC(NVMCTRL->SEESTAT.bit.BUSY); + if (NVMCTRL->INTFLAG.bit.SEESFULL) + NVMCTRL_FLUSH(); // Next write will trigger a sector reallocation. I need to flush 'pagebuffer' + ((volatile uint8_t *)SEEPROM_ADDR)[pos] = v; + SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC); + #endif + crc16(crc, &v, 1); + pos++; + value++; + } + return false; +} + +bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { + while (size--) { + uint8_t c; + #if ANY(SPI_EEPROM, I2C_EEPROM) + c = eeprom_read_byte((uint8_t*)pos); + #else + SYNC(NVMCTRL->SEESTAT.bit.BUSY); + c = ((volatile uint8_t *)SEEPROM_ADDR)[pos]; + #endif + if (writing) *value = c; + crc16(crc, &c, 1); + pos++; + value++; + } + return false; +} + +size_t PersistentStore::capacity() { + #if ANY(SPI_EEPROM, I2C_EEPROM) + return E2END + 1; + #else + const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ, + sblk = NVMCTRL->SEESTAT.bit.SBLK; + + if (!psz && !sblk) return 0; + else if (psz <= 2) return (0x200 << psz); + else if (sblk == 1 || psz == 3) return 4096; + else if (sblk == 2 || psz == 4) return 8192; + else if (sblk <= 4 || psz == 5) return 16384; + else if (sblk >= 9 && psz == 7) return 65536; + else return 32768; + #endif +} + +#endif // EEPROM_SETTINGS + +#endif // __SAMD51__ diff --git a/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h b/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h new file mode 100644 index 000000000000..64f6929c00a7 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h @@ -0,0 +1,153 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +#define NUMBER_PINS_TOTAL PINS_COUNT + +#define digitalRead_mod(p) extDigitalRead(p) +#define PRINT_PORT(p) do{ SERIAL_ECHOPGM(" Port: "); sprintf_P(buffer, PSTR("%c%02ld"), 'A' + g_APinDescription[p].ulPort, g_APinDescription[p].ulPin); SERIAL_ECHO(buffer); }while (0) +#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) +#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0) +#define GET_ARRAY_PIN(p) pin_array[p].pin +#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital +#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL) +#define DIGITAL_PIN_TO_ANALOG_PIN(p) digitalPinToAnalogInput(p) +#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P)!=-1) +#define pwm_status(pin) digitalPinHasPWM(pin) +#define MULTI_NAME_PAD 27 // space needed to be pretty if not first name assigned to a pin + +// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities +// uses pin index +#define M43_NEVER_TOUCH(Q) ((Q) >= 75) + +bool GET_PINMODE(int8_t pin) { // 1: output, 0: input + const EPortType samdport = g_APinDescription[pin].ulPort; + const uint32_t samdpin = g_APinDescription[pin].ulPin; + return PORT->Group[samdport].DIR.reg & MASK(samdpin) || (PORT->Group[samdport].PINCFG[samdpin].reg & (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN)) == PORT_PINCFG_PULLEN; +} + +void pwm_details(int32_t pin) { + if (pwm_status(pin)) { + //uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative; + //SERIAL_ECHOPAIR("PWM = ", duty); + } +} + +/** + * AGCM4 Board pin | PORT | Label + * ----------------+--------+------- + * 0 | PB25 | "RX0" + * 1 | PB24 | "TX0" + * 2 | PC18 | + * 3 | PC19 | + * 4 | PC20 | + * 5 | PC21 | + * 6 | PD20 | + * 7 | PD21 | + * 8 | PB18 | + * 9 | PB2 | + * 10 | PB22 | + * 11 | PB23 | + * 12 | PB0 | "A16" + * 13 | PB1 | LED AMBER "L" / "A17" + * 14 | PB16 | "TX3" + * 15 | PB17 | "RX3" + * 16 | PC22 | "TX2" + * 17 | PC23 | "RX2" + * 18 | PB12 | "TX1" / "A18" + * 19 | PB13 | "RX1" + * 20 | PB20 | "SDA" + * 21 | PB21 | "SCL" + * 22 | PD12 | + * 23 | PA15 | + * 24 | PC17 | + * 25 | PC16 | + * 26 | PA12 | + * 27 | PA13 | + * 28 | PA14 | + * 29 | PB19 | + * 30 | PA23 | + * 31 | PA22 | + * 32 | PA21 | + * 33 | PA20 | + * 34 | PA19 | + * 35 | PA18 | + * 36 | PA17 | + * 37 | PA16 | + * 38 | PB15 | + * 39 | PB14 | + * 40 | PC13 | + * 41 | PC12 | + * 42 | PC15 | + * 43 | PC14 | + * 44 | PC11 | + * 45 | PC10 | + * 46 | PC6 | + * 47 | PC7 | + * 48 | PC4 | + * 49 | PC5 | + * 50 | PD11 | + * 51 | PD8 | + * 52 | PD9 | + * 53 | PD10 | + * 54 | PB5 | "A8" + * 55 | PB6 | "A9" + * 56 | PB7 | "A10" + * 57 | PB8 | "A11" + * 58 | PB9 | "A12" + * 69 | PA4 | "A13" + * 60 | PA6 | "A14" + * 61 | PA7 | "A15" + * 62 | PB17 | + * 63 | PB20 | + * 64 | PD11 | + * 65 | PD8 | + * 66 | PD9 | + * 67 | PA2 | "A0" / "DAC0" + * 68 | PA5 | "A1" / "DAC1" + * 69 | PB3 | "A2" + * 70 | PC0 | "A3" + * 71 | PC1 | "A4" + * 72 | PC2 | "A5" + * 73 | PC3 | "A6" + * 74 | PB4 | "A7" + * 75 | PC31 | LED GREEN "RX" + * 76 | PC30 | LED GREEN "TX" + * 77 | PA27 | USB: Host enable + * 78 | PA24 | USB: D- + * 79 | PA25 | USB: D+ + * 80 | PB29 | SD: MISO + * 81 | PB27 | SD: SCK + * 82 | PB26 | SD: MOSI + * 83 | PB28 | SD: CS + * 84 | PA3 | AREF + * 85 | PA2 | DAC0 (Duplicate) + * 86 | PA5 | DAC1 (Duplicate) + * 87 | PB1 | LED AMBER "L" (Duplicate) + * 88 | PC24 | NeoPixel + * 89 | PB10 | QSPI: SCK + * 90 | PB11 | QSPI: CS + * 91 | PA8 | QSPI: IO0 + * 92 | PA9 | QSPI: IO1 + * 93 | PA10 | QSPI: IO2 + * 94 | PA11 | QSPI: IO3 + * + */ diff --git a/Marlin/src/HAL/HAL_SAMD51/spi_pins.h b/Marlin/src/HAL/HAL_SAMD51/spi_pins.h new file mode 100644 index 000000000000..3315fa08ac5f --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/spi_pins.h @@ -0,0 +1,54 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +#ifdef ADAFRUIT_GRAND_CENTRAL_M4 + + /* + * AGCM4 Default SPI Pins + * + * SS SCK MISO MOSI + * +-------------------------+ + * SPI | 53 52 50 51 | + * SPI1 | 83 81 80 82 | + * +-------------------------+ + * Any pin can be used for Chip Select (SS_PIN) + */ + #ifndef SCK_PIN + #define SCK_PIN 52 + #endif + #ifndef MISO_PIN + #define MISO_PIN 50 + #endif + #ifndef MOSI_PIN + #define MOSI_PIN 51 + #endif + #ifndef SDSS + #define SDSS 53 + #endif + +#else + + #error "Unsupported board!" + +#endif + +#define SS_PIN SDSS diff --git a/Marlin/src/HAL/HAL_SAMD51/timers.cpp b/Marlin/src/HAL/HAL_SAMD51/timers.cpp new file mode 100644 index 000000000000..24340439669d --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/timers.cpp @@ -0,0 +1,135 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ + +#ifdef __SAMD51__ + +// -------------------------------------------------------------------------- +// Includes +// -------------------------------------------------------------------------- +#include "../../inc/MarlinConfig.h" +#include "timers.h" + +// -------------------------------------------------------------------------- +// Local defines +// -------------------------------------------------------------------------- + +#define NUM_HARDWARE_TIMERS 8 + +// -------------------------------------------------------------------------- +// Private Variables +// -------------------------------------------------------------------------- + +const tTimerConfig TimerConfig[NUM_HARDWARE_TIMERS] = { + { TC0, TC0_IRQn, TC_PRIORITY(0) }, + { TC1, TC1_IRQn, TC_PRIORITY(1) }, + { TC2, TC2_IRQn, TC_PRIORITY(2) }, // Reserved by framework tone function + { TC3, TC3_IRQn, TC_PRIORITY(3) }, // Reserved by servo library + { TC4, TC4_IRQn, TC_PRIORITY(4) }, + { TC5, TC5_IRQn, TC_PRIORITY(5) }, + { TC6, TC6_IRQn, TC_PRIORITY(6) }, + { TC7, TC7_IRQn, TC_PRIORITY(7) } +}; + +// -------------------------------------------------------------------------- +// Private functions +// -------------------------------------------------------------------------- + +FORCE_INLINE void Disable_Irq(IRQn_Type irq) { + NVIC_DisableIRQ(irq); + + // We NEED memory barriers to ensure Interrupts are actually disabled! + // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) + __DSB(); + __ISB(); +} + +// -------------------------------------------------------------------------- +// Public functions +// -------------------------------------------------------------------------- + +void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { + Tc * const tc = TimerConfig[timer_num].pTimer; + IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; + + // Disable interrupt, just in case it was already enabled + Disable_Irq(irq); + + // Disable timer interrupt + tc->COUNT32.INTENCLR.reg = TC_INTENCLR_OVF; // disable overflow interrupt + + // TCn clock setup + const uint8_t clockID = GCLK_CLKCTRL_IDs[TCC_INST_NUM + timer_num]; + GCLK->PCHCTRL[clockID].bit.CHEN = false; + SYNC(GCLK->PCHCTRL[clockID].bit.CHEN); + GCLK->PCHCTRL[clockID].reg = GCLK_PCHCTRL_GEN_GCLK0 | GCLK_PCHCTRL_CHEN; // 120MHz startup code programmed + SYNC(!GCLK->PCHCTRL[clockID].bit.CHEN); + + // Stop timer, just in case, to be able to reconfigure it + tc->COUNT32.CTRLA.bit.ENABLE = false; + SYNC(tc->COUNT32.SYNCBUSY.bit.ENABLE); + + // Reset timer + tc->COUNT32.CTRLA.bit.SWRST = true; + SYNC(tc->COUNT32.SYNCBUSY.bit.SWRST); + + NVIC_SetPriority(irq, TimerConfig[timer_num].priority); + + // Wave mode, reset counter on overflow on 0 (I use count down to prevent double buffer use) + tc->COUNT32.WAVE.reg = TC_WAVE_WAVEGEN_MFRQ; + tc->COUNT32.CTRLA.reg = TC_CTRLA_MODE_COUNT32 | TC_CTRLA_PRESCALER_DIV1; + tc->COUNT32.CTRLBSET.reg = TC_CTRLBCLR_DIR; + SYNC(tc->COUNT32.SYNCBUSY.bit.CTRLB); + + // Set compare value + tc->COUNT32.COUNT.reg = tc->COUNT32.CC[0].reg = (HAL_TIMER_RATE) / frequency; + + // And start timer + tc->COUNT32.CTRLA.bit.ENABLE = true; + SYNC(tc->COUNT32.SYNCBUSY.bit.ENABLE); + + // Enable interrupt on RC compare + tc->COUNT32.INTENSET.reg = TC_INTENCLR_OVF; // enable overflow interrupt + + // Finally, enable IRQ + NVIC_EnableIRQ(irq); +} + +void HAL_timer_enable_interrupt(const uint8_t timer_num) { + IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; + NVIC_EnableIRQ(irq); +} + +void HAL_timer_disable_interrupt(const uint8_t timer_num) { + IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; + Disable_Irq(irq); +} + +// missing from CMSIS: Check if interrupt is enabled or not +static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) { + return (NVIC->ISER[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) != 0; +} + +bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { + IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; + return NVIC_GetEnabledIRQ(irq); +} + +#endif // __SAMD51__ diff --git a/Marlin/src/HAL/HAL_SAMD51/timers.h b/Marlin/src/HAL/HAL_SAMD51/timers.h new file mode 100644 index 000000000000..80c37d14af85 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/timers.h @@ -0,0 +1,116 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +#include + +// -------------------------------------------------------------------------- +// Defines +// -------------------------------------------------------------------------- + +typedef uint32_t hal_timer_t; +#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF + +#define HAL_TIMER_RATE SystemCoreClock // frequency of timers peripherals + +#define STEP_TIMER_NUM 0 // index of timer to use for stepper (also +1 for 32bits counter) +#define PULSE_TIMER_NUM STEP_TIMER_NUM +#define TEMP_TIMER_NUM 4 // index of timer to use for temperature (also +1 for 32bits counter) + +#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency + +#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) +#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs +#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US) + +#define PULSE_TIMER_RATE STEPPER_TIMER_RATE +#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE +#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US + +#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM) +#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM) +#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) + +#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) +#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) + +#define TC_PRIORITY(t) (t == STEP_TIMER_NUM || t == PULSE_TIMER_NUM) ? 2 \ + : (t == TEMP_TIMER_NUM) ? 6 \ + : 7 + +#define _TC_HANDLER(t) void TC##t##_Handler() +#define TC_HANDLER(t) _TC_HANDLER(t) +#define HAL_STEP_TIMER_ISR() TC_HANDLER(STEP_TIMER_NUM) +#if STEP_TIMER_NUM != PULSE_TIMER_NUM + #define HAL_PULSE_TIMER_ISR() TC_HANDLER(PULSE_TIMER_NUM) +#endif +#define HAL_TEMP_TIMER_ISR() TC_HANDLER(TEMP_TIMER_NUM) + +// -------------------------------------------------------------------------- +// Types +// -------------------------------------------------------------------------- + +typedef struct { + Tc *pTimer; + IRQn_Type IRQ_Id; + uint8_t priority; +} tTimerConfig; + +// -------------------------------------------------------------------------- +// Public Variables +// -------------------------------------------------------------------------- + +extern const tTimerConfig TimerConfig[]; + +// -------------------------------------------------------------------------- +// Public functions +// -------------------------------------------------------------------------- + +void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); + +FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) { + Tc * const tc = TimerConfig[timer_num].pTimer; + tc->COUNT32.CC[0].reg = HAL_TIMER_TYPE_MAX - compare; +} + +FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { + Tc * const tc = TimerConfig[timer_num].pTimer; + return (hal_timer_t)(HAL_TIMER_TYPE_MAX - tc->COUNT32.CC[0].reg); +} + +FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { + Tc * const tc = TimerConfig[timer_num].pTimer; + tc->COUNT32.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC; + SYNC(tc->COUNT32.SYNCBUSY.bit.CTRLB || tc->COUNT32.SYNCBUSY.bit.COUNT); + return HAL_TIMER_TYPE_MAX - tc->COUNT32.COUNT.reg; +} + +void HAL_timer_enable_interrupt(const uint8_t timer_num); +void HAL_timer_disable_interrupt(const uint8_t timer_num); +bool HAL_timer_interrupt_enabled(const uint8_t timer_num); + +FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { + Tc * const tc = TimerConfig[timer_num].pTimer; + // Clear interrupt flag + tc->COUNT32.INTFLAG.reg = TC_INTFLAG_OVF; +} + +#define HAL_timer_isr_epilogue(timer_num) diff --git a/Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.cpp b/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp similarity index 50% rename from Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.cpp rename to Marlin/src/HAL/HAL_SAMD51/watchdog.cpp index 8b75454dadc5..69a6de4ef759 100644 --- a/Marlin/src/HAL/HAL_STM32F7/watchdog_STM32F7.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp @@ -1,9 +1,8 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) * * 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 @@ -20,33 +19,35 @@ * */ -#ifdef STM32F7 +#ifdef __SAMD51__ #include "../../inc/MarlinConfig.h" #if ENABLED(USE_WATCHDOG) - #include "watchdog_STM32F7.h" - - IWDG_HandleTypeDef hiwdg; + #include "watchdog.h" void watchdog_init() { - hiwdg.Instance = IWDG; - hiwdg.Init.Prescaler = IWDG_PRESCALER_32; //32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock - hiwdg.Init.Reload = 4095; //4095 counts = 4 seconds at 1024Hz - if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { - //Error_Handler(); - } - } + // The low-power oscillator used by the WDT runs at 32,768 Hz with + // a 1:32 prescale, thus 1024 Hz, though probably not super precise. + + // Setup WDT clocks + MCLK->APBAMASK.bit.OSC32KCTRL_ = true; + MCLK->APBAMASK.bit.WDT_ = true; + OSC32KCTRL->OSCULP32K.bit.EN1K = true; // Enable out 1K (this is what WDT uses) + + WDT->CTRLA.bit.ENABLE = false; // Disable watchdog for config + SYNC(WDT->SYNCBUSY.bit.ENABLE); + + WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt + WDT->CONFIG.reg = WDT_CONFIG_PER_CYC4096; // Set at least 4s period for chip reset + + HAL_watchdog_refresh(); - void watchdog_reset() { - /* Refresh IWDG: reload counter */ - if (HAL_IWDG_Refresh(&hiwdg) != HAL_OK) { - /* Refresh Error */ - //Error_Handler(); - } + WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode + SYNC(WDT->SYNCBUSY.bit.ENABLE); } #endif // USE_WATCHDOG -#endif // STM32F7 +#endif // __SAMD51__ diff --git a/Marlin/src/HAL/HAL_SAMD51/watchdog.h b/Marlin/src/HAL/HAL_SAMD51/watchdog.h new file mode 100644 index 000000000000..b626b0b06ae1 --- /dev/null +++ b/Marlin/src/HAL/HAL_SAMD51/watchdog.h @@ -0,0 +1,31 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * 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 . + * + */ +#pragma once + +// Initialize watchdog with a 4 second interrupt time +void watchdog_init(); + +// Reset watchdog. MUST be called at least every 4 seconds after the +// first watchdog_init or SAMD will go into emergency procedures. +inline void HAL_watchdog_refresh() { + SYNC(WDT->SYNCBUSY.bit.CLEAR); // Test first if previous is 'ongoing' to save time waiting for command execution + WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY; +} diff --git a/Marlin/src/HAL/HAL_STM32/HAL.cpp b/Marlin/src/HAL/HAL_STM32/HAL.cpp index 8eb3c588f65c..4fbfa7298ca0 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32/HAL.cpp @@ -28,54 +28,35 @@ #include "../../inc/MarlinConfig.h" #include "../shared/Delay.h" -#if ENABLED(EEPROM_EMULATED_WITH_SRAM) +#if (__cplusplus == 201703L) && defined(__has_include) + #define HAS_SWSERIAL __has_include() +#else + #define HAS_SWSERIAL HAS_TMC220x +#endif + +#if HAS_SWSERIAL + #include "SoftwareSerial.h" +#endif + +#if ENABLED(SRAM_EEPROM_EMULATION) #if STM32F7xx - #include "stm32f7xx_ll_pwr.h" + #include #elif STM32F4xx - #include "stm32f4xx_ll_pwr.h" + #include #else - #error "EEPROM_EMULATED_WITH_SRAM is currently only supported for STM32F4xx and STM32F7xx" + #error "SRAM_EEPROM_EMULATION is currently only supported for STM32F4xx and STM32F7xx" #endif #endif -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ uint16_t HAL_adc_result; -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- - +// ------------------------ // Needed for DELAY_NS() / DELAY_US() on CORTEX-M7 #if (defined(__arm__) || defined(__thumb__)) && __CORTEX_M == 7 @@ -89,7 +70,7 @@ uint16_t HAL_adc_result; #endif // HAL initialization task -void HAL_init(void) { +void HAL_init() { FastIO_init(); #if ENABLED(SDSUPPORT) @@ -100,7 +81,7 @@ void HAL_init(void) { OUT_WRITE(LED_PIN, LOW); #endif - #if ENABLED(EEPROM_EMULATED_WITH_SRAM) + #if ENABLED(SRAM_EEPROM_EMULATION) // Enable access to backup SRAM __HAL_RCC_PWR_CLK_ENABLE(); HAL_PWR_EnableBkUpAccess(); @@ -111,11 +92,15 @@ void HAL_init(void) { // Wait until backup regulator is initialized while (!LL_PWR_IsActiveFlag_BRR()); #endif // EEPROM_EMULATED_SRAM + + #if HAS_SWSERIAL + SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0); + #endif } -void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); } +void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG; if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE; if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL; @@ -129,16 +114,15 @@ extern "C" { extern unsigned int _ebss; // end of bss section } -// -------------------------------------------------------------------------- +// ------------------------ // ADC -// -------------------------------------------------------------------------- +// ------------------------ -void HAL_adc_start_conversion(const uint8_t adc_pin) { - HAL_adc_result = analogRead(adc_pin); -} +// TODO: Make sure this doesn't cause any delay +void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } -uint16_t HAL_adc_get_result(void) { - return HAL_adc_result; -} +uint16_t HAL_adc_get_result() { return HAL_adc_result; } + +void flashFirmware(int16_t) { NVIC_SystemReset(); } #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/HAL_STM32/HAL.h b/Marlin/src/HAL/HAL_STM32/HAL.h index cb810d3f9f95..910d437bd6b5 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.h +++ b/Marlin/src/HAL/HAL_STM32/HAL.h @@ -24,16 +24,12 @@ #define CPU_32_BIT -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../../core/macros.h" #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_STM32.h" -#include "watchdog_STM32.h" +#include "fastio.h" +#include "watchdog.h" #include "../../inc/MarlinConfigPre.h" @@ -43,9 +39,9 @@ #include #endif -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #if SERIAL_PORT == 0 #error "Serial port 0 does not exist" @@ -100,7 +96,7 @@ #define NUM_SERIAL 1 #endif -#include "HAL_timers_STM32.h" +#include "timers.h" /** * TODO: review this to return 1 for pins that are not analog input @@ -128,56 +124,50 @@ #undef pgm_read_ptr #define pgm_read_ptr(addr) (*(addr)) -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ -typedef int8_t pin_t; +typedef int16_t pin_t; #define HAL_SERVO_LIB libServo -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ -/** result of last ADC conversion */ +// result of last ADC conversion extern uint16_t HAL_adc_result; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ // Memory related #define __bss_end __bss_end__ // Enable hooks into setup for HAL -void HAL_init(void); +void HAL_init(); -/** clear reset reason */ -void HAL_clear_reset_source (void); +// Clear reset reason +void HAL_clear_reset_source(); -/** reset reason */ -uint8_t HAL_get_reset_source(void); +// Reset reason +uint8_t HAL_get_reset_source(); void _delay_ms(const int delay); extern "C" char* _sbrk(int incr); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" + static inline int freeMemory() { volatile char top; return &top - reinterpret_cast(_sbrk(0)); } -// -// SPI: Extended functions which take a channel number (hardware SPI only) -// - -/** Write single byte to specified SPI channel */ -void spiSend(uint32_t chan, byte b); -/** Write buffer to specified SPI channel */ -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -/** Read single byte from specified SPI channel */ -uint8_t spiRec(uint32_t chan); +#pragma GCC diagnostic pop // // EEPROM @@ -186,8 +176,8 @@ uint8_t spiRec(uint32_t chan); // Wire library should work for i2c EEPROMs void eeprom_write_byte(uint8_t *pos, unsigned char value); uint8_t eeprom_read_byte(uint8_t *pos); -void eeprom_read_block (void *__dst, const void *__src, size_t __n); -void eeprom_update_block (const void *__src, void *__dst, size_t __n); +void eeprom_read_block(void *__dst, const void *__src, size_t __n); +void eeprom_update_block(const void *__src, void *__dst, size_t __n); // // ADC @@ -195,16 +185,20 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) -inline void HAL_adc_init(void) {} +inline void HAL_adc_init() {} #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + +#define PLATFORM_M997_SUPPORT +void flashFirmware(int16_t value); diff --git a/Marlin/src/HAL/HAL_STM32/HAL_spi_STM32.cpp b/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp similarity index 70% rename from Marlin/src/HAL/HAL_STM32/HAL_spi_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp index cde28e7e145f..45bd26d720b9 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_spi_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp @@ -22,36 +22,31 @@ */ #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../../inc/MarlinConfig.h" #include -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ static SPISettings spiConfig; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ #if ENABLED(SOFTWARE_SPI) - // -------------------------------------------------------------------------- + // ------------------------ // Software SPI - // -------------------------------------------------------------------------- + // ------------------------ #error "Software SPI not supported for STM32. Use Hardware SPI." #else -// -------------------------------------------------------------------------- +// ------------------------ // Hardware SPI -// -------------------------------------------------------------------------- +// ------------------------ /** * VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz @@ -64,7 +59,7 @@ static SPISettings spiConfig; * * @details Only configures SS pin since stm32duino creates and initialize the SPI object */ -void spiBegin(void) { +void spiBegin() { #if !PIN_EXISTS(SS) #error "SS_PIN not defined!" #endif @@ -77,16 +72,17 @@ void spiInit(uint8_t spiRate) { // Use datarates Marlin uses uint32_t clock; switch (spiRate) { - case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000 - case SPI_HALF_SPEED: clock = 5000000; break; - case SPI_QUARTER_SPEED: clock = 2500000; break; - case SPI_EIGHTH_SPEED: clock = 1250000; break; - case SPI_SPEED_5: clock = 625000; break; - case SPI_SPEED_6: clock = 300000; break; - default: - clock = 4000000; // Default from the SPI library + case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000 + case SPI_HALF_SPEED: clock = 5000000; break; + case SPI_QUARTER_SPEED: clock = 2500000; break; + case SPI_EIGHTH_SPEED: clock = 1250000; break; + case SPI_SPEED_5: clock = 625000; break; + case SPI_SPEED_6: clock = 300000; break; + default: + clock = 4000000; // Default from the SPI library } spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); + SPI.begin(); } @@ -97,7 +93,7 @@ void spiInit(uint8_t spiRate) { * * @details */ -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp b/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp deleted file mode 100644 index f309b43f3afb..000000000000 --- a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 . - * - */ -#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "HAL.h" - -#include "HAL_timers_STM32.h" - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -#define NUM_HARDWARE_TIMERS 2 - -//#define PRESCALER 1 -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -stm32f4_timer_t TimerHandle[NUM_HARDWARE_TIMERS]; - -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -bool timers_initialized[NUM_HARDWARE_TIMERS] = { false }; - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - - if (!timers_initialized[timer_num]) { - uint32_t step_prescaler = STEPPER_TIMER_PRESCALE - 1, - temp_prescaler = TEMP_TIMER_PRESCALE - 1; - switch (timer_num) { - case STEP_TIMER_NUM: - // STEPPER TIMER - use a 32bit timer if possible - TimerHandle[timer_num].timer = STEP_TIMER_DEV; - TimerHandle[timer_num].irqHandle = Step_Handler; - TimerHandleInit(&TimerHandle[timer_num], (((HAL_TIMER_RATE) / step_prescaler) / frequency) - 1, step_prescaler); - HAL_NVIC_SetPriority(STEP_TIMER_IRQ_NAME, STEP_TIMER_IRQ_PRIO, 0); - break; - - case TEMP_TIMER_NUM: - // TEMP TIMER - any available 16bit Timer - TimerHandle[timer_num].timer = TEMP_TIMER_DEV; - TimerHandle[timer_num].irqHandle = Temp_Handler; - TimerHandleInit(&TimerHandle[timer_num], (((HAL_TIMER_RATE) / temp_prescaler) / frequency) - 1, temp_prescaler); - HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_NAME, TEMP_TIMER_IRQ_PRIO, 0); - break; - } - timers_initialized[timer_num] = true; - } -} - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - const IRQn_Type IRQ_Id = IRQn_Type(getTimerIrq(TimerHandle[timer_num].timer)); - HAL_NVIC_EnableIRQ(IRQ_Id); -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - const IRQn_Type IRQ_Id = IRQn_Type(getTimerIrq(TimerHandle[timer_num].timer)); - HAL_NVIC_DisableIRQ(IRQ_Id); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - const uint32_t IRQ_Id = getTimerIrq(TimerHandle[timer_num].timer); - return NVIC->ISER[IRQ_Id >> 5] & _BV32(IRQ_Id & 0x1F); -} - -#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.cpp b/Marlin/src/HAL/HAL_STM32/Servo.cpp similarity index 68% rename from Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/Servo.cpp index fa68c4834235..9af8ba618484 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/Servo.cpp @@ -26,29 +26,34 @@ #if HAS_SERVOS -#include "HAL_Servo_STM32.h" +#include "Servo.h" -uint8_t servoPin[MAX_SERVOS] = { 0 }; +static uint_fast8_t servoCount = 0; +constexpr millis_t servoDelay[] = SERVO_DELAY; +static_assert(COUNT(servoDelay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); + +libServo::libServo() +: delay(servoDelay[servoCount++]) +{} int8_t libServo::attach(const int pin) { - if (this->servoIndex >= MAX_SERVOS) return -1; - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex]); + if (servoCount >= MAX_SERVOS) return -1; + if (pin > 0) servo_pin = pin; + return super::attach(servo_pin); } int8_t libServo::attach(const int pin, const int min, const int max) { - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex], min, max); + if (servoCount >= MAX_SERVOS) return -1; + if (pin > 0) servo_pin = pin; + return super::attach(servo_pin, min, max); } void libServo::move(const 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]); + if (attach(0) >= 0) { + write(value); + safe_delay(delay); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.h b/Marlin/src/HAL/HAL_STM32/Servo.h similarity index 89% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.h rename to Marlin/src/HAL/HAL_STM32/Servo.h index e096dc60c8ed..ec4b6be131d2 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.h +++ b/Marlin/src/HAL/HAL_STM32/Servo.h @@ -4,6 +4,7 @@ * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * Copyright (c) 2017 Victor Perez * * 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 @@ -26,11 +27,13 @@ // Inherit and expand on the official library class libServo : public Servo { public: + libServo(); int8_t attach(const int pin); int8_t attach(const int pin, const int min, const int max); void move(const int value); private: - uint16_t min_ticks; - uint16_t max_ticks; - uint8_t servoIndex; // index into the channel data for this servo + typedef Servo super; + + int servo_pin = 0; + millis_t delay = 0; }; diff --git a/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp b/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp new file mode 100644 index 000000000000..2d2883f4ce3b --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp @@ -0,0 +1,395 @@ +/* + * SoftwareSerial.cpp (formerly NewSoftSerial.cpp) + * + * Multi-instance software serial library for Arduino/Wiring + * -- Interrupt-driven receive and other improvements by ladyada + * (http://ladyada.net) + * -- Tuning, circular buffer, derivation from class Print/Stream, + * multi-instance support, porting to 8MHz processors, + * various optimizations, PROGMEM delay tables, inverse logic and + * direct port writing by Mikal Hart (http://www.arduiniana.org) + * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com) + * -- 20MHz processor support by Garrett Mace (http://www.macetech.com) + * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) + * -- STM32 support by Armin van der Togt + * + * 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 + * + * The latest version of this library can always be found at + * http://arduiniana.org. + */ + +// +// Includes +// +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + +#include "SoftwareSerial.h" +#include "timers.h" + +#define OVERSAMPLE 3 // in RX, Timer will generate interruption OVERSAMPLE time during a bit. Thus OVERSAMPLE ticks in a bit. (interrupt not synchonized with edge). + +// defined in bit-periods +#define HALFDUPLEX_SWITCH_DELAY 5 +// It's best to define TIMER_SERIAL in variant.h. If not defined, we choose one here +// The order is based on (lack of) features and compare channels, we choose the simplest available +// because we only need an update interrupt +#if !defined(TIMER_SERIAL) +#if defined (TIM18_BASE) +#define TIMER_SERIAL TIM18 +#elif defined (TIM7_BASE) +#define TIMER_SERIAL TIM7 +#elif defined (TIM6_BASE) +#define TIMER_SERIAL TIM6 +#elif defined (TIM22_BASE) +#define TIMER_SERIAL TIM22 +#elif defined (TIM21_BASE) +#define TIMER_SERIAL TIM21 +#elif defined (TIM17_BASE) +#define TIMER_SERIAL TIM17 +#elif defined (TIM16_BASE) +#define TIMER_SERIAL TIM16 +#elif defined (TIM15_BASE) +#define TIMER_SERIAL TIM15 +#elif defined (TIM14_BASE) +#define TIMER_SERIAL TIM14 +#elif defined (TIM13_BASE) +#define TIMER_SERIAL TIM13 +#elif defined (TIM11_BASE) +#define TIMER_SERIAL TIM11 +#elif defined (TIM10_BASE) +#define TIMER_SERIAL TIM10 +#elif defined (TIM12_BASE) +#define TIMER_SERIAL TIM12 +#elif defined (TIM19_BASE) +#define TIMER_SERIAL TIM19 +#elif defined (TIM9_BASE) +#define TIMER_SERIAL TIM9 +#elif defined (TIM5_BASE) +#define TIMER_SERIAL TIM5 +#elif defined (TIM4_BASE) +#define TIMER_SERIAL TIM4 +#elif defined (TIM3_BASE) +#define TIMER_SERIAL TIM3 +#elif defined (TIM2_BASE) +#define TIMER_SERIAL TIM2 +#elif defined (TIM20_BASE) +#define TIMER_SERIAL TIM20 +#elif defined (TIM8_BASE) +#define TIMER_SERIAL TIM8 +#elif defined (TIM1_BASE) +#define TIMER_SERIAL TIM1 +#else +#error No suitable timer found for SoftwareSerial, define TIMER_SERIAL in variant.h +#endif +#endif +// +// Statics +// +HardwareTimer SoftwareSerial::timer(TIMER_SERIAL); +const IRQn_Type SoftwareSerial::timer_interrupt_number = static_cast(getTimerUpIrq(TIMER_SERIAL)); +uint32_t SoftwareSerial::timer_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), TIM_IRQ_PRIO, TIM_IRQ_SUBPRIO); +SoftwareSerial *SoftwareSerial::active_listener = nullptr; +SoftwareSerial *volatile SoftwareSerial::active_out = nullptr; +SoftwareSerial *volatile SoftwareSerial::active_in = nullptr; +int32_t SoftwareSerial::tx_tick_cnt = 0; // OVERSAMPLE ticks needed for a bit +int32_t volatile SoftwareSerial::rx_tick_cnt = 0; // OVERSAMPLE ticks needed for a bit +uint32_t SoftwareSerial::tx_buffer = 0; +int32_t SoftwareSerial::tx_bit_cnt = 0; +uint32_t SoftwareSerial::rx_buffer = 0; +int32_t SoftwareSerial::rx_bit_cnt = -1; // rx_bit_cnt = -1 : waiting for start bit +uint32_t SoftwareSerial::cur_speed = 0; + +void SoftwareSerial::setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority) { + timer_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), preemptPriority, subPriority); +} + +// +// Private methods +// + +void SoftwareSerial::setSpeed(uint32_t speed) { + if (speed != cur_speed) { + timer.pause(); + if (speed != 0) { + // Disable the timer + uint32_t clock_rate, cmp_value; + // Get timer clock + clock_rate = timer.getTimerClkFreq(); + int pre = 1; + // Calculate prescale an compare value + do { + cmp_value = clock_rate / (speed * OVERSAMPLE); + if (cmp_value >= UINT16_MAX) { + clock_rate /= 2; + pre *= 2; + } + } while (cmp_value >= UINT16_MAX); + timer.setPrescaleFactor(pre); + timer.setOverflow(cmp_value); + timer.setCount(0); + timer.attachInterrupt(&handleInterrupt); + timer.resume(); + NVIC_SetPriority(timer_interrupt_number, timer_interrupt_priority); + } + else + timer.detachInterrupt(); + cur_speed = speed; + } +} + +// This function sets the current object as the "listening" +// one and returns true if it replaces another +bool SoftwareSerial::listen() { + if (active_listener != this) { + // wait for any transmit to complete as we may change speed + while (active_out); + active_listener->stopListening(); + rx_tick_cnt = 1; // 1 : next interrupt will decrease rx_tick_cnt to 0 which means RX pin level will be considered. + rx_bit_cnt = -1; // rx_bit_cnt = -1 : waiting for start bit + setSpeed(_speed); + active_listener = this; + if (!_half_duplex) active_in = this; + return true; + } + return false; +} + +// Stop listening. Returns true if we were actually listening. +bool SoftwareSerial::stopListening() { + if (active_listener == this) { + // wait for any output to complete + while (active_out); + if (_half_duplex) setRXTX(false); + active_listener = nullptr; + active_in = nullptr; + // turn off ints + setSpeed(0); + return true; + } + return false; +} + +inline void SoftwareSerial::setTX() { + if (_inverse_logic) + LL_GPIO_ResetOutputPin(_transmitPinPort, _transmitPinNumber); + else + LL_GPIO_SetOutputPin(_transmitPinPort, _transmitPinNumber); + pinMode(_transmitPin, OUTPUT); +} + +inline void SoftwareSerial::setRX() { + pinMode(_receivePin, _inverse_logic ? INPUT_PULLDOWN : INPUT_PULLUP); // pullup for normal logic! +} + +inline void SoftwareSerial::setRXTX(bool input) { + if (_half_duplex) { + if (input) { + if (active_in != this) { + setRX(); + rx_bit_cnt = -1; // rx_bit_cnt = -1 : waiting for start bit + rx_tick_cnt = 2; // 2 : next interrupt will be discarded. 2 interrupts required to consider RX pin level + active_in = this; + } + } + else { + if (active_in == this) { + setTX(); + active_in = nullptr; + } + } + } +} + +inline void SoftwareSerial::send() { + if (--tx_tick_cnt <= 0) { // if tx_tick_cnt > 0 interrupt is discarded. Only when tx_tick_cnt reaches 0 is TX pin set. + if (tx_bit_cnt++ < 10) { // tx_bit_cnt < 10 transmission is not finished (10 = 1 start +8 bits + 1 stop) + // Send data (including start and stop bits) + if (tx_buffer & 1) + LL_GPIO_SetOutputPin(_transmitPinPort, _transmitPinNumber); + else + LL_GPIO_ResetOutputPin(_transmitPinPort, _transmitPinNumber); + tx_buffer >>= 1; + tx_tick_cnt = OVERSAMPLE; // Wait OVERSAMPLE ticks to send next bit + } + else { // Transmission finished + tx_tick_cnt = 1; + if (_output_pending) { + active_out = nullptr; + + // In half-duplex mode wait HALFDUPLEX_SWITCH_DELAY bit-periods after the byte has + // been transmitted before allowing the switch to RX mode + } + else if (tx_bit_cnt > 10 + OVERSAMPLE * HALFDUPLEX_SWITCH_DELAY) { + if (_half_duplex && active_listener == this) setRXTX(true); + active_out = nullptr; + } + } + } +} + +// +// The receive routine called by the interrupt handler +// +inline void SoftwareSerial::recv() { + if (--rx_tick_cnt <= 0) { // if rx_tick_cnt > 0 interrupt is discarded. Only when rx_tick_cnt reaches 0 is RX pin considered + bool inbit = LL_GPIO_IsInputPinSet(_receivePinPort, _receivePinNumber) ^ _inverse_logic; + if (rx_bit_cnt == -1) { // rx_bit_cnt = -1 : waiting for start bit + if (!inbit) { + // got start bit + rx_bit_cnt = 0; // rx_bit_cnt == 0 : start bit received + rx_tick_cnt = OVERSAMPLE + 1; // Wait 1 bit (OVERSAMPLE ticks) + 1 tick in order to sample RX pin in the middle of the edge (and not too close to the edge) + rx_buffer = 0; + } + else + rx_tick_cnt = 1; // Waiting for start bit, but wrong level. Wait for next Interrupt to check RX pin level + } + else if (rx_bit_cnt >= 8) { // rx_bit_cnt >= 8 : waiting for stop bit + if (inbit) { + // Stop-bit read complete. Add to buffer. + uint8_t next = (_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF; + if (next != _receive_buffer_head) { + // save new data in buffer: tail points to byte destination + _receive_buffer[_receive_buffer_tail] = rx_buffer; // save new byte + _receive_buffer_tail = next; + } + else // rx_bit_cnt = x with x = [0..7] correspond to new bit x received + _buffer_overflow = true; + } + // Full trame received. Restart waiting for start bit at next interrupt + rx_tick_cnt = 1; + rx_bit_cnt = -1; + } + else { + // data bits + rx_buffer >>= 1; + if (inbit) rx_buffer |= 0x80; + rx_bit_cnt++; // Prepare for next bit + rx_tick_cnt = OVERSAMPLE; // Wait OVERSAMPLE ticks before sampling next bit + } + } +} + +// +// Interrupt handling +// + +/* static */ +inline void SoftwareSerial::handleInterrupt(HardwareTimer*) { + if (active_in) active_in->recv(); + if (active_out) active_out->send(); +} + +// +// Constructor +// +SoftwareSerial::SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic /* = false */) : + _receivePin(receivePin), + _transmitPin(transmitPin), + _receivePinPort(digitalPinToPort(receivePin)), + _receivePinNumber(STM_LL_GPIO_PIN(digitalPinToPinName(receivePin))), + _transmitPinPort(digitalPinToPort(transmitPin)), + _transmitPinNumber(STM_LL_GPIO_PIN(digitalPinToPinName(transmitPin))), + _speed(0), + _buffer_overflow(false), + _inverse_logic(inverse_logic), + _half_duplex(receivePin == transmitPin), + _output_pending(0), + _receive_buffer_tail(0), + _receive_buffer_head(0) +{ + if ((receivePin < NUM_DIGITAL_PINS) || (transmitPin < NUM_DIGITAL_PINS)) { + /* Enable GPIO clock for tx and rx pin*/ + set_GPIO_Port_Clock(STM_PORT(digitalPinToPinName(transmitPin))); + set_GPIO_Port_Clock(STM_PORT(digitalPinToPinName(receivePin))); + } + else + _Error_Handler("ERROR: invalid pin number\n", -1); +} + +// +// Destructor +// +SoftwareSerial::~SoftwareSerial() { end(); } + +// +// Public methods +// + +void SoftwareSerial::begin(long speed) { + #ifdef FORCE_BAUD_RATE + speed = FORCE_BAUD_RATE; + #endif + _speed = speed; + if (!_half_duplex) { + setTX(); + setRX(); + listen(); + } + else + setTX(); +} + +void SoftwareSerial::end() { + stopListening(); +} + +// Read data from buffer +int SoftwareSerial::read() { + // Empty buffer? + if (_receive_buffer_head == _receive_buffer_tail) return -1; + + // Read from "head" + uint8_t d = _receive_buffer[_receive_buffer_head]; // grab next byte + _receive_buffer_head = (_receive_buffer_head + 1) % _SS_MAX_RX_BUFF; + return d; +} + +int SoftwareSerial::available() { + return (_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head) % _SS_MAX_RX_BUFF; +} + +size_t SoftwareSerial::write(uint8_t b) { + // wait for previous transmit to complete + _output_pending = 1; + while (active_out) { /* nada */ } + // add start and stop bits. + tx_buffer = b << 1 | 0x200; + if (_inverse_logic) tx_buffer = ~tx_buffer; + tx_bit_cnt = 0; + tx_tick_cnt = OVERSAMPLE; + setSpeed(_speed); + if (_half_duplex) setRXTX(false); + _output_pending = 0; + // make us active + active_out = this; + return 1; +} + +void SoftwareSerial::flush() { + noInterrupts(); + _receive_buffer_head = _receive_buffer_tail = 0; + interrupts(); +} + +int SoftwareSerial::peek() { + // Empty buffer? + if (_receive_buffer_head == _receive_buffer_tail) return -1; + + // Read from "head" + return _receive_buffer[_receive_buffer_head]; +} + +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h b/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h new file mode 100644 index 000000000000..3799701cfe5b --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h @@ -0,0 +1,119 @@ +/** + * SoftwareSerial.h (formerly NewSoftSerial.h) + * + * Multi-instance software serial library for Arduino/Wiring + * -- Interrupt-driven receive and other improvements by ladyada + * (http://ladyada.net) + * -- Tuning, circular buffer, derivation from class Print/Stream, + * multi-instance support, porting to 8MHz processors, + * various optimizations, PROGMEM delay tables, inverse logic and + * direct port writing by Mikal Hart (http://www.arduiniana.org) + * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com) + * -- 20MHz processor support by Garrett Mace (http://www.macetech.com) + * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) + * + * 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 + * + * The latest version of this library can always be found at + * http://arduiniana.org. + */ + +#ifndef SOFTWARESERIAL_H +#define SOFTWARESERIAL_H + +#include + +/****************************************************************************** + * Definitions + ******************************************************************************/ + +#define _SS_MAX_RX_BUFF 64 // RX buffer size + +class SoftwareSerial : public Stream { + private: + // per object data + uint16_t _receivePin; + uint16_t _transmitPin; + GPIO_TypeDef *_receivePinPort; + uint32_t _receivePinNumber; + GPIO_TypeDef *_transmitPinPort; + uint32_t _transmitPinNumber; + uint32_t _speed; + + uint16_t _buffer_overflow: 1; + uint16_t _inverse_logic: 1; + uint16_t _half_duplex: 1; + uint16_t _output_pending: 1; + + unsigned char _receive_buffer[_SS_MAX_RX_BUFF]; + volatile uint8_t _receive_buffer_tail; + volatile uint8_t _receive_buffer_head; + + uint32_t delta_start = 0; + + // static data + static bool initialised; + static HardwareTimer timer; + static const IRQn_Type timer_interrupt_number; + static uint32_t timer_interrupt_priority; + static SoftwareSerial *active_listener; + static SoftwareSerial *volatile active_out; + static SoftwareSerial *volatile active_in; + static int32_t tx_tick_cnt; + static volatile int32_t rx_tick_cnt; + static uint32_t tx_buffer; + static int32_t tx_bit_cnt; + static uint32_t rx_buffer; + static int32_t rx_bit_cnt; + static uint32_t cur_speed; + + // private methods + void send(); + void recv(); + void setTX(); + void setRX(); + void setSpeed(uint32_t speed); + void setRXTX(bool input); + static void handleInterrupt(HardwareTimer *timer); + + public: + // public methods + + SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic = false); + virtual ~SoftwareSerial(); + void begin(long speed); + bool listen(); + void end(); + bool isListening() { return active_listener == this; } + bool stopListening(); + bool overflow() { + bool ret = _buffer_overflow; + if (ret) _buffer_overflow = false; + return ret; + } + int peek(); + + virtual size_t write(uint8_t byte); + virtual int read(); + virtual int available(); + virtual void flush(); + operator bool() { return true; } + + static void setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority); + + using Print::write; +}; + +#endif // SOFTWARESERIAL_H diff --git a/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h b/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h index 86f6d68c59ca..d0aa731e890d 100644 --- a/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h @@ -25,9 +25,9 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { #if HAS_X_MAX attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); #endif diff --git a/Marlin/src/HAL/HAL_STM32/fastio_STM32.cpp b/Marlin/src/HAL/HAL_STM32/fastio.cpp similarity index 100% rename from Marlin/src/HAL/HAL_STM32/fastio_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/fastio.cpp diff --git a/Marlin/src/HAL/HAL_STM32/fastio_STM32.h b/Marlin/src/HAL/HAL_STM32/fastio.h similarity index 85% rename from Marlin/src/HAL/HAL_STM32/fastio_STM32.h rename to Marlin/src/HAL/HAL_STM32/fastio.h index fd97fd206c3a..917ee3a1a630 100644 --- a/Marlin/src/HAL/HAL_STM32/fastio_STM32.h +++ b/Marlin/src/HAL/HAL_STM32/fastio.h @@ -27,25 +27,25 @@ * These use GPIO register access for fast port manipulation. */ -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ extern GPIO_TypeDef * FastIOPortMap[]; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ void FastIO_init(); // Must be called before using fast io macros -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define _BV32(b) (1UL << (b)) -#if !defined(PWM) +#ifndef PWM #define PWM OUTPUT #endif @@ -53,7 +53,7 @@ void FastIO_init(); // Must be called before using fast io macros #define _WRITE(IO, V) do { \ if (V) FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO])) ; \ else FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR = _BV32(STM_PIN(digitalPin[IO])) ; \ - } while(0) + }while(0) #else #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + (V ? 0 : 16))) #endif diff --git a/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32/SanityCheck.h b/Marlin/src/HAL/HAL_STM32/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32/SanityCheck.h rename to Marlin/src/HAL/HAL_STM32/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp index 1161db2cb9ce..c94bce3b650e 100644 --- a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp @@ -24,24 +24,24 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(EEPROM_SETTINGS) +#if ENABLED(EEPROM_SETTINGS) && ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) #include "../shared/persistent_store_api.h" -#if NONE(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM) +#if ENABLED(FLASH_EEPROM_EMULATION) #include static bool eeprom_data_written = false; #endif bool PersistentStore::access_start() { - #if NONE(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM) + #if ENABLED(FLASH_EEPROM_EMULATION) eeprom_buffer_fill(); #endif return true; } bool PersistentStore::access_finish() { - #if NONE(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM) + #if ENABLED(FLASH_EEPROM_EMULATION) if (eeprom_data_written) { eeprom_buffer_flush(); eeprom_data_written = false; @@ -66,7 +66,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return true; } } - #elif DISABLED(EEPROM_EMULATED_WITH_SRAM) + #elif ENABLED(FLASH_EEPROM_EMULATION) eeprom_buffered_write_byte(pos, v); #else *(__IO uint8_t *)(BKPSRAM_BASE + (uint8_t * const)pos) = v; @@ -76,20 +76,20 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui pos++; value++; }; - #if NONE(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM) + #if ENABLED(FLASH_EEPROM_EMULATION) eeprom_data_written = true; #endif return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing) { +bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { // Read from either external EEPROM, program flash or Backup SRAM const uint8_t c = ( #if EITHER(SPI_EEPROM, I2C_EEPROM) eeprom_read_byte((uint8_t*)pos) - #elif DISABLED(EEPROM_EMULATED_WITH_SRAM) + #elif ENABLED(FLASH_EEPROM_EMULATION) eeprom_buffered_read_byte(pos) #else (*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos))) @@ -105,14 +105,14 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t } size_t PersistentStore::capacity() { - #if EITHER(SPI_EEPROM, I2C_EEPROM) - return E2END + 1; - #elif DISABLED(EEPROM_EMULATED_WITH_SRAM) - return E2END + 1; - #else - return 4096; // 4kB - #endif + return ( + #if ENABLED(SRAM_EEPROM_EMULATION) + 4096 // 4kB + #else + E2END + 1 + #endif + ); } -#endif // EEPROM_SETTINGS +#endif // EEPROM_SETTINGS && (FLASH_EEPROM_EMULATION || SRAM_EEPROM_EMULATION || SPI_EEPROM || I2C_EEPROM) #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp b/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp new file mode 100644 index 000000000000..6ce63073c4a2 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp @@ -0,0 +1,103 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * Implementation of EEPROM settings in SD Card + */ + +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) + +#include "../shared/persistent_store_api.h" + +#ifndef E2END + #define E2END 0xFFF // 4KB +#endif +#define HAL_EEPROM_SIZE int(E2END + 1) + +#define _ALIGN(x) __attribute__ ((aligned(x))) +static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; + +#if ENABLED(SDSUPPORT) + + #include "../../sd/cardreader.h" + + #define EEPROM_FILENAME "eeprom.dat" + + bool PersistentStore::access_start() { + if (!card.isMounted()) return false; + + SdFile file, root = card.getroot(); + if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) + return true; + + int bytes_read = file.read(HAL_eeprom_data, HAL_EEPROM_SIZE); + if (bytes_read < 0) return false; + for (; bytes_read < HAL_EEPROM_SIZE; bytes_read++) + HAL_eeprom_data[bytes_read] = 0xFF; + file.close(); + return true; + } + + bool PersistentStore::access_finish() { + if (!card.isMounted()) return false; + + SdFile file, root = card.getroot(); + int bytes_written = 0; + if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) { + bytes_written = file.write(HAL_eeprom_data, HAL_EEPROM_SIZE); + file.close(); + } + return (bytes_written == HAL_EEPROM_SIZE); + } + +#else // !SDSUPPORT + + #error "Please define an EEPROM, a SDCARD or disable EEPROM_SETTINGS." + +#endif // !SDSUPPORT + +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { + for (size_t i = 0; i < size; i++) + HAL_eeprom_data[pos + i] = value[i]; + crc16(crc, value, size); + pos += size; + return false; +} + +bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { + for (size_t i = 0; i < size; i++) { + uint8_t c = HAL_eeprom_data[pos + i]; + if (writing) value[i] = c; + crc16(crc, &c, 1); + } + pos += size; + return false; +} + +size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; } + +#endif // EEPROM_SETTINGS +#endif // STM32 diff --git a/Marlin/src/HAL/HAL_STM32/pinsDebug.h b/Marlin/src/HAL/HAL_STM32/pinsDebug.h index 3759c2d6c3f9..4e27cee195d3 100644 --- a/Marlin/src/HAL/HAL_STM32/pinsDebug.h +++ b/Marlin/src/HAL/HAL_STM32/pinsDebug.h @@ -1 +1,34 @@ -#error "PINS_DEBUGGING is not yet supported for STM32!" +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#if !(defined(NUM_DIGITAL_PINS) || defined(BOARD_NR_GPIO_PINS)) + #error "M43 not supported for this board" +#endif + +// Strange - STM32F4 comes to HAL_STM32 rather than HAL_STM32F4 for these files +#ifdef STM32F4 + #ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) + #include "pinsDebug_STM32duino.h" + #elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) + #include "pinsDebug_STM32GENERIC.h" + #else + #error "M43 not supported for this board" + #endif +#endif diff --git a/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h b/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h new file mode 100644 index 000000000000..b1c256218596 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h @@ -0,0 +1,125 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +/** + * Support routines for STM32GENERIC (Maple) + */ + +/** + * Translation of routines & variables used by pinsDebug.h + */ + +#ifdef BOARD_NR_GPIO_PINS // Only in STM32GENERIC (Maple) + +#ifdef __STM32F1__ + #include "../HAL_STM32F1/fastio.h" +#elif defined(STM32F4) || defined(STM32F7) + #include "../HAL_STM32_F4_F7/fastio.h" +#else + #include "fastio.h" +#endif + +extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]; + +#define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS +#define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS +#define VALID_PIN(pin) (pin >= 0 && pin < BOARD_NR_GPIO_PINS) +#define GET_ARRAY_PIN(p) pin_t(pin_array[p].pin) +#define pwm_status(pin) PWM_PIN(pin) +#define digitalRead_mod(p) extDigitalRead(p) +#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0) +#define PRINT_PORT(p) print_port(p) +#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) +#define MULTI_NAME_PAD 21 // space needed to be pretty if not first name assigned to a pin + +// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities +#ifndef M43_NEVER_TOUCH + #define M43_NEVER_TOUCH(Q) (Q >= 9 && Q <= 12) // SERIAL/USB pins PA9(TX) PA10(RX) +#endif + +static inline int8_t get_pin_mode(pin_t pin) { + return VALID_PIN(pin) ? _GET_MODE(pin) : -1; +} + +static inline pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { + if (!VALID_PIN(pin)) return -1; + int8_t adc_channel = int8_t(PIN_MAP[pin].adc_channel); + #ifdef NUM_ANALOG_INPUTS + if (adc_channel >= NUM_ANALOG_INPUTS) adc_channel = ADCx; + #endif + return pin_t(adc_channel); +} + +static inline bool IS_ANALOG(pin_t pin) { + if (!VALID_PIN(pin)) return false; + if (PIN_MAP[pin].adc_channel != ADCx) { + #ifdef NUM_ANALOG_INPUTS + if (PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS) return false; + #endif + return _GET_MODE(pin) == GPIO_INPUT_ANALOG && !M43_NEVER_TOUCH(pin); + } + return false; +} + +static inline bool GET_PINMODE(const pin_t pin) { + return VALID_PIN(pin) && !IS_INPUT(pin); +} + +static inline bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) { + const pin_t pin = GET_ARRAY_PIN(array_pin); + return (!IS_ANALOG(pin) + #ifdef NUM_ANALOG_INPUTS + || PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS + #endif + ); +} + +#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density + +static inline void pwm_details(const pin_t pin) { + if (PWM_PIN(pin)) { + timer_dev * const tdev = PIN_MAP[pin].timer_device; + const uint8_t channel = PIN_MAP[pin].timer_channel; + const char num = ( + #if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY) + tdev == &timer8 ? '8' : + tdev == &timer5 ? '5' : + #endif + tdev == &timer4 ? '4' : + tdev == &timer3 ? '3' : + tdev == &timer2 ? '2' : + tdev == &timer1 ? '1' : '?' + ); + char buffer[10]; + sprintf_P(buffer, PSTR(" TIM%c CH%c"), num, ('0' + channel)); + SERIAL_ECHO(buffer); + } +} + +static inline void print_port(pin_t pin) { + const char port = 'A' + char(pin >> 4); // pin div 16 + const int16_t gbit = PIN_MAP[pin].gpio_bit; + char buffer[8]; + sprintf_P(buffer, PSTR("P%c%hd "), port, gbit); + if (gbit < 10) SERIAL_CHAR(' '); + SERIAL_ECHO(buffer); +} + +#endif // BOARD_NR_GPIO_PINS diff --git a/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h b/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h new file mode 100644 index 000000000000..9d9796eabecb --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h @@ -0,0 +1,275 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#include + +#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) + +/** + * Life gets complicated if you want an easy to use 'M43 I' output (in port/pin order) + * because the variants in this platform do not always define all the I/O port/pins + * that a CPU has. + * + * VARIABLES: + * Ard_num - Arduino pin number - defined by the platform. It is used by digitalRead and + * digitalWrite commands and by M42. + * - does not contain port/pin info + * - is not in port/pin order + * - typically a variant will only assign Ard_num to port/pins that are actually used + * Index - M43 counter - only used to get Ard_num + * x - a parameter/argument used to search the pin_array to try to find a signal name + * associated with a Ard_num + * Port_pin - port number and pin number for use with CPU registers and printing reports + * + * Since M43 uses digitalRead and digitalWrite commands, only the Port_pins with an Ard_num + * are accessed and/or displayed. + * + * Three arrays are used. + * + * digitalPin[] is provided by the platform. It consists of the Port_pin numbers in + * Arduino pin number order. + * + * pin_array is a structure generated by the pins/pinsDebug.h header file. It is generated by + * the preprocessor. Only the signals associated with enabled options are in this table. + * It contains: + * - name of the signal + * - the Ard_num assigned by the pins_YOUR_BOARD.h file using the platform defines. + * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as an + * index into digitalPin[] to get the Port_pin number + * - if it is a digital or analog signal. PWMs are considered digital here. + * + * pin_xref is a structure generated by this header file. It is generated by the + * preprocessor. It is in port/pin order. It contains just the port/pin numbers defined by the + * platform for this variant. + * - Ard_num + * - printable version of Port_pin + * + * Routines with an "x" as a parameter/argument are used to search the pin_array to try to + * find a signal name associated with a port/pin. + * + * NOTE - the Arduino pin number is what is used by the M42 command, NOT the port/pin for that + * signal. The Arduino pin number is listed by the M43 I command. + */ + +extern const PinName digitalPin[]; // provided by the platform + +//////////////////////////////////////////////////////// +// +// make a list of the Arduino pin numbers in the Port/Pin order +// + +#define _PIN_ADD_2(NAME_ALPHA, ARDUINO_NUM) { {NAME_ALPHA}, ARDUINO_NUM }, +#define _PIN_ADD(NAME_ALPHA, ARDUINO_NUM) { NAME_ALPHA, ARDUINO_NUM }, +#define PIN_ADD(NAME) _PIN_ADD(#NAME, NAME) + +typedef struct { + char Port_pin_alpha[5]; + pin_t Ard_num; +} XrefInfo; + +const XrefInfo pin_xref[] PROGMEM = { + #include "pins_Xref.h" +}; + +//////////////////////////////////////////////////////////// + +#define MODE_PIN_INPUT 0 // Input mode (reset state) +#define MODE_PIN_OUTPUT 1 // General purpose output mode +#define MODE_PIN_ALT 2 // Alternate function mode +#define MODE_PIN_ANALOG 3 // Analog mode + +#define PIN_NUM(P) (P & 0x000F) +#define PIN_NUM_ALPHA_LEFT(P) (((P & 0x000F) < 10) ? ('0' + (P & 0x000F)) : '1') +#define PIN_NUM_ALPHA_RIGHT(P) (((P & 0x000F) > 9) ? ('0' + (P & 0x000F) - 10) : 0 ) +#define PORT_NUM(P) ((P >> 4) & 0x0007) +#define PORT_ALPHA(P) ('A' + (P >> 4)) + +/** + * Translation of routines & variables used by pinsDebug.h + */ +#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS +#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL) +#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads +#define PRINT_PIN(Q) +#define PRINT_PORT(ANUM) port_print(ANUM) +#define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine +#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num + +// x is a variable used to search pin_array +#define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital) +#define GET_ARRAY_PIN(x) ((pin_t) pin_array[x].pin) +#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) +#define MULTI_NAME_PAD 33 // space needed to be pretty if not first name assigned to a pin + +#ifndef M43_NEVER_TOUCH + #define _M43_NEVER_TOUCH(Index) (Index >= 9 && Index <= 12) // SERIAL/USB pins: PA9(TX) PA10(RX) PA11(USB_DM) PA12(USB_DP) + #ifdef KILL_PIN + #define M43_NEVER_TOUCH(Index) m43_never_touch(Index) + + bool m43_never_touch(const pin_t Index) { + static pin_t M43_kill_index = -1; + if (M43_kill_index < 0) + for (M43_kill_index = 0; M43_kill_index < NUMBER_PINS_TOTAL; M43_kill_index++) + if (KILL_PIN == GET_PIN_MAP_PIN_M43(M43_kill_index)) break; + return _M43_NEVER_TOUCH(Index) || Index == M43_kill_index; // KILL_PIN and SERIAL/USB + } + #else + #define M43_NEVER_TOUCH(Index) _M43_NEVER_TOUCH(Index) + #endif +#endif + +uint8_t get_pin_mode(const pin_t Ard_num) { + uint32_t mode_all = 0; + const PinName dp = digitalPin[Ard_num]; + switch (PORT_ALPHA(dp)) { + case 'A' : mode_all = GPIOA->MODER; break; + case 'B' : mode_all = GPIOB->MODER; break; + case 'C' : mode_all = GPIOC->MODER; break; + case 'D' : mode_all = GPIOD->MODER; break; + #ifdef PE_0 + case 'E' : mode_all = GPIOE->MODER; break; + #elif defined(PF_0) + case 'F' : mode_all = GPIOF->MODER; break; + #elif defined(PG_0) + case 'G' : mode_all = GPIOG->MODER; break; + #elif defined(PH_0) + case 'H' : mode_all = GPIOH->MODER; break; + #elif defined(PI_0) + case 'I' : mode_all = GPIOI->MODER; break; + #elif defined(PJ_0) + case 'J' : mode_all = GPIOJ->MODER; break; + #elif defined(PK_0) + case 'K' : mode_all = GPIOK->MODER; break; + #elif defined(PL_0) + case 'L' : mode_all = GPIOL->MODER; break; + #endif + } + return (mode_all >> (2 * uint8_t(PIN_NUM(dp)))) & 0x03; +} + +bool GET_PINMODE(const pin_t Ard_num) { + const uint8_t pin_mode = get_pin_mode(Ard_num); + return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM +} + +int8_t digital_pin_to_analog_pin(pin_t Ard_num) { + Ard_num -= NUM_ANALOG_FIRST; + return (Ard_num >= 0 && Ard_num < NUM_ANALOG_INPUTS) ? Ard_num : -1; +} + +bool IS_ANALOG(const pin_t Ard_num) { + return get_pin_mode(Ard_num) == MODE_PIN_ANALOG; +} + +bool is_digital(const pin_t x) { + const uint8_t pin_mode = get_pin_mode(pin_array[x].pin); + return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT; +} + +void port_print(const pin_t Ard_num) { + char buffer[16]; + pin_t Index; + for (Index = 0; Index < NUMBER_PINS_TOTAL; Index++) + if (Ard_num == GET_PIN_MAP_PIN_M43(Index)) break; + + const char * ppa = pin_xref[Index].Port_pin_alpha; + sprintf_P(buffer, PSTR("%s"), ppa); + SERIAL_ECHO(buffer); + if (ppa[3] == '\0') SERIAL_CHAR(' '); + + // print analog pin number + const int8_t Port_pin = digital_pin_to_analog_pin(Ard_num); + if (Port_pin >= 0) { + sprintf_P(buffer, PSTR(" (A%d) "), Port_pin); + SERIAL_ECHO(buffer); + if (Port_pin < 10) SERIAL_CHAR(' '); + } + else + SERIAL_ECHO_SP(7); + + // Print number to be used with M42 + sprintf_P(buffer, PSTR(" M42 P%d "), Ard_num); + SERIAL_ECHO(buffer); + if (Ard_num < 10) SERIAL_CHAR(' '); + if (Ard_num < 100) SERIAL_CHAR(' '); +} + +bool pwm_status(const pin_t Ard_num) { + return get_pin_mode(Ard_num) == MODE_PIN_ALT; +} + +void pwm_details(const pin_t Ard_num) { + if (pwm_status(Ard_num)) { + uint32_t alt_all = 0; + const PinName dp = digitalPin[Ard_num]; + pin_t pin_number = uint8_t(PIN_NUM(dp)); + const bool over_7 = pin_number >= 8; + const uint8_t ind = over_7 ? 1 : 0; + switch (PORT_ALPHA(dp)) { // get alt function + case 'A' : alt_all = GPIOA->AFR[ind]; break; + case 'B' : alt_all = GPIOB->AFR[ind]; break; + case 'C' : alt_all = GPIOC->AFR[ind]; break; + case 'D' : alt_all = GPIOD->AFR[ind]; break; + #ifdef PE_0 + case 'E' : alt_all = GPIOE->AFR[ind]; break; + #elif defined (PF_0) + case 'F' : alt_all = GPIOF->AFR[ind]; break; + #elif defined (PG_0) + case 'G' : alt_all = GPIOG->AFR[ind]; break; + #elif defined (PH_0) + case 'H' : alt_all = GPIOH->AFR[ind]; break; + #elif defined (PI_0) + case 'I' : alt_all = GPIOI->AFR[ind]; break; + #elif defined (PJ_0) + case 'J' : alt_all = GPIOJ->AFR[ind]; break; + #elif defined (PK_0) + case 'K' : alt_all = GPIOK->AFR[ind]; break; + #elif defined (PL_0) + case 'L' : alt_all = GPIOL->AFR[ind]; break; + #endif + } + if (over_7) pin_number -= 8; + + uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F; + SERIAL_ECHOPAIR("Alt Function: ", alt_func); + if (alt_func < 10) SERIAL_CHAR(' '); + SERIAL_ECHOPGM(" - "); + switch (alt_func) { + case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break; + case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break; + case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break; + case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break; + case 4 : SERIAL_ECHOPGM("I2C1..3"); break; + case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break; + case 6 : SERIAL_ECHOPGM("SPI3"); break; + case 7 : SERIAL_ECHOPGM("USART1..3"); break; + case 8 : SERIAL_ECHOPGM("USART4..6"); break; + case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break; + case 10 : SERIAL_ECHOPGM("OTG"); break; + case 11 : SERIAL_ECHOPGM("ETH"); break; + case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break; + case 13 : SERIAL_ECHOPGM("DCMI"); break; + case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break; + case 15 : SERIAL_ECHOPGM("EVENTOUT"); break; + } + } +} // pwm_details + +#endif // NUM_DIGITAL_PINS diff --git a/Marlin/src/HAL/HAL_STM32/pins_Xref.h b/Marlin/src/HAL/HAL_STM32/pins_Xref.h new file mode 100644 index 000000000000..84278c391683 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/pins_Xref.h @@ -0,0 +1,612 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +// +// make a list of the Arduino pin numbers in the Port/Pin order +// +#ifdef PA0 + PIN_ADD(PA0) +#endif +#ifdef PA1 + PIN_ADD(PA1) +#endif +#ifdef PA2 + PIN_ADD(PA2) +#endif +#ifdef PA3 + PIN_ADD(PA3) +#endif +#ifdef PA4 + PIN_ADD(PA4) +#endif +#ifdef PA5 + PIN_ADD(PA5) +#endif +#ifdef PA6 + PIN_ADD(PA6) +#endif +#ifdef PA7 + PIN_ADD(PA7) +#endif +#ifdef PA8 + PIN_ADD(PA8) +#endif +#ifdef PA9 + PIN_ADD(PA9) +#endif +#ifdef PA10 + PIN_ADD(PA10) +#endif +#ifdef PA11 + PIN_ADD(PA11) +#endif +#ifdef PA12 + PIN_ADD(PA12) +#endif +#ifdef PA13 + PIN_ADD(PA13) +#endif +#ifdef PA14 + PIN_ADD(PA14) +#endif +#ifdef PA15 + PIN_ADD(PA15) +#endif + +#ifdef PB0 + PIN_ADD(PB0) +#endif +#ifdef PB1 + PIN_ADD(PB1) +#endif +#ifdef PB2 + PIN_ADD(PB2) +#endif +#ifdef PB3 + PIN_ADD(PB3) +#endif +#ifdef PB4 + PIN_ADD(PB4) +#endif +#ifdef PB5 + PIN_ADD(PB5) +#endif +#ifdef PB6 + PIN_ADD(PB6) +#endif +#ifdef PB7 + PIN_ADD(PB7) +#endif +#ifdef PB8 + PIN_ADD(PB8) +#endif +#ifdef PB9 + PIN_ADD(PB9) +#endif +#ifdef PB10 + PIN_ADD(PB10) +#endif +#ifdef PB11 + PIN_ADD(PB11) +#endif +#ifdef PB12 + PIN_ADD(PB12) +#endif +#ifdef PB13 + PIN_ADD(PB13) +#endif +#ifdef PB14 + PIN_ADD(PB14) +#endif +#ifdef PB15 + PIN_ADD(PB15) +#endif + +#ifdef PC0 + PIN_ADD(PC0) +#endif +#ifdef PC1 + PIN_ADD(PC1) +#endif +#ifdef PC2 + PIN_ADD(PC2) +#endif +#ifdef PC3 + PIN_ADD(PC3) +#endif +#ifdef PC4 + PIN_ADD(PC4) +#endif +#ifdef PC5 + PIN_ADD(PC5) +#endif +#ifdef PC6 + PIN_ADD(PC6) +#endif +#ifdef PC7 + PIN_ADD(PC7) +#endif +#ifdef PC8 + PIN_ADD(PC8) +#endif +#ifdef PC9 + PIN_ADD(PC9) +#endif +#ifdef PC10 + PIN_ADD(PC10) +#endif +#ifdef PC11 + PIN_ADD(PC11) +#endif +#ifdef PC12 + PIN_ADD(PC12) +#endif +#ifdef PC13 + PIN_ADD(PC13) +#endif +#ifdef PC14 + PIN_ADD(PC14) +#endif +#ifdef PC15 + PIN_ADD(PC15) +#endif + +#ifdef PD0 + PIN_ADD(PD0) +#endif +#ifdef PD1 + PIN_ADD(PD1) +#endif +#ifdef PD2 + PIN_ADD(PD2) +#endif +#ifdef PD3 + PIN_ADD(PD3) +#endif +#ifdef PD4 + PIN_ADD(PD4) +#endif +#ifdef PD5 + PIN_ADD(PD5) +#endif +#ifdef PD6 + PIN_ADD(PD6) +#endif +#ifdef PD7 + PIN_ADD(PD7) +#endif +#ifdef PD8 + PIN_ADD(PD8) +#endif +#ifdef PD9 + PIN_ADD(PD9) +#endif +#ifdef PD10 + PIN_ADD(PD10) +#endif +#ifdef PD11 + PIN_ADD(PD11) +#endif +#ifdef PD12 + PIN_ADD(PD12) +#endif +#ifdef PD13 + PIN_ADD(PD13) +#endif +#ifdef PD14 + PIN_ADD(PD14) +#endif +#ifdef PD15 + PIN_ADD(PD15) +#endif + +#ifdef PE0 + PIN_ADD(PE0) +#endif +#ifdef PE1 + PIN_ADD(PE1) +#endif +#ifdef PE2 + PIN_ADD(PE2) +#endif +#ifdef PE3 + PIN_ADD(PE3) +#endif +#ifdef PE4 + PIN_ADD(PE4) +#endif +#ifdef PE5 + PIN_ADD(PE5) +#endif +#ifdef PE6 + PIN_ADD(PE6) +#endif +#ifdef PE7 + PIN_ADD(PE7) +#endif +#ifdef PE8 + PIN_ADD(PE8) +#endif +#ifdef PE9 + PIN_ADD(PE9) +#endif +#ifdef PE10 + PIN_ADD(PE10) +#endif +#ifdef PE11 + PIN_ADD(PE11) +#endif +#ifdef PE12 + PIN_ADD(PE12) +#endif +#ifdef PE13 + PIN_ADD(PE13) +#endif +#ifdef PE14 + PIN_ADD(PE14) +#endif +#ifdef PE15 + PIN_ADD(PE15) +#endif + +#ifdef PF0 + PIN_ADD(PF0) +#endif +#ifdef PF1 + PIN_ADD(PF1) +#endif +#ifdef PF2 + PIN_ADD(PF2) +#endif +#ifdef PF3 + PIN_ADD(PF3) +#endif +#ifdef PF4 + PIN_ADD(PF4) +#endif +#ifdef PF5 + PIN_ADD(PF5) +#endif +#ifdef PF6 + PIN_ADD(PF6) +#endif +#ifdef PF7 + PIN_ADD(PF7) +#endif +#ifdef PF8 + PIN_ADD(PF8) +#endif +#ifdef PF9 + PIN_ADD(PF9) +#endif +#ifdef PF10 + PIN_ADD(PF10) +#endif +#ifdef PF11 + PIN_ADD(PF11) +#endif +#ifdef PF12 + PIN_ADD(PF12) +#endif +#ifdef PF13 + PIN_ADD(PF13) +#endif +#ifdef PF14 + PIN_ADD(PF14) +#endif +#ifdef PF15 + PIN_ADD(PF15) +#endif + +#ifdef PG0 + PIN_ADD(PG0) +#endif +#ifdef PG1 + PIN_ADD(PG1) +#endif +#ifdef PG2 + PIN_ADD(PG2) +#endif +#ifdef PG3 + PIN_ADD(PG3) +#endif +#ifdef PG4 + PIN_ADD(PG4) +#endif +#ifdef PG5 + PIN_ADD(PG5) +#endif +#ifdef PG6 + PIN_ADD(PG6) +#endif +#ifdef PG7 + PIN_ADD(PG7) +#endif +#ifdef PG8 + PIN_ADD(PG8) +#endif +#ifdef PG9 + PIN_ADD(PG9) +#endif +#ifdef PG10 + PIN_ADD(PG10) +#endif +#ifdef PG11 + PIN_ADD(PG11) +#endif +#ifdef PG12 + PIN_ADD(PG12) +#endif +#ifdef PG13 + PIN_ADD(PG13) +#endif +#ifdef PG14 + PIN_ADD(PG14) +#endif +#ifdef PG15 + PIN_ADD(PG15) +#endif + +#ifdef PH0 + PIN_ADD(PH0) +#endif +#ifdef PH1 + PIN_ADD(PH1) +#endif +#ifdef PH2 + PIN_ADD(PH2) +#endif +#ifdef PH3 + PIN_ADD(PH3) +#endif +#ifdef PH4 + PIN_ADD(PH4) +#endif +#ifdef PH5 + PIN_ADD(PH5) +#endif +#ifdef PH6 + PIN_ADD(PH6) +#endif +#ifdef PH7 + PIN_ADD(PH7) +#endif +#ifdef PH8 + PIN_ADD(PH8) +#endif +#ifdef PH9 + PIN_ADD(PH9) +#endif +#ifdef PH10 + PIN_ADD(PH10) +#endif +#ifdef PH11 + PIN_ADD(PH11) +#endif +#ifdef PH12 + PIN_ADD(PH12) +#endif +#ifdef PH13 + PIN_ADD(PH13) +#endif +#ifdef PH14 + PIN_ADD(PH14) +#endif +#ifdef PH15 + PIN_ADD(PH15) +#endif + +#ifdef PI0 + PIN_ADD(PI0) +#endif +#ifdef PI1 + PIN_ADD(PI1) +#endif +#ifdef PI2 + PIN_ADD(PI2) +#endif +#ifdef PI3 + PIN_ADD(PI3) +#endif +#ifdef PI4 + PIN_ADD(PI4) +#endif +#ifdef PI5 + PIN_ADD(PI5) +#endif +#ifdef PI6 + PIN_ADD(PI6) +#endif +#ifdef PI7 + PIN_ADD(PI7) +#endif +#ifdef PI8 + PIN_ADD(PI8) +#endif +#ifdef PI9 + PIN_ADD(PI9) +#endif +#ifdef PI10 + PIN_ADD(PI10) +#endif +#ifdef PI11 + PIN_ADD(PI11) +#endif +#ifdef PI12 + PIN_ADD(PI12) +#endif +#ifdef PI13 + PIN_ADD(PI13) +#endif +#ifdef PI14 + PIN_ADD(PI14) +#endif +#ifdef PI15 + PIN_ADD(PI15) +#endif + +#ifdef PJ0 + PIN_ADD(PJ0) +#endif +#ifdef PJ1 + PIN_ADD(PJ1) +#endif +#ifdef PJ2 + PIN_ADD(PJ2) +#endif +#ifdef PJ3 + PIN_ADD(PJ3) +#endif +#ifdef PJ4 + PIN_ADD(PJ4) +#endif +#ifdef PJ5 + PIN_ADD(PJ5) +#endif +#ifdef PJ6 + PIN_ADD(PJ6) +#endif +#ifdef PJ7 + PIN_ADD(PJ7) +#endif +#ifdef PJ8 + PIN_ADD(PJ8) +#endif +#ifdef PJ9 + PIN_ADD(PJ9) +#endif +#ifdef PJ10 + PIN_ADD(PJ10) +#endif +#ifdef PJ11 + PIN_ADD(PJ11) +#endif +#ifdef PJ12 + PIN_ADD(PJ12) +#endif +#ifdef PJ13 + PIN_ADD(PJ13) +#endif +#ifdef PJ14 + PIN_ADD(PJ14) +#endif +#ifdef PJ15 + PIN_ADD(PJ15) +#endif + +#ifdef PK0 + PIN_ADD(PK0) +#endif +#ifdef PK1 + PIN_ADD(PK1) +#endif +#ifdef PK2 + PIN_ADD(PK2) +#endif +#ifdef PK3 + PIN_ADD(PK3) +#endif +#ifdef PK4 + PIN_ADD(PK4) +#endif +#ifdef PK5 + PIN_ADD(PK5) +#endif +#ifdef PK6 + PIN_ADD(PK6) +#endif +#ifdef PK7 + PIN_ADD(PK7) +#endif +#ifdef PK8 + PIN_ADD(PK8) +#endif +#ifdef PK9 + PIN_ADD(PK9) +#endif +#ifdef PK10 + PIN_ADD(PK10) +#endif +#ifdef PK11 + PIN_ADD(PK11) +#endif +#ifdef PK12 + PIN_ADD(PK12) +#endif +#ifdef PK13 + PIN_ADD(PK13) +#endif +#ifdef PK14 + PIN_ADD(PK14) +#endif +#ifdef PK15 + PIN_ADD(PK15) +#endif + +#ifdef PL0 + PIN_ADD(PL0) +#endif +#ifdef PL1 + PIN_ADD(PL1) +#endif +#ifdef PL2 + PIN_ADD(PL2) +#endif +#ifdef PL3 + PIN_ADD(PL3) +#endif +#ifdef PL4 + PIN_ADD(PL4) +#endif +#ifdef PL5 + PIN_ADD(PL5) +#endif +#ifdef PL6 + PIN_ADD(PL6) +#endif +#ifdef PL7 + PIN_ADD(PL7) +#endif +#ifdef PL8 + PIN_ADD(PL8) +#endif +#ifdef PL9 + PIN_ADD(PL9) +#endif +#ifdef PL10 + PIN_ADD(PL10) +#endif +#ifdef PL11 + PIN_ADD(PL11) +#endif +#ifdef PL12 + PIN_ADD(PL12) +#endif +#ifdef PL13 + PIN_ADD(PL13) +#endif +#ifdef PL14 + PIN_ADD(PL14) +#endif +#ifdef PL15 + PIN_ADD(PL15) +#endif diff --git a/Marlin/src/HAL/HAL_STM32/timers.cpp b/Marlin/src/HAL/HAL_STM32/timers.cpp new file mode 100644 index 000000000000..c2a4cbdc0e2d --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32/timers.cpp @@ -0,0 +1,139 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com + * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com + * + * 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 . + * + */ + +#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + +#include "HAL.h" + +#include "timers.h" + +// ------------------------ +// Local defines +// ------------------------ + +#define NUM_HARDWARE_TIMERS 2 + +#define __TIMER_DEV(X) TIM##X +#define _TIMER_DEV(X) __TIMER_DEV(X) +#define STEP_TIMER_DEV _TIMER_DEV(STEP_TIMER) +#define TEMP_TIMER_DEV _TIMER_DEV(TEMP_TIMER) + +// ------------------------ +// Private Variables +// ------------------------ + +HardwareTimer *timer_instance[NUM_HARDWARE_TIMERS] = { NULL }; +bool timer_enabled[NUM_HARDWARE_TIMERS] = { false }; + +// ------------------------ +// Public functions +// ------------------------ + +// frequency is in Hertz +void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { + if (!HAL_timer_initialized(timer_num)) { + switch (timer_num) { + case STEP_TIMER_NUM: // STEPPER TIMER - use a 32bit timer if possible + timer_instance[timer_num] = new HardwareTimer(STEP_TIMER_DEV); + /* Set the prescaler to the final desired value. + * This will change the effective ISR callback frequency but when + * HAL_timer_start(timer_num=0) is called in the core for the first time + * the real frequency isn't important as long as, after boot, the ISR + * gets called with the correct prescaler and count register. So here + * we set the prescaler to the correct, final value and ignore the frequency + * asked. We will call back the ISR in 1 second to start at full speed. + * + * The proper fix, however, would be a correct initialization OR a + * HAL_timer_change(const uint8_t timer_num, const uint32_t frequency) + * which changes the prescaler when an IRQ frequency change is needed + * (for example when steppers are turned on) + */ + timer_instance[timer_num]->setPrescaleFactor(STEPPER_TIMER_PRESCALE); //the -1 is done internally + timer_instance[timer_num]->setOverflow(_MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (HAL_TIMER_RATE) / (STEPPER_TIMER_PRESCALE) /* /frequency */), TICK_FORMAT); + break; + case TEMP_TIMER_NUM: // TEMP TIMER - any available 16bit timer + timer_instance[timer_num] = new HardwareTimer(TEMP_TIMER_DEV); + // The prescale factor is computed automatically for HERTZ_FORMAT + timer_instance[timer_num]->setOverflow(frequency, HERTZ_FORMAT); + break; + } + + HAL_timer_enable_interrupt(timer_num); + + /* + * Initializes (and unfortunately starts) the timer. + * This is needed to set correct IRQ priority at the moment but causes + * no harm since every call to HAL_timer_start() is actually followed by + * a call to HAL_timer_enable_interrupt() which means that there isn't + * a case in which you want the timer to run without a callback. + */ + timer_instance[timer_num]->resume(); // First call to resume() MUST follow the attachInterrupt() + + // This is fixed in Arduino_Core_STM32 1.8. + // These calls can be removed and replaced with + // timer_instance[timer_num]->setInterruptPriority + switch (timer_num) { + case STEP_TIMER_NUM: + HAL_NVIC_SetPriority(STEP_TIMER_IRQ_NAME, STEP_TIMER_IRQ_PRIO, 0); + break; + case TEMP_TIMER_NUM: + HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_NAME, TEMP_TIMER_IRQ_PRIO, 0); + break; + } + } +} + +void HAL_timer_enable_interrupt(const uint8_t timer_num) { + if (HAL_timer_initialized(timer_num) && !timer_enabled[timer_num]) { + timer_enabled[timer_num] = true; + switch (timer_num) { + case STEP_TIMER_NUM: + timer_instance[timer_num]->attachInterrupt(Step_Handler); + break; + case TEMP_TIMER_NUM: + timer_instance[timer_num]->attachInterrupt(Temp_Handler); + break; + } + } +} + +void HAL_timer_disable_interrupt(const uint8_t timer_num) { + if (HAL_timer_interrupt_enabled(timer_num)) { + timer_instance[timer_num]->detachInterrupt(); + timer_enabled[timer_num] = false; + } +} + +bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { + return HAL_timer_initialized(timer_num) && timer_enabled[timer_num]; +} + +// Only for use within the HAL +TIM_TypeDef * HAL_timer_device(const uint8_t timer_num) { + switch (timer_num) { + case STEP_TIMER_NUM: return STEP_TIMER_DEV; + case TEMP_TIMER_NUM: return TEMP_TIMER_DEV; + } + return nullptr; +} + +#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h b/Marlin/src/HAL/HAL_STM32/timers.h similarity index 60% rename from Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h rename to Marlin/src/HAL/HAL_STM32/timers.h index 8cdea0a81e40..1d2c095f2bb8 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h +++ b/Marlin/src/HAL/HAL_STM32/timers.h @@ -21,22 +21,19 @@ */ #pragma once -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include #include "../../inc/MarlinConfig.h" -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define FORCE_INLINE __attribute__((always_inline)) inline #define hal_timer_t uint32_t #define HAL_TIMER_TYPE_MAX 0xFFFFFFFF // Timers can be 16 or 32 bit + #ifdef STM32F0xx #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals @@ -70,27 +67,30 @@ #endif #ifndef TEMP_TIMER - #define TEMP_TIMER 7 + #define TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used. #endif #endif +#ifndef SWSERIAL_TIMER_IRQ_PRIO + #define SWSERIAL_TIMER_IRQ_PRIO 1 +#endif + #ifndef STEP_TIMER_IRQ_PRIO - #define STEP_TIMER_IRQ_PRIO 1 + #define STEP_TIMER_IRQ_PRIO 2 #endif #ifndef TEMP_TIMER_IRQ_PRIO - #define TEMP_TIMER_IRQ_PRIO 2 + #define TEMP_TIMER_IRQ_PRIO 14 //14 = after hardware ISRs #endif #define STEP_TIMER_NUM 0 // index of timer to use for stepper #define TEMP_TIMER_NUM 1 // index of timer to use for temperature #define PULSE_TIMER_NUM STEP_TIMER_NUM -#define TEMP_TIMER_RATE 72000 // 72 Khz -#define TEMP_TIMER_PRESCALE ((HAL_TIMER_RATE)/(TEMP_TIMER_RATE)) -#define TEMP_TIMER_FREQUENCY 1000 +#define TEMP_TIMER_FREQUENCY 1000 //Temperature::isr() is expected to be called at around 1kHz +//TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp #define STEPPER_TIMER_RATE 2000000 // 2 Mhz #define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE)) #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs @@ -99,17 +99,6 @@ #define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE #define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US -#define __TIMER_DEV(X) TIM##X -#define _TIMER_DEV(X) __TIMER_DEV(X) -#define STEP_TIMER_DEV _TIMER_DEV(STEP_TIMER) -#define TEMP_TIMER_DEV _TIMER_DEV(TEMP_TIMER) - -#define __TIMER_CALLBACK(X) TIM##X##_IRQHandler -#define _TIMER_CALLBACK(X) __TIMER_CALLBACK(X) - -#define STEP_TIMER_CALLBACK _TIMER_CALLBACK(STEP_TIMER) -#define TEMP_TIMER_CALLBACK _TIMER_CALLBACK(TEMP_TIMER) - #define __TIMER_IRQ_NAME(X) TIM##X##_IRQn #define _TIMER_IRQ_NAME(X) __TIMER_IRQ_NAME(X) @@ -123,44 +112,46 @@ #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -extern void Step_Handler(stimer_t *htim); -extern void Temp_Handler(stimer_t *htim); -#define HAL_STEP_TIMER_ISR() void Step_Handler(stimer_t *htim) -#define HAL_TEMP_TIMER_ISR() void Temp_Handler(stimer_t *htim) - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -typedef stimer_t stm32f4_timer_t; +extern void Step_Handler(HardwareTimer *htim); +extern void Temp_Handler(HardwareTimer *htim); +#define HAL_STEP_TIMER_ISR() void Step_Handler(HardwareTimer *htim) +#define HAL_TEMP_TIMER_ISR() void Temp_Handler(HardwareTimer *htim) -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ -extern stm32f4_timer_t TimerHandle[]; +extern HardwareTimer *timer_instance[]; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_enable_interrupt(const uint8_t timer_num); void HAL_timer_disable_interrupt(const uint8_t timer_num); bool HAL_timer_interrupt_enabled(const uint8_t timer_num); -FORCE_INLINE static uint32_t HAL_timer_get_count(const uint8_t timer_num) { - return __HAL_TIM_GET_COUNTER(&TimerHandle[timer_num].handle); -} +//TIM_TypeDef* HAL_timer_device(const uint8_t timer_num); no need to be public for now. not public = not used externally -FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) { - __HAL_TIM_SET_AUTORELOAD(&TimerHandle[timer_num].handle, compare); - if (HAL_timer_get_count(timer_num) >= compare) - TimerHandle[timer_num].handle.Instance->EGR |= TIM_EGR_UG; // Generate an immediate update interrupt +// FORCE_INLINE because these are used in performance-critical situations +FORCE_INLINE bool HAL_timer_initialized(const uint8_t timer_num) { + return timer_instance[timer_num] != NULL; +} +FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) { + return HAL_timer_initialized(timer_num) ? timer_instance[timer_num]->getCount() : 0; } -FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { - return __HAL_TIM_GET_AUTORELOAD(&TimerHandle[timer_num].handle); +// NOTE: Method name may be misleading. +// STM32 has an Auto-Reload Register (ARR) as opposed to a "compare" register +FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t overflow) { + if (HAL_timer_initialized(timer_num)) { + timer_instance[timer_num]->setOverflow(overflow + 1, TICK_FORMAT); // Value decremented by setOverflow() + // wiki: "force all registers (Autoreload, prescaler, compare) to be taken into account" + // So, if the new overflow value is less than the count it will trigger a rollover interrupt. + if (overflow < timer_instance[timer_num]->getCount()) // Added 'if' here because reports say it won't boot without it + timer_instance[timer_num]->refresh(); + } } #define HAL_timer_isr_prologue(TIMER_NUM) diff --git a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp b/Marlin/src/HAL/HAL_STM32/watchdog.cpp similarity index 86% rename from Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/watchdog.cpp index 6f8b070e7b32..4defadaa77d3 100644 --- a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/watchdog.cpp @@ -22,18 +22,20 @@ #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) -#include "../../inc/MarlinConfig.h" +#include "../../inc/MarlinConfigPre.h" #if ENABLED(USE_WATCHDOG) - #include "watchdog_STM32.h" + #include "../../inc/MarlinConfig.h" + + #include "watchdog.h" #include void watchdog_init() { IWatchdog.begin(4000000); } // 4 sec timeout - void watchdog_reset() { + void HAL_watchdog_refresh() { IWatchdog.reload(); - #if PIN_EXISTS(LED) + #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) TOGGLE(LED_PIN); // heartbeat indicator #endif } diff --git a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.h b/Marlin/src/HAL/HAL_STM32/watchdog.h similarity index 96% rename from Marlin/src/HAL/HAL_STM32/watchdog_STM32.h rename to Marlin/src/HAL/HAL_STM32/watchdog.h index f062d8a2e6f8..6855016737d1 100644 --- a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.h +++ b/Marlin/src/HAL/HAL_STM32/watchdog.h @@ -22,4 +22,4 @@ #pragma once void watchdog_init(); -void watchdog_reset(); +void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp index 2bbbd8b48b50..9dcb77ae4f14 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp @@ -27,22 +27,14 @@ #ifdef __STM32F1__ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "HAL.h" #include "../../inc/MarlinConfig.h" +#include "HAL.h" #include -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ #define __I #define __IO volatile @@ -70,13 +62,10 @@ __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ } SCB_Type; -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Local defines -// -------------------------------------------------------------------------- +// ------------------------ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ @@ -89,21 +78,22 @@ #define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- -#ifdef SERIAL_USB +// ------------------------ + +#if (defined(SERIAL_USB) && !defined(USE_USB_COMPOSITE)) USBSerial SerialUSB; #endif uint16_t HAL_adc_result; -// -------------------------------------------------------------------------- +// ------------------------ // Private Variables -// -------------------------------------------------------------------------- +// ------------------------ STM32ADC adc(ADC1); -uint8_t adc_pins[] = { +const uint8_t adc_pins[] = { #if HAS_TEMP_ADC_0 TEMP_0_PIN, #endif @@ -131,6 +121,18 @@ uint8_t adc_pins[] = { #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH_PIN, #endif + #if ENABLED(ADC_KEYPAD) + ADC_KEYPAD_PIN, + #endif + #if HAS_JOY_ADC_X + JOY_X_PIN, + #endif + #if HAS_JOY_ADC_Y + JOY_Y_PIN, + #endif + #if HAS_JOY_ADC_Z + JOY_Z_PIN, + #endif }; enum TEMP_PINS : char { @@ -161,18 +163,26 @@ enum TEMP_PINS : char { #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH, #endif + #if ENABLED(ADC_KEYPAD) + ADC_KEY, + #endif + #if HAS_JOY_ADC_X + JOY_X, + #endif + #if HAS_JOY_ADC_Y + JOY_Y, + #endif + #if HAS_JOY_ADC_Z + JOY_Z, + #endif ADC_PIN_COUNT }; uint16_t HAL_adc_results[ADC_PIN_COUNT]; -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Private functions -// -------------------------------------------------------------------------- +// ------------------------ static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { uint32_t reg_value; uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */ @@ -185,9 +195,9 @@ static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { SCB->AIRCR = reg_value; } -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ // // Leave PA11/PA12 intact if USBSerial is not used @@ -197,37 +207,63 @@ static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { #if SERIAL_PORT > 0 #if SERIAL_PORT2 #if SERIAL_PORT2 > 0 - void board_setup_usb(void) {} + void board_setup_usb() {} #endif #else - void board_setup_usb(void) {} + void board_setup_usb() {} #endif #endif } } #endif -void HAL_init(void) { +void HAL_init() { NVIC_SetPriorityGrouping(0x3); #if PIN_EXISTS(LED) OUT_WRITE(LED_PIN, LOW); #endif + #ifdef USE_USB_COMPOSITE + MSC_SD_init(); + #endif + #if PIN_EXISTS(USB_CONNECT) + OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection + delay(1000); // Give OS time to notice + OUT_WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING); + #endif +} + +// HAL idle task +void HAL_idletask() { + #ifdef USE_USB_COMPOSITE + #if ENABLED(SHARED_SD_CARD) + // If Marlin is using the SD card we need to lock it to prevent access from + // a PC via USB. + // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but + // this will not reliably detect delete operations. To be safe we will lock + // the disk if Marlin has it mounted. Unfortunately there is currently no way + // to unmount the disk from the LCD menu. + // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) + /* copy from lpc1768 framework, should be fixed later for process SHARED_SD_CARD*/ + #endif + // process USB mass storage device class loop + MarlinMSC.loop(); + #endif } /* VGPV Done with defines // disable interrupts -void cli(void) { noInterrupts(); } +void cli() { noInterrupts(); } // enable interrupts -void sei(void) { interrupts(); } +void sei() { interrupts(); } */ -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } /** * TODO: Check this and change or remove. * currently returns 1 that's equal to poweron reset. */ -uint8_t HAL_get_reset_source(void) { return 1; } +uint8_t HAL_get_reset_source() { return 1; } void _delay_ms(const int delay_ms) { delay(delay_ms); } @@ -242,7 +278,7 @@ extern "C" { // return free memory between end of heap (or end bss) and whatever is current /* -#include "wirish/syscalls.c" +#include //extern caddr_t _sbrk(int incr); #ifndef CONFIG_HEAP_END extern char _lm_heap_end; @@ -263,15 +299,19 @@ extern "C" { } */ -// -------------------------------------------------------------------------- +// ------------------------ // ADC -// -------------------------------------------------------------------------- +// ------------------------ // Init the AD in continuous capture mode -void HAL_adc_init(void) { +void HAL_adc_init() { // configure the ADC adc.calibrate(); - adc.setSampleRate(ADC_SMPR_41_5); // ? - adc.setPins(adc_pins, ADC_PIN_COUNT); + #if F_CPU > 72000000 + adc.setSampleRate(ADC_SMPR_71_5); // 71.5 ADC cycles + #else + adc.setSampleRate(ADC_SMPR_41_5); // 41.5 ADC cycles + #endif + adc.setPins((uint8_t *)adc_pins, ADC_PIN_COUNT); adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr); adc.setScanMode(); adc.setContinuous(); @@ -306,14 +346,26 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { #if HAS_TEMP_ADC_5 case TEMP_5_PIN: pin_index = TEMP_5; break; #endif + #if HAS_JOY_ADC_X + case JOY_X_PIN: pin_index = JOY_X; break; + #endif + #if HAS_JOY_ADC_Y + case JOY_Y_PIN: pin_index = JOY_Y; break; + #endif + #if HAS_JOY_ADC_Z + case JOY_Z_PIN: pin_index = JOY_Z; break; + #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) case FILWIDTH_PIN: pin_index = FILWIDTH; break; #endif + #if ENABLED(ADC_KEYPAD) + case ADC_KEYPAD_PIN: pin_index = ADC_KEY; break; + #endif } HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only. } -uint16_t HAL_adc_get_result(void) { return HAL_adc_result; } +uint16_t HAL_adc_get_result() { return HAL_adc_result; } uint16_t analogRead(pin_t pin) { const bool is_analog = _GET_MODE(pin) == GPIO_INPUT_ANALOG; @@ -322,8 +374,10 @@ uint16_t analogRead(pin_t pin) { // Wrapper to maple unprotected analogWrite void analogWrite(pin_t pin, int pwm_val8) { - if (PWM_PIN(pin) && IS_OUTPUT(pin)) + if (PWM_PIN(pin)) analogWrite(uint8_t(pin), pwm_val8); } +void flashFirmware(int16_t value) { nvic_sys_reset(); } + #endif // __STM32F1__ diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.h b/Marlin/src/HAL/HAL_STM32F1/HAL.h index 3f33e3ec1ab1..a88b72107e55 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.h @@ -28,43 +28,49 @@ #define CPU_32_BIT -#ifndef vsnprintf_P - #define vsnprintf_P vsnprintf -#endif - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../../core/macros.h" #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_STM32F1.h" -#include "watchdog_STM32F1.h" +#include "fastio.h" +#include "watchdog.h" -#include "HAL_timers_STM32F1.h" +#include "timers.h" #include #include #include "../../inc/MarlinConfigPre.h" -// -------------------------------------------------------------------------- +#ifdef USE_USB_COMPOSITE + #include "msc_sd.h" +#endif + +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ + +#ifndef STM32_FLASH_SIZE + #ifdef MCU_STM32F103RE + #define STM32_FLASH_SIZE 512 + #else + #define STM32_FLASH_SIZE 256 + #endif +#endif #ifdef SERIAL_USB - #define UsbSerial Serial + #ifndef USE_USB_COMPOSITE + #define UsbSerial Serial + #else + #define UsbSerial MarlinCompositeSerial + #endif #define MSerial1 Serial1 #define MSerial2 Serial2 #define MSerial3 Serial3 #define MSerial4 Serial4 #define MSerial5 Serial5 #else - extern USBSerial SerialUSB; - #define UsbSerial SerialUSB #define MSerial1 Serial #define MSerial2 Serial1 #define MSerial3 Serial2 @@ -118,7 +124,9 @@ #endif // Set interrupt grouping for this MCU -void HAL_init(void); +void HAL_init(); +#define HAL_IDLETASK 1 +void HAL_idletask(); /** * TODO: review this to return 1 for pins that are not analog input @@ -156,22 +164,22 @@ void HAL_init(void); #define RST_SOFTWARE 32 #define RST_BACKUP 64 -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ typedef int8_t pin_t; -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ -/** result of last ADC conversion */ +// Result of last ADC conversion extern uint16_t HAL_adc_result; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ // Disable interrupts #define cli() noInterrupts() @@ -182,21 +190,25 @@ extern uint16_t HAL_adc_result; // Memory related #define __bss_end __bss_end__ -/** clear reset reason */ -void HAL_clear_reset_source(void); +// Clear reset reason +void HAL_clear_reset_source(); -/** reset reason */ -uint8_t HAL_get_reset_source(void); +// Reset reason +uint8_t HAL_get_reset_source(); void _delay_ms(const int delay); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" + /* extern "C" { - int freeMemory(void); + int freeMemory(); } */ extern "C" char* _sbrk(int incr); + /* static int freeMemory() { volatile int top; @@ -205,9 +217,6 @@ static int freeMemory() { } */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" - static int freeMemory() { volatile char top; return &top - reinterpret_cast(_sbrk(0)); @@ -215,17 +224,6 @@ static int freeMemory() { #pragma GCC diagnostic pop -// -// SPI: Extended functions which take a channel number (hardware SPI only) -// - -/** Write single byte to specified SPI channel */ -void spiSend(uint32_t chan, byte b); -/** Write buffer to specified SPI channel */ -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -/** Read single byte from specified SPI channel */ -uint8_t spiRec(uint32_t chan); - // // EEPROM // @@ -245,14 +243,15 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n); #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG); -void HAL_adc_init(void); +void HAL_adc_init(); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); uint16_t analogRead(pin_t pin); // need HAL_ANALOG_SELECT() first void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!? @@ -263,3 +262,6 @@ void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!? #define JTAG_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY) #define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE) + +#define PLATFORM_M997_SUPPORT +void flashFirmware(int16_t value); diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_spi_STM32F1.cpp b/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp similarity index 76% rename from Marlin/src/HAL/HAL_STM32F1/HAL_spi_STM32F1.cpp rename to Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp index a43a1b41945a..9f3f34239d4a 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_spi_STM32F1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp @@ -32,34 +32,25 @@ #ifdef __STM32F1__ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../../inc/MarlinConfig.h" #include - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ #if ENABLED(SOFTWARE_SPI) - // -------------------------------------------------------------------------- + // ------------------------ // Software SPI - // -------------------------------------------------------------------------- + // ------------------------ #error "Software SPI not supported for STM32F1. Use hardware SPI." #else -// -------------------------------------------------------------------------- +// ------------------------ // Hardware SPI -// -------------------------------------------------------------------------- +// ------------------------ /** * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz @@ -73,10 +64,9 @@ * @details Only configures SS pin since libmaple creates and initialize the SPI object */ void spiBegin() { - #if !PIN_EXISTS(SS) - #error "SS_PIN not defined!" + #if PIN_EXISTS(SS) + OUT_WRITE(SS_PIN, HIGH); #endif - OUT_WRITE(SS_PIN, HIGH); } /** @@ -88,15 +78,25 @@ void spiBegin() { * @details */ void spiInit(uint8_t spiRate) { + /** + * STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz + * STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1 + * so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2 + */ + #if SPI_DEVICE == 1 + #define SPI_CLOCK_MAX SPI_CLOCK_DIV4 + #else + #define SPI_CLOCK_MAX SPI_CLOCK_DIV2 + #endif uint8_t clock; switch (spiRate) { - case SPI_FULL_SPEED: clock = SPI_CLOCK_DIV2 ; break; + case SPI_FULL_SPEED: clock = SPI_CLOCK_MAX ; break; case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break; case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break; case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; - default: clock = SPI_CLOCK_DIV2; // Default from the SPI library + default: clock = SPI_CLOCK_DIV2; // Default from the SPI library } SPI.setModule(SPI_DEVICE); SPI.begin(); @@ -112,8 +112,8 @@ void spiInit(uint8_t spiRate) { * * @details */ -uint8_t spiRec(void) { - uint8_t returnByte = SPI.transfer(0xFF); +uint8_t spiRec() { + uint8_t returnByte = SPI.transfer(ff); return returnByte; } diff --git a/Marlin/src/HAL/HAL_STM32F1/SPI.cpp b/Marlin/src/HAL/HAL_STM32F1/SPI.cpp new file mode 100644 index 000000000000..8eb8f9aa88c9 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/SPI.cpp @@ -0,0 +1,715 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2010 Perry Hung. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + *****************************************************************************/ + +/** + * @author Marti Bolivar + * @brief Wirish SPI implementation. + */ + +#ifdef __STM32F1__ + +#include + +#include +#include +#include + +#include +#include + +/** Time in ms for DMA receive timeout */ +#define DMA_TIMEOUT 100 + +#if CYCLES_PER_MICROSECOND != 72 + #warning "Unexpected clock speed; SPI frequency calculation will be incorrect" +#endif + +struct spi_pins { uint8_t nss, sck, miso, mosi; }; + +static const spi_pins* dev_to_spi_pins(spi_dev *dev); +static void configure_gpios(spi_dev *dev, bool as_master); +static spi_baud_rate determine_baud_rate(spi_dev *dev, uint32_t freq); + +#if BOARD_NR_SPI >= 3 && !defined(STM32_HIGH_DENSITY) + #error "The SPI library is misconfigured: 3 SPI ports only available on high density STM32 devices" +#endif + +static const spi_pins board_spi_pins[] __FLASH__ = { + #if BOARD_NR_SPI >= 1 + { BOARD_SPI1_NSS_PIN, + BOARD_SPI1_SCK_PIN, + BOARD_SPI1_MISO_PIN, + BOARD_SPI1_MOSI_PIN }, + #endif + #if BOARD_NR_SPI >= 2 + { BOARD_SPI2_NSS_PIN, + BOARD_SPI2_SCK_PIN, + BOARD_SPI2_MISO_PIN, + BOARD_SPI2_MOSI_PIN }, + #endif + #if BOARD_NR_SPI >= 3 + { BOARD_SPI3_NSS_PIN, + BOARD_SPI3_SCK_PIN, + BOARD_SPI3_MISO_PIN, + BOARD_SPI3_MOSI_PIN }, + #endif +}; + +#if BOARD_NR_SPI >= 1 + static void *_spi1_this; +#endif +#if BOARD_NR_SPI >= 2 + static void *_spi2_this; +#endif +#if BOARD_NR_SPI >= 3 + static void *_spi3_this; +#endif + +/** + * Constructor + */ +SPIClass::SPIClass(uint32_t spi_num) { + _currentSetting = &_settings[spi_num - 1]; // SPI channels are called 1 2 and 3 but the array is zero indexed + + switch (spi_num) { + #if BOARD_NR_SPI >= 1 + case 1: + _currentSetting->spi_d = SPI1; + _spi1_this = (void*)this; + break; + #endif + #if BOARD_NR_SPI >= 2 + case 2: + _currentSetting->spi_d = SPI2; + _spi2_this = (void*)this; + break; + #endif + #if BOARD_NR_SPI >= 3 + case 3: + _currentSetting->spi_d = SPI3; + _spi3_this = (void*)this; + break; + #endif + default: ASSERT(0); + } + + // Init things specific to each SPI device + // clock divider setup is a bit of hack, and needs to be improved at a later date. + #if BOARD_NR_SPI >= 1 + _settings[0].spi_d = SPI1; + _settings[0].clockDivider = determine_baud_rate(_settings[0].spi_d, _settings[0].clock); + _settings[0].spiDmaDev = DMA1; + _settings[0].spiTxDmaChannel = DMA_CH3; + _settings[0].spiRxDmaChannel = DMA_CH2; + #endif + #if BOARD_NR_SPI >= 2 + _settings[1].spi_d = SPI2; + _settings[1].clockDivider = determine_baud_rate(_settings[1].spi_d, _settings[1].clock); + _settings[1].spiDmaDev = DMA1; + _settings[1].spiTxDmaChannel = DMA_CH5; + _settings[1].spiRxDmaChannel = DMA_CH4; + #endif + #if BOARD_NR_SPI >= 3 + _settings[2].spi_d = SPI3; + _settings[2].clockDivider = determine_baud_rate(_settings[2].spi_d, _settings[2].clock); + _settings[2].spiDmaDev = DMA2; + _settings[2].spiTxDmaChannel = DMA_CH2; + _settings[2].spiRxDmaChannel = DMA_CH1; + #endif + + // added for DMA callbacks. + _currentSetting->state = SPI_STATE_IDLE; +} + +/** + * Set up/tear down + */ +void SPIClass::updateSettings() { + uint32_t flags = ((_currentSetting->bitOrder == MSBFIRST ? SPI_FRAME_MSB : SPI_FRAME_LSB) | _currentSetting->dataSize | SPI_SW_SLAVE | SPI_SOFT_SS); + spi_master_enable(_currentSetting->spi_d, (spi_baud_rate)_currentSetting->clockDivider, (spi_mode)_currentSetting->dataMode, flags); +} + +void SPIClass::begin() { + spi_init(_currentSetting->spi_d); + configure_gpios(_currentSetting->spi_d, 1); + updateSettings(); + // added for DMA callbacks. + _currentSetting->state = SPI_STATE_READY; +} + +void SPIClass::beginSlave() { + spi_init(_currentSetting->spi_d); + configure_gpios(_currentSetting->spi_d, 0); + uint32_t flags = ((_currentSetting->bitOrder == MSBFIRST ? SPI_FRAME_MSB : SPI_FRAME_LSB) | _currentSetting->dataSize); + spi_slave_enable(_currentSetting->spi_d, (spi_mode)_currentSetting->dataMode, flags); + // added for DMA callbacks. + _currentSetting->state = SPI_STATE_READY; +} + +void SPIClass::end() { + if (!spi_is_enabled(_currentSetting->spi_d)) return; + + // Follows RM0008's sequence for disabling a SPI in master/slave + // full duplex mode. + while (spi_is_rx_nonempty(_currentSetting->spi_d)) { + // FIXME [0.1.0] remove this once you have an interrupt based driver + volatile uint16_t rx __attribute__((unused)) = spi_rx_reg(_currentSetting->spi_d); + } + waitSpiTxEnd(_currentSetting->spi_d); + + spi_peripheral_disable(_currentSetting->spi_d); + // added for DMA callbacks. + // Need to add unsetting the callbacks for the DMA channels. + _currentSetting->state = SPI_STATE_IDLE; +} + +/* Roger Clark added 3 functions */ +void SPIClass::setClockDivider(uint32_t clockDivider) { + _currentSetting->clockDivider = clockDivider; + uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_BR); + _currentSetting->spi_d->regs->CR1 = cr1 | (clockDivider & SPI_CR1_BR); +} + +void SPIClass::setBitOrder(BitOrder bitOrder) { + _currentSetting->bitOrder = bitOrder; + uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_LSBFIRST); + if (bitOrder == LSBFIRST) cr1 |= SPI_CR1_LSBFIRST; + _currentSetting->spi_d->regs->CR1 = cr1; +} + +/** + * Victor Perez. Added to test changing datasize from 8 to 16 bit modes on the fly. + * Input parameter should be SPI_CR1_DFF set to 0 or 1 on a 32bit word. + */ +void SPIClass::setDataSize(uint32_t datasize) { + _currentSetting->dataSize = datasize; + uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_DFF); + uint8_t en = spi_is_enabled(_currentSetting->spi_d); + spi_peripheral_disable(_currentSetting->spi_d); + _currentSetting->spi_d->regs->CR1 = cr1 | (datasize & SPI_CR1_DFF) | en; +} + +void SPIClass::setDataMode(uint8_t dataMode) { + /** + * Notes: + * As far as we know the AVR numbers for dataMode match the numbers required by the STM32. + * From the AVR doc http://www.atmel.com/images/doc2585.pdf section 2.4 + * + * SPI Mode CPOL CPHA Shift SCK-edge Capture SCK-edge + * 0 0 0 Falling Rising + * 1 0 1 Rising Falling + * 2 1 0 Rising Falling + * 3 1 1 Falling Rising + * + * On the STM32 it appears to be + * + * bit 1 - CPOL : Clock polarity + * (This bit should not be changed when communication is ongoing) + * 0 : CLK to 0 when idle + * 1 : CLK to 1 when idle + * + * bit 0 - CPHA : Clock phase + * (This bit should not be changed when communication is ongoing) + * 0 : The first clock transition is the first data capture edge + * 1 : The second clock transition is the first data capture edge + * + * If someone finds this is not the case or sees a logic error with this let me know ;-) + */ + _currentSetting->dataMode = dataMode; + uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_CPOL|SPI_CR1_CPHA); + _currentSetting->spi_d->regs->CR1 = cr1 | (dataMode & (SPI_CR1_CPOL|SPI_CR1_CPHA)); +} + +void SPIClass::beginTransaction(uint8_t pin, SPISettings settings) { + setBitOrder(settings.bitOrder); + setDataMode(settings.dataMode); + setDataSize(settings.dataSize); + setClockDivider(determine_baud_rate(_currentSetting->spi_d, settings.clock)); + begin(); +} + +void SPIClass::beginTransactionSlave(SPISettings settings) { + setBitOrder(settings.bitOrder); + setDataMode(settings.dataMode); + setDataSize(settings.dataSize); + beginSlave(); +} + +void SPIClass::endTransaction() { } + +/** + * I/O + */ + +uint16_t SPIClass::read() { + while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ } + return (uint16)spi_rx_reg(_currentSetting->spi_d); +} + +void SPIClass::read(uint8_t *buf, uint32_t len) { + if (len == 0) return; + spi_rx_reg(_currentSetting->spi_d); // clear the RX buffer in case a byte is waiting on it. + spi_reg_map * regs = _currentSetting->spi_d->regs; + // start sequence: write byte 0 + regs->DR = 0x00FF; // write the first byte + // main loop + while (--len) { + while(!(regs->SR & SPI_SR_TXE)) { /* nada */ } // wait for TXE flag + noInterrupts(); // go atomic level - avoid interrupts to surely get the previously received data + regs->DR = 0x00FF; // write the next data item to be transmitted into the SPI_DR register. This clears the TXE flag. + while (!(regs->SR & SPI_SR_RXNE)) { /* nada */ } // wait till data is available in the DR register + *buf++ = (uint8)(regs->DR); // read and store the received byte. This clears the RXNE flag. + interrupts(); // let systick do its job + } + // read remaining last byte + while (!(regs->SR & SPI_SR_RXNE)) { /* nada */ } // wait till data is available in the Rx register + *buf++ = (uint8)(regs->DR); // read and store the received byte +} + +void SPIClass::write(uint16_t data) { + /* Added for 16bit data Victor Perez. Roger Clark + * Improved speed by just directly writing the single byte to the SPI data reg and wait for completion, + * by taking the Tx code from transfer(byte) + * This almost doubles the speed of this function. + */ + spi_tx_reg(_currentSetting->spi_d, data); // write the data to be transmitted into the SPI_DR register (this clears the TXE flag) + waitSpiTxEnd(_currentSetting->spi_d); +} + +void SPIClass::write16(uint16_t data) { + // Added by stevestrong: write two consecutive bytes in 8 bit mode (DFF=0) + spi_tx_reg(_currentSetting->spi_d, data>>8); // write high byte + while (!spi_is_tx_empty(_currentSetting->spi_d)) { /* nada */ } // Wait until TXE=1 + spi_tx_reg(_currentSetting->spi_d, data); // write low byte + waitSpiTxEnd(_currentSetting->spi_d); +} + +void SPIClass::write(uint16_t data, uint32_t n) { + // Added by stevstrong: Repeatedly send same data by the specified number of times + spi_reg_map * regs = _currentSetting->spi_d->regs; + while (n--) { + regs->DR = data; // write the data to be transmitted into the SPI_DR register (this clears the TXE flag) + while (!(regs->SR & SPI_SR_TXE)) { /* nada */ } // wait till Tx empty + } + while (regs->SR & SPI_SR_BSY) { /* nada */ } // wait until BSY=0 before returning +} + +void SPIClass::write(const void *data, uint32_t length) { + spi_dev * spi_d = _currentSetting->spi_d; + spi_tx(spi_d, data, length); // data can be array of bytes or words + waitSpiTxEnd(spi_d); +} + +uint8_t SPIClass::transfer(uint8_t byte) const { + spi_dev * spi_d = _currentSetting->spi_d; + spi_rx_reg(spi_d); // read any previous data + spi_tx_reg(spi_d, byte); // Write the data item to be transmitted into the SPI_DR register + waitSpiTxEnd(spi_d); + return (uint8)spi_rx_reg(spi_d); // "... and read the last received data." +} + +uint16_t SPIClass::transfer16(uint16_t data) const { + // Modified by stevestrong: write & read two consecutive bytes in 8 bit mode (DFF=0) + // This is more effective than two distinct byte transfers + spi_dev * spi_d = _currentSetting->spi_d; + spi_rx_reg(spi_d); // read any previous data + spi_tx_reg(spi_d, data>>8); // write high byte + waitSpiTxEnd(spi_d); // wait until TXE=1 and then wait until BSY=0 + uint16_t ret = spi_rx_reg(spi_d)<<8; // read and shift high byte + spi_tx_reg(spi_d, data); // write low byte + waitSpiTxEnd(spi_d); // wait until TXE=1 and then wait until BSY=0 + ret += spi_rx_reg(spi_d); // read low byte + return ret; +} + +/** + * Roger Clark and Victor Perez, 2015 + * Performs a DMA SPI transfer with at least a receive buffer. + * If a TX buffer is not provided, FF is sent over and over for the lenght of the transfer. + * On exit TX buffer is not modified, and RX buffer cotains the received data. + * Still in progress. + */ +void SPIClass::dmaTransferSet(const void *transmitBuf, void *receiveBuf) { + dma_init(_currentSetting->spiDmaDev); + //spi_rx_dma_enable(_currentSetting->spi_d); + //spi_tx_dma_enable(_currentSetting->spi_d); + dma_xfer_size dma_bit_size = (_currentSetting->dataSize==DATA_SIZE_16BIT) ? DMA_SIZE_16BITS : DMA_SIZE_8BITS; + dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, &_currentSetting->spi_d->regs->DR, + dma_bit_size, receiveBuf, dma_bit_size, (DMA_MINC_MODE | DMA_TRNS_CMPLT ));// receive buffer DMA + if (!transmitBuf) { + transmitBuf = &ff; + dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &_currentSetting->spi_d->regs->DR, + dma_bit_size, (volatile void*)transmitBuf, dma_bit_size, (DMA_FROM_MEM));// Transmit FF repeatedly + } + else { + dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &_currentSetting->spi_d->regs->DR, + dma_bit_size, (volatile void*)transmitBuf, dma_bit_size, (DMA_MINC_MODE | DMA_FROM_MEM ));// Transmit buffer DMA + } + dma_set_priority(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, DMA_PRIORITY_LOW); + dma_set_priority(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, DMA_PRIORITY_VERY_HIGH); +} + +uint8_t SPIClass::dmaTransferRepeat(uint16_t length) { + if (length == 0) return 0; + if (spi_is_rx_nonempty(_currentSetting->spi_d) == 1) spi_rx_reg(_currentSetting->spi_d); + _currentSetting->state = SPI_STATE_TRANSFER; + dma_set_num_transfers(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, length); + dma_set_num_transfers(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, length); + dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel);// enable receive + dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel);// enable transmit + spi_rx_dma_enable(_currentSetting->spi_d); + spi_tx_dma_enable(_currentSetting->spi_d); + if (_currentSetting->receiveCallback) + return 0; + + //uint32_t m = millis(); + uint8_t b = 0; + uint32_t m = millis(); + while (!(dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1)) { + // Avoid interrupts and just loop waiting for the flag to be set. + if ((millis() - m) > DMA_TIMEOUT) { b = 2; break; } + } + + waitSpiTxEnd(_currentSetting->spi_d); // until TXE=1 and BSY=0 + spi_tx_dma_disable(_currentSetting->spi_d); + spi_rx_dma_disable(_currentSetting->spi_d); + dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel); + dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel); + dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + _currentSetting->state = SPI_STATE_READY; + return b; +} + +/** + * Roger Clark and Victor Perez, 2015 + * Performs a DMA SPI transfer with at least a receive buffer. + * If a TX buffer is not provided, FF is sent over and over for the length of the transfer. + * On exit TX buffer is not modified, and RX buffer contains the received data. + * Still in progress. + */ +uint8_t SPIClass::dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_t length) { + dmaTransferSet(transmitBuf, receiveBuf); + return dmaTransferRepeat(length); +} + +/** + * Roger Clark and Victor Perez, 2015 + * Performs a DMA SPI send using a TX buffer. + * On exit TX buffer is not modified. + * Still in progress. + * 2016 - stevstrong - reworked to automatically detect bit size from SPI setting + */ +void SPIClass::dmaSendSet(const void * transmitBuf, bool minc) { + uint32_t flags = ( (DMA_MINC_MODE*minc) | DMA_FROM_MEM | DMA_TRNS_CMPLT); + dma_init(_currentSetting->spiDmaDev); + dma_xfer_size dma_bit_size = (_currentSetting->dataSize==DATA_SIZE_16BIT) ? DMA_SIZE_16BITS : DMA_SIZE_8BITS; + dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &_currentSetting->spi_d->regs->DR, dma_bit_size, + (volatile void*)transmitBuf, dma_bit_size, flags);// Transmit buffer DMA + dma_set_priority(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, DMA_PRIORITY_LOW); +} + +uint8_t SPIClass::dmaSendRepeat(uint16_t length) { + if (length == 0) return 0; + + dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + dma_set_num_transfers(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, length); + _currentSetting->state = SPI_STATE_TRANSMIT; + dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); // enable transmit + spi_tx_dma_enable(_currentSetting->spi_d); + if (_currentSetting->transmitCallback) return 0; + + uint32_t m = millis(); + uint8_t b = 0; + while (!(dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1)) { + // Avoid interrupts and just loop waiting for the flag to be set. + if ((millis() - m) > DMA_TIMEOUT) { b = 2; break; } + } + waitSpiTxEnd(_currentSetting->spi_d); // until TXE=1 and BSY=0 + spi_tx_dma_disable(_currentSetting->spi_d); + dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + _currentSetting->state = SPI_STATE_READY; + return b; +} + +uint8_t SPIClass::dmaSend(const void * transmitBuf, uint16_t length, bool minc) { + dmaSendSet(transmitBuf, minc); + return dmaSendRepeat(length); +} + +uint8_t SPIClass::dmaSendAsync(const void * transmitBuf, uint16_t length, bool minc) { + uint8_t b = 0; + + if (_currentSetting->state != SPI_STATE_READY) { + uint32_t m = millis(); + while (!(dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1)) { + //Avoid interrupts and just loop waiting for the flag to be set. + //delayMicroseconds(10); + if ((millis() - m) > DMA_TIMEOUT) { b = 2; break; } + } + waitSpiTxEnd(_currentSetting->spi_d); // until TXE=1 and BSY=0 + spi_tx_dma_disable(_currentSetting->spi_d); + dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + _currentSetting->state = SPI_STATE_READY; + } + + if (length == 0) return 0; + uint32_t flags = ( (DMA_MINC_MODE*minc) | DMA_FROM_MEM | DMA_TRNS_CMPLT); + + dma_init(_currentSetting->spiDmaDev); + // TX + dma_xfer_size dma_bit_size = (_currentSetting->dataSize==DATA_SIZE_16BIT) ? DMA_SIZE_16BITS : DMA_SIZE_8BITS; + dma_setup_transfer(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &_currentSetting->spi_d->regs->DR, + dma_bit_size, (volatile void*)transmitBuf, dma_bit_size, flags);// Transmit buffer DMA + dma_set_num_transfers(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, length); + dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel);// enable transmit + spi_tx_dma_enable(_currentSetting->spi_d); + + _currentSetting->state = SPI_STATE_TRANSMIT; + return b; +} + + +/** + * New functions added to manage callbacks. + * Victor Perez 2017 + */ +void SPIClass::onReceive(void(*callback)()) { + _currentSetting->receiveCallback = callback; + if (callback) { + switch (_currentSetting->spi_d->clk_id) { + #if BOARD_NR_SPI >= 1 + case RCC_SPI1: + dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, &SPIClass::_spi1EventCallback); + break; + #endif + #if BOARD_NR_SPI >= 2 + case RCC_SPI2: + dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, &SPIClass::_spi2EventCallback); + break; + #endif + #if BOARD_NR_SPI >= 3 + case RCC_SPI3: + dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel, &SPIClass::_spi3EventCallback); + break; + #endif + default: + ASSERT(0); + } + } + else { + dma_detach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel); + } +} + +void SPIClass::onTransmit(void(*callback)()) { + _currentSetting->transmitCallback = callback; + if (callback) { + switch (_currentSetting->spi_d->clk_id) { + #if BOARD_NR_SPI >= 1 + case RCC_SPI1: + dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &SPIClass::_spi1EventCallback); + break; + #endif + #if BOARD_NR_SPI >= 2 + case RCC_SPI2: + dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &SPIClass::_spi2EventCallback); + break; + #endif + #if BOARD_NR_SPI >= 3 + case RCC_SPI3: + dma_attach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, &SPIClass::_spi3EventCallback); + break; + #endif + default: + ASSERT(0); + } + } + else { + dma_detach_interrupt(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + } +} + +/** + * TODO: check if better to first call the customer code, next disable the DMA requests. + * Also see if we need to check whether callbacks are set or not, may be better to be checked + * during the initial setup and only set the callback to EventCallback if they are set. + */ +void SPIClass::EventCallback() { + waitSpiTxEnd(_currentSetting->spi_d); + switch (_currentSetting->state) { + case SPI_STATE_TRANSFER: + while (spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ } + _currentSetting->state = SPI_STATE_READY; + spi_tx_dma_disable(_currentSetting->spi_d); + spi_rx_dma_disable(_currentSetting->spi_d); + //dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + //dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiRxDmaChannel); + if (_currentSetting->receiveCallback) + _currentSetting->receiveCallback(); + break; + case SPI_STATE_TRANSMIT: + _currentSetting->state = SPI_STATE_READY; + spi_tx_dma_disable(_currentSetting->spi_d); + //dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); + if (_currentSetting->transmitCallback) + _currentSetting->transmitCallback(); + break; + default: + break; + } +} + +void SPIClass::attachInterrupt() { + // Should be enableInterrupt() +} + +void SPIClass::detachInterrupt() { + // Should be disableInterrupt() +} + +/** + * Pin accessors + */ + +uint8_t SPIClass::misoPin() { + return dev_to_spi_pins(_currentSetting->spi_d)->miso; +} + +uint8_t SPIClass::mosiPin() { + return dev_to_spi_pins(_currentSetting->spi_d)->mosi; +} + +uint8_t SPIClass::sckPin() { + return dev_to_spi_pins(_currentSetting->spi_d)->sck; +} + +uint8_t SPIClass::nssPin() { + return dev_to_spi_pins(_currentSetting->spi_d)->nss; +} + +/** + * Deprecated functions + */ +uint8_t SPIClass::send(uint8_t data) { write(data); return 1; } +uint8_t SPIClass::send(uint8_t *buf, uint32_t len) { write(buf, len); return len; } +uint8_t SPIClass::recv() { return read(); } + +/** + * DMA call back functions, one per port. + */ +#if BOARD_NR_SPI >= 1 + void SPIClass::_spi1EventCallback() { + reinterpret_cast(_spi1_this)->EventCallback(); + } +#endif +#if BOARD_NR_SPI >= 2 + void SPIClass::_spi2EventCallback() { + reinterpret_cast(_spi2_this)->EventCallback(); + } +#endif +#if BOARD_NR_SPI >= 3 + void SPIClass::_spi3EventCallback() { + reinterpret_cast(_spi3_this)->EventCallback(); + } +#endif + +/** + * Auxiliary functions + */ +static const spi_pins* dev_to_spi_pins(spi_dev *dev) { + switch (dev->clk_id) { + #if BOARD_NR_SPI >= 1 + case RCC_SPI1: return board_spi_pins; + #endif + #if BOARD_NR_SPI >= 2 + case RCC_SPI2: return board_spi_pins + 1; + #endif + #if BOARD_NR_SPI >= 3 + case RCC_SPI3: return board_spi_pins + 2; + #endif + default: return NULL; + } +} + +static void disable_pwm(const stm32_pin_info *i) { + if (i->timer_device) + timer_set_mode(i->timer_device, i->timer_channel, TIMER_DISABLED); +} + +static void configure_gpios(spi_dev *dev, bool as_master) { + const spi_pins *pins = dev_to_spi_pins(dev); + if (!pins) return; + + const stm32_pin_info *nssi = &PIN_MAP[pins->nss], + *scki = &PIN_MAP[pins->sck], + *misoi = &PIN_MAP[pins->miso], + *mosii = &PIN_MAP[pins->mosi]; + + disable_pwm(nssi); + disable_pwm(scki); + disable_pwm(misoi); + disable_pwm(mosii); + + spi_config_gpios(dev, as_master, nssi->gpio_device, nssi->gpio_bit, + scki->gpio_device, scki->gpio_bit, misoi->gpio_bit, + mosii->gpio_bit); +} + +static const spi_baud_rate baud_rates[8] __FLASH__ = { + SPI_BAUD_PCLK_DIV_2, + SPI_BAUD_PCLK_DIV_4, + SPI_BAUD_PCLK_DIV_8, + SPI_BAUD_PCLK_DIV_16, + SPI_BAUD_PCLK_DIV_32, + SPI_BAUD_PCLK_DIV_64, + SPI_BAUD_PCLK_DIV_128, + SPI_BAUD_PCLK_DIV_256, +}; + +/** + * Note: This assumes you're on a LeafLabs-style board + * (CYCLES_PER_MICROSECOND == 72, APB2 at 72MHz, APB1 at 36MHz). + */ +static spi_baud_rate determine_baud_rate(spi_dev *dev, uint32_t freq) { + uint32_t clock = 0; + switch (rcc_dev_clk(dev->clk_id)) { + case RCC_AHB: + case RCC_APB2: clock = STM32_PCLK2; break; // 72 Mhz + case RCC_APB1: clock = STM32_PCLK1; break; // 36 Mhz + } + clock >>= 1; + + uint8_t i = 0; + while (i < 7 && freq < clock) { clock >>= 1; i++; } + return baud_rates[i]; +} + +SPIClass SPI(1); + +#endif // __STM32F1__ diff --git a/Marlin/src/HAL/HAL_STM32F1/SPI.h b/Marlin/src/HAL/HAL_STM32F1/SPI.h new file mode 100644 index 000000000000..0162ac13bb17 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/SPI.h @@ -0,0 +1,417 @@ +/****************************************************************************** + * The MIT License + * + * Copyright (c) 2010 Perry Hung. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + *****************************************************************************/ +#pragma once + +#include +#include +#include + +#include +#include +#include + +// SPI_HAS_TRANSACTION means SPI has +// - beginTransaction() +// - endTransaction() +// - usingInterrupt() +// - SPISetting(clock, bitOrder, dataMode) +//#define SPI_HAS_TRANSACTION + +#define SPI_CLOCK_DIV2 SPI_BAUD_PCLK_DIV_2 +#define SPI_CLOCK_DIV4 SPI_BAUD_PCLK_DIV_4 +#define SPI_CLOCK_DIV8 SPI_BAUD_PCLK_DIV_8 +#define SPI_CLOCK_DIV16 SPI_BAUD_PCLK_DIV_16 +#define SPI_CLOCK_DIV32 SPI_BAUD_PCLK_DIV_32 +#define SPI_CLOCK_DIV64 SPI_BAUD_PCLK_DIV_64 +#define SPI_CLOCK_DIV128 SPI_BAUD_PCLK_DIV_128 +#define SPI_CLOCK_DIV256 SPI_BAUD_PCLK_DIV_256 + +/* + * Roger Clark. 20150106 + * Commented out redundant AVR defined + * +#define SPI_MODE_MASK 0x0C // CPOL = bit 3, CPHA = bit 2 on SPCR +#define SPI_CLOCK_MASK 0x03 // SPR1 = bit 1, SPR0 = bit 0 on SPCR +#define SPI_2XCLOCK_MASK 0x01 // SPI2X = bit 0 on SPSR + +// define SPI_AVR_EIMSK for AVR boards with external interrupt pins +#ifdef EIMSK + #define SPI_AVR_EIMSK EIMSK +#elif defined(GICR) + #define SPI_AVR_EIMSK GICR +#elif defined(GIMSK) + #define SPI_AVR_EIMSK GIMSK +#endif +*/ + +#ifndef STM32_LSBFIRST + #define STM32_LSBFIRST 0 +#endif +#ifndef STM32_MSBFIRST + #define STM32_MSBFIRST 1 +#endif + +// PC13 or PA4 +#define BOARD_SPI_DEFAULT_SS PA4 +//#define BOARD_SPI_DEFAULT_SS PC13 + +#define SPI_MODE0 SPI_MODE_0 +#define SPI_MODE1 SPI_MODE_1 +#define SPI_MODE2 SPI_MODE_2 +#define SPI_MODE3 SPI_MODE_3 + +#define DATA_SIZE_8BIT SPI_CR1_DFF_8_BIT +#define DATA_SIZE_16BIT SPI_CR1_DFF_16_BIT + +typedef enum { + SPI_STATE_IDLE, + SPI_STATE_READY, + SPI_STATE_RECEIVE, + SPI_STATE_TRANSMIT, + SPI_STATE_TRANSFER +} spi_mode_t; + +class SPISettings { +public: + SPISettings(uint32_t inClock, BitOrder inBitOrder, uint8_t inDataMode) { + if (__builtin_constant_p(inClock)) + init_AlwaysInline(inClock, inBitOrder, inDataMode, DATA_SIZE_8BIT); + else + init_MightInline(inClock, inBitOrder, inDataMode, DATA_SIZE_8BIT); + } + SPISettings(uint32_t inClock, BitOrder inBitOrder, uint8_t inDataMode, uint32_t inDataSize) { + if (__builtin_constant_p(inClock)) + init_AlwaysInline(inClock, inBitOrder, inDataMode, inDataSize); + else + init_MightInline(inClock, inBitOrder, inDataMode, inDataSize); + } + SPISettings(uint32_t inClock) { + if (__builtin_constant_p(inClock)) + init_AlwaysInline(inClock, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); + else + init_MightInline(inClock, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); + } + SPISettings() { + init_AlwaysInline(4000000, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); + } +private: + void init_MightInline(uint32_t inClock, BitOrder inBitOrder, uint8_t inDataMode, uint32_t inDataSize) { + init_AlwaysInline(inClock, inBitOrder, inDataMode, inDataSize); + } + void init_AlwaysInline(uint32_t inClock, BitOrder inBitOrder, uint8_t inDataMode, uint32_t inDataSize) __attribute__((__always_inline__)) { + clock = inClock; + bitOrder = inBitOrder; + dataMode = inDataMode; + dataSize = inDataSize; + } + uint32_t clock; + uint32_t dataSize; + uint32_t clockDivider; + BitOrder bitOrder; + uint8_t dataMode; + uint8_t _SSPin; + volatile spi_mode_t state; + spi_dev *spi_d; + dma_channel spiRxDmaChannel, spiTxDmaChannel; + dma_dev* spiDmaDev; + void (*receiveCallback)() = NULL; + void (*transmitCallback)() = NULL; + + friend class SPIClass; +}; + +/* + * Kept for compat. + */ +static const uint8_t ff = 0xFF; + +/** + * @brief Wirish SPI interface. + * + * This implementation uses software slave management, so the caller + * is responsible for controlling the slave select line. + */ +class SPIClass { + +public: + /** + * @param spiPortNumber Number of the SPI port to manage. + */ + SPIClass(uint32_t spiPortNumber); + + /** + * @brief Equivalent to begin(SPI_1_125MHZ, MSBFIRST, 0). + */ + void begin(); + + /** + * @brief Turn on a SPI port and set its GPIO pin modes for use as a slave. + * + * SPI port is enabled in full duplex mode, with software slave management. + * + * @param bitOrder Either LSBFIRST (little-endian) or MSBFIRST(big-endian) + * @param mode SPI mode to use + */ + void beginSlave(uint32_t bitOrder, uint32_t mode); + + /** + * @brief Equivalent to beginSlave(MSBFIRST, 0). + */ + void beginSlave(); + + /** + * @brief Disables the SPI port, but leaves its GPIO pin modes unchanged. + */ + void end(); + + void beginTransaction(SPISettings settings) { beginTransaction(BOARD_SPI_DEFAULT_SS, settings); } + void beginTransaction(uint8_t pin, SPISettings settings); + void endTransaction(); + + void beginTransactionSlave(SPISettings settings); + + void setClockDivider(uint32_t clockDivider); + void setBitOrder(BitOrder bitOrder); + void setDataMode(uint8_t dataMode); + + // SPI Configuration methods + void attachInterrupt(); + void detachInterrupt(); + + /* Victor Perez. Added to change datasize from 8 to 16 bit modes on the fly. + * Input parameter should be SPI_CR1_DFF set to 0 or 1 on a 32bit word. + * Requires an added function spi_data_size on STM32F1 / cores / maple / libmaple / spi.c + */ + void setDataSize(uint32_t ds); + + /* Victor Perez 2017. Added to set and clear callback functions for callback + * on DMA transfer completion. + * onReceive used to set the callback in case of dmaTransfer (tx/rx), once rx is completed + * onTransmit used to set the callback in case of dmaSend (tx only). That function + * will NOT be called in case of TX/RX + */ + void onReceive(void(*)()); + void onTransmit(void(*)()); + + /* + * I/O + */ + + /** + * @brief Return the next unread byte/word. + * + * If there is no unread byte/word waiting, this function will block + * until one is received. + */ + uint16_t read(); + + /** + * @brief Read length bytes, storing them into buffer. + * @param buffer Buffer to store received bytes into. + * @param length Number of bytes to store in buffer. This + * function will block until the desired number of + * bytes have been read. + */ + void read(uint8_t *buffer, uint32_t length); + + /** + * @brief Transmit one byte/word. + * @param data to transmit. + */ + void write(uint16_t data); + void write16(uint16_t data); // write 2 bytes in 8 bit mode (DFF=0) + + /** + * @brief Transmit one byte/word a specified number of times. + * @param data to transmit. + */ + void write(uint16_t data, uint32_t n); + + /** + * @brief Transmit multiple bytes/words. + * @param buffer Bytes/words to transmit. + * @param length Number of bytes/words in buffer to transmit. + */ + void write(const void * buffer, uint32_t length); + + /** + * @brief Transmit a byte, then return the next unread byte. + * + * This function transmits before receiving. + * + * @param data Byte to transmit. + * @return Next unread byte. + */ + uint8_t transfer(uint8_t data) const; + uint16_t transfer16(uint16_t data) const; + + /** + * @brief Sets up a DMA Transfer for "length" bytes. + * The transfer mode (8 or 16 bit mode) is evaluated from the SPI peripheral setting. + * + * This function transmits and receives to buffers. + * + * @param transmitBuf buffer Bytes to transmit. If passed as 0, it sends FF repeatedly for "length" bytes + * @param receiveBuf buffer Bytes to save received data. + * @param length Number of bytes in buffer to transmit. + */ + uint8_t dmaTransfer(const void * transmitBuf, void * receiveBuf, uint16_t length); + void dmaTransferSet(const void *transmitBuf, void *receiveBuf); + uint8_t dmaTransferRepeat(uint16_t length); + + /** + * @brief Sets up a DMA Transmit for SPI 8 or 16 bit transfer mode. + * The transfer mode (8 or 16 bit mode) is evaluated from the SPI peripheral setting. + * + * This function only transmits and does not care about the RX fifo. + * + * @param data buffer half words to transmit, + * @param length Number of bytes in buffer to transmit. + * @param minc Set to use Memory Increment mode, clear to use Circular mode. + */ + uint8_t dmaSend(const void * transmitBuf, uint16_t length, bool minc = 1); + void dmaSendSet(const void * transmitBuf, bool minc); + uint8_t dmaSendRepeat(uint16_t length); + + uint8_t dmaSendAsync(const void * transmitBuf, uint16_t length, bool minc = 1); + /* + * Pin accessors + */ + + /** + * @brief Return the number of the MISO (master in, slave out) pin + */ + uint8_t misoPin(); + + /** + * @brief Return the number of the MOSI (master out, slave in) pin + */ + uint8_t mosiPin(); + + /** + * @brief Return the number of the SCK (serial clock) pin + */ + uint8_t sckPin(); + + /** + * @brief Return the number of the NSS (slave select) pin + */ + uint8_t nssPin(); + + /* Escape hatch */ + + /** + * @brief Get a pointer to the underlying libmaple spi_dev for + * this HardwareSPI instance. + */ + spi_dev* c_dev() { return _currentSetting->spi_d; } + + spi_dev* dev() { return _currentSetting->spi_d; } + + /** + * @brief Sets the number of the SPI peripheral to be used by + * this HardwareSPI instance. + * + * @param spi_num Number of the SPI port. 1-2 in low density devices + * or 1-3 in high density devices. + */ + void setModule(int spi_num) { + _currentSetting = &_settings[spi_num - 1];// SPI channels are called 1 2 and 3 but the array is zero indexed + } + + /* -- The following methods are deprecated --------------------------- */ + + /** + * @brief Deprecated. + * + * Use HardwareSPI::transfer() instead. + * + * @see HardwareSPI::transfer() + */ + uint8_t send(uint8_t data); + + /** + * @brief Deprecated. + * + * Use HardwareSPI::write() in combination with + * HardwareSPI::read() (or HardwareSPI::transfer()) instead. + * + * @see HardwareSPI::write() + * @see HardwareSPI::read() + * @see HardwareSPI::transfer() + */ + uint8_t send(uint8_t *data, uint32_t length); + + /** + * @brief Deprecated. + * + * Use HardwareSPI::read() instead. + * + * @see HardwareSPI::read() + */ + uint8_t recv(); + +private: + + SPISettings _settings[BOARD_NR_SPI]; + SPISettings *_currentSetting; + + void updateSettings(); + + /* + * Functions added for DMA transfers with Callback. + * Experimental. + */ + + void EventCallback(); + + #if BOARD_NR_SPI >= 1 + static void _spi1EventCallback(); + #endif + #if BOARD_NR_SPI >= 2 + static void _spi2EventCallback(); + #endif + #if BOARD_NR_SPI >= 3 + static void _spi3EventCallback(); + #endif + /* + spi_dev *spi_d; + uint8_t _SSPin; + uint32_t clockDivider; + uint8_t dataMode; + BitOrder bitOrder; + */ +}; + +/** + * @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset. + */ +static inline void waitSpiTxEnd(spi_dev *spi_d) { + while (spi_is_tx_empty(spi_d) == 0) { /* nada */ } // wait until TXE=1 + while (spi_is_busy(spi_d) != 0) { /* nada */ } // wait until BSY=0 +} + +extern SPIClass SPI; diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_Servo_STM32F1.cpp b/Marlin/src/HAL/HAL_STM32F1/Servo.cpp similarity index 68% rename from Marlin/src/HAL/HAL_STM32F1/HAL_Servo_STM32F1.cpp rename to Marlin/src/HAL/HAL_STM32F1/Servo.cpp index 7fbc0f61d0f3..5dc21691544c 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_Servo_STM32F1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/Servo.cpp @@ -29,8 +29,8 @@ uint8_t ServoCount = 0; -#include "HAL_Servo_STM32F1.h" -#include "HAL_timers_STM32F1.h" +#include "Servo.h" +#include "timers.h" //#include "Servo.h" @@ -56,52 +56,50 @@ uint8_t ServoCount = 0; #define SERVO_OVERFLOW ((uint16_t)round((double)TAU_CYC / SERVO_PRESCALER)) // Unit conversions -#define US_TO_COMPARE(us) ((uint16_t)map((us), 0, TAU_USEC, 0, SERVO_OVERFLOW)) -#define COMPARE_TO_US(c) ((uint32_t)map((c), 0, SERVO_OVERFLOW, 0, TAU_USEC)) -#define ANGLE_TO_US(a) ((uint16_t)(map((a), this->minAngle, this->maxAngle, \ - SERVO_DEFAULT_MIN_PW, SERVO_DEFAULT_MAX_PW))) -#define US_TO_ANGLE(us) ((int16_t)(map((us), SERVO_DEFAULT_MIN_PW, SERVO_DEFAULT_MAX_PW, \ - this->minAngle, this->maxAngle))) - -void libServo::servoWrite(uint8_t pin, uint16_t duty_cycle) { +#define US_TO_COMPARE(us) uint16_t(map((us), 0, TAU_USEC, 0, SERVO_OVERFLOW)) +#define COMPARE_TO_US(c) uint32_t(map((c), 0, SERVO_OVERFLOW, 0, TAU_USEC)) +#define ANGLE_TO_US(a) uint16_t(map((a), minAngle, maxAngle, SERVO_DEFAULT_MIN_PW, SERVO_DEFAULT_MAX_PW)) +#define US_TO_ANGLE(us) int16_t(map((us), SERVO_DEFAULT_MIN_PW, SERVO_DEFAULT_MAX_PW, minAngle, maxAngle)) + +void libServo::servoWrite(uint8_t inPin, uint16_t duty_cycle) { #ifdef SERVO0_TIMER_NUM - if (this->servoIndex == 0) { - this->pwmSetDuty(duty_cycle); + if (servoIndex == 0) { + pwmSetDuty(duty_cycle); return; } #endif - timer_dev *tdev = PIN_MAP[pin].timer_device; - uint8_t tchan = PIN_MAP[pin].timer_channel; + timer_dev *tdev = PIN_MAP[inPin].timer_device; + uint8_t tchan = PIN_MAP[inPin].timer_channel; if (tdev) timer_set_compare(tdev, tchan, duty_cycle); } libServo::libServo() { - this->servoIndex = ServoCount < MAX_SERVOS ? ServoCount++ : INVALID_SERVO; + servoIndex = ServoCount < MAX_SERVOS ? ServoCount++ : INVALID_SERVO; } -bool libServo::attach(const int32_t pin, const int32_t minAngle, const int32_t maxAngle) { - if (this->servoIndex >= MAX_SERVOS) return false; - if (pin >= BOARD_NR_GPIO_PINS) return false; +bool libServo::attach(const int32_t inPin, const int32_t inMinAngle, const int32_t inMaxAngle) { + if (servoIndex >= MAX_SERVOS) return false; + if (inPin >= BOARD_NR_GPIO_PINS) return false; - this->minAngle = minAngle; - this->maxAngle = maxAngle; - this->angle = -1; + minAngle = inMinAngle; + maxAngle = inMaxAngle; + angle = -1; #ifdef SERVO0_TIMER_NUM - if (this->servoIndex == 0 && this->setupSoftPWM(pin)) { - this->pin = pin; // set attached() + if (servoIndex == 0 && setupSoftPWM(inPin)) { + pin = inPin; // set attached() return true; } #endif - if (!PWM_PIN(pin)) return false; + if (!PWM_PIN(inPin)) return false; - timer_dev *tdev = PIN_MAP[pin].timer_device; - //uint8_t tchan = PIN_MAP[pin].timer_channel; + timer_dev *tdev = PIN_MAP[inPin].timer_device; + //uint8_t tchan = PIN_MAP[inPin].timer_channel; - SET_PWM(pin); - servoWrite(pin, 0); + SET_PWM(inPin); + servoWrite(inPin, 0); timer_pause(tdev); timer_set_prescaler(tdev, SERVO_PRESCALER - 1); // prescaler is 1-based @@ -109,25 +107,24 @@ bool libServo::attach(const int32_t pin, const int32_t minAngle, const int32_t m timer_generate_update(tdev); timer_resume(tdev); - this->pin = pin; // set attached() - + pin = inPin; // set attached() return true; } bool libServo::detach() { - if (!this->attached()) return false; - this->angle = -1; - servoWrite(this->pin, 0); + if (!attached()) return false; + angle = -1; + servoWrite(pin, 0); return true; } int32_t libServo::read() const { - if (this->attached()) { + if (attached()) { #ifdef SERVO0_TIMER_NUM - if (this->servoIndex == 0) return this->angle; + if (servoIndex == 0) return angle; #endif - timer_dev *tdev = PIN_MAP[this->pin].timer_device; - uint8_t tchan = PIN_MAP[this->pin].timer_channel; + timer_dev *tdev = PIN_MAP[pin].timer_device; + uint8_t tchan = PIN_MAP[pin].timer_channel; return US_TO_ANGLE(COMPARE_TO_US(timer_get_compare(tdev, tchan))); } return 0; @@ -137,18 +134,18 @@ void libServo::move(const int32_t 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->attached()) { - this->angle = constrain(value, this->minAngle, this->maxAngle); - servoWrite(this->pin, US_TO_COMPARE(ANGLE_TO_US(this->angle))); - safe_delay(servo_delay[this->servoIndex]); + if (attached()) { + angle = constrain(value, minAngle, maxAngle); + servoWrite(pin, US_TO_COMPARE(ANGLE_TO_US(angle))); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } #ifdef SERVO0_TIMER_NUM - extern "C" void Servo_IRQHandler(void) { + extern "C" void Servo_IRQHandler() { static timer_dev *tdev = get_timer_dev(SERVO0_TIMER_NUM); uint16_t SR = timer_get_status(tdev); if (SR & TIMER_SR_CC1IF) { // channel 1 off @@ -169,13 +166,13 @@ void libServo::move(const int32_t value) { } } - bool libServo::setupSoftPWM(const int32_t pin) { + bool libServo::setupSoftPWM(const int32_t inPin) { timer_dev *tdev = get_timer_dev(SERVO0_TIMER_NUM); if (!tdev) return false; #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(pin, 1); + OUT_WRITE_OD(inPin, 1); #else - OUT_WRITE(pin, 0); + OUT_WRITE(inPin, 0); #endif timer_pause(tdev); @@ -206,9 +203,9 @@ void libServo::move(const int32_t value) { timer_disable_irq(tdev, 1); timer_disable_irq(tdev, 2); #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(this->pin, 1); // off + OUT_WRITE_OD(pin, 1); // off #else - OUT_WRITE(this->pin, 0); + OUT_WRITE(pin, 0); #endif } } @@ -221,7 +218,7 @@ void libServo::move(const int32_t value) { #else - bool libServo::setupSoftPWM(const int32_t pin) { return false; } + bool libServo::setupSoftPWM(const int32_t inPin) { return false; } void libServo::pwmSetDuty(const uint16_t duty_cycle) {} void libServo::pauseSoftPWM() {} diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_Servo_STM32F1.h b/Marlin/src/HAL/HAL_STM32F1/Servo.h similarity index 96% rename from Marlin/src/HAL/HAL_STM32F1/HAL_Servo_STM32F1.h rename to Marlin/src/HAL/HAL_STM32F1/Servo.h index f97ca7486bbe..92f4dd678d34 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_Servo_STM32F1.h +++ b/Marlin/src/HAL/HAL_STM32F1/Servo.h @@ -41,7 +41,7 @@ class libServo { public: libServo(); bool attach(const int32_t pin, const int32_t minAngle=SERVO_DEFAULT_MIN_ANGLE, const int32_t maxAngle=SERVO_DEFAULT_MAX_ANGLE); - bool attached() const { return this->pin != NOT_ATTACHED; } + bool attached() const { return pin != NOT_ATTACHED; } bool detach(); void move(const int32_t value); int32_t read() const; diff --git a/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp b/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp new file mode 100644 index 000000000000..99772a03c209 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp @@ -0,0 +1,60 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#if defined(__STM32F1__) && !defined(HAVE_SW_SERIAL) + +/** + * Empty class for Software Serial implementation (Custom RX/TX pins) + * + * TODO: Optionally use https://github.com/FYSETC/SoftwareSerialM if TMC UART is wanted + */ + +#include "SoftwareSerial.h" + +// Constructor + +SoftwareSerial::SoftwareSerial(int8_t RX_pin, int8_t TX_pin) {} + +// Public + +void SoftwareSerial::begin(const uint32_t baudrate) { +} + +bool SoftwareSerial::available() { + return false; +} + +uint8_t SoftwareSerial::read() { + return 0; +} + +uint16_t SoftwareSerial::write(uint8_t byte) { + return 0; +} + +void SoftwareSerial::flush() {} + +void SoftwareSerial::listen() { + listening = true; +} + +void SoftwareSerial::stopListening() { + listening = false; +} + +#endif //__STM32F1__ diff --git a/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h b/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h new file mode 100644 index 000000000000..330d7d632d16 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h @@ -0,0 +1,44 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#include + +#ifndef HAVE_SW_SERIAL + #define SW_SERIAL_PLACEHOLDER 1 +#endif + +class SoftwareSerial { +public: + SoftwareSerial(int8_t RX_pin, int8_t TX_pin); + + void begin(const uint32_t baudrate); + + bool available(); + + uint8_t read(); + uint16_t write(uint8_t byte); + void flush(); + + void listen(); + void stopListening(); + +protected: + bool listening; +}; diff --git a/Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py b/Marlin/src/HAL/HAL_STM32F1/build_flags.py old mode 100644 new mode 100755 similarity index 97% rename from Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py rename to Marlin/src/HAL/HAL_STM32F1/build_flags.py index 5bb2f18fb6b6..6310740fe0d8 --- a/Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +++ b/Marlin/src/HAL/HAL_STM32F1/build_flags.py @@ -4,7 +4,6 @@ #dynamic build flags for generic compile options if __name__ == "__main__": args = " ".join([ "-std=gnu11", - "-std=gnu++11", "-Os", "-mcpu=cortex-m3", "-mthumb", diff --git a/Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_fsmc.cpp b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp similarity index 73% rename from Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_fsmc.cpp rename to Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp index 4be4ae4dd437..9d569772faed 100644 --- a/Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_fsmc.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp @@ -26,18 +26,21 @@ * Communication interface for FSMC */ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS) // FSMC on 100/144 pins SoCs #if HAS_GRAPHICAL_LCD -#include "U8glib.h" -#include "libmaple/fsmc.h" -#include "libmaple/gpio.h" -#include "boards.h" +#include +#include +#include +#include +#include -#define LCD_READ_ID 0x04 /* Read display identification information */ +#ifndef LCD_READ_ID + #define LCD_READ_ID 0x04 // Read display identification information (0xD3 on ILI9341) +#endif /* Timing configuration */ #define FSMC_ADDRESS_SETUP_TIME 15 // AddressSetupTime @@ -47,6 +50,10 @@ void LCD_IO_Init(uint8_t cs, uint8_t rs); void LCD_IO_WriteData(uint16_t RegValue); void LCD_IO_WriteReg(uint16_t Reg); uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize); +#ifdef LCD_USE_DMA_FSMC + void LCD_IO_WriteMultiple(uint16_t data, uint32_t count); + void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); +#endif static uint8_t msgInitCount = 2; // Ignore all messages until 2nd U8G_COM_MSG_INIT @@ -59,21 +66,25 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi static uint8_t isCommand; switch (msg) { - case U8G_COM_MSG_STOP: - break; + case U8G_COM_MSG_STOP: break; case U8G_COM_MSG_INIT: u8g_SetPIOutput(u8g, U8G_PI_RESET); + #ifdef LCD_USE_DMA_FSMC + dma_init(FSMC_DMA_DEV); + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_set_priority(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, DMA_PRIORITY_MEDIUM); + #endif + LCD_IO_Init(u8g->pin_list[U8G_PI_CS], u8g->pin_list[U8G_PI_A0]); - u8g_Delay(100); + u8g_Delay(50); - if (arg_ptr != nullptr) + if (arg_ptr) *((uint32_t *)arg_ptr) = LCD_IO_ReadData(LCD_READ_ID, 3); - isCommand = 0; break; - case U8G_COM_MSG_ADDRESS: // define cmd (arg_val = 0) or data mode (arg_val = 1) + case U8G_COM_MSG_ADDRESS: // define cmd (arg_val = 0) or data mode (arg_val = 1) isCommand = arg_val == 0 ? 1 : 0; break; @@ -89,7 +100,6 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi break; case U8G_COM_MSG_WRITE_SEQ: - for (uint8_t i = 0; i < arg_val; i += 2) LCD_IO_WriteData(*(uint16_t *)(((uint32_t)arg_ptr) + i)); break; @@ -103,13 +113,13 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi #define __ASM __asm #define __STATIC_INLINE static inline -__attribute__((always_inline)) __STATIC_INLINE void __DSB(void) { +__attribute__((always_inline)) __STATIC_INLINE void __DSB() { __ASM volatile ("dsb 0xF":::"memory"); } -#define FSMC_CS_NE1 PD7 +#define FSMC_CS_NE1 PD7 -#ifdef STM32_XL_DENSITY +#if ENABLED(STM32_XL_DENSITY) #define FSMC_CS_NE2 PG9 #define FSMC_CS_NE3 PG10 #define FSMC_CS_NE4 PG12 @@ -141,7 +151,7 @@ __attribute__((always_inline)) __STATIC_INLINE void __DSB(void) { #define FSMC_RS_A22 PE6 #define FSMC_RS_A23 PE2 -#ifdef STM32_XL_DENSITY +#if ENABLED(STM32_XL_DENSITY) #define FSMC_RS_A24 PG13 #define FSMC_RS_A25 PG14 #endif @@ -163,7 +173,7 @@ void LCD_IO_Init(uint8_t cs, uint8_t rs) { switch (cs) { case FSMC_CS_NE1: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION1; break; - #ifdef STM32_XL_DENSITY + #if ENABLED(STM32_XL_DENSITY) case FSMC_CS_NE2: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION2; break; case FSMC_CS_NE3: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION3; break; case FSMC_CS_NE4: controllerAddress = (uint32_t)FSMC_NOR_PSRAM_REGION4; break; @@ -174,7 +184,7 @@ void LCD_IO_Init(uint8_t cs, uint8_t rs) { #define _ORADDR(N) controllerAddress |= (_BV32(N) - 2) switch (rs) { - #ifdef STM32_XL_DENSITY + #if ENABLED(STM32_XL_DENSITY) case FSMC_RS_A0: _ORADDR( 1); break; case FSMC_RS_A1: _ORADDR( 2); break; case FSMC_RS_A2: _ORADDR( 3); break; @@ -200,7 +210,7 @@ void LCD_IO_Init(uint8_t cs, uint8_t rs) { case FSMC_RS_A21: _ORADDR(22); break; case FSMC_RS_A22: _ORADDR(23); break; case FSMC_RS_A23: _ORADDR(24); break; - #ifdef STM32_XL_DENSITY + #if ENABLED(STM32_XL_DENSITY) case FSMC_RS_A24: _ORADDR(25); break; case FSMC_RS_A25: _ORADDR(26); break; #endif @@ -232,7 +242,7 @@ void LCD_IO_Init(uint8_t cs, uint8_t rs) { gpio_set_mode(PIN_MAP[cs].gpio_device, PIN_MAP[cs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_CS_NEx gpio_set_mode(PIN_MAP[rs].gpio_device, PIN_MAP[rs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_RS_Ax - #ifdef STM32_XL_DENSITY + #if ENABLED(STM32_XL_DENSITY) FSMC_NOR_PSRAM4_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; FSMC_NOR_PSRAM4_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; #else // PSRAM1 for STM32F103V (high density) @@ -257,7 +267,7 @@ void LCD_IO_WriteReg(uint16_t Reg) { uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) { volatile uint32_t data; - LCD->REG = (uint16_t)RegValue; + LCD->REG = RegValue; __DSB(); data = LCD->RAM; // dummy read @@ -267,9 +277,48 @@ uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) { data <<= 8; data |= (LCD->RAM & 0x00FF); } - return (uint32_t)data; + return uint32_t(data); } -#endif // HAS_GRAPHICAL_LCD +#if ENABLED(LCD_USE_DMA_FSMC) + +void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) { + while (count > 0) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, &color, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, count > 65535 ? 65535 : count); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + count = count > 65535 ? count - 65535 : 0; + } +} + +void LCD_IO_WriteSequence(uint16_t *data, uint16_t length) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); +} + +void LCD_IO_WriteSequence_Async(uint16_t *data, uint16_t length) { + dma_setup_transfer(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, data, DMA_SIZE_16BITS, &LCD->RAM, DMA_SIZE_16BITS, DMA_MEM_2_MEM | DMA_PINC_MODE); + dma_set_num_transfers(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, length); + dma_clear_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_enable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); +} + +void LCD_IO_WaitSequence_Async() { + while ((dma_get_isr_bits(FSMC_DMA_DEV, FSMC_DMA_CHANNEL) & 0x0A) == 0) {}; + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); +} + +#endif // LCD_USE_DMA_FSMC + +#endif // HAS_GRAPHICAL_LCD #endif // ARDUINO_ARCH_STM32F1 && FSMC_CS_PIN diff --git a/Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_swspi.cpp b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp similarity index 98% rename from Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_swspi.cpp rename to Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp index 51d1fac9d473..753a5d5e708d 100644 --- a/Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_swspi.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp @@ -18,11 +18,11 @@ */ #ifdef __STM32F1__ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if HAS_GRAPHICAL_LCD && ENABLED(FORCE_SOFT_SPI) -#include "HAL.h" +#include "../HAL.h" #include #undef SPI_SPEED diff --git a/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h b/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h index 830f0075c00b..d043b3b8dbf7 100644 --- a/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h @@ -50,9 +50,9 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { #if HAS_X_MAX attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it #endif diff --git a/Marlin/src/HAL/HAL_STM32F1/fastio.h b/Marlin/src/HAL/HAL_STM32F1/fastio.h new file mode 100644 index 000000000000..3aafb9de3960 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/fastio.h @@ -0,0 +1,186 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * Copyright (c) 2017 Victor Perez + * + * 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 . + * + */ +#pragma once + +/** + * Fast I/O interfaces for STM32F1 + * These use GPIO functions instead of Direct Port Manipulation, as on AVR. + */ + +#include + +#define READ(IO) (PIN_MAP[IO].gpio_device->regs->IDR & (1U << PIN_MAP[IO].gpio_bit) ? HIGH : LOW) +#define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = (1U << PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16)) +#define TOGGLE(IO) (PIN_MAP[IO].gpio_device->regs->ODR = PIN_MAP[IO].gpio_device->regs->ODR ^ (1U << PIN_MAP[IO].gpio_bit)) + +#define _GET_MODE(IO) gpio_get_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit) +#define _SET_MODE(IO,M) gpio_set_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit, M) +#define _SET_OUTPUT(IO) _SET_MODE(IO, GPIO_OUTPUT_PP) +#define _SET_OUTPUT_OD(IO) _SET_MODE(IO, GPIO_OUTPUT_OD) + +#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) +#define OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0) + +#define SET_INPUT(IO) _SET_MODE(IO, GPIO_INPUT_FLOATING) +#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, GPIO_INPUT_PU) +#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, GPIO_INPUT_PD) +#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW) +#define SET_PWM(IO) pinMode(IO, PWM) // do{ gpio_set_mode(PIN_MAP[pin].gpio_device, PIN_MAP[pin].gpio_bit, GPIO_AF_OUTPUT_PP); timer_set_mode(PIN_MAP[pin].timer_device, PIN_MAP[pin].timer_channel, TIMER_PWM); }while(0) +#define SET_PWM_OD(IO) pinMode(IO, PWM_OPEN_DRAIN) + +#define IS_INPUT(IO) (_GET_MODE(IO) == GPIO_INPUT_FLOATING || _GET_MODE(IO) == GPIO_INPUT_ANALOG || _GET_MODE(IO) == GPIO_INPUT_PU || _GET_MODE(IO) == GPIO_INPUT_PD) +#define IS_OUTPUT(IO) (_GET_MODE(IO) == GPIO_OUTPUT_PP || _GET_MODE(IO) == GPIO_OUTPUT_OD) + +#define PWM_PIN(IO) (PIN_MAP[IO].timer_device != nullptr) + +// digitalRead/Write wrappers +#define extDigitalRead(IO) digitalRead(IO) +#define extDigitalWrite(IO,V) digitalWrite(IO,V) + +// +// Pins Definitions +// +#define PA0 0x00 +#define PA1 0x01 +#define PA2 0x02 +#define PA3 0x03 +#define PA4 0x04 +#define PA5 0x05 +#define PA6 0x06 +#define PA7 0x07 +#define PA8 0x08 +#define PA9 0x09 +#define PA10 0x0A +#define PA11 0x0B +#define PA12 0x0C +#define PA13 0x0D +#define PA14 0x0E +#define PA15 0x0F + +#define PB0 0x10 +#define PB1 0x11 +#define PB2 0x12 +#define PB3 0x13 +#define PB4 0x14 +#define PB5 0x15 +#define PB6 0x16 +#define PB7 0x17 // 36 pins (F103T) +#define PB8 0x18 +#define PB9 0x19 +#define PB10 0x1A +#define PB11 0x1B +#define PB12 0x1C +#define PB13 0x1D +#define PB14 0x1E +#define PB15 0x1F + +#if defined(MCU_STM32F103CB) || defined(MCU_STM32F103C8) + #define PC13 0x20 + #define PC14 0x21 + #define PC15 0x22 +#else + #define PC0 0x20 + #define PC1 0x21 + #define PC2 0x22 + #define PC3 0x23 + #define PC4 0x24 + #define PC5 0x25 + #define PC6 0x26 + #define PC7 0x27 + #define PC8 0x28 + #define PC9 0x29 + #define PC10 0x2A + #define PC11 0x2B + #define PC12 0x2C + #define PC13 0x2D + #define PC14 0x2E + #define PC15 0x2F +#endif + +#define PD0 0x30 +#define PD1 0x31 +#define PD2 0x32 // 64 pins (F103R) +#define PD3 0x33 +#define PD4 0x34 +#define PD5 0x35 +#define PD6 0x36 +#define PD7 0x37 +#define PD8 0x38 +#define PD9 0x39 +#define PD10 0x3A +#define PD11 0x3B +#define PD12 0x3C +#define PD13 0x3D +#define PD14 0x3E +#define PD15 0x3F + +#define PE0 0x40 +#define PE1 0x41 +#define PE2 0x42 +#define PE3 0x43 +#define PE4 0x44 +#define PE5 0x45 +#define PE6 0x46 +#define PE7 0x47 +#define PE8 0x48 +#define PE9 0x49 +#define PE10 0x4A +#define PE11 0x4B +#define PE12 0x4C +#define PE13 0x4D +#define PE14 0x4E +#define PE15 0x4F // 100 pins (F103V) + +#define PF0 0x50 +#define PF1 0x51 +#define PF2 0x52 +#define PF3 0x53 +#define PF4 0x54 +#define PF5 0x55 +#define PF6 0x56 +#define PF7 0x57 +#define PF8 0x58 +#define PF9 0x59 +#define PF10 0x5A +#define PF11 0x5B +#define PF12 0x5C +#define PF13 0x5D +#define PF14 0x5E +#define PF15 0x5F + +#define PG0 0x60 +#define PG1 0x61 +#define PG2 0x62 +#define PG3 0x63 +#define PG4 0x64 +#define PG5 0x65 +#define PG6 0x66 +#define PG7 0x67 +#define PG8 0x68 +#define PG9 0x69 +#define PG10 0x6A +#define PG11 0x6B +#define PG12 0x6C +#define PG13 0x6D +#define PG14 0x6E +#define PG15 0x6F // 144 pins (F103Z) diff --git a/Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h b/Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h deleted file mode 100644 index fe09de3ebbdf..000000000000 --- a/Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ -#pragma once - -/** - * Fast I/O interfaces for STM32F1 - * These use GPIO functions instead of Direct Port Manipulation, as on AVR. - */ - -#include - -#define READ(IO) (PIN_MAP[IO].gpio_device->regs->IDR & (1U << PIN_MAP[IO].gpio_bit) ? HIGH : LOW) -#define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = (1U << PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16)) -#define TOGGLE(IO) (PIN_MAP[IO].gpio_device->regs->ODR = PIN_MAP[IO].gpio_device->regs->ODR ^ (1U << PIN_MAP[IO].gpio_bit)) - -#define _GET_MODE(IO) gpio_get_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit) -#define _SET_MODE(IO,M) gpio_set_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit, M) -#define _SET_OUTPUT(IO) _SET_MODE(IO, GPIO_OUTPUT_PP) -#define _SET_OUTPUT_OD(IO) _SET_MODE(IO, GPIO_OUTPUT_OD) - -#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); } while(0) -#define OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); } while(0) - -#define SET_INPUT(IO) _SET_MODE(IO, GPIO_INPUT_FLOATING) -#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, GPIO_INPUT_PU) -#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW) -#define SET_PWM(IO) pinMode(IO, PWM) // do{ gpio_set_mode(PIN_MAP[pin].gpio_device, PIN_MAP[pin].gpio_bit, GPIO_AF_OUTPUT_PP); timer_set_mode(PIN_MAP[pin].timer_device, PIN_MAP[pin].timer_channel, TIMER_PWM); }while(0) -#define SET_PWM_OD(IO) pinMode(IO, PWM_OPEN_DRAIN) - -#define IS_INPUT(IO) (_GET_MODE(IO) == GPIO_INPUT_FLOATING || _GET_MODE(IO) == GPIO_INPUT_ANALOG || _GET_MODE(IO) == GPIO_INPUT_PU || _GET_MODE(IO) == GPIO_INPUT_PD) -#define IS_OUTPUT(IO) (_GET_MODE(IO) == GPIO_OUTPUT_PP || _GET_MODE(IO) == GPIO_OUTPUT_OD) - -#define PWM_PIN(IO) (PIN_MAP[IO].timer_device != nullptr) - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - diff --git a/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32F1/SanityCheck.h b/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h similarity index 86% rename from Marlin/src/HAL/HAL_STM32F1/SanityCheck.h rename to Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h index f356c0da0784..69466a0a7731 100644 --- a/Marlin/src/HAL/HAL_STM32F1/SanityCheck.h +++ b/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h @@ -36,3 +36,8 @@ #if ENABLED(FAST_PWM_FAN) #error "FAST_PWM_FAN is not yet implemented for this platform." #endif + +#if !defined(HAVE_SW_SERIAL) && HAS_TMC220x + #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER." + #error "Missing SoftwareSerial implementation." +#endif diff --git a/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf b/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf new file mode 100644 index 000000000000..c39f4ce0ed5d --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf @@ -0,0 +1,56 @@ +; +; STMicroelectronics Communication Device Class driver installation file +; (C)2006 Copyright STMicroelectronics +; + +[Version] +Signature="$Windows NT$" +Class=Ports +ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} +Provider=%STM% +LayoutFile=layout.inf + +[Manufacturer] +%MFGNAME%=VirComDevice,NT,NTamd64 + +[DestinationDirs] +DefaultDestDir = 12 + +[VirComDevice.NT] +%DESCRIPTION%=DriverInstall,USB\VID_1EAF&PID_0029&MI_01 +%DESCRIPTION%=DriverInstall,USB\VID_1EAF&PID_0029&MI_01 + +[VirComDevice.NTamd64] +%DESCRIPTION%=DriverInstall,USB\VID_1EAF&PID_0029&MI_01 +%DESCRIPTION%=DriverInstall,USB\VID_1EAF&PID_0029&MI_01 + +[DriverInstall.NT] +Include=mdmcpq.inf +CopyFiles=FakeModemCopyFileSection +AddReg=DriverInstall.NT.AddReg + +[DriverInstall.NT.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,usbser.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.NT.Services] +AddService=usbser, 0x00000002, DriverServiceInst + +[DriverServiceInst] +DisplayName=%SERVICE% +ServiceType=1 +StartType=3 +ErrorControl=1 +ServiceBinary=%12%\usbser.sys + +;------------------------------------------------------------------------------ +; String Definitions +;------------------------------------------------------------------------------ + + +[Strings] +STM = "LeafLabs" +MFGNAME = "LeafLabs" +DESCRIPTION = "Maple R3" +SERVICE = "USB Virtual COM port" diff --git a/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp b/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp new file mode 100644 index 000000000000..81e430fa2adb --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp @@ -0,0 +1,64 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#ifdef USE_USB_COMPOSITE + +#include "msc_sd.h" +#include "SPI.h" + +#define PRODUCT_ID 0x29 + +USBMassStorage MarlinMSC; +USBCompositeSerial MarlinCompositeSerial; + +#include "../../inc/MarlinConfig.h" + +#ifdef HAS_ONBOARD_SD + + #include "onboard_sd.h" + + static bool MSC_Write(const uint8_t *writebuff, uint32_t startSector, uint16_t numSectors) { + return (disk_write(0, writebuff, startSector, numSectors) == RES_OK); + } + static bool MSC_Read(uint8_t *readbuff, uint32_t startSector, uint16_t numSectors) { + return (disk_read(0, readbuff, startSector, numSectors) == RES_OK); + } + +#endif + +void MSC_SD_init() { + USBComposite.setProductId(PRODUCT_ID); + // Just set MarlinCompositeSerial enabled to true + // because when MarlinCompositeSerial.begin() is used in setup() + // it clears all USBComposite devices. + MarlinCompositeSerial.begin(); + USBComposite.end(); + USBComposite.clear(); + // Set api and register mass storage + #ifdef HAS_ONBOARD_SD + uint32_t cardSize; + if (disk_initialize(0) == RES_OK) { + if (disk_ioctl(0, GET_SECTOR_COUNT, (void *)(&cardSize)) == RES_OK) { + MarlinMSC.setDriveData(0, cardSize, MSC_Read, MSC_Write); + MarlinMSC.registerComponent(); + } + } + #endif + // Register composite Serial + MarlinCompositeSerial.registerComponent(); + USBComposite.begin(); +} + +#endif // USE_USB_COMPOSITE diff --git a/Marlin/src/HAL/HAL_STM32F1/msc_sd.h b/Marlin/src/HAL/HAL_STM32F1/msc_sd.h new file mode 100644 index 000000000000..9f06ca5fdbf4 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/msc_sd.h @@ -0,0 +1,23 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include + +extern USBMassStorage MarlinMSC; +extern USBCompositeSerial MarlinCompositeSerial; + +void MSC_SD_init(); diff --git a/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp b/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp new file mode 100644 index 000000000000..c5b4f34cd22d --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp @@ -0,0 +1,556 @@ +/** + * STM32F1: MMCv3/SDv1/SDv2 (SPI mode) control module + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] + * Copyright (C) 2015, ChaN, all right reserved. + * + * This software is a free software and there is NO WARRANTY. + * No restriction on use. You can use, modify and redistribute it for + * personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY. + * Redistributions of source code must retain the above copyright notice. + * + */ + +#include "../../inc/MarlinConfig.h" + +#ifdef HAS_ONBOARD_SD + +#include "onboard_sd.h" +#include "SPI.h" +#include "fastio.h" + +#ifdef SHARED_SD_CARD + #ifndef ON_BOARD_SPI_DEVICE + #define ON_BOARD_SPI_DEVICE SPI_DEVICE + #endif + #define ONBOARD_SD_SPI SPI +#else + SPIClass OnBoardSPI(ON_BOARD_SPI_DEVICE); + #define ONBOARD_SD_SPI OnBoardSPI +#endif + +#if ON_BOARD_SPI_DEVICE == 1 + #define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_4 +#else + #define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_2 +#endif + +#define CS_LOW() WRITE(ONBOARD_SD_CS_PIN, LOW) /* Set OnBoardSPI cs low */ +#define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) /* Set OnBoardSPI cs high */ + +#define FCLK_FAST() ONBOARD_SD_SPI.setClockDivider(SPI_CLOCK_MAX) +#define FCLK_SLOW() ONBOARD_SD_SPI.setClockDivider(SPI_BAUD_PCLK_DIV_256) + +/*-------------------------------------------------------------------------- + Module Private Functions +---------------------------------------------------------------------------*/ + +/* MMC/SD command */ +#define CMD0 (0) /* GO_IDLE_STATE */ +#define CMD1 (1) /* SEND_OP_COND (MMC) */ +#define ACMD41 (0x80+41) /* SEND_OP_COND (SDC) */ +#define CMD8 (8) /* SEND_IF_COND */ +#define CMD9 (9) /* SEND_CSD */ +#define CMD10 (10) /* SEND_CID */ +#define CMD12 (12) /* STOP_TRANSMISSION */ +#define ACMD13 (0x80+13) /* SD_STATUS (SDC) */ +#define CMD16 (16) /* SET_BLOCKLEN */ +#define CMD17 (17) /* READ_SINGLE_BLOCK */ +#define CMD18 (18) /* READ_MULTIPLE_BLOCK */ +#define CMD23 (23) /* SET_BLOCK_COUNT (MMC) */ +#define ACMD23 (0x80+23) /* SET_WR_BLK_ERASE_COUNT (SDC) */ +#define CMD24 (24) /* WRITE_BLOCK */ +#define CMD25 (25) /* WRITE_MULTIPLE_BLOCK */ +#define CMD32 (32) /* ERASE_ER_BLK_START */ +#define CMD33 (33) /* ERASE_ER_BLK_END */ +#define CMD38 (38) /* ERASE */ +#define CMD48 (48) /* READ_EXTR_SINGLE */ +#define CMD49 (49) /* WRITE_EXTR_SINGLE */ +#define CMD55 (55) /* APP_CMD */ +#define CMD58 (58) /* READ_OCR */ + +static volatile DSTATUS Stat = STA_NOINIT; /* Physical drive status */ +static volatile UINT timeout; +static BYTE CardType; /* Card type flags */ + +/*-----------------------------------------------------------------------*/ +/* Send/Receive data to the MMC (Platform dependent) */ +/*-----------------------------------------------------------------------*/ + +/* Exchange a byte */ +static BYTE xchg_spi ( + BYTE dat /* Data to send */ +) { + BYTE returnByte = ONBOARD_SD_SPI.transfer(dat); + return returnByte; +} + +/* Receive multiple byte */ +static void rcvr_spi_multi ( + BYTE *buff, /* Pointer to data buffer */ + UINT btr /* Number of bytes to receive (16, 64 or 512) */ +) { + ONBOARD_SD_SPI.dmaTransfer(0, const_cast(buff), btr); +} + +#if _DISKIO_WRITE + + /* Send multiple bytes */ + static void xmit_spi_multi ( + const BYTE *buff, /* Pointer to the data */ + UINT btx /* Number of bytes to send (multiple of 16) */ + ) { + ONBOARD_SD_SPI.dmaSend(const_cast(buff), btx); + } + +#endif // _DISKIO_WRITE + +/*-----------------------------------------------------------------------*/ +/* Wait for card ready */ +/*-----------------------------------------------------------------------*/ + +static int wait_ready ( /* 1:Ready, 0:Timeout */ + UINT wt /* Timeout [ms] */ +) { + BYTE d; + + timeout = millis() + wt; + do { + d = xchg_spi(0xFF); + /* This loop takes a while. Insert rot_rdq() here for multitask environment. */ + } while (d != 0xFF && (timeout > millis())); /* Wait for card goes ready or timeout */ + + return (d == 0xFF) ? 1 : 0; +} + +/*-----------------------------------------------------------------------*/ +/* Deselect card and release SPI */ +/*-----------------------------------------------------------------------*/ + +static void deselect() { + CS_HIGH(); /* CS = H */ + xchg_spi(0xFF); /* Dummy clock (force DO hi-z for multiple slave SPI) */ +} + +/*-----------------------------------------------------------------------*/ +/* Select card and wait for ready */ +/*-----------------------------------------------------------------------*/ + +static int select() { /* 1:OK, 0:Timeout */ + CS_LOW(); /* CS = L */ + xchg_spi(0xFF); /* Dummy clock (force DO enabled) */ + + if (wait_ready(500)) return 1; /* Leading busy check: Wait for card ready */ + + deselect(); /* Timeout */ + return 0; +} + +/*-----------------------------------------------------------------------*/ +/* Control SPI module (Platform dependent) */ +/*-----------------------------------------------------------------------*/ + +static void power_on() { /* Enable SSP module and attach it to I/O pads */ + ONBOARD_SD_SPI.setModule(ON_BOARD_SPI_DEVICE); + ONBOARD_SD_SPI.begin(); + ONBOARD_SD_SPI.setBitOrder(MSBFIRST); + ONBOARD_SD_SPI.setDataMode(SPI_MODE0); + OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); /* Set CS# high */ +} + +static void power_off() { /* Disable SPI function */ + select(); /* Wait for card ready */ + deselect(); +} + +/*-----------------------------------------------------------------------*/ +/* Receive a data packet from the MMC */ +/*-----------------------------------------------------------------------*/ + +static int rcvr_datablock ( /* 1:OK, 0:Error */ + BYTE *buff, /* Data buffer */ + UINT btr /* Data block length (byte) */ +) { + BYTE token; + + timeout = millis() + 200; + do { /* Wait for DataStart token in timeout of 200ms */ + token = xchg_spi(0xFF); + /* This loop will take a while. Insert rot_rdq() here for multitask environment. */ + } while ((token == 0xFF) && (timeout > millis())); + if (token != 0xFE) return 0; /* Function fails if invalid DataStart token or timeout */ + + rcvr_spi_multi(buff, btr); /* Store trailing data to the buffer */ + xchg_spi(0xFF); xchg_spi(0xFF); /* Discard CRC */ + + return 1; /* Function succeeded */ +} + +/*-----------------------------------------------------------------------*/ +/* Send a data packet to the MMC */ +/*-----------------------------------------------------------------------*/ + +#if _DISKIO_WRITE + + static int xmit_datablock ( /* 1:OK, 0:Failed */ + const BYTE *buff, /* Ponter to 512 byte data to be sent */ + BYTE token /* Token */ + ) { + BYTE resp; + + if (!wait_ready(500)) return 0; /* Leading busy check: Wait for card ready to accept data block */ + + xchg_spi(token); /* Send token */ + if (token == 0xFD) return 1; /* Do not send data if token is StopTran */ + + xmit_spi_multi(buff, 512); /* Data */ + xchg_spi(0xFF); xchg_spi(0xFF); /* Dummy CRC */ + + resp = xchg_spi(0xFF); /* Receive data resp */ + + return (resp & 0x1F) == 0x05 ? 1 : 0; /* Data was accepted or not */ + + /* Busy check is done at next transmission */ + } + +#endif // _DISKIO_WRITE + +/*-----------------------------------------------------------------------*/ +/* Send a command packet to the MMC */ +/*-----------------------------------------------------------------------*/ + +static BYTE send_cmd ( /* Return value: R1 resp (bit7==1:Failed to send) */ + BYTE cmd, /* Command index */ + DWORD arg /* Argument */ +) { + BYTE n, res; + + if (cmd & 0x80) { /* Send a CMD55 prior to ACMD */ + cmd &= 0x7F; + res = send_cmd(CMD55, 0); + if (res > 1) return res; + } + + /* Select the card and wait for ready except to stop multiple block read */ + if (cmd != CMD12) { + deselect(); + if (!select()) return 0xFF; + } + + /* Send command packet */ + xchg_spi(0x40 | cmd); /* Start + command index */ + xchg_spi((BYTE)(arg >> 24)); /* Argument[31..24] */ + xchg_spi((BYTE)(arg >> 16)); /* Argument[23..16] */ + xchg_spi((BYTE)(arg >> 8)); /* Argument[15..8] */ + xchg_spi((BYTE)arg); /* Argument[7..0] */ + n = 0x01; /* Dummy CRC + Stop */ + if (cmd == CMD0) n = 0x95; /* Valid CRC for CMD0(0) */ + if (cmd == CMD8) n = 0x87; /* Valid CRC for CMD8(0x1AA) */ + xchg_spi(n); + + /* Receive command resp */ + if (cmd == CMD12) xchg_spi(0xFF); /* Diacard following one byte when CMD12 */ + n = 10; /* Wait for response (10 bytes max) */ + do + res = xchg_spi(0xFF); + while ((res & 0x80) && --n); + + return res; /* Return received response */ +} + +/*-------------------------------------------------------------------------- + Public Functions +---------------------------------------------------------------------------*/ + +/*-----------------------------------------------------------------------*/ +/* Initialize disk drive */ +/*-----------------------------------------------------------------------*/ + +DSTATUS disk_initialize ( + BYTE drv /* Physical drive number (0) */ +) { + BYTE n, cmd, ty, ocr[4]; + + if (drv) return STA_NOINIT; /* Supports only drive 0 */ + power_on(); /* Initialize SPI */ + + if (Stat & STA_NODISK) return Stat; /* Is a card existing in the soket? */ + + FCLK_SLOW(); + for (n = 10; n; n--) xchg_spi(0xFF); /* Send 80 dummy clocks */ + + ty = 0; + if (send_cmd(CMD0, 0) == 1) { /* Put the card SPI state */ + timeout = millis() + 1000; /* Initialization timeout = 1 sec */ + if (send_cmd(CMD8, 0x1AA) == 1) { /* Is the catd SDv2? */ + for (n = 0; n < 4; n++) ocr[n] = xchg_spi(0xFF); /* Get 32 bit return value of R7 resp */ + if (ocr[2] == 0x01 && ocr[3] == 0xAA) { /* Does the card support 2.7-3.6V? */ + while ((timeout > millis()) && send_cmd(ACMD41, 1UL << 30)) ; /* Wait for end of initialization with ACMD41(HCS) */ + if ((timeout > millis()) && send_cmd(CMD58, 0) == 0) { /* Check CCS bit in the OCR */ + for (n = 0; n < 4; n++) ocr[n] = xchg_spi(0xFF); + ty = (ocr[0] & 0x40) ? CT_SD2 | CT_BLOCK : CT_SD2; /* Check if the card is SDv2 */ + } + } + } else { /* Not an SDv2 card */ + if (send_cmd(ACMD41, 0) <= 1) { /* SDv1 or MMCv3? */ + ty = CT_SD1; cmd = ACMD41; /* SDv1 (ACMD41(0)) */ + } else { + ty = CT_MMC; cmd = CMD1; /* MMCv3 (CMD1(0)) */ + } + while ((timeout > millis()) && send_cmd(cmd, 0)) ; /* Wait for the card leaves idle state */ + if (!(timeout > millis()) || send_cmd(CMD16, 512) != 0) /* Set block length: 512 */ + ty = 0; + } + } + CardType = ty; /* Card type */ + deselect(); + + if (ty) { /* OK */ + FCLK_FAST(); /* Set fast clock */ + Stat &= ~STA_NOINIT; /* Clear STA_NOINIT flag */ + } else { /* Failed */ + power_off(); + Stat = STA_NOINIT; + } + + return Stat; +} + +/*-----------------------------------------------------------------------*/ +/* Get disk status */ +/*-----------------------------------------------------------------------*/ + +DSTATUS disk_status ( + BYTE drv /* Physical drive number (0) */ +) { + if (drv) return STA_NOINIT; /* Supports only drive 0 */ + return Stat; /* Return disk status */ +} + +/*-----------------------------------------------------------------------*/ +/* Read sector(s) */ +/*-----------------------------------------------------------------------*/ + +DRESULT disk_read ( + BYTE drv, /* Physical drive number (0) */ + BYTE *buff, /* Pointer to the data buffer to store read data */ + DWORD sector, /* Start sector number (LBA) */ + UINT count /* Number of sectors to read (1..128) */ +) { + BYTE cmd; + + if (drv || !count) return RES_PARERR; /* Check parameter */ + if (Stat & STA_NOINIT) return RES_NOTRDY; /* Check if drive is ready */ + if (!(CardType & CT_BLOCK)) sector *= 512; /* LBA ot BA conversion (byte addressing cards) */ + FCLK_FAST(); + cmd = count > 1 ? CMD18 : CMD17; /* READ_MULTIPLE_BLOCK : READ_SINGLE_BLOCK */ + if (send_cmd(cmd, sector) == 0) { + do { + if (!rcvr_datablock(buff, 512)) break; + buff += 512; + } while (--count); + if (cmd == CMD18) send_cmd(CMD12, 0); /* STOP_TRANSMISSION */ + } + deselect(); + + return count ? RES_ERROR : RES_OK; /* Return result */ +} + +/*-----------------------------------------------------------------------*/ +/* Write sector(s) */ +/*-----------------------------------------------------------------------*/ + +#if _DISKIO_WRITE + + DRESULT disk_write( + BYTE drv, /* Physical drive number (0) */ + const BYTE *buff, /* Ponter to the data to write */ + DWORD sector, /* Start sector number (LBA) */ + UINT count /* Number of sectors to write (1..128) */ + ) { + if (drv || !count) return RES_PARERR; /* Check parameter */ + if (Stat & STA_NOINIT) return RES_NOTRDY; /* Check drive status */ + if (Stat & STA_PROTECT) return RES_WRPRT; /* Check write protect */ + FCLK_FAST(); + if (!(CardType & CT_BLOCK)) sector *= 512; /* LBA ==> BA conversion (byte addressing cards) */ + + if (count == 1) { /* Single sector write */ + if ((send_cmd(CMD24, sector) == 0) /* WRITE_BLOCK */ + && xmit_datablock(buff, 0xFE)) { + count = 0; + } + } + else { /* Multiple sector write */ + if (CardType & CT_SDC) send_cmd(ACMD23, count); /* Predefine number of sectors */ + if (send_cmd(CMD25, sector) == 0) { /* WRITE_MULTIPLE_BLOCK */ + do { + if (!xmit_datablock(buff, 0xFC)) break; + buff += 512; + } while (--count); + if (!xmit_datablock(0, 0xFD)) count = 1; /* STOP_TRAN token */ + } + } + deselect(); + + return count ? RES_ERROR : RES_OK; /* Return result */ + } + +#endif // _DISKIO_WRITE + +/*-----------------------------------------------------------------------*/ +/* Miscellaneous drive controls other than data read/write */ +/*-----------------------------------------------------------------------*/ + +#if _DISKIO_IOCTL + + DRESULT disk_ioctl ( + BYTE drv, /* Physical drive number (0) */ + BYTE cmd, /* Control command code */ + void *buff /* Pointer to the conrtol data */ + ) { + DRESULT res; + BYTE n, csd[16], *ptr = (BYTE *)buff; + DWORD *dp, st, ed, csize; + #if _DISKIO_ISDIO + SDIO_CMD *sdio = buff; + BYTE rc, *buf; + UINT dc; + #endif + + if (drv) return RES_PARERR; /* Check parameter */ + if (Stat & STA_NOINIT) return RES_NOTRDY; /* Check if drive is ready */ + + res = RES_ERROR; + FCLK_FAST(); + switch (cmd) { + case CTRL_SYNC: /* Wait for end of internal write process of the drive */ + if (select()) res = RES_OK; + break; + + case GET_SECTOR_COUNT: /* Get drive capacity in unit of sector (DWORD) */ + if ((send_cmd(CMD9, 0) == 0) && rcvr_datablock(csd, 16)) { + if ((csd[0] >> 6) == 1) { /* SDC ver 2.00 */ + csize = csd[9] + ((WORD)csd[8] << 8) + ((DWORD)(csd[7] & 63) << 16) + 1; + *(DWORD*)buff = csize << 10; + } else { /* SDC ver 1.XX or MMC ver 3 */ + n = (csd[5] & 15) + ((csd[10] & 128) >> 7) + ((csd[9] & 3) << 1) + 2; + csize = (csd[8] >> 6) + ((WORD)csd[7] << 2) + ((WORD)(csd[6] & 3) << 10) + 1; + *(DWORD*)buff = csize << (n - 9); + } + res = RES_OK; + } + break; + + case GET_BLOCK_SIZE: /* Get erase block size in unit of sector (DWORD) */ + if (CardType & CT_SD2) { /* SDC ver 2.00 */ + if (send_cmd(ACMD13, 0) == 0) { /* Read SD status */ + xchg_spi(0xFF); + if (rcvr_datablock(csd, 16)) { /* Read partial block */ + for (n = 64 - 16; n; n--) xchg_spi(0xFF); /* Purge trailing data */ + *(DWORD*)buff = 16UL << (csd[10] >> 4); + res = RES_OK; + } + } + } else { /* SDC ver 1.XX or MMC */ + if ((send_cmd(CMD9, 0) == 0) && rcvr_datablock(csd, 16)) { /* Read CSD */ + if (CardType & CT_SD1) { /* SDC ver 1.XX */ + *(DWORD*)buff = (((csd[10] & 63) << 1) + ((WORD)(csd[11] & 128) >> 7) + 1) << ((csd[13] >> 6) - 1); + } else { /* MMC */ + *(DWORD*)buff = ((WORD)((csd[10] & 124) >> 2) + 1) * (((csd[11] & 3) << 3) + ((csd[11] & 224) >> 5) + 1); + } + res = RES_OK; + } + } + break; + + case CTRL_TRIM: /* Erase a block of sectors (used when _USE_TRIM in ffconf.h is 1) */ + if (!(CardType & CT_SDC)) break; /* Check if the card is SDC */ + if (disk_ioctl(drv, MMC_GET_CSD, csd)) break; /* Get CSD */ + if (!(csd[0] >> 6) && !(csd[10] & 0x40)) break; /* Check if sector erase can be applied to the card */ + dp = (DWORD *)buff; st = dp[0]; ed = dp[1]; /* Load sector block */ + if (!(CardType & CT_BLOCK)) { + st *= 512; ed *= 512; + } + if (send_cmd(CMD32, st) == 0 && send_cmd(CMD33, ed) == 0 && send_cmd(CMD38, 0) == 0 && wait_ready(30000)) { /* Erase sector block */ + res = RES_OK; /* FatFs does not check result of this command */ + } + break; + + /* Following commands are never used by FatFs module */ + + case MMC_GET_TYPE: /* Get MMC/SDC type (BYTE) */ + *ptr = CardType; + res = RES_OK; + break; + + case MMC_GET_CSD: /* Read CSD (16 bytes) */ + if (send_cmd(CMD9, 0) == 0 && rcvr_datablock(ptr, 16)) { /* READ_CSD */ + res = RES_OK; + } + break; + + case MMC_GET_CID: /* Read CID (16 bytes) */ + if (send_cmd(CMD10, 0) == 0 && rcvr_datablock(ptr, 16)) { /* READ_CID */ + res = RES_OK; + } + break; + + case MMC_GET_OCR: /* Read OCR (4 bytes) */ + if (send_cmd(CMD58, 0) == 0) { /* READ_OCR */ + for (n = 4; n; n--) *ptr++ = xchg_spi(0xFF); + res = RES_OK; + } + break; + + case MMC_GET_SDSTAT: /* Read SD status (64 bytes) */ + if (send_cmd(ACMD13, 0) == 0) { /* SD_STATUS */ + xchg_spi(0xFF); + if (rcvr_datablock(ptr, 64)) res = RES_OK; + } + break; + + #if _DISKIO_ISDIO + + case ISDIO_READ: + sdio = buff; + if (send_cmd(CMD48, 0x80000000 | sdio->func << 28 | sdio->addr << 9 | ((sdio->ndata - 1) & 0x1FF)) == 0) { + for (Timer1 = 1000; (rc = xchg_spi(0xFF)) == 0xFF && Timer1; ) ; + if (rc == 0xFE) { + for (buf = sdio->data, dc = sdio->ndata; dc; dc--) *buf++ = xchg_spi(0xFF); + for (dc = 514 - sdio->ndata; dc; dc--) xchg_spi(0xFF); + res = RES_OK; + } + } + break; + case ISDIO_WRITE: + sdio = buff; + if (send_cmd(CMD49, 0x80000000 | sdio->func << 28 | sdio->addr << 9 | ((sdio->ndata - 1) & 0x1FF)) == 0) { + xchg_spi(0xFF); xchg_spi(0xFE); + for (buf = sdio->data, dc = sdio->ndata; dc; dc--) xchg_spi(*buf++); + for (dc = 514 - sdio->ndata; dc; dc--) xchg_spi(0xFF); + if ((xchg_spi(0xFF) & 0x1F) == 0x05) res = RES_OK; + } + break; + case ISDIO_MRITE: + sdio = buff; + if (send_cmd(CMD49, 0x84000000 | sdio->func << 28 | sdio->addr << 9 | sdio->ndata >> 8) == 0) { + xchg_spi(0xFF); xchg_spi(0xFE); + xchg_spi(sdio->ndata); + for (dc = 513; dc; dc--) xchg_spi(0xFF); + if ((xchg_spi(0xFF) & 0x1F) == 0x05) res = RES_OK; + } + break; + + #endif // _DISKIO_ISDIO + + default: res = RES_PARERR; + } + + deselect(); + return res; + } + +#endif // _DISKIO_IOCTL + +#endif // HAS_ONBOARD_SD diff --git a/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h b/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h new file mode 100644 index 000000000000..ec73162ba17f --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h @@ -0,0 +1,96 @@ +/*----------------------------------------------------------------------- +/ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] +/ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] +/ * Low level disk interface module include file (C)ChaN, 2015 +/-----------------------------------------------------------------------*/ + +#pragma once + +#define _DISKIO_WRITE 1 /* 1: Enable disk_write function */ +#define _DISKIO_IOCTL 1 /* 1: Enable disk_ioctl fucntion */ +#define _DISKIO_ISDIO 0 /* 1: Enable iSDIO control fucntion */ + +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef unsigned long DWORD; +typedef unsigned int UINT; + +/* Status of Disk Functions */ +typedef BYTE DSTATUS; + +/* Results of Disk Functions */ +typedef enum { + RES_OK = 0, /* 0: Successful */ + RES_ERROR, /* 1: R/W Error */ + RES_WRPRT, /* 2: Write Protected */ + RES_NOTRDY, /* 3: Not Ready */ + RES_PARERR /* 4: Invalid Parameter */ +} DRESULT; + + +#if _DISKIO_ISDIO +/* Command structure for iSDIO ioctl command */ +typedef struct { + BYTE func; /* Function number: 0..7 */ + WORD ndata; /* Number of bytes to transfer: 1..512, or mask + data */ + DWORD addr; /* Register address: 0..0x1FFFF */ + void* data; /* Pointer to the data (to be written | read buffer) */ +} SDIO_CMD; +#endif + +/*---------------------------------------*/ +/* Prototypes for disk control functions */ + +DSTATUS disk_initialize(BYTE pdrv); +DSTATUS disk_status(BYTE pdrv); +DRESULT disk_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count); +#if _DISKIO_WRITE + DRESULT disk_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); +#endif +#if _DISKIO_IOCTL + DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void* buff); +#endif + +/* Disk Status Bits (DSTATUS) */ +#define STA_NOINIT 0x01 /* Drive not initialized */ +#define STA_NODISK 0x02 /* No medium in the drive */ +#define STA_PROTECT 0x04 /* Write protected */ + +/* Command code for disk_ioctrl fucntion */ + +/* Generic command (Used by FatFs) */ +#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */ +#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */ +#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */ +#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */ +#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */ + +/* Generic command (Not used by FatFs) */ +#define CTRL_FORMAT 5 /* Create physical format on the media */ +#define CTRL_POWER_IDLE 6 /* Put the device idle state */ +#define CTRL_POWER_OFF 7 /* Put the device off state */ +#define CTRL_LOCK 8 /* Lock media removal */ +#define CTRL_UNLOCK 9 /* Unlock media removal */ +#define CTRL_EJECT 10 /* Eject media */ + +/* MMC/SDC specific ioctl command (Not used by FatFs) */ +#define MMC_GET_TYPE 50 /* Get card type */ +#define MMC_GET_CSD 51 /* Get CSD */ +#define MMC_GET_CID 52 /* Get CID */ +#define MMC_GET_OCR 53 /* Get OCR */ +#define MMC_GET_SDSTAT 54 /* Get SD status */ +#define ISDIO_READ 55 /* Read data form SD iSDIO register */ +#define ISDIO_WRITE 56 /* Write data to SD iSDIO register */ +#define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */ + +/* ATA/CF specific ioctl command (Not used by FatFs) */ +#define ATA_GET_REV 60 /* Get F/W revision */ +#define ATA_GET_MODEL 61 /* Get model name */ +#define ATA_GET_SN 62 /* Get serial number */ + +/* MMC card type flags (MMC_GET_TYPE) */ +#define CT_MMC 0x01 /* MMC ver 3 */ +#define CT_SD1 0x02 /* SD ver 1 */ +#define CT_SD2 0x04 /* SD ver 2 */ +#define CT_SDC (CT_SD1|CT_SD2) /* SD */ +#define CT_BLOCK 0x08 /* Block addressing */ diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp index b4ef57e1daa5..babcdeaee31a 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp @@ -26,7 +26,18 @@ #include "../shared/persistent_store_api.h" -bool PersistentStore::access_start() { return true; } +bool PersistentStore::access_start() { + #if ENABLED(SPI_EEPROM) + #if SPI_CHAN_EEPROM1 == 1 + SET_OUTPUT(BOARD_SPI1_SCK_PIN); + SET_OUTPUT(BOARD_SPI1_MOSI_PIN); + SET_INPUT(BOARD_SPI1_MISO_PIN); + SET_OUTPUT(SPI_EEPROM1_CS); + #endif + spiInit(0); + #endif + return true; +} bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { @@ -49,10 +60,10 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool set/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (set && value) *value = c; + if (writing && value) *value = c; crc16(crc, &c, 1); pos++; value++; diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp index 4e73d0564eb3..bbca1cb3912d 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp @@ -40,69 +40,73 @@ #include // Store settings in the last two pages -// Flash pages must be erased before writing, so keep track. -bool firstWrite = false; -uint32_t pageBase = EEPROM_START_ADDRESS; +#define EEPROM_SIZE (EEPROM_PAGE_SIZE * 2) +#define ACCESS_FINISHED(TF) do{ FLASH_Lock(); eeprom_dirty = false; return TF; }while(0) + +static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0}; +static bool eeprom_dirty = false; bool PersistentStore::access_start() { - firstWrite = true; + const uint32_t* source = reinterpret_cast(EEPROM_PAGE0_BASE); + uint32_t* destination = reinterpret_cast(ram_eeprom); + + static_assert(0 == EEPROM_SIZE % 4, "EEPROM_SIZE is corrupted. (Must be a multiple of 4.)"); // Ensure copying as uint32_t is safe + constexpr size_t eeprom_size_u32 = EEPROM_SIZE / 4; + + for (size_t i = 0; i < eeprom_size_u32; ++i, ++destination, ++source) + *destination = *source; + + eeprom_dirty = false; return true; } bool PersistentStore::access_finish() { - FLASH_Lock(); - firstWrite = false; - return true; -} -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { - FLASH_Status status; + if (eeprom_dirty) { + FLASH_Status status; - if (firstWrite) { + // Instead of erasing all (both) pages, maybe in the loop we check what page we are in, and if the + // data has changed in that page. We then erase the first time we "detect" a change. In theory, if + // nothing changed in a page, we wouldn't need to erase/write it. + // Or, instead of checking at this point, turn eeprom_dirty into an array of bool the size of number + // of pages. Inside write_data, we set the flag to true at that time if something in that + // page changes...either way, something to look at later. FLASH_Unlock(); + status = FLASH_ErasePage(EEPROM_PAGE0_BASE); - if (status != FLASH_COMPLETE) return true; + if (status != FLASH_COMPLETE) ACCESS_FINISHED(true); status = FLASH_ErasePage(EEPROM_PAGE1_BASE); - if (status != FLASH_COMPLETE) return true; - firstWrite = false; - } + if (status != FLASH_COMPLETE) ACCESS_FINISHED(true); - // First write full words - int i = 0; - int wordsToWrite = size / sizeof(uint16_t); - uint16_t* wordBuffer = (uint16_t *)value; - while (wordsToWrite) { - status = FLASH_ProgramHalfWord(pageBase + pos + (i * 2), wordBuffer[i]); - if (status != FLASH_COMPLETE) return true; - wordsToWrite--; - i++; - } + const uint16_t *source = reinterpret_cast(ram_eeprom); + for (size_t i = 0; i < EEPROM_SIZE; i += 2, ++source) { + if (FLASH_ProgramHalfWord(EEPROM_PAGE0_BASE + i, *source) != FLASH_COMPLETE) + ACCESS_FINISHED(false); + } - // Now, write any remaining single byte - const uint16_t odd = size & 1; - if (odd) { - uint16_t temp = value[size - 1]; - status = FLASH_ProgramHalfWord(pageBase + pos + i, temp); - if (status != FLASH_COMPLETE) return true; + ACCESS_FINISHED(true); } + return true; +} + +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { + for (size_t i = 0; i < size; ++i) ram_eeprom[pos + i] = value[i]; + eeprom_dirty = true; crc16(crc, value, size); - pos += size + odd; - return false; + pos += size; + return false; // return true for any error } bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { - for (uint16_t i = 0; i < size; i++) { - byte* accessPoint = (byte*)(pageBase + pos + i); - uint8_t c = *accessPoint; - if (writing) value[i] = c; - crc16(crc, &c, 1); - } - pos += ((size + 1) & ~1); // i.e., size+(size&1), round up odd values - return false; + const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos]; + if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i]; + crc16(crc, buff, size); + pos += size; + return false; // return true for any error } -size_t PersistentStore::capacity() { return E2END + 1; } +size_t PersistentStore::capacity() { return EEPROM_SIZE; } #endif // EEPROM_SETTINGS && EEPROM FLASH #endif // __STM32F1__ diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp index 32440935779e..38d5803f5810 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp @@ -22,6 +22,7 @@ /** * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) + * Implementation of EEPROM settings in SD Card */ #ifdef __STM32F1__ @@ -33,11 +34,12 @@ #include "../shared/persistent_store_api.h" #ifndef E2END - #define E2END 4095 + #define E2END 0xFFF // 4KB #endif -#define HAL_STM32F1_EEPROM_SIZE (E2END + 1) +#define HAL_EEPROM_SIZE (E2END + 1) -static char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE]; +#define _ALIGN(x) __attribute__ ((aligned(x))) // SDIO uint32_t* compat. +static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; #if ENABLED(SDSUPPORT) @@ -46,30 +48,30 @@ static char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE]; #define EEPROM_FILENAME "eeprom.dat" bool PersistentStore::access_start() { - if (!card.isDetected()) return false; + if (!card.isMounted()) return false; SdFile file, root = card.getroot(); if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) - return false; + return true; // false aborts the save - int16_t bytes_read = file.read(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); + int bytes_read = file.read(HAL_eeprom_data, HAL_EEPROM_SIZE); if (bytes_read < 0) return false; - for (; bytes_read < HAL_STM32F1_EEPROM_SIZE; bytes_read++) - HAL_STM32F1_eeprom_content[bytes_read] = 0xFF; + for (; bytes_read < HAL_EEPROM_SIZE; bytes_read++) + HAL_eeprom_data[bytes_read] = 0xFF; file.close(); return true; } bool PersistentStore::access_finish() { - if (!card.isDetected()) return false; + if (!card.isMounted()) return false; SdFile file, root = card.getroot(); - int16_t bytes_written = 0; + int bytes_written = 0; if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) { - bytes_written = file.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); + bytes_written = file.write(HAL_eeprom_data, HAL_EEPROM_SIZE); file.close(); } - return (bytes_written == HAL_STM32F1_EEPROM_SIZE); + return (bytes_written == HAL_EEPROM_SIZE); } #else // !SDSUPPORT @@ -78,9 +80,9 @@ static char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE]; #endif // !SDSUPPORT -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { for (size_t i = 0; i < size; i++) - HAL_STM32F1_eeprom_content[pos + i] = value[i]; + HAL_eeprom_data[pos + i] = value[i]; crc16(crc, value, size); pos += size; return false; @@ -88,7 +90,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t si bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) { for (size_t i = 0; i < size; i++) { - uint8_t c = HAL_STM32F1_eeprom_content[pos + i]; + uint8_t c = HAL_eeprom_data[pos + i]; if (writing) value[i] = c; crc16(crc, &c, 1); } @@ -96,7 +98,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin return false; } -size_t PersistentStore::capacity() { return HAL_STM32F1_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; } #endif // EEPROM_SETTINGS diff --git a/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h b/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h index b7f75343a26b..a8b632870aa9 100644 --- a/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h +++ b/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h @@ -16,112 +16,12 @@ * along with this program. If not, see . * */ - -/** - * Support routines for STM32F1 - */ -#ifdef __STM32F1__ - -/** - * Translation of routines & variables used by pinsDebug.h - */ -#include "fastio_STM32F1.h" - -extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]; - -#define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS -#define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS -#define VALID_PIN(pin) (pin >= 0 && pin < BOARD_NR_GPIO_PINS) -#define GET_ARRAY_PIN(p) pin_t(pin_array[p].pin) -#define pwm_status(pin) PWM_PIN(pin) -#define digitalRead_mod(p) extDigitalRead(p) -#define NAME_FORMAT(p) PSTR("%-##p##s") -#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0) -#define PRINT_PORT(p) print_port(p) -#define PRINT_ARRAY_NAME(x) do {sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer);} while (0) -#define MULTI_NAME_PAD 20 // spaces needed to be pretty if not first name assigned to a pin - -// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities -#ifndef M43_NEVER_TOUCH - #define M43_NEVER_TOUCH(Q) (Q >= 9 && Q <= 12) // SERIAL/USB pins PA9(TX) PA10(RX) +#pragma once + +#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) + #include "../HAL_STM32/pinsDebug_STM32duino.h" +#elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) + #include "../HAL_STM32/pinsDebug_STM32GENERIC.h" +#else + #error "M43 not supported for this board" #endif - -static inline int8_t get_pin_mode(pin_t pin) { - return VALID_PIN(pin) ? _GET_MODE(pin) : -1; -} - -static inline pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { - if (!VALID_PIN(pin)) return -1; - int8_t adc_channel = int8_t(PIN_MAP[pin].adc_channel); - #ifdef NUM_ANALOG_INPUTS - if (adc_channel >= NUM_ANALOG_INPUTS) adc_channel = ADCx; - #endif - return pin_t(adc_channel); -} - -static inline bool IS_ANALOG(pin_t pin) { - if (!VALID_PIN(pin)) return false; - if (PIN_MAP[pin].adc_channel != ADCx) { - #ifdef NUM_ANALOG_INPUTS - if (PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS) return false; - #endif - return _GET_MODE(pin) == GPIO_INPUT_ANALOG && !M43_NEVER_TOUCH(pin); - } - return false; -} - -static inline bool GET_PINMODE(pin_t pin) { - return VALID_PIN(pin) ? !IS_INPUT(pin) : false; -} - -static inline bool GET_ARRAY_IS_DIGITAL(int16_t array_pin) { - pin_t pin = GET_ARRAY_PIN(array_pin); - bool isDigital = !IS_ANALOG(pin); - #ifdef NUM_ANALOG_INPUTS - if (!isDigital && PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS) - isDigital = true; - #endif - return isDigital; -} - -static inline void pwm_details(pin_t pin) { - if (PWM_PIN(pin)) { - char buffer[16], num = '?'; - timer_dev * const tdev = PIN_MAP[pin].timer_device; - const uint8_t channel = PIN_MAP[pin].timer_channel; - if (tdev == &timer1) num = '1'; - else if (tdev == &timer1) num = '1'; - else if (tdev == &timer2) num = '2'; - else if (tdev == &timer3) num = '3'; - else if (tdev == &timer4) num = '4'; - #ifdef STM32_HIGH_DENSITY - else if (tdev == &timer5) num = '5'; - else if (tdev == &timer8) num = '8'; - #endif - sprintf_P(buffer, PSTR(" TIM%c CH%c"), num, ('0' + channel)); - SERIAL_ECHO(buffer); - } -} - -static inline void print_port(pin_t pin) { - char buffer[8]; - char port = 'A' + char(pin >> 4); // pin div 16 - /* seems not to be required for our devices - gpio_dev* gp = PIN_MAP[pin].gpio_device; - if (gp == &gpioa) port = 'A'; - else if (gp == &gpiob) port = 'B'; - else if (gp == &gpioc) port = 'C'; - else if (gp == &gpiod) port = 'D'; - #if STM32_NR_GPIO_PORTS > 4 - else if (gp == &gpioe) port = 'E'; - else if (gp == &gpiof) port = 'F'; - else if (gp == &gpiog) port = 'G'; - #endif - */ - const int16_t gbit = PIN_MAP[pin].gpio_bit; - sprintf_P(buffer, PSTR("P%c%hd "), port, gbit); - if (gbit < 10) SERIAL_CHAR(' '); - SERIAL_ECHO(buffer); -} - -#endif // __STM32F1__ diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.cpp b/Marlin/src/HAL/HAL_STM32F1/sdio.cpp similarity index 91% rename from Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.cpp rename to Marlin/src/HAL/HAL_STM32F1/sdio.cpp index 4f90b26e684f..c1cab57a9e9f 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/sdio.cpp @@ -25,13 +25,15 @@ #include +#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density + #if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY) -#include "HAL_sdio_STM32F1.h" +#include "sdio.h" SDIO_CardInfoTypeDef SdCard; -bool SDIO_Init(void) { +bool SDIO_Init() { uint32_t count = 0U; SdCard.CardType = SdCard.CardVersion = SdCard.Class = SdCard.RelCardAdd = SdCard.BlockNbr = SdCard.BlockSize = SdCard.LogBlockNbr = SdCard.LogBlockSize = 0; @@ -105,7 +107,7 @@ bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data) { dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); if (SDIO->STA & SDIO_STA_RXDAVL) { - while (SDIO->STA & SDIO_STA_RXDAVL) (void) SDIO->FIFO; + while (SDIO->STA & SDIO_STA_RXDAVL) (void)SDIO->FIFO; SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); return false; } @@ -124,6 +126,8 @@ bool SDIO_ReadBlock(uint32_t blockAddress, uint8_t *data) { return false; } +uint32_t millis(); + bool SDIO_WriteBlock(uint32_t blockAddress, const uint8_t *data) { if (SDIO_GetCardState() != SDIO_CARD_TRANSFER) return false; if (blockAddress >= SdCard.LogBlockNbr) return false; @@ -163,21 +167,21 @@ bool SDIO_WriteBlock(uint32_t blockAddress, const uint8_t *data) { return false; } -inline uint32_t SDIO_GetCardState(void) { return SDIO_CmdSendStatus(SdCard.RelCardAdd << 16U) ? (SDIO_GetResponse(SDIO_RESP1) >> 9U) & 0x0FU : SDIO_CARD_ERROR; } +inline uint32_t SDIO_GetCardState() { return SDIO_CmdSendStatus(SdCard.RelCardAdd << 16U) ? (SDIO_GetResponse(SDIO_RESP1) >> 9U) & 0x0FU : SDIO_CARD_ERROR; } -// -------------------------------------------------------------------------- +// ------------------------ // SD Commands and Responses -// -------------------------------------------------------------------------- +// ------------------------ void SDIO_SendCommand(uint16_t command, uint32_t argument) { SDIO->ARG = argument; SDIO->CMD = (uint32_t)(SDIO_CMD_CPSMEN | command); } -uint8_t SDIO_GetCommandResponse(void) { return (uint8_t)(SDIO->RESPCMD); } +uint8_t SDIO_GetCommandResponse() { return (uint8_t)(SDIO->RESPCMD); } uint32_t SDIO_GetResponse(uint32_t response) { return SDIO->RESP[response]; } -bool SDIO_CmdGoIdleState(void) { SDIO_SendCommand(CMD0_GO_IDLE_STATE, 0); return SDIO_GetCmdError(); } -bool SDIO_CmdSendCID(void) { SDIO_SendCommand(CMD2_ALL_SEND_CID, 0); return SDIO_GetCmdResp2(); } +bool SDIO_CmdGoIdleState() { SDIO_SendCommand(CMD0_GO_IDLE_STATE, 0); return SDIO_GetCmdError(); } +bool SDIO_CmdSendCID() { SDIO_SendCommand(CMD2_ALL_SEND_CID, 0); return SDIO_GetCmdResp2(); } bool SDIO_CmdSetRelAdd(uint32_t *rca) { SDIO_SendCommand(CMD3_SET_REL_ADDR, 0); return SDIO_GetCmdResp6(SDMMC_CMD_SET_REL_ADDR, rca); } bool SDIO_CmdSelDesel(uint32_t address) { SDIO_SendCommand(CMD7_SEL_DESEL_CARD, address); return SDIO_GetCmdResp1(SDMMC_CMD_SEL_DESEL_CARD); } -bool SDIO_CmdOperCond(void) { SDIO_SendCommand(CMD8_HS_SEND_EXT_CSD, SDMMC_CHECK_PATTERN); return SDIO_GetCmdResp7(); } +bool SDIO_CmdOperCond() { SDIO_SendCommand(CMD8_HS_SEND_EXT_CSD, SDMMC_CHECK_PATTERN); return SDIO_GetCmdResp7(); } bool SDIO_CmdSendCSD(uint32_t argument) { SDIO_SendCommand(CMD9_SEND_CSD, argument); return SDIO_GetCmdResp2(); } bool SDIO_CmdSendStatus(uint32_t argument) { SDIO_SendCommand(CMD13_SEND_STATUS, argument); return SDIO_GetCmdResp1(SDMMC_CMD_SEND_STATUS); } bool SDIO_CmdReadSingleBlock(uint32_t address) { SDIO_SendCommand(CMD17_READ_SINGLE_BLOCK, address); return SDIO_GetCmdResp1(SDMMC_CMD_READ_SINGLE_BLOCK); } @@ -208,7 +212,7 @@ bool SDIO_CmdAppSetClearCardDetect(uint32_t rsa) { do { if (!--count) return false; } while (!SDIO_GET_FLAG(FLAGS)); \ }while(0) -bool SDIO_GetCmdError(void) { +bool SDIO_GetCmdError() { SDIO_WAIT(SDIO_STA_CMDSENT); SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); @@ -228,7 +232,7 @@ bool SDIO_GetCmdResp1(uint8_t command) { return (SDIO_GetResponse(SDIO_RESP1) & SDMMC_OCR_ERRORBITS) == SDMMC_ALLZERO; } -bool SDIO_GetCmdResp2(void) { +bool SDIO_GetCmdResp2() { SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); if (SDIO_GET_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT)) { @@ -240,7 +244,7 @@ bool SDIO_GetCmdResp2(void) { return true; } -bool SDIO_GetCmdResp3(void) { +bool SDIO_GetCmdResp3() { SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) { @@ -268,7 +272,7 @@ bool SDIO_GetCmdResp6(uint8_t command, uint32_t *rca) { return true; } -bool SDIO_GetCmdResp7(void) { +bool SDIO_GetCmdResp7() { SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) { diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h b/Marlin/src/HAL/HAL_STM32F1/sdio.h similarity index 88% rename from Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h rename to Marlin/src/HAL/HAL_STM32F1/sdio.h index 2d4eb5b87977..ca0aced69581 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h +++ b/Marlin/src/HAL/HAL_STM32F1/sdio.h @@ -21,18 +21,14 @@ */ #pragma once -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../shared/Marduino.h" -#include "libmaple/sdio.h" -#include "libmaple/dma.h" +#include +#include -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define SDMMC_CMD_GO_IDLE_STATE ((uint8_t)0) /* Resets the SD memory card. */ #define SDMMC_CMD_ALL_SEND_CID ((uint8_t)2) /* Asks any card connected to the host to send the CID numbers on the CMD line. */ @@ -106,9 +102,9 @@ #define SDIO_CLOCK 18000000 /* 18 MHz */ -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ typedef struct { uint32_t CardType; // Card Type @@ -121,17 +117,17 @@ typedef struct { uint32_t LogBlockSize; // Logical block size in bytes } SDIO_CardInfoTypeDef; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ -inline uint32_t SDIO_GetCardState(void); +inline uint32_t SDIO_GetCardState(); -bool SDIO_CmdGoIdleState(void); -bool SDIO_CmdSendCID(void); +bool SDIO_CmdGoIdleState(); +bool SDIO_CmdSendCID(); bool SDIO_CmdSetRelAdd(uint32_t *rca); bool SDIO_CmdSelDesel(uint32_t address); -bool SDIO_CmdOperCond(void); +bool SDIO_CmdOperCond(); bool SDIO_CmdSendCSD(uint32_t argument); bool SDIO_CmdSendStatus(uint32_t argument); bool SDIO_CmdReadSingleBlock(uint32_t address); @@ -143,11 +139,11 @@ bool SDIO_CmdAppOperCommand(uint32_t sdType); bool SDIO_CmdAppSetClearCardDetect(uint32_t rsa); void SDIO_SendCommand(uint16_t command, uint32_t argument); -uint8_t SDIO_GetCommandResponse(void); +uint8_t SDIO_GetCommandResponse(); uint32_t SDIO_GetResponse(uint32_t response); -bool SDIO_GetCmdError(void); +bool SDIO_GetCmdError(); bool SDIO_GetCmdResp1(uint8_t command); -bool SDIO_GetCmdResp2(void); -bool SDIO_GetCmdResp3(void); +bool SDIO_GetCmdResp2(); +bool SDIO_GetCmdResp3(); bool SDIO_GetCmdResp6(uint8_t command, uint32_t *rca); -bool SDIO_GetCmdResp7(void); +bool SDIO_GetCmdResp7(); diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_timers_STM32F1.cpp b/Marlin/src/HAL/HAL_STM32F1/timers.cpp similarity index 76% rename from Marlin/src/HAL/HAL_STM32F1/HAL_timers_STM32F1.cpp rename to Marlin/src/HAL/HAL_STM32F1/timers.cpp index 8d071dd9c002..051f0323c6bd 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_timers_STM32F1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/timers.cpp @@ -26,45 +26,17 @@ #ifdef __STM32F1__ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - +#include "../../inc/MarlinConfig.h" #include "HAL.h" +#include "timers.h" -#include "HAL_timers_STM32F1.h" - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- +// ------------------------ -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ /** * Timer_clock1: Prescaler 2 -> 36 MHz @@ -110,7 +82,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { timer_set_prescaler(STEP_TIMER_DEV, (uint16_t)(STEPPER_TIMER_PRESCALE - 1)); timer_set_reload(STEP_TIMER_DEV, 0xFFFF); timer_oc_set_mode(STEP_TIMER_DEV, STEP_TIMER_CHAN, TIMER_OC_MODE_FROZEN, TIMER_OC_NO_PRELOAD); // no output pin change - timer_set_compare(STEP_TIMER_DEV, STEP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (STEPPER_TIMER_RATE / frequency))); + timer_set_compare(STEP_TIMER_DEV, STEP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (STEPPER_TIMER_RATE) / frequency)); timer_no_ARR_preload_ARPE(STEP_TIMER_DEV); // Need to be sure no preload on ARR register timer_attach_interrupt(STEP_TIMER_DEV, STEP_TIMER_CHAN, stepTC_Handler); nvic_irq_set_priority(irq_num, STEP_TIMER_IRQ_PRIO); @@ -123,7 +95,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { timer_set_count(TEMP_TIMER_DEV, 0); timer_set_prescaler(TEMP_TIMER_DEV, (uint16_t)(TEMP_TIMER_PRESCALE - 1)); timer_set_reload(TEMP_TIMER_DEV, 0xFFFF); - timer_set_compare(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), ((F_CPU / TEMP_TIMER_PRESCALE) / frequency))); + timer_set_compare(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (F_CPU) / (TEMP_TIMER_PRESCALE) / frequency)); timer_attach_interrupt(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, tempTC_Handler); nvic_irq_set_priority(irq_num, TEMP_TIMER_IRQ_PRIO); timer_generate_update(TEMP_TIMER_DEV); diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_timers_STM32F1.h b/Marlin/src/HAL/HAL_STM32F1/timers.h similarity index 81% rename from Marlin/src/HAL/HAL_STM32F1/HAL_timers_STM32F1.h rename to Marlin/src/HAL/HAL_STM32F1/timers.h index 39241bcb8a6b..d5d02a3dc65c 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_timers_STM32F1.h +++ b/Marlin/src/HAL/HAL_STM32F1/timers.h @@ -25,16 +25,13 @@ * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) */ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include #include +#include "../../core/boards.h" -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ /** * TODO: Check and confirm what timer we will use for each Temps and stepper driving. @@ -50,6 +47,20 @@ typedef uint16_t hal_timer_t; #define STEP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts #define TEMP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts +/** + * Note: Timers may be used by platforms and libraries + * + * FAN PWMs: + * With FAN_SOFT_PWM disabled the Temperature class uses + * FANx_PIN timers to generate FAN PWM signals. + * + * Speaker: + * When SPEAKER is enabled, one timer is allocated by maple/tone.cpp. + * - If BEEPER_PIN has a timer channel (and USE_PIN_TIMER is + * defined in tone.cpp) it uses the pin's own timer. + * - Otherwise it uses Timer 8 on boards with STM32_HIGH_DENSITY + * or Timer 4 on other boards. + */ #if defined(MCU_STM32F103CB) || defined(MCU_STM32F103C8) #define STEP_TIMER_NUM 4 // For C8/CB boards, use timer 4 #else @@ -58,7 +69,17 @@ typedef uint16_t hal_timer_t; #define TEMP_TIMER_NUM 2 // index of timer to use for temperature //#define TEMP_TIMER_NUM 4 // 2->4, Timer 2 for Stepper Current PWM #define PULSE_TIMER_NUM STEP_TIMER_NUM -#define SERVO0_TIMER_NUM 1 // SERVO0 or BLTOUCH + +#if MB(BTT_SKR_MINI_E3_V1_0, BIGTREE_SKR_E3_DIP, BTT_SKR_MINI_E3_V1_2, MKS_ROBIN_LITE) + // SKR Mini E3 boards use PA8 as FAN_PIN, so TIMER 1 is used for Fan PWM. + #ifdef STM32_HIGH_DENSITY + #define SERVO0_TIMER_NUM 8 // tone.cpp uses Timer 4 + #else + #define SERVO0_TIMER_NUM 3 // tone.cpp uses Timer 8 + #endif +#else + #define SERVO0_TIMER_NUM 1 // SERVO0 or BLTOUCH +#endif #define STEP_TIMER_IRQ_PRIO 1 #define TEMP_TIMER_IRQ_PRIO 2 @@ -90,27 +111,22 @@ timer_dev* get_timer_dev(int number); // TODO change this -#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void) -#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void) +#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() +#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() -extern "C" void tempTC_Handler(void); -extern "C" void stepTC_Handler(void); +extern "C" void tempTC_Handler(); +extern "C" void stepTC_Handler(); -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- +// ------------------------ +// Public Variables +// ------------------------ +//static HardwareTimer StepperTimer(STEP_TIMER_NUM); +//static HardwareTimer TempTimer(TEMP_TIMER_NUM); -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- -/* -static HardwareTimer StepperTimer(STEP_TIMER_NUM); -static HardwareTimer TempTimer(TEMP_TIMER_NUM); -*/ -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_enable_interrupt(const uint8_t timer_num); diff --git a/Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.cpp b/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp similarity index 93% rename from Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.cpp rename to Marlin/src/HAL/HAL_STM32F1/watchdog.cpp index 69dca326806f..17f5aa9725b7 100644 --- a/Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp @@ -31,16 +31,16 @@ #if ENABLED(USE_WATCHDOG) #include -#include "watchdog_STM32F1.h" +#include "watchdog.h" -void watchdog_reset() { +void HAL_watchdog_refresh() { #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) TOGGLE(LED_PIN); // heartbeat indicator #endif iwdg_feed(); } -void watchdogSetup(void) { +void watchdogSetup() { // do whatever. don't remove this function. } @@ -51,10 +51,9 @@ void watchdogSetup(void) { * * @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0) */ -void watchdog_init(void) { +void watchdog_init() { //iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD); } #endif // USE_WATCHDOG - #endif // __STM32F1__ diff --git a/Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.h b/Marlin/src/HAL/HAL_STM32F1/watchdog.h similarity index 98% rename from Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.h rename to Marlin/src/HAL/HAL_STM32F1/watchdog.h index 4f3a8deb0d3b..21f97dd7a159 100644 --- a/Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.h +++ b/Marlin/src/HAL/HAL_STM32F1/watchdog.h @@ -41,4 +41,4 @@ void watchdog_init(); // Reset watchdog. MUST be called at least every 4 seconds after the // first watchdog_init or STM32F1 will reset. -void watchdog_reset(); +void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.cpp b/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.cpp deleted file mode 100644 index 8bae46777d3d..000000000000 --- a/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.cpp +++ /dev/null @@ -1,569 +0,0 @@ -/** - ****************************************************************************** - * @file EEPROM/EEPROM_Emulation/src/eeprom.c - * @author MCD Application Team - * @version V1.2.6 - * @date 04-November-2016 - * @brief This file provides all the EEPROM emulation firmware functions. - ****************************************************************************** - * @attention - * - *

© Copyright © 2016 STMicroelectronics International N.V. - * All rights reserved.

- * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -/** @addtogroup EEPROM_Emulation - * @{ - */ -#if defined(STM32GENERIC) && (defined(STM32F4)) - -/* Includes ------------------------------------------------------------------*/ -#include "eeprom_emul.h" - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ - -/* Global variable used to store variable value in read sequence */ -uint16_t DataVar = 0; - -/* Virtual address defined by the user: 0xFFFF value is prohibited */ -uint16_t VirtAddVarTab[NB_OF_VAR]; - -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ -static HAL_StatusTypeDef EE_Format(void); -static uint16_t EE_FindValidPage(uint8_t Operation); -static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data); -static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data); -static uint16_t EE_VerifyPageFullyErased(uint32_t Address); - -/** - * @brief Restore the pages to a known good state in case of page's status - * corruption after a power loss. - * @param None. - * @retval - Flash error code: on write Flash error - * - FLASH_COMPLETE: on success - */ -uint16_t EE_Initialize(void) { - uint16_t PageStatus0 = 6, PageStatus1 = 6; - uint16_t VarIdx = 0; - uint16_t EepromStatus = 0, ReadStatus = 0; - int16_t x = -1; - HAL_StatusTypeDef FlashStatus; - uint32_t SectorError = 0; - FLASH_EraseInitTypeDef pEraseInit; - - - /* Get Page0 status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - /* Get Page1 status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - - pEraseInit.TypeErase = TYPEERASE_SECTORS; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - - /* Check for invalid header states and repair if necessary */ - switch (PageStatus0) { - case ERASED: - if (PageStatus1 == VALID_PAGE) { /* Page0 erased, Page1 valid */ - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - } - else if (PageStatus1 == RECEIVE_DATA) { /* Page0 erased, Page1 receive */ - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - /* Mark Page1 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE1_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - else { /* First EEPROM access (Page0&1 are erased) or invalid state -> format EEPROM */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - break; - - case RECEIVE_DATA: - if (PageStatus1 == VALID_PAGE) { /* Page0 receive, Page1 valid */ - /* Transfer data from Page1 to Page0 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - x = VarIdx; - if (VarIdx != x) { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the Page0 */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - /* Mark Page0 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - } - else if (PageStatus1 == ERASED) { /* Page0 receive, Page1 erased */ - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - /* Mark Page0 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - else { /* Invalid state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - break; - - case VALID_PAGE: - if (PageStatus1 == VALID_PAGE) { /* Invalid state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - else if (PageStatus1 == ERASED) { /* Page0 valid, Page1 erased */ - pEraseInit.Sector = PAGE1_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - } - else { /* Page0 valid, Page1 receive */ - /* Transfer data from Page0 to Page1 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - x = VarIdx; - - if (VarIdx != x) { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the Page1 */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - /* Mark Page1 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE1_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - } - break; - - default: /* Any other state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - break; - } - - return HAL_OK; -} - -/** - * @brief Verify if specified page is fully erased. - * @param Address: page address - * This parameter can be one of the following values: - * @arg PAGE0_BASE_ADDRESS: Page0 base address - * @arg PAGE1_BASE_ADDRESS: Page1 base address - * @retval page fully erased status: - * - 0: if Page not erased - * - 1: if Page erased - */ -uint16_t EE_VerifyPageFullyErased(uint32_t Address) { - uint32_t ReadStatus = 1; - uint16_t AddressValue = 0x5555; - /* Check each active page address starting from end */ - while (Address <= PAGE0_END_ADDRESS) { - /* Get the current location content to be compared with virtual address */ - AddressValue = (*(__IO uint16_t*)Address); - /* Compare the read address with the virtual address */ - if (AddressValue != ERASED) { - /* In case variable value is read, reset ReadStatus flag */ - ReadStatus = 0; - break; - } - /* Next address location */ - Address += 4; - } - /* Return ReadStatus value: (0: Page not erased, 1: Sector erased) */ - return ReadStatus; -} - -/** - * @brief Returns the last stored variable data, if found, which correspond to - * the passed virtual address - * @param VirtAddress: Variable virtual address - * @param Data: Global variable contains the read variable value - * @retval Success or error status: - * - 0: if variable was found - * - 1: if the variable was not found - * - NO_VALID_PAGE: if no valid page was found. - */ -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) { - uint16_t ValidPage = PAGE0; - uint16_t AddressValue = 0x5555, ReadStatus = 1; - uint32_t Address = EEPROM_START_ADDRESS, PageStartAddress = EEPROM_START_ADDRESS; - - /* Get active Page for read operation */ - ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) return NO_VALID_PAGE; - - /* Get the valid Page start Address */ - PageStartAddress = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - - /* Get the valid Page end Address */ - Address = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); - - /* Check each active page address starting from end */ - while (Address > (PageStartAddress + 2)) { - /* Get the current location content to be compared with virtual address */ - AddressValue = (*(__IO uint16_t*)Address); - - /* Compare the read address with the virtual address */ - if (AddressValue == VirtAddress) { - /* Get content of Address-2 which is variable value */ - *Data = (*(__IO uint16_t*)(Address - 2)); - /* In case variable value is read, reset ReadStatus flag */ - ReadStatus = 0; - break; - } - else /* Next address location */ - Address -= 4; - } - /* Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) */ - return ReadStatus; -} - -/** - * @brief Writes/upadtes variable data in EEPROM. - * @param VirtAddress: Variable virtual address - * @param Data: 16 bit data to be written - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) { - /* Write the variable virtual address and value in the EEPROM */ - uint16_t Status = EE_VerifyPageFullWriteVariable(VirtAddress, Data); - - /* In case the EEPROM active page is full */ - if (Status == PAGE_FULL) /* Perform Page transfer */ - Status = EE_PageTransfer(VirtAddress, Data); - - /* Return last operation status */ - return Status; -} - -/** - * @brief Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE - * @param None - * @retval Status of the last operation (Flash write or erase) done during - * EEPROM formating - */ -static HAL_StatusTypeDef EE_Format(void) { - HAL_StatusTypeDef FlashStatus = HAL_OK; - uint32_t SectorError = 0; - FLASH_EraseInitTypeDef pEraseInit; - - pEraseInit.TypeErase = FLASH_TYPEERASE_SECTORS; - pEraseInit.Sector = PAGE0_ID; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - /* Erase Page0 */ - if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - /* Set Page0 as valid page: Write VALID_PAGE at Page0 base address */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - pEraseInit.Sector = PAGE1_ID; - /* Erase Page1 */ - if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - } - - return HAL_OK; -} - -/** - * @brief Find valid Page for write or read operation - * @param Operation: operation to achieve on the valid page. - * This parameter can be one of the following values: - * @arg READ_FROM_VALID_PAGE: read operation from valid page - * @arg WRITE_IN_VALID_PAGE: write operation from valid page - * @retval Valid page number (PAGE or PAGE1) or NO_VALID_PAGE in case - * of no valid page was found - */ -static uint16_t EE_FindValidPage(uint8_t Operation) { - uint16_t PageStatus0 = 6, PageStatus1 = 6; - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - - /* Get Page1 actual status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - - /* Write or read operation */ - switch (Operation) { - case WRITE_IN_VALID_PAGE: /* ---- Write operation ---- */ - if (PageStatus1 == VALID_PAGE) { - /* Page0 receiving data */ - if (PageStatus0 == RECEIVE_DATA) return PAGE0; /* Page0 valid */ - else return PAGE1; /* Page1 valid */ - } - else if (PageStatus0 == VALID_PAGE) { - /* Page1 receiving data */ - if (PageStatus1 == RECEIVE_DATA) return PAGE1; /* Page1 valid */ - else return PAGE0; /* Page0 valid */ - } - else - return NO_VALID_PAGE; /* No valid Page */ - - case READ_FROM_VALID_PAGE: /* ---- Read operation ---- */ - if (PageStatus0 == VALID_PAGE) - return PAGE0; /* Page0 valid */ - else if (PageStatus1 == VALID_PAGE) - return PAGE1; /* Page1 valid */ - else - return NO_VALID_PAGE; /* No valid Page */ - - default: - return PAGE0; /* Page0 valid */ - } -} - -/** - * @brief Verify if active page is full and Writes variable in EEPROM. - * @param VirtAddress: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data) { - HAL_StatusTypeDef FlashStatus = HAL_OK; - uint16_t ValidPage = PAGE0; - uint32_t Address = EEPROM_START_ADDRESS, PageEndAddress = EEPROM_START_ADDRESS+PAGE_SIZE; - - /* Get valid Page for write operation */ - ValidPage = EE_FindValidPage(WRITE_IN_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) return NO_VALID_PAGE; - - /* Get the valid Page start Address */ - Address = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - - /* Get the valid Page end Address */ - PageEndAddress = (uint32_t)((EEPROM_START_ADDRESS - 1) + (uint32_t)((ValidPage + 1) * PAGE_SIZE)); - - /* Check each active page address starting from begining */ - while (Address < PageEndAddress) { - /* Verify if Address and Address+2 contents are 0xFFFFFFFF */ - if ((*(__IO uint32_t*)Address) == 0xFFFFFFFF) { - /* Set variable data */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address, Data); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - /* Set variable virtual address */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address + 2, VirtAddress); - /* Return program operation status */ - return FlashStatus; - } - else /* Next address location */ - Address += 4; - } - - /* Return PAGE_FULL in case the valid page is full */ - return PAGE_FULL; -} - -/** - * @brief Transfers last updated variables data from the full Page to - * an empty one. - * @param VirtAddress: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) { - HAL_StatusTypeDef FlashStatus = HAL_OK; - uint32_t NewPageAddress = EEPROM_START_ADDRESS; - uint16_t OldPageId=0; - uint16_t ValidPage = PAGE0, VarIdx = 0; - uint16_t EepromStatus = 0, ReadStatus = 0; - uint32_t SectorError = 0; - FLASH_EraseInitTypeDef pEraseInit; - - /* Get active Page for read operation */ - ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - - if (ValidPage == PAGE1) { /* Page1 valid */ - /* New page address where variable will be moved to */ - NewPageAddress = PAGE0_BASE_ADDRESS; - /* Old page ID where variable will be taken from */ - OldPageId = PAGE1_ID; - } - else if (ValidPage == PAGE0) { /* Page0 valid */ - /* New page address where variable will be moved to */ - NewPageAddress = PAGE1_BASE_ADDRESS; - /* Old page ID where variable will be taken from */ - OldPageId = PAGE0_ID; - } - else - return NO_VALID_PAGE; /* No valid Page */ - - /* Set the new Page status to RECEIVE_DATA status */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, RECEIVE_DATA); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - /* Write the variable passed as parameter in the new active page */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddress, Data); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - - /* Transfer process: transfer variables from old to the new active page */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { - if (VirtAddVarTab[VarIdx] != VirtAddress) { /* Check each variable except the one passed as parameter */ - /* Read the other last variable updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) { - /* Transfer the variable to the new active page */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != HAL_OK) return EepromStatus; - } - } - } - - pEraseInit.TypeErase = TYPEERASE_SECTORS; - pEraseInit.Sector = OldPageId; - pEraseInit.NbSectors = 1; - pEraseInit.VoltageRange = VOLTAGE_RANGE; - - /* Erase the old Page: Set old Page status to ERASED status */ - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - /* Set new Page status to VALID_PAGE status */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - /* Return last operation flash status */ - return FlashStatus; -} - -#endif // STM32F4 || STM32F4xx - -/** - * @} - */ - -/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ diff --git a/Marlin/src/HAL/HAL_STM32F4/EmulatedEeprom.cpp b/Marlin/src/HAL/HAL_STM32F4/EmulatedEeprom.cpp deleted file mode 100644 index 5cd41bd30d62..000000000000 --- a/Marlin/src/HAL/HAL_STM32F4/EmulatedEeprom.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * 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 . - * - */ - -#if defined(STM32GENERIC) && (defined(STM32F4)) - -/** - * Description: functions for I2C connected external EEPROM. - * Not platform dependent. - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM) - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "HAL.h" -#include "EEPROM_Emul/eeprom_emul.h" - - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- -static bool eeprom_initialized = false; -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -// FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to -// FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F4 -// #define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR - -// -------------------------------------------------------------------------- -// EEPROM -// -------------------------------------------------------------------------- - - -void eeprom_init() { - if (!eeprom_initialized) { - HAL_FLASH_Unlock(); - - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - /* EEPROM Init */ - if (EE_Initialize() != EE_OK) - for (;;) HAL_Delay(1); // Spin forever until watchdog reset - - HAL_FLASH_Lock(); - eeprom_initialized = true; - } -} - -void eeprom_write_byte(uint8_t *pos, unsigned char value) { - uint16_t eeprom_address = (unsigned) pos; - - eeprom_init(); - - HAL_FLASH_Unlock(); - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - if (EE_WriteVariable(eeprom_address, (uint16_t) value) != EE_OK) - for (;;) HAL_Delay(1); // Spin forever until watchdog reset - - HAL_FLASH_Lock(); -} - -uint8_t eeprom_read_byte(uint8_t *pos) { - uint16_t data = 0xFF; - uint16_t eeprom_address = (unsigned)pos; - - eeprom_init(); - - if (EE_ReadVariable(eeprom_address, &data) != EE_OK) { - return (unsigned char)data; - } - return (unsigned char)data; -} - -void eeprom_read_block(void *__dst, const void *__src, size_t __n) { - uint16_t data = 0xFF; - uint16_t eeprom_address = (unsigned) __src; - - eeprom_init(); - - for (uint8_t c = 0; c < __n; c++) { - EE_ReadVariable(eeprom_address+c, &data); - *((uint8_t*)__dst + c) = data; - } -} - -void eeprom_update_block(const void *__src, void *__dst, size_t __n) { - -} - -#endif // EEPROM_SETTINGS && (!I2C_EEPROM && !SPI_EEPROM) -#endif // STM32GENERIC && STM32F4 diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL.cpp b/Marlin/src/HAL/HAL_STM32F4/HAL.cpp deleted file mode 100644 index 3fa2aa2250c7..000000000000 --- a/Marlin/src/HAL/HAL_STM32F4/HAL.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ - -#if defined(STM32GENERIC) && defined(STM32F4) - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "HAL.h" - -//#include - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -uint16_t HAL_adc_result; - -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -/* VGPV Done with defines -// disable interrupts -void cli(void) { noInterrupts(); } - -// enable interrupts -void sei(void) { interrupts(); } -*/ - -void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); } - -uint8_t HAL_get_reset_source(void) { - if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG; - - if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE; - if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL; - if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) return RST_POWER_ON; - return 0; -} - -void _delay_ms(const int delay_ms) { delay(delay_ms); } - -extern "C" { - extern unsigned int _ebss; // end of bss section -} - -// return free memory between end of heap (or end bss) and whatever is current - -/* -#include "wirish/syscalls.c" -//extern caddr_t _sbrk(int incr); -#ifndef CONFIG_HEAP_END -extern char _lm_heap_end; -#define CONFIG_HEAP_END ((caddr_t)&_lm_heap_end) -#endif - -extern "C" { - static int freeMemory() { - char top = 't'; - return &top - reinterpret_cast(sbrk(0)); - } - int freeMemory() { - int free_memory; - int heap_end = (int)_sbrk(0); - free_memory = ((int)&free_memory) - ((int)heap_end); - return free_memory; - } -} -*/ - -// -------------------------------------------------------------------------- -// ADC -// -------------------------------------------------------------------------- - -void HAL_adc_start_conversion(const uint8_t adc_pin) { - HAL_adc_result = analogRead(adc_pin); -} - -uint16_t HAL_adc_get_result(void) { - return HAL_adc_result; -} - -#endif // // STM32GENERIC && STM32F4 diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL.h b/Marlin/src/HAL/HAL_STM32F4/HAL.h deleted file mode 100644 index 44fb909598bb..000000000000 --- a/Marlin/src/HAL/HAL_STM32F4/HAL.h +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ -#pragma once - -#define CPU_32_BIT - -#ifndef vsnprintf_P - #define vsnprintf_P vsnprintf -#endif - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" -#include "fastio_STM32F4.h" -#include "watchdog_STM32F4.h" -#include "HAL_timers_STM32F4.h" - -#include "../../inc/MarlinConfigPre.h" - -#include - -#ifdef USBCON - #include -#endif - -// -------------------------------------------------------------------------- -// Defines -// -------------------------------------------------------------------------- - -//Serial override -//extern HalSerial usb_serial; - -#if SERIAL_PORT == 0 - #error "Serial port 0 does not exist" -#endif - -#if !WITHIN(SERIAL_PORT, -1, 6) - #error "SERIAL_PORT must be from -1 to 6" -#endif -#if SERIAL_PORT == -1 - #define MYSERIAL0 SerialUSB -#elif SERIAL_PORT == 1 - #define MYSERIAL0 SerialUART1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 SerialUART2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 SerialUART3 -#elif SERIAL_PORT == 4 - #define MYSERIAL0 SerialUART4 -#elif SERIAL_PORT == 5 - #define MYSERIAL0 SerialUART5 -#elif SERIAL_PORT == 6 - #define MYSERIAL0 SerialUART6 -#endif - -#ifdef SERIAL_PORT_2 - #if SERIAL_PORT_2 == 0 - #error "Serial port 0 does not exist" - #endif - - #if !WITHIN(SERIAL_PORT_2, -1, 6) - #error "SERIAL_PORT_2 must be from -1 to 6" - #elif SERIAL_PORT_2 == SERIAL_PORT - #error "SERIAL_PORT_2 must be different than SERIAL_PORT" - #endif - #define NUM_SERIAL 2 - #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 SerialUSB - #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 SerialUART1 - #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 SerialUART2 - #elif SERIAL_PORT_2 == 3 - #define MYSERIAL1 SerialUART3 - #elif SERIAL_PORT_2 == 4 - #define MYSERIAL1 SerialUART4 - #elif SERIAL_PORT_2 == 5 - #define MYSERIAL1 SerialUART5 - #elif SERIAL_PORT_2 == 6 - #define MYSERIAL1 SerialUART6 - #endif -#else - #define NUM_SERIAL 1 -#endif - -#undef _BV -#define _BV(b) (1 << (b)) - -/** - * TODO: review this to return 1 for pins that are not analog input - */ -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) (p) -#endif - -#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() -#define cli() __disable_irq() -#define sei() __enable_irq() - -// On AVR this is in math.h? -#define square(x) ((x)*(x)) - -#ifndef strncpy_P - #define strncpy_P(dest, src, num) strncpy((dest), (src), (num)) -#endif - -// Fix bug in pgm_read_ptr -#undef pgm_read_ptr -#define pgm_read_ptr(addr) (*(addr)) - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -typedef int8_t pin_t; - -#define HAL_SERVO_LIB libServo - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -/** result of last ADC conversion */ -extern uint16_t HAL_adc_result; - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -// Memory related -#define __bss_end __bss_end__ - -inline void HAL_init(void) { } - -/** clear reset reason */ -void HAL_clear_reset_source (void); - -/** reset reason */ -uint8_t HAL_get_reset_source(void); - -void _delay_ms(const int delay); - -/* -extern "C" { - int freeMemory(void); -} -*/ - -extern "C" char* _sbrk(int incr); - -/* -static int freeMemory() { - volatile int top; - top = (int)((char*)&top - reinterpret_cast(_sbrk(0))); - return top; -} -*/ - -static int freeMemory() { - volatile char top; - return &top - reinterpret_cast(_sbrk(0)); -} - -// -// SPI: Extended functions which take a channel number (hardware SPI only) -// - -/** Write single byte to specified SPI channel */ -void spiSend(uint32_t chan, byte b); -/** Write buffer to specified SPI channel */ -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -/** Read single byte from specified SPI channel */ -uint8_t spiRec(uint32_t chan); - -// -// EEPROM -// - -/** - * TODO: Write all this EEPROM stuff. Can emulate EEPROM in flash as last resort. - * Wire library should work for i2c EEPROMs. - */ -void eeprom_write_byte(uint8_t *pos, unsigned char value); -uint8_t eeprom_read_byte(uint8_t *pos); -void eeprom_read_block (void *__dst, const void *__src, size_t __n); -void eeprom_update_block (const void *__src, void *__dst, size_t __n); - -// -// ADC -// - -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) - -inline void HAL_adc_init(void) {} - -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_result -#define HAL_ADC_READY() true - -void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); - -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) - -#define JTAG_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY) -#define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE) diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.cpp deleted file mode 100644 index 8f1d2603ee9b..000000000000 --- a/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * - * 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 . - * - */ - -#if defined(STM32GENERIC) && defined(STM32F4) - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "HAL.h" - -#include "HAL_timers_STM32F4.h" - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -#define NUM_HARDWARE_TIMERS 2 -#define STEP_TIMER_IRQ_ID TIM5_IRQn -#define TEMP_TIMER_IRQ_ID TIM7_IRQn - -//#define PRESCALER 1 -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -stm32f4_timer_t TimerHandle[NUM_HARDWARE_TIMERS]; - -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -bool timers_initialized[NUM_HARDWARE_TIMERS] = {false}; - -void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { - - if (!timers_initialized[timer_num]) { - constexpr uint32_t step_prescaler = STEPPER_TIMER_PRESCALE - 1, - temp_prescaler = TEMP_TIMER_PRESCALE - 1; - switch (timer_num) { - case STEP_TIMER_NUM: - // STEPPER TIMER TIM5 - use a 32bit timer - #ifdef STM32GENERIC - __HAL_RCC_TIM5_CLK_ENABLE(); - TimerHandle[timer_num].handle.Instance = TIM5; - TimerHandle[timer_num].handle.Init.Prescaler = step_prescaler; - TimerHandle[timer_num].handle.Init.CounterMode = TIM_COUNTERMODE_UP; - TimerHandle[timer_num].handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - TimerHandle[timer_num].callback = (uint32_t)TC5_Handler; - #else - TimerHandle[timer_num].timer = TIM5; - TimerHandle[timer_num].irqHandle = TC5_Handler; - TimerHandleInit(&TimerHandle[timer_num], (((HAL_TIMER_RATE) / step_prescaler) / frequency) - 1, step_prescaler); - #endif - HAL_NVIC_SetPriority(STEP_TIMER_IRQ_ID, 1, 0); - break; - - case TEMP_TIMER_NUM: - // TEMP TIMER TIM7 - any available 16bit Timer (1 already used for PWM) - #ifdef STM32GENERIC - __HAL_RCC_TIM7_CLK_ENABLE(); - TimerHandle[timer_num].handle.Instance = TIM7; - TimerHandle[timer_num].handle.Init.Prescaler = temp_prescaler; - TimerHandle[timer_num].handle.Init.CounterMode = TIM_COUNTERMODE_UP; - TimerHandle[timer_num].handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - TimerHandle[timer_num].callback = (uint32_t)TC7_Handler; - #else - TimerHandle[timer_num].timer = TIM7; - TimerHandle[timer_num].irqHandle = TC7_Handler; - TimerHandleInit(&TimerHandle[timer_num], (((HAL_TIMER_RATE) / temp_prescaler) / frequency) - 1, temp_prescaler); - #endif - HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_ID, 2, 0); - break; - } - timers_initialized[timer_num] = true; - } - - #ifdef STM32GENERIC - TimerHandle[timer_num].handle.Init.Period = (((HAL_TIMER_RATE) / TimerHandle[timer_num].handle.Init.Prescaler) / frequency) - 1; - if (HAL_TIM_Base_Init(&TimerHandle[timer_num].handle) == HAL_OK) - HAL_TIM_Base_Start_IT(&TimerHandle[timer_num].handle); - #endif -} - -#ifdef STM32GENERIC - extern "C" void TIM5_IRQHandler() { - ((void(*)(void))TimerHandle[0].callback)(); - } - extern "C" void TIM7_IRQHandler() { - ((void(*)(void))TimerHandle[1].callback)(); - } -#endif - -void HAL_timer_enable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: HAL_NVIC_EnableIRQ(STEP_TIMER_IRQ_ID); break; - case TEMP_TIMER_NUM: HAL_NVIC_EnableIRQ(TEMP_TIMER_IRQ_ID); break; - } -} - -void HAL_timer_disable_interrupt(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: HAL_NVIC_DisableIRQ(STEP_TIMER_IRQ_ID); break; - case TEMP_TIMER_NUM: HAL_NVIC_DisableIRQ(TEMP_TIMER_IRQ_ID); break; - } - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); -} - -bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { - switch (timer_num) { - case STEP_TIMER_NUM: return NVIC->ISER[(uint32_t)((int32_t)STEP_TIMER_IRQ_ID) >> 5] & (uint32_t)(1 << ((uint32_t)((int32_t)STEP_TIMER_IRQ_ID) & (uint32_t)0x1F)); - case TEMP_TIMER_NUM: return NVIC->ISER[(uint32_t)((int32_t)TEMP_TIMER_IRQ_ID) >> 5] & (uint32_t)(1 << ((uint32_t)((int32_t)TEMP_TIMER_IRQ_ID) & (uint32_t)0x1F)); - } - return false; -} - -#endif // STM32GENERIC && STM32F4 diff --git a/Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h b/Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h deleted file mode 100644 index a657d2c747c0..000000000000 --- a/Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ -#pragma once - -/** - * Fast I/O interfaces for STM32F4 - * These use GPIO functions instead of Direct Port Manipulation, as on AVR. - */ - -#undef _BV -#define _BV(b) (1 << (b)) - -#define READ(IO) digitalRead(IO) -#define WRITE(IO,V) digitalWrite(IO,V) - -#define _GET_MODE(IO) -#define _SET_MODE(IO,M) pinMode(IO, M) -#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */ - -#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -#define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */ -#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */ -#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */ -#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW) -#define SET_PWM(IO) pinMode(IO, PWM) - -#define TOGGLE(IO) OUT_WRITE(IO, !READ(IO)) - -#define IS_INPUT(IO) -#define IS_OUTPUT(IO) - -#define PWM_PIN(P) true - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -// -// Pins Definitions -// -#define PORTA 0 -#define PORTB 1 -#define PORTC 2 -#define PORTD 3 -#define PORTE 4 - -#define _STM32_PIN(_PORT,_PIN) ((PORT##_PORT * 16) + _PIN) - -#define PA0 _STM32_PIN(A, 0) -#define PA1 _STM32_PIN(A, 1) -#define PA2 _STM32_PIN(A, 2) -#define PA3 _STM32_PIN(A, 3) -#define PA4 _STM32_PIN(A, 4) -#define PA5 _STM32_PIN(A, 5) -#define PA6 _STM32_PIN(A, 6) -#define PA7 _STM32_PIN(A, 7) -#define PA8 _STM32_PIN(A, 8) -#define PA9 _STM32_PIN(A, 9) -#define PA10 _STM32_PIN(A, 10) -#define PA11 _STM32_PIN(A, 11) -#define PA12 _STM32_PIN(A, 12) -#define PA13 _STM32_PIN(A, 13) -#define PA14 _STM32_PIN(A, 14) -#define PA15 _STM32_PIN(A, 15) - -#define PB0 _STM32_PIN(B, 0) -#define PB1 _STM32_PIN(B, 1) -#define PB2 _STM32_PIN(B, 2) -#define PB3 _STM32_PIN(B, 3) -#define PB4 _STM32_PIN(B, 4) -#define PB5 _STM32_PIN(B, 5) -#define PB6 _STM32_PIN(B, 6) -#define PB7 _STM32_PIN(B, 7) -#define PB8 _STM32_PIN(B, 8) -#define PB9 _STM32_PIN(B, 9) -#define PB10 _STM32_PIN(B, 10) -#define PB11 _STM32_PIN(B, 11) -#define PB12 _STM32_PIN(B, 12) -#define PB13 _STM32_PIN(B, 13) -#define PB14 _STM32_PIN(B, 14) -#define PB15 _STM32_PIN(B, 15) - -#define PC0 _STM32_PIN(C, 0) -#define PC1 _STM32_PIN(C, 1) -#define PC2 _STM32_PIN(C, 2) -#define PC3 _STM32_PIN(C, 3) -#define PC4 _STM32_PIN(C, 4) -#define PC5 _STM32_PIN(C, 5) -#define PC6 _STM32_PIN(C, 6) -#define PC7 _STM32_PIN(C, 7) -#define PC8 _STM32_PIN(C, 8) -#define PC9 _STM32_PIN(C, 9) -#define PC10 _STM32_PIN(C, 10) -#define PC11 _STM32_PIN(C, 11) -#define PC12 _STM32_PIN(C, 12) -#define PC13 _STM32_PIN(C, 13) -#define PC14 _STM32_PIN(C, 14) -#define PC15 _STM32_PIN(C, 15) - -#define PD0 _STM32_PIN(D, 0) -#define PD1 _STM32_PIN(D, 1) -#define PD2 _STM32_PIN(D, 2) -#define PD3 _STM32_PIN(D, 3) -#define PD4 _STM32_PIN(D, 4) -#define PD5 _STM32_PIN(D, 5) -#define PD6 _STM32_PIN(D, 6) -#define PD7 _STM32_PIN(D, 7) -#define PD8 _STM32_PIN(D, 8) -#define PD9 _STM32_PIN(D, 9) -#define PD10 _STM32_PIN(D, 10) -#define PD11 _STM32_PIN(D, 11) -#define PD12 _STM32_PIN(D, 12) -#define PD13 _STM32_PIN(D, 13) -#define PD14 _STM32_PIN(D, 14) -#define PD15 _STM32_PIN(D, 15) - -#define PE0 _STM32_PIN(E, 0) -#define PE1 _STM32_PIN(E, 1) -#define PE2 _STM32_PIN(E, 2) -#define PE3 _STM32_PIN(E, 3) -#define PE4 _STM32_PIN(E, 4) -#define PE5 _STM32_PIN(E, 5) -#define PE6 _STM32_PIN(E, 6) -#define PE7 _STM32_PIN(E, 7) -#define PE8 _STM32_PIN(E, 8) -#define PE9 _STM32_PIN(E, 9) -#define PE10 _STM32_PIN(E, 10) -#define PE11 _STM32_PIN(E, 11) -#define PE12 _STM32_PIN(E, 12) -#define PE13 _STM32_PIN(E, 13) -#define PE14 _STM32_PIN(E, 14) -#define PE15 _STM32_PIN(E, 15) diff --git a/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp deleted file mode 100644 index 811b1ed9f4ef..000000000000 --- a/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com - * - * 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 . - * - */ - -#if defined(STM32GENERIC) && defined(STM32F4) - -#include "../shared/persistent_store_api.h" - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) - -bool PersistentStore::access_start() { return true; } -bool PersistentStore::access_finish() { return true; } - -bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - return false; -} - -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -size_t PersistentStore::capacity() { return E2END + 1; } - -#endif // EEPROM_SETTINGS -#endif // STM32GENERIC && STM32F4 diff --git a/Marlin/src/HAL/HAL_STM32F4/pinsDebug.h b/Marlin/src/HAL/HAL_STM32F4/pinsDebug.h deleted file mode 100644 index e5022f79a482..000000000000 --- a/Marlin/src/HAL/HAL_STM32F4/pinsDebug.h +++ /dev/null @@ -1 +0,0 @@ -#error Debug pins is not supported on this Platform! diff --git a/Marlin/src/HAL/HAL_STM32F7/EEPROM_Emul/eeprom_emul.h b/Marlin/src/HAL/HAL_STM32F7/EEPROM_Emul/eeprom_emul.h deleted file mode 100644 index 8cffdbef7779..000000000000 --- a/Marlin/src/HAL/HAL_STM32F7/EEPROM_Emul/eeprom_emul.h +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** - * @file eeprom_emul.h - * @author MCD Application Team - * @version V1.2.6 - * @date 04-November-2016 - * @brief This file contains all the functions prototypes for the EEPROM - * emulation firmware library. - ****************************************************************************** - * @attention - * - *

© Copyright © 2016 STMicroelectronics International N.V. - * All rights reserved.

- * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - *****************************************************************************/ -#pragma once - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- -#include "../../../inc/MarlinConfig.h" -#include "../HAL.h" - -/* Exported constants --------------------------------------------------------*/ -/* EEPROM emulation firmware error codes */ -#define EE_OK (uint32_t)HAL_OK -#define EE_ERROR (uint32_t)HAL_ERROR -#define EE_BUSY (uint32_t)HAL_BUSY -#define EE_TIMEOUT (uint32_t)HAL_TIMEOUT - -/* Define the size of the sectors to be used */ -#define PAGE_SIZE (uint32_t)0x4000 /* Page size = 16KByte */ - -/* Device voltage range supposed to be [2.7V to 3.6V], the operation will - be done by word */ -#define VOLTAGE_RANGE (uint8_t)VOLTAGE_RANGE_3 - -/* EEPROM start address in Flash */ -#define EEPROM_START_ADDRESS ((uint32_t)0x08100000) /* EEPROM emulation start address: - from sector2 : after 16KByte of used - Flash memory */ - -/* Pages 0 and 1 base and end addresses */ -#define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000)) -#define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1))) -#define PAGE0_ID FLASH_SECTOR_1 - -#define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x4000)) -#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1))) -#define PAGE1_ID FLASH_SECTOR_2 - -/* Used Flash pages for EEPROM emulation */ -#define PAGE0 ((uint16_t)0x0000) -#define PAGE1 ((uint16_t)0x0001) /* Page nb between PAGE0_BASE_ADDRESS & PAGE1_BASE_ADDRESS*/ - -/* No valid page define */ -#define NO_VALID_PAGE ((uint16_t)0x00AB) - -/* Page status definitions */ -#define ERASED ((uint16_t)0xFFFF) /* Page is empty */ -#define RECEIVE_DATA ((uint16_t)0xEEEE) /* Page is marked to receive data */ -#define VALID_PAGE ((uint16_t)0x0000) /* Page containing valid data */ - -/* Valid pages in read and write defines */ -#define READ_FROM_VALID_PAGE ((uint8_t)0x00) -#define WRITE_IN_VALID_PAGE ((uint8_t)0x01) - -/* Page full define */ -#define PAGE_FULL ((uint8_t)0x80) - -/* Variables' number */ -#define NB_OF_VAR ((uint16_t)4096) - -/* Exported types ------------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -uint16_t EE_Initialize(void); -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data); -uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data); - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/Marlin/src/HAL/HAL_STM32F7/EmulatedEeprom.cpp b/Marlin/src/HAL/HAL_STM32F7/EmulatedEeprom.cpp deleted file mode 100644 index a612b8953802..000000000000 --- a/Marlin/src/HAL/HAL_STM32F7/EmulatedEeprom.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * 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 . - * - */ - -#ifdef STM32F7 - -/** - * Description: functions for I2C connected external EEPROM. - * Not platform dependent. - */ - -#include "../../inc/MarlinConfig.h" - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "HAL.h" -#include "EEPROM_Emul/eeprom_emul.h" - - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- -static bool eeprom_initialized = false; -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -// FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to -// FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F7 -#define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR - -// -------------------------------------------------------------------------- -// EEPROM -// -------------------------------------------------------------------------- - - -void eeprom_init() { - if (!eeprom_initialized) { - HAL_FLASH_Unlock(); - - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - /* EEPROM Init */ - if (EE_Initialize() != EE_OK) - for (;;) HAL_Delay(1); // Spin forever until watchdog reset - - HAL_FLASH_Lock(); - eeprom_initialized = true; - } -} - -void eeprom_write_byte(uint8_t *pos, unsigned char value) { - uint16_t eeprom_address = (unsigned) pos; - - eeprom_init(); - - HAL_FLASH_Unlock(); - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - if (EE_WriteVariable(eeprom_address, (uint16_t) value) != EE_OK) - for (;;) HAL_Delay(1); // Spin forever until watchdog reset - - HAL_FLASH_Lock(); -} - -uint8_t eeprom_read_byte(uint8_t *pos) { - uint16_t data = 0xFF; - uint16_t eeprom_address = (unsigned)pos; - - eeprom_init(); - - if (EE_ReadVariable(eeprom_address, &data) != EE_OK) { - return (unsigned char)data; - } - return (unsigned char)data; -} - -void eeprom_read_block(void *__dst, const void *__src, size_t __n) { - uint16_t data = 0xFF; - uint16_t eeprom_address = (unsigned) __src; - - eeprom_init(); - - for (uint8_t c = 0; c < __n; c++) { - EE_ReadVariable(eeprom_address+c, &data); - *((uint8_t*)__dst + c) = data; - } -} - -void eeprom_update_block(const void *__src, void *__dst, size_t __n) { - -} - -#endif // STM32F7 diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL.cpp b/Marlin/src/HAL/HAL_STM32F7/HAL.cpp deleted file mode 100644 index e266eabf4677..000000000000 --- a/Marlin/src/HAL/HAL_STM32F7/HAL.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com - * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ - -#ifdef STM32F7 - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "HAL.h" - -//#include - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -uint16_t HAL_adc_result; - -// -------------------------------------------------------------------------- -// Private Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -/* VGPV Done with defines -// disable interrupts -void cli(void) { noInterrupts(); } - -// enable interrupts -void sei(void) { interrupts(); } -*/ - -void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); } - -uint8_t HAL_get_reset_source(void) { - if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) - return RST_WATCHDOG; - - if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) - return RST_SOFTWARE; - - if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) - return RST_EXTERNAL; - - if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) - return RST_POWER_ON; - return 0; -} - -void _delay_ms(const int delay_ms) { delay(delay_ms); } - -extern "C" { - extern unsigned int _ebss; // end of bss section -} - -// return free memory between end of heap (or end bss) and whatever is current - -/* -#include "wirish/syscalls.c" -//extern caddr_t _sbrk(int incr); -#ifndef CONFIG_HEAP_END -extern char _lm_heap_end; -#define CONFIG_HEAP_END ((caddr_t)&_lm_heap_end) -#endif - -extern "C" { - static int freeMemory() { - char top = 't'; - return &top - reinterpret_cast(sbrk(0)); - } - int freeMemory() { - int free_memory; - int heap_end = (int)_sbrk(0); - free_memory = ((int)&free_memory) - ((int)heap_end); - return free_memory; - } -} -*/ - -// -------------------------------------------------------------------------- -// ADC -// -------------------------------------------------------------------------- - -void HAL_adc_start_conversion(const uint8_t adc_pin) { - HAL_adc_result = analogRead(adc_pin); -} - -uint16_t HAL_adc_get_result(void) { - return HAL_adc_result; -} - -#endif // STM32F7 diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL_spi_STM32F7.cpp b/Marlin/src/HAL/HAL_STM32F7/HAL_spi_STM32F7.cpp deleted file mode 100644 index 294d90414e03..000000000000 --- a/Marlin/src/HAL/HAL_STM32F7/HAL_spi_STM32F7.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ - -/** - * Software SPI functions originally from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - */ - -/** - * Adapted to the STM32F7 HAL - */ - -#ifdef STM32F7 - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include "HAL.h" -#include "../shared/HAL_SPI.h" -#include -#include "spi_pins.h" -#include "../../core/macros.h" -#include - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -static SPISettings spiConfig; - -// -------------------------------------------------------------------------- -// Public functions -// -------------------------------------------------------------------------- - -#if ENABLED(SOFTWARE_SPI) - // -------------------------------------------------------------------------- - // Software SPI - // -------------------------------------------------------------------------- - #error "Software SPI not supported for STM32F7. Use hardware SPI." - -#else - -// -------------------------------------------------------------------------- -// Hardware SPI -// -------------------------------------------------------------------------- - -/** - * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz - */ - -/** - * @brief Begin SPI port setup - * - * @return Nothing - * - * @details Only configures SS pin since libmaple creates and initialize the SPI object - */ -void spiBegin(void) { - #if !PIN_EXISTS(SS) - #error SS_PIN not defined! - #endif - - OUT_WRITE(SS_PIN, HIGH); -} - -/** Configure SPI for specified SPI speed */ -void spiInit(uint8_t spiRate) { - // Use datarates Marlin uses - uint32_t clock; - switch (spiRate) { - case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000 - case SPI_HALF_SPEED: clock = 5000000; break; - case SPI_QUARTER_SPEED: clock = 2500000; break; - case SPI_EIGHTH_SPEED: clock = 1250000; break; - case SPI_SPEED_5: clock = 625000; break; - case SPI_SPEED_6: clock = 300000; break; - default: - clock = 4000000; // Default from the SPI libarary - } - spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - SPI.begin(); -} - -/** - * @brief Receives a single byte from the SPI port. - * - * @return Byte received - * - * @details - */ -uint8_t spiRec(void) { - SPI.beginTransaction(spiConfig); - uint8_t returnByte = SPI.transfer(0xFF); - SPI.endTransaction(); - return returnByte; -} - -/** - * @brief Receives a number of bytes from the SPI port to a buffer - * - * @param buf Pointer to starting address of buffer to write to. - * @param nbyte Number of bytes to receive. - * @return Nothing - * - * @details Uses DMA - */ -void spiRead(uint8_t* buf, uint16_t nbyte) { - SPI.beginTransaction(spiConfig); - SPI.dmaTransfer(0, const_cast(buf), nbyte); - SPI.endTransaction(); -} - -/** - * @brief Sends a single byte on SPI port - * - * @param b Byte to send - * - * @details - */ -void spiSend(uint8_t b) { - SPI.beginTransaction(spiConfig); - SPI.transfer(b); - SPI.endTransaction(); -} - -/** - * @brief Write token and then write from 512 byte buffer to SPI (for SD card) - * - * @param buf Pointer with buffer start address - * @return Nothing - * - * @details Use DMA - */ -void spiSendBlock(uint8_t token, const uint8_t* buf) { - SPI.beginTransaction(spiConfig); - SPI.transfer(token); - SPI.dmaSend(const_cast(buf), 512); - SPI.endTransaction(); -} - -#endif // SOFTWARE_SPI - -#endif // STM32F7 diff --git a/Marlin/src/HAL/HAL_STM32F7/endstop_interrupts.h b/Marlin/src/HAL/HAL_STM32F7/endstop_interrupts.h deleted file mode 100644 index 86f6d68c59ca..000000000000 --- a/Marlin/src/HAL/HAL_STM32F7/endstop_interrupts.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ -#pragma once - -#include "../../module/endstops.h" - -// One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } - -void setup_endstop_interrupts(void) { - #if HAS_X_MAX - attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_X_MIN - attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MAX - attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Y_MIN - attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MAX - attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN - attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MAX - attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z2_MIN - attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MAX - attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z3_MIN - attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE); - #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); - #endif -} diff --git a/Marlin/src/HAL/HAL_STM32F7/pinsDebug.h b/Marlin/src/HAL/HAL_STM32F7/pinsDebug.h deleted file mode 100644 index e5022f79a482..000000000000 --- a/Marlin/src/HAL/HAL_STM32F7/pinsDebug.h +++ /dev/null @@ -1 +0,0 @@ -#error Debug pins is not supported on this Platform! diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp new file mode 100644 index 000000000000..5e6ae09bf10a --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp @@ -0,0 +1,122 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ + +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) + +/** + * Description: Functions for a Flash emulated EEPROM + * Not platform dependent. + */ + +// Include configs and pins to get all EEPROM flags +#include "../../inc/MarlinConfig.h" + +#ifdef STM32F7 + #define HAS_EMULATED_EEPROM 1 +#else + #define HAS_EMULATED_EEPROM NONE(I2C_EEPROM, SPI_EEPROM) +#endif + +#if HAS_EMULATED_EEPROM && ENABLED(EEPROM_SETTINGS) + +// ------------------------ +// Includes +// ------------------------ + +#include "HAL.h" +#include "eeprom_emul.h" + +// ------------------------ +// Local defines +// ------------------------ + +// FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to +// FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F4/7 + +#ifdef STM32F7 + #define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR +#else + //#define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR +#endif + +// ------------------------ +// Private Variables +// ------------------------ + +static bool eeprom_initialized = false; + +// ------------------------ +// Public functions +// ------------------------ + +void eeprom_init() { + if (!eeprom_initialized) { + HAL_FLASH_Unlock(); + + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); + + /* EEPROM Init */ + if (EE_Initialize() != EE_OK) + for (;;) HAL_Delay(1); // Spin forever until watchdog reset + + HAL_FLASH_Lock(); + eeprom_initialized = true; + } +} + +void eeprom_write_byte(uint8_t *pos, unsigned char value) { + eeprom_init(); + + HAL_FLASH_Unlock(); + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); + + uint16_t eeprom_address = unsigned(pos); + if (EE_WriteVariable(eeprom_address, uint16_t(value)) != EE_OK) + for (;;) HAL_Delay(1); // Spin forever until watchdog reset + + HAL_FLASH_Lock(); +} + +uint8_t eeprom_read_byte(uint8_t *pos) { + eeprom_init(); + + uint16_t data = 0xFF; + uint16_t eeprom_address = unsigned(pos); + (void)EE_ReadVariable(eeprom_address, &data); // Data unchanged on error + + return uint8_t(data); +} + +void eeprom_read_block(void *__dst, const void *__src, size_t __n) { + eeprom_init(); + + uint16_t data = 0xFF; + uint16_t eeprom_address = unsigned(__src); + for (uint8_t c = 0; c < __n; c++) { + EE_ReadVariable(eeprom_address+c, &data); + *((uint8_t*)__dst + c) = data; + } +} + +void eeprom_update_block(const void *__src, void *__dst, size_t __n) { + +} + +#endif // EEPROM_SETTINGS +#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp new file mode 100644 index 000000000000..e24483f642e2 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp @@ -0,0 +1,96 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com + * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com + * Copyright (c) 2017 Victor Perez + * + * 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 . + * + */ + +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) + +#include "HAL.h" + +//#include + +// ------------------------ +// Public Variables +// ------------------------ + +uint16_t HAL_adc_result; + +// ------------------------ +// Public functions +// ------------------------ + +/* VGPV Done with defines +// disable interrupts +void cli() { noInterrupts(); } + +// enable interrupts +void sei() { interrupts(); } +*/ + +void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } + +uint8_t HAL_get_reset_source() { + if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG; + if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE; + if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL; + if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) return RST_POWER_ON; + return 0; +} + +void _delay_ms(const int delay_ms) { delay(delay_ms); } + +extern "C" { + extern unsigned int _ebss; // end of bss section +} + +// return free memory between end of heap (or end bss) and whatever is current + +/* +#include +//extern caddr_t _sbrk(int incr); +#ifndef CONFIG_HEAP_END +extern char _lm_heap_end; +#define CONFIG_HEAP_END ((caddr_t)&_lm_heap_end) +#endif + +extern "C" { + static int freeMemory() { + char top = 't'; + return &top - reinterpret_cast(sbrk(0)); + } + int freeMemory() { + int free_memory; + int heap_end = (int)_sbrk(0); + free_memory = ((int)&free_memory) - ((int)heap_end); + return free_memory; + } +} +*/ + +// ------------------------ +// ADC +// ------------------------ + +void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } + +uint16_t HAL_adc_get_result() { return HAL_adc_result; } + +#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL.h b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h similarity index 70% rename from Marlin/src/HAL/HAL_STM32F7/HAL.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h index be99165111d0..0e44df4d1179 100644 --- a/Marlin/src/HAL/HAL_STM32F7/HAL.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h @@ -24,34 +24,33 @@ #define CPU_32_BIT -#ifndef vsnprintf_P - #define vsnprintf_P vsnprintf -#endif - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include +#include "../../inc/MarlinConfigPre.h" #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_STM32F7.h" -#include "watchdog_STM32F7.h" +#include "fastio.h" +#include "timers.h" +#include "watchdog.h" -#include "HAL_timers_STM32F7.h" +#include -#include "../../inc/MarlinConfigPre.h" +#if defined(STM32F4) && USBCON + #include +#endif -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ //Serial override //extern HalSerial usb_serial; +#if defined(STM32F4) && SERIAL_PORT == 0 + #error "Serial port 0 does not exist" +#endif + #if !WITHIN(SERIAL_PORT, -1, 6) #error "SERIAL_PORT must be from -1 to 6" #endif @@ -72,6 +71,9 @@ #endif #ifdef SERIAL_PORT_2 + #if defined(STM32F4) && SERIAL_PORT_2 == 0 + #error "Serial port 0 does not exist" + #endif #if !WITHIN(SERIAL_PORT_2, -1, 6) #error "SERIAL_PORT_2 must be from -1 to 6" #elif SERIAL_PORT_2 == SERIAL_PORT @@ -97,8 +99,6 @@ #define NUM_SERIAL 1 #endif -#define _BV(b) (1 << (b)) - /** * TODO: review this to return 1 for pins that are not analog input */ @@ -125,88 +125,100 @@ #undef pgm_read_ptr #define pgm_read_ptr(addr) (*(addr)) -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ typedef int8_t pin_t; -// -------------------------------------------------------------------------- +#ifdef STM32F4 + #define HAL_SERVO_LIB libServo +#endif + +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ -/** result of last ADC conversion */ +// Result of last ADC conversion extern uint16_t HAL_adc_result; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ // Memory related #define __bss_end __bss_end__ -inline void HAL_init(void) { } +inline void HAL_init() {} -/** clear reset reason */ -void HAL_clear_reset_source (void); +// Clear reset reason +void HAL_clear_reset_source(); -/** reset reason */ -uint8_t HAL_get_reset_source(void); +// Reset reason +uint8_t HAL_get_reset_source(); void _delay_ms(const int delay); /* extern "C" { - int freeMemory(void); + int freeMemory(); } */ extern "C" char* _sbrk(int incr); + /* -static int freeMemory() { +int freeMemory() { volatile int top; top = (int)((char*)&top - reinterpret_cast(_sbrk(0))); return top; } */ -static int freeMemory() { + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" + +static inline int freeMemory() { volatile char top; return &top - reinterpret_cast(_sbrk(0)); } -// SPI: Extended functions which take a channel number (hardware SPI only) -/** Write single byte to specified SPI channel */ -void spiSend(uint32_t chan, byte b); -/** Write buffer to specified SPI channel */ -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -/** Read single byte from specified SPI channel */ -uint8_t spiRec(uint32_t chan); - +#pragma GCC diagnostic pop +// // EEPROM +// /** - * TODO: Write all this eeprom stuff. Can emulate eeprom in flash as last resort. - * Wire library should work for i2c eeproms. + * TODO: Write all this EEPROM stuff. Can emulate EEPROM in flash as last resort. + * Wire library should work for i2c EEPROMs. */ void eeprom_write_byte(uint8_t *pos, unsigned char value); uint8_t eeprom_read_byte(uint8_t *pos); void eeprom_read_block (void *__dst, const void *__src, size_t __n); void eeprom_update_block (const void *__src, void *__dst, size_t __n); +// // ADC +// #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) -inline void HAL_adc_init(void) {} +inline void HAL_adc_init() {} #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + +#ifdef STM32F4 + #define JTAG_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY) + #define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE) +#endif diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp similarity index 76% rename from Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp index 315995c0166f..2f85182e2033 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp @@ -27,44 +27,38 @@ */ /** - * Adapted to the STM32F4 HAL + * Adapted to the Marlin STM32F4/7 HAL */ -#if defined(STM32GENERIC) && defined(STM32F4) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- +#include "../../inc/MarlinConfig.h" -#include "HAL.h" -#include "../shared/HAL_SPI.h" +#include #include +#include "../shared/HAL_SPI.h" #include "spi_pins.h" -#include "../../core/macros.h" -#include -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ static SPISettings spiConfig; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ #if ENABLED(SOFTWARE_SPI) - - // -------------------------------------------------------------------------- + // ------------------------ // Software SPI - // -------------------------------------------------------------------------- - #error "Software SPI not supported for STM32F4. Use hardware SPI." - + // ------------------------ + #error "Software SPI not supported for STM32F4/7. Use Hardware SPI." #else -// -------------------------------------------------------------------------- +// ------------------------ // Hardware SPI -// -------------------------------------------------------------------------- +// ------------------------ /** * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz @@ -77,8 +71,8 @@ static SPISettings spiConfig; * * @details Only configures SS pin since libmaple creates and initialize the SPI object */ -void spiBegin(void) { - #if !PIN_EXISTS(SS) +void spiBegin() { + #if !defined(SS_PIN) || SS_PIN < 0 #error SS_PIN not defined! #endif @@ -109,7 +103,7 @@ void spiInit(uint8_t spiRate) { * * @details */ -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); @@ -127,13 +121,11 @@ uint8_t spiRec(void) { */ void spiRead(uint8_t* buf, uint16_t nbyte) { SPI.beginTransaction(spiConfig); - #ifdef STM32GENERIC SPI.dmaTransfer(0, const_cast(buf), nbyte); #else SPI.transfer((uint8_t*)buf, nbyte); #endif - SPI.endTransaction(); } @@ -161,16 +153,13 @@ void spiSend(uint8_t b) { void spiSendBlock(uint8_t token, const uint8_t* buf) { SPI.beginTransaction(spiConfig); SPI.transfer(token); - #ifdef STM32GENERIC SPI.dmaSend(const_cast(buf), 512); #else SPI.transfer((uint8_t*)buf, nullptr, 512); #endif - SPI.endTransaction(); } #endif // SOFTWARE_SPI - -#endif // STM32GENERIC && STM32F4 +#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/README.md b/Marlin/src/HAL/HAL_STM32_F4_F7/README.md new file mode 100644 index 000000000000..3b5a9ab02e21 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/README.md @@ -0,0 +1,6 @@ +# This HAL is for... + + - STM32F407 MCU with STM32Generic Arduino core by danieleff. + - STM32F765 board "The Borg" with STM32Generic. + +See the `README.md` files in HAL_STM32F4 and HAL_STM32F7 for the specifics of those hals. diff --git a/Marlin/src/HAL/HAL_STM32F4/README.md b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/README.md similarity index 100% rename from Marlin/src/HAL/HAL_STM32F4/README.md rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/README.md diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp new file mode 100644 index 000000000000..32219962ee75 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp @@ -0,0 +1,117 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com + * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com + * + * 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 . + * + */ + +#if defined(STM32GENERIC) && defined(STM32F4) + +#include "../HAL.h" +#include "timers.h" + +// ------------------------ +// Local defines +// ------------------------ + +#define NUM_HARDWARE_TIMERS 2 +#define STEP_TIMER_IRQ_ID TIM5_IRQn +#define TEMP_TIMER_IRQ_ID TIM7_IRQn + +// ------------------------ +// Private Variables +// ------------------------ + +stm32_timer_t TimerHandle[NUM_HARDWARE_TIMERS]; + +// ------------------------ +// Public functions +// ------------------------ + +bool timers_initialized[NUM_HARDWARE_TIMERS] = {false}; + +void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { + + if (!timers_initialized[timer_num]) { + constexpr uint32_t step_prescaler = STEPPER_TIMER_PRESCALE - 1, + temp_prescaler = TEMP_TIMER_PRESCALE - 1; + switch (timer_num) { + case STEP_TIMER_NUM: + // STEPPER TIMER TIM5 - use a 32bit timer + __HAL_RCC_TIM5_CLK_ENABLE(); + TimerHandle[timer_num].handle.Instance = TIM5; + TimerHandle[timer_num].handle.Init.Prescaler = step_prescaler; + TimerHandle[timer_num].handle.Init.CounterMode = TIM_COUNTERMODE_UP; + TimerHandle[timer_num].handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + TimerHandle[timer_num].callback = (uint32_t)TC5_Handler; + HAL_NVIC_SetPriority(STEP_TIMER_IRQ_ID, 1, 0); + break; + + case TEMP_TIMER_NUM: + // TEMP TIMER TIM7 - any available 16bit Timer (1 already used for PWM) + __HAL_RCC_TIM7_CLK_ENABLE(); + TimerHandle[timer_num].handle.Instance = TIM7; + TimerHandle[timer_num].handle.Init.Prescaler = temp_prescaler; + TimerHandle[timer_num].handle.Init.CounterMode = TIM_COUNTERMODE_UP; + TimerHandle[timer_num].handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + TimerHandle[timer_num].callback = (uint32_t)TC7_Handler; + HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_ID, 2, 0); + break; + } + timers_initialized[timer_num] = true; + } + + TimerHandle[timer_num].handle.Init.Period = (((HAL_TIMER_RATE) / TimerHandle[timer_num].handle.Init.Prescaler) / frequency) - 1; + if (HAL_TIM_Base_Init(&TimerHandle[timer_num].handle) == HAL_OK) + HAL_TIM_Base_Start_IT(&TimerHandle[timer_num].handle); +} + +extern "C" void TIM5_IRQHandler() { + ((void(*)())TimerHandle[0].callback)(); +} +extern "C" void TIM7_IRQHandler() { + ((void(*)())TimerHandle[1].callback)(); +} + +void HAL_timer_enable_interrupt(const uint8_t timer_num) { + switch (timer_num) { + case STEP_TIMER_NUM: HAL_NVIC_EnableIRQ(STEP_TIMER_IRQ_ID); break; + case TEMP_TIMER_NUM: HAL_NVIC_EnableIRQ(TEMP_TIMER_IRQ_ID); break; + } +} + +void HAL_timer_disable_interrupt(const uint8_t timer_num) { + switch (timer_num) { + case STEP_TIMER_NUM: HAL_NVIC_DisableIRQ(STEP_TIMER_IRQ_ID); break; + case TEMP_TIMER_NUM: HAL_NVIC_DisableIRQ(TEMP_TIMER_IRQ_ID); break; + } + // We NEED memory barriers to ensure Interrupts are actually disabled! + // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) + __DSB(); + __ISB(); +} + +bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { + switch (timer_num) { + case STEP_TIMER_NUM: return NVIC->ISER[(uint32_t)((int32_t)STEP_TIMER_IRQ_ID) >> 5] & (uint32_t)(1 << ((uint32_t)((int32_t)STEP_TIMER_IRQ_ID) & (uint32_t)0x1F)); + case TEMP_TIMER_NUM: return NVIC->ISER[(uint32_t)((int32_t)TEMP_TIMER_IRQ_ID) >> 5] & (uint32_t)(1 << ((uint32_t)((int32_t)TEMP_TIMER_IRQ_ID) & (uint32_t)0x1F)); + } + return false; +} + +#endif // STM32GENERIC && STM32F4 diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.h b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h similarity index 82% rename from Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h index 30161bfc4c29..726207fbcfc6 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h @@ -21,15 +21,11 @@ */ #pragma once -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define FORCE_INLINE __attribute__((always_inline)) inline @@ -75,29 +71,29 @@ #endif -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ #ifdef STM32GENERIC typedef struct { TIM_HandleTypeDef handle; uint32_t callback; } tTimerConfig; - typedef tTimerConfig stm32f4_timer_t; + typedef tTimerConfig stm32_timer_t; #else - typedef stimer_t stm32f4_timer_t; + typedef stimer_t stm32_timer_t; #endif -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ -extern stm32f4_timer_t TimerHandle[]; +extern stm32_timer_t TimerHandle[]; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_enable_interrupt(const uint8_t timer_num); diff --git a/Marlin/src/HAL/HAL_STM32F7/README.md b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/README.md similarity index 75% rename from Marlin/src/HAL/HAL_STM32F7/README.md rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/README.md index 2fb39bf25af3..23155b425e31 100644 --- a/Marlin/src/HAL/HAL_STM32F7/README.md +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/README.md @@ -4,7 +4,7 @@ https://github.com/danieleff/STM32GENERIC -but i have not committed the changes needed for the Borg there yet, so please use: +but I haven't committed the changes needed for the Borg there yet, so please use: https://github.com/Spawn32/STM32GENERIC @@ -15,9 +15,9 @@ Download the latest GNU ARM Embedded Toolchain: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads -(The one in Arduino dosen't support STM32F7). +(The one in Arduino doesn't support STM32F7). -Change compiler.path in platform.txt to point to that you downloaded. +Change compiler.path in platform.txt to point to the one you downloaded. # This HAL is in development. # Currently only tested on "The Borg". @@ -25,4 +25,3 @@ Change compiler.path in platform.txt to point to that you downloaded. You will also need the latest Arduino 1.9.0-beta or newer. This HAL is a modified version of Chris Barr's Picoprint STM32F4 HAL, so shouldn't be to hard to get it to work on a F4. - diff --git a/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp similarity index 93% rename from Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp index 99cadbde1687..3117321ac710 100644 --- a/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp @@ -25,22 +25,22 @@ * */ -//#include +#if defined(STM32GENERIC) && defined(STM32F7) -#ifdef STM32F7 +#include "../../../inc/MarlinConfigPre.h" + +#if HAS_DRIVER(TMC2660) #include #include #include "TMC2660.h" -#include "HAL.h" -#include "../../core/serial.h" -#include "../../inc/MarlinConfig.h" -#include "../../Marlin.h" -#include "../../module/stepper_indirection.h" -#include "../../module/printcounter.h" -#include "../../libs/duration_t.h" -#include "../../libs/hex_print_routines.h" +#include "../../../inc/MarlinConfig.h" +#include "../../../Marlin.h" +#include "../../../module/stepper/indirection.h" +#include "../../../module/printcounter.h" +#include "../../../libs/duration_t.h" +#include "../../../libs/hex_print_routines.h" //some default values used in initialization #define DEFAULT_MICROSTEPPING_VALUE 32 @@ -189,7 +189,6 @@ void TMC26XStepper::start() { pinMode(step_pin, OUTPUT); pinMode(dir_pin, OUTPUT); pinMode(cs_pin, OUTPUT); - //SET_OUTPUT(STEPPER_ENABLE_PIN); extDigitalWrite(step_pin, LOW); extDigitalWrite(dir_pin, LOW); extDigitalWrite(cs_pin, HIGH); @@ -227,7 +226,7 @@ void TMC26XStepper::setSpeed(uint16_t whatSpeed) { this->next_step_time = this->last_step_time + this->step_delay; } -uint16_t TMC26XStepper::getSpeed(void) { return this->speed; } +uint16_t TMC26XStepper::getSpeed() { return this->speed; } /** * Moves the motor steps_to_move steps. @@ -247,7 +246,7 @@ char TMC26XStepper::step(int16_t steps_to_move) { return -1; } -char TMC26XStepper::move(void) { +char TMC26XStepper::move() { // decrement the number of steps, moving one step each time: if (this->steps_left > 0) { uint32_t time = micros(); @@ -278,11 +277,11 @@ char TMC26XStepper::move(void) { return 0; } -char TMC26XStepper::isMoving(void) { return this->steps_left > 0; } +char TMC26XStepper::isMoving() { return this->steps_left > 0; } -uint16_t TMC26XStepper::getStepsLeft(void) { return this->steps_left; } +uint16_t TMC26XStepper::getStepsLeft() { return this->steps_left; } -char TMC26XStepper::stop(void) { +char TMC26XStepper::stop() { //note to self if the motor is currently moving char state = isMoving(); //stop the motor @@ -314,10 +313,12 @@ void TMC26XStepper::setCurrent(uint16_t current) { current_scaling = (byte)((resistor_value * mASetting * 32.0 / (0.165 * sq(1000.0))) - 0.5); //theoretically - 1.0 for better rounding it is 0.5 #ifdef TMC_DEBUG0 // crashes SERIAL_ECHOPAIR("\nCS (Vsense=1): ",current_scaling); - } else { - SERIAL_ECHOPAIR("\nCS: ", current_scaling); #endif } + #ifdef TMC_DEBUG0 // crashes + else + SERIAL_ECHOPAIR("\nCS: ", current_scaling); + #endif // do some sanity checks NOMORE(current_scaling, 31); @@ -333,7 +334,7 @@ void TMC26XStepper::setCurrent(uint16_t current) { } } -uint16_t TMC26XStepper::getCurrent(void) { +uint16_t TMC26XStepper::getCurrent() { // Calculate the current according to the datasheet to be on the safe side. // This is not the fastest but the most accurate and illustrative way. float result = (float)(stallguard2_current_register_value & CURRENT_SCALING_PATTERN), @@ -360,7 +361,7 @@ void TMC26XStepper::setStallGuardThreshold(char stallguard_threshold, char stall if (started) send262(stallguard2_current_register_value); } -char TMC26XStepper::getStallGuardThreshold(void) { +char TMC26XStepper::getStallGuardThreshold() { uint32_t stallguard_threshold = stallguard2_current_register_value & STALL_GUARD_VALUE_PATTERN; //shift it down to bit 0 stallguard_threshold >>= 8; @@ -373,7 +374,7 @@ char TMC26XStepper::getStallGuardThreshold(void) { return result; } -char TMC26XStepper::getStallGuardFilter(void) { +char TMC26XStepper::getStallGuardFilter() { if (stallguard2_current_register_value & STALL_GUARD_FILTER_ENABLED) return -1; return 0; @@ -420,7 +421,7 @@ void TMC26XStepper::setMicrosteps(const int16_t in_steps) { /** * returns the effective number of microsteps at the moment */ -int16_t TMC26XStepper::getMicrosteps(void) { return microsteps; } +int16_t TMC26XStepper::getMicrosteps() { return microsteps; } /** * constant_off_time: The off time setting controls the minimum chopper frequency. @@ -622,7 +623,7 @@ void TMC26XStepper::setCoolStepEnabled(boolean enabled) { if (started) send262(cool_step_register_value); } -boolean TMC26XStepper::isCoolStepEnabled(void) { return this->cool_step_enabled; } +boolean TMC26XStepper::isCoolStepEnabled() { return this->cool_step_enabled; } uint16_t TMC26XStepper::getCoolStepLowerSgThreshold() { // We return our internally stored value - in order to provide the correct setting even if cool step is not enabled @@ -630,19 +631,19 @@ uint16_t TMC26XStepper::getCoolStepLowerSgThreshold() { } uint16_t TMC26XStepper::getCoolStepUpperSgThreshold() { - return (uint8_t)((cool_step_register_value & SE_MAX_PATTERN) >> 8) << 5; + return uint8_t((cool_step_register_value & SE_MAX_PATTERN) >> 8) << 5; } uint8_t TMC26XStepper::getCoolStepCurrentIncrementSize() { - return (uint8_t)((cool_step_register_value & CURRENT_DOWN_STEP_SPEED_PATTERN) >> 13); + return uint8_t((cool_step_register_value & CURRENT_DOWN_STEP_SPEED_PATTERN) >> 13); } uint8_t TMC26XStepper::getCoolStepNumberOfSGReadings() { - return (uint8_t)((cool_step_register_value & SE_CURRENT_STEP_WIDTH_PATTERN) >> 5); + return uint8_t((cool_step_register_value & SE_CURRENT_STEP_WIDTH_PATTERN) >> 5); } uint8_t TMC26XStepper::getCoolStepLowerCurrentLimit() { - return (uint8_t)((cool_step_register_value & MINIMUM_CURRENT_FOURTH) >> 15); + return uint8_t((cool_step_register_value & MINIMUM_CURRENT_FOURTH) >> 15); } void TMC26XStepper::setEnabled(boolean enabled) { @@ -683,7 +684,7 @@ void TMC26XStepper::readStatus(char read_value) { send262(driver_configuration_register_value); } -int16_t TMC26XStepper::getMotorPosition(void) { +int16_t TMC26XStepper::getMotorPosition() { //we read it out even if we are not started yet - perhaps it is useful information for somebody readStatus(TMC26X_READOUT_POSITION); return getReadoutValue(); @@ -691,7 +692,7 @@ int16_t TMC26XStepper::getMotorPosition(void) { //reads the StallGuard setting from last status //returns -1 if StallGuard information is not present -int16_t TMC26XStepper::getCurrentStallGuardReading(void) { +int16_t TMC26XStepper::getCurrentStallGuardReading() { //if we don't yet started there cannot be a StallGuard value if (!started) return -1; //not time optimal, but solution optiomal: @@ -700,7 +701,7 @@ int16_t TMC26XStepper::getCurrentStallGuardReading(void) { return getReadoutValue(); } -uint8_t TMC26XStepper::getCurrentCSReading(void) { +uint8_t TMC26XStepper::getCurrentCSReading() { //if we don't yet started there cannot be a StallGuard value if (!started) return 0; //not time optimal, but solution optiomal: @@ -709,7 +710,7 @@ uint8_t TMC26XStepper::getCurrentCSReading(void) { return (getReadoutValue() & 0x1F); } -uint16_t TMC26XStepper::getCurrentCurrent(void) { +uint16_t TMC26XStepper::getCurrentCurrent() { float result = (float)getCurrentCSReading(), resistor_value = (float)this->resistor, voltage = (driver_configuration_register_value & VSENSE)? 0.165 : 0.31; @@ -720,7 +721,7 @@ uint16_t TMC26XStepper::getCurrentCurrent(void) { /** * Return true if the StallGuard threshold has been reached */ -boolean TMC26XStepper::isStallGuardOverThreshold(void) { +boolean TMC26XStepper::isStallGuardOverThreshold() { if (!this->started) return false; return (driver_status_result & STATUS_STALL_GUARD_STATUS); } @@ -731,7 +732,7 @@ boolean TMC26XStepper::isStallGuardOverThreshold(void) { * OVER_TEMPERATURE_SHUTDOWN if the temperature is so hot that the driver is shut down * Any of those levels are not too good. */ -char TMC26XStepper::getOverTemperature(void) { +char TMC26XStepper::getOverTemperature() { if (!this->started) return 0; if (driver_status_result & STATUS_OVER_TEMPERATURE_SHUTDOWN) @@ -744,44 +745,44 @@ char TMC26XStepper::getOverTemperature(void) { } // Is motor channel A shorted to ground -boolean TMC26XStepper::isShortToGroundA(void) { +boolean TMC26XStepper::isShortToGroundA() { if (!this->started) return false; return (driver_status_result & STATUS_SHORT_TO_GROUND_A); } // Is motor channel B shorted to ground -boolean TMC26XStepper::isShortToGroundB(void) { +boolean TMC26XStepper::isShortToGroundB() { if (!this->started) return false; return (driver_status_result & STATUS_SHORT_TO_GROUND_B); } // Is motor channel A connected -boolean TMC26XStepper::isOpenLoadA(void) { +boolean TMC26XStepper::isOpenLoadA() { if (!this->started) return false; return (driver_status_result & STATUS_OPEN_LOAD_A); } // Is motor channel B connected -boolean TMC26XStepper::isOpenLoadB(void) { +boolean TMC26XStepper::isOpenLoadB() { if (!this->started) return false; return (driver_status_result & STATUS_OPEN_LOAD_B); } // Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s -boolean TMC26XStepper::isStandStill(void) { +boolean TMC26XStepper::isStandStill() { if (!this->started) return false; return (driver_status_result & STATUS_STAND_STILL); } //is chopper inactive since 2^20 clock cycles - defaults to ~0,08s -boolean TMC26XStepper::isStallGuardReached(void) { +boolean TMC26XStepper::isStallGuardReached() { if (!this->started) return false; return (driver_status_result & STATUS_STALL_GUARD_STATUS); } //reads the StallGuard setting from last status //returns -1 if StallGuard information is not present -int16_t TMC26XStepper::getReadoutValue(void) { +int16_t TMC26XStepper::getReadoutValue() { return (int)(driver_status_result >> 10); } @@ -793,7 +794,7 @@ boolean TMC26XStepper::isCurrentScalingHalfed() { /** * version() returns the version of the library: */ -int16_t TMC26XStepper::version(void) { return 1; } +int16_t TMC26XStepper::version() { return 1; } void TMC26XStepper::debugLastStatus() { #ifdef TMC_DEBUG1 @@ -830,9 +831,8 @@ void TMC26XStepper::debugLastStatus() { SERIAL_ECHOPAIR("\n Stall Guard value:", value); } else if (readout_config == READ_STALL_GUARD_AND_COOL_STEP) { - int16_t stallGuard = value & 0xF, current = value & 0x1F0; - SERIAL_ECHOPAIR("\n Approx Stall Guard: ", stallGuard); - SERIAL_ECHOPAIR("\n Current level", current); + SERIAL_ECHOPAIR("\n Approx Stall Guard: ", value & 0xF); + SERIAL_ECHOPAIR("\n Current level", value & 0x1F0); } } #endif @@ -895,4 +895,6 @@ inline void TMC26XStepper::send262(uint32_t datagram) { driver_status_result = i_datagram; } -#endif // STM32F7 +#endif // HAS_DRIVER(TMC2660) + +#endif // STM32GENERIC && STM32F7 diff --git a/Marlin/src/HAL/HAL_STM32F7/TMC2660.h b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h similarity index 97% rename from Marlin/src/HAL/HAL_STM32F7/TMC2660.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h index 1b44a4d5f54f..f1d0133a3b14 100644 --- a/Marlin/src/HAL/HAL_STM32F7/TMC2660.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h @@ -140,7 +140,6 @@ class TMC26XStepper { */ void un_start(); - /*! * \brief Set the rotation speed in RPM. * \param whatSpeed the desired speed in RPM. @@ -151,7 +150,7 @@ class TMC26XStepper { * \brief Report the currently selected speed in RPM. * \sa setSpeed() */ - uint16_t getSpeed(void); + uint16_t getSpeed(); /*! * \brief Set the number of microsteps in 2^i values (rounded) up to 256 @@ -171,7 +170,7 @@ class TMC26XStepper { * * \sa setMicrosteps() */ - int16_t getMicrosteps(void); + int16_t getMicrosteps(); /*! * \brief Initiate a movement with the given number of steps. Positive values move in one direction, negative in the other. @@ -205,7 +204,7 @@ class TMC26XStepper { * It is recommended to call this using a hardware timer to ensure regular invocation. * \sa step() */ - char move(void); + char move(); /*! * \brief Check whether the last movement command is done. @@ -214,13 +213,13 @@ class TMC26XStepper { * Used to determine if the motor is ready for new movements. *\sa step(), move() */ - char isMoving(void); + char isMoving(); /*! * \brief Get the number of steps left in the current movement. * \return The number of steps left in the movement. Always positive. */ - uint16_t getStepsLeft(void); + uint16_t getStepsLeft(); /*! * \brief Stop the motor immediately. @@ -228,7 +227,7 @@ class TMC26XStepper { * * This method directly and abruptly stops the motor and may be used as an emergency stop. */ - char stop(void); + char stop(); /*! * \brief Set and configure the classical Constant Off Timer Chopper @@ -310,7 +309,7 @@ class TMC26XStepper { * \return the maximum motor current in milli amps * \sa getCurrentCurrent() */ - uint16_t getCurrent(void); + uint16_t getCurrent(); /*! * \brief set the StallGuard threshold in order to get sensible StallGuard readings. @@ -333,13 +332,13 @@ class TMC26XStepper { * \brief reads out the StallGuard threshold * \return a number between -64 and 63. */ - char getStallGuardThreshold(void); + char getStallGuardThreshold(); /*! * \brief returns the current setting of the StallGuard filter * \return 0 if not set, -1 if set */ - char getStallGuardFilter(void); + char getStallGuardFilter(); /*! * \brief This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature. @@ -412,7 +411,7 @@ class TMC26XStepper { * * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. */ - int16_t getMotorPosition(void); + int16_t getMotorPosition(); /*! * \brief Reads the current StallGuard value. @@ -420,14 +419,14 @@ class TMC26XStepper { * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. */ - int16_t getCurrentStallGuardReading(void); + int16_t getCurrentStallGuardReading(); /*! * \brief Reads the current current setting value as fraction of the maximum current * Returns values between 0 and 31, representing 1/32 to 32/32 (=1) * \sa setCoolStepConfiguration() */ - uint8_t getCurrentCSReading(void); + uint8_t getCurrentCSReading(); /*! @@ -443,7 +442,7 @@ class TMC26XStepper { * may not be the fastest. * \sa getCurrentCSReading(), getResistor(), isCurrentScalingHalfed(), getCurrent() */ - uint16_t getCurrentCurrent(void); + uint16_t getCurrentCurrent(); /*! * \brief checks if there is a StallGuard warning in the last status @@ -453,7 +452,7 @@ class TMC26XStepper { * * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. */ - boolean isStallGuardOverThreshold(void); + boolean isStallGuardOverThreshold(); /*! * \brief Return over temperature status of the last status readout @@ -461,7 +460,7 @@ class TMC26XStepper { * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - char getOverTemperature(void); + char getOverTemperature(); /*! * \brief Is motor channel A shorted to ground detected in the last status readout. @@ -470,7 +469,7 @@ class TMC26XStepper { * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isShortToGroundA(void); + boolean isShortToGroundA(); /*! * \brief Is motor channel B shorted to ground detected in the last status readout. @@ -478,14 +477,14 @@ class TMC26XStepper { * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isShortToGroundB(void); + boolean isShortToGroundB(); /*! * \brief iIs motor channel A connected according to the last statu readout. * \return true is yes, false if not. * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isOpenLoadA(void); + boolean isOpenLoadA(); /*! * \brief iIs motor channel A connected according to the last statu readout. @@ -493,7 +492,7 @@ class TMC26XStepper { * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isOpenLoadB(void); + boolean isOpenLoadB(); /*! * \brief Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s @@ -501,7 +500,7 @@ class TMC26XStepper { * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isStandStill(void); + boolean isStandStill(); /*! * \brief checks if there is a StallGuard warning in the last status @@ -514,7 +513,7 @@ class TMC26XStepper { * * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. */ - boolean isStallGuardReached(void); + boolean isStallGuardReached(); /*! *\brief enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. @@ -550,13 +549,13 @@ class TMC26XStepper { * \brief Prints out all the information that can be found in the last status read out - it does not force a status readout. * The result is printed via Serial */ - void debugLastStatus(void); + void debugLastStatus(); /*! * \brief library version * \return the version number as int. */ - int16_t version(void); + int16_t version(); private: uint16_t steps_left; // The steps the motor has to do to complete the movement diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp similarity index 69% rename from Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp index df4d9c07d24f..5a3b32ef5bce 100644 --- a/Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp @@ -20,56 +20,30 @@ * */ -#ifdef STM32F7 +#if defined(STM32GENERIC) && defined(STM32F7) -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- +#include "../HAL.h" +#include "timers.h" -#include "HAL.h" - -#include "HAL_timers_STM32F7.h" - -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Local defines -// -------------------------------------------------------------------------- +// ------------------------ #define NUM_HARDWARE_TIMERS 2 //#define PRESCALER 1 -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Private Variables -// -------------------------------------------------------------------------- +// ------------------------ tTimerConfig timerConfig[NUM_HARDWARE_TIMERS]; -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- - +// ------------------------ -bool timers_initialized[NUM_HARDWARE_TIMERS] = {false}; +bool timers_initialized[NUM_HARDWARE_TIMERS] = { false }; void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { @@ -85,8 +59,9 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { timerConfig[0].IRQ_Id = TIM5_IRQn; timerConfig[0].callback = (uint32_t)TC5_Handler; HAL_NVIC_SetPriority(timerConfig[0].IRQ_Id, 1, 0); - SET_OUTPUT(STEPPER_ENABLE_PIN); - WRITE(STEPPER_ENABLE_PIN); + #if PIN_EXISTS(STEPPER_ENABLE) + OUT_WRITE(STEPPER_ENABLE_PIN, HIGH); + #endif break; case TEMP_TIMER_NUM: //TEMP TIMER TIM7 // any available 16bit Timer (1 already used for PWM) @@ -111,10 +86,10 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { //forward the interrupt extern "C" void TIM5_IRQHandler() { - ((void(*)(void))timerConfig[0].callback)(); + ((void(*)())timerConfig[0].callback)(); } extern "C" void TIM7_IRQHandler() { - ((void(*)(void))timerConfig[1].callback)(); + ((void(*)())timerConfig[1].callback)(); } void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) { @@ -153,4 +128,4 @@ bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { return NVIC->ISER[IRQ_Id >> 5] & _BV32(IRQ_Id & 0x1F); } -#endif // STM32F7 +#endif // STM32GENERIC && STM32F7 diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.h b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h similarity index 81% rename from Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h index 01fb02d17866..38ecde30bb94 100644 --- a/Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h @@ -21,15 +21,11 @@ */ #pragma once -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define FORCE_INLINE __attribute__((always_inline)) inline @@ -61,17 +57,17 @@ #define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) #define TEMP_ISR_ENABLED() HAL_timer_interrupt_enabled(TEMP_TIMER_NUM) -// TODO change this +// TODO change this extern void TC5_Handler(); extern void TC7_Handler(); #define HAL_STEP_TIMER_ISR() void TC5_Handler() #define HAL_TEMP_TIMER_ISR() void TC7_Handler() -// -------------------------------------------------------------------------- +// ------------------------ // Types -// -------------------------------------------------------------------------- +// ------------------------ typedef struct { TIM_HandleTypeDef timerdef; @@ -79,15 +75,15 @@ typedef struct { uint32_t callback; } tTimerConfig; -// -------------------------------------------------------------------------- +// ------------------------ // Public Variables -// -------------------------------------------------------------------------- +// ------------------------ //extern const tTimerConfig timerConfig[]; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- +// ------------------------ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_enable_interrupt(const uint8_t timer_num); diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp similarity index 79% rename from Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp index d8545cc9e0e6..b3aac77615d4 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp @@ -21,33 +21,34 @@ * */ -#if defined(STM32GENERIC) && defined(STM32F4) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) #include "../../inc/MarlinConfig.h" #if HAS_SERVOS -#include "HAL_Servo_STM32F4.h" +#include "Servo.h" int8_t libServo::attach(const int pin) { - return Servo::attach(pin); + if (servoIndex >= MAX_SERVOS) return -1; + return super::attach(pin); } int8_t libServo::attach(const int pin, const int min, const int max) { - return Servo::attach(pin, min, max); + return super::attach(pin, min, max); } void libServo::move(const 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]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } -#endif // HAS_SERVOS -#endif // STM32GENERIC && STM32F4 +#endif // HAS_SERVOS +#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.h b/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h similarity index 90% rename from Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h index a782c130e42f..64fa05025c7c 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h @@ -22,7 +22,11 @@ */ #pragma once -#include +//#ifdef STM32F7 +// #include <../../libraries/Servo/src/Servo.h> +//#else + #include +//#endif // Inherit and expand on the official library class libServo : public Servo { @@ -31,6 +35,7 @@ class libServo : public Servo { int8_t attach(const int pin, const int min, const int max); void move(const int value); private: + typedef Servo super; uint16_t min_ticks, max_ticks; uint8_t servoIndex; // index into the channel data for this servo }; diff --git a/Marlin/src/HAL/HAL_STM32F7/EEPROM_Emul/eeprom_emul.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp similarity index 74% rename from Marlin/src/HAL/HAL_STM32F7/EEPROM_Emul/eeprom_emul.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp index 10b3219e9ab4..3358fa3df713 100644 --- a/Marlin/src/HAL/HAL_STM32F7/EEPROM_Emul/eeprom_emul.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp @@ -8,8 +8,8 @@ ****************************************************************************** * @attention * - *

© Copyright 2016 STMicroelectronics International N.V. - * All rights reserved.

+ * Copyright © 2016 STMicroelectronics International N.V. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted, provided that the following conditions are met: @@ -47,14 +47,11 @@ /** @addtogroup EEPROM_Emulation * @{ */ -#ifdef STM32F7 +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) /* Includes ------------------------------------------------------------------*/ #include "eeprom_emul.h" -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Global variable used to store variable value in read sequence */ @@ -65,83 +62,75 @@ uint16_t VirtAddVarTab[NB_OF_VAR]; /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -static HAL_StatusTypeDef EE_Format(void); +static HAL_StatusTypeDef EE_Format(); static uint16_t EE_FindValidPage(uint8_t Operation); static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data); static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data); static uint16_t EE_VerifyPageFullyErased(uint32_t Address); -/** + /** * @brief Restore the pages to a known good state in case of page's status * corruption after a power loss. * @param None. * @retval - Flash error code: on write Flash error * - FLASH_COMPLETE: on success */ -uint16_t EE_Initialize(void) { - uint16_t PageStatus0 = 6, PageStatus1 = 6; - uint16_t VarIdx = 0; - uint16_t EepromStatus = 0, ReadStatus = 0; - int16_t x = -1; - HAL_StatusTypeDef FlashStatus; - uint32_t SectorError = 0; - FLASH_EraseInitTypeDef pEraseInit; - - - /* Get Page0 status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - /* Get Page1 status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); +uint16_t EE_Initialize() { + /* Get Page0 and Page1 status */ + uint16_t PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS), + PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); + FLASH_EraseInitTypeDef pEraseInit; pEraseInit.TypeErase = TYPEERASE_SECTORS; pEraseInit.Sector = PAGE0_ID; pEraseInit.NbSectors = 1; pEraseInit.VoltageRange = VOLTAGE_RANGE; + HAL_StatusTypeDef FlashStatus; // = HAL_OK + /* Check for invalid header states and repair if necessary */ + uint32_t SectorError; switch (PageStatus0) { case ERASED: if (PageStatus1 == VALID_PAGE) { /* Page0 erased, Page1 valid */ - /* Erase Page0 */ + /* Erase Page0 */ if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + /* As the last operation, simply return the result */ + return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); } } else if (PageStatus1 == RECEIVE_DATA) { /* Page0 erased, Page1 receive */ /* Erase Page0 */ if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); + HAL_StatusTypeDef fStat = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + if (fStat != HAL_OK) return fStat; } /* Mark Page1 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE1_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + /* As the last operation, simply return the result */ + return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE1_BASE_ADDRESS, VALID_PAGE); } else { /* First EEPROM access (Page0&1 are erased) or invalid state -> format EEPROM */ /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + /* As the last operation, simply return the result */ + return EE_Format(); } break; case RECEIVE_DATA: if (PageStatus1 == VALID_PAGE) { /* Page0 receive, Page1 valid */ /* Transfer data from Page1 to Page0 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { + int16_t x = -1; + for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) x = VarIdx; if (VarIdx != x) { /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); + uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); /* In case variable corresponding to the virtual address was found */ if (ReadStatus != 0x1) { /* Transfer the variable to the Page0 */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); + uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); /* If program operation was failed, a Flash error code is returned */ if (EepromStatus != HAL_OK) return EepromStatus; } @@ -156,9 +145,8 @@ uint16_t EE_Initialize(void) { pEraseInit.VoltageRange = VOLTAGE_RANGE; /* Erase Page1 */ if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + /* As the last operation, simply return the result */ + return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); } } else if (PageStatus1 == ERASED) { /* Page0 receive, Page1 erased */ @@ -167,20 +155,18 @@ uint16_t EE_Initialize(void) { pEraseInit.VoltageRange = VOLTAGE_RANGE; /* Erase Page1 */ if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); + HAL_StatusTypeDef fStat = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + if (fStat != HAL_OK) return fStat; } /* Mark Page0 as valid */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + /* As the last operation, simply return the result */ + return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, PAGE0_BASE_ADDRESS, VALID_PAGE); } else { /* Invalid state -> format eeprom */ /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + /* As the last operation, simply return the result */ + return EE_Format(); } break; @@ -204,17 +190,18 @@ uint16_t EE_Initialize(void) { } else { /* Page0 valid, Page1 receive */ /* Transfer data from Page0 to Page1 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { + int16_t x = -1; + for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) x = VarIdx; if (VarIdx != x) { /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); + uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); /* In case variable corresponding to the virtual address was found */ if (ReadStatus != 0x1) { /* Transfer the variable to the Page1 */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); + uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); /* If program operation was failed, a Flash error code is returned */ if (EepromStatus != HAL_OK) return EepromStatus; } @@ -229,19 +216,16 @@ uint16_t EE_Initialize(void) { pEraseInit.VoltageRange = VOLTAGE_RANGE; /* Erase Page0 */ if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + /* As the last operation, simply return the result */ + return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); } } break; default: /* Any other state -> format eeprom */ /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - break; + /* As the last operation, simply return the result */ + return EE_Format(); } return HAL_OK; @@ -259,11 +243,10 @@ uint16_t EE_Initialize(void) { */ uint16_t EE_VerifyPageFullyErased(uint32_t Address) { uint32_t ReadStatus = 1; - uint16_t AddressValue = 0x5555; /* Check each active page address starting from end */ while (Address <= PAGE0_END_ADDRESS) { /* Get the current location content to be compared with virtual address */ - AddressValue = (*(__IO uint16_t*)Address); + uint16_t AddressValue = (*(__IO uint16_t*)Address); /* Compare the read address with the virtual address */ if (AddressValue != ERASED) { /* In case variable value is read, reset ReadStatus flag */ @@ -288,26 +271,22 @@ uint16_t EE_VerifyPageFullyErased(uint32_t Address) { * - NO_VALID_PAGE: if no valid page was found. */ uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) { - uint16_t ValidPage = PAGE0; - uint16_t AddressValue = 0x5555, ReadStatus = 1; - uint32_t Address = EEPROM_START_ADDRESS, PageStartAddress = EEPROM_START_ADDRESS; + uint16_t ReadStatus = 1; /* Get active Page for read operation */ - ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); + uint16_t ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); /* Check if there is no valid page */ if (ValidPage == NO_VALID_PAGE) return NO_VALID_PAGE; - /* Get the valid Page start Address */ - PageStartAddress = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - - /* Get the valid Page end Address */ - Address = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); + /* Get the valid Page start and end Addresses */ + uint32_t PageStartAddress = uint32_t(EEPROM_START_ADDRESS) + uint32_t(ValidPage * (PAGE_SIZE)), + Address = PageStartAddress + PAGE_SIZE - 2; /* Check each active page address starting from end */ - while (Address > (PageStartAddress + 2)) { + while (Address > PageStartAddress + 2) { /* Get the current location content to be compared with virtual address */ - AddressValue = (*(__IO uint16_t*)Address); + uint16_t AddressValue = (*(__IO uint16_t*)Address); /* Compare the read address with the virtual address */ if (AddressValue == VirtAddress) { @@ -352,17 +331,18 @@ uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) { * @retval Status of the last operation (Flash write or erase) done during * EEPROM formating */ -static HAL_StatusTypeDef EE_Format(void) { - HAL_StatusTypeDef FlashStatus = HAL_OK; - uint32_t SectorError = 0; +static HAL_StatusTypeDef EE_Format() { FLASH_EraseInitTypeDef pEraseInit; - pEraseInit.TypeErase = FLASH_TYPEERASE_SECTORS; pEraseInit.Sector = PAGE0_ID; pEraseInit.NbSectors = 1; pEraseInit.VoltageRange = VOLTAGE_RANGE; + + HAL_StatusTypeDef FlashStatus; // = HAL_OK + /* Erase Page0 */ if (!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) { + uint32_t SectorError; FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); /* If erase operation was failed, a Flash error code is returned */ if (FlashStatus != HAL_OK) return FlashStatus; @@ -375,9 +355,9 @@ static HAL_StatusTypeDef EE_Format(void) { pEraseInit.Sector = PAGE1_ID; /* Erase Page1 */ if (!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) { - FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; + /* As the last operation, just return the result code */ + uint32_t SectorError; + return HAL_FLASHEx_Erase(&pEraseInit, &SectorError); } return HAL_OK; @@ -393,26 +373,20 @@ static HAL_StatusTypeDef EE_Format(void) { * of no valid page was found */ static uint16_t EE_FindValidPage(uint8_t Operation) { - uint16_t PageStatus0 = 6, PageStatus1 = 6; - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - - /* Get Page1 actual status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); + /* Get Page0 and Page1 actual status */ + uint16_t PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS), + PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); /* Write or read operation */ switch (Operation) { case WRITE_IN_VALID_PAGE: /* ---- Write operation ---- */ if (PageStatus1 == VALID_PAGE) { /* Page0 receiving data */ - if (PageStatus0 == RECEIVE_DATA) return PAGE0; /* Page0 valid */ - else return PAGE1; /* Page1 valid */ + return (PageStatus0 == RECEIVE_DATA) ? PAGE0 : PAGE1; } else if (PageStatus0 == VALID_PAGE) { /* Page1 receiving data */ - if (PageStatus1 == RECEIVE_DATA) return PAGE1; /* Page1 valid */ - else return PAGE0; /* Page0 valid */ + return (PageStatus1 == RECEIVE_DATA) ? PAGE1 : PAGE0; } else return NO_VALID_PAGE; /* No valid Page */ @@ -441,34 +415,26 @@ static uint16_t EE_FindValidPage(uint8_t Operation) { * - Flash error code: on write Flash error */ static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data) { - HAL_StatusTypeDef FlashStatus = HAL_OK; - uint16_t ValidPage = PAGE0; - uint32_t Address = EEPROM_START_ADDRESS, PageEndAddress = EEPROM_START_ADDRESS+PAGE_SIZE; - /* Get valid Page for write operation */ - ValidPage = EE_FindValidPage(WRITE_IN_VALID_PAGE); + uint16_t ValidPage = EE_FindValidPage(WRITE_IN_VALID_PAGE); /* Check if there is no valid page */ if (ValidPage == NO_VALID_PAGE) return NO_VALID_PAGE; - /* Get the valid Page start Address */ - Address = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - - /* Get the valid Page end Address */ - PageEndAddress = (uint32_t)((EEPROM_START_ADDRESS - 1) + (uint32_t)((ValidPage + 1) * PAGE_SIZE)); + /* Get the valid Page start and end Addresses */ + uint32_t Address = uint32_t(EEPROM_START_ADDRESS) + uint32_t(ValidPage * (PAGE_SIZE)), + PageEndAddress = Address + PAGE_SIZE - 1; /* Check each active page address starting from begining */ while (Address < PageEndAddress) { /* Verify if Address and Address+2 contents are 0xFFFFFFFF */ if ((*(__IO uint32_t*)Address) == 0xFFFFFFFF) { /* Set variable data */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address, Data); + HAL_StatusTypeDef FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address, Data); /* If program operation was failed, a Flash error code is returned */ if (FlashStatus != HAL_OK) return FlashStatus; - /* Set variable virtual address */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address + 2, VirtAddress); - /* Return program operation status */ - return FlashStatus; + /* Set variable virtual address, return status */ + return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, Address + 2, VirtAddress); } else /* Next address location */ Address += 4; @@ -490,16 +456,10 @@ static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Da * - Flash error code: on write Flash error */ static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) { - HAL_StatusTypeDef FlashStatus = HAL_OK; - uint32_t NewPageAddress = EEPROM_START_ADDRESS; - uint16_t OldPageId=0; - uint16_t ValidPage = PAGE0, VarIdx = 0; - uint16_t EepromStatus = 0, ReadStatus = 0; - uint32_t SectorError = 0; - FLASH_EraseInitTypeDef pEraseInit; - /* Get active Page for read operation */ - ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); + uint16_t ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); + uint32_t NewPageAddress = EEPROM_START_ADDRESS; + uint16_t OldPageId = 0; if (ValidPage == PAGE1) { /* Page1 valid */ /* New page address where variable will be moved to */ @@ -517,20 +477,20 @@ static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) { return NO_VALID_PAGE; /* No valid Page */ /* Set the new Page status to RECEIVE_DATA status */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, RECEIVE_DATA); + HAL_StatusTypeDef FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, RECEIVE_DATA); /* If program operation was failed, a Flash error code is returned */ if (FlashStatus != HAL_OK) return FlashStatus; /* Write the variable passed as parameter in the new active page */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddress, Data); + uint16_t EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddress, Data); /* If program operation was failed, a Flash error code is returned */ if (EepromStatus != HAL_OK) return EepromStatus; /* Transfer process: transfer variables from old to the new active page */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { + for (uint16_t VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) { if (VirtAddVarTab[VarIdx] != VirtAddress) { /* Check each variable except the one passed as parameter */ /* Read the other last variable updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); + uint16_t ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); /* In case variable corresponding to the virtual address was found */ if (ReadStatus != 0x1) { /* Transfer the variable to the new active page */ @@ -541,26 +501,24 @@ static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) { } } + FLASH_EraseInitTypeDef pEraseInit; pEraseInit.TypeErase = TYPEERASE_SECTORS; pEraseInit.Sector = OldPageId; pEraseInit.NbSectors = 1; pEraseInit.VoltageRange = VOLTAGE_RANGE; /* Erase the old Page: Set old Page status to ERASED status */ + uint32_t SectorError; FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); /* If erase operation was failed, a Flash error code is returned */ if (FlashStatus != HAL_OK) return FlashStatus; /* Set new Page status to VALID_PAGE status */ - FlashStatus = HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != HAL_OK) return FlashStatus; - - /* Return last operation flash status */ - return FlashStatus; + /* As the last operation, just return the result code */ + return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, VALID_PAGE); } -#endif // STM32F7 +#endif // STM32GENERIC && (STM32F4 || STM32F7) /** * @} diff --git a/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.h b/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h similarity index 63% rename from Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h index fe0da6387b7c..e4094f8e134a 100644 --- a/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h @@ -8,7 +8,7 @@ ****************************************************************************** * @attention * - *

© Copyright � 2016 STMicroelectronics International N.V. + * Copyright © 2016 STMicroelectronics International N.V. * All rights reserved.

* * Redistribution and use in source and binary forms, with or without @@ -45,65 +45,70 @@ ******************************************************************************/ #pragma once -// -------------------------------------------------------------------------- +// ------------------------ // Includes -// -------------------------------------------------------------------------- -#include "../../../inc/MarlinConfig.h" -#include "../HAL.h" +// ------------------------ + +#include "../../inc/MarlinConfig.h" +#include "HAL.h" /* Exported constants --------------------------------------------------------*/ /* EEPROM emulation firmware error codes */ -#define EE_OK (uint32_t)HAL_OK -#define EE_ERROR (uint32_t)HAL_ERROR -#define EE_BUSY (uint32_t)HAL_BUSY -#define EE_TIMEOUT (uint32_t)HAL_TIMEOUT +#define EE_OK uint32_t(HAL_OK) +#define EE_ERROR uint32_t(HAL_ERROR) +#define EE_BUSY uint32_t(HAL_BUSY) +#define EE_TIMEOUT uint32_t(HAL_TIMEOUT) /* Define the size of the sectors to be used */ -#define PAGE_SIZE (uint32_t)0x4000 /* Page size = 16KByte */ +#define PAGE_SIZE uint32_t(0x4000) /* Page size = 16KByte */ /* Device voltage range supposed to be [2.7V to 3.6V], the operation will be done by word */ -#define VOLTAGE_RANGE (uint8_t)VOLTAGE_RANGE_3 +#define VOLTAGE_RANGE uint8_t(VOLTAGE_RANGE_3) /* EEPROM start address in Flash */ -#define EEPROM_START_ADDRESS ((uint32_t)0x08078000) /* EEPROM emulation start address: - after 480KByte of used Flash memory */ +#ifdef STM32F7 + #define EEPROM_START_ADDRESS uint32_t(0x08100000) /* EEPROM emulation start address: + from sector2 : after 16KByte of used + Flash memory */ +#else + #define EEPROM_START_ADDRESS uint32_t(0x08078000) /* EEPROM emulation start address: + after 480KByte of used Flash memory */ +#endif /* Pages 0 and 1 base and end addresses */ -#define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000)) -#define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1))) -#define PAGE0_ID FLASH_SECTOR_1 +#define PAGE0_BASE_ADDRESS uint32_t(EEPROM_START_ADDRESS + 0x0000) +#define PAGE0_END_ADDRESS uint32_t(EEPROM_START_ADDRESS + PAGE_SIZE - 1) +#define PAGE0_ID FLASH_SECTOR_1 -#define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x4000)) -#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1))) -#define PAGE1_ID FLASH_SECTOR_2 +#define PAGE1_BASE_ADDRESS uint32_t(EEPROM_START_ADDRESS + 0x4000) +#define PAGE1_END_ADDRESS uint32_t(EEPROM_START_ADDRESS + 2 * (PAGE_SIZE) - 1) +#define PAGE1_ID FLASH_SECTOR_2 /* Used Flash pages for EEPROM emulation */ -#define PAGE0 ((uint16_t)0x0000) -#define PAGE1 ((uint16_t)0x0001) /* Page nb between PAGE0_BASE_ADDRESS & PAGE1_BASE_ADDRESS*/ +#define PAGE0 uint16_t(0x0000) +#define PAGE1 uint16_t(0x0001) /* Page nb between PAGE0_BASE_ADDRESS & PAGE1_BASE_ADDRESS*/ /* No valid page define */ -#define NO_VALID_PAGE ((uint16_t)0x00AB) +#define NO_VALID_PAGE uint16_t(0x00AB) /* Page status definitions */ -#define ERASED ((uint16_t)0xFFFF) /* Page is empty */ -#define RECEIVE_DATA ((uint16_t)0xEEEE) /* Page is marked to receive data */ -#define VALID_PAGE ((uint16_t)0x0000) /* Page containing valid data */ +#define ERASED uint16_t(0xFFFF) /* Page is empty */ +#define RECEIVE_DATA uint16_t(0xEEEE) /* Page is marked to receive data */ +#define VALID_PAGE uint16_t(0x0000) /* Page containing valid data */ /* Valid pages in read and write defines */ -#define READ_FROM_VALID_PAGE ((uint8_t)0x00) -#define WRITE_IN_VALID_PAGE ((uint8_t)0x01) +#define READ_FROM_VALID_PAGE uint8_t(0x00) +#define WRITE_IN_VALID_PAGE uint8_t(0x01) /* Page full define */ -#define PAGE_FULL ((uint8_t)0x80) +#define PAGE_FULL uint8_t(0x80) /* Variables' number */ -#define NB_OF_VAR ((uint16_t)4096) +#define NB_OF_VAR uint16_t(4096) -/* Exported types ------------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ -uint16_t EE_Initialize(void); +uint16_t EE_Initialize(); uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data); uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data); diff --git a/Marlin/src/HAL/HAL_STM32F4/endstop_interrupts.h b/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h similarity index 95% rename from Marlin/src/HAL/HAL_STM32F4/endstop_interrupts.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h index 86f6d68c59ca..d0aa731e890d 100644 --- a/Marlin/src/HAL/HAL_STM32F4/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h @@ -25,9 +25,9 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { #if HAS_X_MAX attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); #endif diff --git a/Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h b/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h similarity index 64% rename from Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h index 81f363609fce..1e5ef2ef3085 100644 --- a/Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h @@ -23,11 +23,13 @@ #pragma once /** - * Fast I/O interfaces for STM32F7 + * Fast I/O interfaces for STM32F4/7 * These use GPIO functions instead of Direct Port Manipulation, as on AVR. */ -#define _BV(b) (1 << (b)) +#ifndef PWM + #define PWM OUTPUT +#endif #define READ(IO) digitalRead(IO) #define WRITE(IO,V) digitalWrite(IO,V) @@ -66,123 +68,243 @@ #define PORTF 5 #define PORTG 6 -#define _STM32_PIN(_PORT,_PIN) ((PORT##_PORT * 16) + _PIN) +#define _STM32_PIN(P,PN) ((PORT##P * 16) + PN) +#undef PA0 #define PA0 _STM32_PIN(A, 0) +#undef PA1 #define PA1 _STM32_PIN(A, 1) +#undef PA2 #define PA2 _STM32_PIN(A, 2) +#undef PA3 #define PA3 _STM32_PIN(A, 3) +#undef PA4 #define PA4 _STM32_PIN(A, 4) +#undef PA5 #define PA5 _STM32_PIN(A, 5) +#undef PA6 #define PA6 _STM32_PIN(A, 6) +#undef PA7 #define PA7 _STM32_PIN(A, 7) +#undef PA8 #define PA8 _STM32_PIN(A, 8) +#undef PA9 #define PA9 _STM32_PIN(A, 9) +#undef PA10 #define PA10 _STM32_PIN(A, 10) +#undef PA11 #define PA11 _STM32_PIN(A, 11) +#undef PA12 #define PA12 _STM32_PIN(A, 12) +#undef PA13 #define PA13 _STM32_PIN(A, 13) +#undef PA14 #define PA14 _STM32_PIN(A, 14) +#undef PA15 #define PA15 _STM32_PIN(A, 15) +#undef PB0 #define PB0 _STM32_PIN(B, 0) +#undef PB1 #define PB1 _STM32_PIN(B, 1) +#undef PB2 #define PB2 _STM32_PIN(B, 2) +#undef PB3 #define PB3 _STM32_PIN(B, 3) +#undef PB4 #define PB4 _STM32_PIN(B, 4) +#undef PB5 #define PB5 _STM32_PIN(B, 5) +#undef PB6 #define PB6 _STM32_PIN(B, 6) +#undef PB7 #define PB7 _STM32_PIN(B, 7) +#undef PB8 #define PB8 _STM32_PIN(B, 8) +#undef PB9 #define PB9 _STM32_PIN(B, 9) +#undef PB10 #define PB10 _STM32_PIN(B, 10) +#undef PB11 #define PB11 _STM32_PIN(B, 11) +#undef PB12 #define PB12 _STM32_PIN(B, 12) +#undef PB13 #define PB13 _STM32_PIN(B, 13) +#undef PB14 #define PB14 _STM32_PIN(B, 14) +#undef PB15 #define PB15 _STM32_PIN(B, 15) +#undef PC0 #define PC0 _STM32_PIN(C, 0) +#undef PC1 #define PC1 _STM32_PIN(C, 1) +#undef PC2 #define PC2 _STM32_PIN(C, 2) +#undef PC3 #define PC3 _STM32_PIN(C, 3) +#undef PC4 #define PC4 _STM32_PIN(C, 4) +#undef PC5 #define PC5 _STM32_PIN(C, 5) +#undef PC6 #define PC6 _STM32_PIN(C, 6) +#undef PC7 #define PC7 _STM32_PIN(C, 7) +#undef PC8 #define PC8 _STM32_PIN(C, 8) +#undef PC9 #define PC9 _STM32_PIN(C, 9) +#undef PC10 #define PC10 _STM32_PIN(C, 10) +#undef PC11 #define PC11 _STM32_PIN(C, 11) +#undef PC12 #define PC12 _STM32_PIN(C, 12) +#undef PC13 #define PC13 _STM32_PIN(C, 13) +#undef PC14 #define PC14 _STM32_PIN(C, 14) +#undef PC15 #define PC15 _STM32_PIN(C, 15) +#undef PD0 #define PD0 _STM32_PIN(D, 0) +#undef PD1 #define PD1 _STM32_PIN(D, 1) +#undef PD2 #define PD2 _STM32_PIN(D, 2) +#undef PD3 #define PD3 _STM32_PIN(D, 3) +#undef PD4 #define PD4 _STM32_PIN(D, 4) +#undef PD5 #define PD5 _STM32_PIN(D, 5) +#undef PD6 #define PD6 _STM32_PIN(D, 6) +#undef PD7 #define PD7 _STM32_PIN(D, 7) +#undef PD8 #define PD8 _STM32_PIN(D, 8) +#undef PD9 #define PD9 _STM32_PIN(D, 9) +#undef PD10 #define PD10 _STM32_PIN(D, 10) +#undef PD11 #define PD11 _STM32_PIN(D, 11) +#undef PD12 #define PD12 _STM32_PIN(D, 12) +#undef PD13 #define PD13 _STM32_PIN(D, 13) +#undef PD14 #define PD14 _STM32_PIN(D, 14) +#undef PD15 #define PD15 _STM32_PIN(D, 15) +#undef PE0 #define PE0 _STM32_PIN(E, 0) +#undef PE1 #define PE1 _STM32_PIN(E, 1) +#undef PE2 #define PE2 _STM32_PIN(E, 2) +#undef PE3 #define PE3 _STM32_PIN(E, 3) +#undef PE4 #define PE4 _STM32_PIN(E, 4) +#undef PE5 #define PE5 _STM32_PIN(E, 5) +#undef PE6 #define PE6 _STM32_PIN(E, 6) +#undef PE7 #define PE7 _STM32_PIN(E, 7) +#undef PE8 #define PE8 _STM32_PIN(E, 8) +#undef PE9 #define PE9 _STM32_PIN(E, 9) +#undef PE10 #define PE10 _STM32_PIN(E, 10) +#undef PE11 #define PE11 _STM32_PIN(E, 11) +#undef PE12 #define PE12 _STM32_PIN(E, 12) +#undef PE13 #define PE13 _STM32_PIN(E, 13) +#undef PE14 #define PE14 _STM32_PIN(E, 14) +#undef PE15 #define PE15 _STM32_PIN(E, 15) -#define PF0 _STM32_PIN(F, 0) -#define PF1 _STM32_PIN(F, 1) -#define PF2 _STM32_PIN(F, 2) -#define PF3 _STM32_PIN(F, 3) -#define PF4 _STM32_PIN(F, 4) -#define PF5 _STM32_PIN(F, 5) -#define PF6 _STM32_PIN(F, 6) -#define PF7 _STM32_PIN(F, 7) -#define PF8 _STM32_PIN(F, 8) -#define PF9 _STM32_PIN(F, 9) -#define PF10 _STM32_PIN(F, 10) -#define PF11 _STM32_PIN(F, 11) -#define PF12 _STM32_PIN(F, 12) -#define PF13 _STM32_PIN(F, 13) -#define PF14 _STM32_PIN(F, 14) -#define PF15 _STM32_PIN(F, 15) - -#define PG0 _STM32_PIN(G, 0) -#define PG1 _STM32_PIN(G, 1) -#define PG2 _STM32_PIN(G, 2) -#define PG3 _STM32_PIN(G, 3) -#define PG4 _STM32_PIN(G, 4) -#define PG5 _STM32_PIN(G, 5) -#define PG6 _STM32_PIN(G, 6) -#define PG7 _STM32_PIN(G, 7) -#define PG8 _STM32_PIN(G, 8) -#define PG9 _STM32_PIN(G, 9) -#define PG10 _STM32_PIN(G, 10) -#define PG11 _STM32_PIN(G, 11) -#define PG12 _STM32_PIN(G, 12) -#define PG13 _STM32_PIN(G, 13) -#define PG14 _STM32_PIN(G, 14) -#define PG15 _STM32_PIN(G, 15) +#ifdef STM32F7 + + #undef PORTF + #define PORTF 5 + #undef PF0 + #define PF0 _STM32_PIN(F, 0) + #undef PF1 + #define PF1 _STM32_PIN(F, 1) + #undef PF2 + #define PF2 _STM32_PIN(F, 2) + #undef PF3 + #define PF3 _STM32_PIN(F, 3) + #undef PF4 + #define PF4 _STM32_PIN(F, 4) + #undef PF5 + #define PF5 _STM32_PIN(F, 5) + #undef PF6 + #define PF6 _STM32_PIN(F, 6) + #undef PF7 + #define PF7 _STM32_PIN(F, 7) + #undef PF8 + #define PF8 _STM32_PIN(F, 8) + #undef PF9 + #define PF9 _STM32_PIN(F, 9) + #undef PF10 + #define PF10 _STM32_PIN(F, 10) + #undef PF11 + #define PF11 _STM32_PIN(F, 11) + #undef PF12 + #define PF12 _STM32_PIN(F, 12) + #undef PF13 + #define PF13 _STM32_PIN(F, 13) + #undef PF14 + #define PF14 _STM32_PIN(F, 14) + #undef PF15 + #define PF15 _STM32_PIN(F, 15) + + #undef PORTG + #define PORTG 6 + #undef PG0 + #define PG0 _STM32_PIN(G, 0) + #undef PG1 + #define PG1 _STM32_PIN(G, 1) + #undef PG2 + #define PG2 _STM32_PIN(G, 2) + #undef PG3 + #define PG3 _STM32_PIN(G, 3) + #undef PG4 + #define PG4 _STM32_PIN(G, 4) + #undef PG5 + #define PG5 _STM32_PIN(G, 5) + #undef PG6 + #define PG6 _STM32_PIN(G, 6) + #undef PG7 + #define PG7 _STM32_PIN(G, 7) + #undef PG8 + #define PG8 _STM32_PIN(G, 8) + #undef PG9 + #define PG9 _STM32_PIN(G, 9) + #undef PG10 + #define PG10 _STM32_PIN(G, 10) + #undef PG11 + #define PG11 _STM32_PIN(G, 11) + #undef PG12 + #define PG12 _STM32_PIN(G, 12) + #undef PG13 + #define PG13 _STM32_PIN(G, 13) + #undef PG14 + #define PG14 _STM32_PIN(G, 14) + #undef PG15 + #define PG15 _STM32_PIN(G, 15) + +#endif // STM32GENERIC && STM32F7 diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_STM32F7/SanityCheck.h b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h similarity index 87% rename from Marlin/src/HAL/HAL_STM32F7/SanityCheck.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h index e292de4efe42..7b8d29aa7dcf 100644 --- a/Marlin/src/HAL/HAL_STM32F7/SanityCheck.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h @@ -22,14 +22,14 @@ #pragma once /** - * Test STM32F7-specific configuration values for errors at compile-time. + * Test STM32F4/7-specific configuration values for errors at compile-time. */ //#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) // #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" //#endif #if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for STM32F7. Disable EMERGENCY_PARSER to continue." + #error "EMERGENCY_PARSER is not yet implemented for STM32F4/7. Disable EMERGENCY_PARSER to continue." #endif #if ENABLED(FAST_PWM_FAN) diff --git a/Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp similarity index 91% rename from Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp index 6d7d10323549..4bd86d225d4f 100644 --- a/Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp @@ -21,7 +21,7 @@ * */ -#ifdef STM32F7 +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) #include "../../inc/MarlinConfigPre.h" @@ -52,10 +52,10 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc) { +bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); - *value = c; + if (writing) *value = c; crc16(crc, &c, 1); pos++; value++; @@ -66,4 +66,4 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t size_t PersistentStore::capacity() { return E2END + 1; } #endif // EEPROM_SETTINGS -#endif // STM32F7 +#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h b/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h new file mode 100644 index 000000000000..342b875561b5 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core) + #include "../HAL_STM32/pinsDebug_STM32duino.h" +#elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple) + #include "../HAL_STM32/pinsDebug_STM32GENERIC.h" +#else + #error "M43 Pins Debugging not supported for this board." +#endif diff --git a/Marlin/src/HAL/HAL_STM32F4/spi_pins.h b/Marlin/src/HAL/HAL_STM32_F4_F7/spi_pins.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32F4/spi_pins.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/spi_pins.h diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h b/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h new file mode 100644 index 000000000000..cf33205bddab --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h @@ -0,0 +1,28 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com + * Copyright (c) 2017 Victor Perez + * + * 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 . + * + */ +#pragma once + +#ifdef STM32F4 + #include "STM32F4/timers.h" +#else + #include "STM32F7/timers.h" +#endif diff --git a/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp similarity index 87% rename from Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp index 51b3a8d62de0..900d1ef6a6fa 100644 --- a/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp @@ -20,13 +20,13 @@ * */ -#if defined(STM32GENERIC) && defined(STM32F4) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) #include "../../inc/MarlinConfig.h" #if ENABLED(USE_WATCHDOG) - #include "watchdog_STM32F4.h" + #include "watchdog.h" IWDG_HandleTypeDef hiwdg; @@ -37,21 +37,20 @@ if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { //Error_Handler(); } + else { + #if PIN_EXISTS(LED) && DISABLED(PINS_DEBUGGING) + TOGGLE(LED_PIN); // heartbeat indicator + #endif + } } - void watchdog_reset() { + void HAL_watchdog_refresh() { /* Refresh IWDG: reload counter */ if (HAL_IWDG_Refresh(&hiwdg) != HAL_OK) { /* Refresh Error */ //Error_Handler(); } - else { - #if PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heartbeat indicator - #endif - } } #endif // USE_WATCHDOG - -#endif // STM32GENERIC && STM32F4 +#endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.h b/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h similarity index 96% rename from Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h index cc02fda24f41..9e2a2dc21c45 100644 --- a/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h @@ -24,4 +24,4 @@ extern IWDG_HandleTypeDef hiwdg; void watchdog_init(); -void watchdog_reset(); +void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp index 56b609785869..2e15324e3bbd 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp @@ -44,10 +44,10 @@ static const uint8_t pin2sc1a[] = { /* // disable interrupts - void cli(void) { noInterrupts(); } + void cli() { noInterrupts(); } // enable interrupts - void sei(void) { interrupts(); } + void sei() { interrupts(); } */ void HAL_adc_init() { @@ -56,9 +56,9 @@ void HAL_adc_init() { NVIC_ENABLE_IRQ(IRQ_FTM1); } -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { switch (RCM_SRS0) { case 128: return RST_POWER_ON; break; case 64: return RST_EXTERNAL; break; @@ -87,6 +87,6 @@ extern "C" { void HAL_adc_start_conversion(const uint8_t adc_pin) { ADC0_SC1A = pin2sc1a[adc_pin]; } -uint16_t HAL_adc_get_result(void) { return ADC0_RA; } +uint16_t HAL_adc_get_result() { return ADC0_RA; } #endif // __MK20DX256__ diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h index 0dbfa284e54c..684afa58f466 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h @@ -19,24 +19,22 @@ * along with this program. If not, see . * */ +#pragma once /** * Description: HAL for Teensy 3.5 and Teensy 3.6 */ -#pragma once - #define CPU_32_BIT #include "../shared/Marduino.h" +#include "../shared/math_32bit.h" +#include "../shared/HAL_SPI.h" -#include "../math_32bit.h" -#include "../HAL_SPI.h" - -#include "fastio_Teensy.h" -#include "watchdog_Teensy.h" +#include "fastio.h" +#include "watchdog.h" -#include "HAL_timers_Teensy.h" +#include "timers.h" #include @@ -89,43 +87,36 @@ typedef int8_t pin_t; #undef pgm_read_word #define pgm_read_word(addr) (*((uint16_t*)(addr))) -inline void HAL_init(void) { } +inline void HAL_init() {} // Clear the reset reason -void HAL_clear_reset_source(void); +void HAL_clear_reset_source(); // Get the reason for the reset -uint8_t HAL_get_reset_source(void); +uint8_t HAL_get_reset_source(); FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" extern "C" { - int freeMemory(void); + int freeMemory(); } - -// SPI: Extended functions which take a channel number (hardware SPI only) - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); - -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); - -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); +#pragma GCC diagnostic pop // ADC void HAL_adc_init(); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_get_result() #define HAL_ADC_READY() true #define HAL_ANALOG_SELECT(pin) void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_spi_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp similarity index 98% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_spi_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp index f53658ec5572..4236f02b0f43 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_spi_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp @@ -34,7 +34,7 @@ static SPISettings spiConfig; */ // Initialize SPI bus -void spiBegin(void) { +void spiBegin() { #if !PIN_EXISTS(SS) #error "SS_PIN not defined!" #endif @@ -71,7 +71,7 @@ void spiInit(uint8_t spiRate) { } // SPI receive a byte -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); const uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp similarity index 70% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp index 2ffd96e3e1bc..6451f6b1722e 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp @@ -25,29 +25,29 @@ #if HAS_SERVOS -#include "HAL_Servo_Teensy.h" +#include "Servo.h" uint8_t servoPin[MAX_SERVOS] = { 0 }; -int8_t libServo::attach(const int pin) { - if (this->servoIndex >= MAX_SERVOS) return -1; - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex]); +int8_t libServo::attach(const int inPin) { + if (servoIndex >= MAX_SERVOS) return -1; + if (inPin > 0) servoPin[servoIndex] = inPin; + return super::attach(servoPin[servoIndex]); } -int8_t libServo::attach(const int pin, const int min, const int max) { - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex], min, max); +int8_t libServo::attach(const int inPin, const int inMin, const int inMax) { + if (inPin > 0) servoPin[servoIndex] = inPin; + return super::attach(servoPin[servoIndex], inMin, inMax); } void libServo::move(const 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]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.h b/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h similarity index 97% rename from Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.h rename to Marlin/src/HAL/HAL_TEENSY31_32/Servo.h index 413c4995a5b3..3eb7d39b2217 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h @@ -4,7 +4,6 @@ * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez * * 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 @@ -31,6 +30,7 @@ class libServo : public Servo { int8_t attach(const int pin, const int min, const int max); void move(const int value); private: + typedef Servo super; uint16_t min_ticks; uint16_t max_ticks; uint8_t servoIndex; // index into the channel data for this servo diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h b/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h index 1af89e0f33fd..221b721b356a 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h @@ -35,53 +35,43 @@ * (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino) */ -#pragma once - #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } /** * Endstop interrupts for Due based targets. * On Due, all pins support external interrupt capability. */ -void setup_endstop_interrupts( void ) { - +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + _ATTACH(X_MAX_PIN); #endif - #if HAS_X_MIN - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif - #if HAS_Y_MAX - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif - #if HAS_Y_MIN - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif - #if HAS_Z_MAX - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif - #if HAS_Z_MIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif - #if HAS_Z2_MAX - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif - #if HAS_Z2_MIN - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/fastio_Teensy.h b/Marlin/src/HAL/HAL_TEENSY31_32/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY35_36/fastio_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY31_32/fastio.h diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/SanityCheck.h b/Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY31_32/SanityCheck.h rename to Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp index d746dc9730a5..6da102638f63 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp @@ -1,18 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ #ifdef __MK20DX256__ #include "../../inc/MarlinConfig.h" #if ENABLED(EEPROM_SETTINGS) -#include "../persistent_store_api.h" +#include "../shared/persistent_store_api.h" -namespace HAL { -namespace PersistentStore { +bool PersistentStore::access_start() { return true; } +bool PersistentStore::access_finish() { return true; } -bool access_start() { return true; } -bool access_finish() { return true; } - -bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t * const p = (uint8_t * const)pos; uint8_t v = *value; @@ -32,7 +47,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { return false; } -bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { uint8_t c = eeprom_read_byte((uint8_t*)pos); if (writing) *value = c; @@ -43,8 +58,5 @@ bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const boo return false; } -} // PersistentStore -} // HAL - #endif // EEPROM_SETTINGS #endif // __MK20DX256__ diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp similarity index 92% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp index ac0432564978..e4ccf33a4bb0 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp @@ -27,14 +27,14 @@ #ifdef __MK20DX256__ #include "HAL.h" -#include "HAL_timers_Teensy.h" +#include "timers.h" /** \brief Instruction Synchronization Barrier Instruction Synchronization Barrier flushes the pipeline in the processor, so that all instructions following the ISB are fetched from cache or memory, after the instruction has been completed. */ -FORCE_INLINE static void __ISB(void) { +FORCE_INLINE static void __ISB() { __asm__ __volatile__("isb 0xF":::"memory"); } @@ -42,7 +42,7 @@ FORCE_INLINE static void __ISB(void) { This function acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete. */ -FORCE_INLINE static void __DSB(void) { +FORCE_INLINE static void __DSB() { __asm__ __volatile__("dsb 0xF":::"memory"); } @@ -53,7 +53,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { FTM0_SC = 0x00; // Set this to zero before changing the modulus FTM0_CNT = 0x0000; // Reset the count to zero FTM0_MOD = 0xFFFF; // max modulus = 65535 - FTM0_C0V = FTM0_TIMER_RATE / frequency; // Initial FTM Channel 0 compare value + FTM0_C0V = (FTM0_TIMER_RATE) / frequency; // Initial FTM Channel 0 compare value FTM0_SC = (FTM_SC_CLKS(0b1) & FTM_SC_CLKS_MASK) | (FTM_SC_PS(FTM0_TIMER_PRESCALE_BITS) & FTM_SC_PS_MASK); // Bus clock 60MHz divided by prescaler 8 FTM0_C0SC = FTM_CSC_CHIE | FTM_CSC_MSA | FTM_CSC_ELSA; break; @@ -62,7 +62,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { FTM1_SC = 0x00; // Set this to zero before changing the modulus FTM1_CNT = 0x0000; // Reset the count to zero FTM1_MOD = 0xFFFF; // max modulus = 65535 - FTM1_C0V = FTM1_TIMER_RATE / frequency; // Initial FTM Channel 0 compare value 65535 + FTM1_C0V = (FTM1_TIMER_RATE) / frequency; // Initial FTM Channel 0 compare value 65535 FTM1_SC = (FTM_SC_CLKS(0b1) & FTM_SC_CLKS_MASK) | (FTM_SC_PS(FTM1_TIMER_PRESCALE_BITS) & FTM_SC_PS_MASK); // Bus clock 60MHz divided by prescaler 4 FTM1_C0SC = FTM_CSC_CHIE | FTM_CSC_MSA | FTM_CSC_ELSA; break; diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.h b/Marlin/src/HAL/HAL_TEENSY31_32/timers.h similarity index 82% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY31_32/timers.h index 8c9836d130cc..6dff7701be3c 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/timers.h @@ -26,17 +26,11 @@ * Teensy3.2 (__MK20DX256__) */ -#pragma once - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define FORCE_INLINE __attribute__((always_inline)) inline @@ -48,8 +42,8 @@ typedef uint32_t hal_timer_t; #define FTM0_TIMER_PRESCALE_BITS 0b011 #define FTM1_TIMER_PRESCALE_BITS 0b010 -#define FTM0_TIMER_RATE (F_BUS / FTM0_TIMER_PRESCALE) // 60MHz / 8 = 7500kHz -#define FTM1_TIMER_RATE (F_BUS / FTM1_TIMER_PRESCALE) // 60MHz / 4 = 15MHz +#define FTM0_TIMER_RATE (F_BUS / (FTM0_TIMER_PRESCALE)) // 60MHz / 8 = 7500kHz +#define FTM1_TIMER_RATE (F_BUS / (FTM1_TIMER_PRESCALE)) // 60MHz / 4 = 15MHz #define HAL_TIMER_RATE (FTM0_TIMER_RATE) @@ -74,8 +68,8 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr(void) //void TC3_Handler() -#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr(void) //void TC4_Handler() +#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() +#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp similarity index 97% rename from Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp index bf812d9a51d7..d1313e1f5deb 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp @@ -26,7 +26,7 @@ #if ENABLED(USE_WATCHDOG) -#include "watchdog_Teensy.h" +#include "watchdog.h" void watchdog_init() { WDOG_TOVALH = 0; diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.h b/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h similarity index 96% rename from Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h index ceb041b45715..861afcbc9148 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h @@ -27,7 +27,7 @@ void watchdog_init(); -inline void watchdog_reset() { +inline void HAL_watchdog_refresh() { // Watchdog refresh sequence WDOG_REFRESH = 0xA602; WDOG_REFRESH = 0xB480; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp index 33541c03bf7e..584894479229 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp @@ -51,10 +51,10 @@ static const uint8_t pin2sc1a[] = { /* // disable interrupts - void cli(void) { noInterrupts(); } + void cli() { noInterrupts(); } // enable interrupts - void sei(void) { interrupts(); } + void sei() { interrupts(); } */ void HAL_adc_init() { @@ -64,9 +64,9 @@ void HAL_adc_init() { NVIC_ENABLE_IRQ(IRQ_FTM1); } -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { switch (RCM_SRS0) { case 128: return RST_POWER_ON; break; case 64: return RST_EXTERNAL; break; @@ -109,7 +109,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { } } -uint16_t HAL_adc_get_result(void) { +uint16_t HAL_adc_get_result() { switch (HAL_adc_select) { case 0: return ADC0_RA; case 1: return ADC1_RA; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h index f3a26eb5d810..97763bf205bf 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h @@ -27,18 +27,14 @@ #define CPU_32_BIT -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_Teensy.h" -#include "watchdog_Teensy.h" +#include "fastio.h" +#include "watchdog.h" -#include "HAL_timers_Teensy.h" +#include "timers.h" #include #include @@ -47,9 +43,9 @@ #define ST7920_DELAY_2 DELAY_NS(750) #define ST7920_DELAY_3 DELAY_NS(750) -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define IS_32BIT_TEENSY (defined(__MK64FX512__) || defined(__MK66FX1M0__)) #define IS_TEENSY35 defined(__MK64FX512__) @@ -97,40 +93,36 @@ typedef int8_t pin_t; #undef pgm_read_word #define pgm_read_word(addr) (*((uint16_t*)(addr))) -inline void HAL_init(void) { } +inline void HAL_init() {} -/** clear reset reason */ -void HAL_clear_reset_source(void); +// Clear reset reason +void HAL_clear_reset_source(); -/** reset reason */ -uint8_t HAL_get_reset_source(void); +// Reset reason +uint8_t HAL_get_reset_source(); FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" extern "C" { - int freeMemory(void); + int freeMemory(); } - -// SPI: Extended functions which take a channel number (hardware SPI only) -/** Write single byte to specified SPI channel */ -void spiSend(uint32_t chan, byte b); -/** Write buffer to specified SPI channel */ -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -/** Read single byte from specified SPI channel */ -uint8_t spiRec(uint32_t chan); +#pragma GCC diagnostic pop // ADC void HAL_adc_init(); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) +#define HAL_ADC_RESOLUTION 10 #define HAL_READ_ADC() HAL_adc_get_result() #define HAL_ADC_READY() true #define HAL_ANALOG_SELECT(pin) void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp similarity index 98% rename from Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp index 35424625d5ed..44ab74cc9bf6 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp @@ -29,7 +29,7 @@ static SPISettings spiConfig; -void spiBegin(void) { +void spiBegin() { #if !PIN_EXISTS(SS) #error SS_PIN not defined! #endif @@ -65,7 +65,7 @@ void spiInit(uint8_t spiRate) { SPI.begin(); } -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp deleted file mode 100644 index ff56036ccd7a..000000000000 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#if defined(__MK64FX512__) || defined(__MK66FX1M0__) - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "HAL_Servo_Teensy.h" - -uint8_t servoPin[MAX_SERVOS] = { 0 }; - -int8_t libServo::attach(const int pin) { - if (this->servoIndex >= MAX_SERVOS) return -1; - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex]); -} - -int8_t libServo::attach(const int pin, const int min, const int max) { - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex], min, max); -} - -void libServo::move(const 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]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); - #endif - } -} - -#endif // HAS_SERVOS - -#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL_Servo_STM32F7.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp similarity index 66% rename from Marlin/src/HAL/HAL_STM32F7/HAL_Servo_STM32F7.cpp rename to Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp index 3be816ad34a2..d376b80a7df6 100644 --- a/Marlin/src/HAL/HAL_STM32F7/HAL_Servo_STM32F7.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp @@ -4,7 +4,6 @@ * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez * * 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 @@ -20,35 +19,39 @@ * along with this program. If not, see . * */ - -#ifdef STM32F7 +#if defined(__MK64FX512__) || defined(__MK66FX1M0__) #include "../../inc/MarlinConfig.h" #if HAS_SERVOS -#include "HAL_Servo_STM32F7.h" +#include "Servo.h" + +uint8_t servoPin[MAX_SERVOS] = { 0 }; -int8_t libServo::attach(const int pin) { - if (this->servoIndex >= MAX_SERVOS) return -1; - return Servo::attach(pin); +int8_t libServo::attach(const int inPin) { + if (servoIndex >= MAX_SERVOS) return -1; + if (inPin > 0) servoPin[servoIndex] = inPin; + return super::attach(servoPin[servoIndex]); } -int8_t libServo::attach(const int pin, const int min, const int max) { - return Servo::attach(pin, min, max); +int8_t libServo::attach(const int inPin, const int inMin, const int inMax) { + if (inPin > 0) servoPin[servoIndex] = inPin; + return super::attach(servoPin[servoIndex], inMin, inMax); } void libServo::move(const 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]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } + #endif // HAS_SERVOS -#endif // STM32F7 +#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h similarity index 88% rename from Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY35_36/Servo.h index 4b97dbffbbbe..cafd323a3846 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h @@ -30,7 +30,8 @@ class libServo : public Servo { int8_t attach(const int pin, const int min, const int max); void move(const int value); private: - uint16_t min_ticks; - uint16_t max_ticks; - uint8_t servoIndex; // Index into the channel data for this servo + typedef Servo super; + uint16_t min_ticks; + uint16_t max_ticks; + uint8_t servoIndex; // Index into the channel data for this servo }; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h b/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h index 137cb472eff3..3862f2b5b897 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h @@ -38,44 +38,45 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } /** * Endstop interrupts for Due based targets. * On Due, all pins support external interrupt capability. */ -void setup_endstop_interrupts( void ) { +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/fastio_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h similarity index 99% rename from Marlin/src/HAL/HAL_TEENSY31_32/fastio_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY35_36/fastio.h index 7bcd601b5863..d1b5f567d750 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/fastio_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h @@ -27,8 +27,6 @@ * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al. */ -#pragma once - #ifndef MASK #define MASK(PIN) (1 << PIN) #endif diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h new file mode 100644 index 000000000000..85f26f40162e --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/SanityCheck.h b/Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY35_36/SanityCheck.h rename to Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp deleted file mode 100644 index 29b4653b3eac..000000000000 --- a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#if defined(__MK64FX512__) || defined(__MK66FX1M0__) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(EEPROM_SETTINGS) - -#include "../shared/persistent_store_api.h" - -namespace HAL { -namespace PersistentStore { - -bool access_start() { return true; } -bool access_finish() { return true; } - -bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { - while (size--) { - uint8_t * const p = (uint8_t * const)pos; - uint8_t v = *value; - // EEPROM has only ~100,000 write cycles, - // so only write bytes that have changed! - if (v != eeprom_read_byte(p)) { - eeprom_write_byte(p, v); - if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); - return true; - } - } - crc16(crc, &v, 1); - pos++; - value++; - }; - return false; -} - -bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) { - do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); - if (writing) *value = c; - crc16(crc, &c, 1); - pos++; - value++; - } while (--size); - return false; -} - -} // PersistentStore -} // HAL - -#endif // EEPROM_SETTINGS -#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h b/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h index e6dcb2996cfe..db750cf6ec85 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h @@ -16,8 +16,7 @@ * along with this program. If not, see . * */ - -#ifndef HAL_PINSDEBUG_TEENSY_H +#pragma once #define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS #define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin @@ -103,5 +102,3 @@ bool HAL_pwm_status(int8_t pin) { } static void HAL_pwm_details(uint8_t pin) { /* TODO */ } - -#endif diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp similarity index 93% rename from Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp index 8c01120cc786..6bbc16dcb55e 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp @@ -28,14 +28,14 @@ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) #include "HAL.h" -#include "HAL_timers_Teensy.h" +#include "timers.h" /** \brief Instruction Synchronization Barrier Instruction Synchronization Barrier flushes the pipeline in the processor, so that all instructions following the ISB are fetched from cache or memory, after the instruction has been completed. */ -FORCE_INLINE static void __ISB(void) { +FORCE_INLINE static void __ISB() { __asm__ __volatile__("isb 0xF":::"memory"); } @@ -43,7 +43,7 @@ FORCE_INLINE static void __ISB(void) { This function acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete. */ -FORCE_INLINE static void __DSB(void) { +FORCE_INLINE static void __DSB() { __asm__ __volatile__("dsb 0xF":::"memory"); } @@ -54,7 +54,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { FTM0_SC = 0x00; // Set this to zero before changing the modulus FTM0_CNT = 0x0000; // Reset the count to zero FTM0_MOD = 0xFFFF; // max modulus = 65535 - FTM0_C0V = FTM0_TIMER_RATE / frequency; // Initial FTM Channel 0 compare value + FTM0_C0V = (FTM0_TIMER_RATE) / frequency; // Initial FTM Channel 0 compare value FTM0_SC = (FTM_SC_CLKS(0b1) & FTM_SC_CLKS_MASK) | (FTM_SC_PS(FTM0_TIMER_PRESCALE_BITS) & FTM_SC_PS_MASK); // Bus clock 60MHz divided by prescaler 8 FTM0_C0SC = FTM_CSC_CHIE | FTM_CSC_MSA | FTM_CSC_ELSA; break; @@ -63,7 +63,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { FTM1_SC = 0x00; // Set this to zero before changing the modulus FTM1_CNT = 0x0000; // Reset the count to zero FTM1_MOD = 0xFFFF; // max modulus = 65535 - FTM1_C0V = FTM1_TIMER_RATE / frequency; // Initial FTM Channel 0 compare value 65535 + FTM1_C0V = (FTM1_TIMER_RATE) / frequency; // Initial FTM Channel 0 compare value 65535 FTM1_SC = (FTM_SC_CLKS(0b1) & FTM_SC_CLKS_MASK) | (FTM_SC_PS(FTM1_TIMER_PRESCALE_BITS) & FTM_SC_PS_MASK); // Bus clock 60MHz divided by prescaler 4 FTM1_C0SC = FTM_CSC_CHIE | FTM_CSC_MSA | FTM_CSC_ELSA; break; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/timers.h similarity index 87% rename from Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY35_36/timers.h index 8263691947c9..8ae51107c74b 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/timers.h @@ -25,15 +25,11 @@ * Teensy3.6 (__MK66FX1M0__) */ -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - #include -// -------------------------------------------------------------------------- +// ------------------------ // Defines -// -------------------------------------------------------------------------- +// ------------------------ #define FORCE_INLINE __attribute__((always_inline)) inline @@ -71,8 +67,8 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr(void) //void TC3_Handler() -#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr(void) //void TC4_Handler() +#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() +#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp similarity index 97% rename from Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp index 7924c0373063..f58217c75054 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp @@ -26,7 +26,7 @@ #if ENABLED(USE_WATCHDOG) -#include "watchdog_Teensy.h" +#include "watchdog.h" void watchdog_init() { WDOG_TOVALH = 0; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h similarity index 96% rename from Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h index d2efaab37217..7c27260906c7 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h @@ -23,7 +23,7 @@ void watchdog_init(); -inline void watchdog_reset() { +inline void HAL_watchdog_refresh() { // Watchdog refresh sequence WDOG_REFRESH = 0xA602; WDOG_REFRESH = 0xB480; diff --git a/Marlin/src/HAL/platforms.h b/Marlin/src/HAL/platforms.h index 48405f49f78b..e3e7f52cfaec 100644 --- a/Marlin/src/HAL/platforms.h +++ b/Marlin/src/HAL/platforms.h @@ -33,16 +33,16 @@ #define HAL_PLATFORM HAL_LPC1768 #elif defined(__STM32F1__) || defined(TARGET_STM32F1) #define HAL_PLATFORM HAL_STM32F1 -#elif defined(STM32GENERIC) && defined(STM32F4) - #define HAL_PLATFORM HAL_STM32F4 -#elif defined(STM32GENERIC) && defined(STM32F7) - #define HAL_PLATFORM HAL_STM32F7 +#elif defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) + #define HAL_PLATFORM HAL_STM32_F4_F7 #elif defined(ARDUINO_ARCH_STM32) #define HAL_PLATFORM HAL_STM32 #elif defined(ARDUINO_ARCH_ESP32) #define HAL_PLATFORM HAL_ESP32 #elif defined(__PLAT_LINUX__) #define HAL_PLATFORM HAL_LINUX +#elif defined(__SAMD51__) + #define HAL_PLATFORM HAL_SAMD51 #else #error "Unsupported Platform!" #endif diff --git a/Marlin/src/HAL/shared/Delay.h b/Marlin/src/HAL/shared/Delay.h index 1bcfb9e8a65d..b1dafbb0f5d6 100644 --- a/Marlin/src/HAL/shared/Delay.h +++ b/Marlin/src/HAL/shared/Delay.h @@ -29,21 +29,22 @@ * DELAY_US(count): Delay execution in microseconds */ -#include "../../core/macros.h" #include "../../core/millis_t.h" +#include "../../core/macros.h" #if defined(__arm__) || defined(__thumb__) #if __CORTEX_M == 7 - // Cortex-M7 can use the cycle counter of the DWT unit + // Cortex-M3 through M7 can use the cycle counter of the DWT unit // http://www.anthonyvh.com/2017/05/18/cortex_m-cycle_counter/ FORCE_INLINE static void enableCycleCounter() { CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - // Unlock DWT. - DWT->LAR = 0xC5ACCE55; + #if __CORTEX_M == 7 + DWT->LAR = 0xC5ACCE55; // Unlock DWT on the M7 + #endif DWT->CYCCNT = 0; DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; @@ -53,7 +54,7 @@ FORCE_INLINE static void DELAY_CYCLES(const uint32_t x) { const uint32_t endCycles = getCycleCount() + x; - while (PENDING(getCycleCount(), endCycles)) { } + while (PENDING(getCycleCount(), endCycles)) {} } #else diff --git a/Marlin/src/HAL/shared/HAL_SPI.h b/Marlin/src/HAL/shared/HAL_SPI.h index 16a58f673acc..d805207047da 100644 --- a/Marlin/src/HAL/shared/HAL_SPI.h +++ b/Marlin/src/HAL/shared/HAL_SPI.h @@ -22,10 +22,11 @@ #pragma once /** - * HAL/HAL_SPI.h + * HAL/shared/HAL_SPI.h * Core Marlin definitions for SPI, implemented in the HALs */ +#include "Marduino.h" #include /** @@ -53,18 +54,40 @@ #define SPI_SPEED_5 5 // Set SCK rate to 1/32 of max rate #define SPI_SPEED_6 6 // Set SCK rate to 1/64 of max rate +// // Standard SPI functions -/** Initialize SPI bus */ -void spiBegin(void); -/** Configure SPI for specified SPI speed */ +// + +// Initialize SPI bus +void spiBegin(); + +// Configure SPI for specified SPI speed void spiInit(uint8_t spiRate); -/** Write single byte to SPI */ + +// Write single byte to SPI void spiSend(uint8_t b); -/** Read single byte from SPI */ -uint8_t spiRec(void); -/** Read from SPI into buffer */ + +// Read single byte from SPI +uint8_t spiRec(); + +// Read from SPI into buffer void spiRead(uint8_t* buf, uint16_t nbyte); -/** Write token and then write from 512 byte buffer to SPI (for SD card) */ + +// Write token and then write from 512 byte buffer to SPI (for SD card) void spiSendBlock(uint8_t token, const uint8_t* buf); -/** Begin SPI transaction, set clock, bit order, data mode */ + +// Begin SPI transaction, set clock, bit order, data mode void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode); + +// +// Extended SPI functions taking a channel number (Hardware SPI only) +// + +// Write single byte to specified SPI channel +void spiSend(uint32_t chan, byte b); + +// Write buffer to specified SPI channel +void spiSend(uint32_t chan, const uint8_t* buf, size_t n); + +// Read single byte from specified SPI channel +uint8_t spiRec(uint32_t chan); diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h index d9440325f269..a2de03a2b6e4 100644 --- a/Marlin/src/HAL/shared/Marduino.h +++ b/Marlin/src/HAL/shared/Marduino.h @@ -29,6 +29,9 @@ #undef M_PI // Redefined by all #undef _BV // Redefined by some #undef sq // Redefined by teensy3/wiring.h +#undef SBI // Redefined by arduino/const_functions.h +#undef CBI // Redefined by arduino/const_functions.h +#undef UNUSED // Redefined by stm32f4xx_hal_def.h #include // NOTE: If included earlier then this line is a NOOP @@ -54,6 +57,13 @@ inline const char* strchr_P(const char *s, int c) { return strchr(s,c); } //#define strchr_P(s,c) strchr(s,c) #endif + + #ifndef snprintf_P + #define snprintf_P snprintf + #endif + #ifndef vsnprintf_P + #define vsnprintf_P vsnprintf + #endif #endif // Restart causes @@ -68,3 +78,8 @@ #ifndef M_PI #define M_PI 3.14159265358979323846f #endif + +// Remove compiler warning on an unused variable +#ifndef UNUSED + #define UNUSED(x) ((void)(x)) +#endif diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.cpp b/Marlin/src/HAL/shared/backtrace/backtrace.cpp index fc8abfa0e632..7a8377f789aa 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.cpp +++ b/Marlin/src/HAL/shared/backtrace/backtrace.cpp @@ -20,10 +20,9 @@ * */ -#include "backtrace.h" - #if defined(__arm__) || defined(__thumb__) +#include "backtrace.h" #include "unwinder.h" #include "unwmemaccess.h" @@ -65,7 +64,7 @@ static const UnwindCallbacks UnwCallbacks = { #endif }; -void backtrace(void) { +void backtrace() { UnwindFrame btf; uint32_t sp = 0, lr = 0, pc = 0; @@ -95,6 +94,6 @@ void backtrace(void) { #else // !__arm__ && !__thumb__ -void backtrace(void) {} +void backtrace() {} #endif diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.h b/Marlin/src/HAL/shared/backtrace/backtrace.h index a3d7cc7e3dae..a2b8eae59412 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.h +++ b/Marlin/src/HAL/shared/backtrace/backtrace.h @@ -22,4 +22,4 @@ #pragma once // Perform a backtrace to the serial port -void backtrace(void); +void backtrace(); diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm.cpp index fb4263a2728c..cdc9c06c615e 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm.cpp @@ -78,7 +78,7 @@ void UnwInitState(UnwState * const state, /**< Pointer to structure to fill. } // Detect if function names are available -static int __attribute__ ((noinline)) has_function_names(void) { +static int __attribute__ ((noinline)) has_function_names() { uint32_t flag_word = ((uint32_t*)(((uint32_t)(&has_function_names)) & (-4))) [-1]; return ((flag_word & 0xFF000000) == 0xFF000000) ? 1 : 0; } diff --git a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp index ebd53cc1d9bb..207cd56aa82e 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp @@ -23,9 +23,9 @@ extern "C" const UnwTabEntry __exidx_start[]; extern "C" const UnwTabEntry __exidx_end[]; /* This prevents the linking of libgcc unwinder code */ -void __aeabi_unwind_cpp_pr0(void) {}; -void __aeabi_unwind_cpp_pr1(void) {}; -void __aeabi_unwind_cpp_pr2(void) {}; +void __aeabi_unwind_cpp_pr0() {}; +void __aeabi_unwind_cpp_pr1() {}; +void __aeabi_unwind_cpp_pr2() {}; static inline __attribute__((always_inline)) uint32_t prel31_to_addr(const uint32_t *prel31) { uint32_t offset = (((uint32_t)(*prel31)) << 1) >> 1; @@ -285,7 +285,7 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat return UNWIND_SUCCESS; } -static inline __attribute__((always_inline)) uint32_t read_psp(void) { +static inline __attribute__((always_inline)) uint32_t read_psp() { /* Read the current PSP and return its value as a pointer */ uint32_t psp; diff --git a/Marlin/src/HAL/shared/backtrace/unwinder.cpp b/Marlin/src/HAL/shared/backtrace/unwinder.cpp index bde58994355b..e63af1ed25a8 100644 --- a/Marlin/src/HAL/shared/backtrace/unwinder.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwinder.cpp @@ -27,7 +27,7 @@ extern "C" const UnwTabEntry __exidx_start[]; extern "C" const UnwTabEntry __exidx_end[]; // Detect if unwind information is present or not -static int HasUnwindTableInfo(void) { +static int HasUnwindTableInfo() { // > 16 because there are default entries we can't supress return ((char*)(&__exidx_end) - (char*)(&__exidx_start)) > 16 ? 1 : 0; } diff --git a/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp b/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp index 20f1a7bc0f23..8cf31cadf556 100644 --- a/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp @@ -129,6 +129,17 @@ #define END_FLASH_ADDR 0x00140000 #endif +#ifdef __SAMD51P20A__ +// For SAMD51x20, valid address ranges are +// SRAM (0x20000000 - 0x20040000) (256kb) +// FLASH (0x00000000 - 0x00100000) (1024kb) +// +#define START_SRAM_ADDR 0x20000000 +#define END_SRAM_ADDR 0x20040000 +#define START_FLASH_ADDR 0x00000000 +#define END_FLASH_ADDR 0x00100000 +#endif + static bool validate_addr(uint32_t addr) { // Address must be in SRAM range diff --git a/Marlin/src/HAL/shared/I2cEeprom.cpp b/Marlin/src/HAL/shared/eeprom_i2c.cpp similarity index 64% rename from Marlin/src/HAL/shared/I2cEeprom.cpp rename to Marlin/src/HAL/shared/eeprom_i2c.cpp index cc98ac183dc7..2752b7d4ccd5 100644 --- a/Marlin/src/HAL/shared/I2cEeprom.cpp +++ b/Marlin/src/HAL/shared/eeprom_i2c.cpp @@ -29,57 +29,21 @@ #if ENABLED(I2C_EEPROM) -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - -#include HAL_PATH(.., HAL.h) +#include "../HAL.h" #include -// -------------------------------------------------------------------------- -// Externals -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Local defines -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Public Variables -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- +// ------------------------ // Private Variables -// -------------------------------------------------------------------------- +// ------------------------ -// -------------------------------------------------------------------------- -// Function prototypes -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -// Private functions -// -------------------------------------------------------------------------- +static uint8_t eeprom_device_address = 0x50; -// -------------------------------------------------------------------------- +// ------------------------ // Public functions -// -------------------------------------------------------------------------- - -static uint8_t eeprom_device_address = 0x50; +// ------------------------ -static void eeprom_init(void) { - static bool eeprom_initialized = false; - if (!eeprom_initialized) { - Wire.begin(); - eeprom_initialized = true; - } +static void eeprom_init() { + Wire.begin(); } void eeprom_write_byte(uint8_t *pos, unsigned char value) { @@ -127,7 +91,6 @@ void eeprom_update_block(const void *pos, void* eeprom_address, size_t n) { } } - uint8_t eeprom_read_byte(uint8_t *pos) { unsigned eeprom_address = (unsigned)pos; @@ -141,7 +104,7 @@ uint8_t eeprom_read_byte(uint8_t *pos) { return Wire.available() ? Wire.read() : 0xFF; } -// maybe let's not read more than 30 or 32 bytes at a time! +// Don't read more than 30..32 bytes at a time! void eeprom_read_block(void* pos, const void* eeprom_address, size_t n) { eeprom_init(); diff --git a/Marlin/src/HAL/shared/SpiEeprom.cpp b/Marlin/src/HAL/shared/eeprom_spi.cpp similarity index 99% rename from Marlin/src/HAL/shared/SpiEeprom.cpp rename to Marlin/src/HAL/shared/eeprom_spi.cpp index cbdb4d29859d..35e7d9b0a952 100644 --- a/Marlin/src/HAL/shared/SpiEeprom.cpp +++ b/Marlin/src/HAL/shared/eeprom_spi.cpp @@ -29,7 +29,7 @@ #if ENABLED(SPI_EEPROM) -#include HAL_PATH(.., HAL.h) +#include "../HAL.h" #define CMD_WREN 6 // WREN #define CMD_READ 2 // WRITE diff --git a/Marlin/src/HAL/shared/servo.cpp b/Marlin/src/HAL/shared/servo.cpp index af338536654f..b5975e58e708 100644 --- a/Marlin/src/HAL/shared/servo.cpp +++ b/Marlin/src/HAL/shared/servo.cpp @@ -58,11 +58,11 @@ #include "servo.h" #include "servo_private.h" -ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures -uint8_t ServoCount = 0; // the total number of attached servos +ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures +uint8_t ServoCount = 0; // the total number of attached servos -#define SERVO_MIN() (MIN_PULSE_WIDTH - this->min * 4) // minimum value in uS for this servo -#define SERVO_MAX() (MAX_PULSE_WIDTH - this->max * 4) // maximum value in uS for this servo +#define SERVO_MIN(v) (MIN_PULSE_WIDTH - (v) * 4) // minimum value in uS for this servo +#define SERVO_MAX(v) (MAX_PULSE_WIDTH - (v) * 4) // maximum value in uS for this servo /************ static functions common to all instances ***********************/ @@ -79,55 +79,54 @@ static boolean isTimerActive(timer16_Sequence_t timer) { Servo::Servo() { if (ServoCount < MAX_SERVOS) { - this->servoIndex = ServoCount++; // assign a servo index to this instance - servo_info[this->servoIndex].ticks = usToTicks(DEFAULT_PULSE_WIDTH); // store default values - 12 Aug 2009 + servoIndex = ServoCount++; // assign a servo index to this instance + servo_info[servoIndex].ticks = usToTicks(DEFAULT_PULSE_WIDTH); // store default values - 12 Aug 2009 } else - this->servoIndex = INVALID_SERVO; // too many servos + servoIndex = INVALID_SERVO; // too many servos } -int8_t Servo::attach(const int pin) { - return this->attach(pin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); +int8_t Servo::attach(const int inPin) { + return attach(inPin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); } -int8_t Servo::attach(const int pin, const int min, const int max) { +int8_t Servo::attach(const int inPin, const int inMin, const int inMax) { - if (this->servoIndex >= MAX_SERVOS) return -1; + if (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 + if (inPin > 0) servo_info[servoIndex].Pin.nbr = inPin; + pinMode(servo_info[servoIndex].Pin.nbr, OUTPUT); // set servo pin to output - // 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; + // TODO: min/max check: ABS(min - MIN_PULSE_WIDTH) / 4 < 128 + min = (MIN_PULSE_WIDTH - inMin) / 4; //resolution of min/max is 4 uS + max = (MAX_PULSE_WIDTH - inMax) / 4; // initialize the timer if it has not already been initialized timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); if (!isTimerActive(timer)) initISR(timer); - servo_info[this->servoIndex].Pin.isActive = true; // this must be set after the check for isTimerActive + servo_info[servoIndex].Pin.isActive = true; // this must be set after the check for isTimerActive - return this->servoIndex; + return servoIndex; } void Servo::detach() { - servo_info[this->servoIndex].Pin.isActive = false; + servo_info[servoIndex].Pin.isActive = false; timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); if (!isTimerActive(timer)) finISR(timer); } void Servo::write(int value) { - if (value < MIN_PULSE_WIDTH) { // treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds) - value = map(constrain(value, 0, 180), 0, 180, SERVO_MIN(), SERVO_MAX()); - } - this->writeMicroseconds(value); + if (value < MIN_PULSE_WIDTH) // treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds) + value = map(constrain(value, 0, 180), 0, 180, SERVO_MIN(min), SERVO_MAX(max)); + writeMicroseconds(value); } void Servo::writeMicroseconds(int value) { // calculate and store the values for the given channel - byte channel = this->servoIndex; + byte channel = servoIndex; if (channel < MAX_SERVOS) { // ensure channel is valid // ensure pulse width is valid - value = constrain(value, SERVO_MIN(), SERVO_MAX()) - (TRIM_DURATION); + value = constrain(value, SERVO_MIN(min), SERVO_MAX(max)) - (TRIM_DURATION); value = usToTicks(value); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009 CRITICAL_SECTION_START; @@ -137,22 +136,22 @@ void Servo::writeMicroseconds(int value) { } // return the value as degrees -int Servo::read() { return map(this->readMicroseconds() + 1, SERVO_MIN(), SERVO_MAX(), 0, 180); } +int Servo::read() { return map(readMicroseconds() + 1, SERVO_MIN(min), SERVO_MAX(max), 0, 180); } int Servo::readMicroseconds() { - return (this->servoIndex == INVALID_SERVO) ? 0 : ticksToUs(servo_info[this->servoIndex].ticks) + TRIM_DURATION; + return (servoIndex == INVALID_SERVO) ? 0 : ticksToUs(servo_info[servoIndex].ticks) + (TRIM_DURATION); } -bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; } +bool Servo::attached() { return servo_info[servoIndex].Pin.isActive; } void Servo::move(const 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]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/shared/servo.h b/Marlin/src/HAL/shared/servo.h index b6b2d13e98cb..e4905b7295c8 100644 --- a/Marlin/src/HAL/shared/servo.h +++ b/Marlin/src/HAL/shared/servo.h @@ -67,29 +67,27 @@ * With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. */ -#pragma once - #if IS_TEENSY32 - #include "../HAL_TEENSY31_32/HAL_Servo_Teensy.h" + #include "../HAL_TEENSY31_32/Servo.h" #elif IS_TEENSY35 || IS_TEENSY36 - #include "../HAL_TEENSY35_36/HAL_Servo_Teensy.h" + #include "../HAL_TEENSY35_36/Servo.h" #elif defined(TARGET_LPC1768) - #include "../HAL_LPC1768/HAL_Servo_LPC1768.h" + #include "../HAL_LPC1768/Servo.h" #elif defined(__STM32F1__) || defined(TARGET_STM32F1) - #include "../HAL_STM32F1/HAL_Servo_STM32F1.h" + #include "../HAL_STM32F1/Servo.h" #elif defined(STM32GENERIC) && defined(STM32F4) - #include "../HAL_STM32F4/HAL_Servo_STM32F4.h" + #include "../HAL_STM32_F4_F7/Servo.h" #elif defined(ARDUINO_ARCH_STM32) - #include "../HAL_STM32/HAL_Servo_STM32.h" + #include "../HAL_STM32/Servo.h" #elif defined(ARDUINO_ARCH_ESP32) - #include "../HAL_ESP32/HAL_Servo_ESP32.h" + #include "../HAL_ESP32/Servo.h" #else #include - #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM) + #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM) || defined(__SAMD51__) // we're good to go #else - #error "This library only supports boards with an AVR or SAM3X processor." + #error "This library only supports boards with an AVR, SAM3X or SAMD51 processor." #endif #define Servo_VERSION 2 // software version of this library diff --git a/Marlin/src/HAL/shared/servo_private.h b/Marlin/src/HAL/shared/servo_private.h index 12d4740525dd..1d4cdc7e3eb8 100644 --- a/Marlin/src/HAL/shared/servo_private.h +++ b/Marlin/src/HAL/shared/servo_private.h @@ -47,8 +47,10 @@ #include "../HAL_AVR/ServoTimers.h" #elif defined(ARDUINO_ARCH_SAM) #include "../HAL_DUE/ServoTimers.h" +#elif defined(__SAMD51__) + #include "../HAL_SAMD51/ServoTimers.h" #else - #error "This library only supports boards with an AVR or SAM3X processor." + #error "This library only supports boards with an AVR, SAM3X or SAMD51 processor." #endif // Macros @@ -64,10 +66,8 @@ #define INVALID_SERVO 255 // flag indicating an invalid servo index // Convert microseconds to ticks and back (PRESCALER depends on architecture) -#define usToTicks(_us) (clockCyclesPerMicrosecond() * (_us) / (PRESCALER)) -#define ticksToUs(_ticks) (unsigned(_ticks) * (PRESCALER) / clockCyclesPerMicrosecond()) - -//#define NBR_TIMERS ((MAX_SERVOS) / (SERVOS_PER_TIMER)) +#define usToTicks(_us) (clockCyclesPerMicrosecond() * (_us) / (SERVO_TIMER_PRESCALER)) +#define ticksToUs(_ticks) (unsigned(_ticks) * (SERVO_TIMER_PRESCALER) / clockCyclesPerMicrosecond()) // convenience macros #define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / (SERVOS_PER_TIMER))) // returns the timer controlling this servo @@ -78,7 +78,7 @@ // Types typedef struct { - uint8_t nbr : 6 ; // a pin number from 0 to 63 + uint8_t nbr : 7 ; // a pin number from 0 to 127 uint8_t isActive : 1 ; // true if this channel is enabled, pin not pulsed if false } ServoPin_t; diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index e73066fabfaf..a03d1f396359 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -45,7 +45,7 @@ #include "HAL/shared/Delay.h" -#include "module/stepper_indirection.h" +#include "module/stepper/indirection.h" #ifdef ARDUINO #include @@ -57,11 +57,15 @@ #include "gcode/parser.h" #include "gcode/queue.h" +#if ENABLED(TOUCH_BUTTONS) + #include "feature/touch/xpt2046.h" +#endif + #if ENABLED(HOST_ACTION_COMMANDS) #include "feature/host_actions.h" #endif -#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) +#if USE_BEEPER #include "libs/buzzer.h" #endif @@ -85,6 +89,10 @@ #include "feature/bltouch.h" #endif +#if ENABLED(POLL_JOG) + #include "feature/joystick.h" +#endif + #if HAS_SERVOS #include "module/servo.h" #endif @@ -102,7 +110,7 @@ #include "feature/I2CPositionEncoder.h" #endif -#if HAS_TRINAMIC && DISABLED(PS_DEFAULT_OFF) +#if HAS_TRINAMIC && DISABLED(PSU_DEFAULT_OFF) #include "feature/tmc_util.h" #endif @@ -137,6 +145,10 @@ #include "feature/power_loss_recovery.h" #endif +#if ENABLED(CANCEL_OBJECTS) + #include "feature/cancel_object.h" +#endif + #if HAS_FILAMENT_SENSOR #include "feature/runout.h" #endif @@ -165,14 +177,20 @@ #include "feature/prusa_MMU2/mmu2.h" #endif -#if ENABLED(EXTENSIBLE_UI) - #include "lcd/extensible_ui/ui_api.h" -#endif - #if HAS_DRIVER(L6470) #include "libs/L6470/L6470_Marlin.h" #endif +const char NUL_STR[] PROGMEM = "", + G28_STR[] PROGMEM = "G28", + M21_STR[] PROGMEM = "M21", + M23_STR[] PROGMEM = "M23 %s", + M24_STR[] PROGMEM = "M24", + SP_X_STR[] PROGMEM = " X", + SP_Y_STR[] PROGMEM = " Y", + SP_Z_STR[] PROGMEM = " Z", + SP_E_STR[] PROGMEM = " E"; + bool Running = true; // For M109 and M190, this flag may be cleared (by M108) to exit the wait loop @@ -213,10 +231,10 @@ void setup_killpin() { void setup_powerhold() { #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, HIGH); + OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING); #endif - #if HAS_POWER_SWITCH - #if ENABLED(PS_DEFAULT_OFF) + #if ENABLED(PSU_CONTROL) + #if ENABLED(PSU_DEFAULT_OFF) powersupply_on = true; PSU_OFF(); #else powersupply_on = false; PSU_ON(); @@ -271,6 +289,11 @@ void quickstop_stepper() { sync_plan_position(); } +void enable_e_steppers() { + #define _ENA_E(N) enable_E##N(); + REPEAT(E_STEPPERS, _ENA_E) +} + void enable_all_steppers() { #if ENABLED(AUTO_POWER_CONTROL) powerManager.power_on(); @@ -278,31 +301,18 @@ void enable_all_steppers() { enable_X(); enable_Y(); enable_Z(); - enable_E0(); - enable_E1(); - enable_E2(); - enable_E3(); - enable_E4(); - enable_E5(); + enable_e_steppers(); } void disable_e_steppers() { - disable_E0(); - disable_E1(); - disable_E2(); - disable_E3(); - disable_E4(); - disable_E5(); + #define _DIS_E(N) disable_E##N(); + REPEAT(E_STEPPERS, _DIS_E) } void disable_e_stepper(const uint8_t e) { + #define _CASE_DIS_E(N) case N: disable_E##N(); break; 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; - case 5: disable_E5(); break; + REPEAT(EXTRUDERS, _CASE_DIS_E) } } @@ -313,71 +323,6 @@ void disable_all_steppers() { disable_e_steppers(); } -#if HAS_FILAMENT_SENSOR - - void event_filament_runout() { - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (did_pause_print) return; // Action already in progress. Purge triggered repeated runout. - #endif - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onFilamentRunout(ExtUI::getActiveTool()); - #endif - - #if EITHER(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS) - const char tool = '0' - #if NUM_RUNOUT_SENSORS > 1 - + active_extruder - #endif - ; - #endif - - //action:out_of_filament - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_reason = PROMPT_FILAMENT_RUNOUT; - host_action_prompt_end(); - host_action_prompt_begin(PSTR("FilamentRunout T"), false); - SERIAL_CHAR(tool); - SERIAL_EOL(); - host_action_prompt_show(); - #endif - - const bool run_runout_script = !runout.host_handling; - - #if ENABLED(HOST_ACTION_COMMANDS) - if (run_runout_script - && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600") - || strstr(FILAMENT_RUNOUT_SCRIPT, "M125") - #if ENABLED(ADVANCED_PAUSE_FEATURE) - || strstr(FILAMENT_RUNOUT_SCRIPT, "M25") - #endif - ) - ) { - host_action_paused(false); - } - else { - // Legacy Repetier command for use until newer version supports standard dialog - // To be removed later when pause command also triggers dialog - #ifdef ACTION_ON_FILAMENT_RUNOUT - host_action(PSTR(ACTION_ON_FILAMENT_RUNOUT " T"), false); - SERIAL_CHAR(tool); - SERIAL_EOL(); - #endif - - host_action_pause(false); - } - SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " "); - SERIAL_CHAR(tool); - SERIAL_EOL(); - #endif // HOST_ACTION_COMMANDS - - if (run_runout_script) - queue.inject_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); - } - -#endif // HAS_FILAMENT_SENSOR - #if ENABLED(G29_RETRY_AND_RECOVER) void event_probe_failure() { @@ -391,13 +336,13 @@ void disable_all_steppers() { #ifdef ACTION_ON_CANCEL host_action_cancel(); #endif - kill(PSTR(MSG_ERR_PROBING_FAILED)); + kill(GET_TEXT(MSG_LCD_PROBING_FAILED)); #endif } void event_probe_recover() { #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying")); + host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), PSTR("Dismiss")); #endif #ifdef ACTION_ON_G29_RECOVER host_action(PSTR(ACTION_ON_G29_RECOVER)); @@ -409,6 +354,67 @@ void disable_all_steppers() { #endif +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #include "feature/pause.h" +#else + constexpr bool did_pause_print = false; +#endif + +/** + * Printing is active when the print job timer is running + */ +bool printingIsActive() { + return !did_pause_print && (print_job_timer.isRunning() || IS_SD_PRINTING()); +} + +/** + * Printing is paused according to SD or host indicators + */ +bool printingIsPaused() { + return did_pause_print || print_job_timer.isPaused() || IS_SD_PAUSED(); +} + +void startOrResumeJob() { + if (!printingIsPaused()) { + #if ENABLED(CANCEL_OBJECTS) + cancelable.reset(); + #endif + #if ENABLED(LCD_SHOW_E_TOTAL) + e_move_accumulator = 0; + #endif + #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) + ui.reset_remaining_time(); + #endif + } + print_job_timer.start(); +} + +#if ENABLED(SDSUPPORT) + + void abortSDPrinting() { + card.stopSDPrint( + #if SD_RESORT + true + #endif + ); + queue.clear(); + quickstop_stepper(); + print_job_timer.stop(); + #if DISABLED(SD_ABORT_NO_COOLDOWN) + thermalManager.disable_all_heaters(); + #endif + thermalManager.zero_fan_speeds(); + wait_for_heatup = false; + #if ENABLED(POWER_LOSS_RECOVERY) + card.removeJobRecoveryFile(); + #endif + #ifdef EVENT_GCODE_SD_STOP + queue.inject_P(PSTR(EVENT_GCODE_SD_STOP)); + #endif + } + +#endif + /** * Manage several activities: * - Check for Filament Runout @@ -514,7 +520,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { if (ELAPSED(ms, next_home_key_ms)) { next_home_key_ms = ms + HOME_DEBOUNCE_DELAY; LCD_MESSAGEPGM(MSG_AUTO_HOME); - queue.enqueue_now_P(PSTR("G28")); + queue.enqueue_now_P(G28_STR); } } #endif @@ -535,40 +541,27 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #if ENABLED(SWITCHING_EXTRUDER) bool oldstatus; switch (active_extruder) { - default: oldstatus = E0_ENABLE_READ; enable_E0(); break; + default: oldstatus = E0_ENABLE_READ(); enable_E0(); break; #if E_STEPPERS > 1 - case 2: case 3: oldstatus = E1_ENABLE_READ; enable_E1(); break; + case 2: case 3: oldstatus = E1_ENABLE_READ(); enable_E1(); break; #if E_STEPPERS > 2 - case 4: case 5: oldstatus = E2_ENABLE_READ; enable_E2(); break; + case 4: case 5: oldstatus = E2_ENABLE_READ(); enable_E2(); break; #endif // E_STEPPERS > 2 #endif // E_STEPPERS > 1 } #else // !SWITCHING_EXTRUDER bool oldstatus; switch (active_extruder) { - default: oldstatus = E0_ENABLE_READ; enable_E0(); break; - #if E_STEPPERS > 1 - case 1: oldstatus = E1_ENABLE_READ; enable_E1(); break; - #if E_STEPPERS > 2 - case 2: oldstatus = E2_ENABLE_READ; enable_E2(); break; - #if E_STEPPERS > 3 - case 3: oldstatus = E3_ENABLE_READ; enable_E3(); break; - #if E_STEPPERS > 4 - case 4: oldstatus = E4_ENABLE_READ; enable_E4(); break; - #if E_STEPPERS > 5 - case 5: oldstatus = E5_ENABLE_READ; enable_E5(); break; - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 + default: + #define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); enable_E##N(); break; + REPEAT(E_STEPPERS, _CASE_EN); } - #endif // !SWITCHING_EXTRUDER + #endif - const float olde = current_position[E_AXIS]; - current_position[E_AXIS] += EXTRUDER_RUNOUT_EXTRUDE; - planner.buffer_line(current_position, MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED), active_extruder); - current_position[E_AXIS] = olde; + const float olde = current_position.e; + current_position.e += EXTRUDER_RUNOUT_EXTRUDE; + line_to_current_position(MMM_TO_MMS(EXTRUDER_RUNOUT_SPEED)); + current_position.e = olde; planner.set_e_position_mm(olde); planner.synchronize(); @@ -584,22 +577,8 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { } #else // !SWITCHING_EXTRUDER switch (active_extruder) { - case 0: E0_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 1 - case 1: E1_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 2 - case 2: E2_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 3 - case 3: E3_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 4 - case 4: E4_ENABLE_WRITE(oldstatus); break; - #if E_STEPPERS > 5 - case 5: E5_ENABLE_WRITE(oldstatus); break; - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 + #define _CASE_RESTORE(N) case N: E##N##_ENABLE_WRITE(oldstatus); break; + REPEAT(E_STEPPERS, _CASE_RESTORE); } #endif // !SWITCHING_EXTRUDER @@ -612,7 +591,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { if (delayed_move_time && ELAPSED(ms, delayed_move_time + 1000UL) && IsRunning()) { // travel moves have been received so enact them delayed_move_time = 0xFFFFFFFFUL; // force moves to be done - set_destination_from_current(); + destination = current_position; prepare_move_to_destination(); } #endif @@ -622,7 +601,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(MONITOR_DRIVER_STATUS) - monitor_tmc_driver(); + monitor_tmc_drivers(); #endif #if ENABLED(MONITOR_L6470_DRIVER_STATUS) @@ -655,6 +634,21 @@ void idle( bool no_stepper_sleep/*=false*/ #endif ) { + #if ENABLED(POWER_LOSS_RECOVERY) && PIN_EXISTS(POWER_LOSS) + recovery.outage(); + #endif + + #if ENABLED(SPI_ENDSTOPS) + if (endstops.tmc_spi_homing.any + #if ENABLED(IMPROVE_HOMING_RELIABILITY) + && ELAPSED(millis(), sg_guard_period) + #endif + ) { + for (uint8_t i = 4; i--;) // Read SGT 4 times per idle loop + if (endstops.tmc_spi_homing_check()) break; + } + #endif + #if ENABLED(MAX7219_DEBUG) max7219.idle_tasks(); #endif @@ -677,15 +671,18 @@ void idle( print_job_timer.tick(); #endif - #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER) + #if USE_BEEPER buzzer.tick(); #endif #if ENABLED(I2C_POSITION_ENCODERS) static millis_t i2cpem_next_update_ms; - if (planner.has_blocks_queued() && ELAPSED(millis(), i2cpem_next_update_ms)) { - I2CPEM.update(); - i2cpem_next_update_ms = millis() + I2CPE_MIN_UPD_TIME_MS; + if (planner.has_blocks_queued()) { + const millis_t ms = millis(); + if (ELAPSED(ms, i2cpem_next_update_ms)) { + I2CPEM.update(); + i2cpem_next_update_ms = ms + I2CPE_MIN_UPD_TIME_MS; + } } #endif @@ -711,31 +708,36 @@ void idle( #if ENABLED(PRUSA_MMU2) mmu2.mmu_loop(); #endif + + #if ENABLED(POLL_JOG) + joystick.inject_jog_moves(); + #endif } /** * Kill all activity and lock the machine. * After this the machine will need to be reset. */ -void kill(PGM_P const lcd_msg/*=nullptr*/) { +void kill(PGM_P const lcd_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr*/, const bool steppers_off/*=false*/) { thermalManager.disable_all_heaters(); SERIAL_ERROR_MSG(MSG_ERR_KILLED); #if HAS_DISPLAY - ui.kill_screen(lcd_msg ? lcd_msg : PSTR(MSG_KILLED)); + ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR); #else - UNUSED(lcd_msg); + UNUSED(lcd_error); + UNUSED(lcd_component); #endif #ifdef ACTION_ON_KILL host_action_kill(); #endif - minkill(); + minkill(steppers_off); } -void minkill() { +void minkill(const bool steppers_off/*=false*/) { // Wait a short time (allows messages to get out before shutting down. for (int i = 1000; i--;) DELAY_US(600); @@ -745,9 +747,13 @@ void minkill() { // Wait to ensure all interrupts stopped for (int i = 1000; i--;) DELAY_US(250); - thermalManager.disable_all_heaters(); // turn off heaters again + // Reiterate heaters off + thermalManager.disable_all_heaters(); - #if HAS_POWER_SWITCH + // Power off all steppers (for M112) or just the E steppers + steppers_off ? disable_all_steppers() : disable_e_steppers(); + + #if ENABLED(PSU_CONTROL) PSU_OFF(); #endif @@ -758,29 +764,17 @@ void minkill() { #if HAS_KILL // Wait for kill to be released - while (!READ(KILL_PIN)) { - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif - } + while (!READ(KILL_PIN)) watchdog_refresh(); // Wait for kill to be pressed - while (READ(KILL_PIN)) { - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif - } + while (READ(KILL_PIN)) watchdog_refresh(); - void(*resetFunc)(void) = 0; // Declare resetFunc() at address 0 - resetFunc(); // Jump to address 0 + void (*resetFunc)() = 0; // Declare resetFunc() at address 0 + resetFunc(); // Jump to address 0 #else // !HAS_KILL - for (;;) { - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif - } // Wait for reset + for (;;) watchdog_refresh(); // Wait for reset #endif // !HAS_KILL } @@ -858,9 +852,13 @@ void setup() { runout.setup(); #endif + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.setup(); + #endif + setup_killpin(); - #if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) + #if HAS_TMC220x tmc_serial_begin(); #endif @@ -915,10 +913,11 @@ void setup() { SERIAL_EOL(); #if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_CONFIGURATION_VER); - SERIAL_ECHOPGM(STRING_DISTRIBUTION_DATE); - SERIAL_ECHOLNPGM(MSG_AUTHOR STRING_CONFIG_H_AUTHOR); + SERIAL_ECHO_MSG( + MSG_CONFIGURATION_VER + STRING_DISTRIBUTION_DATE + MSG_AUTHOR STRING_CONFIG_H_AUTHOR + ); SERIAL_ECHO_MSG("Compiled: " __DATE__); #endif @@ -927,25 +926,32 @@ void setup() { // UI must be initialized before EEPROM // (because EEPROM code calls the UI). - ui.init(); - ui.reset_status(); + // Set up LEDs early + #if HAS_COLOR_LEDS + leds.setup(); + #endif + + ui.init(); #if HAS_SPI_LCD && ENABLED(SHOW_BOOTSCREEN) ui.show_bootscreen(); #endif - #if ENABLED(SDIO_SUPPORT) && !PIN_EXISTS(SD_DETECT) - // Auto-mount the SD for EEPROM.dat emulation - if (!card.isDetected()) card.initsd(); + #if ENABLED(SDSUPPORT) + card.mount(); // Mount the SD card before settings.first_load #endif // Load data from EEPROM if available (or use defaults) // This also updates variables in the planner, elsewhere - (void)settings.load(); + settings.first_load(); + + #if ENABLED(TOUCH_BUTTONS) + touch.init(); + #endif #if HAS_M206_COMMAND // Initialize current position based on home_offset - LOOP_XYZ(a) current_position[a] += home_offset[a]; + current_position += home_offset; #endif // Vital to init stepper/planner equivalent for current_position @@ -955,6 +961,8 @@ void setup() { print_job_timer.init(); // Initial setup of print job timer + ui.reset_status(); // Print startup message after print statistics are loaded + endstops.init(); // Init endstops and pullups stepper.init(); // Init stepper. This enables interrupts! @@ -1018,10 +1026,6 @@ void setup() { OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // OFF #endif - #if HAS_COLOR_LEDS - leds.setup(); - #endif - #if HAS_CASE_LIGHT #if DISABLED(CASE_LIGHT_USE_NEOPIXEL) if (PWM_PIN(CASE_LIGHT_PIN)) SET_PWM(CASE_LIGHT_PIN); else SET_OUTPUT(CASE_LIGHT_PIN); @@ -1094,11 +1098,19 @@ void setup() { init_closedloop(); #endif + #ifdef STARTUP_COMMANDS + queue.inject_P(PSTR(STARTUP_COMMANDS)); + #endif + #if ENABLED(INIT_SDCARD_ON_BOOT) && !HAS_SPI_LCD card.beginautostart(); #endif - #if HAS_TRINAMIC && DISABLED(PS_DEFAULT_OFF) + #if ENABLED(HOST_PROMPT_SUPPORT) + host_action_prompt_end(); + #endif + + #if HAS_TRINAMIC && DISABLED(PSU_DEFAULT_OFF) test_tmc_connection(true, true, true, true); #endif @@ -1119,37 +1131,15 @@ void loop() { for (;;) { - #if ENABLED(SDSUPPORT) + idle(); // Do an idle first so boot is slightly faster + #if ENABLED(SDSUPPORT) card.checkautostart(); + if (card.flag.abort_sd_printing) abortSDPrinting(); + #endif - if (card.flag.abort_sd_printing) { - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - queue.clear(); - quickstop_stepper(); - print_job_timer.stop(); - #if DISABLED(SD_ABORT_NO_COOLDOWN) - thermalManager.disable_all_heaters(); - #endif - thermalManager.zero_fan_speeds(); - wait_for_heatup = false; - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - #ifdef EVENT_GCODE_SD_STOP - queue.inject_P(PSTR(EVENT_GCODE_SD_STOP)); - #endif - } - - #endif // SDSUPPORT - - if (queue.length < BUFSIZE) queue.get_available_commands(); queue.advance(); + endstops.event_handler(); - idle(); } } diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index cef5950b990b..8b44298a91bb 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -51,96 +51,96 @@ void manage_inactivity(const bool ignore_stepper_queue=false); // #if AXIS_DRIVER_TYPE_X(L6470) extern L6470 stepperX; - #define X_enable NOOP - #define X_disable stepperX.free() + #define X_enable() NOOP + #define X_disable() stepperX.free() #elif HAS_X_ENABLE - #define X_enable X_ENABLE_WRITE( X_ENABLE_ON) - #define X_disable X_ENABLE_WRITE(!X_ENABLE_ON) + #define X_enable() X_ENABLE_WRITE( X_ENABLE_ON) + #define X_disable() X_ENABLE_WRITE(!X_ENABLE_ON) #else - #define X_enable NOOP - #define X_disable NOOP + #define X_enable() NOOP + #define X_disable() NOOP #endif #if AXIS_DRIVER_TYPE_X2(L6470) extern L6470 stepperX2; - #define X2_enable NOOP - #define X2_disable stepperX2.free() + #define X2_enable() NOOP + #define X2_disable() stepperX2.free() #elif HAS_X2_ENABLE - #define X2_enable X2_ENABLE_WRITE( X_ENABLE_ON) - #define X2_disable X2_ENABLE_WRITE(!X_ENABLE_ON) + #define X2_enable() X2_ENABLE_WRITE( X_ENABLE_ON) + #define X2_disable() X2_ENABLE_WRITE(!X_ENABLE_ON) #else - #define X2_enable NOOP - #define X2_disable NOOP + #define X2_enable() NOOP + #define X2_disable() NOOP #endif -#define enable_X() do{ X_enable; X2_enable; }while(0) -#define disable_X() do{ X_disable; X2_disable; CBI(axis_known_position, X_AXIS); }while(0) +#define enable_X() do{ X_enable(); X2_enable(); }while(0) +#define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0) #if AXIS_DRIVER_TYPE_Y(L6470) extern L6470 stepperY; - #define Y_enable NOOP - #define Y_disable stepperY.free() + #define Y_enable() NOOP + #define Y_disable() stepperY.free() #elif HAS_Y_ENABLE - #define Y_enable Y_ENABLE_WRITE( Y_ENABLE_ON) - #define Y_disable Y_ENABLE_WRITE(!Y_ENABLE_ON) + #define Y_enable() Y_ENABLE_WRITE( Y_ENABLE_ON) + #define Y_disable() Y_ENABLE_WRITE(!Y_ENABLE_ON) #else - #define Y_enable NOOP - #define Y_disable NOOP + #define Y_enable() NOOP + #define Y_disable() NOOP #endif #if AXIS_DRIVER_TYPE_Y2(L6470) extern L6470 stepperY2; - #define Y2_enable NOOP - #define Y2_disable stepperY2.free() + #define Y2_enable() NOOP + #define Y2_disable() stepperY2.free() #elif HAS_Y2_ENABLE - #define Y2_enable Y2_ENABLE_WRITE( Y_ENABLE_ON) - #define Y2_disable Y2_ENABLE_WRITE(!Y_ENABLE_ON) + #define Y2_enable() Y2_ENABLE_WRITE( Y_ENABLE_ON) + #define Y2_disable() Y2_ENABLE_WRITE(!Y_ENABLE_ON) #else - #define Y2_enable NOOP - #define Y2_disable NOOP + #define Y2_enable() NOOP + #define Y2_disable() NOOP #endif -#define enable_Y() do{ Y_enable; Y2_enable; }while(0) -#define disable_Y() do{ Y_disable; Y2_disable; CBI(axis_known_position, Y_AXIS); }while(0) +#define enable_Y() do{ Y_enable(); Y2_enable(); }while(0) +#define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0) #if AXIS_DRIVER_TYPE_Z(L6470) extern L6470 stepperZ; - #define Z_enable NOOP - #define Z_disable stepperZ.free() + #define Z_enable() NOOP + #define Z_disable() stepperZ.free() #elif HAS_Z_ENABLE - #define Z_enable Z_ENABLE_WRITE( Z_ENABLE_ON) - #define Z_disable Z_ENABLE_WRITE(!Z_ENABLE_ON) + #define Z_enable() Z_ENABLE_WRITE( Z_ENABLE_ON) + #define Z_disable() Z_ENABLE_WRITE(!Z_ENABLE_ON) #else - #define Z_enable NOOP - #define Z_disable NOOP + #define Z_enable() NOOP + #define Z_disable() NOOP #endif #if AXIS_DRIVER_TYPE_Z2(L6470) extern L6470 stepperZ2; - #define Z2_enable NOOP - #define Z2_disable stepperZ2.free() + #define Z2_enable() NOOP + #define Z2_disable() stepperZ2.free() #elif HAS_Z2_ENABLE - #define Z2_enable Z2_ENABLE_WRITE( Z_ENABLE_ON) - #define Z2_disable Z2_ENABLE_WRITE(!Z_ENABLE_ON) + #define Z2_enable() Z2_ENABLE_WRITE( Z_ENABLE_ON) + #define Z2_disable() Z2_ENABLE_WRITE(!Z_ENABLE_ON) #else - #define Z2_enable NOOP - #define Z2_disable NOOP + #define Z2_enable() NOOP + #define Z2_disable() NOOP #endif #if AXIS_DRIVER_TYPE_Z3(L6470) extern L6470 stepperZ3; - #define Z3_enable NOOP - #define Z3_disable stepperZ3.free() + #define Z3_enable() NOOP + #define Z3_disable() stepperZ3.free() #elif HAS_Z3_ENABLE - #define Z3_enable Z3_ENABLE_WRITE( Z_ENABLE_ON) - #define Z3_disable Z3_ENABLE_WRITE(!Z_ENABLE_ON) + #define Z3_enable() Z3_ENABLE_WRITE( Z_ENABLE_ON) + #define Z3_disable() Z3_ENABLE_WRITE(!Z_ENABLE_ON) #else - #define Z3_enable NOOP - #define Z3_disable NOOP + #define Z3_enable() NOOP + #define Z3_disable() NOOP #endif -#define enable_Z() do{ Z_enable; Z2_enable; Z3_enable; }while(0) -#define disable_Z() do{ Z_disable; Z2_disable; Z3_disable; CBI(axis_known_position, Z_AXIS); }while(0) +#define enable_Z() do{ Z_enable(); Z2_enable(); Z3_enable(); }while(0) +#define disable_Z() do{ Z_disable(); Z2_disable(); Z3_disable(); CBI(axis_known_position, Z_AXIS); }while(0) // // Extruder Stepper enable / disable @@ -149,74 +149,74 @@ void manage_inactivity(const bool ignore_stepper_queue=false); // define the individual enables/disables #if AXIS_DRIVER_TYPE_E0(L6470) extern L6470 stepperE0; - #define E0_enable NOOP - #define E0_disable do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define E0_enable() NOOP + #define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif HAS_E0_ENABLE - #define E0_enable E0_ENABLE_WRITE( E_ENABLE_ON) - #define E0_disable E0_ENABLE_WRITE(!E_ENABLE_ON) + #define E0_enable() E0_ENABLE_WRITE( E_ENABLE_ON) + #define E0_disable() E0_ENABLE_WRITE(!E_ENABLE_ON) #else - #define E0_enable NOOP - #define E0_disable NOOP + #define E0_enable() NOOP + #define E0_disable() NOOP #endif #if AXIS_DRIVER_TYPE_E1(L6470) extern L6470 stepperE1; - #define E1_enable NOOP - #define E1_disable do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define E1_enable() NOOP + #define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 1 && HAS_E1_ENABLE - #define E1_enable E1_ENABLE_WRITE( E_ENABLE_ON) - #define E1_disable E1_ENABLE_WRITE(!E_ENABLE_ON) + #define E1_enable() E1_ENABLE_WRITE( E_ENABLE_ON) + #define E1_disable() E1_ENABLE_WRITE(!E_ENABLE_ON) #else - #define E1_enable NOOP - #define E1_disable NOOP + #define E1_enable() NOOP + #define E1_disable() NOOP #endif #if AXIS_DRIVER_TYPE_E2(L6470) extern L6470 stepperE2; - #define E2_enable NOOP - #define E2_disable do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define E2_enable() NOOP + #define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 2 && HAS_E2_ENABLE - #define E2_enable E2_ENABLE_WRITE( E_ENABLE_ON) - #define E2_disable E2_ENABLE_WRITE(!E_ENABLE_ON) + #define E2_enable() E2_ENABLE_WRITE( E_ENABLE_ON) + #define E2_disable() E2_ENABLE_WRITE(!E_ENABLE_ON) #else - #define E2_enable NOOP - #define E2_disable NOOP + #define E2_enable() NOOP + #define E2_disable() NOOP #endif #if AXIS_DRIVER_TYPE_E3(L6470) extern L6470 stepperE3; - #define E3_enable NOOP - #define E3_disable do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define E3_enable() NOOP + #define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 3 && HAS_E3_ENABLE - #define E3_enable E3_ENABLE_WRITE( E_ENABLE_ON) - #define E3_disable E3_ENABLE_WRITE(!E_ENABLE_ON) + #define E3_enable() E3_ENABLE_WRITE( E_ENABLE_ON) + #define E3_disable() E3_ENABLE_WRITE(!E_ENABLE_ON) #else - #define E3_enable NOOP - #define E3_disable NOOP + #define E3_enable() NOOP + #define E3_disable() NOOP #endif #if AXIS_DRIVER_TYPE_E4(L6470) extern L6470 stepperE4; - #define E4_enable NOOP - #define E4_disable do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define E4_enable() NOOP + #define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 4 && HAS_E4_ENABLE - #define E4_enable E4_ENABLE_WRITE( E_ENABLE_ON) - #define E4_disable E4_ENABLE_WRITE(!E_ENABLE_ON) + #define E4_enable() E4_ENABLE_WRITE( E_ENABLE_ON) + #define E4_disable() E4_ENABLE_WRITE(!E_ENABLE_ON) #else - #define E4_enable NOOP - #define E4_disable NOOP + #define E4_enable() NOOP + #define E4_disable() NOOP #endif #if AXIS_DRIVER_TYPE_E5(L6470) extern L6470 stepperE5; - #define E5_enable NOOP - #define E5_disable do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0) + #define E5_enable() NOOP + #define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0) #elif E_STEPPERS > 5 && HAS_E5_ENABLE - #define E5_enable E5_ENABLE_WRITE( E_ENABLE_ON) - #define E5_disable E5_ENABLE_WRITE(!E_ENABLE_ON) + #define E5_enable() E5_ENABLE_WRITE( E_ENABLE_ON) + #define E5_disable() E5_ENABLE_WRITE(!E_ENABLE_ON) #else - #define E5_enable NOOP - #define E5_disable NOOP + #define E5_enable() NOOP + #define E5_disable() NOOP #endif #if ENABLED(MIXING_EXTRUDER) @@ -225,20 +225,20 @@ void manage_inactivity(const bool ignore_stepper_queue=false); * Mixing steppers synchronize their enable (and direction) together */ #if MIXING_STEPPERS > 5 - #define enable_E0() { E0_enable; E1_enable; E2_enable; E3_enable; E4_enable; E5_enable; } - #define disable_E0() { E0_disable; E1_disable; E2_disable; E3_disable; E4_disable; E5_disable; } + #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); } + #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); } #elif MIXING_STEPPERS > 4 - #define enable_E0() { E0_enable; E1_enable; E2_enable; E3_enable; E4_enable; } - #define disable_E0() { E0_disable; E1_disable; E2_disable; E3_disable; E4_disable; } + #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); } + #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); } #elif MIXING_STEPPERS > 3 - #define enable_E0() { E0_enable; E1_enable; E2_enable; E3_enable; } - #define disable_E0() { E0_disable; E1_disable; E2_disable; E3_disable; } + #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); } + #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); } #elif MIXING_STEPPERS > 2 - #define enable_E0() { E0_enable; E1_enable; E2_enable; } - #define disable_E0() { E0_disable; E1_disable; E2_disable; } + #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); } + #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); } #else - #define enable_E0() { E0_enable; E1_enable; } - #define disable_E0() { E0_disable; E1_disable; } + #define enable_E0() { E0_enable(); E1_enable(); } + #define disable_E0() { E0_disable(); E1_disable(); } #endif #define enable_E1() NOOP #define disable_E1() NOOP @@ -254,48 +254,48 @@ void manage_inactivity(const bool ignore_stepper_queue=false); #else // !MIXING_EXTRUDER #if HAS_E0_ENABLE - #define enable_E0() E0_enable - #define disable_E0() E0_disable + #define enable_E0() E0_enable() + #define disable_E0() E0_disable() #else #define enable_E0() NOOP #define disable_E0() NOOP #endif #if E_STEPPERS > 1 && HAS_E1_ENABLE - #define enable_E1() E1_enable - #define disable_E1() E1_disable + #define enable_E1() E1_enable() + #define disable_E1() E1_disable() #else #define enable_E1() NOOP #define disable_E1() NOOP #endif #if E_STEPPERS > 2 && HAS_E2_ENABLE - #define enable_E2() E2_enable - #define disable_E2() E2_disable + #define enable_E2() E2_enable() + #define disable_E2() E2_disable() #else #define enable_E2() NOOP #define disable_E2() NOOP #endif #if E_STEPPERS > 3 && HAS_E3_ENABLE - #define enable_E3() E3_enable - #define disable_E3() E3_disable + #define enable_E3() E3_enable() + #define disable_E3() E3_disable() #else #define enable_E3() NOOP #define disable_E3() NOOP #endif #if E_STEPPERS > 4 && HAS_E4_ENABLE - #define enable_E4() E4_enable - #define disable_E4() E4_disable + #define enable_E4() E4_enable() + #define disable_E4() E4_disable() #else #define enable_E4() NOOP #define disable_E4() NOOP #endif #if E_STEPPERS > 5 && HAS_E5_ENABLE - #define enable_E5() E5_enable - #define disable_E5() E5_disable + #define enable_E5() E5_enable() + #define disable_E5() E5_disable() #else #define enable_E5() NOOP #define disable_E5() NOOP @@ -316,13 +316,14 @@ void manage_inactivity(const bool ignore_stepper_queue=false); /** * The axis order in all axis related arrays is X, Y, Z, E */ +void enable_e_steppers(); void enable_all_steppers(); void disable_e_stepper(const uint8_t e); void disable_e_steppers(); void disable_all_steppers(); -void kill(PGM_P const lcd_msg=nullptr); -void minkill(); +void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false); +void minkill(const bool steppers_off=false); void quickstop_stepper(); @@ -330,6 +331,10 @@ extern bool Running; inline bool IsRunning() { return Running; } inline bool IsStopped() { return !Running; } +bool printingIsActive(); +bool printingIsPaused(); +void startOrResumeJob(); + extern bool wait_for_heatup; #if HAS_RESUME_CONTINUE @@ -347,7 +352,7 @@ extern millis_t max_inactive_time, stepper_inactive_time; extern uint8_t controllerfan_speed; #endif -#if HAS_POWER_SWITCH +#if ENABLED(PSU_CONTROL) extern bool powersupply_on; #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_HIGH); powersupply_on = true; }while(0) #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_HIGH); powersupply_on = false; }while(0) @@ -364,14 +369,13 @@ bool pin_is_protected(const pin_t pin); void protected_pin_err(); #if HAS_SUICIDE - inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); } -#endif - -#if HAS_FILAMENT_SENSOR - void event_filament_runout(); + inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); } #endif #if ENABLED(G29_RETRY_AND_RECOVER) void event_probe_recover(); void event_probe_failure(); #endif + +extern const char NUL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[], + SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[]; diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index c9c5d412fa91..5cdf2a4944fd 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -21,6 +21,8 @@ */ #pragma once +#include "macros.h" + #define BOARD_UNKNOWN -1 // @@ -88,92 +90,105 @@ #define BOARD_RAMPS_ENDER_4 1134 // Creality: Ender-4, CR-8 #define BOARD_RAMPS_CREALITY 1135 // Creality: CR10S, CR20, CR-X #define BOARD_RAMPS_DAGOMA 1136 // Dagoma F5 -#define BOARD_FYSETC_F6_13 1137 // Fysetc F6 +#define BOARD_FYSETC_F6_13 1137 // FYSETC F6 #define BOARD_DUPLICATOR_I3_PLUS 1138 // Wanhao Duplicator i3 Plus #define BOARD_VORON 1139 // VORON Design #define BOARD_TRONXY_V3_1_0 1140 // Tronxy TRONXY-V3-1.0 #define BOARD_Z_BOLT_X_SERIES 1141 // Z-Bolt X Series +#define BOARD_TT_OSCAR 1142 // TT OSCAR +#define BOARD_OVERLORD 1143 // Overlord/Overlord Pro +#define BOARD_HJC2560C_REV1 1144 // ADIMLab Gantry v1 +#define BOARD_HJC2560C_REV2 1145 // ADIMLab Gantry v2 +#define BOARD_TANGO 1146 // BIQU Tango V1 +#define BOARD_MKS_GEN_L_V2 1147 // MKS GEN L V2 + +// +// RAMBo and derivatives +// + +#define BOARD_RAMBO 1200 // Rambo +#define BOARD_MINIRAMBO 1201 // Mini-Rambo +#define BOARD_MINIRAMBO_10A 1202 // Mini-Rambo 1.0a +#define BOARD_EINSY_RAMBO 1203 // Einsy Rambo +#define BOARD_EINSY_RETRO 1204 // Einsy Retro +#define BOARD_SCOOVO_X9H 1205 // abee Scoovo X9H // // Other ATmega1280, ATmega2560 // -#define BOARD_CNCONTROLS_11 1200 // Cartesio CN Controls V11 -#define BOARD_CNCONTROLS_12 1201 // Cartesio CN Controls V12 -#define BOARD_CHEAPTRONIC 1202 // Cheaptronic v1.0 -#define BOARD_CHEAPTRONIC_V2 1203 // Cheaptronic v2.0 -#define BOARD_MIGHTYBOARD_REVE 1204 // Makerbot Mightyboard Revision E -#define BOARD_MEGATRONICS 1205 // Megatronics -#define BOARD_MEGATRONICS_2 1206 // Megatronics v2.0 -#define BOARD_MEGATRONICS_3 1207 // Megatronics v3.0 -#define BOARD_MEGATRONICS_31 1208 // Megatronics v3.1 -#define BOARD_MEGATRONICS_32 1209 // Megatronics v3.2 -#define BOARD_RAMBO 1210 // Rambo -#define BOARD_MINIRAMBO 1211 // Mini-Rambo -#define BOARD_MINIRAMBO_10A 1212 // Mini-Rambo 1.0a -#define BOARD_EINSY_RAMBO 1213 // Einsy Rambo -#define BOARD_EINSY_RETRO 1214 // Einsy Retro -#define BOARD_ELEFU_3 1215 // Elefu Ra Board (v3) -#define BOARD_LEAPFROG 1216 // Leapfrog -#define BOARD_MEGACONTROLLER 1217 // Mega controller -#define BOARD_SCOOVO_X9H 1218 // abee Scoovo X9H -#define BOARD_GT2560_REV_A 1219 // Geeetech GT2560 Rev. A -#define BOARD_GT2560_REV_A_PLUS 1220 // Geeetech GT2560 Rev. A+ (with auto level probe) -#define BOARD_GT2560_V3 1221 // Geeetech GT2560 Rev B for A10(M/D) -#define BOARD_GT2560_V3_MC2 1222 // Geeetech GT2560 Rev B for Mecreator2 -#define BOARD_GT2560_V3_A20 1223 // Geeetech GT2560 Rev B for A20(M/D) -#define BOARD_EINSTART_S 1224 // Einstart retrofit +#define BOARD_CNCONTROLS_11 1300 // Cartesio CN Controls V11 +#define BOARD_CNCONTROLS_12 1301 // Cartesio CN Controls V12 +#define BOARD_CNCONTROLS_15 1302 // Cartesio CN Controls V15 +#define BOARD_CHEAPTRONIC 1303 // Cheaptronic v1.0 +#define BOARD_CHEAPTRONIC_V2 1304 // Cheaptronic v2.0 +#define BOARD_MIGHTYBOARD_REVE 1305 // Makerbot Mightyboard Revision E +#define BOARD_MEGATRONICS 1306 // Megatronics +#define BOARD_MEGATRONICS_2 1307 // Megatronics v2.0 +#define BOARD_MEGATRONICS_3 1308 // Megatronics v3.0 +#define BOARD_MEGATRONICS_31 1309 // Megatronics v3.1 +#define BOARD_MEGATRONICS_32 1310 // Megatronics v3.2 +#define BOARD_ELEFU_3 1311 // Elefu Ra Board (v3) +#define BOARD_LEAPFROG 1312 // Leapfrog +#define BOARD_MEGACONTROLLER 1313 // Mega controller +#define BOARD_GT2560_REV_A 1314 // Geeetech GT2560 Rev. A +#define BOARD_GT2560_REV_A_PLUS 1315 // Geeetech GT2560 Rev. A+ (with auto level probe) +#define BOARD_GT2560_V3 1316 // Geeetech GT2560 Rev B for A10(M/D) +#define BOARD_GT2560_V3_MC2 1317 // Geeetech GT2560 Rev B for Mecreator2 +#define BOARD_GT2560_V3_A20 1318 // Geeetech GT2560 Rev B for A20(M/D) +#define BOARD_EINSTART_S 1319 // Einstart retrofit +#define BOARD_WANHAO_ONEPLUS 1320 // Wanhao 0ne+ i3 Mini // // ATmega1281, ATmega2561 // -#define BOARD_MINITRONICS 1300 // Minitronics v1.0/1.1 -#define BOARD_SILVER_GATE 1301 // Silvergate v1.0 +#define BOARD_MINITRONICS 1400 // Minitronics v1.0/1.1 +#define BOARD_SILVER_GATE 1401 // Silvergate v1.0 // // Sanguinololu and Derivatives - ATmega644P, ATmega1284P // -#define BOARD_SANGUINOLOLU_11 1400 // Sanguinololu < 1.2 -#define BOARD_SANGUINOLOLU_12 1401 // Sanguinololu 1.2 and above -#define BOARD_MELZI 1402 // Melzi -#define BOARD_MELZI_MAKR3D 1403 // Melzi with ATmega1284 (MaKr3d version) -#define BOARD_MELZI_CREALITY 1404 // Melzi Creality3D board (for CR-10 etc) -#define BOARD_MELZI_MALYAN 1405 // Melzi Malyan M150 board -#define BOARD_MELZI_TRONXY 1406 // Tronxy X5S -#define BOARD_STB_11 1407 // STB V1.1 -#define BOARD_AZTEEG_X1 1408 // Azteeg X1 -#define BOARD_ANET_10 1409 // Anet 1.0 (Melzi clone) +#define BOARD_SANGUINOLOLU_11 1500 // Sanguinololu < 1.2 +#define BOARD_SANGUINOLOLU_12 1501 // Sanguinololu 1.2 and above +#define BOARD_MELZI 1502 // Melzi +#define BOARD_MELZI_MAKR3D 1503 // Melzi with ATmega1284 (MaKr3d version) +#define BOARD_MELZI_CREALITY 1504 // Melzi Creality3D board (for CR-10 etc) +#define BOARD_MELZI_MALYAN 1505 // Melzi Malyan M150 board +#define BOARD_MELZI_TRONXY 1506 // Tronxy X5S +#define BOARD_STB_11 1507 // STB V1.1 +#define BOARD_AZTEEG_X1 1508 // Azteeg X1 +#define BOARD_ANET_10 1509 // Anet 1.0 (Melzi clone) // // Other ATmega644P, ATmega644, ATmega1284P // -#define BOARD_GEN3_MONOLITHIC 1500 // Gen3 Monolithic Electronics -#define BOARD_GEN3_PLUS 1501 // Gen3+ -#define BOARD_GEN6 1502 // Gen6 -#define BOARD_GEN6_DELUXE 1503 // Gen6 deluxe -#define BOARD_GEN7_CUSTOM 1504 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics" -#define BOARD_GEN7_12 1505 // Gen7 v1.1, v1.2 -#define BOARD_GEN7_13 1506 // Gen7 v1.3 -#define BOARD_GEN7_14 1507 // Gen7 v1.4 -#define BOARD_OMCA_A 1508 // Alpha OMCA board -#define BOARD_OMCA 1509 // Final OMCA board -#define BOARD_SETHI 1510 // Sethi 3D_1 +#define BOARD_GEN3_MONOLITHIC 1600 // Gen3 Monolithic Electronics +#define BOARD_GEN3_PLUS 1601 // Gen3+ +#define BOARD_GEN6 1602 // Gen6 +#define BOARD_GEN6_DELUXE 1603 // Gen6 deluxe +#define BOARD_GEN7_CUSTOM 1604 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics" +#define BOARD_GEN7_12 1605 // Gen7 v1.1, v1.2 +#define BOARD_GEN7_13 1606 // Gen7 v1.3 +#define BOARD_GEN7_14 1607 // Gen7 v1.4 +#define BOARD_OMCA_A 1608 // Alpha OMCA board +#define BOARD_OMCA 1609 // Final OMCA board +#define BOARD_SETHI 1610 // Sethi 3D_1 // // Teensyduino - AT90USB1286, AT90USB1286P // -#define BOARD_TEENSYLU 1600 // Teensylu -#define BOARD_PRINTRBOARD 1601 // Printrboard (AT90USB1286) -#define BOARD_PRINTRBOARD_REVF 1602 // Printrboard Revision F (AT90USB1286) -#define BOARD_BRAINWAVE 1603 // Brainwave (AT90USB646) -#define BOARD_BRAINWAVE_PRO 1604 // Brainwave Pro (AT90USB1286) -#define BOARD_SAV_MKI 1605 // SAV Mk-I (AT90USB1286) -#define BOARD_TEENSY2 1606 // Teensy++2.0 (AT90USB1286) -#define BOARD_5DPRINT 1607 // 5DPrint D8 Driver Board +#define BOARD_TEENSYLU 1700 // Teensylu +#define BOARD_PRINTRBOARD 1701 // Printrboard (AT90USB1286) +#define BOARD_PRINTRBOARD_REVF 1702 // Printrboard Revision F (AT90USB1286) +#define BOARD_BRAINWAVE 1703 // Brainwave (AT90USB646) +#define BOARD_BRAINWAVE_PRO 1704 // Brainwave Pro (AT90USB1286) +#define BOARD_SAV_MKI 1705 // SAV Mk-I (AT90USB1286) +#define BOARD_TEENSY2 1706 // Teensy++2.0 (AT90USB1286) +#define BOARD_5DPRINT 1707 // 5DPrint D8 Driver Board // // LPC1768 ARM Cortex M3 @@ -193,13 +208,14 @@ #define BOARD_COHESION3D_MINI 2011 // Cohesion3D Mini #define BOARD_SMOOTHIEBOARD 2012 // Smoothieboard #define BOARD_AZTEEG_X5_MINI_WIFI 2013 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan) -#define BOARD_BIQU_SKR_V1_1 2014 // BIQU SKR_V1.1 (Power outputs: Hotend0,Hotend1, Fan, Bed) +#define BOARD_BIGTREE_SKR_V1_1 2014 // BIGTREE SKR_V1.1 (Power outputs: Hotend0,Hotend1, Fan, Bed) #define BOARD_BIQU_B300_V1_0 2015 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver) #define BOARD_BIGTREE_SKR_V1_3 2016 // BIGTREE SKR_V1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_AZTEEG_X5_MINI 2017 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan) #define BOARD_MKS_SGEN 2018 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan) #define BOARD_MKS_SGEN_L 2019 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan) #define BOARD_TH3D_EZBOARD 2020 // TH3D EZBoard v1.0 +#define BOARD_GMARSH_X6_REV1 2021 // GMARSH X6 board, revision 1 prototype // // SAM3X8E ARM Cortex M3 @@ -243,33 +259,56 @@ // STM32 ARM Cortex-M3 // -#define BOARD_STM32F1R 4000 // STM32R Libmaple-based STM32F1 controller -#define BOARD_MALYAN_M200 4001 // STM32C8T6 Libmaple-based STM32F1 controller -#define BOARD_STM3R_MINI 4002 // STM32 Libmaple-based STM32F1 controller +#define BOARD_STM32F103RE 4000 // STM32F103RE Libmaple-based STM32F1 controller +#define BOARD_MALYAN_M200 4001 // STM32C8T6 Libmaple-based STM32F1 controller +#define BOARD_STM3R_MINI 4002 // STM32F103RE Libmaple-based STM32F1 controller #define BOARD_GTM32_PRO_VB 4003 // STM32F103VET6 controller #define BOARD_MORPHEUS 4004 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller -#define BOARD_MKS_ROBIN 4005 // MKS Robin (STM32F103ZET6) -#define BOARD_MKS_ROBIN_MINI 4006 // MKS Robin Mini (STM32F103VET6) -#define BOARD_MKS_ROBIN_NANO 4007 // MKS Robin Nano (STM32F103VET6) -#define BOARD_BIGTREE_SKR_MINI_V1_1 4008 // BigTreeTech SKR Mini v1.1 (STM32F103RC) -#define BOARD_BIGTREE_SKR_MINI_E3 4009 // BigTreeTech SKR Mini E3 (STM32F103RC) -#define BOARD_JGAURORA_A5S_A1 4010 // JGAurora A5S A1 (STM32F103ZET6) -#define BOARD_FYSETC_AIO_II 4011 // FYSETC AIO_II -#define BOARD_FYSETC_CHEETAH 4012 // FYSETC CHEETAH +#define BOARD_CHITU3D 4005 // Chitu3D (STM32F103RET6) +#define BOARD_MKS_ROBIN 4006 // MKS Robin (STM32F103ZET6) +#define BOARD_MKS_ROBIN_MINI 4007 // MKS Robin Mini (STM32F103VET6) +#define BOARD_MKS_ROBIN_NANO 4008 // MKS Robin Nano (STM32F103VET6) +#define BOARD_MKS_ROBIN_LITE 4009 // MKS Robin Lite/Lite2 (STM32F103RCT6) +#define BOARD_MKS_ROBIN_LITE3 4010 // MKS Robin Lite3 (STM32F103RCT6) +#define BOARD_MKS_ROBIN_PRO 4011 // MKS Robin Pro (STM32F103ZET6) +#define BOARD_BIGTREE_SKR_MINI_V1_1 4012 // BigTreeTech SKR Mini v1.1 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_E3_V1_0 4013 // BigTreeTech SKR Mini E3 (STM32F103RC) +#define BOARD_BTT_SKR_MINI_E3_V1_2 4014 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC) +#define BOARD_BIGTREE_SKR_E3_DIP 4015 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) +#define BOARD_JGAURORA_A5S_A1 4016 // JGAurora A5S A1 (STM32F103ZET6) +#define BOARD_FYSETC_AIO_II 4017 // FYSETC AIO_II +#define BOARD_FYSETC_CHEETAH 4018 // FYSETC Cheetah +#define BOARD_FYSETC_CHEETAH_V12 4019 // FYSETC Cheetah V1.2 +#define BOARD_LONGER3D_LK 4020 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 +#define BOARD_GTM32_MINI 4021 // STM32F103VET6 controller +#define BOARD_GTM32_MINI_A30 4022 // STM32F103VET6 controller +#define BOARD_GTM32_REV_B 4023 // STM32F103VET6 controller + // -// STM32 ARM Cortex-M4F +// ARM Cortex-M4F // #define BOARD_TEENSY31_32 4100 // Teensy3.1 and Teensy3.2 #define BOARD_TEENSY35_36 4101 // Teensy3.5 and Teensy3.6 -#define BOARD_BEAST 4102 // STM32F4xxVxT6 Libmaple-based STM32F4 controller -#define BOARD_STM32F4 4103 // STM32 STM32GENERIC-based STM32F4 controller -#define BOARD_ARMED 4104 // Arm'ed STM32F4-based controller -#define BOARD_RUMBA32 4105 // RUMBA32 STM32F4-based controller -#define BOARD_BLACK_STM32F407VE 4106 // BLACK_STM32F407VE -#define BOARD_BLACK_STM32F407ZE 4107 // BLACK_STM32F407ZE -#define BOARD_STEVAL 4108 // STEVAL-3DP001V1 3D PRINTER BOARD + +// +// STM32 ARM Cortex-M4F +// + +#define BOARD_BEAST 4200 // STM32F4xxVxT6 Libmaple-based STM32F4 controller +#define BOARD_GENERIC_STM32F4 4201 // STM32 STM32GENERIC-based STM32F4 controller +#define BOARD_ARMED 4202 // Arm'ed STM32F4-based controller +#define BOARD_RUMBA32 4203 // RUMBA32 STM32F4-based controller +#define BOARD_BLACK_STM32F407VE 4204 // BLACK_STM32F407VE +#define BOARD_BLACK_STM32F407ZE 4205 // BLACK_STM32F407ZE +#define BOARD_STEVAL 4206 // STEVAL-3DP001V1 3D PRINTER BOARD +#define BOARD_BIGTREE_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) +#define BOARD_BIGTREE_BTT002_V1_0 4208 // BigTreeTech BTT002 v1.0 (STM32F407VE) +#define BOARD_LERDGE_K 4209 // Lerdge K (STM32F407ZG) +#define BOARD_LERDGE_X 4210 // Lerdge X (STM32F407VE) +#define BOARD_VAKE403D 4211 // VAkE 403D (STM32F446VET6) +#define BOARD_FYSETC_S6 4212 // FYSETC S6 board // // ARM Cortex M7 @@ -281,7 +320,7 @@ // // Espressif ESP32 WiFi // -#define BOARD_ESP32 6000 +#define BOARD_ESPRESSIF_ESP32 6000 // // Simulations @@ -289,4 +328,7 @@ #define BOARD_LINUX_RAMPS 9999 -#define MB(board) (defined(BOARD_##board) && MOTHERBOARD==BOARD_##board) +#define _MB_1(B) (defined(BOARD_##B) && MOTHERBOARD==BOARD_##B) +#define MB(V...) DO(MB,||,V) + +#define IS_MELZI MB(MELZI, MELZI_CREALITY, MELZI_MAKR3D, MELZI_MALYAN, MELZI_TRONXY) diff --git a/Marlin/src/core/debug_out.h b/Marlin/src/core/debug_out.h index 7eb93a702001..07bdad7ff2c1 100644 --- a/Marlin/src/core/debug_out.h +++ b/Marlin/src/core/debug_out.h @@ -19,7 +19,6 @@ * along with this program. If not, see . * */ -#pragma once // // Serial aliases for debugging. @@ -37,9 +36,13 @@ #undef DEBUG_ECHOPGM #undef DEBUG_ECHOLNPGM #undef DEBUG_ECHOPAIR +#undef DEBUG_ECHOPAIR_P #undef DEBUG_ECHOPAIR_F +#undef DEBUG_ECHOPAIR_F_P #undef DEBUG_ECHOLNPAIR +#undef DEBUG_ECHOLNPAIR_P #undef DEBUG_ECHOLNPAIR_F +#undef DEBUG_ECHOLNPAIR_F_P #undef DEBUG_ECHO_MSG #undef DEBUG_ERROR_MSG #undef DEBUG_EOL @@ -58,9 +61,13 @@ #define DEBUG_ECHOPGM SERIAL_ECHOPGM #define DEBUG_ECHOLNPGM SERIAL_ECHOLNPGM #define DEBUG_ECHOPAIR SERIAL_ECHOPAIR + #define DEBUG_ECHOPAIR_P SERIAL_ECHOPAIR_P #define DEBUG_ECHOPAIR_F SERIAL_ECHOPAIR_F + #define DEBUG_ECHOPAIR_F_P SERIAL_ECHOPAIR_F_P #define DEBUG_ECHOLNPAIR SERIAL_ECHOLNPAIR + #define DEBUG_ECHOLNPAIR_P SERIAL_ECHOLNPAIR_P #define DEBUG_ECHOLNPAIR_F SERIAL_ECHOLNPAIR_F + #define DEBUG_ECHOLNPAIR_F_P SERIAL_ECHOLNPAIR_F_P #define DEBUG_ECHO_MSG SERIAL_ECHO_MSG #define DEBUG_ERROR_MSG SERIAL_ERROR_MSG #define DEBUG_EOL SERIAL_EOL @@ -68,25 +75,29 @@ #define DEBUG_XYZ SERIAL_XYZ #define DEBUG_DELAY(ms) serial_delay(ms) #else - #define DEBUG_PRINT_P(P) NOOP - #define DEBUG_ECHO_START() NOOP - #define DEBUG_ERROR_START() NOOP - #define DEBUG_CHAR(...) NOOP - #define DEBUG_ECHO(...) NOOP - #define DEBUG_ECHO_F(...) NOOP - #define DEBUG_ECHOLN(...) NOOP - #define DEBUG_ECHOPGM(...) NOOP - #define DEBUG_ECHOLNPGM(...) NOOP - #define DEBUG_ECHOPAIR(...) NOOP - #define DEBUG_ECHOPAIR_F(...) NOOP - #define DEBUG_ECHOLNPAIR(...) NOOP - #define DEBUG_ECHOLNPAIR_F(...) NOOP - #define DEBUG_ECHO_MSG(...) NOOP - #define DEBUG_ERROR_MSG(...) NOOP - #define DEBUG_EOL() NOOP - #define DEBUG_POS(...) NOOP - #define DEBUG_XYZ(...) NOOP - #define DEBUG_DELAY(...) NOOP + #define DEBUG_PRINT_P(P) NOOP + #define DEBUG_ECHO_START() NOOP + #define DEBUG_ERROR_START() NOOP + #define DEBUG_CHAR(...) NOOP + #define DEBUG_ECHO(...) NOOP + #define DEBUG_ECHO_F(...) NOOP + #define DEBUG_ECHOLN(...) NOOP + #define DEBUG_ECHOPGM(...) NOOP + #define DEBUG_ECHOLNPGM(...) NOOP + #define DEBUG_ECHOPAIR(...) NOOP + #define DEBUG_ECHOPAIR_P(...) NOOP + #define DEBUG_ECHOPAIR_F(...) NOOP + #define DEBUG_ECHOPAIR_F_P(...) NOOP + #define DEBUG_ECHOLNPAIR(...) NOOP + #define DEBUG_ECHOLNPAIR_P(...) NOOP + #define DEBUG_ECHOLNPAIR_F(...) NOOP + #define DEBUG_ECHOLNPAIR_F_P(...) NOOP + #define DEBUG_ECHO_MSG(...) NOOP + #define DEBUG_ERROR_MSG(...) NOOP + #define DEBUG_EOL() NOOP + #define DEBUG_POS(...) NOOP + #define DEBUG_XYZ(...) NOOP + #define DEBUG_DELAY(...) NOOP #endif #undef DEBUG_OUT diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index a6e480c14103..44434581a5a6 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -67,12 +67,14 @@ #define AXIS_DRIVER_TYPE(A,T) AXIS_DRIVER_TYPE_##A(T) +#define HAS_E_DRIVER(T) ( AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) \ + || AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) \ + || AXIS_DRIVER_TYPE_E4(T) || AXIS_DRIVER_TYPE_E5(T) ) + #define HAS_DRIVER(T) ( AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) \ || AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) \ || AXIS_DRIVER_TYPE_Z(T) || AXIS_DRIVER_TYPE_Z2(T) || AXIS_DRIVER_TYPE_Z3(T) \ - || AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) \ - || AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) \ - || AXIS_DRIVER_TYPE_E4(T) || AXIS_DRIVER_TYPE_E5(T) ) + || HAS_E_DRIVER(T) ) // Test for supported TMC drivers that require advanced configuration // Does not match standalone configurations @@ -84,6 +86,8 @@ || HAS_DRIVER(TMC5130) \ || HAS_DRIVER(TMC5160) ) +#define HAS_TMC220x (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)) + #define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \ || AXIS_DRIVER_TYPE(A,TMC2160) \ || AXIS_DRIVER_TYPE(A,TMC2208) \ @@ -117,8 +121,21 @@ || AXIS_DRIVER_TYPE(A,TMC5130) \ || AXIS_DRIVER_TYPE(A,TMC5160) ) +#define HAS_TMC_E_DRIVER ( HAS_E_DRIVER(TMC2130) \ + || HAS_E_DRIVER(TMC2160) \ + || HAS_E_DRIVER(TMC2660) \ + || HAS_E_DRIVER(TMC2209) \ + || HAS_E_DRIVER(TMC5130) \ + || HAS_E_DRIVER(TMC5160) ) + +#define HAS_TMC_STANDALONE_E_DRIVER ( HAS_E_DRIVER(TMC2130_STANDALONE) \ + || HAS_E_DRIVER(TMC2160_STANDALONE) \ + || HAS_E_DRIVER(TMC2660_STANDALONE) \ + || HAS_E_DRIVER(TMC2209_STANDALONE) \ + || HAS_E_DRIVER(TMC5130_STANDALONE) \ + || HAS_E_DRIVER(TMC5160_STANDALONE) ) // -// Stretching 'drivers.h' to include LPC SD options +// Stretching 'drivers.h' to include LPC/SAMD51 SD options // #define _SDCARD_LCD 1 #define _SDCARD_ONBOARD 2 diff --git a/Marlin/src/core/enum.h b/Marlin/src/core/enum.h deleted file mode 100644 index a6a3f57888f2..000000000000 --- a/Marlin/src/core/enum.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -/** - * 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 - */ -enum AxisEnum : unsigned char { - X_AXIS = 0, - A_AXIS = 0, - Y_AXIS = 1, - B_AXIS = 1, - Z_AXIS = 2, - C_AXIS = 2, - E_AXIS = 3, - X_HEAD = 4, - Y_HEAD = 5, - Z_HEAD = 6, - E0_AXIS = 3, - E1_AXIS = 4, - E2_AXIS = 5, - E3_AXIS = 6, - E4_AXIS = 7, - E5_AXIS = 8, - ALL_AXES = 0xFE, - NO_AXIS = 0xFF -}; - -#if HAS_DRIVER(L6470) - enum L6470_driver_enum : unsigned char { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 }; -#endif - -#define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++) -#define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++) -#define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N) -#define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N) - -#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_AXIS) -#define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N) -#define LOOP_ABC(VAR) LOOP_S_LE_N(VAR, A_AXIS, C_AXIS) -#define LOOP_ABCE(VAR) LOOP_S_LE_N(VAR, A_AXIS, E_AXIS) -#define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N) - -typedef enum { - LINEARUNIT_MM, - LINEARUNIT_INCH -} LinearUnit; - -typedef enum { - TEMPUNIT_C, - TEMPUNIT_K, - TEMPUNIT_F -} TempUnit; diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index c291b0549aa2..cfce9d9ae1e2 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -37,7 +37,7 @@ // NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES // -// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" +// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRA_LCD" / "SDSUPPORT" #define IN "Configuration.h" // ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS // See also http://marlinfw.org/docs/development/lcd_language.html @@ -46,9 +46,10 @@ // bg Bulgarian // ca Catalan // cz Czech +// da Danish // de German // el Greek -// el-gr Greek (Greece) +// el_gr Greek (Greece) // en English // es Spanish // eu Basque-Euskera @@ -57,16 +58,17 @@ // gl Galician // hr Croatian // it Italian -// jp-kana Japanese +// jp_kana Japanese // ko_KR Korean (South Korea) // nl Dutch // pl Polish // pt Portuguese -// pt-br Portuguese (Brazilian) +// pt_br Portuguese (Brazilian) // ru Russian // sk Slovak // tr Turkish // uk Ukrainian +// vi Vietnamese // zh_CN Chinese (Simplified) // zh_TW Chinese (Traditional) @@ -89,12 +91,26 @@ #define MACHINE_UUID DEFAULT_MACHINE_UUID #endif -#ifdef BOARD_WEBSITE_URL - #undef WEBSITE_URL - #define WEBSITE_URL BOARD_WEBSITE_URL -#endif +#define MARLIN_WEBSITE_URL "http://marlinfw.org" + +//#if !defined(STRING_SPLASH_LINE3) && defined(WEBSITE_URL) +// #define STRING_SPLASH_LINE3 WEBSITE_URL +//#endif + +#if HAS_CHARACTER_LCD -#if HAS_GRAPHICAL_LCD + // Custom characters defined in the first 8 characters of the LCD + #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string! + #define LCD_STR_DEGREE "\x01" + #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation + #define LCD_STR_UPLEVEL "\x03" + #define LCD_STR_REFRESH "\x04" + #define LCD_STR_FOLDER "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_CLOCK "\x07" + #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ + +#else // // Custom characters from Marlin_symbols.fon which was merged into ISO10646-0-3.bdf // \x00 intentionally skipped to avoid problems in strings @@ -117,19 +133,6 @@ #define LCD_STR_FILAM_DIA "\xF8" #define LCD_STR_FILAM_MUL "\xA4" -#elif HAS_CHARACTER_LCD - - // Custom characters defined in the first 8 characters of the LCD - #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string! - #define LCD_STR_DEGREE "\x01" - #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation - #define LCD_STR_UPLEVEL "\x03" - #define LCD_STR_REFRESH "\x04" - #define LCD_STR_FOLDER "\x05" - #define LCD_STR_FEEDRATE "\x06" - #define LCD_STR_CLOCK "\x07" - #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ - #endif // Common LCD messages @@ -165,7 +168,6 @@ #define MSG_INVALID_E_STEPPER "Invalid E stepper" #define MSG_E_STEPPER_NOT_SPECIFIED "E stepper not specified" #define MSG_INVALID_SOLENOID "Invalid solenoid" -#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature" #define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID #define MSG_COUNT_X " Count X:" #define MSG_COUNT_A " Count A:" @@ -195,7 +197,7 @@ #define MSG_Z3_MAX "z3_max" #define MSG_Z_PROBE "z_probe" #define MSG_FILAMENT_RUNOUT_SENSOR "filament" -#define MSG_PROBE_Z_OFFSET "Probe Z Offset" +#define MSG_PROBE_OFFSET "Probe Offset" #define MSG_SKEW_MIN "min_skew_factor: " #define MSG_SKEW_MAX "max_skew_factor: " #define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" @@ -240,10 +242,9 @@ #define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" #define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" #define MSG_ERR_HOTEND_TOO_COLD "Hotend too cold" +#define MSG_ERR_Z_HOMING_SER "Home XY first" +#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" -#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_WAIT "Press button (or M108) to resume" #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_WAIT_LCD "Press button to resume" @@ -251,17 +252,15 @@ #define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108" #define MSG_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume" -#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" - -#define MSG_STOP_BLTOUCH "STOP called because of BLTouch error - restart with M999" -#define MSG_STOP_UNHOMED "STOP called because of unhomed error - restart with M999" -#define MSG_KILL_INACTIVE_TIME "KILL caused by too much inactive time - current command: " -#define MSG_KILL_BUTTON "KILL caused by KILL button/pin" +#define MSG_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999" +#define MSG_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999" +#define MSG_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: " +#define MSG_KILL_BUTTON "!! KILL caused by KILL button/pin" // temperature.cpp strings -#define MSG_PID_AUTOTUNE "PID Autotune" -#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE " start" -#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed!" +#define MSG_PID_AUTOTUNE_PREFIX "PID Autotune" +#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE_PREFIX " start" +#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE_PREFIX " failed!" #define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number" #define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high" #define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout" @@ -276,7 +275,7 @@ #define MSG_KI " Ki: " #define MSG_KD " Kd: " #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_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE_PREFIX " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" #define MSG_PID_DEBUG " PID_DEBUG " #define MSG_PID_DEBUG_INPUT ": Input " #define MSG_PID_DEBUG_OUTPUT " Output " @@ -295,6 +294,8 @@ #define MSG_T_THERMAL_RUNAWAY "Thermal Runaway" #define MSG_T_MAXTEMP "MAXTEMP triggered" #define MSG_T_MINTEMP "MINTEMP triggered" +#define MSG_ERR_PROBING_FAILED "Probing Failed" +#define MSG_ZPROBE_OUT_SER "Z Probe Past Bed" // Debug #define MSG_DEBUG_PREFIX "DEBUG:" @@ -310,11 +311,9 @@ #define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/langdata_##M.h) #define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M) -#define INCLUDE_LANGUAGE_DATA LANGUAGE_DATA_INCL(LCD_LANGUAGE) #define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h) #define LANGUAGE_INCL(M) LANGUAGE_INCL_(M) -#define INCLUDE_LANGUAGE LANGUAGE_INCL(LCD_LANGUAGE) // Never translate these strings #define MSG_X "X" @@ -334,54 +333,63 @@ #define MSG_Y2 "Y2" #define MSG_Z2 "Z2" #define MSG_Z3 "Z3" -#define MSG_H1 "1" -#define MSG_H2 "2" -#define MSG_H3 "3" -#define MSG_H4 "4" -#define MSG_H5 "5" -#define MSG_H6 "6" -#define MSG_LCD_N0 " 1" -#define MSG_LCD_N1 " 2" -#define MSG_LCD_N2 " 3" -#define MSG_LCD_N3 " 4" -#define MSG_LCD_N4 " 5" -#define MSG_LCD_N5 " 6" -#define MSG_E1 "E1" -#define MSG_E2 "E2" -#define MSG_E3 "E3" -#define MSG_E4 "E4" -#define MSG_E5 "E5" -#define MSG_E6 "E6" -#define MSG_MOVE_E1 "1" -#define MSG_MOVE_E2 "2" -#define MSG_MOVE_E3 "3" -#define MSG_MOVE_E4 "4" -#define MSG_MOVE_E5 "5" -#define MSG_MOVE_E6 "6" -#define MSG_DIAM_E1 " 1" -#define MSG_DIAM_E2 " 2" -#define MSG_DIAM_E3 " 3" -#define MSG_DIAM_E4 " 4" -#define MSG_DIAM_E5 " 5" -#define MSG_DIAM_E6 " 6" - -#include INCLUDE_LANGUAGE - -#if DISABLED(DISPLAY_CHARSET_ISO10646_1) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_5) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_GREEK) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_CN) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_TR) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_PL) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_CZ) \ - && DISABLED(DISPLAY_CHARSET_ISO10646_SK) - #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. + +#define LCD_STR_A MSG_A +#define LCD_STR_B MSG_B +#define LCD_STR_C MSG_C +#define LCD_STR_E MSG_E + +/** + * Tool indexes for LCD display only + * + * By convention the LCD shows "E1" for the first extruder. + * However, internal to Marlin E0/T0 is the first tool, and + * most board silkscreens say "E0." Zero-based labels will + * make these indexes consistent but this defies expectation. + * + */ +#if ENABLED(NUMBER_TOOLS_FROM_0) + #define LCD_FIRST_TOOL '0' + #define LCD_STR_N0 "0" + #define LCD_STR_N1 "1" + #define LCD_STR_N2 "2" + #define LCD_STR_N3 "3" + #define LCD_STR_N4 "4" + #define LCD_STR_N5 "5" +#else + #define LCD_FIRST_TOOL '1' + #define LCD_STR_N0 "1" + #define LCD_STR_N1 "2" + #define LCD_STR_N2 "3" + #define LCD_STR_N3 "4" + #define LCD_STR_N4 "5" + #define LCD_STR_N5 "6" #endif -#include "../lcd/language/language_en.h" +#define LCD_STR_E0 "E" LCD_STR_N0 +#define LCD_STR_E1 "E" LCD_STR_N1 +#define LCD_STR_E2 "E" LCD_STR_N2 +#define LCD_STR_E3 "E" LCD_STR_N3 +#define LCD_STR_E4 "E" LCD_STR_N4 +#define LCD_STR_E5 "E" LCD_STR_N5 + +#include "multi_language.h" // Allow multiple languages -#ifdef CUSTOM_USER_MENU_TITLE - #undef MSG_USER_MENU - #define MSG_USER_MENU CUSTOM_USER_MENU_TITLE +#include "../lcd/language/language_en.h" +#include LANGUAGE_INCL(LCD_LANGUAGE) +#include LANGUAGE_INCL(LCD_LANGUAGE_2) +#include LANGUAGE_INCL(LCD_LANGUAGE_3) +#include LANGUAGE_INCL(LCD_LANGUAGE_4) +#include LANGUAGE_INCL(LCD_LANGUAGE_5) + +#if NONE(DISPLAY_CHARSET_ISO10646_1, \ + DISPLAY_CHARSET_ISO10646_5, \ + DISPLAY_CHARSET_ISO10646_KANA, \ + DISPLAY_CHARSET_ISO10646_GREEK, \ + DISPLAY_CHARSET_ISO10646_CN, \ + DISPLAY_CHARSET_ISO10646_TR, \ + DISPLAY_CHARSET_ISO10646_PL, \ + DISPLAY_CHARSET_ISO10646_CZ, \ + DISPLAY_CHARSET_ISO10646_SK) + #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. #endif diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 918b3c6d1bd4..f3c9f3a81842 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -21,13 +21,11 @@ */ #pragma once -#include "minmax.h" - -#define NUM_AXIS 4 #define ABCE 4 #define XYZE 4 #define ABC 3 #define XYZ 3 +#define XY 2 #define _AXIS(A) (A##_AXIS) @@ -47,6 +45,14 @@ #define _O2 __attribute__((optimize("O2"))) #define _O3 __attribute__((optimize("O3"))) +#ifndef UNUSED + #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + #define UNUSED(X) (void)X + #else + #define UNUSED(x) ((void)(x)) + #endif +#endif + // Clock speed factors #if !defined(CYCLES_PER_MICROSECOND) && !defined(__STM32F1__) #define CYCLES_PER_MICROSECOND (F_CPU / 1000000UL) // 16 or 20 on AVR @@ -55,13 +61,11 @@ // Nanoseconds per cycle #define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU) -// Remove compiler warning on an unused variable -#ifndef UNUSED - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - #define UNUSED(X) (void)X - #else - #define UNUSED(x) ((void)(x)) - #endif +// Macros to make sprintf_P read from PROGMEM (AVR extension) +#ifdef __AVR__ + #define S_FMT "%S" +#else + #define S_FMT "%s" #endif // Macros to make a string from a macro @@ -74,16 +78,23 @@ // Macros for bit masks #undef _BV #define _BV(n) (1<<(n)) -#define TEST(n,b) !!((n)&_BV(b)) -#define SBI(n,b) (n |= _BV(b)) -#define CBI(n,b) (n &= ~_BV(b)) +#define TEST(n,b) (!!((n)&_BV(b))) #define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) +#ifndef SBI + #define SBI(A,B) (A |= (1 << (B))) +#endif + +#ifndef CBI + #define CBI(A,B) (A &= ~(1 << (B))) +#endif + #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 cu(x) ((x)*(x)*(x)) #define RADIANS(d) ((d)*float(M_PI)/180.0f) #define DEGREES(r) ((r)*180.0f/float(M_PI)) #define HYPOT2(x,y) (sq(x)+sq(y)) @@ -99,14 +110,14 @@ // C++11 solution that is standards compliant. template static inline constexpr void NOLESS(V& v, const N n) { - if (v < n) v = n; + if (n > v) v = n; } template static inline constexpr void NOMORE(V& v, const N n) { - if (v > n) v = n; + if (n < v) v = n; } template static inline constexpr void LIMIT(V& v, const N1 n1, const N2 n2) { - if (v < n1) v = n1; - else if (v > n2) v = n2; + if (n1 > v) v = n1; + else if (n2 < v) v = n2; } #else @@ -114,24 +125,24 @@ // 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 NOLESS(v, n) \ - do { \ + do{ \ __typeof__(n) _n = (n); \ - if (v < _n) v = _n; \ - } while(0) + if (_n > v) v = _n; \ + }while(0) #define NOMORE(v, n) \ - do { \ + do{ \ __typeof__(n) _n = (n); \ - if (v > _n) v = _n; \ - } while(0) + if (_n < v) v = _n; \ + }while(0) #define LIMIT(v, n1, n2) \ - do { \ + do{ \ __typeof__(n1) _n1 = (n1); \ __typeof__(n2) _n2 = (n2); \ - if (v < _n1) v = _n1; \ - else if (v > _n2) v = _n2; \ - } while(0) + if (_n1 > v) v = _n1; \ + else if (_n2 < v) v = _n2; \ + }while(0) #endif @@ -154,6 +165,7 @@ // Macros to support option testing #define _CAT(a,V...) a##V +#define CAT(a,V...) _CAT(a,V) #define SWITCH_ENABLED_false 0 #define SWITCH_ENABLED_true 1 #define SWITCH_ENABLED_0 0 @@ -194,44 +206,29 @@ }while(0) // Macros for initializing arrays -#define ARRAY_6(v1, v2, v3, v4, v5, v6, ...) { v1, v2, v3, v4, v5, v6 } -#define ARRAY_5(v1, v2, v3, v4, v5, ...) { v1, v2, v3, v4, v5 } -#define ARRAY_4(v1, v2, v3, v4, ...) { v1, v2, v3, v4 } -#define ARRAY_3(v1, v2, v3, ...) { v1, v2, v3 } -#define ARRAY_2(v1, v2, ...) { v1, v2 } -#define ARRAY_1(v1, ...) { v1 } - -#define _ARRAY_N(N,V...) ARRAY_##N(V) -#define ARRAY_N(N,V...) _ARRAY_N(N,V) - -// Macros for adding -#define INC_0 1 -#define INC_1 2 -#define INC_2 3 -#define INC_3 4 -#define INC_4 5 -#define INC_5 6 -#define INC_6 7 -#define INC_7 8 -#define INC_8 9 -#define INCREMENT_(n) INC_##n -#define INCREMENT(n) INCREMENT_(n) - -// Macros for subtracting -#define DEC_1 0 -#define DEC_2 1 -#define DEC_3 2 -#define DEC_4 3 -#define DEC_5 4 -#define DEC_6 5 -#define DEC_7 6 -#define DEC_8 7 -#define DEC_9 8 -#define DECREMENT_(n) DEC_##n -#define DECREMENT(n) DECREMENT_(n) - -#define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) -#define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) +#define LIST_16(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P +#define LIST_15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O +#define LIST_14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N +#define LIST_13(A,B,C,D,E,F,G,H,I,J,K,L,M,...) A,B,C,D,E,F,G,H,I,J,K,L,M +#define LIST_12(A,B,C,D,E,F,G,H,I,J,K,L,...) A,B,C,D,E,F,G,H,I,J,K,L +#define LIST_11(A,B,C,D,E,F,G,H,I,J,K,...) A,B,C,D,E,F,G,H,I,J,K +#define LIST_10(A,B,C,D,E,F,G,H,I,J,...) A,B,C,D,E,F,G,H,I,J +#define LIST_9( A,B,C,D,E,F,G,H,I,...) A,B,C,D,E,F,G,H,I +#define LIST_8( A,B,C,D,E,F,G,H,...) A,B,C,D,E,F,G,H +#define LIST_7( A,B,C,D,E,F,G,...) A,B,C,D,E,F,G +#define LIST_6( A,B,C,D,E,F,...) A,B,C,D,E,F +#define LIST_5( A,B,C,D,E,...) A,B,C,D,E +#define LIST_4( A,B,C,D,...) A,B,C,D +#define LIST_3( A,B,C,...) A,B,C +#define LIST_2( A,B,...) A,B +#define LIST_1( A,...) A + +#define _LIST_N(N,V...) LIST_##N(V) +#define LIST_N(N,V...) _LIST_N(N,V) +#define ARRAY_N(N,V...) { _LIST_N(N,V) } + +#define _JOIN_1(O) (O) +#define JOIN_N(N,C,V...) (DO(JOIN,C,LIST_N(N,V))) #define NOOP (void(0)) @@ -254,10 +251,11 @@ // // Maths macros that can be overridden by HAL // +#define ACOS(x) acosf(x) #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 RSQRT(x) (1.0f / sqrtf(x)) #define CEIL(x) ceilf(x) #define FLOOR(x) floorf(x) #define LROUND(x) lroundf(x) @@ -269,3 +267,182 @@ #else #define I2C_ADDRESS(A) A #endif + +// Use NUM_ARGS(__VA_ARGS__) to get the number of variadic arguments +#define _NUM_ARGS(_,Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,OUT,...) OUT +#define NUM_ARGS(V...) _NUM_ARGS(0,V,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0) + +#ifdef __cplusplus + + #ifndef _MINMAX_H_ + #define _MINMAX_H_ + + extern "C++" { + + // 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 _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } + template static inline constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } + + } + + #endif + +#else + + #define MIN_2(a,b) ((a)<(b)?(a):(b)) + #define MIN_3(a,V...) MIN_2(a,MIN_2(V)) + #define MIN_4(a,V...) MIN_2(a,MIN_3(V)) + #define MIN_5(a,V...) MIN_2(a,MIN_4(V)) + #define MIN_6(a,V...) MIN_2(a,MIN_5(V)) + #define MIN_7(a,V...) MIN_2(a,MIN_6(V)) + #define MIN_8(a,V...) MIN_2(a,MIN_7(V)) + #define MIN_9(a,V...) MIN_2(a,MIN_8(V)) + #define MIN_10(a,V...) MIN_2(a,MIN_9(V)) + #define __MIN_N(N,V...) MIN_##N(V) + #define _MIN_N(N,V...) __MIN_N(N,V) + #define _MIN(V...) _MIN_N(NUM_ARGS(V), V) + + #define MAX_2(a,b) ((a)>(b)?(a):(b)) + #define MAX_3(a,V...) MAX_2(a,MAX_2(V)) + #define MAX_4(a,V...) MAX_2(a,MAX_3(V)) + #define MAX_5(a,V...) MAX_2(a,MAX_4(V)) + #define MAX_6(a,V...) MAX_2(a,MAX_5(V)) + #define MAX_7(a,V...) MAX_2(a,MAX_6(V)) + #define MAX_8(a,V...) MAX_2(a,MAX_7(V)) + #define MAX_9(a,V...) MAX_2(a,MAX_8(V)) + #define MAX_10(a,V...) MAX_2(a,MAX_9(V)) + #define __MAX_N(N,V...) MAX_##N(V) + #define _MAX_N(N,V...) __MAX_N(N,V) + #define _MAX(V...) _MAX_N(NUM_ARGS(V), V) + +#endif + +// Macros for adding +#define INC_0 1 +#define INC_1 2 +#define INC_2 3 +#define INC_3 4 +#define INC_4 5 +#define INC_5 6 +#define INC_6 7 +#define INC_7 8 +#define INC_8 9 +#define INCREMENT_(n) INC_##n +#define INCREMENT(n) INCREMENT_(n) + +#define ADD0(N) N +#define ADD1(N) INCREMENT_(N) +#define ADD2(N) ADD1(ADD1(N)) +#define ADD3(N) ADD1(ADD2(N)) +#define ADD4(N) ADD2(ADD2(N)) +#define ADD5(N) ADD2(ADD3(N)) +#define ADD6(N) ADD3(ADD3(N)) +#define ADD7(N) ADD3(ADD4(N)) +#define ADD8(N) ADD4(ADD4(N)) +#define ADD9(N) ADD4(ADD5(N)) +#define ADD10(N) ADD5(ADD5(N)) + +// Macros for subtracting +#define DEC_0 0 +#define DEC_1 0 +#define DEC_2 1 +#define DEC_3 2 +#define DEC_4 3 +#define DEC_5 4 +#define DEC_6 5 +#define DEC_7 6 +#define DEC_8 7 +#define DEC_9 8 +#define DECREMENT_(n) DEC_##n +#define DECREMENT(n) DECREMENT_(n) + +#define SUB0(N) N +#define SUB1(N) DECREMENT_(N) +#define SUB2(N) SUB1(SUB1(N)) +#define SUB3(N) SUB1(SUB2(N)) +#define SUB4(N) SUB2(SUB2(N)) +#define SUB5(N) SUB2(SUB3(N)) +#define SUB6(N) SUB3(SUB3(N)) +#define SUB7(N) SUB3(SUB4(N)) +#define SUB8(N) SUB4(SUB4(N)) +#define SUB9(N) SUB4(SUB5(N)) +#define SUB10(N) SUB5(SUB5(N)) + +// +// Primitives supporting precompiler REPEAT +// +#define FIRST(a,...) a +#define SECOND(a,b,...) b + +// Defer expansion +#define EMPTY() +#define DEFER(M) M EMPTY() +#define DEFER2(M) M EMPTY EMPTY()() +#define DEFER3(M) M EMPTY EMPTY EMPTY()()() +#define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()() + +// Force define expansion +#define EVAL(V...) EVAL16(V) +#define EVAL1024(V...) EVAL512(EVAL512(V)) +#define EVAL512(V...) EVAL256(EVAL256(V)) +#define EVAL256(V...) EVAL128(EVAL128(V)) +#define EVAL128(V...) EVAL64(EVAL64(V)) +#define EVAL64(V...) EVAL32(EVAL32(V)) +#define EVAL32(V...) EVAL16(EVAL16(V)) +#define EVAL16(V...) EVAL8(EVAL8(V)) +#define EVAL8(V...) EVAL4(EVAL4(V)) +#define EVAL4(V...) EVAL2(EVAL2(V)) +#define EVAL2(V...) EVAL1(EVAL1(V)) +#define EVAL1(V...) V + +#define IS_PROBE(V...) SECOND(V, 0) // Get the second item passed, or 0 +#define PROBE() ~, 1 // Second item will be 1 if this is passed +#define _NOT_0 PROBE() +#define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'. +#define _BOOL(x) NOT(NOT(x)) // NOT('0') gets '0'. Anything else gets '1'. + +#define IF_ELSE(TF) _IF_ELSE(_BOOL(TF)) +#define _IF_ELSE(TF) _CAT(_IF_, TF) + +#define _IF_1(V...) V _IF_1_ELSE +#define _IF_0(...) _IF_0_ELSE + +#define _IF_1_ELSE(...) +#define _IF_0_ELSE(V...) V + +#define HAS_ARGS(V...) _BOOL(FIRST(_END_OF_ARGUMENTS_ V)()) +#define _END_OF_ARGUMENTS_() 0 + +// +// REPEAT core macros. Recurse N times with ascending I. +// + +// Call OP(I) N times with ascending counter. +#define _REPEAT(_RPT_I,_RPT_N,_RPT_OP) \ + _RPT_OP(_RPT_I) \ + IF_ELSE(SUB1(_RPT_N)) \ + ( DEFER2(__REPEAT)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP) ) \ + ( /* Do nothing */ ) +#define __REPEAT() _REPEAT + +// Call OP(I, ...) N times with ascending counter. +#define _REPEAT2(_RPT_I,_RPT_N,_RPT_OP,V...) \ + _RPT_OP(_RPT_I,V) \ + IF_ELSE(SUB1(_RPT_N)) \ + ( DEFER2(__REPEAT2)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP,V) ) \ + ( /* Do nothing */ ) +#define __REPEAT2() _REPEAT2 + +// Repeat a macro passing S...N-1. +#define REPEAT_S(S,N,OP) EVAL(_REPEAT(S,SUB##S(N),OP)) +#define REPEAT(N,OP) REPEAT_S(0,N,OP) + +// Repeat a macro passing 0...N-1 plus additional arguments. +#define REPEAT2_S(S,N,OP,V...) EVAL(_REPEAT2(S,SUB##S(N),OP,V)) +#define REPEAT2(N,OP,V...) REPEAT2_S(0,N,OP,V) diff --git a/Marlin/src/core/minmax.h b/Marlin/src/core/minmax.h deleted file mode 100644 index cdb84138eccc..000000000000 --- a/Marlin/src/core/minmax.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -#undef MIN -#undef MAX - -// Use NUM_ARGS(__VA_ARGS__) to get the number of variadic arguments -#define _NUM_ARGS(_0,_24_,_23,_22,_21,_20,_19,_18,_17,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,N,...) N -#define NUM_ARGS(V...) _NUM_ARGS(0,V,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0) - -#ifdef __cplusplus - - #ifndef _MINMAX_H_ - #define _MINMAX_H_ - - extern "C++" { - - // 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 _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } - template static inline constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } - - } - - #endif - -#else - - #define MIN_2(a,b) ((a)<(b)?(a):(b)) - #define MIN_3(a,...) MIN_2(a,MIN_2(__VA_ARGS__)) - #define MIN_4(a,...) MIN_2(a,MIN_3(__VA_ARGS__)) - #define MIN_5(a,...) MIN_2(a,MIN_4(__VA_ARGS__)) - #define MIN_6(a,...) MIN_2(a,MIN_5(__VA_ARGS__)) - #define MIN_7(a,...) MIN_2(a,MIN_6(__VA_ARGS__)) - #define MIN_8(a,...) MIN_2(a,MIN_7(__VA_ARGS__)) - #define MIN_9(a,...) MIN_2(a,MIN_8(__VA_ARGS__)) - #define MIN_10(a,...) MIN_2(a,MIN_9(__VA_ARGS__)) - #define __MIN_N(N, ...) MIN_##N(__VA_ARGS__) - #define _MIN_N(N, ...) __MIN_N(N,__VA_ARGS__) - #define MIN(...) _MIN_N(NUM_ARGS(__VA_ARGS__), __VA_ARGS__) - - #define MAX_2(a,b) ((a)>(b)?(a):(b)) - #define MAX_3(a,...) MAX_2(a,MAX_2(__VA_ARGS__)) - #define MAX_4(a,...) MAX_2(a,MAX_3(__VA_ARGS__)) - #define MAX_5(a,...) MAX_2(a,MAX_4(__VA_ARGS__)) - #define MAX_6(a,...) MAX_2(a,MAX_5(__VA_ARGS__)) - #define MAX_7(a,...) MAX_2(a,MAX_6(__VA_ARGS__)) - #define MAX_8(a,...) MAX_2(a,MAX_7(__VA_ARGS__)) - #define MAX_9(a,...) MAX_2(a,MAX_8(__VA_ARGS__)) - #define MAX_10(a,...) MAX_2(a,MAX_9(__VA_ARGS__)) - #define __MAX_N(N, ...) MAX_##N(__VA_ARGS__) - #define _MAX_N(N, ...) __MAX_N(N,__VA_ARGS__) - #define MAX(...) _MAX_N(NUM_ARGS(__VA_ARGS__), __VA_ARGS__) - -#endif diff --git a/Marlin/src/core/multi_language.cpp b/Marlin/src/core/multi_language.cpp new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/Marlin/src/core/multi_language.h b/Marlin/src/core/multi_language.h new file mode 100644 index 000000000000..98020b1e8d9c --- /dev/null +++ b/Marlin/src/core/multi_language.h @@ -0,0 +1,79 @@ +/******************** + * multi_language.h * + ********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ +#pragma once + +typedef const char Language_Str[]; + +#if defined(LCD_LANGUAGE_5) + #define NUM_LANGUAGES 5 +#elif defined(LCD_LANGUAGE_4) + #define NUM_LANGUAGES 4 +#elif defined(LCD_LANGUAGE_3) + #define NUM_LANGUAGES 3 +#elif defined(LCD_LANGUAGE_2) + #define NUM_LANGUAGES 2 +#else + #define NUM_LANGUAGES 1 +#endif + +// Setting the unused languages equal to each other allows +// the compiler to optimize away the conditionals + +#ifndef LCD_LANGUAGE_2 + #define LCD_LANGUAGE_2 LCD_LANGUAGE +#endif + +#ifndef LCD_LANGUAGE_3 + #define LCD_LANGUAGE_3 LCD_LANGUAGE_2 +#endif + +#ifndef LCD_LANGUAGE_4 + #define LCD_LANGUAGE_4 LCD_LANGUAGE_3 +#endif + +#ifndef LCD_LANGUAGE_5 + #define LCD_LANGUAGE_5 LCD_LANGUAGE_4 +#endif + +#define _GET_LANG(LANG) Language_##LANG +#define GET_LANG(LANG) _GET_LANG(LANG) + +#if NUM_LANGUAGES > 1 + extern uint8_t lang; + #define GET_TEXT(MSG) ( \ + lang == 0 ? GET_LANG(LCD_LANGUAGE)::MSG : \ + lang == 1 ? GET_LANG(LCD_LANGUAGE_2)::MSG : \ + lang == 2 ? GET_LANG(LCD_LANGUAGE_3)::MSG : \ + lang == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \ + GET_LANG(LCD_LANGUAGE_5)::MSG \ + ) + #define MAX_LANG_CHARSIZE _MAX(GET_LANG(LCD_LANGUAGE)::CHARSIZE, \ + GET_LANG(LCD_LANGUAGE_2)::CHARSIZE, \ + GET_LANG(LCD_LANGUAGE_3)::CHARSIZE, \ + GET_LANG(LCD_LANGUAGE_4)::CHARSIZE, \ + GET_LANG(LCD_LANGUAGE_5)::CHARSIZE) +#else + #define GET_TEXT(MSG) GET_LANG(LCD_LANGUAGE)::MSG + #define MAX_LANG_CHARSIZE GET_LANG(LCD_LANGUAGE)::CHARSIZE +#endif +#define GET_TEXT_F(MSG) (const __FlashStringHelper*)GET_TEXT(MSG) + +#define MSG_CONCAT(A,B) pgm_p_pair_t(GET_TEXT(A),GET_TEXT(B)) diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 84b64b8b62c1..4a5214f5c04d 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -22,7 +22,6 @@ #include "serial.h" #include "language.h" -#include "enum.h" uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE; @@ -68,15 +67,10 @@ void print_bin(const uint16_t val) { } } -void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z) { +extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[]; + +void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) { serialprintPGM(prefix); - SERIAL_CHAR('('); - SERIAL_ECHO(x); - SERIAL_ECHOPAIR(", ", y, ", ", z); - SERIAL_CHAR(')'); + SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z); if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); } - -void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]) { - print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); -} diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index e46696669845..c2745e972b0d 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -21,9 +21,7 @@ */ #pragma once -#include "../inc/MarlinConfigPre.h" -#include "../core/minmax.h" -#include HAL_PATH(../HAL, HAL.h) +#include "../inc/MarlinConfig.h" /** * Define debug bit-masks @@ -57,10 +55,12 @@ extern uint8_t marlin_debug_flags; if (!serial_port_index || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \ if ( serial_port_index) (void)MYSERIAL1.WHAT(V); \ }while(0) + #define SERIAL_ASSERT(P) if(serial_port_index!=(P)){ debugger(); } #else #define _PORT_REDIRECT(n,p) NOOP #define _PORT_RESTORE(n) NOOP #define SERIAL_OUT(WHAT, V...) (void)MYSERIAL0.WHAT(V) + #define SERIAL_ASSERT(P) NOOP #endif #define PORT_REDIRECT(p) _PORT_REDIRECT(1,p) @@ -68,20 +68,22 @@ extern uint8_t marlin_debug_flags; #define SERIAL_CHAR(x) SERIAL_OUT(write, x) #define SERIAL_ECHO(x) SERIAL_OUT(print, x) -#define SERIAL_ECHO_F(V...) SERIAL_OUT(print, V) +#define SERIAL_ECHO_F(V...) SERIAL_OUT(print, V) #define SERIAL_ECHOLN(x) SERIAL_OUT(println, x) #define SERIAL_PRINT(x,b) SERIAL_OUT(print, x, b) #define SERIAL_PRINTLN(x,b) SERIAL_OUT(println, x, b) -#define SERIAL_PRINTF(V...) SERIAL_OUT(printf, V) +#define SERIAL_PRINTF(V...) SERIAL_OUT(printf, V) #define SERIAL_FLUSH() SERIAL_OUT(flush) -#if TX_BUFFER_SIZE > 0 +#ifdef __STM32F1__ + #define SERIAL_FLUSHTX() SERIAL_OUT(flush) +#elif TX_BUFFER_SIZE > 0 #define SERIAL_FLUSHTX() SERIAL_OUT(flushTX) #else #define SERIAL_FLUSHTX() #endif -// Print up to 12 pairs of values +// Print up to 12 pairs of values. Odd elements auto-wrapped in PSTR(). #define __SEP_N(N,V...) _SEP_##N(V) #define _SEP_N(N,V...) __SEP_N(N,V) #define _SEP_1(PRE) SERIAL_ECHOPGM(PRE) @@ -111,6 +113,36 @@ extern uint8_t marlin_debug_flags; #define SERIAL_ECHOPAIR(V...) _SEP_N(NUM_ARGS(V),V) +// Print up to 12 pairs of values. Odd elements must be PSTR pointers. +#define __SEP_N_P(N,V...) _SEP_##N##_P(V) +#define _SEP_N_P(N,V...) __SEP_N_P(N,V) +#define _SEP_1_P(PRE) serialprintPGM(PRE) +#define _SEP_2_P(PRE,V) serial_echopair_PGM(PRE,V) +#define _SEP_3_P(a,b,c) do{ _SEP_2_P(a,b); serialprintPGM(c); }while(0) +#define _SEP_4_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_2_P(V); }while(0) +#define _SEP_5_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_3_P(V); }while(0) +#define _SEP_6_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_4_P(V); }while(0) +#define _SEP_7_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_5_P(V); }while(0) +#define _SEP_8_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_6_P(V); }while(0) +#define _SEP_9_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_7_P(V); }while(0) +#define _SEP_10_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_8_P(V); }while(0) +#define _SEP_11_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_9_P(V); }while(0) +#define _SEP_12_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_10_P(V); }while(0) +#define _SEP_13_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_11_P(V); }while(0) +#define _SEP_14_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_12_P(V); }while(0) +#define _SEP_15_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_13_P(V); }while(0) +#define _SEP_16_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_14_P(V); }while(0) +#define _SEP_17_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_15_P(V); }while(0) +#define _SEP_18_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_16_P(V); }while(0) +#define _SEP_19_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_17_P(V); }while(0) +#define _SEP_20_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_18_P(V); }while(0) +#define _SEP_21_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_19_P(V); }while(0) +#define _SEP_22_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_20_P(V); }while(0) +#define _SEP_23_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_21_P(V); }while(0) +#define _SEP_24_P(a,b,V...) do{ _SEP_2_P(a,b); _SEP_22_P(V); }while(0) + +#define SERIAL_ECHOPAIR_P(V...) _SEP_N_P(NUM_ARGS(V),V) + // Print up to 12 pairs of values followed by newline #define __SELP_N(N,V...) _SELP_##N(V) #define _SELP_N(N,V...) __SELP_N(N,V) @@ -137,15 +169,77 @@ extern uint8_t marlin_debug_flags; #define _SELP_21(a,b,V...) do{ _SEP_2(a,b); _SELP_19(V); }while(0) #define _SELP_22(a,b,V...) do{ _SEP_2(a,b); _SELP_20(V); }while(0) #define _SELP_23(a,b,V...) do{ _SEP_2(a,b); _SELP_21(V); }while(0) -#define _SELP_24(a,b,V...) do{ _SEP_2(a,b); _SELP_22(V); }while(0) +#define _SELP_24(a,b,V...) do{ _SEP_2(a,b); _SELP_22(V); }while(0) // Eat two args, pass the rest up #define SERIAL_ECHOLNPAIR(V...) _SELP_N(NUM_ARGS(V),V) -#define SERIAL_ECHOPGM(S) (serialprintPGM(PSTR(S))) -#define SERIAL_ECHOLNPGM(S) (serialprintPGM(PSTR(S "\n"))) +// Print up to 12 pairs of values followed by newline +#define __SELP_N_P(N,V...) _SELP_##N##_P(V) +#define _SELP_N_P(N,V...) __SELP_N_P(N,V) +#define _SELP_1_P(PRE) serialprintPGM(PRE) +#define _SELP_2_P(PRE,V) do{ serial_echopair_PGM(PRE,V); SERIAL_EOL(); }while(0) +#define _SELP_3_P(a,b,c) do{ _SEP_2_P(a,b); serialprintPGM(c); }while(0) +#define _SELP_4_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_2_P(V); }while(0) +#define _SELP_5_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_3_P(V); }while(0) +#define _SELP_6_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_4_P(V); }while(0) +#define _SELP_7_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_5_P(V); }while(0) +#define _SELP_8_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_6_P(V); }while(0) +#define _SELP_9_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_7_P(V); }while(0) +#define _SELP_10_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_8_P(V); }while(0) +#define _SELP_11_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_9_P(V); }while(0) +#define _SELP_12_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_10_P(V); }while(0) +#define _SELP_13_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_11_P(V); }while(0) +#define _SELP_14_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_12_P(V); }while(0) +#define _SELP_15_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_13_P(V); }while(0) +#define _SELP_16_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_14_P(V); }while(0) +#define _SELP_17_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_15_P(V); }while(0) +#define _SELP_18_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_16_P(V); }while(0) +#define _SELP_19_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_17_P(V); }while(0) +#define _SELP_20_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_18_P(V); }while(0) +#define _SELP_21_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_19_P(V); }while(0) +#define _SELP_22_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_20_P(V); }while(0) +#define _SELP_23_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_21_P(V); }while(0) +#define _SELP_24_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_22_P(V); }while(0) // Eat two args, pass the rest up + +#define SERIAL_ECHOLNPAIR_P(V...) _SELP_N_P(NUM_ARGS(V),V) + +// Print up to 20 comma-separated pairs of values +#define __SLST_N(N,V...) _SLST_##N(V) +#define _SLST_N(N,V...) __SLST_N(N,V) +#define _SLST_1(a) SERIAL_ECHO(a) +#define _SLST_2(a,b) do{ SERIAL_ECHO(a); SERIAL_ECHOPAIR(", ",b); }while(0) +#define _SLST_3(a,b,c) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_1(c); }while(0) +#define _SLST_4(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_2(V); }while(0) +#define _SLST_5(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_3(V); }while(0) +#define _SLST_6(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_4(V); }while(0) +#define _SLST_7(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_5(V); }while(0) +#define _SLST_8(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_6(V); }while(0) +#define _SLST_9(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_7(V); }while(0) +#define _SLST_10(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_8(V); }while(0) +#define _SLST_11(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_9(V); }while(0) +#define _SLST_12(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_10(V); }while(0) +#define _SLST_13(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_11(V); }while(0) +#define _SLST_14(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_12(V); }while(0) +#define _SLST_15(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_13(V); }while(0) +#define _SLST_16(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_14(V); }while(0) +#define _SLST_17(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_15(V); }while(0) +#define _SLST_18(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_16(V); }while(0) +#define _SLST_19(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_17(V); }while(0) +#define _SLST_20(a,b,V...) do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_18(V); }while(0) // Eat two args, pass the rest up + +#define SERIAL_ECHOLIST(pre,V...) do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0) +#define SERIAL_ECHOLIST_N(N,V...) _SLST_N(N,LIST_N(N,V)) -#define SERIAL_ECHOPAIR_F(pre, V...) do{ SERIAL_ECHO(pre); SERIAL_ECHO_F(V); }while(0) -#define SERIAL_ECHOLNPAIR_F(V...) do{ SERIAL_ECHOPAIR_F(V); SERIAL_EOL(); }while(0) +#define SERIAL_ECHO_P(P) (serialprintPGM(P)) + +#define SERIAL_ECHOPGM(S) (SERIAL_ECHO_P(PSTR(S))) +#define SERIAL_ECHOLNPGM(S) (SERIAL_ECHO_P(PSTR(S "\n"))) + +#define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0) +#define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0) + +#define SERIAL_ECHOPAIR_F(S,V...) SERIAL_ECHOPAIR_F_P(PSTR(S),V) +#define SERIAL_ECHOLNPAIR_F(V...) do{ SERIAL_ECHOPAIR_F(V); SERIAL_EOL(); }while(0) #define SERIAL_ECHO_START() serial_echo_start() #define SERIAL_ERROR_START() serial_error_start() @@ -156,6 +250,8 @@ extern uint8_t marlin_debug_flags; #define SERIAL_ECHO_SP(C) serial_spaces(C) +#define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST) serial_ternary(TF, PSTR(PRE), PSTR(ON), PSTR(OFF), PSTR(POST)) + // // Functions for serial printing from PROGMEM. (Saves loads of SRAM.) // @@ -182,7 +278,11 @@ void serial_spaces(uint8_t count); void print_bin(const uint16_t val); -void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z); -void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]); -#define SERIAL_POS(SUFFIX,VAR) do { print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0) -#define SERIAL_XYZ(PREFIX,V...) do { print_xyz(PSTR(PREFIX), nullptr, V); } while(0) +void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr); + +inline void print_xyz(const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr) { + print_xyz(xyz.x, xyz.y, xyz.z, prefix, suffix); +} + +#define SERIAL_POS(SUFFIX,VAR) do { print_xyz(VAR, PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n")); }while(0) +#define SERIAL_XYZ(PREFIX,V...) do { print_xyz(V, PSTR(PREFIX), nullptr); }while(0) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h new file mode 100644 index 000000000000..72578faaaf27 --- /dev/null +++ b/Marlin/src/core/types.h @@ -0,0 +1,489 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include +#include + +#include "millis_t.h" + +class __FlashStringHelper; +typedef const __FlashStringHelper *progmem_str; + +// +// Enumerated axis indices +// +// - 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 +// +enum AxisEnum : uint8_t { + X_AXIS = 0, A_AXIS = 0, + Y_AXIS = 1, B_AXIS = 1, + Z_AXIS = 2, C_AXIS = 2, + E_AXIS = 3, + X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 6, + E0_AXIS = 3, + E1_AXIS = 4, + E2_AXIS = 5, + E3_AXIS = 6, + E4_AXIS = 7, + E5_AXIS = 8, + ALL_AXES = 0xFE, NO_AXIS = 0xFF +}; + +// +// Loop over XYZE axes +// + +#define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++) +#define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++) +#define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N) +#define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N) + +#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_AXIS) +#define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N) +#define LOOP_ABC(VAR) LOOP_S_LE_N(VAR, A_AXIS, C_AXIS) +#define LOOP_ABCE(VAR) LOOP_S_LE_N(VAR, A_AXIS, E_AXIS) +#define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N) + +// +// Conditional type assignment magic. For example... +// +// typename IF<(MYOPT==12), int, float>::type myvar; +// +template +struct IF { typedef R type; }; +template +struct IF { typedef L type; }; + +// +// feedRate_t is just a humble float +// +typedef float feedRate_t; + +// Conversion macros +#define MMM_TO_MMS(MM_M) feedRate_t(float(MM_M) / 60.0f) +#define MMS_TO_MMM(MM_S) (float(MM_S) * 60.0f) +#define MMS_SCALED(V) ((V) * 0.01f * feedrate_percentage) + +// +// Coordinates structures for XY, XYZ, XYZE... +// + +// Helpers +#define _RECIP(N) ((N) ? 1.0f / float(N) : 0.0f) +#define _ABS(N) ((N) < 0 ? -(N) : (N)) +#define _LS(N) (N = (T)(uint32_t(N) << v)) +#define _RS(N) (N = (T)(uint32_t(N) >> v)) +#define FI FORCE_INLINE + +// Forward declarations +template struct XYval; +template struct XYZval; +template struct XYZEval; + +typedef struct XYval xy_bool_t; +typedef struct XYZval xyz_bool_t; +typedef struct XYZEval xyze_bool_t; + +typedef struct XYval xy_char_t; +typedef struct XYZval xyz_char_t; +typedef struct XYZEval xyze_char_t; + +typedef struct XYval xy_uchar_t; +typedef struct XYZval xyz_uchar_t; +typedef struct XYZEval xyze_uchar_t; + +typedef struct XYval xy_int8_t; +typedef struct XYZval xyz_int8_t; +typedef struct XYZEval xyze_int8_t; + +typedef struct XYval xy_uint8_t; +typedef struct XYZval xyz_uint8_t; +typedef struct XYZEval xyze_uint8_t; + +typedef struct XYval xy_int_t; +typedef struct XYZval xyz_int_t; +typedef struct XYZEval xyze_int_t; + +typedef struct XYval xy_uint_t; +typedef struct XYZval xyz_uint_t; +typedef struct XYZEval xyze_uint_t; + +typedef struct XYval xy_long_t; +typedef struct XYZval xyz_long_t; +typedef struct XYZEval xyze_long_t; + +typedef struct XYval xy_ulong_t; +typedef struct XYZval xyz_ulong_t; +typedef struct XYZEval xyze_ulong_t; + +typedef struct XYZval xyz_vlong_t; +typedef struct XYZEval xyze_vlong_t; + +typedef struct XYval xy_float_t; +typedef struct XYZval xyz_float_t; +typedef struct XYZEval xyze_float_t; + +typedef struct XYval xy_feedrate_t; +typedef struct XYZval xyz_feedrate_t; +typedef struct XYZEval xyze_feedrate_t; + +typedef xy_uint8_t xy_byte_t; +typedef xyz_uint8_t xyz_byte_t; +typedef xyze_uint8_t xyze_byte_t; + +typedef xyz_long_t abc_long_t; +typedef xyze_long_t abce_long_t; +typedef xyz_ulong_t abc_ulong_t; +typedef xyze_ulong_t abce_ulong_t; + +typedef xy_float_t xy_pos_t; +typedef xyz_float_t xyz_pos_t; +typedef xyze_float_t xyze_pos_t; + +typedef xy_float_t ab_float_t; +typedef xyz_float_t abc_float_t; +typedef xyze_float_t abce_float_t; + +typedef ab_float_t ab_pos_t; +typedef abc_float_t abc_pos_t; +typedef abce_float_t abce_pos_t; + +// External conversion methods +void toLogical(xy_pos_t &raw); +void toLogical(xyz_pos_t &raw); +void toLogical(xyze_pos_t &raw); +void toNative(xy_pos_t &raw); +void toNative(xyz_pos_t &raw); +void toNative(xyze_pos_t &raw); + +// +// XY coordinates, counters, etc. +// +template +struct XYval { + union { + struct { T x, y; }; + struct { T a, b; }; + T pos[2]; + }; + FI void set(const T px) { x = px; } + FI void set(const T px, const T py) { x = px; y = py; } + FI void reset() { x = y = 0; } + FI T magnitude() const { return (T)sqrtf(x*x + y*y); } + FI operator T* () { return pos; } + FI operator bool() { return x || y; } + FI XYval copy() const { return *this; } + FI XYval ABS() const { return { T(_ABS(x)), T(_ABS(y)) }; } + FI XYval asInt() { return { int16_t(x), int16_t(y) }; } + FI XYval asInt() const { return { int16_t(x), int16_t(y) }; } + FI XYval asLong() { return { int32_t(x), int32_t(y) }; } + FI XYval asLong() const { return { int32_t(x), int32_t(y) }; } + FI XYval asFloat() { return { float(x), float(y) }; } + FI XYval asFloat() const { return { float(x), float(y) }; } + FI XYval reciprocal() const { return { _RECIP(x), _RECIP(y) }; } + FI XYval asLogical() const { XYval o = asFloat(); toLogical(o); return o; } + FI XYval asNative() const { XYval o = asFloat(); toNative(o); return o; } + FI operator XYZval() { return { x, y }; } + FI operator XYZval() const { return { x, y }; } + FI operator XYZEval() { return { x, y }; } + FI operator XYZEval() const { return { x, y }; } + FI T& operator[](const int i) { return pos[i]; } + FI const T& operator[](const int i) const { return pos[i]; } + FI XYval& operator= (const T v) { set(v, v ); return *this; } + FI XYval& operator= (const XYZval &rs) { set(rs.x, rs.y); return *this; } + FI XYval& operator= (const XYZEval &rs) { set(rs.x, rs.y); return *this; } + FI XYval operator+ (const XYval &rs) const { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYval operator+ (const XYval &rs) { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYval operator- (const XYval &rs) const { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYval operator- (const XYval &rs) { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYval operator* (const XYval &rs) const { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYval operator* (const XYval &rs) { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYval operator/ (const XYval &rs) const { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYval operator/ (const XYval &rs) { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYval operator+ (const XYZval &rs) const { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYval operator+ (const XYZval &rs) { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYval operator- (const XYZval &rs) const { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYval operator- (const XYZval &rs) { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYval operator* (const XYZval &rs) const { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYval operator* (const XYZval &rs) { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYval operator/ (const XYZval &rs) const { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYval operator/ (const XYZval &rs) { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYval operator+ (const XYZEval &rs) const { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYval operator+ (const XYZEval &rs) { XYval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYval operator- (const XYZEval &rs) const { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYval operator- (const XYZEval &rs) { XYval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYval operator* (const XYZEval &rs) const { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYval operator* (const XYZEval &rs) { XYval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYval operator/ (const XYZEval &rs) const { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYval operator/ (const XYZEval &rs) { XYval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYval operator* (const float &v) const { XYval ls = *this; ls.x *= v; ls.y *= v; return ls; } + FI XYval operator* (const float &v) { XYval ls = *this; ls.x *= v; ls.y *= v; return ls; } + FI XYval operator* (const int &v) const { XYval ls = *this; ls.x *= v; ls.y *= v; return ls; } + FI XYval operator* (const int &v) { XYval ls = *this; ls.x *= v; ls.y *= v; return ls; } + FI XYval operator/ (const float &v) const { XYval ls = *this; ls.x /= v; ls.y /= v; return ls; } + FI XYval operator/ (const float &v) { XYval ls = *this; ls.x /= v; ls.y /= v; return ls; } + FI XYval operator/ (const int &v) const { XYval ls = *this; ls.x /= v; ls.y /= v; return ls; } + FI XYval operator/ (const int &v) { XYval ls = *this; ls.x /= v; ls.y /= v; return ls; } + FI XYval operator>>(const int &v) const { XYval ls = *this; _RS(ls.x); _RS(ls.y); return ls; } + FI XYval operator>>(const int &v) { XYval ls = *this; _RS(ls.x); _RS(ls.y); return ls; } + FI XYval operator<<(const int &v) const { XYval ls = *this; _LS(ls.x); _LS(ls.y); return ls; } + FI XYval operator<<(const int &v) { XYval ls = *this; _LS(ls.x); _LS(ls.y); return ls; } + FI XYval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } + FI XYval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } + FI XYval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } + FI XYval& operator+=(const XYZval &rs) { x += rs.x; y += rs.y; return *this; } + FI XYval& operator-=(const XYZval &rs) { x -= rs.x; y -= rs.y; return *this; } + FI XYval& operator*=(const XYZval &rs) { x *= rs.x; y *= rs.y; return *this; } + FI XYval& operator+=(const XYZEval &rs) { x += rs.x; y += rs.y; return *this; } + FI XYval& operator-=(const XYZEval &rs) { x -= rs.x; y -= rs.y; return *this; } + FI XYval& operator*=(const XYZEval &rs) { x *= rs.x; y *= rs.y; return *this; } + FI XYval& operator*=(const float &v) { x *= v; y *= v; return *this; } + FI XYval& operator*=(const int &v) { x *= v; y *= v; return *this; } + FI XYval& operator>>=(const int &v) { _RS(x); _RS(y); return *this; } + FI XYval& operator<<=(const int &v) { _LS(x); _LS(y); return *this; } + FI bool operator==(const XYval &rs) { return x == rs.x && y == rs.y; } + FI bool operator==(const XYZval &rs) { return x == rs.x && y == rs.y; } + FI bool operator==(const XYZEval &rs) { return x == rs.x && y == rs.y; } + FI bool operator==(const XYval &rs) const { return x == rs.x && y == rs.y; } + FI bool operator==(const XYZval &rs) const { return x == rs.x && y == rs.y; } + FI bool operator==(const XYZEval &rs) const { return x == rs.x && y == rs.y; } + FI bool operator!=(const XYval &rs) { return !operator==(rs); } + FI bool operator!=(const XYZval &rs) { return !operator==(rs); } + FI bool operator!=(const XYZEval &rs) { return !operator==(rs); } + FI bool operator!=(const XYval &rs) const { return !operator==(rs); } + FI bool operator!=(const XYZval &rs) const { return !operator==(rs); } + FI bool operator!=(const XYZEval &rs) const { return !operator==(rs); } + FI XYval operator-() { XYval o = *this; o.x = -x; o.y = -y; return o; } + FI const XYval operator-() const { XYval o = *this; o.x = -x; o.y = -y; return o; } +}; + +// +// XYZ coordinates, counters, etc. +// +template +struct XYZval { + union { + struct { T x, y, z; }; + struct { T a, b, c; }; + T pos[3]; + }; + FI void set(const T px) { x = px; } + FI void set(const T px, const T py) { x = px; y = py; } + FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } + FI void set(const XYval pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; } + FI void reset() { x = y = z = 0; } + FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z); } + FI operator T* () { return pos; } + FI operator bool() { return z || x || y; } + FI XYZval copy() const { XYZval o = *this; return o; } + FI XYZval ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)) }; } + FI XYZval asInt() { return { int16_t(x), int16_t(y), int16_t(z) }; } + FI XYZval asInt() const { return { int16_t(x), int16_t(y), int16_t(z) }; } + FI XYZval asLong() { return { int32_t(x), int32_t(y), int32_t(z) }; } + FI XYZval asLong() const { return { int32_t(x), int32_t(y), int32_t(z) }; } + FI XYZval asFloat() { return { float(x), float(y), float(z) }; } + FI XYZval asFloat() const { return { float(x), float(y), float(z) }; } + FI XYZval reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z) }; } + FI XYZval asLogical() const { XYZval o = asFloat(); toLogical(o); return o; } + FI XYZval asNative() const { XYZval o = asFloat(); toNative(o); return o; } + FI operator XYval&() { return *(XYval*)this; } + FI operator const XYval&() const { return *(const XYval*)this; } + FI operator XYZEval() const { return { x, y, z }; } + FI T& operator[](const int i) { return pos[i]; } + FI const T& operator[](const int i) const { return pos[i]; } + FI XYZval& operator= (const T v) { set(v, v, v ); return *this; } + FI XYZval& operator= (const XYval &rs) { set(rs.x, rs.y ); return *this; } + FI XYZval& operator= (const XYZEval &rs) { set(rs.x, rs.y, rs.z); return *this; } + FI XYZval operator+ (const XYval &rs) const { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYZval operator+ (const XYval &rs) { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYZval operator- (const XYval &rs) const { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYZval operator- (const XYval &rs) { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYZval operator* (const XYval &rs) const { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYZval operator* (const XYval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYZval operator/ (const XYval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYZval operator/ (const XYval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYZval operator+ (const XYZval &rs) const { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } + FI XYZval operator+ (const XYZval &rs) { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } + FI XYZval operator- (const XYZval &rs) const { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } + FI XYZval operator- (const XYZval &rs) { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } + FI XYZval operator* (const XYZval &rs) const { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } + FI XYZval operator* (const XYZval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } + FI XYZval operator/ (const XYZval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } + FI XYZval operator/ (const XYZval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } + FI XYZval operator+ (const XYZEval &rs) const { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } + FI XYZval operator+ (const XYZEval &rs) { XYZval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } + FI XYZval operator- (const XYZEval &rs) const { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } + FI XYZval operator- (const XYZEval &rs) { XYZval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } + FI XYZval operator* (const XYZEval &rs) const { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } + FI XYZval operator* (const XYZEval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } + FI XYZval operator/ (const XYZEval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } + FI XYZval operator/ (const XYZEval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } + FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } + FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } + FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } + FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } + FI XYZval operator/ (const float &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } + FI XYZval operator/ (const float &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } + FI XYZval operator/ (const int &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } + FI XYZval operator/ (const int &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } + FI XYZval operator>>(const int &v) const { XYZval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; } + FI XYZval operator>>(const int &v) { XYZval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; } + FI XYZval operator<<(const int &v) const { XYZval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; } + FI XYZval operator<<(const int &v) { XYZval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; } + FI XYZval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } + FI XYZval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } + FI XYZval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } + FI XYZval& operator/=(const XYval &rs) { x /= rs.x; y /= rs.y; return *this; } + FI XYZval& operator+=(const XYZval &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; } + FI XYZval& operator-=(const XYZval &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; } + FI XYZval& operator*=(const XYZval &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; } + FI XYZval& operator/=(const XYZval &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; } + FI XYZval& operator+=(const XYZEval &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; } + FI XYZval& operator-=(const XYZEval &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; } + FI XYZval& operator*=(const XYZEval &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; } + FI XYZval& operator/=(const XYZEval &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; } + FI XYZval& operator*=(const float &v) { x *= v; y *= v; z *= v; return *this; } + FI XYZval& operator*=(const int &v) { x *= v; y *= v; z *= v; return *this; } + FI XYZval& operator>>=(const int &v) { _RS(x); _RS(y); _RS(z); return *this; } + FI XYZval& operator<<=(const int &v) { _LS(x); _LS(y); _LS(z); return *this; } + FI bool operator==(const XYZEval &rs) { return x == rs.x && y == rs.y && z == rs.z; } + FI bool operator!=(const XYZEval &rs) { return !operator==(rs); } + FI bool operator==(const XYZEval &rs) const { return x == rs.x && y == rs.y && z == rs.z; } + FI bool operator!=(const XYZEval &rs) const { return !operator==(rs); } + FI XYZval operator-() { XYZval o = *this; o.x = -x; o.y = -y; o.z = -z; return o; } + FI const XYZval operator-() const { XYZval o = *this; o.x = -x; o.y = -y; o.z = -z; return o; } +}; + +// +// XYZE coordinates, counters, etc. +// +template +struct XYZEval { + union { + struct{ T x, y, z, e; }; + struct{ T a, b, c; }; + T pos[4]; + }; + FI void reset() { x = y = z = e = 0; } + FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z + e*e); } + FI operator T* () { return pos; } + FI operator bool() { return e || z || x || y; } + FI void set(const T px) { x = px; } + FI void set(const T px, const T py) { x = px; y = py; } + FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } + FI void set(const T px, const T py, const T pz, const T pe) { x = px; y = py; z = pz; e = pe; } + FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } + FI void set(const XYval pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; } + FI void set(const XYZval pxyz) { x = pxyz.x; y = pxyz.y; z = pxyz.z; } + FI void set(const XYval pxy, const T pz, const T pe) { x = pxy.x; y = pxy.y; z = pz; e = pe; } + FI void set(const XYval pxy, const XYval pze) { x = pxy.x; y = pxy.y; z = pze.z; e = pze.e; } + FI void set(const XYZval pxyz, const T pe) { x = pxyz.x; y = pxyz.y; z = pxyz.z; e = pe; } + FI XYZEval copy() const { return *this; } + FI XYZEval ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(e)) }; } + FI XYZEval asInt() { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; } + FI XYZEval asInt() const { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; } + FI XYZEval asLong() const { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; } + FI XYZEval asLong() { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; } + FI XYZEval asFloat() { return { float(x), float(y), float(z), float(e) }; } + FI XYZEval asFloat() const { return { float(x), float(y), float(z), float(e) }; } + FI XYZEval reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z), _RECIP(e) }; } + FI XYZEval asLogical() const { XYZEval o = asFloat(); toLogical(o); return o; } + FI XYZEval asNative() const { XYZEval o = asFloat(); toNative(o); return o; } + FI operator XYval&() { return *(XYval*)this; } + FI operator const XYval&() const { return *(const XYval*)this; } + FI operator XYZval&() { return *(XYZval*)this; } + FI operator const XYZval&() const { return *(const XYZval*)this; } + FI T& operator[](const int i) { return pos[i]; } + FI const T& operator[](const int i) const { return pos[i]; } + FI XYZEval& operator= (const T v) { set(v, v, v, v); return *this; } + FI XYZEval& operator= (const XYval &rs) { set(rs.x, rs.y); return *this; } + FI XYZEval& operator= (const XYZval &rs) { set(rs.x, rs.y, rs.z); return *this; } + FI XYZEval operator+ (const XYval &rs) const { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYZEval operator+ (const XYval &rs) { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; } + FI XYZEval operator- (const XYval &rs) const { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYZEval operator- (const XYval &rs) { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; } + FI XYZEval operator* (const XYval &rs) const { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYZEval operator* (const XYval &rs) { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; } + FI XYZEval operator/ (const XYval &rs) const { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYZEval operator/ (const XYval &rs) { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; } + FI XYZEval operator+ (const XYZval &rs) const { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } + FI XYZEval operator+ (const XYZval &rs) { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; } + FI XYZEval operator- (const XYZval &rs) const { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } + FI XYZEval operator- (const XYZval &rs) { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; } + FI XYZEval operator* (const XYZval &rs) const { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } + FI XYZEval operator* (const XYZval &rs) { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } + FI XYZEval operator/ (const XYZval &rs) const { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } + FI XYZEval operator/ (const XYZval &rs) { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } + FI XYZEval operator+ (const XYZEval &rs) const { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; ls.e += rs.e; return ls; } + FI XYZEval operator+ (const XYZEval &rs) { XYZEval ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; ls.e += rs.e; return ls; } + FI XYZEval operator- (const XYZEval &rs) const { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; ls.e -= rs.e; return ls; } + FI XYZEval operator- (const XYZEval &rs) { XYZEval ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; ls.e -= rs.e; return ls; } + FI XYZEval operator* (const XYZEval &rs) const { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.e *= rs.e; return ls; } + FI XYZEval operator* (const XYZEval &rs) { XYZEval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.e *= rs.e; return ls; } + FI XYZEval operator/ (const XYZEval &rs) const { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.e /= rs.e; return ls; } + FI XYZEval operator/ (const XYZEval &rs) { XYZEval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.e /= rs.e; return ls; } + FI XYZEval operator* (const float &v) const { XYZEval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; } + FI XYZEval operator* (const float &v) { XYZEval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; } + FI XYZEval operator* (const int &v) const { XYZEval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; } + FI XYZEval operator* (const int &v) { XYZEval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; } + FI XYZEval operator/ (const float &v) const { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; } + FI XYZEval operator/ (const float &v) { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; } + FI XYZEval operator/ (const int &v) const { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; } + FI XYZEval operator/ (const int &v) { XYZEval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; } + FI XYZEval operator>>(const int &v) const { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.e); return ls; } + FI XYZEval operator>>(const int &v) { XYZEval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.e); return ls; } + FI XYZEval operator<<(const int &v) const { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.e); return ls; } + FI XYZEval operator<<(const int &v) { XYZEval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.e); return ls; } + FI XYZEval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } + FI XYZEval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } + FI XYZEval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } + FI XYZEval& operator/=(const XYval &rs) { x /= rs.x; y /= rs.y; return *this; } + FI XYZEval& operator+=(const XYZval &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; } + FI XYZEval& operator-=(const XYZval &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; } + FI XYZEval& operator*=(const XYZval &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; } + FI XYZEval& operator/=(const XYZval &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; } + FI XYZEval& operator+=(const XYZEval &rs) { x += rs.x; y += rs.y; z += rs.z; e += rs.e; return *this; } + FI XYZEval& operator-=(const XYZEval &rs) { x -= rs.x; y -= rs.y; z -= rs.z; e -= rs.e; return *this; } + FI XYZEval& operator*=(const XYZEval &rs) { x *= rs.x; y *= rs.y; z *= rs.z; e *= rs.e; return *this; } + FI XYZEval& operator/=(const XYZEval &rs) { x /= rs.x; y /= rs.y; z /= rs.z; e /= rs.e; return *this; } + FI XYZEval& operator*=(const T &v) { x *= v; y *= v; z *= v; e *= v; return *this; } + FI XYZEval& operator>>=(const int &v) { _RS(x); _RS(y); _RS(z); _RS(e); return *this; } + FI XYZEval& operator<<=(const int &v) { _LS(x); _LS(y); _LS(z); _LS(e); return *this; } + FI bool operator==(const XYZval &rs) { return x == rs.x && y == rs.y && z == rs.z; } + FI bool operator!=(const XYZval &rs) { return !operator==(rs); } + FI bool operator==(const XYZval &rs) const { return x == rs.x && y == rs.y && z == rs.z; } + FI bool operator!=(const XYZval &rs) const { return !operator==(rs); } + FI XYZEval operator-() { return { -x, -y, -z, -e }; } + FI const XYZEval operator-() const { return { -x, -y, -z, -e }; } +}; + +#undef _RECIP +#undef _ABS +#undef _LS +#undef _RS +#undef FI + +const xyze_char_t axis_codes { 'X', 'Y', 'Z', 'E' }; diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 089cf528d655..189a505cc37d 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -40,7 +40,6 @@ void safe_delay(millis_t ms) { #include "../module/probe.h" #include "../module/motion.h" #include "../module/stepper.h" - #include "../module/stepper.h" #include "../libs/numtostr.h" #include "../feature/bedlevel/bedlevel.h" @@ -80,40 +79,36 @@ void safe_delay(millis_t ms) { ); #if HAS_BED_PROBE - SERIAL_ECHOPAIR( - "Probe Offset X:" STRINGIFY(X_PROBE_OFFSET_FROM_EXTRUDER) - " Y:" STRINGIFY(Y_PROBE_OFFSET_FROM_EXTRUDER) - " Z:", zprobe_zoffset - ); - if ((X_PROBE_OFFSET_FROM_EXTRUDER) > 0) + SERIAL_ECHOPAIR_P(PSTR("Probe Offset X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z); + if (probe_offset.x > 0) SERIAL_ECHOPGM(" (Right"); - else if ((X_PROBE_OFFSET_FROM_EXTRUDER) < 0) + else if (probe_offset.x < 0) SERIAL_ECHOPGM(" (Left"); - else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) != 0) + else if (probe_offset.y != 0) SERIAL_ECHOPGM(" (Middle"); else SERIAL_ECHOPGM(" (Aligned With"); - if ((Y_PROBE_OFFSET_FROM_EXTRUDER) > 0) { + if (probe_offset.y > 0) { #if IS_SCARA SERIAL_ECHOPGM("-Distal"); #else SERIAL_ECHOPGM("-Back"); #endif } - else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) < 0) { + else if (probe_offset.y < 0) { #if IS_SCARA SERIAL_ECHOPGM("-Proximal"); #else SERIAL_ECHOPGM("-Front"); #endif } - else if ((X_PROBE_OFFSET_FROM_EXTRUDER) != 0) + else if (probe_offset.x != 0) SERIAL_ECHOPGM("-Center"); - if (zprobe_zoffset < 0) + if (probe_offset.z < 0) SERIAL_ECHOPGM(" & Below"); - else if (zprobe_zoffset > 0) + else if (probe_offset.z > 0) SERIAL_ECHOPGM(" & Above"); else SERIAL_ECHOPGM(" & Same Z as"); @@ -139,24 +134,18 @@ void safe_delay(millis_t ms) { 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] - }; SERIAL_ECHOPGM("ABL Adjustment X"); - if (diff[X_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[X_AXIS]); - SERIAL_ECHOPGM(" Y"); - if (diff[Y_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[Y_AXIS]); - SERIAL_ECHOPGM(" Z"); - if (diff[Z_AXIS] > 0) SERIAL_CHAR('+'); - SERIAL_ECHO(diff[Z_AXIS]); + LOOP_XYZ(a) { + float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]; + SERIAL_CHAR(' '); + SERIAL_CHAR('X' + char(a)); + if (v > 0) SERIAL_CHAR('+'); + SERIAL_ECHO(v); + } #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]); + const float rz = ubl.get_z_correction(current_position); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) SERIAL_ECHOPGM("ABL Adjustment Z"); const float rz = bilinear_z_offset(current_position); @@ -164,7 +153,7 @@ void safe_delay(millis_t ms) { 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_ECHOPAIR(" (", ftostr43sign(rz * planner.fade_scaling_factor_for_z(current_position.z), '+')); SERIAL_CHAR(')'); } #endif @@ -180,15 +169,11 @@ void safe_delay(millis_t ms) { SERIAL_ECHOPGM("Mesh Bed Leveling"); if (planner.leveling_active) { 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 - ), '+')); + SERIAL_ECHOPAIR("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position), '+')); #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])), '+' + mbl.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+' )); SERIAL_CHAR(')'); } diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index 63597fd41365..f430da50d6a0 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -22,8 +22,7 @@ #pragma once #include "../inc/MarlinConfigPre.h" - -constexpr char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' }; +#include "../core/types.h" // Delay that ensures heaters and watchdog are kept alive void safe_delay(millis_t ms); @@ -37,10 +36,25 @@ inline void serial_delay(const millis_t ms) { #endif } -// 16x16 bit arrays -FORCE_INLINE void bitmap_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); } -FORCE_INLINE void bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); } -FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); } +#if GRID_MAX_POINTS_X && GRID_MAX_POINTS_Y + + // 16x16 bit arrays + template + struct FlagBits { + typename IF<(W>8), uint16_t, uint8_t>::type bits[H]; + void fill() { memset(bits, 0xFF, sizeof(bits)); } + void reset() { memset(bits, 0x00, sizeof(bits)); } + void unmark(const uint8_t x, const uint8_t y) { CBI(bits[y], x); } + void mark(const uint8_t x, const uint8_t y) { SBI(bits[y], x); } + bool marked(const uint8_t x, const uint8_t y) { return TEST(bits[y], x); } + inline void unmark(const xy_int8_t &xy) { unmark(xy.x, xy.y); } + inline void mark(const xy_int8_t &xy) { mark(xy.x, xy.y); } + inline bool marked(const xy_int8_t &xy) { return marked(xy.x, xy.y); } + }; + + typedef FlagBits MeshFlags; + +#endif #if ENABLED(DEBUG_LEVELING_FEATURE) void log_machine_info(); @@ -59,7 +73,7 @@ class restorer { inline void restore() { ref_ = val_; } }; -#define REMEMBER(N,X, ...) restorer restorer_##N(X, ##__VA_ARGS__) +#define REMEMBER(N,X,V...) const restorer restorer_##N(X, ##V) #define RESTORE(N) restorer_##N.restore() // Converts from an uint8_t in the range of 0-255 to an uint8_t diff --git a/Marlin/src/feature/I2CPositionEncoder.cpp b/Marlin/src/feature/I2CPositionEncoder.cpp index 254ba01eff70..c3b182c72a0f 100644 --- a/Marlin/src/feature/I2CPositionEncoder.cpp +++ b/Marlin/src/feature/I2CPositionEncoder.cpp @@ -168,7 +168,7 @@ void I2CPositionEncoder::update() { 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))); + const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE)); SERIAL_ECHO(axis_codes[encoderAxis]); SERIAL_ECHOLNPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis], "mm; correcting!"); babystep.add_steps(encoderAxis, -LROUND(errorP)); @@ -233,7 +233,7 @@ bool I2CPositionEncoder::passes_test(const bool report) { switch (H) { case I2CPE_MAG_SIG_GOOD: case I2CPE_MAG_SIG_MID: - serial_ternary(H == I2CPE_MAG_SIG_GOOD, PSTR("passes test; field strength "), PSTR("good"), PSTR("fair"), PSTR(".\n")); + SERIAL_ECHO_TERNARY(H == I2CPE_MAG_SIG_GOOD, "passes test; field strength ", "good", "fair", ".\n"); break; default: SERIAL_ECHOLNPGM("not detected!"); @@ -326,26 +326,23 @@ bool I2CPositionEncoder::test_axis() { //only works on XYZ cartesian machines for the time being if (!(encoderAxis == X_AXIS || encoderAxis == Y_AXIS || encoderAxis == Z_AXIS)) return false; - float startCoord[NUM_AXIS] = { 0 }, endCoord[NUM_AXIS] = { 0 }; - - const float startPosition = soft_endstop[encoderAxis].min + 10, - endPosition = soft_endstop[encoderAxis].max - 10, - feedrate = FLOOR(MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY)); + const float startPosition = soft_endstop.min[encoderAxis] + 10, + endPosition = soft_endstop.max[encoderAxis] - 10; + const feedRate_t fr_mm_s = FLOOR(MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY)); ec = false; - LOOP_NA(i) { - startCoord[i] = planner.get_axis_position_mm((AxisEnum)i); - endCoord[i] = planner.get_axis_position_mm((AxisEnum)i); + xyze_pos_t startCoord, endCoord; + LOOP_XYZ(a) { + startCoord[a] = planner.get_axis_position_mm((AxisEnum)a); + endCoord[a] = planner.get_axis_position_mm((AxisEnum)a); } - startCoord[encoderAxis] = startPosition; endCoord[encoderAxis] = endPosition; planner.synchronize(); - - planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); + startCoord.e = planner.get_axis_position_mm(E_AXIS); + planner.buffer_line(startCoord, fr_mm_s, 0); planner.synchronize(); // if the module isn't currently trusted, wait until it is (or until it should be if things are working) @@ -356,8 +353,8 @@ bool I2CPositionEncoder::test_axis() { } 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); + endCoord.e = planner.get_axis_position_mm(E_AXIS); + planner.buffer_line(endCoord, fr_mm_s, 0); planner.synchronize(); } @@ -377,44 +374,41 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { float old_steps_mm, new_steps_mm, startDistance, endDistance, - travelDistance, travelledDistance, total = 0, - startCoord[NUM_AXIS] = { 0 }, endCoord[NUM_AXIS] = { 0 }; - - float feedrate; + travelDistance, travelledDistance, total = 0; int32_t startCount, stopCount; - feedrate = MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY); + const feedRate_t fr_mm_s = MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY); bool oldec = ec; ec = false; startDistance = 20; - endDistance = soft_endstop[encoderAxis].max - 20; + endDistance = soft_endstop.max[encoderAxis] - 20; travelDistance = endDistance - startDistance; - LOOP_NA(i) { - startCoord[i] = planner.get_axis_position_mm((AxisEnum)i); - endCoord[i] = planner.get_axis_position_mm((AxisEnum)i); + xyze_pos_t startCoord, endCoord; + LOOP_XYZ(a) { + startCoord[a] = planner.get_axis_position_mm((AxisEnum)a); + endCoord[a] = planner.get_axis_position_mm((AxisEnum)a); } - 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); + startCoord.e = planner.get_axis_position_mm(E_AXIS); + planner.buffer_line(startCoord, fr_mm_s, 0); planner.synchronize(); delay(250); startCount = get_position(); - //do_blocking_move_to(endCoord[X_AXIS],endCoord[Y_AXIS],endCoord[Z_AXIS]); + //do_blocking_move_to(endCoord); - planner.buffer_line(endCoord[X_AXIS], endCoord[Y_AXIS], endCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); + endCoord.e = planner.get_axis_position_mm(E_AXIS); + planner.buffer_line(endCoord, fr_mm_s, 0); planner.synchronize(); //Read encoder distance @@ -424,7 +418,6 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { travelledDistance = mm_from_count(ABS(stopCount - startCount)); SERIAL_ECHOLNPAIR("Attempted travel: ", travelDistance, "mm"); - SERIAL_ECHOLNPAIR(" Actual travel: ", travelledDistance, "mm"); //Calculate new axis steps per unit @@ -441,7 +434,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { total += new_steps_mm; // swap start and end points so next loop runs from current position - float tempCoord = startCoord[encoderAxis]; + const float tempCoord = startCoord[encoderAxis]; startCoord[encoderAxis] = endCoord[encoderAxis]; endCoord[encoderAxis] = tempCoord; } diff --git a/Marlin/src/feature/I2CPositionEncoder.h b/Marlin/src/feature/I2CPositionEncoder.h index 84e4a295194b..25350b27873f 100644 --- a/Marlin/src/feature/I2CPositionEncoder.h +++ b/Marlin/src/feature/I2CPositionEncoder.h @@ -93,8 +93,6 @@ #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]; @@ -168,15 +166,15 @@ class I2CPositionEncoder { bool passes_test(const bool report); - bool test_axis(void); + bool test_axis(); - FORCE_INLINE int get_error_count(void) { return errorCount; } + FORCE_INLINE int get_error_count() { return errorCount; } FORCE_INLINE void set_error_count(const int newCount) { errorCount = newCount; } FORCE_INLINE uint8_t get_address() { return i2cAddress; } FORCE_INLINE void set_address(const uint8_t addr) { i2cAddress = addr; } - FORCE_INLINE bool get_active(void) { return active; } + FORCE_INLINE bool get_active() { return active; } FORCE_INLINE void set_active(const bool a) { active = a; } FORCE_INLINE void set_inverted(const bool i) { invert = i; } @@ -219,10 +217,10 @@ class I2CPositionEncodersMgr { public: - static void init(void); + static void init(); // consider only updating one endoder per call / tick if encoders become too time intensive - static void update(void) { LOOP_PE(i) encoders[i].update(); } + static void update() { LOOP_PE(i) encoders[i].update(); } static void homed(const AxisEnum axis) { LOOP_PE(i) @@ -276,7 +274,7 @@ class I2CPositionEncodersMgr { CHECK_IDX(); encoders[idx].set_ec_enabled(enabled); SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]); - serial_ternary(encoders[idx].get_ec_enabled(), PSTR(" axis is "), PSTR("en"), PSTR("dis"), PSTR("abled.\n")); + SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n"); } static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) { diff --git a/Marlin/src/feature/Max7219_Debug_LEDs.cpp b/Marlin/src/feature/Max7219_Debug_LEDs.cpp index 0667af05819a..9ba67d6caac3 100644 --- a/Marlin/src/feature/Max7219_Debug_LEDs.cpp +++ b/Marlin/src/feature/Max7219_Debug_LEDs.cpp @@ -48,6 +48,28 @@ #include "../Marlin.h" #include "../HAL/shared/Delay.h" +#define HAS_SIDE_BY_SIDE (ENABLED(MAX7219_SIDE_BY_SIDE) && MAX7219_NUMBER_UNITS > 1) + +#if _ROT == 0 || _ROT == 180 + #if HAS_SIDE_BY_SIDE + #define MAX7219_X_LEDS 8 + #define MAX7219_Y_LEDS MAX7219_LINES + #else + #define MAX7219_Y_LEDS 8 + #define MAX7219_X_LEDS MAX7219_LINES + #endif +#elif _ROT == 90 || _ROT == 270 + #if HAS_SIDE_BY_SIDE + #define MAX7219_Y_LEDS 8 + #define MAX7219_X_LEDS MAX7219_LINES + #else + #define MAX7219_X_LEDS 8 + #define MAX7219_Y_LEDS MAX7219_LINES + #endif +#else + #error "MAX7219_ROTATE must be a multiple of +/- 90°." +#endif + Max7219 max7219; uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; @@ -59,25 +81,41 @@ uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; #else #define _LED_BIT(Q) ((Q) & 0x7) #endif - -#if (_ROT == 0 || _ROT == 270) == ENABLED(MAX7219_REVERSE_ORDER) - #define _LED_UNIT(Q) ((MAX7219_NUMBER_UNITS - 1 - ((Q) >> 3)) << 3) +#if _ROT == 0 || _ROT == 180 + #define LED_BIT(X,Y) _LED_BIT(X) #else - #define _LED_UNIT(Q) ((Q) & ~0x7) + #define LED_BIT(X,Y) _LED_BIT(Y) #endif - -#if _ROT < 180 - #define _LED_IND(P,Q) (_LED_UNIT(P) + (Q)) +#if _ROT == 0 || _ROT == 90 + #define _LED_IND(P,Q) (_LED_TOP(P) + ((Q) & 0x7)) #else - #define _LED_IND(P,Q) (_LED_UNIT(P) + (7 - ((Q) & 0x7))) + #define _LED_IND(P,Q) (_LED_TOP(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) + +#if HAS_SIDE_BY_SIDE + #if (_ROT == 0 || _ROT == 90) == DISABLED(MAX7219_REVERSE_ORDER) + #define _LED_TOP(Q) ((MAX7219_NUMBER_UNITS - 1 - ((Q) >> 3)) << 3) + #else + #define _LED_TOP(Q) ((Q) & ~0x7) + #endif + #if _ROT == 0 || _ROT == 180 + #define LED_IND(X,Y) _LED_IND(Y,Y) + #elif _ROT == 90 || _ROT == 270 + #define LED_IND(X,Y) _LED_IND(X,X) + #endif +#else + #if (_ROT == 0 || _ROT == 270) == DISABLED(MAX7219_REVERSE_ORDER) + #define _LED_TOP(Q) ((Q) & ~0x7) + #else + #define _LED_TOP(Q) ((MAX7219_NUMBER_UNITS - 1 - ((Q) >> 3)) << 3) + #endif + #if _ROT == 0 || _ROT == 180 + #define LED_IND(X,Y) _LED_IND(X,Y) + #elif _ROT == 90 || _ROT == 270 + #define LED_IND(X,Y) _LED_IND(Y,X) + #endif #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) @@ -172,23 +210,31 @@ void Max7219::send(const uint8_t reg, const uint8_t 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)]); +// Send out a single native row of bits to just one unit +void Max7219::refresh_unit_line(const uint8_t line) { + #if MAX7219_NUMBER_UNITS == 1 + send(LINE_REG(line), led_line[line]); + #else + for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) + if (u == (line >> 3)) send(LINE_REG(line), led_line[line]); else noop(); + #endif 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(); +// Send out a single native row of bits to all units +void Max7219::refresh_line(const uint8_t line) { + #if MAX7219_NUMBER_UNITS == 1 + refresh_unit_line(line); + #else + for (uint8_t u = MAX7219_NUMBER_UNITS; u--;) + send(LINE_REG(line), led_line[(u << 3) | (line & 0x7)]); + #endif pulse_load(); } void Max7219::set(const uint8_t line, const uint8_t bits) { led_line[line] = bits; - refresh_line(line); + refresh_unit_line(line); } #if ENABLED(MAX7219_NUMERIC) @@ -227,42 +273,50 @@ void Max7219::set(const uint8_t line, const uint8_t bits) { // 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 (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_set"), x, y); if (BIT_7219(x, y) == on) return; XOR_7219(x, y); - refresh_line(LED_IND(x, y)); + refresh_unit_line(LED_IND(x, y)); } 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); + if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) 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); + if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) 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); + if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) 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 + #if _ROT == 0 || _ROT == 180 // Native Lines are horizontal too + #if MAX7219_X_LEDS <= 8 + refresh_unit_line(LED_IND(0, row)); // A single unit line + #else + refresh_line(LED_IND(0, row)); // Same line, all units + #endif + #else // Native lines are vertical UNUSED(row); - refresh(); + refresh(); // Actually a column #endif } void Max7219::send_column(const uint8_t col) { - #if _ROT == 90 || _ROT == 270 - refresh_line(LED_IND(col, 0)); - #else + #if _ROT == 90 || _ROT == 270 // Native Lines are vertical too + #if MAX7219_Y_LEDS <= 8 + refresh_unit_line(LED_IND(col, 0)); // A single unit line + #else + refresh_line(LED_IND(col, 0)); // Same line, all units + #endif + #else // Native lines are horizontal UNUSED(col); - refresh(); + refresh(); // Actually a row #endif } @@ -378,24 +432,24 @@ void Max7219::set_columns_32bits(const uint8_t x, uint32_t val) { 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 + 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 + 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 + 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 + 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 + 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 @@ -408,7 +462,7 @@ void Max7219::register_setup() { 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; + 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]; } } @@ -416,7 +470,7 @@ void Max7219::register_setup() { #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; + 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); @@ -434,10 +488,10 @@ void Max7219::init() { register_setup(); - for (uint8_t i = 0; i <= 7; i++) { // Empty registers to turn all LEDs off + 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 + pulse_load(); // Tell the chips to load the clocked out data } #ifdef MAX7219_INIT_TEST @@ -464,55 +518,52 @@ void Max7219::init() { */ // 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); +void Max7219::mark16(const uint8_t pos, const uint8_t v1, const uint8_t v2) { + #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. + led_off(v1 & 0xF, pos); + led_on(v2 & 0xF, pos); + #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column. + led_off(pos, v1 & 0xF); + led_on(pos, v2 & 0xF); + #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. + led_off(v1 & 0x7, pos + (v1 >= 8)); + led_on(v2 & 0x7, pos + (v2 >= 8)); #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 MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. 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 + #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. 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); + #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. + 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)); + #endif } // Apply changes to update a quantity -void Max7219::quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv) { +void Max7219::quantity16(const uint8_t pos, 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 + led_set( + #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. + i, pos + #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column. + pos, i + #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. + i >> 1, pos + (i & 1) #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 + , nv >= ov + ); } void Max7219::idle_tasks() { diff --git a/Marlin/src/feature/Max7219_Debug_LEDs.h b/Marlin/src/feature/Max7219_Debug_LEDs.h index 17b2dfb474e3..9462fb23d9af 100644 --- a/Marlin/src/feature/Max7219_Debug_LEDs.h +++ b/Marlin/src/feature/Max7219_Debug_LEDs.h @@ -41,7 +41,6 @@ * 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. */ -#pragma once #ifndef MAX7219_ROTATE #define MAX7219_ROTATE 0 @@ -53,16 +52,6 @@ #endif #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 - // // MAX7219 registers // @@ -86,7 +75,7 @@ class Max7219 { public: static uint8_t led_line[MAX7219_LINES]; - Max7219() { } + Max7219() {} static void init(); static void register_setup(); diff --git a/Marlin/src/feature/babystep.cpp b/Marlin/src/feature/babystep.cpp index eb6ed046a432..1fc24991101e 100644 --- a/Marlin/src/feature/babystep.cpp +++ b/Marlin/src/feature/babystep.cpp @@ -35,20 +35,17 @@ Babystep babystep; -volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1]; - -#if HAS_LCD_MENU - int16_t Babystep::accum; - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; - #endif +volatile int16_t Babystep::steps[BS_TODO_AXIS(Z_AXIS) + 1]; +#if ENABLED(BABYSTEP_DISPLAY_TOTAL) + int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; #endif +int16_t Babystep::accum; void Babystep::step_axis(const AxisEnum axis) { - const int16_t curTodo = todo[BS_TODO_AXIS(axis)]; // get rid of volatile for performance + const int16_t curTodo = steps[BS_TODO_AXIS(axis)]; // get rid of volatile for performance if (curTodo) { stepper.babystep((AxisEnum)axis, curTodo > 0); - if (curTodo > 0) todo[BS_TODO_AXIS(axis)]--; else todo[BS_TODO_AXIS(axis)]++; + if (curTodo > 0) steps[BS_TODO_AXIS(axis)]--; else steps[BS_TODO_AXIS(axis)]++; } } @@ -75,11 +72,9 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) { if (!CAN_BABYSTEP(axis)) return; - #if HAS_LCD_MENU - accum += distance; // Count up babysteps for the UI - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - axis_total[BS_TOTAL_AXIS(axis)] += distance; - #endif + accum += distance; // Count up babysteps for the UI + #if ENABLED(BABYSTEP_DISPLAY_TOTAL) + axis_total[BS_TOTAL_AXIS(axis)] += distance; #endif #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) @@ -94,30 +89,30 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) { case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ BSA_ENABLE(CORE_AXIS_1); BSA_ENABLE(CORE_AXIS_2); - todo[CORE_AXIS_1] += distance * 2; - todo[CORE_AXIS_2] += distance * 2; + steps[CORE_AXIS_1] += distance * 2; + steps[CORE_AXIS_2] += distance * 2; break; case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ BSA_ENABLE(CORE_AXIS_1); BSA_ENABLE(CORE_AXIS_2); - todo[CORE_AXIS_1] += CORESIGN(distance * 2); - todo[CORE_AXIS_2] -= CORESIGN(distance * 2); + steps[CORE_AXIS_1] += CORESIGN(distance * 2); + steps[CORE_AXIS_2] -= CORESIGN(distance * 2); break; case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ default: BSA_ENABLE(NORMAL_AXIS); - todo[NORMAL_AXIS] += distance; + steps[NORMAL_AXIS] += distance; break; } #elif CORE_IS_XZ || CORE_IS_YZ // Only Z stepping needs to be handled here BSA_ENABLE(CORE_AXIS_1); BSA_ENABLE(CORE_AXIS_2); - todo[CORE_AXIS_1] += CORESIGN(distance * 2); - todo[CORE_AXIS_2] -= CORESIGN(distance * 2); + steps[CORE_AXIS_1] += CORESIGN(distance * 2); + steps[CORE_AXIS_2] -= CORESIGN(distance * 2); #else BSA_ENABLE(Z_AXIS); - todo[Z_AXIS] += distance; + steps[Z_AXIS] += distance; #endif #else #if ENABLED(BABYSTEP_XY) @@ -125,7 +120,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) { #else BSA_ENABLE(Z_AXIS); #endif - todo[BS_TODO_AXIS(axis)] += distance; + steps[BS_TODO_AXIS(axis)] += distance; #endif #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) gcode.reset_stepper_timeout(); diff --git a/Marlin/src/feature/babystep.h b/Marlin/src/feature/babystep.h index 1969e6c9c387..fbf04a03f945 100644 --- a/Marlin/src/feature/babystep.h +++ b/Marlin/src/feature/babystep.h @@ -22,7 +22,6 @@ #pragma once #include "../inc/MarlinConfigPre.h" -#include "../core/enum.h" #if IS_CORE || EITHER(BABYSTEP_XY, I2C_POSITION_ENCODERS) #define BS_TODO_AXIS(A) A @@ -30,7 +29,7 @@ #define BS_TODO_AXIS(A) 0 #endif -#if HAS_LCD_MENU && ENABLED(BABYSTEP_DISPLAY_TOTAL) +#if ENABLED(BABYSTEP_DISPLAY_TOTAL) #if ENABLED(BABYSTEP_XY) #define BS_TOTAL_AXIS(A) A #else @@ -40,19 +39,20 @@ class Babystep { public: - static volatile int16_t todo[BS_TODO_AXIS(Z_AXIS) + 1]; - #if HAS_LCD_MENU - static int16_t accum; // Total babysteps in current edit - #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; // Total babysteps since G28 - static inline void reset_total(const AxisEnum axis) { + static volatile int16_t steps[BS_TODO_AXIS(Z_AXIS) + 1]; + static int16_t accum; // Total babysteps in current edit + + #if ENABLED(BABYSTEP_DISPLAY_TOTAL) + static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; // Total babysteps since G28 + static inline void reset_total(const AxisEnum axis) { + if (true #if ENABLED(BABYSTEP_XY) - if (axis == Z_AXIS) + && axis == Z_AXIS #endif - axis_total[BS_TOTAL_AXIS(axis)] = 0; - } - #endif + ) axis_total[BS_TOTAL_AXIS(axis)] = 0; + } #endif + static void add_steps(const AxisEnum axis, const int16_t distance); static void add_mm(const AxisEnum axis, const float &mm); static void task(); diff --git a/Marlin/src/feature/backlash.cpp b/Marlin/src/feature/backlash.cpp index 8f708c14f6b2..43e6d36becd1 100644 --- a/Marlin/src/feature/backlash.cpp +++ b/Marlin/src/feature/backlash.cpp @@ -31,9 +31,9 @@ #ifdef BACKLASH_DISTANCE_MM #if ENABLED(BACKLASH_GCODE) - float Backlash::distance_mm[XYZ] = BACKLASH_DISTANCE_MM; + xyz_float_t Backlash::distance_mm = BACKLASH_DISTANCE_MM; #else - const float Backlash::distance_mm[XYZ] = BACKLASH_DISTANCE_MM; + const xyz_float_t Backlash::distance_mm = BACKLASH_DISTANCE_MM; #endif #endif @@ -45,8 +45,8 @@ #endif #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - float Backlash::measured_mm[XYZ] = { 0 }; - uint8_t Backlash::measured_count[XYZ] = { 0 }; + xyz_float_t Backlash::measured_mm{0}; + xyz_uint8_t Backlash::measured_count{0}; #endif Backlash backlash; @@ -80,12 +80,12 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const // Residual error carried forward across multiple segments, so correction can be applied // to segments where there is no direction change. - static int32_t residual_error[XYZ] = { 0 }; + static xyz_long_t residual_error{0}; #else // No direction change, no correction. if (!changed_dir) return; // No leftover residual error from segment to segment - int32_t residual_error[XYZ] = { 0 }; + xyz_long_t residual_error{0}; #endif const float f_corr = float(correction) / 255.0f; @@ -123,7 +123,7 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const } #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - #if USES_Z_MIN_PROBE_ENDSTOP + #if HAS_CUSTOM_PROBE_PIN #define TEST_PROBE_PIN (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) #else #define TEST_PROBE_PIN (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) @@ -131,15 +131,15 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const // Measure Z backlash by raising nozzle in increments until probe deactivates void Backlash::measure_with_probe() { - if (measured_count[Z_AXIS] == 255) return; + if (measured_count.z == 255) return; - float start_height = current_position[Z_AXIS]; - while (current_position[Z_AXIS] < (start_height + BACKLASH_MEASUREMENT_LIMIT) && TEST_PROBE_PIN) - do_blocking_move_to_z(current_position[Z_AXIS] + BACKLASH_MEASUREMENT_RESOLUTION, MMM_TO_MMS(BACKLASH_MEASUREMENT_FEEDRATE)); + const float start_height = current_position.z; + while (current_position.z < (start_height + BACKLASH_MEASUREMENT_LIMIT) && TEST_PROBE_PIN) + do_blocking_move_to_z(current_position.z + BACKLASH_MEASUREMENT_RESOLUTION, MMM_TO_MMS(BACKLASH_MEASUREMENT_FEEDRATE)); // The backlash from all probe points is averaged, so count the number of measurements - measured_mm[Z_AXIS] += current_position[Z_AXIS] - start_height; - measured_count[Z_AXIS]++; + measured_mm.z += current_position.z - start_height; + measured_count.z++; } #endif diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index e86955b95b54..0ded86565b51 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -28,59 +28,52 @@ constexpr uint8_t all_on = 0xFF, all_off = 0x00; class Backlash { public: - #ifdef BACKLASH_DISTANCE_MM - #if ENABLED(BACKLASH_GCODE) - static float distance_mm[XYZ]; - #else - static const float distance_mm[XYZ]; - //static constexpr float distance_mm[XYZ] = BACKLASH_DISTANCE_MM; // compiler barks at this - #endif - #endif #if ENABLED(BACKLASH_GCODE) + static xyz_float_t distance_mm; static uint8_t correction; #ifdef BACKLASH_SMOOTHING_MM static float smoothing_mm; #endif + static inline void set_correction(const float &v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; } static inline float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } #else static constexpr uint8_t correction = (BACKLASH_CORRECTION) * 0xFF; + static const xyz_float_t distance_mm; #ifdef BACKLASH_SMOOTHING_MM static constexpr float smoothing_mm = BACKLASH_SMOOTHING_MM; #endif - static inline void set_correction(float) { } - static inline float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } #endif #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) private: - static float measured_mm[XYZ]; - static uint8_t measured_count[XYZ]; + static xyz_float_t measured_mm; + static xyz_uint8_t measured_count; public: static void measure_with_probe(); #endif - static inline float get_measurement(const uint8_t e) { + static inline float get_measurement(const AxisEnum a) { // Return the measurement averaged over all readings return ( #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - measured_count[e] > 0 ? measured_mm[e] / measured_count[e] : + measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : #endif 0 ); #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(e); + UNUSED(a); #endif } - static inline bool has_measurement(const uint8_t e) { + static inline bool has_measurement(const AxisEnum a) { return (false #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - || (measured_count[e] > 0) + || (measured_count[a] > 0) #endif ); #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(e); + UNUSED(a); #endif } diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/abl.cpp index 85ec693203cd..738a9526f698 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/abl.cpp @@ -24,7 +24,6 @@ #if ENABLED(AUTO_BED_LEVELING_BILINEAR) -#include "abl.h" #include "../bedlevel.h" #include "../../../module/motion.h" @@ -36,9 +35,9 @@ #include "../../../lcd/extensible_ui/ui_api.h" #endif -int bilinear_grid_spacing[2], bilinear_start[2]; -float bilinear_grid_factor[2], - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; +xy_pos_t bilinear_grid_spacing, bilinear_start; +xy_float_t bilinear_grid_factor; +bed_mesh_t z_values; /** * Extrapolate a single point from its neighbors @@ -154,8 +153,8 @@ void print_bilinear_leveling_grid() { #define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2) #define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2) float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; - int bilinear_grid_spacing_virt[2] = { 0 }; - float bilinear_grid_factor_virt[2] = { 0 }; + xy_pos_t bilinear_grid_spacing_virt; + xy_float_t bilinear_grid_factor_virt; void print_bilinear_leveling_grid_virt() { SERIAL_ECHOLNPGM("Subdivided with CATMULL ROM Leveling Grid:"); @@ -208,7 +207,7 @@ void print_bilinear_leveling_grid() { + p[i] * (2 - 5 * sq(t) + 3 * t * sq(t)) + p[i+1] * t * (1 + 4 * t - 3 * sq(t)) - p[i+2] * sq(t) * (1 - t) - ) * 0.5; + ) * 0.5f; } static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const float &tx, const float &ty) { @@ -223,10 +222,8 @@ void print_bilinear_leveling_grid() { } void bed_level_virt_interpolate() { - bilinear_grid_spacing_virt[X_AXIS] = bilinear_grid_spacing[X_AXIS] / (BILINEAR_SUBDIVISIONS); - bilinear_grid_spacing_virt[Y_AXIS] = bilinear_grid_spacing[Y_AXIS] / (BILINEAR_SUBDIVISIONS); - bilinear_grid_factor_virt[X_AXIS] = RECIPROCAL(bilinear_grid_spacing_virt[X_AXIS]); - bilinear_grid_factor_virt[Y_AXIS] = RECIPROCAL(bilinear_grid_spacing_virt[Y_AXIS]); + bilinear_grid_spacing_virt = bilinear_grid_spacing / (BILINEAR_SUBDIVISIONS); + bilinear_grid_factor_virt = bilinear_grid_spacing_virt.reciprocal(); for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t ty = 0; ty < BILINEAR_SUBDIVISIONS; ty++) @@ -246,106 +243,101 @@ void print_bilinear_leveling_grid() { // Refresh after other values have been updated void refresh_bed_level() { - bilinear_grid_factor[X_AXIS] = RECIPROCAL(bilinear_grid_spacing[X_AXIS]); - bilinear_grid_factor[Y_AXIS] = RECIPROCAL(bilinear_grid_spacing[Y_AXIS]); + bilinear_grid_factor = bilinear_grid_spacing.reciprocal(); #if ENABLED(ABL_BILINEAR_SUBDIVISION) bed_level_virt_interpolate(); #endif } #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_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_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]) { +float bilinear_z_offset(const xy_pos_t &raw) { - static float z1, d2, z3, d4, L, D, ratio_x, ratio_y, - last_x = -999.999, last_y = -999.999; + static float z1, d2, z3, d4, L, D; + + static xy_pos_t prev { -999.999, -999.999 }, ratio; // Whole units for the grid line indices. Constrained within bounds. - static int8_t gridx, gridy, nextx, nexty, - last_gridx = -99, last_gridy = -99; + static xy_int8_t thisg, nextg, lastg { -99, -99 }; // XY relative to the probed area - const float rx = raw[X_AXIS] - bilinear_start[X_AXIS], - ry = raw[Y_AXIS] - bilinear_start[Y_AXIS]; + xy_pos_t rel = raw - bilinear_start.asFloat(); #if ENABLED(EXTRAPOLATE_BEYOND_GRID) - // Keep using the last grid box - #define FAR_EDGE_OR_BOX 2 + #define FAR_EDGE_OR_BOX 2 // Keep using the last grid box #else - // Just use the grid far edge - #define FAR_EDGE_OR_BOX 1 + #define FAR_EDGE_OR_BOX 1 // Just use the grid far edge #endif - if (last_x != rx) { - last_x = rx; - ratio_x = rx * ABL_BG_FACTOR(X_AXIS); - const float gx = constrain(FLOOR(ratio_x), 0, ABL_BG_POINTS_X - (FAR_EDGE_OR_BOX)); - ratio_x -= gx; // Subtract whole to get the ratio within the grid box + if (prev.x != rel.x) { + prev.x = rel.x; + ratio.x = rel.x * ABL_BG_FACTOR(x); + const float gx = constrain(FLOOR(ratio.x), 0, ABL_BG_POINTS_X - (FAR_EDGE_OR_BOX)); + ratio.x -= gx; // Subtract whole to get the ratio within the grid box #if DISABLED(EXTRAPOLATE_BEYOND_GRID) // Beyond the grid maintain height at grid edges - NOLESS(ratio_x, 0); // Never < 0.0. (> 1.0 is ok when nextx==gridx.) + NOLESS(ratio.x, 0); // Never <0 (>1 is ok when nextg.x==thisg.x) #endif - gridx = gx; - nextx = _MIN(gridx + 1, ABL_BG_POINTS_X - 1); + thisg.x = gx; + nextg.x = _MIN(thisg.x + 1, ABL_BG_POINTS_X - 1); } - if (last_y != ry || last_gridx != gridx) { + if (prev.y != rel.y || lastg.x != thisg.x) { - if (last_y != ry) { - last_y = ry; - ratio_y = ry * ABL_BG_FACTOR(Y_AXIS); - const float gy = constrain(FLOOR(ratio_y), 0, ABL_BG_POINTS_Y - (FAR_EDGE_OR_BOX)); - ratio_y -= gy; + if (prev.y != rel.y) { + prev.y = rel.y; + ratio.y = rel.y * ABL_BG_FACTOR(y); + const float gy = constrain(FLOOR(ratio.y), 0, ABL_BG_POINTS_Y - (FAR_EDGE_OR_BOX)); + ratio.y -= gy; #if DISABLED(EXTRAPOLATE_BEYOND_GRID) // Beyond the grid maintain height at grid edges - NOLESS(ratio_y, 0); // Never < 0.0. (> 1.0 is ok when nexty==gridy.) + NOLESS(ratio.y, 0); // Never < 0.0. (> 1.0 is ok when nextg.y==thisg.y.) #endif - gridy = gy; - nexty = _MIN(gridy + 1, ABL_BG_POINTS_Y - 1); + thisg.y = gy; + nextg.y = _MIN(thisg.y + 1, ABL_BG_POINTS_Y - 1); } - if (last_gridx != gridx || last_gridy != gridy) { - last_gridx = gridx; - last_gridy = gridy; + if (lastg != thisg) { + lastg = thisg; // Z at the box corners - z1 = ABL_BG_GRID(gridx, gridy); // left-front - d2 = ABL_BG_GRID(gridx, nexty) - z1; // left-back (delta) - z3 = ABL_BG_GRID(nextx, gridy); // right-front - d4 = ABL_BG_GRID(nextx, nexty) - z3; // right-back (delta) + z1 = ABL_BG_GRID(thisg.x, thisg.y); // left-front + d2 = ABL_BG_GRID(thisg.x, nextg.y) - z1; // left-back (delta) + z3 = ABL_BG_GRID(nextg.x, thisg.y); // right-front + d4 = ABL_BG_GRID(nextg.x, nextg.y) - z3; // right-back (delta) } - // Bilinear interpolate. Needed since ry or gridx has changed. - L = z1 + d2 * ratio_y; // Linear interp. LF -> LB - const float R = z3 + d4 * ratio_y; // Linear interp. RF -> RB + // Bilinear interpolate. Needed since rel.y or thisg.x has changed. + L = z1 + d2 * ratio.y; // Linear interp. LF -> LB + const float R = z3 + d4 * ratio.y; // Linear interp. RF -> RB D = R - L; } - const float offset = L + ratio_x * D; // the offset almost always changes + const float offset = L + ratio.x * D; // the offset almost always changes /* static float last_offset = 0; if (ABS(last_offset - offset) > 0.2) { - SERIAL_ECHOLNPAIR("Sudden Shift at x=", rx, " / ", bilinear_grid_spacing[X_AXIS], " -> gridx=", gridx); - SERIAL_ECHOLNPAIR(" y=", ry, " / ", bilinear_grid_spacing[Y_AXIS], " -> gridy=", gridy); - SERIAL_ECHOLNPAIR(" ratio_x=", ratio_x, " ratio_y=", ratio_y); + SERIAL_ECHOLNPAIR("Sudden Shift at x=", rel.x, " / ", bilinear_grid_spacing.x, " -> thisg.x=", thisg.x); + SERIAL_ECHOLNPAIR(" y=", rel.y, " / ", bilinear_grid_spacing.y, " -> thisg.y=", thisg.y); + SERIAL_ECHOLNPAIR(" ratio.x=", ratio.x, " ratio.y=", ratio.y); SERIAL_ECHOLNPAIR(" z1=", z1, " z2=", z2, " z3=", z3, " z4=", z4); SERIAL_ECHOLNPAIR(" L=", L, " R=", R, " offset=", offset); } @@ -357,71 +349,70 @@ float bilinear_z_offset(const float raw[XYZ]) { #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - #define CELL_INDEX(A,V) ((V - bilinear_start[_AXIS(A)]) * ABL_BG_FACTOR(_AXIS(A))) + #define CELL_INDEX(A,V) ((V - bilinear_start.A) * ABL_BG_FACTOR(A)) /** * Prepare a bilinear-leveled linear move on Cartesian, * splitting the move where it crosses grid borders. */ - void bilinear_line_to_destination(const float fr_mm_s, uint16_t x_splits, uint16_t y_splits) { + void bilinear_line_to_destination(const feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) { // Get current and destination cells for this line - int cx1 = CELL_INDEX(X, current_position[X_AXIS]), - cy1 = CELL_INDEX(Y, current_position[Y_AXIS]), - cx2 = CELL_INDEX(X, destination[X_AXIS]), - cy2 = CELL_INDEX(Y, destination[Y_AXIS]); - cx1 = constrain(cx1, 0, ABL_BG_POINTS_X - 2); - cy1 = constrain(cy1, 0, ABL_BG_POINTS_Y - 2); - cx2 = constrain(cx2, 0, ABL_BG_POINTS_X - 2); - cy2 = constrain(cy2, 0, ABL_BG_POINTS_Y - 2); + xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) }, + c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) }; + LIMIT(c1.x, 0, ABL_BG_POINTS_X - 2); + LIMIT(c1.y, 0, ABL_BG_POINTS_Y - 2); + LIMIT(c2.x, 0, ABL_BG_POINTS_X - 2); + LIMIT(c2.y, 0, ABL_BG_POINTS_Y - 2); // Start and end in the same cell? No split needed. - if (cx1 == cx2 && cy1 == cy2) { - buffer_line_to_destination(fr_mm_s); - set_current_from_destination(); + if (c1 == c2) { + current_position = destination; + line_to_current_position(scaled_fr_mm_s); return; } - #define LINE_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist) + #define LINE_SEGMENT_END(A) (current_position.A + (destination.A - current_position.A) * normalized_dist) - float normalized_dist, end[XYZE]; - const int8_t gcx = _MAX(cx1, cx2), gcy = _MAX(cy1, cy2); + float normalized_dist; + xyze_pos_t end; + const xy_int8_t gc { _MAX(c1.x, c2.x), _MAX(c1.y, c2.y) }; // Crosses on the X and not already split on this X? // The x_splits flags are insurance against rounding errors. - if (cx2 != cx1 && TEST(x_splits, gcx)) { + if (c2.x != c1.x && TEST(x_splits, gc.x)) { // Split on the X grid line - CBI(x_splits, gcx); - COPY(end, destination); - destination[X_AXIS] = bilinear_start[X_AXIS] + ABL_BG_SPACING(X_AXIS) * gcx; - normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); - destination[Y_AXIS] = LINE_SEGMENT_END(Y); + CBI(x_splits, gc.x); + end = destination; + destination.x = bilinear_start.x + ABL_BG_SPACING(x) * gc.x; + normalized_dist = (destination.x - current_position.x) / (end.x - current_position.x); + destination.y = LINE_SEGMENT_END(y); } // Crosses on the Y and not already split on this Y? - else if (cy2 != cy1 && TEST(y_splits, gcy)) { + else if (c2.y != c1.y && TEST(y_splits, gc.y)) { // Split on the Y grid line - CBI(y_splits, gcy); - COPY(end, destination); - destination[Y_AXIS] = bilinear_start[Y_AXIS] + ABL_BG_SPACING(Y_AXIS) * gcy; - normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); - destination[X_AXIS] = LINE_SEGMENT_END(X); + CBI(y_splits, gc.y); + end = destination; + destination.y = bilinear_start.y + ABL_BG_SPACING(y) * gc.y; + normalized_dist = (destination.y - current_position.y) / (end.y - current_position.y); + destination.x = LINE_SEGMENT_END(x); } else { // Must already have been split on these border(s) // This should be a rare case. - buffer_line_to_destination(fr_mm_s); - set_current_from_destination(); + current_position = destination; + line_to_current_position(scaled_fr_mm_s); return; } - destination[Z_AXIS] = LINE_SEGMENT_END(Z); - destination[E_AXIS] = LINE_SEGMENT_END(E); + destination.z = LINE_SEGMENT_END(z); + destination.e = LINE_SEGMENT_END(e); // Do the split and look for more borders - bilinear_line_to_destination(fr_mm_s, x_splits, y_splits); + bilinear_line_to_destination(scaled_fr_mm_s, x_splits, y_splits); // Restore destination from stack - COPY(destination, end); - bilinear_line_to_destination(fr_mm_s, x_splits, y_splits); + destination = end; + bilinear_line_to_destination(scaled_fr_mm_s, x_splits, y_splits); } #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES diff --git a/Marlin/src/feature/bedlevel/abl/abl.h b/Marlin/src/feature/bedlevel/abl/abl.h index 2ba834480f56..15e988fe0a76 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.h +++ b/Marlin/src/feature/bedlevel/abl/abl.h @@ -23,10 +23,10 @@ #include "../../../inc/MarlinConfigPre.h" -extern int bilinear_grid_spacing[2], bilinear_start[2]; -extern float bilinear_grid_factor[2], - z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; -float bilinear_z_offset(const float raw[XYZ]); +extern xy_pos_t bilinear_grid_spacing, bilinear_start; +extern xy_float_t bilinear_grid_factor; +extern bed_mesh_t z_values; +float bilinear_z_offset(const xy_pos_t &raw); void extrapolate_unprobed_bed_level(); void print_bilinear_leveling_grid(); @@ -37,9 +37,9 @@ void refresh_bed_level(); #endif #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - void bilinear_line_to_destination(const float fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF); + void bilinear_line_to_destination(const feedRate_t &scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF); #endif -#define _GET_MESH_X(I) (bilinear_start[X_AXIS] + (I) * bilinear_grid_spacing[X_AXIS]) -#define _GET_MESH_Y(J) (bilinear_start[Y_AXIS] + (J) * bilinear_grid_spacing[Y_AXIS]) +#define _GET_MESH_X(I) float(bilinear_start.x + (I) * bilinear_grid_spacing.x) +#define _GET_MESH_Y(J) float(bilinear_start.y + (J) * bilinear_grid_spacing.y) #define Z_VALUES_ARR z_values diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 1ce89d1e056e..ef8cfd345536 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -51,7 +51,7 @@ bool leveling_is_valid() { #if ENABLED(MESH_BED_LEVELING) mbl.has_mesh() #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - !!bilinear_grid_spacing[X_AXIS] + !!bilinear_grid_spacing.x #elif ENABLED(AUTO_BED_LEVELING_UBL) ubl.mesh_is_valid() #else // 3POINT, LINEAR @@ -81,13 +81,13 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) // Force bilinear_z_offset to re-calculate next time - const float reset[XYZ] = { -9999.999, -9999.999, 0 }; + const xyz_pos_t reset { -9999.999, -9999.999, 0 }; (void)bilinear_z_offset(reset); #endif if (planner.leveling_active) { // leveling from on to off // change unleveled current_position to physical current_position without moving steppers. - planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); + planner.apply_leveling(current_position); planner.leveling_active = false; // disable only AFTER calling apply_leveling } else { // leveling from off to on @@ -100,6 +100,10 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { } } +TemporaryBedLevelingState::TemporaryBedLevelingState(const bool enable) : saved(planner.leveling_active) { + set_bed_leveling_enabled(enable); +} + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) void set_z_fade_height(const float zfh, const bool do_report/*=true*/) { @@ -112,9 +116,9 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { planner.set_z_fade_height(zfh); if (leveling_was_active) { - const float oldpos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; + const xyz_pos_t oldpos = current_position; set_bed_leveling_enabled(true); - if (do_report && memcmp(oldpos, current_position, sizeof(oldpos))) + if (do_report && oldpos != current_position) report_current_position(); } } @@ -126,23 +130,25 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { */ void reset_bed_level() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("reset_bed_level"); - set_bed_leveling_enabled(false); - #if ENABLED(MESH_BED_LEVELING) - mbl.reset(); - #elif ENABLED(AUTO_BED_LEVELING_UBL) + #if ENABLED(AUTO_BED_LEVELING_UBL) ubl.reset(); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] = - bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { - z_values[x][y] = NAN; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, 0); - #endif - } - #elif ABL_PLANAR - planner.bed_level_matrix.set_to_identity(); + #else + set_bed_leveling_enabled(false); + #if ENABLED(MESH_BED_LEVELING) + mbl.reset(); + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + bilinear_start.reset(); + bilinear_grid_spacing.reset(); + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { + z_values[x][y] = NAN; + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onMeshUpdate(x, y, 0); + #endif + } + #elif ABL_PLANAR + planner.bed_level_matrix.set_to_identity(); + #endif #endif } @@ -217,25 +223,25 @@ void reset_bed_level() { #if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY) - void _manual_goto_xy(const float &rx, const float &ry) { + void _manual_goto_xy(const xy_pos_t &pos) { #ifdef MANUAL_PROBE_START_Z + constexpr float startz = _MAX(0, 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)); + do_blocking_move_to_xy_z(pos, MANUAL_PROBE_HEIGHT); + do_blocking_move_to_z(startz); #else - do_blocking_move_to(rx, ry, _MAX(0,MANUAL_PROBE_START_Z)); + do_blocking_move_to_xy_z(pos, startz); #endif #elif MANUAL_PROBE_HEIGHT > 0 - const float prev_z = current_position[Z_AXIS]; - do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT); + const float prev_z = current_position.z; + do_blocking_move_to_xy_z(pos, MANUAL_PROBE_HEIGHT); do_blocking_move_to_z(prev_z); #else - do_blocking_move_to_xy(rx, ry); + do_blocking_move_to_xy(pos); #endif - current_position[X_AXIS] = rx; - current_position[Y_AXIS] = ry; + current_position = pos; #if ENABLED(LCD_BED_LEVELING) ui.wait_for_bl_move = false; diff --git a/Marlin/src/feature/bedlevel/bedlevel.h b/Marlin/src/feature/bedlevel/bedlevel.h index 82957c488459..6ba09488801c 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.h +++ b/Marlin/src/feature/bedlevel/bedlevel.h @@ -23,11 +23,6 @@ #include "../../inc/MarlinConfigPre.h" -typedef struct { - int8_t x_index, y_index; - float distance; // When populated, the distance from the search location -} mesh_index_pair; - #if ENABLED(PROBE_MANUALLY) extern bool g29_in_progress; #else @@ -43,12 +38,24 @@ void reset_bed_level(); #endif #if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY) - void _manual_goto_xy(const float &x, const float &y); + void _manual_goto_xy(const xy_pos_t &pos); #endif +/** + * A class to save and change the bed leveling state, + * then restore it when it goes out of scope. + */ +class TemporaryBedLevelingState { + bool saved; + public: + TemporaryBedLevelingState(const bool enable); + ~TemporaryBedLevelingState() { set_bed_leveling_enabled(saved); } +}; +#define TEMPORARY_BED_LEVELING_STATE(enable) const TemporaryBedLevelingState tbls(enable) + #if HAS_MESH - typedef float (&bed_mesh_t)[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; #if ENABLED(AUTO_BED_LEVELING_BILINEAR) #include "abl/abl.h" @@ -59,6 +66,7 @@ void reset_bed_level(); #endif #define Z_VALUES(X,Y) Z_VALUES_ARR[X][Y] + #define _GET_MESH_POS(M) { _GET_MESH_X(M.a), _GET_MESH_Y(M.b) } #if EITHER(AUTO_BED_LEVELING_BILINEAR, MESH_BED_LEVELING) @@ -73,4 +81,18 @@ void reset_bed_level(); #endif + struct mesh_index_pair { + xy_int8_t pos; + float distance; // When populated, the distance from the search location + void invalidate() { pos = -1; } + bool valid() const { return pos.x >= 0 && pos.y >= 0; } + #if ENABLED(AUTO_BED_LEVELING_UBL) + xy_pos_t meshpos() { + return { ubl.mesh_index_to_xpos(pos.x), ubl.mesh_index_to_ypos(pos.y) }; + } + #endif + operator xy_int8_t&() { return pos; } + operator const xy_int8_t&() const { return pos; } + }; + #endif diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp index f929f048b1a7..af9c671d6a2d 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp @@ -24,10 +24,13 @@ #if ENABLED(MESH_BED_LEVELING) - #include "mesh_bed_leveling.h" + #include "../bedlevel.h" #include "../../../module/motion.h" - #include "../../../feature/bedlevel/bedlevel.h" + + #if ENABLED(EXTENSIBLE_UI) + #include "../../../lcd/extensible_ui/ui_api.h" + #endif mesh_bed_leveling mbl; @@ -60,65 +63,63 @@ * Prepare a mesh-leveled linear move in a Cartesian setup, * splitting the move where it crosses mesh borders. */ - void mesh_bed_leveling::line_to_destination(const float fr_mm_s, uint8_t x_splits, uint8_t y_splits) { + void mesh_bed_leveling::line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) { // Get current and destination cells for this line - int cx1 = cell_index_x(current_position[X_AXIS]), - cy1 = cell_index_y(current_position[Y_AXIS]), - cx2 = cell_index_x(destination[X_AXIS]), - cy2 = cell_index_y(destination[Y_AXIS]); - NOMORE(cx1, GRID_MAX_POINTS_X - 2); - NOMORE(cy1, GRID_MAX_POINTS_Y - 2); - NOMORE(cx2, GRID_MAX_POINTS_X - 2); - NOMORE(cy2, GRID_MAX_POINTS_Y - 2); + xy_int8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination); + NOMORE(scel.x, GRID_MAX_POINTS_X - 2); + NOMORE(scel.y, GRID_MAX_POINTS_Y - 2); + NOMORE(ecel.x, GRID_MAX_POINTS_X - 2); + NOMORE(ecel.y, GRID_MAX_POINTS_Y - 2); // Start and end in the same cell? No split needed. - if (cx1 == cx2 && cy1 == cy2) { - line_to_destination(fr_mm_s); - set_current_from_destination(); + if (scel == ecel) { + line_to_destination(scaled_fr_mm_s); + current_position = destination; return; } - #define MBL_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist) + #define MBL_SEGMENT_END(A) (current_position.A + (destination.A - current_position.A) * normalized_dist) - float normalized_dist, end[XYZE]; - const int8_t gcx = _MAX(cx1, cx2), gcy = _MAX(cy1, cy2); + float normalized_dist; + xyze_pos_t dest; + const int8_t gcx = _MAX(scel.x, ecel.x), gcy = _MAX(scel.y, ecel.y); // Crosses on the X and not already split on this X? // The x_splits flags are insurance against rounding errors. - if (cx2 != cx1 && TEST(x_splits, gcx)) { + if (ecel.x != scel.x && TEST(x_splits, gcx)) { // Split on the X grid line CBI(x_splits, gcx); - COPY(end, destination); - destination[X_AXIS] = index_to_xpos[gcx]; - normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); - destination[Y_AXIS] = MBL_SEGMENT_END(Y); + dest = destination; + destination.x = index_to_xpos[gcx]; + normalized_dist = (destination.x - current_position.x) / (dest.x - current_position.x); + destination.y = MBL_SEGMENT_END(y); } // Crosses on the Y and not already split on this Y? - else if (cy2 != cy1 && TEST(y_splits, gcy)) { + else if (ecel.y != scel.y && TEST(y_splits, gcy)) { // Split on the Y grid line CBI(y_splits, gcy); - COPY(end, destination); - destination[Y_AXIS] = index_to_ypos[gcy]; - normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); - destination[X_AXIS] = MBL_SEGMENT_END(X); + dest = destination; + destination.y = index_to_ypos[gcy]; + normalized_dist = (destination.y - current_position.y) / (dest.y - current_position.y); + destination.x = MBL_SEGMENT_END(x); } else { // Must already have been split on these border(s) // This should be a rare case. - line_to_destination(fr_mm_s); - set_current_from_destination(); + line_to_destination(scaled_fr_mm_s); + current_position = destination; return; } - destination[Z_AXIS] = MBL_SEGMENT_END(Z); - destination[E_AXIS] = MBL_SEGMENT_END(E); + destination.z = MBL_SEGMENT_END(z); + destination.e = MBL_SEGMENT_END(e); // Do the split and look for more borders - line_to_destination(fr_mm_s, x_splits, y_splits); + line_to_destination(scaled_fr_mm_s, x_splits, y_splits); // Restore destination from stack - COPY(destination, end); - line_to_destination(fr_mm_s, x_splits, y_splits); + destination = dest; + line_to_destination(scaled_fr_mm_s, x_splits, y_splits); } #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h index e39bd0e789cc..3009f4aea4c3 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h @@ -32,8 +32,8 @@ enum MeshLevelingState : char { MeshReset // G29 S5 }; -#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 (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)) #define _GET_MESH_X(I) mbl.index_to_xpos[I] #define _GET_MESH_Y(J) mbl.index_to_ypos[J] #define Z_VALUES_ARR mbl.z_values @@ -73,24 +73,30 @@ class mesh_bed_leveling { } static int8_t cell_index_x(const float &x) { - int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); + int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST); return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2); } - static int8_t cell_index_y(const float &y) { - int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); + int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2); } + static inline xy_int8_t cell_indexes(const float &x, const float &y) { + return { cell_index_x(x), cell_index_y(y) }; + } + static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } 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)); + int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * RECIPROCAL(MESH_X_DIST); return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } - 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)); + int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } + static inline xy_int8_t probe_indexes(const float &x, const float &y) { + return { probe_index_x(x), probe_index_y(y) }; + } + static inline xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); } 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), @@ -98,25 +104,25 @@ class mesh_bed_leveling { return z1 + delta_a * delta_z; } - static float get_z(const float &x0, const float &y0 + static float get_z(const xy_pos_t &pos #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , const float &factor + , const float &factor=1.0f #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 - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - * factor - #endif - ; + #if DISABLED(ENABLE_LEVELING_FADE_HEIGHT) + constexpr float factor = 1.0f; + #endif + const xy_int8_t ind = cell_indexes(pos); + const float x1 = index_to_xpos[ind.x], x2 = index_to_xpos[ind.x+1], + y1 = index_to_xpos[ind.y], y2 = index_to_xpos[ind.y+1], + z1 = calc_z0(pos.x, x1, z_values[ind.x][ind.y ], x2, z_values[ind.x+1][ind.y ]), + z2 = calc_z0(pos.x, x1, z_values[ind.x][ind.y+1], x2, z_values[ind.x+1][ind.y+1]); + + return z_offset + calc_z0(pos.y, y1, z1, y2, z2) * factor; } #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - static void line_to_destination(const float fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF); + static void line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF); #endif }; diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index 1b7bebfa61d8..66eff703c358 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -24,13 +24,14 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" + #include "../bedlevel.h" + unified_bed_leveling ubl; #include "../../../module/configuration_store.h" #include "../../../module/planner.h" #include "../../../module/motion.h" - #include "../../bedlevel/bedlevel.h" + #include "../../../module/probe.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extensible_ui/ui_api.h" @@ -49,16 +50,15 @@ 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, " J", y); - SERIAL_ECHOPAIR_F(" Z", z_values[x][y], 2); - SERIAL_EOL(); + SERIAL_ECHOPAIR(" M421 I", int(x), " J", int(y)); + SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z_values[x][y], 4); serial_delay(75); // Prevent Printrun from exploding } } void unified_bed_leveling::report_state() { echo_name(); - serial_ternary(planner.leveling_active, PSTR(" System v" UBL_VERSION " "), PSTR(""), PSTR("in"), PSTR("active\n")); + SERIAL_ECHO_TERNARY(planner.leveling_active, " System v" UBL_VERSION " ", "", "in", "active\n"); serial_delay(50); } @@ -66,10 +66,21 @@ float unified_bed_leveling::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 - constexpr float unified_bed_leveling::_mesh_index_to_xpos[16], - unified_bed_leveling::_mesh_index_to_ypos[16]; + #define _GRIDPOS(A,N) (MESH_MIN_##A + N * (MESH_##A##_DIST)) + + const float + unified_bed_leveling::_mesh_index_to_xpos[GRID_MAX_POINTS_X] PROGMEM = ARRAY_N(GRID_MAX_POINTS_X, + _GRIDPOS(X, 0), _GRIDPOS(X, 1), _GRIDPOS(X, 2), _GRIDPOS(X, 3), + _GRIDPOS(X, 4), _GRIDPOS(X, 5), _GRIDPOS(X, 6), _GRIDPOS(X, 7), + _GRIDPOS(X, 8), _GRIDPOS(X, 9), _GRIDPOS(X, 10), _GRIDPOS(X, 11), + _GRIDPOS(X, 12), _GRIDPOS(X, 13), _GRIDPOS(X, 14), _GRIDPOS(X, 15) + ), + unified_bed_leveling::_mesh_index_to_ypos[GRID_MAX_POINTS_Y] PROGMEM = ARRAY_N(GRID_MAX_POINTS_Y, + _GRIDPOS(Y, 0), _GRIDPOS(Y, 1), _GRIDPOS(Y, 2), _GRIDPOS(Y, 3), + _GRIDPOS(Y, 4), _GRIDPOS(Y, 5), _GRIDPOS(Y, 6), _GRIDPOS(Y, 7), + _GRIDPOS(Y, 8), _GRIDPOS(Y, 9), _GRIDPOS(Y, 10), _GRIDPOS(Y, 11), + _GRIDPOS(Y, 12), _GRIDPOS(Y, 13), _GRIDPOS(Y, 14), _GRIDPOS(Y, 15) + ); #if HAS_LCD_MENU bool unified_bed_leveling::lcd_map_control = false; @@ -85,9 +96,6 @@ const bool was_enabled = planner.leveling_active; set_bed_leveling_enabled(false); storage_slot = -1; - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - planner.set_z_fade_height(10.0); - #endif ZERO(z_values); #if ENABLED(EXTENSIBLE_UI) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) @@ -165,11 +173,10 @@ serialprintPGM(csv ? PSTR("CSV:\n") : PSTR("LCD:\n")); } - // Add XY_PROBE_OFFSET_FROM_EXTRUDER because probe_pt() subtracts these when - // moving to the xy position to be measured. This ensures better agreement between + // Add XY probe offset from extruder because probe_at_point() subtracts them when + // moving to the XY position to be measured. This ensures better agreement between // the current Z position after G28 and the mesh values. - const float current_xi = find_closest_x_index(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER), - current_yi = find_closest_y_index(current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER); + const xy_int8_t curr = closest_indexes(xy_pos_t(current_position) + xy_pos_t(probe_offset)); if (!lcd) SERIAL_EOL(); for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) { @@ -185,7 +192,7 @@ 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; + const bool is_current = i == curr.x && j == curr.y; if (human) SERIAL_CHAR(is_current ? '[' : ' '); // Z Value at current I, J diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 20ff9b077911..2202bb6524a1 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -23,11 +23,7 @@ //#define UBL_DEVEL_DEBUGGING -#include "../bedlevel.h" -#include "../../../module/planner.h" #include "../../../module/motion.h" -#include "../../../lcd/ultralcd.h" -#include "../../../Marlin.h" #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" @@ -36,15 +32,12 @@ #define UBL_OK false #define UBL_ERR true -#define USE_NOZZLE_AS_REFERENCE 0 -#define USE_PROBE_AS_REFERENCE 1 - -// ubl_G29.cpp - enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP }; // External references +struct mesh_index_pair; + #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)) @@ -56,10 +49,11 @@ class unified_bed_leveling { 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, + static bool g29_c_flag; + static float g29_card_thickness, g29_constant; + static xy_pos_t g29_pos; + static xy_bool_t xy_seen; #if HAS_BED_PROBE static int g29_grid_size; @@ -69,16 +63,19 @@ class unified_bed_leveling { 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; + static void manually_probe_remaining_mesh(const xy_pos_t&, const float&, const float&, const bool) _O0; + static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) _O0; #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, const bool do_furthest) _O0; + static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const 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 bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); + static inline bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) { + return smart_fill_one(pos.x, pos.y, dir.x, dir.y); + } static void smart_fill_mesh(); #if ENABLED(UBL_DEVEL_DEBUGGING) @@ -95,7 +92,7 @@ class unified_bed_leveling { 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_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) _O0; static mesh_index_pair find_furthest_invalid_mesh_point() _O0; static void reset(); static void invalidate(); @@ -108,31 +105,9 @@ class unified_bed_leveling { static int8_t storage_slot; - 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) - }; - - 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) - }; + static bed_mesh_t z_values; + static const float _mesh_index_to_xpos[GRID_MAX_POINTS_X], + _mesh_index_to_ypos[GRID_MAX_POINTS_Y]; #if HAS_LCD_MENU static bool lcd_map_control; @@ -144,30 +119,37 @@ class 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; } - static int8_t get_cell_index_x(const float &x) { - const int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); + static int8_t cell_index_x(const float &x) { + const int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(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)); + static int8_t cell_index_y(const float &y) { + const int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(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.5) * (1.0f / (MESH_X_DIST)); - return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; + static inline xy_int8_t cell_indexes(const float &x, const float &y) { + return { cell_index_x(x), cell_index_y(y) }; } + static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } - static int8_t find_closest_y_index(const float &y) { - const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0f / (MESH_Y_DIST)); + static int8_t closest_x_index(const float &x) { + const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * RECIPROCAL(MESH_X_DIST); + return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; + } + static int8_t closest_y_index(const float &y) { + const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } + static inline xy_int8_t closest_indexes(const xy_pos_t &xy) { + return { closest_x_index(xy.x), closest_y_index(xy.y) }; + } /** * z2 --| @@ -210,7 +192,7 @@ class unified_bed_leveling { ); } - const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0f / (MESH_X_DIST)), + const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * RECIPROCAL(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 @@ -239,7 +221,7 @@ class unified_bed_leveling { ); } - const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0f / (MESH_Y_DIST)), + const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * RECIPROCAL(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 @@ -254,8 +236,7 @@ class unified_bed_leveling { * 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 int8_t cx = cell_index_x(rx0), cy = cell_index_y(ry0); // return values are clamped /** * Check if the requested location is off the mesh. If so, and @@ -301,19 +282,19 @@ class unified_bed_leveling { } return z0; } + static inline float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); } static inline 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); } - static inline 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); + static bool line_to_destination_segmented(const feedRate_t &scaled_fr_mm_s); #else - static void line_to_destination_cartesian(const float &fr, const uint8_t e); + static void line_to_destination_cartesian(const feedRate_t &scaled_fr_mm_s, const uint8_t e); #endif static inline bool mesh_is_valid() { diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index c5b450019602..8b2e046e4564 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -24,7 +24,7 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" + #include "../bedlevel.h" #include "../../../Marlin.h" #include "../../../HAL/shared/persistent_store_api.h" @@ -33,11 +33,9 @@ #include "../../../lcd/ultralcd.h" #include "../../../module/stepper.h" #include "../../../module/planner.h" + #include "../../../module/motion.h" #include "../../../module/probe.h" #include "../../../gcode/gcode.h" - #include "../../../core/serial.h" - #include "../../../gcode/parser.h" - #include "../../../feature/bedlevel/bedlevel.h" #include "../../../libs/least_squares_fit.h" #if ENABLED(DUAL_X_CARRIAGE) @@ -55,8 +53,6 @@ #define UBL_G29_P31 - extern float destination[XYZE], current_position[XYZE]; - #if HAS_LCD_MENU void _lcd_ubl_output_map_lcd(); #endif @@ -69,13 +65,11 @@ unified_bed_leveling::g29_repetition_cnt, unified_bed_leveling::g29_storage_slot = 0, unified_bed_leveling::g29_map_type; - bool unified_bed_leveling::g29_c_flag, - unified_bed_leveling::g29_x_flag, - 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, + bool unified_bed_leveling::g29_c_flag; + float unified_bed_leveling::g29_card_thickness = 0, unified_bed_leveling::g29_constant = 0; + xy_bool_t unified_bed_leveling::xy_seen; + xy_pos_t unified_bed_leveling::g29_pos; #if HAS_BED_PROBE int unified_bed_leveling::g29_grid_size; @@ -292,7 +286,7 @@ * 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 + * or probe offsets are incorrect. Mesh-generation gathers points starting closest to the nozzle unless * an (X,Y) coordinate pair is given. * * Unified Bed Leveling uses a lot of EEPROM storage to hold its data, and it takes some effort to get @@ -315,7 +309,7 @@ // Check for commands that require the printer to be homed if (may_move) { planner.synchronize(); - if (axis_unhomed_error()) gcode.home_all_axes(); + if (axes_need_homing()) gcode.home_all_axes(); #if ENABLED(DUAL_X_CARRIAGE) if (active_extruder != 0) tool_change(0); #endif @@ -332,18 +326,19 @@ else { while (g29_repetition_cnt--) { if (cnt > 20) { cnt = 0; idle(); } - const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, nullptr); - if (location.x_index < 0) { - // No more REACHABLE mesh points to invalidate, so we ASSUME the user + const mesh_index_pair closest = find_closest_mesh_point_of_type(REAL, g29_pos); + const xy_int8_t &cpos = closest.pos; + if (cpos.x < 0) { + // No more REAL mesh points to invalidate, so we ASSUME the user // meant to invalidate the ENTIRE mesh, which cannot be done with - // find_closest_mesh_point loop which only returns REACHABLE points. + // find_closest_mesh_point loop which only returns REAL points. set_all_mesh_points_to_value(NAN); SERIAL_ECHOLNPGM("Entire Mesh invalidated.\n"); break; // No more invalid Mesh Points to populate } - z_values[location.x_index][location.y_index] = NAN; + z_values[cpos.x][cpos.y] = NAN; #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(location.x_index, location.y_index, 0); + ExtUI::onMeshUpdate(cpos, 0.0f); #endif cnt++; } @@ -441,7 +436,7 @@ #if HAS_BED_PROBE - case 1: + case 1: { // // Invalidate Entire Mesh and Automatically Probe Mesh in areas that can be reached by the probe // @@ -450,17 +445,17 @@ SERIAL_ECHOLNPGM("Mesh invalidated. Probing mesh."); } if (g29_verbose_level > 1) { - SERIAL_ECHOPAIR("Probing around (", g29_x_pos); + SERIAL_ECHOPAIR("Probing around (", g29_pos.x); SERIAL_CHAR(','); - SERIAL_ECHO(g29_y_pos); + SERIAL_ECHO(g29_pos.y); SERIAL_ECHOLNPGM(").\n"); } - 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')); + const xy_pos_t near = g29_pos + probe_offset; + probe_entire_mesh(near, parser.seen('T'), parser.seen('E'), parser.seen('U')); report_current_position(); probe_deployed = true; - break; + } break; #endif // HAS_BED_PROBE @@ -472,7 +467,7 @@ SERIAL_ECHOLNPGM("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 (parser.seen('C') && !xy_seen) { /** * Use a good default location for the path. * The flipped > and < operators in these comparisons is intentional. @@ -480,13 +475,14 @@ * It may make sense to have Delta printers default to the center of the bed. * Until that is decided, this can be forced with the X and Y parameters. */ - #if IS_KINEMATIC - g29_x_pos = X_HOME_POS; - g29_y_pos = Y_HOME_POS; - #else // cartesian - g29_x_pos = X_PROBE_OFFSET_FROM_EXTRUDER > 0 ? X_BED_SIZE : 0; - g29_y_pos = Y_PROBE_OFFSET_FROM_EXTRUDER < 0 ? Y_BED_SIZE : 0; - #endif + g29_pos.set( + #if IS_KINEMATIC + X_HOME_POS, Y_HOME_POS + #else + probe_offset.x > 0 ? X_BED_SIZE : 0, + probe_offset.y < 0 ? Y_BED_SIZE : 0 + #endif + ); } if (parser.seen('B')) { @@ -498,13 +494,13 @@ probe_deployed = true; } - if (!position_is_reachable(g29_x_pos, g29_y_pos)) { + if (!position_is_reachable(g29_pos)) { SERIAL_ECHOLNPGM("XY outside printable radius."); return; } const float height = parser.floatval('H', Z_CLEARANCE_BETWEEN_PROBES); - manually_probe_remaining_mesh(g29_x_pos, g29_y_pos, height, g29_card_thickness, parser.seen('T')); + manually_probe_remaining_mesh(g29_pos, height, g29_card_thickness, parser.seen('T')); SERIAL_ECHOLNPGM("G29 P2 finished."); @@ -532,20 +528,22 @@ } else { while (g29_repetition_cnt--) { // this only populates reachable mesh points near - const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, nullptr); - if (location.x_index < 0) { - // No more REACHABLE INVALID mesh points to populate, so we ASSUME + const mesh_index_pair closest = find_closest_mesh_point_of_type(INVALID, g29_pos); + const xy_int8_t &cpos = closest.pos; + if (cpos.x < 0) { + // No more REAL INVALID mesh points to populate, so we ASSUME // user meant to populate ALL INVALID mesh points to value 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] = g29_constant; + if (isnan(z_values[x][y])) z_values[x][y] = g29_constant; break; // No more invalid Mesh Points to populate } - z_values[location.x_index][location.y_index] = g29_constant; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(location.x_index, location.y_index, z_values[location.x_index][location.y_index]); - #endif + else { + z_values[cpos.x][cpos.y] = g29_constant; + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onMeshUpdate(cpos, g29_constant); + #endif + } } } } @@ -578,7 +576,7 @@ case 4: // Fine Tune (i.e., Edit) the Mesh #if HAS_LCD_MENU - fine_tune_mesh(g29_x_pos, g29_y_pos, parser.seen('T')); + fine_tune_mesh(g29_pos, parser.seen('T')); #else SERIAL_ECHOLNPGM("?P4 is only available when an LCD is present."); return; @@ -742,57 +740,63 @@ * 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) { - mesh_index_pair location; + void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { + DEPLOY_PROBE(); // Deploy before ui.capture() to allow for PAUSE_BEFORE_DEPLOY_STOW #if HAS_LCD_MENU ui.capture(); #endif save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained - DEPLOY_PROBE(); - - uint16_t count = GRID_MAX_POINTS, current = 1; + uint8_t count = GRID_MAX_POINTS; + mesh_index_pair best; do { - current = (GRID_MAX_POINTS) - count + 1; - if (do_ubl_mesh_map) display_map(g29_map_type); - SERIAL_ECHOLNPAIR("\nProbing mesh point ", current, "/", GRID_MAX_POINTS, ".\n"); - #if HAS_LCD_MENU - ui.status_printf_P(0, PSTR(MSG_LCD_PROBING_MESH " %i/%i"), current, int(GRID_MAX_POINTS)); + const int point_num = (GRID_MAX_POINTS) - count + 1; + SERIAL_ECHOLNPAIR("\nProbing mesh point ", point_num, "/", int(GRID_MAX_POINTS), ".\n"); + #if HAS_DISPLAY + ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), point_num, int(GRID_MAX_POINTS)); + #endif + #if HAS_LCD_MENU if (ui.button_pressed()) { ui.quick_feedback(false); // Preserve button state for click-and-hold SERIAL_ECHOLNPGM("\nMesh only partially populated.\n"); - STOW_PROBE(); ui.wait_for_release(); ui.quick_feedback(); ui.release(); + STOW_PROBE(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW return restore_ubl_active_state_and_leave(); } #endif - if (do_furthest) - location = find_furthest_invalid_mesh_point(); - else - location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_PROBE_AS_REFERENCE, nullptr); + best = do_furthest + ? find_furthest_invalid_mesh_point() + : find_closest_mesh_point_of_type(INVALID, near, true); - if (location.x_index >= 0) { // mesh point found and is reachable by probe - const float rawx = mesh_index_to_xpos(location.x_index), - rawy = mesh_index_to_ypos(location.y_index), - measured_z = probe_pt(rawx, rawy, stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling - z_values[location.x_index][location.y_index] = measured_z; + if (best.pos.x >= 0) { // mesh point found and is reachable by probe + const float measured_z = probe_at_point( + best.meshpos(), + stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level + ); + z_values[best.pos.x][best.pos.y] = measured_z; #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(location.x_index, location.y_index, measured_z); + ExtUI::onMeshUpdate(best.pos, measured_z); #endif } SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (location.x_index >= 0 && --count); + } while (best.pos.x >= 0 && --count); - STOW_PROBE(); + #if HAS_LCD_MENU + ui.release(); + #endif + STOW_PROBE(); // Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW + #if HAS_LCD_MENU + ui.capture(); + #endif #ifdef Z_AFTER_PROBING move_z_after_probing(); @@ -801,8 +805,8 @@ restore_ubl_active_state_and_leave(); do_blocking_move_to_xy( - constrain(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), MESH_MIN_X, MESH_MAX_X), - constrain(ry - (Y_PROBE_OFFSET_FROM_EXTRUDER), MESH_MIN_Y, MESH_MAX_Y) + constrain(near.x - probe_offset.x, MESH_MIN_X, MESH_MAX_X), + constrain(near.y - probe_offset.y, MESH_MIN_Y, MESH_MAX_Y) ); } @@ -836,7 +840,7 @@ idle(); gcode.reset_stepper_timeout(); // Keep steppers powered if (encoder_diff) { - do_blocking_move_to_z(current_position[Z_AXIS] + float(encoder_diff) * multiplier); + do_blocking_move_to_z(current_position.z + float(encoder_diff) * multiplier); encoder_diff = 0; } } @@ -845,13 +849,15 @@ float unified_bed_leveling::measure_point_with_encoder() { KEEPALIVE_STATE(PAUSED_FOR_USER); move_z_with_encoder(0.01f); - return current_position[Z_AXIS]; + return current_position.z; } static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); } float unified_bed_leveling::measure_business_card_thickness(float in_height) { - ui.capture(); + #if HAS_LCD_MENU + ui.capture(); + #endif 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); @@ -864,7 +870,7 @@ echo_and_take_a_measurement(); const float z1 = measure_point_with_encoder(); - do_blocking_move_to_z(current_position[Z_AXIS] + SIZE_OF_LITTLE_RAISE); + do_blocking_move_to_z(current_position.z + SIZE_OF_LITTLE_RAISE); planner.synchronize(); SERIAL_ECHOPGM("Remove shim"); @@ -873,7 +879,7 @@ const float z2 = measure_point_with_encoder(); - do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES); + do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES); const float thickness = ABS(z1 - z2); @@ -889,37 +895,44 @@ return thickness; } - void unified_bed_leveling::manually_probe_remaining_mesh(const float &rx, const float &ry, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) { - - ui.capture(); + void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) { + #if HAS_LCD_MENU + ui.capture(); + #endif save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_clearance); + do_blocking_move_to_xy_z(current_position, z_clearance); ui.return_to_status(); mesh_index_pair location; + xy_int8_t &lpos = location.pos; do { - location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_NOZZLE_AS_REFERENCE, nullptr); + location = find_closest_mesh_point_of_type(INVALID, pos); // It doesn't matter if the probe can't reach the NAN location. This is a manual probe. - if (location.x_index < 0 && location.y_index < 0) continue; + if (!location.valid()) continue; - const float xProbe = mesh_index_to_xpos(location.x_index), - yProbe = mesh_index_to_ypos(location.y_index); + const xyz_pos_t ppos = { + mesh_index_to_xpos(lpos.x), + mesh_index_to_ypos(lpos.y), + Z_CLEARANCE_BETWEEN_PROBES + }; - if (!position_is_reachable(xProbe, yProbe)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points) + if (!position_is_reachable(ppos)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points) LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT); - do_blocking_move_to(xProbe, yProbe, Z_CLEARANCE_BETWEEN_PROBES); + do_blocking_move_to(ppos); do_blocking_move_to_z(z_clearance); KEEPALIVE_STATE(PAUSED_FOR_USER); - ui.capture(); + #if HAS_LCD_MENU + ui.capture(); + #endif if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing - serialprintPGM(parser.seen('B') ? PSTR(MSG_UBL_BC_INSERT) : PSTR(MSG_UBL_BC_INSERT2)); + serialprintPGM(parser.seen('B') ? GET_TEXT(MSG_UBL_BC_INSERT) : GET_TEXT(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 @@ -933,20 +946,20 @@ return restore_ubl_active_state_and_leave(); } - z_values[location.x_index][location.y_index] = current_position[Z_AXIS] - thick; + z_values[lpos.x][lpos.y] = current_position.z - thick; #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(location.x_index, location.y_index, z_values[location.x_index][location.y_index]); + ExtUI::onMeshUpdate(location, z_values[lpos.x][lpos.y]); #endif if (g29_verbose_level > 2) - SERIAL_ECHOLNPAIR_F("Mesh Point Measured at: ", z_values[location.x_index][location.y_index], 6); + SERIAL_ECHOLNPAIR_F("Mesh Point Measured at: ", z_values[lpos.x][lpos.y], 6); SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (location.x_index >= 0 && location.y_index >= 0); + } while (location.valid()); if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing restore_ubl_active_state_and_leave(); - do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE); + do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE); } inline void set_message_with_feedback(PGM_P const msg_P) { @@ -957,11 +970,11 @@ void abort_fine_tune() { ui.return_to_status(); do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - set_message_with_feedback(PSTR(MSG_EDITING_STOPPED)); + set_message_with_feedback(GET_TEXT(MSG_EDITING_STOPPED)); } - void unified_bed_leveling::fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) { - if (!parser.seen('R')) // fine_tune_mesh() is special. If no repetition count flag is specified + void unified_bed_leveling::fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) { + if (!parser.seen('R')) // fine_tune_mesh() is special. If no repetition count flag is specified g29_repetition_cnt = 1; // do exactly one mesh location. Otherwise use what the parser decided. #if ENABLED(UBL_MESH_EDIT_MOVES_Z) @@ -974,7 +987,7 @@ mesh_index_pair location; - if (!position_is_reachable(rx, ry)) { + if (!position_is_reachable(pos)) { SERIAL_ECHOLNPGM("(X,Y) outside printable radius."); return; } @@ -982,76 +995,79 @@ save_ubl_active_state_and_disable(); LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH); - ui.capture(); // 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 HAS_LCD_MENU + ui.capture(); // Take over control of the LCD encoder + #endif + do_blocking_move_to_xy_z(pos, 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 + do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset #endif - uint16_t not_done[16]; - memset(not_done, 0xFF, sizeof(not_done)); + MeshFlags done_flags{0}; + xy_int8_t &lpos = location.pos; 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 + location = find_closest_mesh_point_of_type(SET_IN_BITMAP, pos, false, &done_flags); - 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 + if (lpos.x < 0) break; // Stop when there are no more reachable points - const float rawx = mesh_index_to_xpos(location.x_index), - rawy = mesh_index_to_ypos(location.y_index); + done_flags.mark(lpos); // Mark this location as 'adjusted' so a new + // location is used on the next loop + const xyz_pos_t raw = { + mesh_index_to_xpos(lpos.x), + mesh_index_to_ypos(lpos.y), + Z_CLEARANCE_BETWEEN_PROBES + }; - 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(raw)) break; // SHOULD NOT OCCUR (find_closest_mesh_point_of_type only returns reachable) - do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point with probe clearance + do_blocking_move_to(raw); // 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 + do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset before editing #endif KEEPALIVE_STATE(PAUSED_FOR_USER); - if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point + if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point ui.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 + float new_z = z_values[lpos.x][lpos.y]; + 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 lcd_mesh_edit_setup(new_z); do { 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. + SERIAL_FLUSH(); // Prevent host M105 buffer overrun. } while (!ui.button_pressed()); - if (!lcd_map_control) ui.return_to_status(); // Just editing a single point? Return to status + if (!lcd_map_control) ui.return_to_status(); // Just editing a single point? Return to status - if (click_and_hold(abort_fine_tune)) break; // Button held down? Abort editing + if (click_and_hold(abort_fine_tune)) break; // Button held down? Abort editing - z_values[location.x_index][location.y_index] = new_z; // Save the updated Z value + z_values[lpos.x][lpos.y] = new_z; // Save the updated Z value #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(location.x_index, location.y_index, new_z); + ExtUI::onMeshUpdate(location, new_z); #endif - serial_delay(20); // No switch noise + serial_delay(20); // No switch noise ui.refresh(); - } while (location.x_index >= 0 && --g29_repetition_cnt > 0); + } while (lpos.x >= 0 && --g29_repetition_cnt > 0); ui.release(); if (do_ubl_mesh_map) display_map(g29_map_type); restore_ubl_active_state_and_leave(); - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); + do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH); SERIAL_ECHOLNPGM("Done Editing Mesh"); @@ -1068,17 +1084,12 @@ bool err_flag = false; #if HAS_LCD_MENU - set_message_with_feedback(PSTR(MSG_UBL_DOING_G29)); + set_message_with_feedback(GET_TEXT(MSG_UBL_DOING_G29)); #endif g29_constant = 0; g29_repetition_cnt = 0; - g29_x_flag = parser.seenval('X'); - g29_x_pos = g29_x_flag ? parser.value_float() : current_position[X_AXIS]; - g29_y_flag = parser.seenval('Y'); - g29_y_pos = g29_y_flag ? parser.value_float() : current_position[Y_AXIS]; - if (parser.seen('R')) { g29_repetition_cnt = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS; NOMORE(g29_repetition_cnt, GRID_MAX_POINTS); @@ -1090,7 +1101,7 @@ g29_verbose_level = parser.seen('V') ? parser.value_int() : 0; if (!WITHIN(g29_verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4).\n"); + SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4).\n"); err_flag = true; } @@ -1125,17 +1136,24 @@ #endif } - if (g29_x_flag != g29_y_flag) { + xy_seen.x = parser.seenval('X'); + float sx = xy_seen.x ? parser.value_float() : current_position.x; + xy_seen.y = parser.seenval('Y'); + float sy = xy_seen.y ? parser.value_float() : current_position.y; + + if (xy_seen.x != xy_seen.y) { SERIAL_ECHOLNPGM("Both X & Y locations must be specified.\n"); err_flag = true; } // If X or Y are not valid, use center of the bed values - if (!WITHIN(g29_x_pos, X_MIN_BED, X_MAX_BED)) g29_x_pos = X_CENTER; - if (!WITHIN(g29_y_pos, Y_MIN_BED, Y_MAX_BED)) g29_y_pos = Y_CENTER; + if (!WITHIN(sx, X_MIN_BED, X_MAX_BED)) sx = X_CENTER; + if (!WITHIN(sy, Y_MIN_BED, Y_MAX_BED)) sy = Y_CENTER; if (err_flag) return UBL_ERR; + g29_pos.set(sx, sy); + /** * Activate or deactivate UBL * Note: UBL's G29 restores the state set here when done. @@ -1190,7 +1208,7 @@ if (ubl_state_recursion_chk != 1) { SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row."); #if HAS_LCD_MENU - set_message_with_feedback(PSTR(MSG_UBL_SAVE_ERROR)); + set_message_with_feedback(GET_TEXT(MSG_UBL_SAVE_ERROR)); #endif return; } @@ -1204,7 +1222,7 @@ if (--ubl_state_recursion_chk) { SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); #if HAS_LCD_MENU - set_message_with_feedback(PSTR(MSG_UBL_RESTORE_ERROR)); + set_message_with_feedback(GET_TEXT(MSG_UBL_RESTORE_ERROR)); #endif return; } @@ -1214,26 +1232,22 @@ mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { - bool found_a_NAN = false, found_a_real = false; + bool found_a_NAN = false, found_a_real = false; - mesh_index_pair out_mesh; - out_mesh.x_index = out_mesh.y_index = -1; - out_mesh.distance = -99999.99f; + mesh_index_pair farthest { -1, -1, -99999.99 }; for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - if (isnan(z_values[i][j])) { // Check to see if this location holds an invalid mesh point - - const float mx = mesh_index_to_xpos(i), - my = mesh_index_to_ypos(j); + if (isnan(z_values[i][j])) { // Invalid mesh point? - if (!position_is_reachable_by_probe(mx, my)) // make sure the probe can get to the mesh point + // Skip points the probe can't reach + if (!position_is_reachable_by_probe(mesh_index_to_xpos(i), mesh_index_to_ypos(j))) continue; found_a_NAN = true; - int8_t closest_x = -1, closest_y = -1; + xy_int8_t near { -1, -1 }; float d1, d2 = 99999.9f; for (int8_t k = 0; k < GRID_MAX_POINTS_X; k++) { for (int8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { @@ -1246,84 +1260,75 @@ d1 = HYPOT(i - k, j - l) + (1.0f / ((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 - closest_y = j; + if (d1 < d2) { // Invalid mesh point (i,j) is closer to the defined point (k,l) + d2 = d1; + near.set(i, j); } } } } // - // At this point d2 should have the closest defined mesh point to invalid mesh point (i,j) + // At this point d2 should have the near defined mesh point to invalid mesh point (i,j) // - if (found_a_real && (closest_x >= 0) && (d2 > out_mesh.distance)) { - out_mesh.distance = d2; // found an invalid location with a greater distance - out_mesh.x_index = closest_x; // to a defined mesh point - out_mesh.y_index = closest_y; + if (found_a_real && near.x >= 0 && d2 > farthest.distance) { + farthest.pos = near; // Found an invalid location farther from the defined mesh point + farthest.distance = d2; } } } // for j } // for i 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; + farthest.pos.set(GRID_MAX_POINTS_X / 2, GRID_MAX_POINTS_Y / 2); + farthest.distance = 1; } - return out_mesh; + return farthest; } - 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; + mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const MeshPointType type, const xy_pos_t &pos, const bool probe_relative/*=false*/, MeshFlags *done_flags/*=nullptr*/) { + mesh_index_pair closest; + closest.invalidate(); + closest.distance = -99999.9f; - // 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); + // Get the reference position, either nozzle or probe + const xy_pos_t ref = probe_relative ? pos + probe_offset : pos; float best_so_far = 99999.99f; for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - - if ( (type == INVALID && isnan(z_values[i][j])) // Check to see if this location holds the right thing - || (type == REAL && !isnan(z_values[i][j])) - || (type == SET_IN_BITMAP && is_bitmap_set(bits, i, j)) + if ( (type == (isnan(z_values[i][j]) ? INVALID : REAL)) + || (type == SET_IN_BITMAP && !done_flags->marked(i, j)) ) { - // We only get here if we found a Mesh Point of the specified type - - const float mx = mesh_index_to_xpos(i), - my = mesh_index_to_ypos(j); + // Found a Mesh Point of the specified type! + const xy_pos_t mpos = { mesh_index_to_xpos(i), mesh_index_to_ypos(j) }; // If using the probe as the reference there are some unreachable locations. // Also for round beds, there are grid points outside the bed the nozzle can't reach. // Prune them from the list and ignore them till the next Phase (manual nozzle probing). - if (probe_as_reference ? !position_is_reachable_by_probe(mx, my) : !position_is_reachable(mx, my)) + if (probe_relative ? !position_is_reachable_by_probe(mpos) : !position_is_reachable(mpos)) continue; // Reachable. Check if it's the best_so_far location to the nozzle. - float distance = HYPOT(px - mx, py - my); + const xy_pos_t diff = current_position - mpos; + const float distance = (ref - mpos).magnitude() + diff.magnitude() * 0.1f; // 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; 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. - out_mesh.y_index = j; - out_mesh.distance = best_so_far; + best_so_far = distance; // Found a closer location with the desired value type. + closest.pos.set(i, j); + closest.distance = best_so_far; } } } // for j } // for i - return out_mesh; + return closest; } /** @@ -1333,20 +1338,20 @@ */ bool unified_bed_leveling::smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { - const int8_t x1 = x + xdir, x2 = x1 + xdir, - y1 = y + ydir, y2 = y1 + ydir; - // A NAN next to a pair of real values? - if (isnan(z_values[x][y]) && !isnan(z_values[x1][y1]) && !isnan(z_values[x2][y2])) { - 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... - - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, z_values[x][y]); - #endif - - return true; + const float v = z_values[x][y]; + if (isnan(v)) { // A NAN... + const int8_t dx = x + xdir, dy = y + ydir; + const float v1 = z_values[dx][dy]; + if (!isnan(v1)) { // ...next to a pair of real values? + const float v2 = z_values[dx + xdir][dy + ydir]; + if (!isnan(v2)) { + z_values[x][y] = v1 < v2 ? v1 : v1 + v1 - v2; + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onMeshUpdate(x, y, z_values[x][y]); + #endif + return true; + } + } } return false; } @@ -1382,83 +1387,91 @@ #if HAS_BED_PROBE + //#define VALIDATE_MESH_TILT + #include "../../../libs/vector_3.h" 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); + const float x_min = probe_min_x(), x_max = probe_max_x(), + y_min = probe_min_y(), y_max = probe_max_y(), + dx = (x_max - x_min) / (g29_grid_size - 1), + dy = (y_max - y_min) / (g29_grid_size - 1); - bool abort_flag = false; + xy_float_t points[3]; + get_three_probe_points(points); float measured_z; + bool abort_flag = false; - const float dx = float(x_max - x_min) / (g29_grid_size - 1), - dy = float(y_max - y_min) / (g29_grid_size - 1); + #ifdef VALIDATE_MESH_TILT + float z1, z2, z3; // Needed for algorithm validation below + #endif 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) { SERIAL_ECHOLNPGM("Tilting mesh (1/3)"); - #if HAS_LCD_MENU - ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 1/3")); + #if HAS_DISPLAY + ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)); #endif - measured_z = probe_pt(PROBE_PT_1_X, PROBE_PT_1_Y, PROBE_PT_RAISE, g29_verbose_level); + measured_z = probe_at_point(points[0], 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; + measured_z -= get_z_correction(points[0]); + #ifdef VALIDATE_MESH_TILT + z1 = measured_z; + #endif 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); + incremental_LSF(&lsf_results, points[0], measured_z); } if (!abort_flag) { SERIAL_ECHOLNPGM("Tilting mesh (2/3)"); - #if HAS_LCD_MENU - ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 2/3")); + #if HAS_DISPLAY + ui.status_printf_P(0, PSTR(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)); #endif - measured_z = probe_pt(PROBE_PT_2_X, PROBE_PT_2_Y, PROBE_PT_RAISE, g29_verbose_level); - //z2 = measured_z; + measured_z = probe_at_point(points[1], PROBE_PT_RAISE, g29_verbose_level); + #ifdef VALIDATE_MESH_TILT + z2 = measured_z; + #endif if (isnan(measured_z)) abort_flag = true; else { - measured_z -= get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y); + measured_z -= get_z_correction(points[1]); if (g29_verbose_level > 3) { serial_spaces(16); SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); } - incremental_LSF(&lsf_results, PROBE_PT_2_X, PROBE_PT_2_Y, measured_z); + incremental_LSF(&lsf_results, points[1], measured_z); } } if (!abort_flag) { SERIAL_ECHOLNPGM("Tilting mesh (3/3)"); - #if HAS_LCD_MENU - ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 3/3")); + #if HAS_DISPLAY + ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)); #endif - measured_z = probe_pt(PROBE_PT_3_X, PROBE_PT_3_Y, PROBE_PT_STOW, g29_verbose_level); - //z3 = measured_z; + measured_z = probe_at_point(points[2], PROBE_PT_STOW, g29_verbose_level); + #ifdef VALIDATE_MESH_TILT + z3 = measured_z; + #endif if (isnan(measured_z)) abort_flag = true; else { - measured_z -= get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y); + measured_z -= get_z_correction(points[2]); if (g29_verbose_level > 3) { serial_spaces(16); SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); } - incremental_LSF(&lsf_results, PROBE_PT_3_X, PROBE_PT_3_Y, measured_z); + incremental_LSF(&lsf_results, points[2], measured_z); } } @@ -1476,38 +1489,40 @@ bool zig_zag = false; - uint16_t total_points = g29_grid_size * g29_grid_size, current = 1; + uint16_t total_points = g29_grid_size * g29_grid_size, point_num = 1; + xy_pos_t rpos; for (uint8_t ix = 0; ix < g29_grid_size; ix++) { - const float rx = float(x_min) + ix * dx; + rpos.x = 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); + rpos.y = y_min + dy * (zig_zag ? g29_grid_size - 1 - iy : iy); if (!abort_flag) { - SERIAL_ECHOLNPAIR("Tilting mesh point ", current, "/", total_points, "\n"); - #if HAS_LCD_MENU - ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), current, total_points); + SERIAL_ECHOLNPAIR("Tilting mesh point ", point_num, "/", total_points, "\n"); + #if HAS_DISPLAY + ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points); #endif - measured_z = probe_pt(rx, ry, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling + measured_z = probe_at_point(rpos, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling abort_flag = isnan(measured_z); - if (DEBUGGING(LEVELING)) { - DEBUG_CHAR('('); - DEBUG_ECHO_F(rx, 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(ry, 7); - DEBUG_ECHOPGM(") logical: "); - DEBUG_CHAR('('); - DEBUG_ECHO_F(LOGICAL_X_POSITION(rx), 7); - DEBUG_CHAR(','); - DEBUG_ECHO_F(LOGICAL_Y_POSITION(ry), 7); - DEBUG_ECHOPAIR_F(") measured: ", measured_z, 7); - DEBUG_ECHOPAIR_F(" correction: ", get_z_correction(rx, ry), 7); - } + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + const xy_pos_t lpos = rpos.asLogical(); + DEBUG_CHAR('('); + DEBUG_ECHO_F(rpos.x, 7); + DEBUG_CHAR(','); + DEBUG_ECHO_F(rpos.y, 7); + DEBUG_ECHOPAIR_F(") logical: (", lpos.x, 7); + DEBUG_CHAR(','); + DEBUG_ECHO_F(lpos.y, 7); + DEBUG_ECHOPAIR_F(") measured: ", measured_z, 7); + DEBUG_ECHOPAIR_F(" correction: ", get_z_correction(rpos), 7); + } + #endif - measured_z -= get_z_correction(rx, ry) /* + zprobe_zoffset */ ; + measured_z -= get_z_correction(rpos) /* + probe_offset.z */ ; if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_F(" final >>>---> ", measured_z, 7); @@ -1515,10 +1530,10 @@ serial_spaces(16); SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); } - incremental_LSF(&lsf_results, rx, ry, measured_z); + incremental_LSF(&lsf_results, rpos, measured_z); } - current++; + point_num++; } zig_zag ^= true; @@ -1549,33 +1564,33 @@ 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]; + float mx = mesh_index_to_xpos(i), + my = mesh_index_to_ypos(j), + mz = z_values[i][j]; if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR_F("before rotation = [", x_tmp, 7); + DEBUG_ECHOPAIR_F("before rotation = [", mx, 7); DEBUG_CHAR(','); - DEBUG_ECHO_F(y_tmp, 7); + DEBUG_ECHO_F(my, 7); DEBUG_CHAR(','); - DEBUG_ECHO_F(z_tmp, 7); + DEBUG_ECHO_F(mz, 7); DEBUG_ECHOPGM("] ---> "); DEBUG_DELAY(20); } - apply_rotation_xyz(rotation, x_tmp, y_tmp, z_tmp); + apply_rotation_xyz(rotation, mx, my, mz); if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR_F("after rotation = [", x_tmp, 7); + DEBUG_ECHOPAIR_F("after rotation = [", mx, 7); DEBUG_CHAR(','); - DEBUG_ECHO_F(y_tmp, 7); + DEBUG_ECHO_F(my, 7); DEBUG_CHAR(','); - DEBUG_ECHO_F(z_tmp, 7); + DEBUG_ECHO_F(mz, 7); DEBUG_ECHOLNPGM("]"); - DEBUG_DELAY(55); + DEBUG_DELAY(20); } - z_values[i][j] = z_tmp - lsf_results.D; + z_values[i][j] = mz - lsf_results.D; #if ENABLED(EXTENSIBLE_UI) ExtUI::onMeshUpdate(i, j, z_values[i][j]); #endif @@ -1598,41 +1613,32 @@ DEBUG_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() + * Use the code below to check the validity of the mesh tilting algorithm. + * 3-Point Mesh Tilt uses the same algorithm as grid-based tilting, but only + * three points are used in the calculation. This guarantees that each probed point + * has an exact match when 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; - DEBUG_ECHOPAIR_F("D from 1st point: ", d, 6); - DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6); - - t = normal.x * (PROBE_PT_2_X) + normal.y * (PROBE_PT_2_Y); - d = t + normal.z * z2; - DEBUG_EOL(); - DEBUG_ECHOPAIR_F("D from 2nd point: ", d, 6); - DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6); - - t = normal.x * (PROBE_PT_3_X) + normal.y * (PROBE_PT_3_Y); - d = t + normal.z * z3; - DEBUG_ECHOPAIR_F("D from 3rd point: ", d, 6); - DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6); - - t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + normal.z * 0; - DEBUG_ECHOLNPAIR_F("D from home location with Z=0 : ", d, 6); - - 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; - DEBUG_ECHOPAIR_F("D from home location using mesh value for Z: ", d, 6); - - DEBUG_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT); - DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6); + #ifdef VALIDATE_MESH_TILT + auto d_from = []() { DEBUG_ECHOPGM("D from "); }; + auto normed = [&](const xy_pos_t &pos, const float &zadd) { + return normal.x * pos.x + normal.y * pos.y + zadd; + }; + auto debug_pt = [](PGM_P const pre, const xy_pos_t &pos, const float &zadd) { + d_from(); serialprintPGM(pre); + DEBUG_ECHO_F(normed(pos, zadd), 6); + DEBUG_ECHOLNPAIR_F(" Z error: ", zadd - get_z_correction(pos), 6); + }; + debug_pt(PSTR("1st point: "), probe_pt[0], normal.z * z1); + debug_pt(PSTR("2nd point: "), probe_pt[1], normal.z * z2); + debug_pt(PSTR("3rd point: "), probe_pt[2], normal.z * z3); + d_from(); DEBUG_ECHOPGM("safe home with Z="); + DEBUG_ECHOLNPAIR_F("0 : ", normed(safe_homing_xy, 0), 6); + d_from(); DEBUG_ECHOPGM("safe home with Z="); + DEBUG_ECHOLNPAIR_F("mesh value ", normed(safe_homing_xy, get_z_correction(safe_homing_xy)), 6); + DEBUG_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT); + DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(safe_homing_xy), 6); #endif } // DEBUGGING(LEVELING) @@ -1661,21 +1667,23 @@ if (!isnan(z_values[jx][jy])) SBI(bitmap[jx], jy); + xy_pos_t ppos; for (uint8_t ix = 0; ix < GRID_MAX_POINTS_X; ix++) { - const float px = mesh_index_to_xpos(ix); + ppos.x = mesh_index_to_xpos(ix); for (uint8_t iy = 0; iy < GRID_MAX_POINTS_Y; iy++) { - const float py = mesh_index_to_ypos(iy); + ppos.y = mesh_index_to_ypos(iy); if (isnan(z_values[ix][iy])) { - // undefined mesh point at (px,py), compute weighted LSF from original valid mesh points. + // undefined mesh point at (ppos.x,ppos.y), compute weighted LSF from original valid mesh points. incremental_LSF_reset(&lsf_results); + xy_pos_t rpos; for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++) { - const float rx = mesh_index_to_xpos(jx); + rpos.x = mesh_index_to_xpos(jx); for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++) { 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)); - incremental_WLSF(&lsf_results, rx, ry, rz, w); + rpos.y = mesh_index_to_ypos(jy); + const float rz = z_values[jx][jy], + w = 1.0f + weight_scaled / (rpos - ppos).magnitude(); + incremental_WLSF(&lsf_results, rpos, rz, w); } } } @@ -1683,12 +1691,12 @@ SERIAL_ECHOLNPGM("Insufficient data"); return; } - const float ez = -lsf_results.D - lsf_results.A * px - lsf_results.B * py; + const float ez = -lsf_results.D - lsf_results.A * ppos.x - lsf_results.B * ppos.y; z_values[ix][iy] = ez; #if ENABLED(EXTENSIBLE_UI) ExtUI::onMeshUpdate(ix, iy, z_values[ix][iy]); #endif - idle(); // housekeeping + idle(); // housekeeping } } } @@ -1713,13 +1721,13 @@ serial_delay(50); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_ECHOLNPAIR_F("planner.z_fade_height : ", planner.z_fade_height, 4); + SERIAL_ECHOLNPAIR_F("Fade Height M420 Z", planner.z_fade_height, 4); #endif adjust_mesh_to_mean(g29_c_flag, g29_constant); #if HAS_BED_PROBE - SERIAL_ECHOLNPAIR_F("zprobe_zoffset: ", zprobe_zoffset, 7); + SERIAL_ECHOLNPAIR_F("Probe Offset M851 Z", probe_offset.z, 7); #endif SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index d3b012da5abc..a0d5518c451a 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -35,77 +35,66 @@ #include "../../../Marlin.h" #include -#if AVR_AT90USB1286_FAMILY // Teensyduino & Printrboard IDE extensions have compile errors without this - inline void set_current_from_destination() { COPY(current_position, destination); } -#else - extern void set_current_from_destination(); -#endif - #if !UBL_SEGMENTED - void unified_bed_leveling::line_to_destination_cartesian(const float &feed_rate, const uint8_t extruder) { + void unified_bed_leveling::line_to_destination_cartesian(const feedRate_t &scaled_fr_mm_s, const uint8_t extruder) { /** * Much of the nozzle movement will be within the same cell. So we will do as little computation * as possible to determine if this is the case. If this move is within the same cell, we will * just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave */ #if HAS_POSITION_MODIFIERS - 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] }; + xyze_pos_t start = current_position, end = destination; planner.apply_modifiers(start); planner.apply_modifiers(end); #else - const float (&start)[XYZE] = current_position, - (&end)[XYZE] = destination; + const xyze_pos_t &start = current_position, &end = destination; #endif - const int cell_start_xi = get_cell_index_x(start[X_AXIS]), - cell_start_yi = get_cell_index_y(start[Y_AXIS]), - cell_dest_xi = get_cell_index_x(end[X_AXIS]), - cell_dest_yi = get_cell_index_y(end[Y_AXIS]); + const xy_int8_t istart = cell_indexes(start), iend = cell_indexes(end); // A move within the same cell needs no splitting - if (cell_start_xi == cell_dest_xi && cell_start_yi == cell_dest_yi) { + if (istart == iend) { // 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)) { + if (!WITHIN(iend.x, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iend.y, 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. - 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_AXIS], feed_rate, extruder); - set_current_from_destination(); - + #ifdef UBL_Z_RAISE_WHEN_OFF_MESH + end.z += UBL_Z_RAISE_WHEN_OFF_MESH; + #endif + planner.buffer_segment(end, scaled_fr_mm_s, extruder); + current_position = destination; return; } 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)); - - 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 ]), - z2 = z_values[cell_dest_xi ][cell_dest_yi + 1] + xratio * - (z_values[cell_dest_xi + 1][cell_dest_yi + 1] - z_values[cell_dest_xi][cell_dest_yi + 1]); + const float xratio = (end.x - mesh_index_to_xpos(iend.x)) * RECIPROCAL(MESH_X_DIST); - if (cell_dest_xi >= GRID_MAX_POINTS_X - 1) z1 = z2 = 0.0; + float z1, z2; + if (iend.x >= GRID_MAX_POINTS_X - 1) + z1 = z2 = 0.0; + else { + z1 = z_values[iend.x ][iend.y ] + xratio * + (z_values[iend.x + 1][iend.y ] - z_values[iend.x][iend.y ]), + z2 = z_values[iend.x ][iend.y + 1] + xratio * + (z_values[iend.x + 1][iend.y + 1] - z_values[iend.x][iend.y + 1]); + } // 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; + const float yratio = (end.y - mesh_index_to_ypos(iend.y)) * RECIPROCAL(MESH_Y_DIST), + z0 = iend.y < GRID_MAX_POINTS_Y - 1 ? (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end.z) : 0.0; // 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_AXIS], feed_rate, extruder); - - set_current_from_destination(); + if (!isnan(z0)) end.z += z0; + planner.buffer_segment(end, scaled_fr_mm_s, extruder); + current_position = destination; return; } @@ -114,17 +103,11 @@ * case - crossing only one X or Y line - after details are worked out to reduce computation. */ - const float dx = end[X_AXIS] - start[X_AXIS], - dy = end[Y_AXIS] - start[Y_AXIS]; - - const int left_flag = dx < 0.0 ? 1 : 0, - down_flag = dy < 0.0 ? 1 : 0; - - const float adx = left_flag ? -dx : dx, - ady = down_flag ? -dy : dy; - - const int dxi = cell_start_xi == cell_dest_xi ? 0 : left_flag ? -1 : 1, - dyi = cell_start_yi == cell_dest_yi ? 0 : down_flag ? -1 : 1; + const xy_float_t dist = end - start; + const xy_bool_t neg { dist.x < 0, dist.y < 0 }; + const xy_int8_t ineg { int8_t(neg.x), int8_t(neg.y) }; + const xy_float_t sign { neg.x ? -1.0f : 1.0f, neg.y ? -1.0f : 1.0f }; + const xy_int8_t iadd { int8_t(iend.x == istart.x ? 0 : sign.x), int8_t(iend.y == istart.y ? 0 : sign.y) }; /** * Compute the extruder scaling factor for each partial move, checking for @@ -134,75 +117,75 @@ * components. The larger of the two is used to preserve precision. */ - const bool use_x_dist = adx > ady; + const xy_float_t ad = sign * dist; + const bool use_x_dist = ad.x > ad.y; - float on_axis_distance = use_x_dist ? dx : dy, - e_position = end[E_AXIS] - start[E_AXIS], - z_position = end[Z_AXIS] - start[Z_AXIS]; + float on_axis_distance = use_x_dist ? dist.x : dist.y, + e_position = end.e - start.e, + z_position = end.z - start.z; - const float e_normalized_dist = e_position / on_axis_distance, + const float e_normalized_dist = e_position / on_axis_distance, // Allow divide by zero z_normalized_dist = z_position / on_axis_distance; - int current_xi = cell_start_xi, - current_yi = cell_start_yi; + xy_int8_t icell = istart; - const float m = dy / dx, - c = start[Y_AXIS] - m * start[X_AXIS]; + const float ratio = dist.y / dist.x, // Allow divide by zero + c = start.y - ratio * start.x; - const bool inf_normalized_flag = (isinf(e_normalized_dist) != 0), - inf_m_flag = (isinf(m) != 0); + const bool inf_normalized_flag = isinf(e_normalized_dist), + inf_ratio_flag = isinf(ratio); /** * Handle vertical lines that stay within one column. * These need not be perfectly vertical. */ - if (dxi == 0) { // Vertical line? - current_yi += down_flag; // Line going down? Just 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); + if (iadd.x == 0) { // Vertical line? + icell.y += ineg.y; // Line going down? Just go to the bottom. + while (icell.y != iend.y + ineg.y) { + icell.y += iadd.y; + const float next_mesh_line_y = mesh_index_to_ypos(icell.y); /** * 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. */ - const float rx = inf_m_flag ? start[X_AXIS] : (next_mesh_line_y - c) / m; + const float rx = inf_ratio_flag ? start.x : (next_mesh_line_y - c) / ratio; - float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, current_xi, current_yi) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); + float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, icell.x, icell.y) + * planner.fade_scaling_factor_for_z(end.z); // Undefined parts of the Mesh in z_values[][] are NAN. // Replace NAN corrections with 0.0 to prevent NAN propagation. if (isnan(z0)) z0 = 0.0; - const float ry = mesh_index_to_ypos(current_yi); + const float ry = mesh_index_to_ypos(icell.y); /** * 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. */ - 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_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; + if (ry != start.y) { + if (!inf_normalized_flag) { // fall-through faster than branch + on_axis_distance = use_x_dist ? rx - start.x : ry - start.y; + e_position = start.e + on_axis_distance * e_normalized_dist; + z_position = start.z + on_axis_distance * z_normalized_dist; } else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; + e_position = end.e; + z_position = end.z; } - planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder); + planner.buffer_segment(rx, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder); } //else printf("FIRST MOVE PRUNED "); } // At the final destination? Usually not, but when on a Y Mesh Line it's completed. - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) + if (xy_pos_t(current_position) != xy_pos_t(end)) goto FINAL_MOVE; - set_current_from_destination(); + current_position = destination; return; } @@ -210,130 +193,123 @@ * Handle horizontal lines that stay within one row. * These need not be perfectly horizontal. */ - if (dyi == 0) { // Horizontal line? - current_xi += left_flag; // Heading left? Just go to the left edge of the 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), - ry = m * next_mesh_line_x + c; // Calculate Y at the next X mesh line + if (iadd.y == 0) { // Horizontal line? + icell.x += ineg.x; // Heading left? Just go to the left edge of the cell for the first move. + while (icell.x != iend.x + ineg.x) { + icell.x += iadd.x; + const float rx = mesh_index_to_xpos(icell.x); + const float ry = ratio * rx + c; // Calculate Y at the next X mesh line - float z0 = z_correction_for_y_on_vertical_mesh_line(ry, current_xi, current_yi) - * planner.fade_scaling_factor_for_z(end[Z_AXIS]); + float z0 = z_correction_for_y_on_vertical_mesh_line(ry, icell.x, icell.y) + * planner.fade_scaling_factor_for_z(end.z); // Undefined parts of the Mesh in z_values[][] are NAN. // Replace NAN corrections with 0.0 to prevent NAN propagation. 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. */ - if (rx != start[X_AXIS]) { + if (rx != start.x) { if (!inf_normalized_flag) { - on_axis_distance = use_x_dist ? rx - start[X_AXIS] : ry - start[Y_AXIS]; - 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; + on_axis_distance = use_x_dist ? rx - start.x : ry - start.y; + e_position = start.e + on_axis_distance * e_normalized_dist; // is based on X or Y because this is a horizontal move + z_position = start.z + on_axis_distance * z_normalized_dist; } else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; + e_position = end.e; + z_position = end.z; } - if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder)) + if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder)) break; } //else printf("FIRST MOVE PRUNED "); } - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) + if (xy_pos_t(current_position) != xy_pos_t(end)) goto FINAL_MOVE; - set_current_from_destination(); + current_position = destination; return; } /** * - * Handle the generic case of a line crossing both X and Y Mesh lines. + * Generic case of a line crossing both X and Y Mesh lines. * */ - int xi_cnt = cell_start_xi - cell_dest_xi, - yi_cnt = cell_start_yi - cell_dest_yi; + xy_int8_t cnt = (istart - iend).ABS(); - if (xi_cnt < 0) xi_cnt = -xi_cnt; - if (yi_cnt < 0) yi_cnt = -yi_cnt; + icell += ineg; - current_xi += left_flag; - current_yi += down_flag; + while (cnt) { - while (xi_cnt || yi_cnt) { + const float next_mesh_line_x = mesh_index_to_xpos(icell.x + iadd.x), + next_mesh_line_y = mesh_index_to_ypos(icell.y + iadd.y), + ry = ratio * next_mesh_line_x + c, // Calculate Y at the next X mesh line + rx = (next_mesh_line_y - c) / ratio; // Calculate X at the next Y mesh line + // (No need to worry about ratio == 0. + // In that case, it was already detected + // as a vertical line move above.) - const float next_mesh_line_x = mesh_index_to_xpos(current_xi + dxi), - next_mesh_line_y = mesh_index_to_ypos(current_yi + dyi), - ry = m * next_mesh_line_x + c, // Calculate Y at the next X mesh line - rx = (next_mesh_line_y - c) / m; // Calculate X at the next Y mesh line - // (No need to worry about m being zero. - // If that was the case, it was already detected - // as a vertical line move above.) - - if (left_flag == (rx > next_mesh_line_x)) { // Check if we hit the Y line first + if (neg.x == (rx > next_mesh_line_x)) { // Check if we hit the Y line first // Yes! Crossing a Y Mesh Line next - 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]); + float z0 = z_correction_for_x_on_horizontal_mesh_line(rx, icell.x - ineg.x, icell.y + iadd.y) + * planner.fade_scaling_factor_for_z(end.z); // Undefined parts of the Mesh in z_values[][] are NAN. // Replace NAN corrections with 0.0 to prevent NAN propagation. 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_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; + on_axis_distance = use_x_dist ? rx - start.x : next_mesh_line_y - start.y; + e_position = start.e + on_axis_distance * e_normalized_dist; + z_position = start.z + on_axis_distance * z_normalized_dist; } else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; + e_position = end.e; + z_position = end.z; } - if (!planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder)) + if (!planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, scaled_fr_mm_s, extruder)) break; - current_yi += dyi; - yi_cnt--; + icell.y += iadd.y; + cnt.y--; } else { // Yes! Crossing a X Mesh Line next - 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]); + float z0 = z_correction_for_y_on_vertical_mesh_line(ry, icell.x + iadd.x, icell.y - ineg.y) + * planner.fade_scaling_factor_for_z(end.z); // Undefined parts of the Mesh in z_values[][] are NAN. // Replace NAN corrections with 0.0 to prevent NAN propagation. 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_AXIS] + on_axis_distance * e_normalized_dist; - z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist; + on_axis_distance = use_x_dist ? next_mesh_line_x - start.x : ry - start.y; + e_position = start.e + on_axis_distance * e_normalized_dist; + z_position = start.z + on_axis_distance * z_normalized_dist; } else { - e_position = end[E_AXIS]; - z_position = end[Z_AXIS]; + e_position = end.e; + z_position = end.z; } - if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder)) + if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder)) break; - current_xi += dxi; - xi_cnt--; + icell.x += iadd.x; + cnt.x--; } - if (xi_cnt < 0 || yi_cnt < 0) break; // Too far! Exit the loop and go to FINAL_MOVE + if (cnt.x < 0 || cnt.y < 0) break; // Too far! Exit the loop and go to FINAL_MOVE } - if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS]) + if (xy_pos_t(current_position) != xy_pos_t(end)) goto FINAL_MOVE; - set_current_from_destination(); + current_position = destination; } #else // UBL_SEGMENTED @@ -356,80 +332,66 @@ * Returns true if did NOT move, false if moved (requires current_position update). */ - bool _O2 unified_bed_leveling::prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate) { + bool _O2 unified_bed_leveling::line_to_destination_segmented(const feedRate_t &scaled_fr_mm_s) { - if (!position_is_reachable(rtarget[X_AXIS], rtarget[Y_AXIS])) // fail if moving outside reachable boundary - return true; // did not move, so current_position still accurate + if (!position_is_reachable(destination)) // fail if moving outside reachable boundary + return true; // did not move, so current_position still accurate - const float total[XYZE] = { - rtarget[X_AXIS] - current_position[X_AXIS], - rtarget[Y_AXIS] - current_position[Y_AXIS], - rtarget[Z_AXIS] - current_position[Z_AXIS], - rtarget[E_AXIS] - current_position[E_AXIS] - }; + const xyze_pos_t total = destination - current_position; - const float cartesian_xy_mm = HYPOT(total[X_AXIS], total[Y_AXIS]); // total horizontal xy distance + const float cart_xy_mm_2 = HYPOT2(total.x, total.y), + cart_xy_mm = SQRT(cart_xy_mm_2); // Total XY distance #if IS_KINEMATIC - const float seconds = cartesian_xy_mm / feedrate; // seconds to move xy distance at requested rate - uint16_t segments = LROUND(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate - seglimit = LROUND(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length - NOMORE(segments, seglimit); // limit to minimum segment length (fewer segments) + const float seconds = cart_xy_mm / scaled_fr_mm_s; // Duration of XY move at requested rate + uint16_t segments = LROUND(delta_segments_per_second * seconds), // Preferred number of segments for distance @ feedrate + seglimit = LROUND(cart_xy_mm * RECIPROCAL(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 = LROUND(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length + uint16_t segments = LROUND(cart_xy_mm * RECIPROCAL(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, 1U); // Must have at least one segment + const float inv_segments = 1.0f / segments, // Reciprocal to save calculation + segment_xyz_mm = SQRT(cart_xy_mm_2 + sq(total.z)) * inv_segments; // Length of each segment - const float segment_xyz_mm = HYPOT(cartesian_xy_mm, total[Z_AXIS]) * inv_segments; // length of each segment #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = feedrate / segment_xyz_mm; + const float inv_duration = scaled_fr_mm_s / segment_xyz_mm; #endif - const float diff[XYZE] = { - total[X_AXIS] * inv_segments, - total[Y_AXIS] * inv_segments, - total[Z_AXIS] * inv_segments, - total[E_AXIS] * inv_segments - }; + xyze_float_t diff = total * inv_segments; // Note that E segment distance could vary slightly as z mesh height // changes for each segment, but small enough to ignore. - float raw[XYZE] = { - current_position[X_AXIS], - current_position[Y_AXIS], - current_position[Z_AXIS], - current_position[E_AXIS] - }; + xyze_pos_t raw = current_position; - // Only compute leveling per segment if ubl active and target below z_fade_height. - if (!planner.leveling_active || !planner.leveling_active_at_z(rtarget[Z_AXIS])) { // no mesh leveling + // Just do plain segmentation if UBL is inactive or the target is above the fade height + if (!planner.leveling_active || !planner.leveling_active_at_z(destination.z)) { while (--segments) { - LOOP_XYZE(i) raw[i] += diff[i]; - planner.buffer_line(raw, feedrate, active_extruder, segment_xyz_mm + raw += diff; + planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, segment_xyz_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif ); } - planner.buffer_line(rtarget, feedrate, active_extruder, segment_xyz_mm + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder, segment_xyz_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif ); - return false; // moved but did not set_current_from_destination(); + return false; // Did not set current from destination } // Otherwise perform per-segment leveling #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = planner.fade_scaling_factor_for_z(rtarget[Z_AXIS]); + const float fade_scaling_factor = planner.fade_scaling_factor_for_z(destination.z); #endif - // increment to first segment destination - LOOP_XYZE(i) raw[i] += diff[i]; + // Move to first segment destination + raw += diff; for (;;) { // for each mesh cell encountered during the move @@ -440,76 +402,68 @@ // 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)); - - cell_xi = constrain(cell_xi, 0, (GRID_MAX_POINTS_X) - 1); - cell_yi = constrain(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1); + xy_int8_t icell = { + int8_t((raw.x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST)), + int8_t((raw.y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST)) + }; + LIMIT(icell.x, 0, (GRID_MAX_POINTS_X) - 1); + LIMIT(icell.y, 0, (GRID_MAX_POINTS_Y) - 1); - const float x0 = mesh_index_to_xpos(cell_xi), // 64 byte table lookup avoids mul+add - y0 = mesh_index_to_ypos(cell_yi); - - float z_x0y0 = z_values[cell_xi ][cell_yi ], // z at lower left corner - z_x1y0 = z_values[cell_xi+1][cell_yi ], // z at upper left corner - z_x0y1 = z_values[cell_xi ][cell_yi+1], // z at lower right corner - z_x1y1 = z_values[cell_xi+1][cell_yi+1]; // z at upper right corner + float z_x0y0 = z_values[icell.x ][icell.y ], // z at lower left corner + z_x1y0 = z_values[icell.x+1][icell.y ], // z at upper left corner + z_x0y1 = z_values[icell.x ][icell.y+1], // z at lower right corner + z_x1y1 = z_values[icell.x+1][icell.y+1]; // z at upper right corner if (isnan(z_x0y0)) z_x0y0 = 0; // ideally activating planner.leveling_active (G29 A) if (isnan(z_x1y0)) z_x1y0 = 0; // should refuse if any invalid mesh points if (isnan(z_x0y1)) z_x0y1 = 0; // in order to avoid isnan tests per cell, if (isnan(z_x1y1)) z_x1y1 = 0; // thus guessing zero for undefined points - float cx = raw[X_AXIS] - x0, // cell-relative x and y - cy = raw[Y_AXIS] - y0; + const xy_pos_t pos = { mesh_index_to_xpos(icell.x), mesh_index_to_ypos(icell.y) }; + xy_pos_t cell = raw - pos; - 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) * RECIPROCAL(MESH_X_DIST), // z slope per x along y0 (lower left to lower right) + z_xmy1 = (z_x1y1 - z_x0y1) * RECIPROCAL(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) + float z_cxy0 = z_x0y0 + z_xmy0 * cell.x; // z height along y0 at cell.x (changes for each cell.x 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 + const float z_cxy1 = z_x0y1 + z_xmy1 * cell.x, // z height along y1 at cell.x + z_cxyd = z_cxy1 - z_cxy0; // z height difference along cell.x 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 * RECIPROCAL(MESH_Y_DIST); // z slope per y along cell.x from pos.y to y1 (changes for each cell.x in cell) - // float z_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop) + // float z_cxcy = z_cxy0 + z_cxym * cell.y; // interpolated mesh z height along cell.x at cell.y (do inside the segment loop) // As subsequent segments step through this cell, the z_cxy0 intercept will change - // and the z_cxym slope will change, both as a function of cx within the cell, and + // and the z_cxym slope will change, both as a function of cell.x within the cell, and // 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 + const float z_sxy0 = z_xmy0 * diff.x, // per-segment adjustment to z_cxy0 + z_sxym = (z_xmy1 - z_xmy0) * RECIPROCAL(MESH_Y_DIST) * diff.x; // per-segment adjustment to z_cxym for (;;) { // for all segments within this mesh cell - if (--segments == 0) // if this is last segment, use rtarget for exact - COPY(raw, rtarget); + if (--segments == 0) raw = destination; // if this is last segment, use destination for exact - const float z_cxcy = (z_cxy0 + z_cxym * cy) // interpolated mesh z height along cx at cy + const float z_cxcy = (z_cxy0 + z_cxym * cell.y) // interpolated mesh z height along cell.x at cell.y #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) * fade_scaling_factor // apply fade factor to interpolated mesh height #endif ; - const float z = raw[Z_AXIS]; - raw[Z_AXIS] += z_cxcy; - planner.buffer_line(raw, feedrate, active_extruder, segment_xyz_mm + planner.buffer_line(raw.x, raw.y, raw.z + z_cxcy, raw.e, scaled_fr_mm_s, active_extruder, segment_xyz_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif ); - raw[Z_AXIS] = z; if (segments == 0) // done with last segment - return false; // did not set_current_from_destination() - - LOOP_XYZE(i) raw[i] += diff[i]; + return false; // didn't set current from destination - cx += diff[X_AXIS]; - cy += diff[Y_AXIS]; + raw += diff; + cell += diff; - if (!WITHIN(cx, 0, MESH_X_DIST) || !WITHIN(cy, 0, MESH_Y_DIST)) // done within this cell, break to next + if (!WITHIN(cell.x, 0, MESH_X_DIST) || !WITHIN(cell.y, 0, MESH_Y_DIST)) // done within this cell, break to next break; // Next segment still within same mesh cell, adjust the per-segment diff --git a/Marlin/src/feature/binary_protocol.cpp b/Marlin/src/feature/binary_protocol.cpp new file mode 100644 index 000000000000..81ccbfbe32e4 --- /dev/null +++ b/Marlin/src/feature/binary_protocol.cpp @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../inc/MarlinConfigPre.h" + +#if ENABLED(BINARY_FILE_TRANSFER) + +#include "../sd/cardreader.h" +#include "binary_protocol.h" + +char* SDFileTransferProtocol::Packet::Open::data = nullptr; +size_t SDFileTransferProtocol::data_waiting, SDFileTransferProtocol::transfer_timeout, SDFileTransferProtocol::idle_timeout; +bool SDFileTransferProtocol::transfer_active, SDFileTransferProtocol::dummy_transfer, SDFileTransferProtocol::compression; + +BinaryStream binaryStream[NUM_SERIAL]; + +#endif // BINARY_FILE_TRANSFER diff --git a/Marlin/src/feature/binary_protocol.h b/Marlin/src/feature/binary_protocol.h new file mode 100644 index 000000000000..0025fbe13809 --- /dev/null +++ b/Marlin/src/feature/binary_protocol.h @@ -0,0 +1,480 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include "../inc/MarlinConfig.h" + +#define BINARY_STREAM_COMPRESSION + +#if ENABLED(BINARY_STREAM_COMPRESSION) + #include "../libs/heatshrink/heatshrink_decoder.h" +#endif + +inline bool bs_serial_data_available(const uint8_t index) { + switch (index) { + case 0: return MYSERIAL0.available(); + #if NUM_SERIAL > 1 + case 1: return MYSERIAL1.available(); + #endif + } + return false; +} + +inline int bs_read_serial(const uint8_t index) { + switch (index) { + case 0: return MYSERIAL0.read(); + #if NUM_SERIAL > 1 + case 1: return MYSERIAL1.read(); + #endif + } + return -1; +} + +#if ENABLED(BINARY_STREAM_COMPRESSION) + static heatshrink_decoder hsd; + static uint8_t decode_buffer[512] = {}; +#endif + +class SDFileTransferProtocol { +private: + struct Packet { + struct [[gnu::packed]] Open { + static bool validate(char* buffer, size_t length) { + return (length > sizeof(Open) && buffer[length - 1] == '\0'); + } + static Open& decode(char* buffer) { + data = &buffer[2]; + return *reinterpret_cast(buffer); + } + bool compression_enabled() { return compression & 0x1; } + bool dummy_transfer() { return dummy & 0x1; } + static char* filename() { return data; } + private: + uint8_t dummy, compression; + static char* data; // variable length strings complicate things + }; + }; + + static bool file_open(char* filename) { + if (!dummy_transfer) { + card.mount(); + card.openFileWrite(filename); + if (!card.isFileOpen()) return false; + } + transfer_active = true; + data_waiting = 0; + #if ENABLED(BINARY_STREAM_COMPRESSION) + heatshrink_decoder_reset(&hsd); + #endif + return true; + } + + static bool file_write(char* buffer, const size_t length) { + #if ENABLED(BINARY_STREAM_COMPRESSION) + if (compression) { + size_t total_processed = 0, processed_count = 0; + HSD_poll_res presult; + + while (total_processed < length) { + heatshrink_decoder_sink(&hsd, reinterpret_cast(&buffer[total_processed]), length - total_processed, &processed_count); + total_processed += processed_count; + do { + presult = heatshrink_decoder_poll(&hsd, &decode_buffer[data_waiting], sizeof(decode_buffer) - data_waiting, &processed_count); + data_waiting += processed_count; + if (data_waiting == sizeof(decode_buffer)) { + if (!dummy_transfer) + if (card.write(decode_buffer, data_waiting) < 0) { + return false; + } + data_waiting = 0; + } + } while (presult == HSDR_POLL_MORE); + } + return true; + } + #endif + return (dummy_transfer || card.write(buffer, length) >= 0); + } + + static bool file_close() { + if (!dummy_transfer) { + #if ENABLED(BINARY_STREAM_COMPRESSION) + // flush any buffered data + if (data_waiting) { + if (card.write(decode_buffer, data_waiting) < 0) return false; + data_waiting = 0; + } + #endif + card.closefile(); + card.release(); + } + #if ENABLED(BINARY_STREAM_COMPRESSION) + heatshrink_decoder_finish(&hsd); + #endif + transfer_active = false; + return true; + } + + static void transfer_abort() { + if (!dummy_transfer) { + card.closefile(); + card.removeFile(card.filename); + card.release(); + #if ENABLED(BINARY_STREAM_COMPRESSION) + heatshrink_decoder_finish(&hsd); + #endif + } + transfer_active = false; + return; + } + + enum class FileTransfer : uint8_t { QUERY, OPEN, CLOSE, WRITE, ABORT }; + + static size_t data_waiting, transfer_timeout, idle_timeout; + static bool transfer_active, dummy_transfer, compression; + +public: + + static void idle() { + // If a transfer is interrupted and a file is left open, abort it after TIMEOUT ms + const millis_t ms = millis(); + if (transfer_active && ELAPSED(ms, idle_timeout)) { + idle_timeout = ms + IDLE_PERIOD; + if (ELAPSED(ms, transfer_timeout)) transfer_abort(); + } + } + + static void process(uint8_t packet_type, char* buffer, const uint16_t length) { + transfer_timeout = millis() + TIMEOUT; + switch (static_cast(packet_type)) { + case FileTransfer::QUERY: + SERIAL_ECHOPAIR("PFT:version:", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH); + #if ENABLED(BINARY_STREAM_COMPRESSION) + SERIAL_ECHOLNPAIR(":compresion:heatshrink,", HEATSHRINK_STATIC_WINDOW_BITS, ",", HEATSHRINK_STATIC_LOOKAHEAD_BITS); + #else + SERIAL_ECHOLNPGM(":compresion:none"); + #endif + break; + case FileTransfer::OPEN: + if (transfer_active) + SERIAL_ECHOLNPGM("PFT:busy"); + else { + if (Packet::Open::validate(buffer, length)) { + auto packet = Packet::Open::decode(buffer); + compression = packet.compression_enabled(); + dummy_transfer = packet.dummy_transfer(); + if (file_open(packet.filename())) { + SERIAL_ECHOLNPGM("PFT:success"); + break; + } + } + SERIAL_ECHOLNPGM("PFT:fail"); + } + break; + case FileTransfer::CLOSE: + if (transfer_active) { + if (file_close()) + SERIAL_ECHOLNPGM("PFT:success"); + else + SERIAL_ECHOLNPGM("PFT:ioerror"); + } + else SERIAL_ECHOLNPGM("PFT:invalid"); + break; + case FileTransfer::WRITE: + if (!transfer_active) + SERIAL_ECHOLNPGM("PFT:invalid"); + else if (!file_write(buffer, length)) + SERIAL_ECHOLNPGM("PFT:ioerror"); + break; + case FileTransfer::ABORT: + transfer_abort(); + SERIAL_ECHOLNPGM("PFT:success"); + break; + default: + SERIAL_ECHOLNPGM("PTF:invalid"); + break; + } + } + + static const uint16_t VERSION_MAJOR = 0, VERSION_MINOR = 1, VERSION_PATCH = 0, TIMEOUT = 10000, IDLE_PERIOD = 1000; +}; + +class BinaryStream { +public: + enum class Protocol : uint8_t { CONTROL, FILE_TRANSFER }; + + enum class ProtocolControl : uint8_t { SYNC = 1, CLOSE }; + + enum class StreamState : uint8_t { PACKET_RESET, PACKET_WAIT, PACKET_HEADER, PACKET_DATA, PACKET_FOOTER, + PACKET_PROCESS, PACKET_RESEND, PACKET_TIMEOUT, PACKET_ERROR }; + + struct Packet { // 10 byte protocol overhead, ascii with checksum and line number has a minimum of 7 increasing with line + + union Header { + static constexpr uint16_t HEADER_TOKEN = 0xB5AD; + struct [[gnu::packed]] { + uint16_t token; // packet start token + uint8_t sync; // stream sync, resend id and packet loss detection + uint8_t meta; // 4 bit protocol, + // 4 bit packet type + uint16_t size; // data length + uint16_t checksum; // header checksum + }; + uint8_t protocol() { return (meta >> 4) & 0xF; } + uint8_t type() { return meta & 0xF; } + void reset() { token = 0; sync = 0; meta = 0; size = 0; checksum = 0; } + uint8_t data[1]; + }; + + union Footer { + struct [[gnu::packed]] { + uint16_t checksum; // full packet checksum + }; + void reset() { checksum = 0; } + uint8_t data[1]; + }; + + Header header; + Footer footer; + uint32_t bytes_received; + uint16_t checksum, header_checksum; + millis_t timeout; + char* buffer; + + void reset() { + header.reset(); + footer.reset(); + bytes_received = 0; + checksum = 0; + header_checksum = 0; + timeout = millis() + PACKET_MAX_WAIT; + buffer = nullptr; + } + } packet{}; + + void reset() { + sync = 0; + packet_retries = 0; + buffer_next_index = 0; + } + + // fletchers 16 checksum + uint32_t checksum(uint32_t cs, uint8_t value) { + uint16_t cs_low = (((cs & 0xFF) + value) % 255); + return ((((cs >> 8) + cs_low) % 255) << 8) | cs_low; + } + + // read the next byte from the data stream keeping track of + // whether the stream times out from data starvation + // takes the data variable by reference in order to return status + bool stream_read(uint8_t& data) { + if (stream_state != StreamState::PACKET_WAIT && ELAPSED(millis(), packet.timeout)) { + stream_state = StreamState::PACKET_TIMEOUT; + return false; + } + if (!bs_serial_data_available(card.transfer_port_index)) return false; + data = bs_read_serial(card.transfer_port_index); + packet.timeout = millis() + PACKET_MAX_WAIT; + return true; + } + + template + void receive(char (&buffer)[buffer_size]) { + uint8_t data = 0; + millis_t transfer_window = millis() + RX_TIMESLICE; + + #if ENABLED(SDSUPPORT) + PORT_REDIRECT(card.transfer_port_index); + #endif + + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Warray-bounds" + + while (PENDING(millis(), transfer_window)) { + switch (stream_state) { + /** + * Data stream packet handling + */ + case StreamState::PACKET_RESET: + packet.reset(); + stream_state = StreamState::PACKET_WAIT; + case StreamState::PACKET_WAIT: + if (!stream_read(data)) { idle(); return; } // no active packet so don't wait + packet.header.data[1] = data; + if (packet.header.token == packet.header.HEADER_TOKEN) { + packet.bytes_received = 2; + stream_state = StreamState::PACKET_HEADER; + } + else { + // stream corruption drop data + packet.header.data[0] = data; + } + break; + case StreamState::PACKET_HEADER: + if (!stream_read(data)) break; + + packet.header.data[packet.bytes_received++] = data; + packet.checksum = checksum(packet.checksum, data); + + // header checksum calculation can't contain the checksum + if (packet.bytes_received == sizeof(Packet::header) - 2) + packet.header_checksum = packet.checksum; + + if (packet.bytes_received == sizeof(Packet::header)) { + if (packet.header.checksum == packet.header_checksum) { + // The SYNC control packet is a special case in that it doesn't require the stream sync to be correct + if (static_cast(packet.header.protocol()) == Protocol::CONTROL && static_cast(packet.header.type()) == ProtocolControl::SYNC) { + SERIAL_ECHOLNPAIR("ss", sync, ",", buffer_size, ",", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH); + stream_state = StreamState::PACKET_RESET; + break; + } + if (packet.header.sync == sync) { + buffer_next_index = 0; + packet.bytes_received = 0; + if (packet.header.size) { + stream_state = StreamState::PACKET_DATA; + packet.buffer = static_cast(&buffer[0]); // multipacket buffering not implemented, always allocate whole buffer to packet + } + else + stream_state = StreamState::PACKET_PROCESS; + } + else if (packet.header.sync == sync - 1) { // ok response must have been lost + SERIAL_ECHOLNPAIR("ok", packet.header.sync); // transmit valid packet received and drop the payload + stream_state = StreamState::PACKET_RESET; + } + else if (packet_retries) { + stream_state = StreamState::PACKET_RESET; // could be packets already buffered on flow controlled connections, drop them without ack + } + else { + SERIAL_ECHO_MSG("Datastream packet out of order"); + stream_state = StreamState::PACKET_RESEND; + } + } + else { + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("Packet header(", packet.header.sync, "?) corrupt"); + stream_state = StreamState::PACKET_RESEND; + } + } + break; + case StreamState::PACKET_DATA: + if (!stream_read(data)) break; + + if (buffer_next_index < buffer_size) + packet.buffer[buffer_next_index] = data; + else { + SERIAL_ECHO_MSG("Datastream packet data buffer overrun"); + stream_state = StreamState::PACKET_ERROR; + break; + } + + packet.checksum = checksum(packet.checksum, data); + packet.bytes_received++; + buffer_next_index++; + + if (packet.bytes_received == packet.header.size) { + stream_state = StreamState::PACKET_FOOTER; + packet.bytes_received = 0; + } + break; + case StreamState::PACKET_FOOTER: + if (!stream_read(data)) break; + + packet.footer.data[packet.bytes_received++] = data; + if (packet.bytes_received == sizeof(Packet::footer)) { + if (packet.footer.checksum == packet.checksum) { + stream_state = StreamState::PACKET_PROCESS; + } + else { + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("Packet(", packet.header.sync, ") payload corrupt"); + stream_state = StreamState::PACKET_RESEND; + } + } + break; + case StreamState::PACKET_PROCESS: + sync++; + packet_retries = 0; + bytes_received += packet.header.size; + + SERIAL_ECHOLNPAIR("ok", packet.header.sync); // transmit valid packet received + dispatch(); + stream_state = StreamState::PACKET_RESET; + break; + case StreamState::PACKET_RESEND: + if (packet_retries < MAX_RETRIES || MAX_RETRIES == 0) { + packet_retries++; + stream_state = StreamState::PACKET_RESET; + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("Resend request ", int(packet_retries)); + SERIAL_ECHOLNPAIR("rs", sync); + } + else + stream_state = StreamState::PACKET_ERROR; + break; + case StreamState::PACKET_TIMEOUT: + SERIAL_ECHO_MSG("Datastream timeout"); + stream_state = StreamState::PACKET_RESEND; + break; + case StreamState::PACKET_ERROR: + SERIAL_ECHOLNPAIR("fe", packet.header.sync); + reset(); // reset everything, resync required + stream_state = StreamState::PACKET_RESET; + break; + } + } + + #pragma GCC diagnostic pop + } + + void dispatch() { + switch(static_cast(packet.header.protocol())) { + case Protocol::CONTROL: + switch(static_cast(packet.header.type())) { + case ProtocolControl::CLOSE: // revert back to ASCII mode + card.flag.binary_mode = false; + break; + default: + SERIAL_ECHO_MSG("Unknown BinaryProtocolControl Packet"); + } + break; + case Protocol::FILE_TRANSFER: + SDFileTransferProtocol::process(packet.header.type(), packet.buffer, packet.header.size); // send user data to be processed + break; + default: + SERIAL_ECHO_MSG("Unsupported Binary Protocol"); + } + } + + void idle() { + // Some Protocols may need periodic updates without new data + SDFileTransferProtocol::idle(); + } + + static const uint16_t PACKET_MAX_WAIT = 500, RX_TIMESLICE = 20, MAX_RETRIES = 0, VERSION_MAJOR = 0, VERSION_MINOR = 1, VERSION_PATCH = 0; + uint8_t packet_retries, sync; + uint16_t buffer_next_index; + uint32_t bytes_received; + StreamState stream_state = StreamState::PACKET_RESET; +}; + +extern BinaryStream binaryStream[NUM_SERIAL]; diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index b768fc3e80e5..64c052269b72 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -110,19 +110,19 @@ bool BLTouch::triggered() { bool BLTouch::deploy_proc() { // Do a DEPLOY - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch DEPLOY requested"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch DEPLOY requested"); // Attempt to DEPLOY, wait for DEPLOY_DELAY or ALARM if (_deploy_query_alarm()) { // The deploy might have failed or the probe is already triggered (nozzle too low?) - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch ALARM or TRIGGER after DEPLOY, recovering"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch ALARM or TRIGGER after DEPLOY, recovering"); clear(); // Get the probe into start condition // Last attempt to DEPLOY if (_deploy_query_alarm()) { // The deploy might have failed or the probe is actually triggered (nozzle too low?) again - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch Recovery Failed"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed"); SERIAL_ERROR_MSG(MSG_STOP_BLTOUCH); // Tell the user something is wrong, needs action stop(); // but it's not too bad, no need to kill, allow restart @@ -140,14 +140,14 @@ bool BLTouch::deploy_proc() { // The trigger STOW (see motion.cpp for example) will pull up the probes pin as soon as the pulse // is registered. - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("bltouch.deploy_proc() end"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("bltouch.deploy_proc() end"); return false; // report success to caller } bool BLTouch::stow_proc() { // Do a STOW - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch STOW requested"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch STOW requested"); // A STOW will clear a triggered condition in the probe (10ms pulse). // At the moment that we come in here, we might (pulse) or will (SW mode) see the trigger on the pin. @@ -158,7 +158,7 @@ bool BLTouch::stow_proc() { // Attempt to STOW, wait for STOW_DELAY or ALARM if (_stow_query_alarm()) { // The stow might have failed - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch ALARM or TRIGGER after STOW, recovering"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch ALARM or TRIGGER after STOW, recovering"); _reset(); // This RESET will then also pull up the pin. If it doesn't // work and the pin is still down, there will no longer be @@ -167,7 +167,7 @@ bool BLTouch::stow_proc() { // Last attempt to STOW if (_stow_query_alarm()) { // so if there is now STILL an ALARM condition: - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch Recovery Failed"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed"); SERIAL_ERROR_MSG(MSG_STOP_BLTOUCH); // Tell the user something is wrong, needs action stop(); // but it's not too bad, no need to kill, allow restart @@ -176,7 +176,7 @@ bool BLTouch::stow_proc() { } } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("bltouch.stow_proc() end"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("bltouch.stow_proc() end"); return false; // report success to caller } @@ -187,7 +187,7 @@ bool BLTouch::status_proc() { * This function will ensure switch state is reset after execution */ - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch STATUS requested"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch STATUS requested"); _set_SW_mode(); // Incidentally, _set_SW_mode() will also RESET any active alarm const bool tr = triggered(); // If triggered in SW mode, the pin is up, it is STOWED diff --git a/Marlin/src/feature/cancel_object.cpp b/Marlin/src/feature/cancel_object.cpp new file mode 100644 index 000000000000..a066815e85e0 --- /dev/null +++ b/Marlin/src/feature/cancel_object.cpp @@ -0,0 +1,83 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../inc/MarlinConfig.h" + +#if ENABLED(CANCEL_OBJECTS) + +#include "cancel_object.h" +#include "../gcode/gcode.h" +#include "../lcd/ultralcd.h" + +CancelObject cancelable; + +int8_t CancelObject::object_count, // = 0 + CancelObject::active_object = -1; +uint32_t CancelObject::canceled; // = 0x0000 +bool CancelObject::skipping; // = false + +void CancelObject::set_active_object(const int8_t obj) { + active_object = obj; + if (WITHIN(obj, 0, 31)) { + if (obj >= object_count) object_count = obj + 1; + skipping = TEST(canceled, obj); + } + else + skipping = false; + + #if HAS_DISPLAY + if (active_object >= 0) + ui.status_printf_P(0, PSTR(S_FMT " %i"), GET_TEXT(MSG_PRINTING_OBJECT), int(active_object + 1)); + else + ui.reset_status(); + #endif +} + +void CancelObject::cancel_object(const int8_t obj) { + if (WITHIN(obj, 0, 31)) { + SBI(canceled, obj); + if (obj == active_object) skipping = true; + } +} + +void CancelObject::uncancel_object(const int8_t obj) { + if (WITHIN(obj, 0, 31)) { + CBI(canceled, obj); + if (obj == active_object) skipping = false; + } +} + +void CancelObject::report() { + if (active_object >= 0) { + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("Active Object: ", int(active_object)); + } + + if (canceled) { + SERIAL_ECHO_START(); + SERIAL_ECHOPGM("Canceled:"); + for (int i = 0; i < object_count; i++) + if (TEST(canceled, i)) { SERIAL_CHAR(' '); SERIAL_ECHO(i); } + SERIAL_EOL(); + } +} + +#endif // CANCEL_OBJECTS diff --git a/Marlin/src/feature/cancel_object.h b/Marlin/src/feature/cancel_object.h new file mode 100644 index 000000000000..f32283b46dd3 --- /dev/null +++ b/Marlin/src/feature/cancel_object.h @@ -0,0 +1,41 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include + +class CancelObject { +public: + static bool skipping; + static int8_t object_count, active_object; + static uint32_t canceled; + static void set_active_object(const int8_t obj); + static void cancel_object(const int8_t obj); + static void uncancel_object(const int8_t obj); + static void report(); + static inline bool is_canceled(const int8_t obj) { return TEST(canceled, obj); } + static inline void clear_active_object() { set_active_object(-1); } + static inline void cancel_active_object() { cancel_object(active_object); } + static inline void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); } +}; + +extern CancelObject cancelable; diff --git a/Marlin/src/feature/caselight.cpp b/Marlin/src/feature/caselight.cpp index 81eb4aaac4c7..8c58d8452abd 100644 --- a/Marlin/src/feature/caselight.cpp +++ b/Marlin/src/feature/caselight.cpp @@ -71,7 +71,13 @@ void update_case_light() { #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) if (PWM_PIN(CASE_LIGHT_PIN)) - analogWrite(pin_t(CASE_LIGHT_PIN), n10ct); + analogWrite(pin_t(CASE_LIGHT_PIN), + #if CASE_LIGHT_MAX_PWM == 255 + n10ct + #else + map(n10ct, 0, 255, 0, CASE_LIGHT_MAX_PWM) + #endif + ); else #endif { diff --git a/Marlin/src/feature/controllerfan.cpp b/Marlin/src/feature/controllerfan.cpp index a75f4d982218..7e4312bab193 100644 --- a/Marlin/src/feature/controllerfan.cpp +++ b/Marlin/src/feature/controllerfan.cpp @@ -24,7 +24,7 @@ #if ENABLED(USE_CONTROLLER_FAN) -#include "../module/stepper_indirection.h" +#include "../module/stepper/indirection.h" #include "../module/temperature.h" uint8_t controllerfan_speed; @@ -36,52 +36,45 @@ void controllerfan_update() { if (ELAPSED(ms, nextMotorCheck)) { nextMotorCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s + const bool xory = X_ENABLE_READ() == X_ENABLE_ON || Y_ENABLE_READ() == Y_ENABLE_ON; + // 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 (xory || Z_ENABLE_READ() == Z_ENABLE_ON #if HAS_HEATED_BED || thermalManager.temp_bed.soft_pwm_amount > 0 #endif #if HAS_X2_ENABLE - || X2_ENABLE_READ == X_ENABLE_ON + || X2_ENABLE_READ() == X_ENABLE_ON #endif #if HAS_Y2_ENABLE - || Y2_ENABLE_READ == Y_ENABLE_ON + || Y2_ENABLE_READ() == Y_ENABLE_ON #endif #if HAS_Z2_ENABLE - || Z2_ENABLE_READ == Z_ENABLE_ON + || Z2_ENABLE_READ() == Z_ENABLE_ON #endif #if HAS_Z3_ENABLE - || Z3_ENABLE_READ == Z_ENABLE_ON + || Z3_ENABLE_READ() == Z_ENABLE_ON #endif #if E_STEPPERS - || E0_ENABLE_READ == E_ENABLE_ON - #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 - #if E_STEPPERS > 5 - || E5_ENABLE_READ == E_ENABLE_ON - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - #endif // E_STEPPERS + #define _OR_ENABLED_E(N) || E##N##_ENABLE_READ() == E_ENABLE_ON + REPEAT(E_STEPPERS, _OR_ENABLED_E) + #endif ) { lastMotorOn = ms; //... set time to NOW so the fan will turn on } // Fan off if no steppers have been enabled for CONTROLLERFAN_SECS seconds - uint8_t speed = (!lastMotorOn || ELAPSED(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? 0 : CONTROLLERFAN_SPEED; - controllerfan_speed = speed; + controllerfan_speed = (!lastMotorOn || ELAPSED(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? 0 : ( + #ifdef CONTROLLERFAN_SPEED_Z_ONLY + xory ? CONTROLLERFAN_SPEED : CONTROLLERFAN_SPEED_Z_ONLY + #else + CONTROLLERFAN_SPEED + #endif + ); - // allows digital or PWM fan output to be used (see M42 handling) - WRITE(CONTROLLER_FAN_PIN, speed); - analogWrite(pin_t(CONTROLLER_FAN_PIN), speed); + // Allow digital or PWM fan output (see M42 handling) + WRITE(CONTROLLER_FAN_PIN, controllerfan_speed); + analogWrite(pin_t(CONTROLLER_FAN_PIN), controllerfan_speed); } } diff --git a/Marlin/src/feature/dac/dac_dac084s085.h b/Marlin/src/feature/dac/dac_dac084s085.h index 80d7869ab6d1..09d5bb857d54 100644 --- a/Marlin/src/feature/dac/dac_dac084s085.h +++ b/Marlin/src/feature/dac/dac_dac084s085.h @@ -24,7 +24,7 @@ class dac084s085 { public: dac084s085(); - static void begin(void); + static void begin(); static void setValue(const uint8_t channel, const uint8_t value); private: static void cshigh(); diff --git a/Marlin/src/feature/dac/dac_mcp4728.cpp b/Marlin/src/feature/dac/dac_mcp4728.cpp index cfe36dd39f81..19f8d5f64302 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.cpp +++ b/Marlin/src/feature/dac/dac_mcp4728.cpp @@ -36,7 +36,7 @@ #include "dac_mcp4728.h" -uint16_t mcp4728_values[XYZE]; +xyze_uint_t mcp4728_values; /** * Begin I2C, get current values (input register and eeprom) of mcp4728 @@ -121,8 +121,8 @@ uint8_t mcp4728_getDrvPct(const uint8_t channel) { return uint8_t(100.0 * mcp472 * Receives all Drive strengths as 0-100 percent values, updates * DAC Values array and calls fastwrite to update the DAC. */ -void mcp4728_setDrvPct(uint8_t pct[XYZE]) { - LOOP_XYZE(i) mcp4728_values[i] = 0.01 * pct[i] * (DAC_STEPPER_MAX); +void mcp4728_setDrvPct(xyze_uint8_t &pct) { + mcp4728_values *= 0.01 * pct * (DAC_STEPPER_MAX); mcp4728_fastWrite(); } diff --git a/Marlin/src/feature/dac/dac_mcp4728.h b/Marlin/src/feature/dac/dac_mcp4728.h index c814829456a3..92e28ffb2bab 100644 --- a/Marlin/src/feature/dac/dac_mcp4728.h +++ b/Marlin/src/feature/dac/dac_mcp4728.h @@ -25,6 +25,8 @@ * Arduino library for MicroChip MCP4728 I2C D/A converter. */ +#include "../../core/types.h" + #include #define defaultVDD DAC_STEPPER_MAX //was 5000 but differs with internal Vref @@ -54,4 +56,4 @@ uint16_t mcp4728_getValue(const uint8_t channel); uint8_t mcp4728_fastWrite(); uint8_t mcp4728_simpleCommand(const byte simpleCommand); uint8_t mcp4728_getDrvPct(const uint8_t channel); -void mcp4728_setDrvPct(uint8_t pct[XYZE]); +void mcp4728_setDrvPct(xyze_uint8_t &pct); diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index de497fdacd00..565b62a3921b 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -31,8 +31,8 @@ #include "stepper_dac.h" bool dac_present = false; -const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER; -uint8_t dac_channel_pct[XYZE] = DAC_MOTOR_CURRENT_DEFAULT; +constexpr xyze_uint8_t dac_order = DAC_STEPPER_ORDER; +xyze_uint8_t dac_channel_pct = DAC_MOTOR_CURRENT_DEFAULT; int dac_init() { #if PIN_EXISTS(DAC_DISABLE) @@ -74,11 +74,11 @@ void dac_current_raw(uint8_t channel, uint16_t val) { mcp4728_simpleCommand(UPDATE); } -static float dac_perc(int8_t n) { return 100.0 * 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]) * RECIPROCAL(DAC_STEPPER_MAX); } +static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE); } -uint8_t dac_current_get_percent(AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } -void dac_current_set_percents(const uint8_t pct[XYZE]) { +uint8_t dac_current_get_percent(const AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } +void dac_current_set_percents(xyze_uint8_t &pct) { LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]]; mcp4728_setDrvPct(dac_channel_pct); } diff --git a/Marlin/src/feature/dac/stepper_dac.h b/Marlin/src/feature/dac/stepper_dac.h index 8ad51ee78164..3496ebec4897 100644 --- a/Marlin/src/feature/dac/stepper_dac.h +++ b/Marlin/src/feature/dac/stepper_dac.h @@ -33,4 +33,4 @@ void dac_current_raw(uint8_t channel, uint16_t val); void dac_print_values(); void dac_commit_eeprom(); uint8_t dac_current_get_percent(AxisEnum axis); -void dac_current_set_percents(const uint8_t pct[XYZE]); +void dac_current_set_percents(xyze_uint8_t &pct); diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 91a64d54323a..86eeab63b481 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -24,7 +24,6 @@ #if BOTH(DIGIPOT_I2C, DIGIPOT_MCP4018) -#include "../../core/enum.h" #include "Stream.h" #include "utility/twi.h" #include //https://github.com/stawel/SlowSoftI2CMaster diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 61140d81b5e9..b04406f4be7f 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -35,7 +35,7 @@ #if MB(5DPRINT) #define DIGIPOT_I2C_FACTOR 117.96 #define DIGIPOT_I2C_MAX_CURRENT 1.736 -#elif MB(AZTEEG_X5_MINI) || MB(AZTEEG_X5_MINI_WIFI) +#elif MB(AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) #define DIGIPOT_I2C_FACTOR 113.5 #define DIGIPOT_I2C_MAX_CURRENT 2.0 #else @@ -72,7 +72,7 @@ void digipot_i2c_set_current(const uint8_t channel, const float current) { // Set actual wiper value byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 }; - i2c_send(addr, addresses[channel & 0x3], current_to_wiper(MIN((float) _MAX(current, 0), DIGIPOT_I2C_MAX_CURRENT))); + i2c_send(addr, addresses[channel & 0x3], current_to_wiper(_MIN(float(_MAX(current, 0)), DIGIPOT_I2C_MAX_CURRENT))); } void digipot_i2c_init() { diff --git a/Marlin/src/feature/emergency_parser.h b/Marlin/src/feature/emergency_parser.h index dadd67715496..e9ce0f664508 100644 --- a/Marlin/src/feature/emergency_parser.h +++ b/Marlin/src/feature/emergency_parser.h @@ -25,7 +25,7 @@ * emergency_parser.h - Intercept special commands directly in the serial stream */ -#define FORCE_INLINE __attribute__((always_inline)) inline +#include "../inc/MarlinConfigPre.h" #if ENABLED(HOST_PROMPT_SUPPORT) #include "host_actions.h" diff --git a/Marlin/src/feature/fanmux.cpp b/Marlin/src/feature/fanmux.cpp index 7b293acbf856..6c7b56ac5446 100644 --- a/Marlin/src/feature/fanmux.cpp +++ b/Marlin/src/feature/fanmux.cpp @@ -41,7 +41,7 @@ void fanmux_switch(const uint8_t e) { #endif } -void fanmux_init(void) { +void fanmux_init() { SET_OUTPUT(FANMUX0_PIN); #if PIN_EXISTS(FANMUX1) SET_OUTPUT(FANMUX1_PIN); diff --git a/Marlin/src/feature/fanmux.h b/Marlin/src/feature/fanmux.h index 517e7bfd5717..492b9fd7858d 100644 --- a/Marlin/src/feature/fanmux.h +++ b/Marlin/src/feature/fanmux.h @@ -26,4 +26,4 @@ */ extern void fanmux_switch(const uint8_t e); -extern void fanmux_init(void); +extern void fanmux_init(); diff --git a/Marlin/src/feature/filwidth.cpp b/Marlin/src/feature/filwidth.cpp index ec90f3adf025..fb685bddc1f6 100644 --- a/Marlin/src/feature/filwidth.cpp +++ b/Marlin/src/feature/filwidth.cpp @@ -26,11 +26,24 @@ #include "filwidth.h" -bool filament_sensor; // = false; // M405/M406 turns filament sensor control ON/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 -int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delayed measurement. Store extruder factor after subtracting 100 - filwidth_delay_index[2] = { 0, -1 }; // Indexes into ring buffer +FilamentWidthSensor filwidth; + +bool FilamentWidthSensor::enabled; // = false; // (M405-M406) Filament Width Sensor ON/OFF. +uint32_t FilamentWidthSensor::accum; // = 0 // ADC accumulator +uint16_t FilamentWidthSensor::raw; // = 0 // Measured filament diameter - one extruder only +float FilamentWidthSensor::nominal_mm = DEFAULT_NOMINAL_FILAMENT_DIA, // (M104) Nominal filament width + FilamentWidthSensor::measured_mm = DEFAULT_MEASURED_FILAMENT_DIA, // Measured filament diameter + FilamentWidthSensor::e_count = 0, + FilamentWidthSensor::delay_dist = 0; +uint8_t FilamentWidthSensor::meas_delay_cm = MEASUREMENT_DELAY_CM; // Distance delay setting +int8_t FilamentWidthSensor::ratios[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delay measurement. (Extruder factor minus 100) + FilamentWidthSensor::index_r, // Indexes into ring buffer + FilamentWidthSensor::index_w; + +void FilamentWidthSensor::init() { + const int8_t ratio = sample_to_size_ratio(); + for (uint8_t i = 0; i < COUNT(ratios); ++i) ratios[i] = ratio; + index_r = index_w = 0; +} #endif // FILAMENT_WIDTH_SENSOR diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index 91122a8605b9..7255428fdf5d 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -22,10 +22,99 @@ #pragma once #include "../inc/MarlinConfig.h" +#include "../module/planner.h" +#include "../module/thermistor/thermistors.h" -extern bool filament_sensor; // M405/M406 turns filament sensor control ON/OFF. -extern float filament_width_nominal, // Nominal filament width. Change with M404. - filament_width_meas; // Measured filament diameter -extern uint8_t meas_delay_cm; // Distance delay setting -extern int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delayed measurement. Store extruder factor after subtracting 100 - filwidth_delay_index[2]; // Indexes into ring buffer +class FilamentWidthSensor { +public: + static constexpr int MMD_CM = MAX_MEASUREMENT_DELAY + 1, MMD_MM = MMD_CM * 10; + static bool enabled; // (M405-M406) Filament Width Sensor ON/OFF. + static uint32_t accum; // ADC accumulator + static uint16_t raw; // Measured filament diameter - one extruder only + static float nominal_mm, // (M104) Nominal filament width + measured_mm, // Measured filament diameter + e_count, delay_dist; + static uint8_t meas_delay_cm; // Distance delay setting + static int8_t ratios[MMD_CM], // Ring buffer to delay measurement. (Extruder factor minus 100) + index_r, index_w; // Indexes into ring buffer + + FilamentWidthSensor() { init(); } + static void init(); + + static inline void enable(const bool ena) { enabled = ena; } + + static inline void set_delay_cm(const uint8_t cm) { + meas_delay_cm = _MIN(cm, MAX_MEASUREMENT_DELAY); + } + + /** + * Convert Filament Width (mm) to an extrusion ratio + * and reduce to an 8 bit value. + * + * A nominal width of 1.75 and measured width of 1.73 + * gives (100 * 1.75 / 1.73) for a ratio of 101 and + * a return value of 1. + */ + static int8_t sample_to_size_ratio() { + return ABS(nominal_mm - measured_mm) <= FILWIDTH_ERROR_MARGIN + ? int(100.0f * nominal_mm / measured_mm) - 100 : 0; + } + + // Apply a single ADC reading to the raw value + static void accumulate(const uint16_t adc) { + if (adc > 102) // Ignore ADC under 0.5 volts + accum += (uint32_t(adc) << 7) - (accum >> 7); + } + + // Convert raw measurement to mm + static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } + static inline float raw_to_mm() { return raw_to_mm(raw); } + + // A scaled reading is ready + // Divide to get to 0-16384 range since we used 1/128 IIR filter approach + static inline void reading_ready() { raw = accum >> 10; } + + // Update mm from the raw measurement + static inline void update_measured_mm() { measured_mm = raw_to_mm(); } + + // Update ring buffer used to delay filament measurements + static inline void advance_e(const float &e_move) { + + // Increment counters with the E distance + e_count += e_move; + delay_dist += e_move; + + // Only get new measurements on forward E movement + if (!UNEAR_ZERO(e_count)) { + + // Loop the delay distance counter (modulus by the mm length) + while (delay_dist >= MMD_MM) delay_dist -= MMD_MM; + + // Convert into an index (cm) into the measurement array + index_r = int8_t(delay_dist * 0.1f); + + // If the ring buffer is not full... + if (index_r != index_w) { + e_count = 0; // Reset the E movement counter + const int8_t meas_sample = sample_to_size_ratio(); + do { + if (++index_w >= MMD_CM) index_w = 0; // The next unused slot + ratios[index_w] = meas_sample; // Store the measurement + } while (index_r != index_w); // More slots to fill? + } + } + } + + // Dynamically set the volumetric multiplier based on the delayed width measurement. + static inline void update_volumetric() { + if (enabled) { + int8_t read_index = index_r - meas_delay_cm; + if (read_index < 0) read_index += MMD_CM; // Loop around buffer if needed + LIMIT(read_index, 0, MAX_MEASUREMENT_DELAY); + planner.apply_filament_width_sensor(ratios[read_index]); + } + } + +}; + +extern FilamentWidthSensor filwidth; diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index dc9785c1d533..896e60295091 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -123,15 +123,12 @@ void FWRetract::retract(const bool retracting SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]); #endif } - SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]); - SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]); + SERIAL_ECHOLNPAIR("current_position.z ", current_position.z); + SERIAL_ECHOLNPAIR("current_position.e ", current_position.e); SERIAL_ECHOLNPAIR("current_hop ", current_hop); //*/ - const float old_feedrate_mm_s = feedrate_mm_s, - unscale_e = RECIPROCAL(planner.e_factor[active_extruder]), - unscale_fr = 100.0 / feedrate_percentage, // Disable feedrate scaling for retract moves - base_retract = ( + const float base_retract = ( (swapping ? settings.swap_retract_length : settings.retract_length) #if ENABLED(RETRACT_SYNC_MIXING) * (MIXING_STEPPERS) @@ -139,60 +136,60 @@ void FWRetract::retract(const bool retracting ); // The current position will be the destination for E and Z moves - set_destination_from_current(); + destination = current_position; #if ENABLED(RETRACT_SYNC_MIXING) const uint8_t old_mixing_tool = mixer.get_current_vtool(); mixer.T(MIXER_AUTORETRACT_TOOL); #endif + const feedRate_t fr_max_z = planner.settings.max_feedrate_mm_s[Z_AXIS]; if (retracting) { // Retract by moving from a faux E position back to the current E position - feedrate_mm_s = ( - settings.retract_feedrate_mm_s * unscale_fr + current_retract[active_extruder] = base_retract; + prepare_internal_move_to_destination( // set current to destination + settings.retract_feedrate_mm_s #if ENABLED(RETRACT_SYNC_MIXING) * (MIXING_STEPPERS) #endif ); - current_retract[active_extruder] = base_retract * unscale_e; - prepare_move_to_destination(); // set_current_to_destination // Is a Z hop set, and has the hop not yet been done? - if (settings.retract_zraise > 0.01 && !current_hop) { // Apply hop only once - current_hop += settings.retract_zraise; // Add to the hop total (again, only once) - feedrate_mm_s = planner.settings.max_feedrate_mm_s[Z_AXIS] * unscale_fr; // Maximum Z feedrate - prepare_move_to_destination(); // Raise up, set_current_to_destination + if (!current_hop && settings.retract_zraise > 0.01f) { // Apply hop only once + current_hop += settings.retract_zraise; // Add to the hop total (again, only once) + // Raise up, set_current_to_destination. Maximum Z feedrate + prepare_internal_move_to_destination(fr_max_z); } } else { // If a hop was done and Z hasn't changed, undo the Z hop if (current_hop) { - current_hop = 0.0; - feedrate_mm_s = planner.settings.max_feedrate_mm_s[Z_AXIS] * unscale_fr; // Z feedrate to max - prepare_move_to_destination(); // Lower Z, set_current_to_destination + current_hop = 0; + // Lower Z, set_current_to_destination. Maximum Z feedrate + prepare_internal_move_to_destination(fr_max_z); } const float extra_recover = swapping ? settings.swap_retract_recover_extra : settings.retract_recover_extra; - if (extra_recover != 0.0) { - current_position[E_AXIS] -= extra_recover; // Adjust the current E position by the extra amount to recover + if (extra_recover) { + current_position.e -= extra_recover; // Adjust the current E position by the extra amount to recover sync_plan_position_e(); // Sync the planner position so the extra amount is recovered } - current_retract[active_extruder] = 0.0; - feedrate_mm_s = ( - (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s) * unscale_fr + current_retract[active_extruder] = 0; + + const feedRate_t fr_mm_s = ( + (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s) #if ENABLED(RETRACT_SYNC_MIXING) * (MIXING_STEPPERS) #endif ); - prepare_move_to_destination(); // Recover E, set_current_to_destination + prepare_internal_move_to_destination(fr_mm_s); // Recover E, set_current_to_destination } #if ENABLED(RETRACT_SYNC_MIXING) mixer.T(old_mixing_tool); // Restore original mixing tool #endif - 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 @@ -210,8 +207,8 @@ void FWRetract::retract(const bool retracting SERIAL_ECHOLNPAIR("retracted_swap[", i, "] ", retracted_swap[i]); #endif } - SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]); - SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]); + SERIAL_ECHOLNPAIR("current_position.z ", current_position.z); + SERIAL_ECHOLNPAIR("current_position.e ", current_position.e); SERIAL_ECHOLNPAIR("current_hop ", current_hop); //*/ } diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index 7caba3dbe95a..374667513de2 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -27,21 +27,17 @@ #include "../inc/MarlinConfigPre.h" -#pragma pack(push, 1) // No padding between fields - typedef struct { - float retract_length, // M207 S - G10 Retract length - retract_feedrate_mm_s, // M207 F - G10 Retract feedrate - retract_zraise, // M207 Z - G10 Retract hop size - retract_recover_extra, // 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_extra, // M208 W - G11 Swap Recover length - swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate + float retract_length; // M207 S - G10 Retract length + feedRate_t retract_feedrate_mm_s; // M207 F - G10 Retract feedrate + float retract_zraise, // M207 Z - G10 Retract hop size + retract_recover_extra; // M208 S - G11 Recover length + feedRate_t retract_recover_feedrate_mm_s; // M208 F - G11 Recover feedrate + float swap_retract_length, // M207 W - G10 Swap Retract length + swap_retract_recover_extra; // M208 W - G11 Swap Recover length + feedRate_t swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate } fwretract_settings_t; -#pragma pack(pop) - #if ENABLED(FWRETRACT) class FWRetract { diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index be26586984c6..30ec8bfb1d50 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -37,8 +37,6 @@ #include "runout.h" #endif -extern bool wait_for_user; - void host_action(const char * const pstr, const bool eol) { SERIAL_ECHOPGM("//action:"); serialprintPGM(pstr); @@ -66,8 +64,20 @@ void host_action(const char * const pstr, const bool eol) { #if ENABLED(HOST_PROMPT_SUPPORT) + const char CONTINUE_STR[] PROGMEM = "Continue"; + + #if HAS_RESUME_CONTINUE + extern bool wait_for_user; + #endif + PromptReason host_prompt_reason = PROMPT_NOT_DEFINED; + void host_action_notify(const char * const message) { + host_action(PSTR("notification "), false); + serialprintPGM(message); + SERIAL_EOL(); + } + void host_action_prompt(const char * const ptype, const bool eol=true) { host_action(PSTR("prompt_"), false); serialprintPGM(ptype); @@ -100,8 +110,8 @@ void host_action(const char * const pstr, const bool eol) { void host_response_handler(const uint8_t response) { #ifdef DEBUG_HOST_ACTIONS - SERIAL_ECHOLNPAIR("M86 Handle Reason: ", host_prompt_reason); - SERIAL_ECHOLNPAIR("M86 Handle Response: ", response); + SERIAL_ECHOLNPAIR("M876 Handle Reason: ", host_prompt_reason); + SERIAL_ECHOLNPAIR("M876 Handle Response: ", response); #endif const char *msg = PSTR("UNKNOWN STATE"); const PromptReason hpr = host_prompt_reason; @@ -110,7 +120,9 @@ void host_action(const char * const pstr, const bool eol) { case PROMPT_FILAMENT_RUNOUT: msg = PSTR("FILAMENT_RUNOUT"); if (response == 0) { - pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; + #if ENABLED(ADVANCED_PAUSE_FEATURE) + pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; + #endif host_action_prompt_end(); // Close current prompt host_action_prompt_begin(PSTR("Paused")); host_action_prompt_button(PSTR("Purge More")); @@ -122,7 +134,7 @@ void host_action(const char * const pstr, const bool eol) { host_action_prompt_button(PSTR("DisableRunout")); else { host_prompt_reason = PROMPT_FILAMENT_RUNOUT; - host_action_prompt_button(PSTR("Continue")); + host_action_prompt_button(CONTINUE_STR); } host_action_prompt_show(); } @@ -133,16 +145,23 @@ void host_action(const char * const pstr, const bool eol) { runout.reset(); } #endif - pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; + #if ENABLED(ADVANCED_PAUSE_FEATURE) + pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; + #endif } break; case PROMPT_USER_CONTINUE: + #if HAS_RESUME_CONTINUE + wait_for_user = false; + #endif msg = PSTR("FILAMENT_RUNOUT_CONTINUE"); - wait_for_user = false; break; case PROMPT_PAUSE_RESUME: msg = PSTR("LCD_PAUSE_RESUME"); - queue.inject_P(PSTR("M24")); + #if ENABLED(ADVANCED_PAUSE_FEATURE) + extern const char M24_STR[]; + queue.inject_P(M24_STR); + #endif break; case PROMPT_INFO: msg = PSTR("GCODE_INFO"); diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index c93d3a16dbea..57af59eb2e4e 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -23,8 +23,6 @@ #include "../inc/MarlinConfigPre.h" -#include - void host_action(const char * const pstr, const bool eol=true); #ifdef ACTION_ON_KILL @@ -48,6 +46,8 @@ void host_action(const char * const pstr, const bool eol=true); #if ENABLED(HOST_PROMPT_SUPPORT) + extern const char CONTINUE_STR[]; + enum PromptReason : uint8_t { PROMPT_NOT_DEFINED, PROMPT_FILAMENT_RUNOUT, @@ -60,6 +60,7 @@ void host_action(const char * const pstr, const bool eol=true); extern PromptReason host_prompt_reason; void host_response_handler(const uint8_t response); + void host_action_notify(const char * const message); void host_action_prompt_begin(const char * const pstr, const bool eol=true); void host_action_prompt_button(const char * const pstr); void host_action_prompt_end(); diff --git a/Marlin/src/feature/joystick.cpp b/Marlin/src/feature/joystick.cpp new file mode 100644 index 000000000000..abfd77f43804 --- /dev/null +++ b/Marlin/src/feature/joystick.cpp @@ -0,0 +1,170 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * joystick.cpp - joystick input / jogging + */ + +#include "../inc/MarlinConfigPre.h" + +#if ENABLED(JOYSTICK) + +#include "joystick.h" + +#include "../inc/MarlinConfig.h" // for pins +#include "../module/planner.h" +#include "../module/temperature.h" + +Joystick joystick; + +#if ENABLED(EXTENSIBLE_UI) + #include "../lcd/extensible_ui/ui_api.h" +#endif + +#if HAS_JOY_ADC_X + temp_info_t Joystick::x; // = { 0 } +#endif +#if HAS_JOY_ADC_Y + temp_info_t Joystick::y; // = { 0 } +#endif +#if HAS_JOY_ADC_Z + temp_info_t Joystick::z; // = { 0 } +#endif + +#if ENABLED(JOYSTICK_DEBUG) + void Joystick::report() { + SERIAL_ECHOPGM("Joystick"); + #if HAS_JOY_ADC_X + SERIAL_ECHOPAIR_P(SP_X_STR, x.raw); + #endif + #if HAS_JOY_ADC_Y + SERIAL_ECHOPAIR_P(SP_Y_STR, y.raw); + #endif + #if HAS_JOY_ADC_Z + SERIAL_ECHOPAIR_P(SP_Z_STR, z.raw); + #endif + #if HAS_JOY_ADC_EN + SERIAL_ECHO_TERNARY(READ(JOY_EN_PIN), " EN=", "HIGH (dis", "LOW (en", "abled)"); + #endif + SERIAL_EOL(); + } +#endif + +#if HAS_JOY_ADC_X || HAS_JOY_ADC_Y || HAS_JOY_ADC_Z + + void Joystick::calculate(xyz_float_t &norm_jog) { + // Do nothing if enable pin (active-low) is not LOW + #if HAS_JOY_ADC_EN + if (READ(JOY_EN_PIN)) return; + #endif + + auto _normalize_joy = [](float &axis_jog, const int16_t raw, const int16_t (&joy_limits)[4]) { + if (WITHIN(raw, joy_limits[0], joy_limits[3])) { + // within limits, check deadzone + if (raw > joy_limits[2]) + axis_jog = (raw - joy_limits[2]) / float(joy_limits[3] - joy_limits[2]); + else if (raw < joy_limits[1]) + axis_jog = (raw - joy_limits[1]) / float(joy_limits[1] - joy_limits[0]); // negative value + // Map normal to jog value via quadratic relationship + axis_jog = SIGN(axis_jog) * sq(axis_jog); + } + }; + + #if HAS_JOY_ADC_X + static constexpr int16_t joy_x_limits[4] = JOY_X_LIMITS; + _normalize_joy(norm_jog.x, x.raw, joy_x_limits); + #endif + #if HAS_JOY_ADC_Y + static constexpr int16_t joy_y_limits[4] = JOY_Y_LIMITS; + _normalize_joy(norm_jog.y, y.raw, joy_y_limits); + #endif + #if HAS_JOY_ADC_Z + static constexpr int16_t joy_z_limits[4] = JOY_Z_LIMITS; + _normalize_joy(norm_jog.z, z.raw, joy_z_limits); + #endif + } + +#endif + +#if ENABLED(POLL_JOG) + + void Joystick::inject_jog_moves() { + // Recursion barrier + static bool injecting_now; // = false; + if (injecting_now) return; + + static constexpr int QUEUE_DEPTH = 5; // Insert up to this many movements + static constexpr float target_lag = 0.25f, // Aim for 1/4 second lag + seg_time = target_lag / QUEUE_DEPTH; // 0.05 seconds, short segments inserted every 1/20th of a second + static constexpr millis_t timer_limit_ms = millis_t(seg_time * 500); // 25 ms minimum delay between insertions + + // The planner can merge/collapse small moves, so the movement queue is unreliable to control the lag + static millis_t next_run = 0; + if (PENDING(millis(), next_run)) return; + next_run = millis() + timer_limit_ms; + + // Only inject a command if the planner has fewer than 5 moves and there are no unparsed commands + if (planner.movesplanned() >= QUEUE_DEPTH || queue.has_commands_queued()) + return; + + // Normalized jog values are 0 for no movement and -1 or +1 for as max feedrate (nonlinear relationship) + // Jog are initialized to zero and handling input can update values but doesn't have to + // You could use a two-axis joystick and a one-axis keypad and they might work together + xyz_float_t norm_jog{0}; + + // Use ADC values and defined limits. The active zone is normalized: -1..0 (dead) 0..1 + #if HAS_JOY_ADC_X || HAS_JOY_ADC_Y || HAS_JOY_ADC_Z + joystick.calculate(norm_jog); + #endif + + // Other non-joystick poll-based jogging could be implemented here + // with "jogging" encapsulated as a more general class. + + #if ENABLED(EXTENSIBLE_UI) + ExtUI::_joystick_update(norm_jog); + #endif + + // norm_jog values of [-1 .. 1] maps linearly to [-feedrate .. feedrate] + xyz_float_t move_dist{0}; + float hypot2 = 0; + LOOP_XYZ(i) if (norm_jog[i]) { + move_dist[i] = seg_time * norm_jog[i] * + #if ENABLED(EXTENSIBLE_UI) + MMM_TO_MMS(manual_feedrate_mm_m[i]); + #else + planner.settings.max_feedrate_mm_s[i]; + #endif + hypot2 += sq(move_dist[i]); + } + + if (!UNEAR_ZERO(hypot2)) { + current_position += move_dist; + const float length = sqrt(hypot2); + injecting_now = true; + planner.buffer_line(current_position, length / seg_time, active_extruder, length); + injecting_now = false; + } + } + +#endif // POLL_JOG + +#endif // JOYSTICK diff --git a/Marlin/src/feature/joystick.h b/Marlin/src/feature/joystick.h new file mode 100644 index 000000000000..50196374a762 --- /dev/null +++ b/Marlin/src/feature/joystick.h @@ -0,0 +1,55 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * joystick.h - joystick input / jogging + */ + +#include "../inc/MarlinConfigPre.h" +#include "../core/types.h" +#include "../core/macros.h" +#include "../module/temperature.h" + +//#define JOYSTICK_DEBUG + +class Joystick { + friend class Temperature; + private: + #if HAS_JOY_ADC_X + static temp_info_t x; + #endif + #if HAS_JOY_ADC_Y + static temp_info_t y; + #endif + #if HAS_JOY_ADC_Z + static temp_info_t z; + #endif + public: + #if ENABLED(JOYSTICK_DEBUG) + static void report(); + #endif + static void calculate(xyz_float_t &norm_jog); + static void inject_jog_moves(); +}; + +extern Joystick joystick; diff --git a/Marlin/src/feature/leds/leds.cpp b/Marlin/src/feature/leds/leds.cpp index a1e033ab08e1..210aeef0922b 100644 --- a/Marlin/src/feature/leds/leds.cpp +++ b/Marlin/src/feature/leds/leds.cpp @@ -39,7 +39,7 @@ #endif #if ENABLED(PCA9533) - #include "SailfishRGB_LED.h" + #include #endif #if ENABLED(LED_COLOR_PRESETS) @@ -69,7 +69,7 @@ void LEDLights::setup() { #endif #endif #if ENABLED(NEOPIXEL_LED) - setup_neopixel(); + neo.init(); #endif #if ENABLED(PCA9533) RGBinit(); @@ -88,23 +88,28 @@ void LEDLights::set_color(const LEDColor &incol #if ENABLED(NEOPIXEL_LED) const uint32_t neocolor = LEDColorWhite() == incol - ? pixels.Color(NEO_WHITE) - : pixels.Color(incol.r, incol.g, incol.b, incol.w); + ? neo.Color(NEO_WHITE) + : neo.Color(incol.r, incol.g, incol.b, incol.w); static uint16_t nextLed = 0; #ifdef NEOPIXEL_BKGD_LED_INDEX - if (NEOPIXEL_BKGD_LED_INDEX == nextLed) { nextLed++; return; } + if (NEOPIXEL_BKGD_LED_INDEX == nextLed) { + if (++nextLed >= neo.pixels()) nextLed = 0; + return; + } #endif - pixels.setBrightness(incol.i); - if (!isSequence) - set_neopixel_color(neocolor); - else { - pixels.setPixelColor(nextLed, neocolor); - pixels.show(); - if (++nextLed >= pixels.numPixels()) nextLed = 0; + + neo.set_brightness(incol.i); + + if (isSequence) { + neo.set_pixel_color(nextLed, neocolor); + neo.show(); + if (++nextLed >= neo.pixels()) nextLed = 0; return; } + neo.set_color(neocolor); + #endif #if ENABLED(BLINKM) @@ -120,7 +125,7 @@ void LEDLights::set_color(const LEDColor &incol // If the pins can do PWM then their intensity will be set. #define UPDATE_RGBW(C,c) do { if (PWM_PIN(RGB_LED_##C##_PIN)) \ analogWrite(pin_t(RGB_LED_##C##_PIN), incol.c); \ - else WRITE(RGB_LED_##C##_PIN, incol.c ? HIGH : LOW); } while(0) + else WRITE(RGB_LED_##C##_PIN, incol.c ? HIGH : LOW); }while(0) UPDATE_RGBW(R,r); UPDATE_RGBW(G,g); UPDATE_RGBW(B,b); diff --git a/Marlin/src/feature/leds/neopixel.cpp b/Marlin/src/feature/leds/neopixel.cpp index d29226c362e0..a3ceacb42c75 100644 --- a/Marlin/src/feature/leds/neopixel.cpp +++ b/Marlin/src/feature/leds/neopixel.cpp @@ -34,73 +34,81 @@ #include "../../core/utility.h" #endif -Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800); +Marlin_NeoPixel neo; + +Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800) + #if MULTIPLE_NEOPIXEL_TYPES + , Marlin_NeoPixel::adaneo2(NEOPIXEL_PIXELS, NEOPIXEL2_PIN, NEOPIXEL2_TYPE + NEO_KHZ800) + #endif +; #ifdef NEOPIXEL_BKGD_LED_INDEX - void set_neopixel_color_background() { + + void Marlin_NeoPixel::set_color_background() { uint8_t background_color[4] = NEOPIXEL_BKGD_COLOR; - pixels.setPixelColor(NEOPIXEL_BKGD_LED_INDEX, pixels.Color(background_color[0], background_color[1], background_color[2], background_color[3])); + set_pixel_color(NEOPIXEL_BKGD_LED_INDEX, adaneo1.Color(background_color[0], background_color[1], background_color[2], background_color[3])); } + #endif -void set_neopixel_color(const uint32_t color) { - for (uint16_t i = 0; i < pixels.numPixels(); ++i) { +void Marlin_NeoPixel::set_color(const uint32_t color) { + for (uint16_t i = 0; i < pixels(); ++i) { #ifdef NEOPIXEL_BKGD_LED_INDEX if (i == NEOPIXEL_BKGD_LED_INDEX && color != 0x000000) { - set_neopixel_color_background(); + set_color_background(); continue; } #endif - pixels.setPixelColor(i, color); + set_pixel_color(i, color); } - pixels.show(); + show(); } -void set_neopixel_color_startup(const uint32_t color) { - for (uint16_t i = 0; i < pixels.numPixels(); ++i) - pixels.setPixelColor(i, color); - pixels.show(); +void Marlin_NeoPixel::set_color_startup(const uint32_t color) { + for (uint16_t i = 0; i < pixels(); ++i) + set_pixel_color(i, color); + show(); } -void setup_neopixel() { +void Marlin_NeoPixel::init() { SET_OUTPUT(NEOPIXEL_PIN); - pixels.setBrightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range - pixels.begin(); - pixels.show(); // initialize to all off + set_brightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range + begin(); + show(); // initialize to all off #if ENABLED(NEOPIXEL_STARTUP_TEST) safe_delay(1000); - set_neopixel_color_startup(pixels.Color(255, 0, 0, 0)); // red + set_color_startup(adaneo1.Color(255, 0, 0, 0)); // red safe_delay(1000); - set_neopixel_color_startup(pixels.Color(0, 255, 0, 0)); // green + set_color_startup(adaneo1.Color(0, 255, 0, 0)); // green safe_delay(1000); - set_neopixel_color_startup(pixels.Color(0, 0, 255, 0)); // blue + set_color_startup(adaneo1.Color(0, 0, 255, 0)); // blue safe_delay(1000); #endif #ifdef NEOPIXEL_BKGD_LED_INDEX - set_neopixel_color_background(); + set_color_background(); #endif #if ENABLED(LED_USER_PRESET_STARTUP) - set_neopixel_color(pixels.Color(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE)); + set_color(adaneo1.Color(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE)); #else - set_neopixel_color(pixels.Color(0, 0, 0, 0)); + set_color(adaneo1.Color(0, 0, 0, 0)); #endif } #if 0 -bool neopixel_set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p) { - const uint32_t color = pixels.Color(r, g, b, w); - pixels.setBrightness(p); +bool Marlin_NeoPixel::set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p) { + const uint32_t color = adaneo1.Color(r, g, b, w); + set_brightness(p); #if DISABLED(NEOPIXEL_IS_SEQUENTIAL) - set_neopixel_color(color); + set_color(color); return false; #else static uint16_t nextLed = 0; - pixels.setPixelColor(nextLed, color); - pixels.show(); - if (++nextLed >= pixels.numPixels()) nextLed = 0; + set_pixel_color(nextLed, color); + show(); + if (++nextLed >= pixels()) nextLed = 0; return true; #endif } diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index 713300b287f6..e0a3d7c389d7 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -25,11 +25,21 @@ * Neopixel support */ +// ------------------------ +// Includes +// ------------------------ + #include "../../inc/MarlinConfig.h" #include #include +// ------------------------ +// Defines +// ------------------------ + +#define MULTIPLE_NEOPIXEL_TYPES (defined(NEOPIXEL2_TYPE) && (NEOPIXEL2_TYPE != NEOPIXEL_TYPE)) + #define NEOPIXEL_IS_RGB (NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR) #define NEOPIXEL_IS_RGBW !NEOPIXEL_IS_RGB @@ -39,8 +49,72 @@ #define NEO_WHITE 0, 0, 0, 255 #endif -void setup_neopixel(); -void set_neopixel_color(const uint32_t color); -//bool neopixel_set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p); +// ------------------------ +// Function prototypes +// ------------------------ + +class Marlin_NeoPixel { +private: + static Adafruit_NeoPixel adaneo1 + #if MULTIPLE_NEOPIXEL_TYPES + , adaneo2 + #endif + ; + +public: + static void init(); + static void set_color_startup(const uint32_t c); + + static void set_color(const uint32_t c); + + #ifdef NEOPIXEL_BKGD_LED_INDEX + static void set_color_background(); + #endif + + static inline void begin() { + adaneo1.begin(); + #if MULTIPLE_NEOPIXEL_TYPES + adaneo2.begin(); + #endif + } + + static inline void set_pixel_color(const uint16_t n, const uint32_t c) { + adaneo1.setPixelColor(n, c); + #if MULTIPLE_NEOPIXEL_TYPES + adaneo2.setPixelColor(n, c); + #endif + } + + static inline void set_brightness(const uint8_t b) { + adaneo1.setBrightness(b); + #if MULTIPLE_NEOPIXEL_TYPES + adaneo2.setBrightness(b); + #endif + } + + static inline void show() { + adaneo1.show(); + #if PIN_EXISTS(NEOPIXEL2) + #if MULTIPLE_NEOPIXEL_TYPES + adaneo2.show(); + #else + adaneo1.setPin(NEOPIXEL2_PIN); + adaneo1.show(); + adaneo1.setPin(NEOPIXEL_PIN); + #endif + #endif + } + + #if 0 + bool set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p); + #endif + + // Accessors + static inline uint16_t pixels() { return adaneo1.numPixels(); } + static inline uint8_t brightness() { return adaneo1.getBrightness(); } + static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w) { + return adaneo1.Color(r, g, b, w); + } +}; -extern Adafruit_NeoPixel pixels; +extern Marlin_NeoPixel neo; diff --git a/Marlin/src/feature/leds/pca9632.cpp b/Marlin/src/feature/leds/pca9632.cpp index 1f536d6eabba..fc0da10f708d 100644 --- a/Marlin/src/feature/leds/pca9632.cpp +++ b/Marlin/src/feature/leds/pca9632.cpp @@ -58,12 +58,21 @@ #define PCA9632_AUTOGLO 0xC0 #define PCA9632_AUTOGI 0xE0 -// Red LED0 -// Green LED1 -// Blue LED2 -#define PCA9632_RED 0x00 -#define PCA9632_GRN 0x02 -#define PCA9632_BLU 0x04 +// Red=LED0 Green=LED1 Blue=LED2 +#ifndef PCA9632_RED + #define PCA9632_RED 0x00 +#endif +#ifndef PCA9632_GRN + #define PCA9632_GRN 0x02 +#endif +#ifndef PCA9632_BLU + #define PCA9632_BLU 0x04 +#endif + +// If any of the color indexes are greater than 0x04 they can't use auto increment +#if !defined(PCA9632_NO_AUTO_INC) && (PCA9632_RED > 0x04 || PCA9632_GRN > 0x04 || PCA9632_BLU > 0x04) + #define PCA9632_NO_AUTO_INC +#endif #define LED_OFF 0x00 #define LED_ON 0x01 @@ -80,12 +89,24 @@ static void PCA9632_WriteRegister(const byte addr, const byte regadd, const byte Wire.endTransmission(); } -static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const byte value1, const byte value2, const byte value3) { +static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const byte vr, const byte vg, const byte vb) { + #if DISABLED(PCA9632_NO_AUTO_INC) + uint8_t data[4], len = 4; + data[0] = PCA9632_AUTO_IND | regadd; + data[1 + (PCA9632_RED >> 1)] = vr; + data[1 + (PCA9632_GRN >> 1)] = vg; + data[1 + (PCA9632_BLU >> 1)] = vb; + #else + uint8_t data[6], len = 6; + data[0] = regadd + (PCA9632_RED >> 1); + data[1] = vr; + data[2] = regadd + (PCA9632_GRN >> 1); + data[3] = vg; + data[4] = regadd + (PCA9632_BLU >> 1); + data[5] = vb; + #endif Wire.beginTransmission(I2C_ADDRESS(addr)); - Wire.write(PCA9632_AUTO_IND | regadd); - Wire.write(value1); - Wire.write(value2); - Wire.write(value3); + Wire.write(data, len); Wire.endTransmission(); } @@ -115,4 +136,15 @@ void pca9632_set_led_color(const LEDColor &color) { PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT); } +#if ENABLED(PCA9632_BUZZER) + + void pca9632_buzz(const long, const uint16_t) { + uint8_t data[] = PCA9632_BUZZER_DATA; + Wire.beginTransmission(I2C_ADDRESS(PCA9632_ADDRESS)); + Wire.write(data, sizeof(data)); + Wire.endTransmission(); + } + +#endif // PCA9632_BUZZER + #endif // PCA9632 diff --git a/Marlin/src/feature/leds/pca9632.h b/Marlin/src/feature/leds/pca9632.h index a231cb9f424b..2abdf7c7af19 100644 --- a/Marlin/src/feature/leds/pca9632.h +++ b/Marlin/src/feature/leds/pca9632.h @@ -30,3 +30,8 @@ struct LEDColor; typedef LEDColor LEDColor; void pca9632_set_led_color(const LEDColor &color); + +#if ENABLED(PCA9632_BUZZER) + #include + void pca9632_buzz(const long, const uint16_t); +#endif diff --git a/Marlin/src/feature/leds/printer_event_leds.cpp b/Marlin/src/feature/leds/printer_event_leds.cpp index 917ec3e64e3d..3ce7a1af2181 100644 --- a/Marlin/src/feature/leds/printer_event_leds.cpp +++ b/Marlin/src/feature/leds/printer_event_leds.cpp @@ -46,7 +46,7 @@ PrinterEventLEDs printerEventLEDs; inline void pel_set_rgb(const uint8_t r, const uint8_t g, const uint8_t b) { leds.set_color( - MakeLEDColor(r, g, b, 0, pixels.getBrightness()) + MakeLEDColor(r, g, b, 0, neo.brightness()) #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) , true #endif diff --git a/Marlin/src/feature/leds/printer_event_leds.h b/Marlin/src/feature/leds/printer_event_leds.h index 4430e5be6827..f59d6c699c19 100644 --- a/Marlin/src/feature/leds/printer_event_leds.h +++ b/Marlin/src/feature/leds/printer_event_leds.h @@ -36,6 +36,14 @@ class PrinterEventLEDs { static bool leds_off_after_print; #endif + static inline void set_done() { + #if ENABLED(LED_COLOR_PRESETS) + leds.set_default(); + #else + leds.set_off(); + #endif + } + public: #if HAS_TEMP_HOTEND static inline LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); } @@ -60,14 +68,14 @@ class PrinterEventLEDs { leds_off_after_print = true; #else safe_delay(2000); - leds.set_off(); + set_done(); #endif } static inline void onResumeAfterWait() { #if HAS_LEDS_OFF_FLAG if (leds_off_after_print) { - leds.set_off(); + set_done(); leds_off_after_print = false; } #endif diff --git a/Marlin/src/feature/leds/tempstat.cpp b/Marlin/src/feature/leds/tempstat.cpp index 601e433687e7..f19ae0f092ad 100644 --- a/Marlin/src/feature/leds/tempstat.cpp +++ b/Marlin/src/feature/leds/tempstat.cpp @@ -31,7 +31,7 @@ #include "tempstat.h" #include "../../module/temperature.h" -void handle_status_leds(void) { +void handle_status_leds() { static int8_t old_red = -1; // Invalid value to force LED initialization static millis_t next_status_led_update_ms = 0; if (ELAPSED(millis(), next_status_led_update_ms)) { diff --git a/Marlin/src/feature/leds/tempstat.h b/Marlin/src/feature/leds/tempstat.h index 6d1e2490f3a8..834f2e491f4e 100644 --- a/Marlin/src/feature/leds/tempstat.h +++ b/Marlin/src/feature/leds/tempstat.h @@ -25,4 +25,4 @@ * Marlin general RGB LED support */ -void handle_status_leds(void); +void handle_status_leds(); diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index 9f8d4b143976..095f22d13bc9 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -25,7 +25,7 @@ //#define MIXER_NORMALIZER_DEBUG -#if !defined(__AVR__) // || DUAL_MIXING_EXTRUDER +#ifndef __AVR__ // || DUAL_MIXING_EXTRUDER // Use 16-bit (or fastest) data for the integer mix factors typedef uint_fast16_t mixer_comp_t; typedef uint_fast16_t mixer_accu_t; @@ -142,13 +142,19 @@ class Mixer { static inline void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) { // Scale each component to the largest one in terms of COLOR_A_MASK // So the largest component will be COLOR_A_MASK and the other will be in proportion to it - const float scale = (COLOR_A_MASK) * RECIPROCAL(float(_MAX(mix[0], mix[1]))); + const float scale = (COLOR_A_MASK) * RECIPROCAL(_MAX( + LIST_N(MIXING_STEPPERS, mix[0], mix[1], mix[2], mix[3], mix[4], mix[5]) + )); // Scale all values so their maximum is COLOR_A_MASK MIXER_STEPPER_LOOP(i) tcolor[i] = mix[i] * scale; #ifdef MIXER_NORMALIZER_DEBUG - SERIAL_ECHOLNPAIR("Mix [", int(mix[0]), ", ", int(mix[1]), "] to Color [", int(tcolor[0]), ", ", int(tcolor[1]), "]"); + SERIAL_ECHOPGM("Mix [ "); + SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(mix[0]), int(mix[1]), int(mix[2]), int(mix[3]), int(mix[4]), int(mix[5])); + SERIAL_ECHOPGM(" ] to Color [ "); + SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(tcolor[0]), int(tcolor[1]), int(tcolor[2]), int(tcolor[3]), int(tcolor[4]), int(tcolor[5])); + SERIAL_ECHOLNPGM(" ]"); #endif } @@ -156,10 +162,14 @@ class Mixer { float ctot = 0; MIXER_STEPPER_LOOP(i) ctot += color[j][i]; //MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot; - mix[0] = mixer_perc_t(100.0f * color[j][0] / ctot); - mix[1] = 100 - mix[0]; + MIXER_STEPPER_LOOP(i) mix[i] = mixer_perc_t(100.0f * color[j][i] / ctot); + #ifdef MIXER_NORMALIZER_DEBUG - SERIAL_ECHOLNPAIR("V-tool ", int(j), " [", int(color[j][0]), ", ", int(color[j][1]), "] to Mix [", int(mix[0]), ", ", int(mix[1]), "]"); + SERIAL_ECHOPAIR("V-tool ", int(j), " [ "); + SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(color[j][0]), int(color[j][1]), int(color[j][2]), int(color[j][3]), int(color[j][4]), int(color[j][5])); + SERIAL_ECHOPGM(" ] to Mix [ "); + SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(mix[0]), int(mix[1]), int(mix[2]), int(mix[3]), int(mix[4]), int(mix[5])); + SERIAL_ECHOLNPGM(" ]"); #endif } @@ -199,10 +209,14 @@ class Mixer { static inline void update_mix_from_gradient() { float ctot = 0; MIXER_STEPPER_LOOP(i) ctot += gradient.color[i]; - mix[0] = (mixer_perc_t)CEIL(100.0f * gradient.color[0] / ctot); - mix[1] = 100 - mix[0]; + MIXER_STEPPER_LOOP(i) mix[i] = (mixer_perc_t)CEIL(100.0f * gradient.color[i] / ctot); + #ifdef MIXER_NORMALIZER_DEBUG - SERIAL_ECHOLNPAIR("Gradient [", int(gradient.color[0]), ", ", int(gradient.color[1]), "] to Mix [", int(mix[0]), ", ", int(mix[1]), "]"); + SERIAL_ECHOPGM("Gradient [ "); + SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(gradient.color[0]), int(gradient.color[1]), int(gradient.color[2]), int(gradient.color[3]), int(gradient.color[4]), int(gradient.color[5])); + SERIAL_ECHOPGM(" ] to Mix [ "); + SERIAL_ECHOLIST_N(MIXING_STEPPERS, int(mix[0]), int(mix[1]), int(mix[2]), int(mix[3]), int(mix[4]), int(mix[5])); + SERIAL_ECHOLNPGM(" ]"); #endif } diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 74009c9f30c9..4ec0a2b60896 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -53,14 +53,19 @@ #include "../lcd/extensible_ui/ui_api.h" #endif +#include "../core/language.h" #include "../lcd/ultralcd.h" -#include "../libs/buzzer.h" + +#if HAS_BUZZER + #include "../libs/buzzer.h" +#endif + #include "../libs/nozzle.h" #include "pause.h" // private: -static float resume_position[XYZE]; +static xyze_pos_t resume_position; PauseMode pause_mode = PAUSE_MODE_PAUSE_PRINT; @@ -72,6 +77,12 @@ fil_change_settings_t fc_settings[EXTRUDERS]; #include "../sd/cardreader.h" #endif +#if ENABLED(EMERGENCY_PARSER) + #define _PMSG(L) L##_M108 +#else + #define _PMSG(L) L##_LCD +#endif + #if HAS_BUZZER static void filament_change_beep(const int8_t max_beep_count, const bool init=false) { if (pause_mode == PAUSE_MODE_PAUSE_PRINT) return; @@ -118,12 +129,12 @@ static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) { return thermalManager.wait_for_hotend(active_extruder); } -void do_pause_e_move(const float &length, const float &fr_mm_s) { +void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s) { #if HAS_FILAMENT_SENSOR runout.reset(); #endif - current_position[E_AXIS] += length / planner.e_factor[active_extruder]; - planner.buffer_line(current_position, fr_mm_s, active_extruder); + current_position.e += length / planner.e_factor[active_extruder]; + line_to_current_position(fr_mm_s); planner.synchronize(); } @@ -159,7 +170,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l #if HAS_LCD_MENU if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_INSERT, mode); #endif - SERIAL_ECHO_MSG(MSG_FILAMENT_CHANGE_INSERT); + SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_INSERT)); #if HAS_BUZZER filament_change_beep(max_beep_count, true); @@ -180,9 +191,12 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l host_action_prompt_begin(PSTR("Load Filament T"), false); SERIAL_CHAR(tool); SERIAL_EOL(); - host_action_prompt_button(PSTR("Continue")); + host_action_prompt_button(CONTINUE_STR); host_action_prompt_show(); #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired_P(PSTR("Load Filament")); + #endif while (wait_for_user) { #if HAS_BUZZER filament_change_beep(max_beep_count); @@ -233,7 +247,10 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l wait_for_user = true; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Continuous Purge Running..."), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purge Running..."), CONTINUE_STR); + #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired_P(PSTR("Filament Purge Running...")); #endif for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); @@ -266,7 +283,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l host_action_prompt_button(PSTR("DisableRunout")); else { host_prompt_reason = PROMPT_FILAMENT_RUNOUT; - host_action_prompt_button(PSTR("Continue")); + host_action_prompt_button(CONTINUE_STR); } host_action_prompt_show(); #endif @@ -328,13 +345,13 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, #endif // Retract filament - do_pause_e_move(-(FILAMENT_UNLOAD_RETRACT_LENGTH) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier); + do_pause_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier); // Wait for filament to cool - safe_delay(FILAMENT_UNLOAD_DELAY); + safe_delay(FILAMENT_UNLOAD_PURGE_DELAY); // Quickly purge - do_pause_e_move((FILAMENT_UNLOAD_RETRACT_LENGTH + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier, + do_pause_e_move((FILAMENT_UNLOAD_PURGE_RETRACT + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier, planner.settings.max_feedrate_mm_s[E_AXIS] * mix_multiplier); // Unload filament @@ -349,8 +366,8 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, planner.settings.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) || AXIS_DRIVER_TYPE_E0(TMC2660) || AXIS_DRIVER_TYPE_E1(TMC2660) || AXIS_DRIVER_TYPE_E2(TMC2660) || AXIS_DRIVER_TYPE_E3(TMC2660) || AXIS_DRIVER_TYPE_E4(TMC2660) || AXIS_DRIVER_TYPE_E5(TMC2660) + // Disable E steppers for manual change + #if HAS_E_STEPPER_ENABLE disable_e_stepper(active_extruder); safe_delay(100); #endif @@ -371,11 +388,11 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/, * - Park the nozzle at the given position * - Call unload_filament (if a length was specified) * - * Returns 'true' if pause was completed, 'false' for abort + * Return 'true' if pause was completed, 'false' for abort */ uint8_t did_pause_print = 0; -bool pause_print(const float &retract, const point_t &park_point, const float &unload_length/*=0*/, const bool show_lcd/*=false*/ DXC_ARGS) { +bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length/*=0*/, const bool show_lcd/*=false*/ DXC_ARGS) { #if !HAS_LCD_MENU UNUSED(show_lcd); @@ -389,9 +406,10 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u #elif defined(ACTION_ON_PAUSE) host_action_pause(); #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Pause")); - #endif + #endif + + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_open(PROMPT_INFO, PSTR("Pause"), PSTR("Dismiss")); #endif if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { @@ -421,7 +439,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u print_job_timer.pause(); // Save current position - COPY(resume_position, current_position); + resume_position = current_position; // Wait for buffered blocks to complete planner.synchronize(); @@ -435,8 +453,8 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u 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); + if (!axes_need_homing()) + nozzle.park(2, park_point); #if ENABLED(DUAL_X_CARRIAGE) const int8_t saved_ext = active_extruder; @@ -446,7 +464,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u #endif if (unload_length) // Unload the filament - unload_filament(unload_length, show_lcd); + unload_filament(unload_length, show_lcd, PAUSE_MODE_CHANGE_FILAMENT); #if ENABLED(DUAL_X_CARRIAGE) active_extruder = saved_ext; @@ -470,14 +488,6 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u * Used by M125 and M600 */ -#if (HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)) && ENABLED(EMERGENCY_PARSER) - #define _PMSG(L) L -#elif ENABLED(EMERGENCY_PARSER) - #define _PMSG(L) L##_M108 -#else - #define _PMSG(L) L##_LCD -#endif - void show_continue_prompt(const bool is_reload) { #if HAS_LCD_MENU lcd_pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING); @@ -493,6 +503,8 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep #if HAS_BUZZER filament_change_beep(max_beep_count, true); + #else + UNUSED(max_beep_count); #endif // Start the heater idle timers @@ -511,7 +523,10 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; // LCD click or M108 will clear this #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), CONTINUE_STR); + #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired_P(PSTR("Nozzle Parked")); #endif while (wait_for_user) { #if HAS_BUZZER @@ -534,11 +549,15 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep host_prompt_do(PROMPT_USER_CONTINUE, PSTR("HeaterTimeout"), PSTR("Reheat")); #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired_P(PSTR("HeaterTimeout")); + #endif + // Wait for LCD click or M108 while (wait_for_user) idle(true); #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Reheating")); + host_prompt_do(PROMPT_INFO, PSTR("Reheating")); #endif #if ENABLED(EXTENSIBLE_UI) ExtUI::onStatusChanged(PSTR("Reheating...")); @@ -558,10 +577,10 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep HOTEND_LOOP() thermalManager.hotend_idle[e].start(nozzle_timeout); #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Reheat Done"), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Reheat Done"), CONTINUE_STR); #endif #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired("Reheat finished."); + ExtUI::onUserConfirmRequired_P(PSTR("Reheat finished.")); #endif wait_for_user = true; nozzle_timed_out = false; @@ -583,7 +602,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep /** * Resume or Start print procedure * - * - Abort if not paused + * - If not paused, do nothing and return * - Reset heater idle timers * - Load filament if specified, but only if: * - a nozzle timed out, or @@ -591,10 +610,10 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep * - 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. + * - !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] + * - Sync the planner E to resume_position.e * - Send host action for resume, if configured * - Resume the current SD print job, if any */ @@ -618,7 +637,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le } 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, PAUSE_MODE_PAUSE_PRINT DXC_PASS); + load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, PAUSE_MODE_SAME DXC_PASS); #if HAS_LCD_MENU lcd_pause_show_message(PAUSE_MESSAGE_RESUME); @@ -632,21 +651,21 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le #endif // If resume_position is negative - if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], PAUSE_PARK_RETRACT_FEEDRATE); + if (resume_position.e < 0) do_pause_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE)); // Move XY to starting position, then Z - do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE); + do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); // Move Z_AXIS to saved position - do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); + do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); #if ADVANCED_PAUSE_RESUME_PRIME != 0 - do_pause_e_move(ADVANCED_PAUSE_RESUME_PRIME, ADVANCED_PAUSE_PURGE_FEEDRATE); + do_pause_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE)); #endif // Now all extrusion positions are resumed and ready to be confirmed // Set extruder to saved position - planner.set_e_position_mm((destination[E_AXIS] = current_position[E_AXIS] = resume_position[E_AXIS])); + planner.set_e_position_mm((destination.e = current_position.e = resume_position.e)); #if HAS_LCD_MENU lcd_pause_show_message(PAUSE_MESSAGE_STATUS); @@ -661,7 +680,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le --did_pause_print; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Resume")); + host_prompt_open(PROMPT_INFO, PSTR("Resuming"), PSTR("Dismiss")); #endif #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 77cbe6b3f513..42f70cc60174 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -39,6 +39,7 @@ typedef struct { enum PauseMode : char { PAUSE_MODE_SAME, PAUSE_MODE_PAUSE_PRINT, + PAUSE_MODE_CHANGE_FILAMENT, PAUSE_MODE_LOAD_FILAMENT, PAUSE_MODE_UNLOAD_FILAMENT }; @@ -81,9 +82,9 @@ extern uint8_t did_pause_print; #define DXC_PASS #endif -void do_pause_e_move(const float &length, const float &fr_mm_s); +void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s); -bool pause_print(const float &retract, const point_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS); +bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS); void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS); diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index ff012ee6bd34..53b1c509128a 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -30,7 +30,7 @@ #include "power.h" #include "../module/temperature.h" -#include "../module/stepper_indirection.h" +#include "../module/stepper/indirection.h" #include "../Marlin.h" Power powerManager; @@ -55,37 +55,23 @@ bool Power::is_power_needed() { #endif // 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 (X_ENABLE_READ() == X_ENABLE_ON || Y_ENABLE_READ() == Y_ENABLE_ON || Z_ENABLE_READ() == Z_ENABLE_ON #if HAS_HEATED_BED || thermalManager.temp_bed.soft_pwm_amount > 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 - #if E_STEPPERS - || E0_ENABLE_READ == E_ENABLE_ON - #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 - #if E_STEPPERS > 5 - || E5_ENABLE_READ == E_ENABLE_ON - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - #endif // E_STEPPERS + #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 + #if E_STEPPERS + #define _OR_ENABLED_E(N) || E##N##_ENABLE_READ() == E_ENABLE_ON + REPEAT(E_STEPPERS, _OR_ENABLED_E) + #endif ) return true; HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true; @@ -123,7 +109,7 @@ void Power::power_on() { PSU_PIN_ON(); #if HAS_TRINAMIC - delay(100); // Wait for power to settle + delay(PSU_POWERUP_DELAY); // Wait for power to settle restore_stepper_drivers(); #endif } diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index ebaa1dfc12f1..0cf0fc5885f4 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -35,6 +35,10 @@ bool PrintJobRecovery::enabled; // Initialized by settings.load() SdFile PrintJobRecovery::file; job_recovery_info_t PrintJobRecovery::info; +const char PrintJobRecovery::filename[5] = "/PLR"; +uint8_t PrintJobRecovery::queue_index_r; +uint32_t PrintJobRecovery::cmd_sdpos, // = 0 + PrintJobRecovery::sdpos[BUFSIZE]; #include "../sd/cardreader.h" #include "../lcd/ultralcd.h" @@ -61,6 +65,9 @@ PrintJobRecovery recovery; #ifndef POWER_LOSS_RETRACT_LEN #define POWER_LOSS_RETRACT_LEN 0 #endif +#ifndef POWER_LOSS_ZRAISE + #define POWER_LOSS_ZRAISE 2 +#endif /** * Clear the recovery info @@ -94,8 +101,8 @@ void PrintJobRecovery::changed() { */ void PrintJobRecovery::check() { if (enabled) { - if (!card.isDetected()) card.initsd(); - if (card.isDetected()) { + if (!card.isMounted()) card.mount(); + if (card.isMounted()) { load(); if (!valid()) return purge(); queue.inject_P(PSTR("M1000 S")); @@ -123,6 +130,14 @@ void PrintJobRecovery::load() { debug(PSTR("Load")); } +/** + * Set info fields that won't change + */ +void PrintJobRecovery::prepare() { + card.getAbsFilename(info.sd_filename); // SD filename + cmd_sdpos = 0; +} + /** * Save the current machine state to the power-loss recovery file */ @@ -140,14 +155,11 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= // Did Z change since the last call? if (force #if DISABLED(SAVE_EACH_CMD_MODE) // Always save state when enabled - #if PIN_EXISTS(POWER_LOSS) // Save if power loss pin is triggered - || READ(POWER_LOSS_PIN) == POWER_LOSS_STATE - #endif #if SAVE_INFO_INTERVAL_MS > 0 // Save if interval is elapsed || ELAPSED(ms, next_save_ms) #endif // Save if Z is above the last-saved position by some minimum height - || current_position[Z_AXIS] > info.current_position[Z_AXIS] + POWER_LOSS_MIN_Z_CHANGE + || current_position.z > info.current_position.z + POWER_LOSS_MIN_Z_CHANGE #endif ) { @@ -161,12 +173,12 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= info.valid_foot = info.valid_head; // Machine state - COPY(info.current_position, current_position); + info.current_position = current_position; #if HAS_HOME_OFFSET - COPY(info.home_offset, home_offset); + info.home_offset = home_offset; #endif #if HAS_POSITION_SHIFT - COPY(info.position_shift, position_shift); + info.position_shift = position_shift; #endif info.feedrate = uint16_t(feedrate_mm_s * 60.0f); @@ -174,7 +186,18 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= info.active_extruder = active_extruder; #endif - HOTEND_LOOP() info.target_temperature[e] = thermalManager.temp_hotend[e].target; + #if DISABLED(NO_VOLUMETRICS) + info.volumetric_enabled = parser.volumetric_enabled; + #if EXTRUDERS > 1 + for (int8_t e = 0; e < EXTRUDERS; e++) info.filament_size[e] = planner.filament_size[e]; + #else + if (parser.volumetric_enabled) info.filament_size = planner.filament_size[active_extruder]; + #endif + #endif + + #if EXTRUDERS + HOTEND_LOOP() info.target_temperature[e] = thermalManager.temp_hotend[e].target; + #endif #if HAS_HEATED_BED info.target_temperature_bed = thermalManager.temp_bed.target; @@ -204,30 +227,46 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= info.retract_hop = fwretract.current_hop; #endif - // Relative mode - info.relative_mode = relative_mode; - info.relative_modes_e = gcode.axis_relative_modes[E_AXIS]; - - // Commands in the queue - info.queue_length = save_queue ? queue.length : 0; - info.queue_index_r = queue.index_r; - COPY(info.queue_buffer, queue.buffer); + // Relative axis modes + info.axis_relative = gcode.axis_relative; // Elapsed print job time info.print_job_elapsed = print_job_timer.duration(); - // SD file position - card.getAbsFilename(info.sd_filename); - info.sdpos = card.getIndex(); - write(); + } +} + +#if PIN_EXISTS(POWER_LOSS) - // KILL now if the power-loss pin was triggered - #if PIN_EXISTS(POWER_LOSS) - if (READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) kill(PSTR(MSG_OUTAGE_RECOVERY)); + void PrintJobRecovery::_outage() { + #if ENABLED(BACKUP_POWER_SUPPLY) + static bool lock = false; + if (lock) return; // No re-entrance from idle() during raise_z() + lock = true; #endif + if (IS_SD_PRINTING()) save(true); + #if ENABLED(BACKUP_POWER_SUPPLY) + raise_z(); + #endif + + kill(GET_TEXT(MSG_OUTAGE_RECOVERY)); } -} + + #if ENABLED(BACKUP_POWER_SUPPLY) + + void PrintJobRecovery::raise_z() { + // Disable all heaters to reduce power loss + thermalManager.disable_all_heaters(); + quickstop_stepper(); + // Raise Z axis + gcode.process_subcommands_now_P(PSTR("G91\nG0 Z" STRINGIFY(POWER_LOSS_ZRAISE))); + planner.synchronize(); + } + + #endif + +#endif /** * Save the recovery info the recovery file @@ -248,7 +287,7 @@ void PrintJobRecovery::write() { */ void PrintJobRecovery::resume() { - #define RECOVERY_ZRAISE 2 + const uint32_t resume_sdpos = info.sdpos; // Get here before the stepper ISR overwrites it #if HAS_LEVELING // Make sure leveling is off before any G92 and G28 @@ -258,15 +297,27 @@ void PrintJobRecovery::resume() { // Reset E, raise Z, home XY... gcode.process_subcommands_now_P(PSTR("G92.9 E0" #if Z_HOME_DIR > 0 - // If Z homing goes to max, reset E and home all - "\nG28R0" + + // If Z homing goes to max, just reset E and home all + "\n" + "G28R0" #if ENABLED(MARLIN_DEV_MODE) "S" #endif - #else + + #else // "G92.9 E0 ..." + // Set Z to 0, raise Z by RECOVERY_ZRAISE, and Home (XY only for Cartesian) // with no raise. (Only do simulated homing in Marlin Dev Mode.) - "Z0\nG1Z" STRINGIFY(RECOVERY_ZRAISE) "\nG28R0" + #if ENABLED(BACKUP_POWER_SUPPLY) + "Z" STRINGIFY(POWER_LOSS_ZRAISE) // Z-axis was already raised at outage + #else + "Z0\n" // Set Z=0 + "G1Z" STRINGIFY(POWER_LOSS_ZRAISE) // Raise Z + #endif + "\n" + + "G28R0" #if ENABLED(MARLIN_DEV_MODE) "S" #elif !IS_KINEMATIC @@ -286,6 +337,27 @@ void PrintJobRecovery::resume() { gcode.process_subcommands_now(cmd); #endif + // Recover volumetric extrusion state + #if DISABLED(NO_VOLUMETRICS) + #if EXTRUDERS > 1 + for (int8_t e = 0; e < EXTRUDERS; e++) { + dtostrf(info.filament_size[e], 1, 3, str_1); + sprintf_P(cmd, PSTR("M200 T%i D%s"), e, str_1); + gcode.process_subcommands_now(cmd); + } + if (!info.volumetric_enabled) { + sprintf_P(cmd, PSTR("M200 T%i D0"), info.active_extruder); + gcode.process_subcommands_now(cmd); + } + #else + if (info.volumetric_enabled) { + dtostrf(info.filament_size, 1, 3, str_1); + sprintf_P(cmd, PSTR("M200 D%s"), str_1); + gcode.process_subcommands_now(cmd); + } + #endif + #endif + #if HAS_HEATED_BED const int16_t bt = info.target_temperature_bed; if (bt) { @@ -296,17 +368,19 @@ void PrintJobRecovery::resume() { #endif // Restore all hotend temperatures - HOTEND_LOOP() { - const int16_t et = info.target_temperature[e]; - if (et) { - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), e); + #if HOTENDS + HOTEND_LOOP() { + const int16_t et = info.target_temperature[e]; + if (et) { + #if HOTENDS > 1 + sprintf_P(cmd, PSTR("T%i"), e); + gcode.process_subcommands_now(cmd); + #endif + sprintf_P(cmd, PSTR("M109 S%i"), et); gcode.process_subcommands_now(cmd); - #endif - sprintf_P(cmd, PSTR("M109 S%i"), et); - gcode.process_subcommands_now(cmd); + } } - } + #endif // Restore print cooling fan speeds FANS_LOOP(i) { @@ -320,9 +394,10 @@ void PrintJobRecovery::resume() { // Restore retract and hop state #if ENABLED(FWRETRACT) for (uint8_t e = 0; e < EXTRUDERS; e++) { - if (info.retract[e] != 0.0) + if (info.retract[e] != 0.0) { fwretract.current_retract[e] = info.retract[e]; fwretract.retracted[e] = true; + } } fwretract.current_hop = info.retract_hop; #endif @@ -331,8 +406,7 @@ void PrintJobRecovery::resume() { // Restore leveling state before 'G92 Z' to ensure // the Z stepper count corresponds to the native Z. if (info.fade || info.leveling) { - dtostrf(info.fade, 1, 1, str_1); - sprintf_P(cmd, PSTR("M420 S%i Z%s"), int(info.leveling), str_1); + sprintf_P(cmd, PSTR("M420 S%i Z%s"), int(info.leveling), dtostrf(info.fade, 1, 1, str_1)); gcode.process_subcommands_now(cmd); } #endif @@ -354,13 +428,14 @@ void PrintJobRecovery::resume() { #endif // Move back to the saved XY - dtostrf(info.current_position[X_AXIS], 1, 3, str_1); - dtostrf(info.current_position[Y_AXIS], 1, 3, str_2); - sprintf_P(cmd, PSTR("G1 X%s Y%s F3000"), str_1, str_2); + sprintf_P(cmd, PSTR("G1 X%s Y%s F3000"), + dtostrf(info.current_position.x, 1, 3, str_1), + dtostrf(info.current_position.y, 1, 3, str_2) + ); gcode.process_subcommands_now(cmd); // Move back to the saved Z - dtostrf(info.current_position[Z_AXIS], 1, 3, str_1); + dtostrf(info.current_position.z, 1, 3, str_1); #if Z_HOME_DIR > 0 sprintf_P(cmd, PSTR("G1 Z%s F200"), str_1); #else @@ -381,36 +456,28 @@ void PrintJobRecovery::resume() { gcode.process_subcommands_now(cmd); // Restore E position with G92.9 - dtostrf(info.current_position[E_AXIS], 1, 3, str_1); - sprintf_P(cmd, PSTR("G92.9 E%s"), str_1); + sprintf_P(cmd, PSTR("G92.9 E%s"), dtostrf(info.current_position.e, 1, 3, str_1)); gcode.process_subcommands_now(cmd); - // Relative mode - relative_mode = info.relative_mode; - gcode.axis_relative_modes[E_AXIS] = info.relative_modes_e; + // Relative axis modes + gcode.axis_relative = info.axis_relative; + #if HAS_HOME_OFFSET + home_offset = info.home_offset; + #endif + #if HAS_POSITION_SHIFT + position_shift = info.position_shift; + #endif #if HAS_HOME_OFFSET || HAS_POSITION_SHIFT - LOOP_XYZ(i) { - #if HAS_HOME_OFFSET - home_offset[i] = info.home_offset[i]; - #endif - #if HAS_POSITION_SHIFT - position_shift[i] = info.position_shift[i]; - #endif - update_workspace_offset((AxisEnum)i); - } + LOOP_XYZ(i) update_workspace_offset((AxisEnum)i); #endif - // Process commands from the old pending queue - uint8_t c = info.queue_length, r = info.queue_index_r; - for (; c--; r = (r + 1) % BUFSIZE) - gcode.process_subcommands_now(info.queue_buffer[r]); - // Resume the SD file from the last position char *fn = info.sd_filename; - sprintf_P(cmd, PSTR("M23 %s"), fn); + extern const char M23_STR[]; + sprintf_P(cmd, M23_STR, fn); gcode.process_subcommands_now(cmd); - sprintf_P(cmd, PSTR("M24 S%ld T%ld"), info.sdpos, info.print_job_elapsed); + sprintf_P(cmd, PSTR("M24 S%ld T%ld"), resume_sdpos, info.print_job_elapsed); gcode.process_subcommands_now(cmd); } @@ -452,12 +519,14 @@ void PrintJobRecovery::resume() { DEBUG_ECHOLNPAIR("active_extruder: ", int(info.active_extruder)); #endif - DEBUG_ECHOPGM("target_temperature: "); - HOTEND_LOOP() { - DEBUG_ECHO(info.target_temperature[e]); - if (e < HOTENDS - 1) DEBUG_CHAR(','); - } - DEBUG_EOL(); + #if HOTENDS + DEBUG_ECHOPGM("target_temperature: "); + HOTEND_LOOP() { + DEBUG_ECHO(info.target_temperature[e]); + if (e < HOTENDS - 1) DEBUG_CHAR(','); + } + DEBUG_EOL(); + #endif #if HAS_HEATED_BED DEBUG_ECHOLNPAIR("target_temperature_bed: ", info.target_temperature_bed); @@ -484,9 +553,6 @@ void PrintJobRecovery::resume() { DEBUG_EOL(); DEBUG_ECHOLNPAIR("retract_hop: ", info.retract_hop); #endif - DEBUG_ECHOLNPAIR("queue_index_r: ", int(info.queue_index_r)); - DEBUG_ECHOLNPAIR("queue_length: ", int(info.queue_length)); - for (uint8_t i = 0; i < info.queue_length; i++) DEBUG_ECHOLNPAIR("> ", info.queue_buffer[i]); DEBUG_ECHOLNPAIR("sd_filename: ", info.sd_filename); DEBUG_ECHOLNPAIR("sdpos: ", info.sdpos); DEBUG_ECHOLNPAIR("print_job_elapsed: ", info.print_job_elapsed); diff --git a/Marlin/src/feature/power_loss_recovery.h b/Marlin/src/feature/power_loss_recovery.h index 57873df26503..771fce44dfd9 100644 --- a/Marlin/src/feature/power_loss_recovery.h +++ b/Marlin/src/feature/power_loss_recovery.h @@ -26,12 +26,16 @@ */ #include "../sd/cardreader.h" -#include "../inc/MarlinConfigPre.h" +#include "../inc/MarlinConfig.h" #if ENABLED(MIXING_EXTRUDER) #include "../feature/mixing.h" #endif +#if !defined(POWER_LOSS_STATE) && PIN_EXISTS(POWER_LOSS) + #define POWER_LOSS_STATE HIGH +#endif + //#define DEBUG_POWER_LOSS_RECOVERY //#define SAVE_EACH_CMD_MODE //#define SAVE_INFO_INTERVAL_MS 0 @@ -40,13 +44,13 @@ typedef struct { uint8_t valid_head; // Machine state - float current_position[NUM_AXIS]; + xyze_pos_t current_position; #if HAS_HOME_OFFSET - float home_offset[XYZ]; + xyz_pos_t home_offset; #endif #if HAS_POSITION_SHIFT - float position_shift[XYZ]; + xyz_pos_t position_shift; #endif uint16_t feedrate; @@ -55,7 +59,18 @@ typedef struct { uint8_t active_extruder; #endif - int16_t target_temperature[HOTENDS]; + #if DISABLED(NO_VOLUMETRICS) + bool volumetric_enabled; + #if EXTRUDERS > 1 + float filament_size[EXTRUDERS]; + #else + float filament_size; + #endif + #endif + + #if HOTENDS + int16_t target_temperature[HOTENDS]; + #endif #if HAS_HEATED_BED int16_t target_temperature_bed; @@ -83,16 +98,12 @@ typedef struct { #endif #endif - // Relative mode - bool relative_mode, relative_modes_e; - - // Command queue - uint8_t queue_length, queue_index_r; - char queue_buffer[BUFSIZE][MAX_CMD_SIZE]; + // Relative axis modes + uint8_t axis_relative; // SD Filename and position char sd_filename[MAXPATHNAMELENGTH]; - uint32_t sdpos; + volatile uint32_t sdpos; // Job elapsed time millis_t print_job_elapsed; @@ -103,10 +114,35 @@ typedef struct { class PrintJobRecovery { public: + static const char filename[5]; + static SdFile file; static job_recovery_info_t info; + static uint8_t queue_index_r; //!< Queue index of the active command + static uint32_t cmd_sdpos, //!< SD position of the next command + sdpos[BUFSIZE]; //!< SD positions of queued commands + static void init(); + static void prepare(); + + static inline void setup() { + #if PIN_EXISTS(POWER_LOSS) + #if ENABLED(POWER_LOSS_PULL) + #if POWER_LOSS_STATE == LOW + SET_INPUT_PULLUP(POWER_LOSS_PIN); + #else + SET_INPUT_PULLDOWN(POWER_LOSS_PIN); + #endif + #else + SET_INPUT(POWER_LOSS_PIN); + #endif + #endif + } + + // Track each command's file offsets + static inline uint32_t command_sdpos() { return sdpos[queue_index_r]; } + static inline void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; } static bool enabled; static void enable(const bool onoff); @@ -130,16 +166,31 @@ class PrintJobRecovery { , const bool save_queue=true ); + #if PIN_EXISTS(POWER_LOSS) + static inline void outage() { + if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) + _outage(); + } + #endif + static inline bool valid() { return info.valid_head && info.valid_head == info.valid_foot; } #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) static void debug(PGM_P const prefix); #else - static inline void debug(PGM_P const prefix) { UNUSED(prefix); } + static inline void debug(PGM_P const) {} #endif private: static void write(); + + #if ENABLED(BACKUP_POWER_SUPPLY) + static void raise_z(); + #endif + + #if PIN_EXISTS(POWER_LOSS) + static void _outage(); + #endif }; extern PrintJobRecovery recovery; diff --git a/Marlin/src/feature/prusa_MMU2/mmu2.cpp b/Marlin/src/feature/prusa_MMU2/mmu2.cpp index 8453afc6012f..2fdd6c09c587 100644 --- a/Marlin/src/feature/prusa_MMU2/mmu2.cpp +++ b/Marlin/src/feature/prusa_MMU2/mmu2.cpp @@ -35,13 +35,17 @@ MMU2 mmu2; #include "../../libs/nozzle.h" #include "../../module/temperature.h" #include "../../module/planner.h" -#include "../../module/stepper_indirection.h" +#include "../../module/stepper/indirection.h" #include "../../Marlin.h" #if ENABLED(HOST_PROMPT_SUPPORT) #include "../../feature/host_actions.h" #endif +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extensible_ui/ui_api.h" +#endif + #define DEBUG_OUT ENABLED(MMU2_DEBUG) #include "../../core/debug_out.h" @@ -93,13 +97,13 @@ volatile int8_t MMU2::finda = 1; volatile bool MMU2::finda_runout_valid; int16_t MMU2::version = -1, MMU2::buildnr = -1; millis_t MMU2::last_request, MMU2::next_P0_request; -char MMU2::rx_buffer[16], MMU2::tx_buffer[16]; +char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE]; #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) struct E_Step { - float extrude; //!< extrude distance in mm - float feedRate; //!< feed rate in mm/s + float extrude; //!< extrude distance in mm + feedRate_t feedRate; //!< feed rate in mm/s }; static constexpr E_Step ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE }; @@ -428,10 +432,8 @@ bool MMU2::rx_ok() { */ void MMU2::check_version() { if (buildnr < MMU_REQUIRED_FW_BUILDNR) { - SERIAL_ERROR_START(); - SERIAL_ECHOPGM("MMU2 firmware version invalid. Required version >= "); - SERIAL_ECHOLN(MMU_REQUIRED_FW_BUILDNR); - kill(MSG_MMU2_WRONG_FIRMWARE); + SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required."); + kill(GET_TEXT(MSG_MMU2_WRONG_FIRMWARE)); } } @@ -447,7 +449,7 @@ void MMU2::tool_change(uint8_t index) { if (index != extruder) { disable_E0(); - ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); command(MMU_CMD_T0 + index); @@ -529,7 +531,7 @@ void MMU2::command(const uint8_t mmu_cmd) { /** * Wait for response from MMU */ -bool MMU2::get_response(void) { +bool MMU2::get_response() { while (cmd != MMU_CMD_NONE) idle(); while (!ready) { @@ -548,10 +550,10 @@ bool MMU2::get_response(void) { */ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { + constexpr xyz_pos_t park_point = NOZZLE_PARK_POINT; bool response = false; mmu_print_saved = false; - point_t park_point = NOZZLE_PARK_POINT; - float resume_position[XYZE]; + xyz_pos_t resume_position; int16_t resume_hotend_temp; KEEPALIVE_STATE(PAUSED_FOR_USER); @@ -570,10 +572,10 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { SERIAL_ECHOLNPGM("MMU not responding"); resume_hotend_temp = thermalManager.degTargetHotend(active_extruder); - COPY(resume_position, current_position); + resume_position = current_position; if (move_axes && all_axes_homed()) - Nozzle::park(2, park_point /*= NOZZLE_PARK_POINT*/); + nozzle.park(2, park_point /*= NOZZLE_PARK_POINT*/); if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder); @@ -602,10 +604,10 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { BUZZ(200, 404); // Move XY to starting position, then Z - do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE); + do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); // Move Z_AXIS to saved position - do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); + do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); } else { BUZZ(200, 404); @@ -694,12 +696,10 @@ void MMU2::filament_runout() { } LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT); - const bool saved_e_relative_mode = gcode.axis_relative_modes[E_AXIS]; - gcode.axis_relative_modes[E_AXIS] = true; enable_E0(); - current_position[E_AXIS] -= MMU2_FILAMENTCHANGE_EJECT_FEED; - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder); + current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED; + line_to_current_position(2500 / 60); planner.synchronize(); command(MMU_CMD_E0 + index); manage_response(false, false); @@ -709,7 +709,10 @@ void MMU2::filament_runout() { BUZZ(200, 404); wait_for_user = true; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR); + #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover")); #endif while (wait_for_user) idle(); BUZZ(200, 404); @@ -728,8 +731,6 @@ void MMU2::filament_runout() { BUZZ(200, 404); - gcode.axis_relative_modes[E_AXIS] = saved_e_relative_mode; - disable_E0(); return true; @@ -777,28 +778,22 @@ void MMU2::filament_runout() { planner.synchronize(); enable_E0(); - const bool saved_e_relative_mode = gcode.axis_relative_modes[E_AXIS]; - gcode.axis_relative_modes[E_AXIS] = true; - const E_Step* step = sequence; for (uint8_t i = 0; i < steps; i++) { - const float es = pgm_read_float(&(step->extrude)), - fr = pgm_read_float(&(step->feedRate)); + const float es = pgm_read_float(&(step->extrude)); + const feedRate_t fr_mm_m = pgm_read_float(&(step->feedRate)); DEBUG_ECHO_START(); - DEBUG_ECHOLNPAIR("E step ", es, "/", fr); + DEBUG_ECHOLNPAIR("E step ", es, "/", fr_mm_m); - current_position[E_AXIS] += es; - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_AXIS], MMM_TO_MMS(fr), active_extruder); + current_position.e += es; + line_to_current_position(MMM_TO_MMS(fr_mm_m)); planner.synchronize(); step++; } - gcode.axis_relative_modes[E_AXIS] = saved_e_relative_mode; - disable_E0(); } diff --git a/Marlin/src/feature/prusa_MMU2/mmu2.h b/Marlin/src/feature/prusa_MMU2/mmu2.h index 0c20be9d8e01..9628c4be7f5b 100644 --- a/Marlin/src/feature/prusa_MMU2/mmu2.h +++ b/Marlin/src/feature/prusa_MMU2/mmu2.h @@ -27,6 +27,14 @@ #include "../runout.h" #endif +#if SERIAL_USB + #define MMU_RX_SIZE 256 + #define MMU_TX_SIZE 256 +#else + #define MMU_RX_SIZE 16 + #define MMU_TX_SIZE 16 +#endif + struct E_Step; class MMU2 { @@ -61,7 +69,7 @@ class MMU2 { static void check_version(); static void command(const uint8_t cmd); - static bool get_response(void); + static bool get_response(); static void manage_response(const bool move_axes, const bool turn_off_nozzle); #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) @@ -79,7 +87,7 @@ class MMU2 { static volatile bool finda_runout_valid; static int16_t version, buildnr; static millis_t last_request, next_P0_request; - static char rx_buffer[16], tx_buffer[16]; + static char rx_buffer[MMU_RX_SIZE], tx_buffer[MMU_TX_SIZE]; static inline void set_runout_valid(const bool valid) { finda_runout_valid = valid; diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index a4172fc08600..6b8905c3b995 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -58,4 +58,79 @@ void FilamentSensorBase::filament_present(const uint8_t extruder) { int8_t RunoutResponseDebounced::runout_count; // = 0 #endif +// +// Filament Runout event handler +// +#include "../Marlin.h" +#include "../gcode/queue.h" + +#if ENABLED(HOST_ACTION_COMMANDS) + #include "host_actions.h" +#endif + +#if ENABLED(EXTENSIBLE_UI) + #include "../lcd/extensible_ui/ui_api.h" +#endif + +void event_filament_runout() { + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + if (did_pause_print) return; // Action already in progress. Purge triggered repeated runout. + #endif + + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onFilamentRunout(ExtUI::getActiveTool()); + #endif + + #if EITHER(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS) + const char tool = '0' + #if NUM_RUNOUT_SENSORS > 1 + + active_extruder + #endif + ; + #endif + + //action:out_of_filament + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_reason = PROMPT_FILAMENT_RUNOUT; + host_action_prompt_end(); + host_action_prompt_begin(PSTR("FilamentRunout T"), false); + SERIAL_CHAR(tool); + SERIAL_EOL(); + host_action_prompt_show(); + #endif + + const bool run_runout_script = !runout.host_handling; + + #if ENABLED(HOST_ACTION_COMMANDS) + if (run_runout_script + && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600") + || strstr(FILAMENT_RUNOUT_SCRIPT, "M125") + #if ENABLED(ADVANCED_PAUSE_FEATURE) + || strstr(FILAMENT_RUNOUT_SCRIPT, "M25") + #endif + ) + ) { + host_action_paused(false); + } + else { + // Legacy Repetier command for use until newer version supports standard dialog + // To be removed later when pause command also triggers dialog + #ifdef ACTION_ON_FILAMENT_RUNOUT + host_action(PSTR(ACTION_ON_FILAMENT_RUNOUT " T"), false); + SERIAL_CHAR(tool); + SERIAL_EOL(); + #endif + + host_action_pause(false); + } + SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " "); + SERIAL_CHAR(tool); + SERIAL_EOL(); + #endif // HOST_ACTION_COMMANDS + + if (run_runout_script) + queue.inject_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); +} + #endif // HAS_FILAMENT_SENSOR diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 5c4b4d56845b..4fed18e359f8 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -27,7 +27,8 @@ #include "../sd/cardreader.h" #include "../module/printcounter.h" -#include "../module/stepper.h" +#include "../module/planner.h" +#include "../module/stepper.h" // for block_t #include "../gcode/queue.h" #include "../inc/MarlinConfig.h" @@ -45,6 +46,8 @@ #define FILAMENT_RUNOUT_THRESHOLD 5 #endif +void event_filament_runout(); + class FilamentMonitorBase { public: static bool enabled, filament_ran_out; @@ -97,7 +100,11 @@ class TFilamentMonitor : public FilamentMonitorBase { // Give the response a chance to update its counter. static inline void run() { - if (enabled && !filament_ran_out && (IS_SD_PRINTING() || print_job_timer.isRunning() || did_pause_print)) { + if (enabled && !filament_ran_out && (printingIsActive() + #if ENABLED(ADVANCED_PAUSE_FEATURE) + || did_pause_print + #endif + )) { #ifdef FILAMENT_RUNOUT_DISTANCE_MM cli(); // Prevent RunoutResponseDelayed::block_completed from accumulating here #endif @@ -249,6 +256,8 @@ class FilamentSensorBase { && (dual_x_carriage_mode == DXC_DUPLICATION_MODE || dual_x_carriage_mode == DXC_MIRRORED_MODE) #elif ENABLED(MULTI_NOZZLE_DUPLICATION) && extruder_duplication_enabled + #else + && false #endif #endif ) return runout_states; // Any extruder @@ -259,7 +268,7 @@ class FilamentSensorBase { } public: - static inline void block_completed(const block_t* const b) { UNUSED(b); } + static inline void block_completed(const block_t* const) {} static inline void run() { const bool out = poll_runout_state(active_extruder); @@ -320,14 +329,14 @@ class FilamentSensorBase { } static inline void block_completed(const block_t* const b) { - if (b->steps[X_AXIS] || b->steps[Y_AXIS] || b->steps[Z_AXIS] + if (b->steps.x || b->steps.y || b->steps.z #if ENABLED(ADVANCED_PAUSE_FEATURE) || did_pause_print // Allow pause purge move to re-trigger runout state #endif ) { // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover. const uint8_t e = b->extruder; - const int32_t steps = b->steps[E_AXIS]; + const int32_t steps = b->steps.e; runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.steps_to_mm[E_AXIS_N(e)]; } } @@ -346,8 +355,8 @@ class FilamentSensorBase { static inline void reset() { runout_count = runout_threshold; } static inline void run() { if (runout_count >= 0) runout_count--; } static inline bool has_run_out() { return runout_count < 0; } - static inline void block_completed(const block_t* const b) { UNUSED(b); } - static inline void filament_present(const uint8_t extruder) { runout_count = runout_threshold; UNUSED(extruder); } + static inline void block_completed(const block_t* const) { } + static inline void filament_present(const uint8_t) { runout_count = runout_threshold; } }; #endif // !FILAMENT_RUNOUT_DISTANCE_MM diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index 81865fddb6cd..775e7a864aef 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -34,14 +34,16 @@ SpindleLaser cutter; cutter_power_t SpindleLaser::power; // = 0 +#define SPINDLE_LASER_PWM_OFF ((SPINDLE_LASER_PWM_INVERT) ? 255 : 0) + void SpindleLaser::init() { OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Init spindle to off #if ENABLED(SPINDLE_CHANGE_DIR) OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // Init rotation to clockwise (M3) #endif - #if ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) + #if ENABLED(SPINDLE_LASER_PWM) SET_PWM(SPINDLE_LASER_PWM_PIN); - analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_INVERT ? 255 : 0); // set to lowest speed + analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // set to lowest speed #endif } @@ -54,34 +56,34 @@ void SpindleLaser::init() { */ void SpindleLaser::set_ocr(const uint8_t ocr) { WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_HIGH); // turn spindle on (active low) - #if ENABLED(SPINDLE_LASER_PWM) - analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), (SPINDLE_LASER_PWM_INVERT) ? 255 - ocr : ocr); - #endif + analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); } #endif -void SpindleLaser::update_output() { - const bool ena = enabled(); +void SpindleLaser::apply_power(const cutter_power_t inpow) { + static cutter_power_t last_power_applied = 0; + if (inpow == last_power_applied) return; + last_power_applied = inpow; #if ENABLED(SPINDLE_LASER_PWM) - if (ena) { + if (enabled()) { + #define _scaled(F) ((F - (SPEED_POWER_INTERCEPT)) * inv_slope) constexpr float inv_slope = RECIPROCAL(SPEED_POWER_SLOPE), - min_ocr = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * inv_slope, // Minimum allowed - max_ocr = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * inv_slope; // Maximum allowed + min_ocr = _scaled(SPEED_POWER_MIN), + max_ocr = _scaled(SPEED_POWER_MAX); int16_t ocr_val; - if (power <= SPEED_POWER_MIN) ocr_val = min_ocr; // Use minimum if set below - else if (power >= SPEED_POWER_MAX) ocr_val = max_ocr; // Use maximum if set above - else ocr_val = (power - (SPEED_POWER_INTERCEPT)) * inv_slope; // Use calculated OCR value - set_ocr(ocr_val & 0xFF); // ...limited to Atmel PWM max + if (inpow <= SPEED_POWER_MIN) ocr_val = min_ocr; // Use minimum if set below + else if (inpow >= SPEED_POWER_MAX) ocr_val = max_ocr; // Use maximum if set above + else ocr_val = _scaled(inpow); // Use calculated OCR value + set_ocr(ocr_val & 0xFF); // ...limited to Atmel PWM max } - else { // Convert RPM to PWM duty cycle - WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Turn spindle off (active low) - analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_INVERT ? 255 : 0); // Only write low byte + else { + WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Turn spindle off (active low) + analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Only write low byte } #else - WRITE(SPINDLE_LASER_ENA_PIN, ena ? SPINDLE_LASER_ACTIVE_HIGH : !SPINDLE_LASER_ACTIVE_HIGH); + WRITE(SPINDLE_LASER_ENA_PIN, (SPINDLE_LASER_ACTIVE_HIGH) ? enabled() : !enabled()); #endif - power_delay(ena); } #if ENABLED(SPINDLE_CHANGE_DIR) diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 5d70895ef5cb..26d7c301b4ee 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -36,42 +36,54 @@ #define MSG_CUTTER(M) _MSG_CUTTER(M) #if SPEED_POWER_MAX > 255 - #define cutter_power_t uint16_t + typedef uint16_t cutter_power_t; #define CUTTER_MENU_TYPE uint16_5 #else - #define cutter_power_t uint8_t + typedef uint8_t cutter_power_t; #define CUTTER_MENU_TYPE uint8 #endif class SpindleLaser { public: static cutter_power_t power; + static inline uint8_t powerPercent(const uint8_t pp) { return ui8_to_percent(pp); } // for display static void init(); static inline bool enabled() { return !!power; } - static inline void set_power(const uint8_t pwr) { power = pwr; update_output(); } + static inline void set_power(const cutter_power_t pwr) { power = pwr; } - static inline void set_enabled(const bool enable) { set_power(enable ? 255 : 0); } + static inline void refresh() { apply_power(power); } + + static inline void set_enabled(const bool enable) { + const bool was = enabled(); + set_power(enable ? 255 : 0); + if (was != enable) power_delay(); + } + + static void apply_power(const cutter_power_t inpow); //static bool active() { return READ(SPINDLE_LASER_ENA_PIN) == SPINDLE_LASER_ACTIVE_HIGH; } + static void update_output(); + #if ENABLED(SPINDLE_LASER_PWM) - static void update_output(); static void set_ocr(const uint8_t ocr); - static inline void set_ocr_power(const uint8_t pwr) { power = pwr; set_ocr(pwr); } - #else - static inline void update_output() { } + static inline void set_ocr_power(const cutter_power_t pwr) { power = pwr; set_ocr(pwr); } #endif // Wait for spindle to spin up or spin down - static inline void power_delay(const bool on) { safe_delay(on ? SPINDLE_LASER_POWERUP_DELAY : SPINDLE_LASER_POWERDOWN_DELAY); } + static inline void power_delay() { + #if SPINDLE_LASER_POWERUP_DELAY || SPINDLE_LASER_POWERDOWN_DELAY + safe_delay(enabled() ? SPINDLE_LASER_POWERUP_DELAY : SPINDLE_LASER_POWERDOWN_DELAY); + #endif + } #if ENABLED(SPINDLE_CHANGE_DIR) static void set_direction(const bool reverse); #else - static inline void set_direction(const bool reverse) { UNUSED(reverse); } + static inline void set_direction(const bool) {} #endif static inline void disable() { set_enabled(false); } diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index c432a3cf9abe..f5c950983167 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -27,7 +27,7 @@ #include "tmc_util.h" #include "../Marlin.h" -#include "../module/stepper_indirection.h" +#include "../module/stepper/indirection.h" #include "../module/printcounter.h" #include "../libs/duration_t.h" #include "../gcode/gcode.h" @@ -69,7 +69,7 @@ #endif ; #if ENABLED(TMC_DEBUG) - #if HAS_TMCX1X0 || HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) + #if HAS_TMCX1X0 || HAS_TMC220x uint8_t cs_actual; #endif #if HAS_STALLGUARD @@ -139,7 +139,7 @@ #endif // HAS_TMCX1X0 - #if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) + #if HAS_TMC220x #if ENABLED(TMC_DEBUG) static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); } @@ -239,7 +239,7 @@ st.printLabel(); SERIAL_CHAR(':'); SERIAL_PRINT(pwm_scale, DEC); #if ENABLED(TMC_DEBUG) - #if HAS_TMCX1X0 || HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) + #if HAS_TMCX1X0 || HAS_TMC220x SERIAL_CHAR('/'); SERIAL_PRINT(data.cs_actual, DEC); #endif #if HAS_STALLGUARD @@ -265,10 +265,30 @@ SERIAL_CHAR('\t'); } + #if CURRENT_STEP_DOWN > 0 + + template + void step_current_down(TMC &st) { + if (st.isEnabled()) { + const uint16_t I_rms = st.getMilliamps() - (CURRENT_STEP_DOWN); + if (I_rms > 50) { + st.rms_current(I_rms); + #if ENABLED(REPORT_CURRENT_CHANGE) + st.printLabel(); + SERIAL_ECHOLNPAIR(" current decreased to ", I_rms); + #endif + } + } + } + + #endif + template - void monitor_tmc_driver(TMC &st, const bool need_update_error_counters, const bool need_debug_reporting) { + bool monitor_tmc_driver(TMC &st, const bool need_update_error_counters, const bool need_debug_reporting) { TMC_driver_data data = get_driver_data(st); - if (data.drv_status == 0xFFFFFFFF || data.drv_status == 0x0) return; + if (data.drv_status == 0xFFFFFFFF || data.drv_status == 0x0) return false; + + bool did_step_down = false; if (need_update_error_counters) { if (data.is_ot /* | data.s2ga | data.s2gb*/) st.error_count++; @@ -288,15 +308,9 @@ #if CURRENT_STEP_DOWN > 0 // Decrease current if is_otpw is true and driver is enabled and there's been more than 4 warnings - if (data.is_otpw && st.otpw_count > 4) { - uint16_t I_rms = st.getMilliamps(); - if (st.isEnabled() && I_rms > 100) { - st.rms_current(I_rms - (CURRENT_STEP_DOWN)); - #if ENABLED(REPORT_CURRENT_CHANGE) - st.printLabel(); - SERIAL_ECHOLNPAIR(" current decreased to ", st.getMilliamps()); - #endif - } + if (data.is_otpw && st.otpw_count > 4 && st.isEnabled()) { + step_current_down(st); + did_step_down = true; } #endif @@ -308,64 +322,105 @@ } #if ENABLED(TMC_DEBUG) - if (need_debug_reporting) - report_polled_driver_data(st, data); + if (need_debug_reporting) report_polled_driver_data(st, data); #endif + + return did_step_down; } - void monitor_tmc_driver() { - static millis_t next_poll = 0; + void monitor_tmc_drivers() { const millis_t ms = millis(); - bool need_update_error_counters = ELAPSED(ms, next_poll); - bool need_debug_reporting = false; - if (need_update_error_counters) - next_poll = ms + MONITOR_DRIVER_STATUS_INTERVAL_MS; + + // Poll TMC drivers at the configured interval + static millis_t next_poll = 0; + const bool need_update_error_counters = ELAPSED(ms, next_poll); + if (need_update_error_counters) next_poll = ms + MONITOR_DRIVER_STATUS_INTERVAL_MS; + + // Also poll at intervals for debugging #if ENABLED(TMC_DEBUG) static millis_t next_debug_reporting = 0; - if (report_tmc_status_interval && ELAPSED(ms, next_debug_reporting)) { - need_debug_reporting = true; - next_debug_reporting = ms + report_tmc_status_interval; - } + const bool need_debug_reporting = report_tmc_status_interval && ELAPSED(ms, next_debug_reporting); + if (need_debug_reporting) next_debug_reporting = ms + report_tmc_status_interval; + #else + constexpr bool need_debug_reporting = false; #endif + if (need_update_error_counters || need_debug_reporting) { #if AXIS_IS_TMC(X) - monitor_tmc_driver(stepperX, need_update_error_counters, need_debug_reporting); - #endif - #if AXIS_IS_TMC(Y) - monitor_tmc_driver(stepperY, need_update_error_counters, need_debug_reporting); - #endif - #if AXIS_IS_TMC(Z) - monitor_tmc_driver(stepperZ, need_update_error_counters, need_debug_reporting); + if (monitor_tmc_driver(stepperX, need_update_error_counters, need_debug_reporting)) { + #if AXIS_IS_TMC(X2) + step_current_down(stepperX2); + #endif + } #endif #if AXIS_IS_TMC(X2) - monitor_tmc_driver(stepperX2, need_update_error_counters, need_debug_reporting); + if (monitor_tmc_driver(stepperX2, need_update_error_counters, need_debug_reporting)) { + #if AXIS_IS_TMC(X) + step_current_down(stepperX); + #endif + } + #endif + #if AXIS_IS_TMC(Y) + if (monitor_tmc_driver(stepperY, need_update_error_counters, need_debug_reporting)) { + #if AXIS_IS_TMC(Y2) + step_current_down(stepperY2); + #endif + } #endif #if AXIS_IS_TMC(Y2) - monitor_tmc_driver(stepperY2, need_update_error_counters, need_debug_reporting); + if (monitor_tmc_driver(stepperY2, need_update_error_counters, need_debug_reporting)) { + #if AXIS_IS_TMC(Y) + step_current_down(stepperY); + #endif + } + #endif + #if AXIS_IS_TMC(Z) + if (monitor_tmc_driver(stepperZ, need_update_error_counters, need_debug_reporting)) { + #if AXIS_IS_TMC(Z2) + step_current_down(stepperZ2); + #endif + #if AXIS_IS_TMC(Z3) + step_current_down(stepperZ3); + #endif + } #endif #if AXIS_IS_TMC(Z2) - monitor_tmc_driver(stepperZ2, need_update_error_counters, need_debug_reporting); + if (monitor_tmc_driver(stepperZ2, need_update_error_counters, need_debug_reporting)) { + #if AXIS_IS_TMC(Z) + step_current_down(stepperZ); + #endif + #if AXIS_IS_TMC(Z3) + step_current_down(stepperZ3); + #endif + } #endif #if AXIS_IS_TMC(Z3) - monitor_tmc_driver(stepperZ3, need_update_error_counters, need_debug_reporting); + if (monitor_tmc_driver(stepperZ3, need_update_error_counters, need_debug_reporting)) { + #if AXIS_IS_TMC(Z) + step_current_down(stepperZ); + #endif + #if AXIS_IS_TMC(Z2) + step_current_down(stepperZ2); + #endif + } #endif #if AXIS_IS_TMC(E0) - monitor_tmc_driver(stepperE0, need_update_error_counters, need_debug_reporting); + (void)monitor_tmc_driver(stepperE0, need_update_error_counters, need_debug_reporting); #endif #if AXIS_IS_TMC(E1) - monitor_tmc_driver(stepperE1, need_update_error_counters, need_debug_reporting); + (void)monitor_tmc_driver(stepperE1, need_update_error_counters, need_debug_reporting); #endif #if AXIS_IS_TMC(E2) - monitor_tmc_driver(stepperE2, need_update_error_counters, need_debug_reporting); + (void)monitor_tmc_driver(stepperE2, need_update_error_counters, need_debug_reporting); #endif #if AXIS_IS_TMC(E3) - monitor_tmc_driver(stepperE3, need_update_error_counters, need_debug_reporting); + (void)monitor_tmc_driver(stepperE3, need_update_error_counters, need_debug_reporting); #endif #if AXIS_IS_TMC(E4) - monitor_tmc_driver(stepperE4, need_update_error_counters, need_debug_reporting); + (void)monitor_tmc_driver(stepperE4, need_update_error_counters, need_debug_reporting); #endif #if AXIS_IS_TMC(E5) - monitor_tmc_driver(stepperE5, need_update_error_counters, need_debug_reporting); + (void)monitor_tmc_driver(stepperE5, need_update_error_counters, need_debug_reporting); #endif #if ENABLED(TMC_DEBUG) @@ -507,7 +562,7 @@ case TMC_GLOBAL_SCALER: { uint16_t value = st.GLOBAL_SCALER(); - SERIAL_PRINT(value ? value : 256, DEC); + SERIAL_PRINT(value ?: 256, DEC); SERIAL_ECHOPGM("/256"); } break; @@ -516,7 +571,7 @@ } #endif - #if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) + #if HAS_TMC220x static void _tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) { switch (i) { case TMC_PWM_SCALE: SERIAL_PRINT(st.pwm_scale_sum(), DEC); break; @@ -787,22 +842,22 @@ #if HAS_DRIVER(TMC2160) || HAS_DRIVER(TMC5160) TMC_REPORT("Global scaler", TMC_GLOBAL_SCALER); #endif - TMC_REPORT("CS actual\t", TMC_CS_ACTUAL); + TMC_REPORT("CS actual", TMC_CS_ACTUAL); TMC_REPORT("PWM scale", TMC_PWM_SCALE); - #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2224) || HAS_DRIVER(TMC2660) || HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) + #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2224) || HAS_DRIVER(TMC2660) || HAS_TMC220x TMC_REPORT("vsense\t", TMC_VSENSE); #endif TMC_REPORT("stealthChop", TMC_STEALTHCHOP); TMC_REPORT("msteps\t", TMC_MICROSTEPS); TMC_REPORT("tstep\t", TMC_TSTEP); - TMC_REPORT("pwm\nthreshold\t", TMC_TPWMTHRS); + TMC_REPORT("pwm\nthreshold", TMC_TPWMTHRS); TMC_REPORT("[mm/s]\t", TMC_TPWMTHRS_MMS); TMC_REPORT("OT prewarn", TMC_OTPW); #if ENABLED(MONITOR_DRIVER_STATUS) TMC_REPORT("OT prewarn has\n" "been triggered", TMC_OTPW_TRIGGERED); #endif - TMC_REPORT("off time\t", TMC_TOFF); + TMC_REPORT("off time", TMC_TOFF); TMC_REPORT("blank time", TMC_TBL); TMC_REPORT("hysteresis\n-end\t", TMC_HEND); TMC_REPORT("-start\t", TMC_HSTRT); @@ -811,7 +866,7 @@ DRV_REPORT("DRVSTATUS", TMC_DRV_CODES); #if HAS_TMCX1X0 DRV_REPORT("stallguard\t", TMC_STALLGUARD); - DRV_REPORT("sg_result\t", TMC_SG_RESULT); + DRV_REPORT("sg_result", TMC_SG_RESULT); DRV_REPORT("fsactive\t", TMC_FSACTIVE); #endif DRV_REPORT("stst\t", TMC_STST); @@ -821,7 +876,7 @@ DRV_REPORT("s2ga\t", TMC_S2GA); DRV_REPORT("otpw\t", TMC_DRV_OTPW); DRV_REPORT("ot\t", TMC_OT); - #if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) + #if HAS_TMC220x DRV_REPORT("157C\t", TMC_T157); DRV_REPORT("150C\t", TMC_T150); DRV_REPORT("143C\t", TMC_T143); @@ -845,7 +900,7 @@ } } #endif - #if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) + #if HAS_TMC220x static void tmc_get_ic_registers(TMC2208Stepper, const TMC_get_registers_enum) { SERIAL_CHAR('\t'); } #endif @@ -1118,7 +1173,7 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z #endif } - if (axis_connection) ui.set_status_P(PSTR("TMC CONNECTION ERROR")); + if (axis_connection) ui.set_status_P(GET_TEXT(MSG_ERROR_TMC)); } #endif // HAS_TRINAMIC diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 1df9a1a3b3ce..8fa143387a34 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -103,9 +103,15 @@ class TMCMarlin : public TMC, public TMCStorage { TMCMarlin(const uint16_t cs_pin, const float RS) : TMC(cs_pin, RS) {} + TMCMarlin(const uint16_t cs_pin, const float RS, const uint8_t axis_chain_index) : + TMC(cs_pin, RS, axis_chain_index) + {} TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK) : TMC(CS, RS, pinMOSI, pinMISO, pinSCK) {} + TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK, const uint8_t axis_chain_index) : + TMC(CS, RS, pinMOSI, pinMISO, pinSCK, axis_chain_index) + {} inline uint16_t rms_current() { return TMC::rms_current(); } inline void rms_current(uint16_t mA) { this->val_mA = mA; @@ -140,6 +146,9 @@ class TMCMarlin : public TMC, public TMCStorage { this->stored.homing_thrs = sgt_val; #endif } + #if ENABLED(SPI_ENDSTOPS) + bool test_stall_status(); + #endif #endif #if HAS_LCD_MENU @@ -160,7 +169,7 @@ template class TMCMarlin : public TMC2208Stepper, public TMCStorage { public: TMCMarlin(Stream * SerialPort, const float RS, const uint8_t) : - TMC2208Stepper(SerialPort, RS, /*has_rx=*/true) + TMC2208Stepper(SerialPort, RS) {} TMCMarlin(const uint16_t RX, const uint16_t TX, const float RS, const uint8_t, const bool has_rx=true) : TMC2208Stepper(RX, TX, RS, has_rx) @@ -264,10 +273,10 @@ class TMCMarlin : public TMC220 template class TMCMarlin : public TMC2660Stepper, public TMCStorage { public: - TMCMarlin(const uint16_t cs_pin, const float RS) : + TMCMarlin(const uint16_t cs_pin, const float RS, const uint8_t) : TMC2660Stepper(cs_pin, RS) {} - TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK) : + TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK, const uint8_t) : TMC2660Stepper(CS, RS, pinMOSI, pinMISO, pinSCK) {} inline uint16_t rms_current() { return TMC2660Stepper::rms_current(); } @@ -336,7 +345,7 @@ void tmc_print_current(TMC &st) { } #endif -void monitor_tmc_driver(); +void monitor_tmc_drivers(); void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z, const bool test_e); #if ENABLED(TMC_DEBUG) @@ -348,17 +357,28 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z #endif /** - * TMC2130 specific sensorless homing using stallGuard2. + * TMC2130-specific sensorless homing using stallGuard2. * stallGuard2 only works when in spreadCycle mode. - * spreadCycle and stealthChop are mutually exclusive. + * spreadCycle and stealthChop are mutually-exclusive. * * Defined here because of limitations with templates and headers. */ #if USE_SENSORLESS + // Track enabled status of stealthChop and only re-enable where applicable - struct sensorless_t { - bool x, y, z, x2, y2, z2, z3; - }; + struct sensorless_t { bool x, y, z, x2, y2, z2, z3; }; + + #if ENABLED(IMPROVE_HOMING_RELIABILITY) + extern millis_t sg_guard_period; + constexpr uint16_t default_sg_guard_duration = 400; + + struct slow_homing_t { + xy_ulong_t acceleration; + #if HAS_CLASSIC_JERK + xy_float_t jerk_xy; + #endif + }; + #endif bool tmc_enable_stallguard(TMC2130Stepper &st); void tmc_disable_stallguard(TMC2130Stepper &st, const bool restore_stealth); @@ -368,7 +388,24 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z bool tmc_enable_stallguard(TMC2660Stepper); void tmc_disable_stallguard(TMC2660Stepper, const bool); -#endif + + #if ENABLED(SPI_ENDSTOPS) + + template + bool TMCMarlin::test_stall_status() { + this->switchCSpin(LOW); + + // read stallGuard flag from TMC library, will handle HW and SW SPI + TMC2130_n::DRV_STATUS_t drv_status{0}; + drv_status.sr = this->DRV_STATUS(); + + this->switchCSpin(HIGH); + + return drv_status.stallGuard; + } + #endif // SPI_ENDSTOPS + +#endif // USE_SENSORLESS #if TMC_HAS_SPI void tmc_init_cs_pins(); diff --git a/Marlin/src/feature/touch/xpt2046.cpp b/Marlin/src/feature/touch/xpt2046.cpp new file mode 100644 index 000000000000..b0ab10e7ce1b --- /dev/null +++ b/Marlin/src/feature/touch/xpt2046.cpp @@ -0,0 +1,146 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(TOUCH_BUTTONS) + +#include "xpt2046.h" +#include "../../inc/MarlinConfig.h" + +#ifndef TOUCH_INT_PIN + #define TOUCH_INT_PIN -1 +#endif +#ifndef TOUCH_MISO_PIN + #define TOUCH_MISO_PIN MISO_PIN +#endif +#ifndef TOUCH_MOSI_PIN + #define TOUCH_MOSI_PIN MOSI_PIN +#endif +#ifndef TOUCH_SCK_PIN + #define TOUCH_SCK_PIN SCK_PIN +#endif +#ifndef TOUCH_CS_PIN + #define TOUCH_CS_PIN CS_PIN +#endif + +XPT2046 touch; +extern int8_t encoderDiff; + +void XPT2046::init() { + SET_INPUT(TOUCH_MISO_PIN); + SET_OUTPUT(TOUCH_MOSI_PIN); + SET_OUTPUT(TOUCH_SCK_PIN); + OUT_WRITE(TOUCH_CS_PIN, HIGH); + + #if PIN_EXISTS(TOUCH_INT) + // Optional Pendrive interrupt pin + SET_INPUT(TOUCH_INT_PIN); + #endif + + // Read once to enable pendrive status pin + getInTouch(XPT2046_X); +} + +#include "../../lcd/ultralcd.h" // For EN_C bit mask + +uint8_t XPT2046::read_buttons() { + int16_t tsoffsets[4] = { 0 }; + + if (tsoffsets[0] + tsoffsets[1] == 0) { + // Not yet set, so use defines as fallback... + tsoffsets[0] = XPT2046_X_CALIBRATION; + tsoffsets[1] = XPT2046_X_OFFSET; + tsoffsets[2] = XPT2046_Y_CALIBRATION; + tsoffsets[3] = XPT2046_Y_OFFSET; + } + + // We rely on XPT2046 compatible mode to ADS7843, hence no Z1 and Z2 measurements possible. + + if (!isTouched()) return 0; + const uint16_t x = uint16_t(((uint32_t(getInTouch(XPT2046_X))) * tsoffsets[0]) >> 16) + tsoffsets[1], + y = uint16_t(((uint32_t(getInTouch(XPT2046_Y))) * tsoffsets[2]) >> 16) + tsoffsets[3]; + if (!isTouched()) return 0; // Fingers must still be on the TS for a valid read. + + if (y < 175 || y > 234) return 0; + + return WITHIN(x, 14, 77) ? EN_D + : WITHIN(x, 90, 153) ? EN_A + : WITHIN(x, 166, 229) ? EN_B + : WITHIN(x, 242, 305) ? EN_C + : 0; +} + +bool XPT2046::isTouched() { + return ( + #if PIN_EXISTS(TOUCH_INT) + READ(TOUCH_INT_PIN) != HIGH + #else + getInTouch(XPT2046_Z1) >= XPT2046_Z1_THRESHOLD + #endif + ); +} + +uint16_t XPT2046::getInTouch(const XPTCoordinate coordinate) { + uint16_t data[3]; + + OUT_WRITE(TOUCH_CS_PIN, LOW); + + const uint8_t coord = uint8_t(coordinate) | XPT2046_CONTROL | XPT2046_DFR_MODE; + for (uint16_t i = 0; i < 3 ; i++) { + for (uint8_t j = 0x80; j; j >>= 1) { + WRITE(TOUCH_SCK_PIN, LOW); + WRITE(TOUCH_MOSI_PIN, bool(coord & j)); + WRITE(TOUCH_SCK_PIN, HIGH); + } + + data[i] = 0; + for (uint16_t j = 0x8000; j; j >>= 1) { + WRITE(TOUCH_SCK_PIN, LOW); + if (READ(TOUCH_MISO_PIN)) data[i] |= j; + WRITE(TOUCH_SCK_PIN, HIGH); + } + WRITE(TOUCH_SCK_PIN, LOW); + data[i] >>= 4; + } + + WRITE(TOUCH_CS_PIN, HIGH); + + uint16_t delta01 = _MAX(data[0], data[1]) - _MIN(data[0], data[1]), + delta02 = _MAX(data[0], data[2]) - _MIN(data[0], data[2]), + delta12 = _MAX(data[1], data[2]) - _MIN(data[1], data[2]); + + if (delta01 <= delta02 && delta01 <= delta12) + return (data[0] + data[1]) >> 1; + + if (delta02 <= delta12) + return (data[0] + data[2]) >> 1; + + return (data[1] + data[2]) >> 1; +} + +bool XPT2046::getTouchPoint(uint16_t &x, uint16_t &y) { + if (isTouched()) { + x = getInTouch(XPT2046_X); + y = getInTouch(XPT2046_Y); + } + return isTouched(); +} + +#endif // TOUCH_BUTTONS diff --git a/Marlin/src/feature/touch/xpt2046.h b/Marlin/src/feature/touch/xpt2046.h new file mode 100644 index 000000000000..384d7904bd48 --- /dev/null +++ b/Marlin/src/feature/touch/xpt2046.h @@ -0,0 +1,53 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#include + +// Relies on XPT2046-compatible mode of ADS7843, +// hence no Z1 / Z2 measurements are possible. + +#define XPT2046_DFR_MODE 0x00 +#define XPT2046_SER_MODE 0x04 +#define XPT2046_CONTROL 0x80 + +enum XPTCoordinate : uint8_t { + XPT2046_X = 0x10, + XPT2046_Y = 0x50, + XPT2046_Z1 = 0x30, + XPT2046_Z2 = 0x40 +}; + +#ifndef XPT2046_Z1_THRESHOLD + #define XPT2046_Z1_THRESHOLD 10 +#endif + +class XPT2046 { +public: + static void init(); + static uint8_t read_buttons(); + bool getTouchPoint(uint16_t &x, uint16_t &y); + static bool isTouched(); + inline void waitForRelease() { while (isTouched()) { /* nada */ } } + inline void waitForTouch(uint16_t &x, uint16_t &y) { while (!getTouchPoint(x, y)) { /* nada */ } } +private: + static uint16_t getInTouch(const XPTCoordinate coordinate); +}; + +extern XPT2046 touch; diff --git a/Marlin/src/feature/twibus.cpp b/Marlin/src/feature/twibus.cpp index ccd778120ddb..f4fe512cdf3f 100644 --- a/Marlin/src/feature/twibus.cpp +++ b/Marlin/src/feature/twibus.cpp @@ -34,12 +34,12 @@ TWIBus::TWIBus() { #else Wire.begin(I2C_SLAVE_ADDRESS); // Join the bus as a slave #endif - this->reset(); + reset(); } void TWIBus::reset() { - this->buffer_s = 0; - this->buffer[0] = 0x00; + buffer_s = 0; + buffer[0] = 0x00; } void TWIBus::address(const uint8_t adr) { @@ -47,7 +47,7 @@ void TWIBus::address(const uint8_t adr) { SERIAL_ECHO_MSG("Bad I2C address (8-127)"); } - this->addr = adr; + addr = adr; #if ENABLED(DEBUG_TWIBUS) debug(PSTR("address"), adr); @@ -55,8 +55,8 @@ void TWIBus::address(const uint8_t adr) { } void TWIBus::addbyte(const char c) { - if (this->buffer_s >= COUNT(this->buffer)) return; - this->buffer[this->buffer_s++] = c; + if (buffer_s >= COUNT(buffer)) return; + buffer[buffer_s++] = c; #if ENABLED(DEBUG_TWIBUS) debug(PSTR("addbyte"), c); #endif @@ -66,26 +66,26 @@ void TWIBus::addbytes(char src[], uint8_t bytes) { #if ENABLED(DEBUG_TWIBUS) debug(PSTR("addbytes"), bytes); #endif - while (bytes--) this->addbyte(*src++); + while (bytes--) addbyte(*src++); } void TWIBus::addstring(char str[]) { #if ENABLED(DEBUG_TWIBUS) debug(PSTR("addstring"), str); #endif - while (char c = *str++) this->addbyte(c); + while (char c = *str++) addbyte(c); } void TWIBus::send() { #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("send"), this->addr); + debug(PSTR("send"), addr); #endif - Wire.beginTransmission(I2C_ADDRESS(this->addr)); - Wire.write(this->buffer, this->buffer_s); + Wire.beginTransmission(I2C_ADDRESS(addr)); + Wire.write(buffer, buffer_s); Wire.endTransmission(); - this->reset(); + reset(); } // static @@ -103,22 +103,22 @@ void TWIBus::echodata(uint8_t bytes, const char prefix[], uint8_t adr) { } void TWIBus::echobuffer(const char prefix[], uint8_t adr) { - echoprefix(this->buffer_s, prefix, adr); - for (uint8_t i = 0; i < this->buffer_s; i++) SERIAL_CHAR(this->buffer[i]); + echoprefix(buffer_s, prefix, adr); + for (uint8_t i = 0; i < buffer_s; i++) SERIAL_CHAR(buffer[i]); SERIAL_EOL(); } bool TWIBus::request(const uint8_t bytes) { - if (!this->addr) return false; + if (!addr) return false; #if ENABLED(DEBUG_TWIBUS) debug(PSTR("request"), bytes); #endif // requestFrom() is a blocking function - if (Wire.requestFrom(this->addr, bytes) == 0) { + if (Wire.requestFrom(addr, bytes) == 0) { #if ENABLED(DEBUG_TWIBUS) - debug("request fail", this->addr); + debug("request fail", addr); #endif return false; } @@ -131,12 +131,12 @@ void TWIBus::relay(const uint8_t bytes) { debug(PSTR("relay"), bytes); #endif - if (this->request(bytes)) - echodata(bytes, PSTR("i2c-reply"), this->addr); + if (request(bytes)) + echodata(bytes, PSTR("i2c-reply"), addr); } uint8_t TWIBus::capture(char *dst, const uint8_t bytes) { - this->reset(); + reset(); uint8_t count = 0; while (count < bytes && Wire.available()) dst[count++] = Wire.read(); @@ -168,13 +168,13 @@ void TWIBus::flush() { #endif if (str) { - this->reset(); - this->addstring(str); + reset(); + addstring(str); } - Wire.write(this->buffer, this->buffer_s); + Wire.write(buffer, buffer_s); - this->reset(); + reset(); } #endif diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index 1e2f14cfc008..211711ba8519 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -62,7 +62,7 @@ class TWIBus { * @brief Internal buffer * @details A fixed buffer. TWI commands can be no longer than this. */ - char buffer[TWIBUS_BUFFER_SIZE]; + uint8_t buffer[TWIBUS_BUFFER_SIZE]; public: @@ -218,7 +218,7 @@ class TWIBus { * If a string is passed, write it into the buffer first. */ void reply(char str[]=nullptr); - inline void reply(const char str[]) { this->reply((char*)str); } + inline void reply(const char str[]) { reply((char*)str); } #endif diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 817e5646a689..71fecb837ed8 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -62,7 +62,7 @@ #define G26_ERR true #if ENABLED(ARC_SUPPORT) - void plan_arc(const float (&cart)[XYZE], const float (&offset)[2], const uint8_t clockwise); + void plan_arc(const xyze_pos_t &cart, const ab_float_t &offset, const uint8_t clockwise); #endif /** @@ -142,7 +142,7 @@ // Private functions -static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16]; +static MeshFlags circle_flags, horizontal_mesh_line_flags, vertical_mesh_line_flags; float g26_e_axis_feedrate = 0.025, random_deviation = 0.0; @@ -154,7 +154,7 @@ float g26_extrusion_multiplier, g26_layer_height, g26_prime_length; -float g26_x_pos = 0, g26_y_pos = 0; +xy_pos_t g26_pos; // = { 0, 0 } int16_t g26_bed_temp, g26_hotend_temp; @@ -168,7 +168,7 @@ int8_t g26_prime_flag; */ bool user_canceled() { if (!ui.button_pressed()) return false; // Return if the button isn't pressed - ui.set_status_P(PSTR("Mesh Validation Stopped."), 99); + ui.set_status_P(GET_TEXT(MSG_G26_CANCELED), 99); #if HAS_LCD_MENU ui.quick_feedback(); #endif @@ -178,94 +178,85 @@ int8_t g26_prime_flag; #endif -mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) { +mesh_index_pair find_closest_circle_to_print(const xy_pos_t &pos) { float closest = 99999.99; - mesh_index_pair return_val; + mesh_index_pair out_point; - return_val.x_index = return_val.y_index = -1; + out_point.pos = -1; for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - if (!is_bitmap_set(circle_flags, i, j)) { - const float mx = _GET_MESH_X(i), // We found a circle that needs to be printed - my = _GET_MESH_Y(j); + if (!circle_flags.marked(i, j)) { + // We found a circle that needs to be printed + const xy_pos_t m = { _GET_MESH_X(i), _GET_MESH_Y(j) }; // Get the distance to this intersection - float f = HYPOT(X - mx, Y - my); + float f = (pos - m).magnitude(); // It is possible that we are being called with the values // to let us find the closest circle to the start position. // But if this is not the case, add a small weighting to the // distance calculation to help it choose a better place to continue. - f += HYPOT(g26_x_pos - mx, g26_y_pos - my) / 15.0; + f += (g26_pos - m).magnitude() / 15.0f; - // Add in the specified amount of Random Noise to our search - if (random_deviation > 1.0) - f += random(0.0, random_deviation); + // Add the specified amount of Random Noise to our search + if (random_deviation > 1.0) f += random(0.0, random_deviation); if (f < closest) { - closest = f; // We found a closer location that is still - return_val.x_index = i; // un-printed --- save the data for it - return_val.y_index = j; - return_val.distance = closest; + closest = f; // Found a closer un-printed location + out_point.pos.set(i, j); // Save its data + out_point.distance = closest; } } } } - bitmap_set(circle_flags, return_val.x_index, return_val.y_index); // Mark this location as done. - return return_val; -} - -void G26_line_to_destination(const float &feed_rate) { - const float save_feedrate = feedrate_mm_s; - feedrate_mm_s = 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; + circle_flags.mark(out_point); // Mark this location as done. + return out_point; } void move_to(const float &rx, const float &ry, const float &z, const float &e_delta) { - float feed_value; static float last_z = -999.99; - bool has_xy_component = (rx != current_position[X_AXIS] || ry != current_position[Y_AXIS]); // Check if X or Y is involved in the movement. + const xy_pos_t dest = { rx, ry }; - if (z != last_z) { - last_z = z; - feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS]/(2.0); // Base the feed rate off of the configured Z_AXIS feed rate + const bool has_xy_component = dest != current_position; // Check if X or Y is involved in the movement. - 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_AXIS] = current_position[E_AXIS]; + destination = current_position; - G26_line_to_destination(feed_value); - set_destination_from_current(); + if (z != last_z) { + last_z = destination.z = z; + const feedRate_t feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS] * 0.5f; // Use half of the Z_AXIS max feed rate + prepare_internal_move_to_destination(feed_value); + destination = current_position; } - // Check if X or Y is involved in the movement. - // Yes: a 'normal' movement. No: a retract() or recover() - feed_value = has_xy_component ? G26_XY_FEEDRATE : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5; - - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - destination[E_AXIS] += e_delta; - - G26_line_to_destination(feed_value); - set_destination_from_current(); + // If X or Y is involved do a 'normal' move. Otherwise retract/recover/hop. + destination = dest; + destination.e += e_delta; + const feedRate_t feed_value = has_xy_component ? feedRate_t(G26_XY_FEEDRATE) : planner.settings.max_feedrate_mm_s[E_AXIS] * 0.666f; + prepare_internal_move_to_destination(feed_value); + destination = current_position; } -FORCE_INLINE void move_to(const float (&where)[XYZE], const float &de) { move_to(where[X_AXIS], where[Y_AXIS], where[Z_AXIS], de); } +FORCE_INLINE void move_to(const xyz_pos_t &where, const float &de) { move_to(where.x, where.y, where.z, de); } -void retract_filament(const float (&where)[XYZE]) { +void retract_filament(const xyz_pos_t &where) { if (!g26_retracted) { // Only retract if we are not already retracted! g26_retracted = true; - move_to(where, -1.0 * g26_retraction_multiplier); + move_to(where, -1.0f * g26_retraction_multiplier); } } -void recover_filament(const float (&where)[XYZE]) { +// TODO: Parameterize the Z lift with a define +void retract_lift_move(const xyz_pos_t &s) { + retract_filament(destination); + move_to(current_position.x, current_position.y, current_position.z + 0.5f, 0.0); // Z lift to minimize scraping + move_to(s.x, s.y, s.z + 0.5f, 0.0); // Get to the starting point with no extrusion while lifted +} + +void recover_filament(const xyz_pos_t &where) { if (g26_retracted) { // Only un-retract if we are retracted. - move_to(where, 1.2 * g26_retraction_multiplier); + move_to(where, 1.2f * g26_retraction_multiplier); g26_retracted = false; } } @@ -285,41 +276,34 @@ void recover_filament(const float (&where)[XYZE]) { * segment of a 'circle'. The time this requires is very short and is easily saved by the other * cases where the optimization comes into play. */ -void print_line_from_here_to_there(const float &sx, const float &sy, const float &sz, const float &ex, const float &ey, const float &ez) { - const float dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual line segment - dy_s = current_position[Y_AXIS] - sy, - dist_start = HYPOT2(dx_s, dy_s), // We don't need to do a sqrt(), we can compare the distance^2 - // to save computation time - dx_e = current_position[X_AXIS] - ex, // find our distance from the end of the actual line segment - dy_e = current_position[Y_AXIS] - ey, - dist_end = HYPOT2(dx_e, dy_e), +void print_line_from_here_to_there(const xyz_pos_t &s, const xyz_pos_t &e) { + + // Distances to the start / end of the line + xy_float_t svec = current_position - s, evec = current_position - e; - line_length = HYPOT(ex - sx, ey - sy); + const float dist_start = HYPOT2(svec.x, svec.y), + dist_end = HYPOT2(evec.x, evec.y), + line_length = HYPOT(e.x - s.x, e.y - s.y); // 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)) - return print_line_from_here_to_there(ex, ey, ez, sx, sy, sz); + return print_line_from_here_to_there(e, s); - // Decide whether to retract & bump + // Decide whether to retract & lift + if (dist_start > 2.0) retract_lift_move(s); - 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, sz + 0.500, 0.0); // Get to the starting point with no extrusion while bumped - } - - move_to(sx, sy, sz, 0.0); // Get to the starting point with no extrusion / un-Z bump + move_to(s, 0.0); // Get to the starting point with no extrusion / un-Z lift const float e_pos_delta = line_length * g26_e_axis_feedrate * g26_extrusion_multiplier; recover_filament(destination); - move_to(ex, ey, ez, e_pos_delta); // Get to the ending point with an appropriate amount of extrusion + move_to(e, e_pos_delta); // Get to the ending point with an appropriate amount of extrusion } inline bool look_for_lines_to_connect() { - float sx, sy, ex, ey; + xyz_pos_t s, e; + s.z = e.z = g26_layer_height; for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { @@ -328,43 +312,43 @@ inline bool look_for_lines_to_connect() { if (user_canceled()) return true; #endif - if (i < GRID_MAX_POINTS_X) { // Can't connect to anything to the right than GRID_MAX_POINTS_X. - // Already a half circle at the edge of the bed. + if (i < GRID_MAX_POINTS_X) { // Can't connect to anything farther to the right than GRID_MAX_POINTS_X. + // Already a half circle at the edge of the bed. - if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i + 1, j)) { // check if we can do a line to the left - if (!is_bitmap_set(horizontal_mesh_line_flags, i, j)) { + if (circle_flags.marked(i, j) && circle_flags.marked(i + 1, j)) { // Test whether a leftward line can be done + if (!horizontal_mesh_line_flags.marked(i, j)) { // Two circles need a horizontal line to connect them - 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 + s.x = _GET_MESH_X( i ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // right edge + e.x = _GET_MESH_X(i + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // 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); - ex = constrain(ex, X_MIN_POS + 1, X_MAX_POS - 1); + LIMIT(s.x, X_MIN_POS + 1, X_MAX_POS - 1); + s.y = e.y = constrain(_GET_MESH_Y(j), Y_MIN_POS + 1, Y_MAX_POS - 1); + LIMIT(e.x, X_MIN_POS + 1, X_MAX_POS - 1); - if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) - print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height); + if (position_is_reachable(s.x, s.y) && position_is_reachable(e.x, e.y)) + print_line_from_here_to_there(s, e); - bitmap_set(horizontal_mesh_line_flags, i, j); // Mark done, even if skipped + horizontal_mesh_line_flags.mark(i, j); // Mark done, even if skipped } } if (j < GRID_MAX_POINTS_Y) { // Can't connect to anything further back than GRID_MAX_POINTS_Y. // Already a half circle at the edge of the bed. - if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i, j + 1)) { // check if we can do a line straight down - if (!is_bitmap_set( vertical_mesh_line_flags, i, j)) { + if (circle_flags.marked(i, j) && circle_flags.marked(i, j + 1)) { // Test whether a downward line can be done + if (!vertical_mesh_line_flags.marked(i, j)) { // Two circles that need a vertical line to connect them - 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 + s.y = _GET_MESH_Y( j ) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // top edge + e.y = _GET_MESH_Y(j + 1) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)); // 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); - ey = constrain(ey, Y_MIN_POS + 1, Y_MAX_POS - 1); + s.x = e.x = constrain(_GET_MESH_X(i), X_MIN_POS + 1, X_MAX_POS - 1); + LIMIT(s.y, Y_MIN_POS + 1, Y_MAX_POS - 1); + LIMIT(e.y, Y_MIN_POS + 1, Y_MAX_POS - 1); - if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) - print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height); + if (position_is_reachable(s.x, s.y) && position_is_reachable(e.x, e.y)) + print_line_from_here_to_there(s, e); - bitmap_set(vertical_mesh_line_flags, i, j); // Mark done, even if skipped + vertical_mesh_line_flags.mark(i, j); // Mark done, even if skipped } } } @@ -385,8 +369,8 @@ inline bool turn_on_heaters() { #if HAS_HEATED_BED if (g26_bed_temp > 25) { - #if ENABLED(ULTRA_LCD) - ui.set_status_P(PSTR("G26 Heating Bed."), 99); + #if HAS_SPI_LCD + ui.set_status_P(GET_TEXT(MSG_G26_HEATING_BED), 99); ui.quick_feedback(); #if HAS_LCD_MENU ui.capture(); @@ -406,8 +390,8 @@ inline bool turn_on_heaters() { #endif // HAS_HEATED_BED // Start heating the active nozzle - #if ENABLED(ULTRA_LCD) - ui.set_status_P(PSTR("G26 Heating Nozzle."), 99); + #if HAS_SPI_LCD + ui.set_status_P(GET_TEXT(MSG_G26_HEATING_NOZZLE), 99); ui.quick_feedback(); #endif thermalManager.setTargetHotend(g26_hotend_temp, active_extruder); @@ -420,7 +404,7 @@ inline bool turn_on_heaters() { ) ) return G26_ERR; - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD ui.reset_status(); ui.quick_feedback(); #endif @@ -433,30 +417,32 @@ inline bool turn_on_heaters() { */ inline bool prime_nozzle() { + const feedRate_t fr_slow_e = planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0f; #if HAS_LCD_MENU #if ENABLED(PREVENT_LENGTHY_EXTRUDE) float Total_Prime = 0.0; #endif if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged - - ui.capture(); - ui.set_status_P(PSTR("User-Controlled Prime"), 99); + #if HAS_LCD_MENU + ui.capture(); + #endif + ui.set_status_P(GET_TEXT(MSG_G26_MANUAL_PRIME), 99); ui.chirp(); - set_destination_from_current(); + destination = current_position; recover_filament(destination); // Make sure G26 doesn't think the filament is retracted(). while (!ui.button_pressed()) { ui.chirp(); - destination[E_AXIS] += 0.25; + destination.e += 0.25; #if ENABLED(PREVENT_LENGTHY_EXTRUDE) Total_Prime += 0.25; if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR; #endif - G26_line_to_destination(planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0); - set_destination_from_current(); + prepare_internal_move_to_destination(fr_slow_e); + destination = current_position; planner.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 @@ -465,33 +451,27 @@ inline bool prime_nozzle() { ui.wait_for_release(); - ui.set_status_P(PSTR("Done Priming"), 99); + ui.set_status_P(GET_TEXT(MSG_G26_PRIME_DONE), 99); ui.quick_feedback(); ui.release(); } else #endif { - #if ENABLED(ULTRA_LCD) - ui.set_status_P(PSTR("Fixed Length Prime."), 99); + #if HAS_SPI_LCD + ui.set_status_P(GET_TEXT(MSG_G26_FIXED_LENGTH), 99); ui.quick_feedback(); #endif - set_destination_from_current(); - destination[E_AXIS] += g26_prime_length; - G26_line_to_destination(planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0); - set_destination_from_current(); + destination = current_position; + destination.e += g26_prime_length; + prepare_internal_move_to_destination(fr_slow_e); + destination.e -= g26_prime_length; retract_filament(destination); } return G26_OK; } -float valid_trig_angle(float d) { - while (d > 360.0) d -= 360.0; - while (d < 0.0) d += 360.0; - return d; -} - /** * G26: Mesh Validation Pattern generation. * @@ -644,9 +624,9 @@ void GcodeSuite::G26() { return; } - g26_x_pos = parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position[X_AXIS]; - g26_y_pos = parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position[Y_AXIS]; - if (!position_is_reachable(g26_x_pos, g26_y_pos)) { + g26_pos.set(parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x, + parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y); + if (!position_is_reachable(g26_pos.x, g26_pos.y)) { SERIAL_ECHOLNPGM("?Specified X,Y coordinate out of bounds."); return; } @@ -656,9 +636,9 @@ void GcodeSuite::G26() { */ set_bed_leveling_enabled(!parser.seen('D')); - if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) { + if (current_position.z < Z_CLEARANCE_BETWEEN_PROBES) { do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - set_current_from_destination(); + current_position = destination; } #if DISABLED(NO_VOLUMETRICS) @@ -669,7 +649,7 @@ void GcodeSuite::G26() { if (turn_on_heaters() != G26_OK) goto LEAVE; - current_position[E_AXIS] = 0.0; + current_position.e = 0.0; sync_plan_position_e(); if (g26_prime_flag && prime_nozzle() != G26_OK) goto LEAVE; @@ -684,13 +664,13 @@ void GcodeSuite::G26() { * It's "Show Time" !!! */ - ZERO(circle_flags); - ZERO(horizontal_mesh_line_flags); - ZERO(vertical_mesh_line_flags); + circle_flags.reset(); + horizontal_mesh_line_flags.reset(); + vertical_mesh_line_flags.reset(); // Move nozzle to the specified height for the first layer - set_destination_from_current(); - destination[Z_AXIS] = g26_layer_height; + destination = current_position; + destination.z = g26_layer_height; move_to(destination, 0.0); move_to(destination, g26_ooze_amount); @@ -720,79 +700,77 @@ void GcodeSuite::G26() { mesh_index_pair location; do { - 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. + // Find the nearest confluence + location = find_closest_circle_to_print(g26_continue_with_closest ? xy_pos_t(current_position) : g26_pos); - if (location.x_index >= 0 && location.y_index >= 0) { - const float circle_x = _GET_MESH_X(location.x_index), - circle_y = _GET_MESH_Y(location.y_index); + if (location.valid()) { + const xy_pos_t circle = _GET_MESH_POS(location.pos); // If this mesh location is outside the printable_radius, skip it. - if (!position_is_reachable(circle_x, circle_y)) continue; + if (!position_is_reachable(circle)) 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; + const xy_int8_t st = location; + const bool f = st.y == 0, + r = st.x >= GRID_MAX_POINTS_X - 1, + b = st.y >= GRID_MAX_POINTS_Y - 1; #if ENABLED(ARC_SUPPORT) #define ARC_LENGTH(quarters) (INTERSECTION_CIRCLE_RADIUS * M_PI * (quarters) / 2) #define INTERSECTION_CIRCLE_DIAM ((INTERSECTION_CIRCLE_RADIUS) * 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); + + xy_float_t e = { circle.x + INTERSECTION_CIRCLE_RADIUS, circle.y }; + xyz_float_t s = e; // Figure out where to start and end the arc - we always print counterclockwise - if (xi == 0) { // left edge - if (!f) { sx = circle_x; sy -= INTERSECTION_CIRCLE_RADIUS; } - if (!b) { ex = circle_x; ey += INTERSECTION_CIRCLE_RADIUS; } + float arc_length = ARC_LENGTH(4); + if (st.x == 0) { // left edge + if (!f) { s.x = circle.x; s.y -= INTERSECTION_CIRCLE_RADIUS; } + if (!b) { e.x = circle.x; e.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); + if (b) s.set(circle.x - (INTERSECTION_CIRCLE_RADIUS), circle.y); + else s.set(circle.x, circle.y + INTERSECTION_CIRCLE_RADIUS); + if (f) e.set(circle.x - (INTERSECTION_CIRCLE_RADIUS), circle.y); + else e.set(circle.x, circle.y - (INTERSECTION_CIRCLE_RADIUS)); arc_length = (f || b) ? ARC_LENGTH(1) : ARC_LENGTH(2); } else if (f) { - ex -= INTERSECTION_CIRCLE_DIAM; + e.x -= INTERSECTION_CIRCLE_DIAM; arc_length = ARC_LENGTH(2); } else if (b) { - sx -= INTERSECTION_CIRCLE_DIAM; + s.x -= INTERSECTION_CIRCLE_DIAM; arc_length = ARC_LENGTH(2); } - const float arc_offset[2] = { circle_x - sx, circle_y - sy }, - 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), - endpoint[XYZE] = { - ex, ey, - g26_layer_height, - current_position[E_AXIS] + (arc_length * g26_e_axis_feedrate * g26_extrusion_multiplier) - }; + const ab_float_t arc_offset = circle - s; + const xy_float_t dist = current_position - s; // Distance from the start of the actual circle + const float dist_start = HYPOT2(dist.x, dist.y); + const xyze_pos_t endpoint = { + e.x, e.y, g26_layer_height, + current_position.e + (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 + s.z = g26_layer_height + 0.5f; + retract_lift_move(s); } - move_to(sx, sy, g26_layer_height, 0.0); // Get to the starting point with no extrusion / un-Z bump + s.z = g26_layer_height; + move_to(s, 0.0); // Get to the starting point with no extrusion / un-Z lift recover_filament(destination); - const float save_feedrate = feedrate_mm_s; - feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0; + const feedRate_t old_feedrate = feedrate_mm_s; + feedrate_mm_s = PLANNER_XY_FEEDRATE() * 0.1f; plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc - feedrate_mm_s = save_feedrate; - set_destination_from_current(); + feedrate_mm_s = old_feedrate; + destination = current_position; + #if HAS_LCD_MENU if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation #endif @@ -800,7 +778,7 @@ void GcodeSuite::G26() { #else // !ARC_SUPPORT 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. + if (st.x == 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 } @@ -823,23 +801,21 @@ void GcodeSuite::G26() { if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation #endif - 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); + xyz_float_t p = { circle.x + _COS(ind ), circle.y + _SIN(ind ), g26_layer_height }, + q = { circle.x + _COS(ind + 1), circle.y + _SIN(ind + 1), g26_layer_height }; #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); + if (!position_is_reachable(p) || !position_is_reachable(q)) continue; + #else + LIMIT(p.x, X_MIN_POS + 1, X_MAX_POS - 1); // Prevent hitting the endstops + LIMIT(p.y, Y_MIN_POS + 1, Y_MAX_POS - 1); + LIMIT(q.x, X_MIN_POS + 1, X_MAX_POS - 1); + LIMIT(q.y, 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. + print_line_from_here_to_there(p, q); + SERIAL_FLUSH(); // Prevent host M105 buffer overrun. } #endif // !ARC_SUPPORT @@ -849,19 +825,18 @@ void GcodeSuite::G26() { SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0); + } while (--g26_repeats && location.valid()); LEAVE: - ui.set_status_P(PSTR("Leaving G26"), -1); + ui.set_status_P(GET_TEXT(MSG_G26_LEAVING), -1); retract_filament(destination); - destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; + destination.z = Z_CLEARANCE_BETWEEN_PROBES; move_to(destination, 0); // Raise the nozzle - destination[X_AXIS] = g26_x_pos; // Move back to the starting position - destination[Y_AXIS] = g26_y_pos; - //destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; // Keep the nozzle where it is + destination.set(g26_pos.x, g26_pos.y); // Move back to the starting position + //destination.z = Z_CLEARANCE_BETWEEN_PROBES; // Keep the nozzle where it is move_to(destination, 0); // Move back to the starting position diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp index 3240b94e8e8c..424e5a6995f9 100644 --- a/Marlin/src/gcode/bedlevel/G42.cpp +++ b/Marlin/src/gcode/bedlevel/G42.cpp @@ -27,6 +27,7 @@ #include "../gcode.h" #include "../../Marlin.h" // for IsRunning() #include "../../module/motion.h" +#include "../../module/probe.h" // for probe_offset #include "../../feature/bedlevel/bedlevel.h" /** @@ -44,22 +45,26 @@ void GcodeSuite::G42() { return; } - set_destination_from_current(); - if (hasI) destination[X_AXIS] = _GET_MESH_X(ix); - if (hasJ) destination[Y_AXIS] = _GET_MESH_Y(iy); - if (parser.boolval('P')) { - if (hasI) destination[X_AXIS] -= X_PROBE_OFFSET_FROM_EXTRUDER; - if (hasJ) destination[Y_AXIS] -= Y_PROBE_OFFSET_FROM_EXTRUDER; - } + destination = current_position; + + if (hasI) destination.x = _GET_MESH_X(ix); + if (hasJ) destination.y = _GET_MESH_Y(iy); + + #if HAS_BED_PROBE + if (parser.boolval('P')) { + if (hasI) destination.x -= probe_offset.x; + if (hasJ) destination.y -= probe_offset.y; + } + #endif - const float fval = parser.linearval('F'); - if (fval > 0.0) feedrate_mm_s = MMM_TO_MMS(fval); + const feedRate_t fval = parser.linearval('F'), + fr_mm_s = fval > 0 ? MMM_TO_MMS(fval) : 0.0f; // SCARA kinematic has "safe" XY raw moves #if IS_SCARA - prepare_uninterpolated_move_to_destination(); + prepare_internal_fast_move_to_destination(fr_mm_s); #else - prepare_move_to_destination(); + prepare_internal_move_to_destination(fr_mm_s); #endif } } diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index 982ec6e0357c..9e96b456e352 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -27,6 +27,7 @@ #include "../gcode.h" #include "../../feature/bedlevel/bedlevel.h" #include "../../module/planner.h" +#include "../../module/probe.h" #if ENABLED(EEPROM_SETTINGS) #include "../../module/configuration_store.h" @@ -63,11 +64,12 @@ void GcodeSuite::M420() { #if ENABLED(MARLIN_DEV_MODE) if (parser.intval('S') == 2) { + const float x_min = probe_min_x(), x_max = probe_max_x(), + y_min = probe_min_y(), y_max = probe_max_y(); #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start[X_AXIS] = MIN_PROBE_X; - bilinear_start[Y_AXIS] = MIN_PROBE_Y; - bilinear_grid_spacing[X_AXIS] = (MAX_PROBE_X - (MIN_PROBE_X)) / (GRID_MAX_POINTS_X - 1); - bilinear_grid_spacing[Y_AXIS] = (MAX_PROBE_Y - (MIN_PROBE_Y)) / (GRID_MAX_POINTS_Y - 1); + bilinear_start.set(x_min, y_min); + bilinear_grid_spacing.set((x_max - x_min) / (GRID_MAX_POINTS_X - 1), + (y_max - y_min) / (GRID_MAX_POINTS_Y - 1)); #endif for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { @@ -76,11 +78,11 @@ void GcodeSuite::M420() { ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y)); #endif } - SERIAL_ECHOPGM("Simulated " STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_X) " mesh "); - SERIAL_ECHOPAIR(" (", MIN_PROBE_X); - SERIAL_CHAR(','); SERIAL_ECHO(MIN_PROBE_Y); - SERIAL_ECHOPAIR(")-(", MAX_PROBE_X); - SERIAL_CHAR(','); SERIAL_ECHO(MAX_PROBE_Y); + SERIAL_ECHOPGM("Simulated " STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh "); + SERIAL_ECHOPAIR(" (", x_min); + SERIAL_CHAR(','); SERIAL_ECHO(y_min); + SERIAL_ECHOPAIR(")-(", x_max); + SERIAL_CHAR(','); SERIAL_ECHO(y_max); SERIAL_ECHOLNPGM(")"); } #endif @@ -89,7 +91,7 @@ void GcodeSuite::M420() { // (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] }; + xyz_pos_t oldpos = current_position; #if ENABLED(AUTO_BED_LEVELING_UBL) @@ -125,7 +127,7 @@ void GcodeSuite::M420() { } // L or V display the map info - if (parser.seen('L') || parser.seen('V')) { + if (parser.seen("LV")) { ubl.display_map(parser.byteval('T')); SERIAL_ECHOPGM("Mesh is "); if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in"); @@ -249,7 +251,7 @@ void GcodeSuite::M420() { #endif // Report change in position - if (memcmp(oldpos, current_position, sizeof(oldpos))) + if (oldpos != current_position) report_current_position(); } diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 2a4b4f85bb7e..41e5fce4d29d 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -36,7 +36,7 @@ #include "../../../module/probe.h" #include "../../queue.h" -#if BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) +#if HAS_DISPLAY #include "../../../lcd/ultralcd.h" #endif @@ -61,15 +61,15 @@ #if ABL_GRID #if ENABLED(PROBE_Y_FIRST) - #define PR_OUTER_VAR xCount - #define PR_OUTER_END abl_grid_points_x - #define PR_INNER_VAR yCount - #define PR_INNER_END abl_grid_points_y + #define PR_OUTER_VAR meshCount.x + #define PR_OUTER_END abl_grid_points.x + #define PR_INNER_VAR meshCount.y + #define PR_INNER_END abl_grid_points.y #else - #define PR_OUTER_VAR yCount - #define PR_OUTER_END abl_grid_points_y - #define PR_INNER_VAR xCount - #define PR_INNER_END abl_grid_points_x + #define PR_OUTER_VAR meshCount.y + #define PR_OUTER_END abl_grid_points.y + #define PR_INNER_VAR meshCount.x + #define PR_INNER_END abl_grid_points.x #endif #endif @@ -210,7 +210,8 @@ G29_TYPE GcodeSuite::G29() { #endif ABL_VAR int verbose_level; - ABL_VAR float xProbe, yProbe, measured_z; + ABL_VAR xy_pos_t probePos; + ABL_VAR float measured_z; ABL_VAR bool dryrun, abl_should_enable; #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR) @@ -224,20 +225,17 @@ G29_TYPE GcodeSuite::G29() { #if ABL_GRID #if ENABLED(PROBE_MANUALLY) - ABL_VAR uint8_t PR_OUTER_VAR; - ABL_VAR int8_t PR_INNER_VAR; + ABL_VAR xy_int8_t meshCount; #endif - ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position; - ABL_VAR float xGridSpacing = 0, yGridSpacing = 0; + ABL_VAR xy_float_t probe_position_lf, probe_position_rb; + ABL_VAR xy_float_t gridSpacing = { 0, 0 }; #if ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X, - abl_grid_points_y = GRID_MAX_POINTS_Y; ABL_VAR bool do_topography_map; + ABL_VAR xy_uint8_t abl_grid_points; #else // Bilinear - uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X, - abl_grid_points_y = GRID_MAX_POINTS_Y; + constexpr xy_uint8_t abl_grid_points = { GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y }; #endif #if ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -254,8 +252,8 @@ G29_TYPE GcodeSuite::G29() { ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - ABL_VAR float eqnAMatrix[GRID_MAX_POINTS * 3], // "A" matrix of the linear system of equations - eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points + ABL_VAR float eqnAMatrix[(GRID_MAX_POINTS) * 3], // "A" matrix of the linear system of equations + eqnBVector[GRID_MAX_POINTS], // "B" vector of Z points mean; #endif @@ -265,12 +263,8 @@ G29_TYPE GcodeSuite::G29() { int constexpr abl_points = 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 points[3]; + get_three_probe_points(points); #endif // AUTO_BED_LEVELING_3POINT @@ -303,7 +297,7 @@ G29_TYPE GcodeSuite::G29() { G29_RETURN(false); } - const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position[Z_AXIS]; + const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position.z; if (!WITHIN(rz, -10, 10)) { SERIAL_ERROR_MSG("Bad Z value"); G29_RETURN(false); @@ -311,15 +305,14 @@ G29_TYPE GcodeSuite::G29() { const float rx = RAW_X_POSITION(parser.linearval('X', NAN)), ry = RAW_Y_POSITION(parser.linearval('Y', NAN)); - int8_t i = parser.byteval('I', -1), - j = parser.byteval('J', -1); + int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1); if (!isnan(rx) && !isnan(ry)) { // Get nearest i / j from rx / ry - 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); + i = (rx - bilinear_start.x + 0.5 * gridSpacing.x) / gridSpacing.x; + j = (ry - bilinear_start.y + 0.5 * gridSpacing.y) / gridSpacing.y; + LIMIT(i, 0, GRID_MAX_POINTS_X - 1); + LIMIT(j, 0, GRID_MAX_POINTS_Y - 1); } if (WITHIN(i, 0, GRID_MAX_POINTS_X - 1) && WITHIN(j, 0, GRID_MAX_POINTS_Y)) { set_bed_leveling_enabled(false); @@ -350,7 +343,7 @@ G29_TYPE GcodeSuite::G29() { verbose_level = parser.intval('V'); if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4)."); + SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); G29_RETURN(false); } @@ -366,20 +359,22 @@ G29_TYPE GcodeSuite::G29() { // X and Y specify points in each direction, overriding the default // These values may be saved with the completed mesh - abl_grid_points_x = parser.intval('X', GRID_MAX_POINTS_X); - 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_ECHOLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); + abl_grid_points.set( + parser.byteval('X', GRID_MAX_POINTS_X), + parser.byteval('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_ECHOLNPGM("?Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); G29_RETURN(false); } - if (!WITHIN(abl_grid_points_y, 2, GRID_MAX_POINTS_Y)) { - SERIAL_ECHOLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); + if (!WITHIN(abl_grid_points.y, 2, GRID_MAX_POINTS_Y)) { + SERIAL_ECHOLNPGM("?Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); G29_RETURN(false); } - abl_points = abl_grid_points_x * abl_grid_points_y; + abl_points = abl_grid_points.x * abl_grid_points.y; mean = 0; #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) @@ -392,29 +387,40 @@ G29_TYPE GcodeSuite::G29() { xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_SPEED)); + const float x_min = probe_min_x(), x_max = probe_max_x(), + y_min = probe_min_y(), y_max = probe_max_y(); + if (parser.seen('H')) { const int16_t size = (int16_t)parser.value_linear_units(); - left_probe_bed_position = _MAX(X_CENTER - size / 2, MIN_PROBE_X); - right_probe_bed_position = _MIN(left_probe_bed_position + size, MAX_PROBE_X); - front_probe_bed_position = _MAX(Y_CENTER - size / 2, MIN_PROBE_Y); - back_probe_bed_position = _MIN(front_probe_bed_position + size, MAX_PROBE_Y); + probe_position_lf.set( + _MAX(X_CENTER - size / 2, x_min), + _MAX(Y_CENTER - size / 2, y_min) + ); + probe_position_rb.set( + _MIN(probe_position_lf.x + size, x_max), + _MIN(probe_position_lf.y + size, y_max) + ); } else { - 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; + probe_position_lf.set( + parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MAX(X_CENTER - (X_BED_SIZE) / 2, x_min), + parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MAX(Y_CENTER - (Y_BED_SIZE) / 2, y_min) + ); + probe_position_rb.set( + parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MIN(probe_position_lf.x + X_BED_SIZE, x_max), + parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MIN(probe_position_lf.y + Y_BED_SIZE, y_max) + ); } 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) + !position_is_reachable_by_probe(probe_position_lf.x, 0) + || !position_is_reachable_by_probe(probe_position_rb.x, 0) + || !position_is_reachable_by_probe(0, probe_position_lf.y) + || !position_is_reachable_by_probe(0, probe_position_rb.y) #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) + !position_is_reachable_by_probe(probe_position_lf) + || !position_is_reachable_by_probe(probe_position_rb) #endif ) { SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds."); @@ -422,8 +428,8 @@ G29_TYPE GcodeSuite::G29() { } // probe at the points of a lattice grid - xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (abl_grid_points_x - 1); - yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (abl_grid_points_y - 1); + gridSpacing.set((probe_position_rb.x - probe_position_lf.x) / (abl_grid_points.x - 1), + (probe_position_rb.y - probe_position_lf.y) / (abl_grid_points.y - 1)); #endif // ABL_GRID @@ -447,26 +453,20 @@ G29_TYPE GcodeSuite::G29() { } #endif - if (!faux) setup_for_endstop_or_probe_move(); + if (!faux) remember_feedrate_scaling_off(); #if ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(PROBE_MANUALLY) if (!no_action) #endif - if ( xGridSpacing != bilinear_grid_spacing[X_AXIS] - || yGridSpacing != bilinear_grid_spacing[Y_AXIS] - || left_probe_bed_position != bilinear_start[X_AXIS] - || front_probe_bed_position != bilinear_start[Y_AXIS] - ) { + if (gridSpacing != bilinear_grid_spacing || probe_position_lf != bilinear_start) { // Reset grid to 0.0 or "not probed". (Also disables ABL) reset_bed_level(); // Initialize a grid with the given dimensions - bilinear_grid_spacing[X_AXIS] = xGridSpacing; - bilinear_grid_spacing[Y_AXIS] = yGridSpacing; - bilinear_start[X_AXIS] = left_probe_bed_position; - bilinear_start[Y_AXIS] = front_probe_bed_position; + bilinear_grid_spacing = gridSpacing; + bilinear_start = probe_position_lf; // Can't re-enable (on error) until the new grid is written abl_should_enable = false; @@ -536,17 +536,17 @@ G29_TYPE GcodeSuite::G29() { // For G29 after adjusting Z. // Save the previous Z before going to the next point - measured_z = current_position[Z_AXIS]; + measured_z = current_position.z; #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 + 0 * abl_points] = probePos.x; + eqnAMatrix[index + 1 * abl_points] = probePos.y; eqnAMatrix[index + 2 * abl_points] = 1; - incremental_LSF(&lsf_results, xProbe, yProbe, measured_z); + incremental_LSF(&lsf_results, probePos, measured_z); #elif ENABLED(AUTO_BED_LEVELING_3POINT) @@ -554,12 +554,13 @@ G29_TYPE GcodeSuite::G29() { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - z_values[xCount][yCount] = measured_z + zoffset; + const float newz = measured_z + zoffset; + z_values[meshCount.x][meshCount.y] = newz; #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(xCount, yCount, z_values[xCount][yCount]); + ExtUI::onMeshUpdate(meshCount, newz); #endif - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Save X", xCount, " Y", yCount, " Z", measured_z + zoffset); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_P(PSTR("Save X"), meshCount.x, SP_Y_STR, meshCount.y, SP_Z_STR, measured_z + zoffset); #endif } @@ -573,7 +574,7 @@ G29_TYPE GcodeSuite::G29() { // Skip any unreachable points while (abl_probe_index < abl_points) { - // Set xCount, yCount based on abl_probe_index, with zig-zag + // Set meshCount.x, meshCount.y based on abl_probe_index, with zig-zag PR_OUTER_VAR = abl_probe_index / PR_INNER_END; PR_INNER_VAR = abl_probe_index - (PR_OUTER_VAR * PR_INNER_END); @@ -582,24 +583,20 @@ G29_TYPE GcodeSuite::G29() { if (zig) PR_INNER_VAR = (PR_INNER_END - 1) - PR_INNER_VAR; - const float xBase = xCount * xGridSpacing + left_probe_bed_position, - yBase = yCount * yGridSpacing + front_probe_bed_position; - - xProbe = FLOOR(xBase + (xBase < 0 ? 0 : 0.5)); - yProbe = FLOOR(yBase + (yBase < 0 ? 0 : 0.5)); + probePos = probe_position_lf + gridSpacing * meshCount.asFloat(); #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[xCount][yCount] = abl_probe_index; + indexIntoAB[meshCount.x][meshCount.y] = abl_probe_index; #endif // Keep looping till a reachable point is found - if (position_is_reachable(xProbe, yProbe)) break; + if (position_is_reachable(probePos)) break; ++abl_probe_index; } // Is there a next point to move to? if (abl_probe_index < abl_points) { - _manual_goto_xy(xProbe, yProbe); // Can be used here too! + _manual_goto_xy(probePos); // Can be used here too! #if HAS_SOFTWARE_ENDSTOPS // Disable software endstops to allow manual adjustment // If G29 is not completed, they will not be re-enabled @@ -623,9 +620,8 @@ G29_TYPE GcodeSuite::G29() { // Probe at 3 arbitrary points if (abl_probe_index < abl_points) { - xProbe = points[abl_probe_index].x; - yProbe = points[abl_probe_index].y; - _manual_goto_xy(xProbe, yProbe); + probePos = points[abl_probe_index]; + _manual_goto_xy(probePos); #if HAS_SOFTWARE_ENDSTOPS // Disable software endstops to allow manual adjustment // If G29 is not completed, they will not be re-enabled @@ -644,11 +640,7 @@ G29_TYPE GcodeSuite::G29() { if (!dryrun) { vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); - if (planeNormal.z < 0) { - planeNormal.x *= -1; - planeNormal.y *= -1; - planeNormal.z *= -1; - } + if (planeNormal.z < 0) planeNormal *= -1; planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); // Can't re-enable (on error) until the new grid is written @@ -671,64 +663,72 @@ G29_TYPE GcodeSuite::G29() { measured_z = 0; + xy_int8_t meshCount; + + // Outer loop is X with PROBE_Y_FIRST enabled // Outer loop is Y with PROBE_Y_FIRST disabled - for (uint8_t PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_END && !isnan(measured_z); PR_OUTER_VAR++) { + for (PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_END && !isnan(measured_z); PR_OUTER_VAR++) { int8_t inStart, inStop, inInc; - if (zig) { // away from origin - inStart = 0; - inStop = PR_INNER_END; - inInc = 1; + if (zig) { // Zig away from origin + inStart = 0; // Left or front + inStop = PR_INNER_END; // Right or back + inInc = 1; // Zig right } - else { // towards origin - inStart = PR_INNER_END - 1; - inStop = -1; - inInc = -1; + else { // Zag towards origin + inStart = PR_INNER_END - 1; // Right or back + inStop = -1; // Left or front + inInc = -1; // Zag left } zig ^= true; // zag - // Inner loop is Y with PROBE_Y_FIRST enabled - for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) { + // An index to print current state + uint8_t pt_index = (PR_OUTER_VAR) * (PR_INNER_END) + 1; - const float xBase = left_probe_bed_position + xGridSpacing * xCount, - yBase = front_probe_bed_position + yGridSpacing * yCount; + // Inner loop is Y with PROBE_Y_FIRST enabled + // Inner loop is X with PROBE_Y_FIRST disabled + for (PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; pt_index++, PR_INNER_VAR += inInc) { - xProbe = FLOOR(xBase + (xBase < 0 ? 0 : 0.5)); - yProbe = FLOOR(yBase + (yBase < 0 ? 0 : 0.5)); + probePos = probe_position_lf + gridSpacing * meshCount.asFloat(); #if ENABLED(AUTO_BED_LEVELING_LINEAR) - indexIntoAB[xCount][yCount] = ++abl_probe_index; // 0... + indexIntoAB[meshCount.x][meshCount.y] = ++abl_probe_index; // 0... #endif #if IS_KINEMATIC // Avoid probing outside the round or hexagonal area - if (!position_is_reachable_by_probe(xProbe, yProbe)) continue; + if (!position_is_reachable_by_probe(probePos)) continue; #endif - measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level); + if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", int(pt_index), "/", int(GRID_MAX_POINTS), "."); + #if HAS_DISPLAY + ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), int(pt_index), int(GRID_MAX_POINTS)); + #endif + + measured_z = faux ? 0.001f * random(-100, 101) : probe_at_point(probePos, raise_after, verbose_level); if (isnan(measured_z)) { set_bed_leveling_enabled(abl_should_enable); - break; + break; // Breaks out of both loops } #if ENABLED(AUTO_BED_LEVELING_LINEAR) 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 + 0 * abl_points] = probePos.x; + eqnAMatrix[abl_probe_index + 1 * abl_points] = probePos.y; eqnAMatrix[abl_probe_index + 2 * abl_points] = 1; - incremental_LSF(&lsf_results, xProbe, yProbe, measured_z); + incremental_LSF(&lsf_results, probePos, measured_z); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - z_values[xCount][yCount] = measured_z + zoffset; + z_values[meshCount.x][meshCount.y] = measured_z + zoffset; #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(xCount, yCount, z_values[xCount][yCount]); + ExtUI::onMeshUpdate(meshCount, z_values[meshCount.x][meshCount.y]); #endif #endif @@ -744,10 +744,14 @@ G29_TYPE GcodeSuite::G29() { // Probe at 3 arbitrary points for (uint8_t i = 0; i < 3; ++i) { + if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", int(i), "/3."); + #if HAS_DISPLAY + ui.status_printf_P(0, PSTR(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_MESH), int(i)); + #endif + // 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); + probePos = points[i]; + measured_z = faux ? 0.001 * random(-100, 101) : probe_at_point(probePos, raise_after, verbose_level); if (isnan(measured_z)) { set_bed_leveling_enabled(abl_should_enable); break; @@ -757,11 +761,7 @@ G29_TYPE GcodeSuite::G29() { if (!dryrun && !isnan(measured_z)) { vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); - if (planeNormal.z < 0) { - planeNormal.x *= -1; - planeNormal.y *= -1; - planeNormal.z *= -1; - } + if (planeNormal.z < 0) planeNormal *= -1; planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); // Can't re-enable (on error) until the new grid is written @@ -770,6 +770,10 @@ G29_TYPE GcodeSuite::G29() { #endif // AUTO_BED_LEVELING_3POINT + #if HAS_DISPLAY + ui.reset_status(); + #endif + // Stow the probe. No raise for FIX_MOUNTED_PROBE. if (STOW_PROBE()) { set_bed_leveling_enabled(abl_should_enable); @@ -822,19 +826,19 @@ G29_TYPE GcodeSuite::G29() { * plane equation in the standard form, which is Vx*x+Vy*y+Vz*z+d = 0 * so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z */ - float plane_equation_coefficients[3]; + struct { float a, b, d; } plane_equation_coefficients; finish_incremental_LSF(&lsf_results); - plane_equation_coefficients[0] = -lsf_results.A; // We should be able to eliminate the '-' on these three lines and down below - plane_equation_coefficients[1] = -lsf_results.B; // but that is not yet tested. - plane_equation_coefficients[2] = -lsf_results.D; + plane_equation_coefficients.a = -lsf_results.A; // We should be able to eliminate the '-' on these three lines and down below + plane_equation_coefficients.b = -lsf_results.B; // but that is not yet tested. + plane_equation_coefficients.d = -lsf_results.D; mean /= abl_points; if (verbose_level) { - SERIAL_ECHOPAIR_F("Eqn coefficients: a: ", plane_equation_coefficients[0], 8); - SERIAL_ECHOPAIR_F(" b: ", plane_equation_coefficients[1], 8); - SERIAL_ECHOPAIR_F(" d: ", plane_equation_coefficients[2], 8); + SERIAL_ECHOPAIR_F("Eqn coefficients: a: ", plane_equation_coefficients.a, 8); + SERIAL_ECHOPAIR_F(" b: ", plane_equation_coefficients.b, 8); + SERIAL_ECHOPAIR_F(" d: ", plane_equation_coefficients.d, 8); if (verbose_level > 2) SERIAL_ECHOPAIR_F("\nMean of sampled points: ", mean, 8); SERIAL_EOL(); @@ -843,13 +847,34 @@ G29_TYPE GcodeSuite::G29() { // Create the matrix but don't correct the position yet if (!dryrun) planner.bed_level_matrix = matrix_3x3::create_look_at( - vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1) // We can eliminate the '-' here and up above + vector_3(-plane_equation_coefficients.a, -plane_equation_coefficients.b, 1) // We can eliminate the '-' here and up above ); // Show the Topography map if enabled if (do_topography_map) { - SERIAL_ECHOLNPGM("\nBed Height Topography:\n" + float min_diff = 999; + + auto print_topo_map = [&](PGM_P const title, const bool get_min) { + serialprintPGM(title); + for (int8_t yy = abl_grid_points.y - 1; yy >= 0; yy--) { + for (uint8_t xx = 0; xx < abl_grid_points.x; xx++) { + const int ind = indexIntoAB[xx][yy]; + xyz_float_t tmp = { eqnAMatrix[ind + 0 * abl_points], + eqnAMatrix[ind + 1 * abl_points], 0 }; + apply_rotation_xyz(planner.bed_level_matrix, tmp); + if (get_min) NOMORE(min_diff, eqnBVector[ind] - tmp.z); + const float subval = get_min ? mean : tmp.z + min_diff, + diff = eqnBVector[ind] - subval; + SERIAL_CHAR(' '); if (diff >= 0.0) SERIAL_CHAR('+'); // Include + for column alignment + SERIAL_ECHO_F(diff, 5); + } // xx + SERIAL_EOL(); + } // yy + SERIAL_EOL(); + }; + + print_topo_map(PSTR("\nBed Height Topography:\n" " +--- BACK --+\n" " | |\n" " L | (+) | R\n" @@ -859,56 +884,10 @@ G29_TYPE GcodeSuite::G29() { " | (-) | T\n" " | |\n" " O-- FRONT --+\n" - " (0,0)"); - - float min_diff = 999; - - 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 diff = eqnBVector[ind] - mean, - x_tmp = eqnAMatrix[ind + 0 * abl_points], - y_tmp = eqnAMatrix[ind + 1 * abl_points], - z_tmp = 0; - - apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); - - NOMORE(min_diff, eqnBVector[ind] - z_tmp); - - if (diff >= 0.0) - SERIAL_ECHOPGM(" +"); // Include + for column alignment - else - SERIAL_CHAR(' '); - SERIAL_ECHO_F(diff, 5); - } // xx - SERIAL_EOL(); - } // yy - SERIAL_EOL(); - - if (verbose_level > 3) { - SERIAL_ECHOLNPGM("\nCorrected Bed Height vs. Bed Topology:"); - - 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], - z_tmp = 0; - - apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); + " (0,0)\n"), true); + if (verbose_level > 3) + print_topo_map(PSTR("\nCorrected Bed Height vs. Bed Topology:\n"), false); - float diff = eqnBVector[ind] - z_tmp - min_diff; - if (diff >= 0.0) - SERIAL_ECHOPGM(" +"); - // Include + for column alignment - else - SERIAL_CHAR(' '); - SERIAL_ECHO_F(diff, 5); - } // xx - SERIAL_EOL(); - } // yy - SERIAL_EOL(); - } } //do_topography_map #endif // AUTO_BED_LEVELING_LINEAR @@ -927,24 +906,20 @@ G29_TYPE GcodeSuite::G29() { if (DEBUGGING(LEVELING)) DEBUG_POS("G29 uncorrected XYZ", current_position); - float converted[XYZ]; - COPY(converted, current_position); - - planner.leveling_active = true; - planner.unapply_leveling(converted); // use conversion machinery - planner.leveling_active = false; + xyze_pos_t converted = current_position; + planner.force_unapply_leveling(converted); // use conversion machinery // Use the last measured distance to the bed, if possible - if ( NEAR(current_position[X_AXIS], xProbe - (X_PROBE_OFFSET_FROM_EXTRUDER)) - && NEAR(current_position[Y_AXIS], yProbe - (Y_PROBE_OFFSET_FROM_EXTRUDER)) + if ( NEAR(current_position.x, probePos.x - probe_offset.x) + && NEAR(current_position.y, probePos.y - probe_offset.y) ) { - const float simple_z = current_position[Z_AXIS] - measured_z; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probed Z", simple_z, " Matrix Z", converted[Z_AXIS], " Discrepancy ", simple_z - converted[Z_AXIS]); - converted[Z_AXIS] = simple_z; + const float simple_z = current_position.z - measured_z; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probed Z", simple_z, " Matrix Z", converted.z, " Discrepancy ", simple_z - converted.z); + converted.z = simple_z; } // The rotated XY and corrected Z are now current_position - COPY(current_position, converted); + current_position = converted; if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position); } @@ -952,29 +927,23 @@ G29_TYPE GcodeSuite::G29() { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) if (!dryrun) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("G29 uncorrected Z:", current_position[Z_AXIS]); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("G29 uncorrected Z:", current_position.z); // Unapply the offset because it is going to be immediately applied // and cause compensation movement in Z - current_position[Z_AXIS] -= bilinear_z_offset(current_position); + current_position.z -= bilinear_z_offset(current_position); - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(" corrected Z:", current_position[Z_AXIS]); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(" corrected Z:", current_position.z); } #endif // ABL_PLANAR - #ifdef Z_PROBE_END_SCRIPT - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT); - planner.synchronize(); - process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT)); - #endif - // Auto Bed Leveling is complete! Enable if possible. planner.leveling_active = dryrun ? abl_should_enable : true; } // !isnan(measured_z) // Restore state after probing - if (!faux) clean_up_after_endstop_or_probe_move(); + if (!faux) restore_feedrate_and_scaling(); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G29"); @@ -985,6 +954,12 @@ G29_TYPE GcodeSuite::G29() { move_z_after_probing(); #endif + #ifdef Z_PROBE_END_SCRIPT + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT); + planner.synchronize(); + process_subcommands_now_P(PSTR(Z_PROBE_END_SCRIPT)); + #endif + report_current_position(); G29_RETURN(isnan(measured_z)); diff --git a/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin/src/gcode/bedlevel/abl/M421.cpp index f755115317da..b9470528a189 100644 --- a/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/abl/M421.cpp @@ -29,7 +29,7 @@ #if ENABLED(AUTO_BED_LEVELING_BILINEAR) #include "../../gcode.h" -#include "../../../feature/bedlevel/abl/abl.h" +#include "../../../feature/bedlevel/bedlevel.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extensible_ui/ui_api.h" diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 6b4b6ed630f7..944e8d3a69bf 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -38,6 +38,10 @@ #include "../../../module/motion.h" #include "../../../module/stepper.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../../lcd/extensible_ui/ui_api.h" +#endif + // Save 130 bytes with non-duplication of PSTR inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); } @@ -106,7 +110,7 @@ void GcodeSuite::G29() { } else { // Save Z for the previous mesh position - mbl.set_zigzag_z(mbl_probe_index - 1, current_position[Z_AXIS]); + mbl.set_zigzag_z(mbl_probe_index - 1, current_position.z); #if HAS_SOFTWARE_ENDSTOPS soft_endstops_enabled = saved_soft_endstops_state; #endif @@ -120,11 +124,11 @@ void GcodeSuite::G29() { #endif mbl.zigzag(mbl_probe_index++, ix, iy); - _manual_goto_xy(mbl.index_to_xpos[ix], mbl.index_to_ypos[iy]); + _manual_goto_xy({ mbl.index_to_xpos[ix], mbl.index_to_ypos[iy] }); } else { // One last "return to the bed" (as originally coded) at completion - current_position[Z_AXIS] = MANUAL_PROBE_HEIGHT; + current_position.z = MANUAL_PROBE_HEIGHT; line_to_current_position(); planner.synchronize(); @@ -138,9 +142,8 @@ void GcodeSuite::G29() { set_bed_leveling_enabled(true); #if ENABLED(MESH_G28_REST_ORIGIN) - current_position[Z_AXIS] = 0; - set_destination_from_current(); - buffer_line_to_destination(homing_feedrate(Z_AXIS)); + current_position.z = 0; + line_to_current_position(homing_feedrate(Z_AXIS)); planner.synchronize(); #endif diff --git a/Marlin/src/gcode/bedlevel/ubl/G29.cpp b/Marlin/src/gcode/bedlevel/ubl/G29.cpp index cb130c39d6ff..c0f8f20439d3 100644 --- a/Marlin/src/gcode/bedlevel/ubl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/G29.cpp @@ -29,7 +29,7 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) #include "../../gcode.h" -#include "../../../feature/bedlevel/ubl/ubl.h" +#include "../../../feature/bedlevel/bedlevel.h" void GcodeSuite::G29() { ubl.G29(); } diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index 34afe786258a..153e6018aa61 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -46,28 +46,25 @@ * M421 C Q */ void GcodeSuite::M421() { - int8_t ix = parser.intval('I', -1), iy = parser.intval('J', -1); - const bool hasI = ix >= 0, - hasJ = iy >= 0, + xy_int8_t ij = { int8_t(parser.intval('I', -1)), int8_t(parser.intval('J', -1)) }; + const bool hasI = ij.x >= 0, + hasJ = ij.y >= 0, hasC = parser.seen('C'), hasN = parser.seen('N'), hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); - if (hasC) { - const mesh_index_pair location = ubl.find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, nullptr); - ix = location.x_index; - iy = location.y_index; - } + if (hasC) ij = ubl.find_closest_mesh_point_of_type(REAL, current_position); if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) + else if (!WITHIN(ij.x, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ij.y, 0, GRID_MAX_POINTS_Y - 1)) SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); else { - ubl.z_values[ix][iy] = hasN ? NAN : parser.value_linear_units() + (hasQ ? ubl.z_values[ix][iy] : 0); + float &zval = ubl.z_values[ij.x][ij.y]; + zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(ix, iy, ubl.z_values[ix][iy]); + ExtUI::onMeshUpdate(ij.x, ij.y, zval); #endif } } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 8e12f4b06ad4..b7af871b11a6 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -39,9 +39,7 @@ #include "../../feature/tmc_util.h" #endif -#if HOMING_Z_WITH_PROBE || ENABLED(BLTOUCH) - #include "../../module/probe.h" -#endif +#include "../../module/probe.h" #if ENABLED(BLTOUCH) #include "../../feature/bltouch.h" @@ -61,7 +59,7 @@ static void quick_home_xy() { // Pretend the current position is 0,0 - current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; + current_position.set(0.0, 0.0); sync_plan_position(); const int x_axis_home_dir = @@ -78,22 +76,26 @@ fr_mm_s = _MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0); #if ENABLED(SENSORLESS_HOMING) - sensorless_t stealth_states { false, false, false, false, false, false, false }; - stealth_states.x = tmc_enable_stallguard(stepperX); - stealth_states.y = tmc_enable_stallguard(stepperY); - #if AXIS_HAS_STALLGUARD(X2) - stealth_states.x2 = tmc_enable_stallguard(stepperX2); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - stealth_states.y2 = tmc_enable_stallguard(stepperY2); - #endif + sensorless_t stealth_states { + tmc_enable_stallguard(stepperX) + , tmc_enable_stallguard(stepperY) + , false + , false + #if AXIS_HAS_STALLGUARD(X2) + || tmc_enable_stallguard(stepperX2) + #endif + , false + #if AXIS_HAS_STALLGUARD(Y2) + || tmc_enable_stallguard(stepperY2) + #endif + }; #endif 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(); - current_position[X_AXIS] = current_position[Y_AXIS] = 0.0; + current_position.set(0.0, 0.0); #if ENABLED(SENSORLESS_HOMING) tmc_disable_stallguard(stepperX, stealth_states.x); @@ -116,29 +118,27 @@ // Disallow Z homing if X or Y are unknown if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) { LCD_MESSAGEPGM(MSG_ERR_Z_HOMING); - SERIAL_ECHO_MSG(MSG_ERR_Z_HOMING); + SERIAL_ECHO_MSG(MSG_ERR_Z_HOMING_SER); return; } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z_SAFE_HOMING >>>"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("home_z_safely >>>"); sync_plan_position(); /** * Move the Z probe (or just the nozzle) to the safe homing point + * (Z is already at the right height) */ - destination[X_AXIS] = Z_SAFE_HOMING_X_POINT; - destination[Y_AXIS] = Z_SAFE_HOMING_Y_POINT; - destination[Z_AXIS] = current_position[Z_AXIS]; // Z is already at the right height + destination.set(safe_homing_xy, current_position.z); #if HOMING_Z_WITH_PROBE - destination[X_AXIS] -= X_PROBE_OFFSET_FROM_EXTRUDER; - destination[Y_AXIS] -= Y_PROBE_OFFSET_FROM_EXTRUDER; + destination -= probe_offset; #endif - if (position_is_reachable(destination[X_AXIS], destination[Y_AXIS])) { + if (position_is_reachable(destination)) { - if (DEBUGGING(LEVELING)) DEBUG_POS("Z_SAFE_HOMING", destination); + if (DEBUGGING(LEVELING)) DEBUG_POS("home_z_safely", destination); // This causes the carriage on Dual X to unpark #if ENABLED(DUAL_X_CARRIAGE) @@ -149,19 +149,46 @@ safe_delay(500); // Short delay needed to settle #endif - do_blocking_move_to_xy(destination[X_AXIS], destination[Y_AXIS]); + do_blocking_move_to_xy(destination); homeaxis(Z_AXIS); } else { LCD_MESSAGEPGM(MSG_ZPROBE_OUT); - SERIAL_ECHO_MSG(MSG_ZPROBE_OUT); + SERIAL_ECHO_MSG(MSG_ZPROBE_OUT_SER); } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< Z_SAFE_HOMING"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< home_z_safely"); } #endif // Z_SAFE_HOMING +#if ENABLED(IMPROVE_HOMING_RELIABILITY) + + slow_homing_t begin_slow_homing() { + slow_homing_t slow_homing{0}; + slow_homing.acceleration.set(planner.settings.max_acceleration_mm_per_s2[X_AXIS], + planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); + planner.settings.max_acceleration_mm_per_s2[X_AXIS] = 100; + planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = 100; + #if HAS_CLASSIC_JERK + slow_homing.jerk_xy = planner.max_jerk; + planner.max_jerk.set(0, 0); + #endif + planner.reset_acceleration_rates(); + return slow_homing; + } + + void end_slow_homing(const slow_homing_t &slow_homing) { + planner.settings.max_acceleration_mm_per_s2[X_AXIS] = slow_homing.acceleration.x; + planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = slow_homing.acceleration.y; + #if HAS_CLASSIC_JERK + planner.max_jerk = slow_homing.jerk_xy; + #endif + planner.reset_acceleration_rates(); + } + +#endif // IMPROVE_HOMING_RELIABILITY + /** * G28: Home all axes according to settings * @@ -203,6 +230,7 @@ void GcodeSuite::G28(const bool always_home_all) { } #endif + // Home (O)nly if position is unknown if (!homing_needed() && parser.boolval('O')) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> homing not needed, skip\n<<< G28"); return; @@ -229,6 +257,44 @@ void GcodeSuite::G28(const bool always_home_all) { workspace_plane = PLANE_XY; #endif + #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) + #define HAS_HOMING_CURRENT (HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2)) + + #if HAS_HOMING_CURRENT + auto debug_current = [](const char * const s, const int16_t a, const int16_t b){ + DEBUG_ECHO(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); + }; + #if HAS_CURRENT_HOME(X) + const int16_t tmc_save_current_X = stepperX.getMilliamps(); + stepperX.rms_current(X_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current("X", tmc_save_current_X, X_CURRENT_HOME); + #endif + #if HAS_CURRENT_HOME(X2) + const int16_t tmc_save_current_X2 = stepperX2.getMilliamps(); + stepperX2.rms_current(X2_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current("X2", tmc_save_current_X2, X2_CURRENT_HOME); + #endif + #if HAS_CURRENT_HOME(Y) + const int16_t tmc_save_current_Y = stepperY.getMilliamps(); + stepperY.rms_current(Y_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current("Y", tmc_save_current_Y, Y_CURRENT_HOME); + #endif + #if HAS_CURRENT_HOME(Y2) + const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps(); + stepperY2.rms_current(Y2_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current("Y2", tmc_save_current_Y2, Y2_CURRENT_HOME); + #endif + #endif + + #if BOTH(STEALTHCHOP_XY, HOME_USING_SPREADCYCLE) + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set XY to spreadCycle..."); + process_subcommands_now_P(PSTR("M569S0XY")); + #endif + + #if ENABLED(IMPROVE_HOMING_RELIABILITY) + slow_homing_t slow_homing = begin_slow_homing(); + #endif + // Always home with tool 0 active #if HOTENDS > 1 #if DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE) @@ -241,7 +307,7 @@ void GcodeSuite::G28(const bool always_home_all) { extruder_duplication_enabled = false; #endif - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); endstops.enable(true); // Enable endstops for next homing move @@ -250,13 +316,17 @@ void GcodeSuite::G28(const bool always_home_all) { home_delta(); UNUSED(always_home_all); + #if ENABLED(IMPROVE_HOMING_RELIABILITY) + end_slow_homing(slow_homing); + #endif + #else // NOT DELTA const bool homeX = parser.seen('X'), homeY = parser.seen('Y'), homeZ = parser.seen('Z'), home_all = always_home_all || (homeX == homeY && homeX == homeZ), doX = home_all || homeX, doY = home_all || homeY, doZ = home_all || homeZ; - set_destination_from_current(); + destination = current_position; #if Z_HOME_DIR > 0 // If homing away from BED do Z first @@ -273,10 +343,10 @@ void GcodeSuite::G28(const bool always_home_all) { if (z_homing_height && (doX || doY)) { // Raise Z before homing any other axes and z is not already high enough (never lower z) - destination[Z_AXIS] = z_homing_height; - if (destination[Z_AXIS] > current_position[Z_AXIS]) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) to ", destination[Z_AXIS]); - do_blocking_move_to_z(destination[Z_AXIS]); + destination.z = z_homing_height + (TEST(axis_known_position, Z_AXIS) ? 0.0f : current_position.z); + if (destination.z > current_position.z) { + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before homing) to ", destination.z); + do_blocking_move_to_z(destination.z); } } @@ -311,14 +381,14 @@ void GcodeSuite::G28(const bool always_home_all) { homeaxis(X_AXIS); // Remember this extruder's position for later tool change - inactive_extruder_x_pos = current_position[X_AXIS]; + inactive_extruder_x_pos = current_position.x; // Home the 1st (left) extruder active_extruder = 0; homeaxis(X_AXIS); // Consider the active extruder to be parked - COPY(raised_parked_position, current_position); + raised_parked_position = current_position; delayed_move_time = 0; active_extruder_parked = true; @@ -334,6 +404,10 @@ void GcodeSuite::G28(const bool always_home_all) { if (doY) homeaxis(Y_AXIS); #endif + #if ENABLED(IMPROVE_HOMING_RELIABILITY) + end_slow_homing(slow_homing); + #endif + // Home Z last if homing towards the bed #if Z_HOME_DIR < 0 if (doZ) { @@ -367,41 +441,43 @@ void GcodeSuite::G28(const bool always_home_all) { if (dxc_is_duplicating()) { + #if ENABLED(IMPROVE_HOMING_RELIABILITY) + slow_homing = begin_slow_homing(); + #endif + // Always home the 2nd (right) extruder first active_extruder = 1; homeaxis(X_AXIS); // Remember this extruder's position for later tool change - inactive_extruder_x_pos = current_position[X_AXIS]; + inactive_extruder_x_pos = current_position.x; // Home the 1st (left) extruder active_extruder = 0; homeaxis(X_AXIS); // Consider the active extruder to be parked - COPY(raised_parked_position, current_position); + raised_parked_position = current_position; delayed_move_time = 0; active_extruder_parked = true; extruder_duplication_enabled = IDEX_saved_duplication_state; - extruder_duplication_enabled = false; - dual_x_carriage_mode = IDEX_saved_mode; stepper.set_directions(); + + #if ENABLED(IMPROVE_HOMING_RELIABILITY) + end_slow_homing(slow_homing); + #endif } #endif // DUAL_X_CARRIAGE - #ifdef HOMING_BACKOFF_MM - endstops.enable(false); - constexpr float endstop_backoff[XYZ] = HOMING_BACKOFF_MM; - const float backoff_x = doX ? ABS(endstop_backoff[X_AXIS]) * (X_HOME_DIR) : 0, - backoff_y = doY ? ABS(endstop_backoff[Y_AXIS]) * (Y_HOME_DIR) : 0, - backoff_z = doZ ? ABS(endstop_backoff[Z_AXIS]) * (Z_HOME_DIR) : 0; - if (backoff_z) do_blocking_move_to_z(current_position[Z_AXIS] - backoff_z); - if (backoff_x || backoff_y) do_blocking_move_to_xy(current_position[X_AXIS] - backoff_x, current_position[Y_AXIS] - backoff_y); - #endif endstops.not_homing(); + // Clear endstop state for polled stallGuard endstops + #if ENABLED(SPI_ENDSTOPS) + endstops.clear_endstop_state(); + #endif + #if BOTH(DELTA, DELTA_HOME_TO_SAFE_ZONE) // move to a height where we can use the full xy-area do_blocking_move_to_z(delta_clip_start_height); @@ -411,7 +487,7 @@ void GcodeSuite::G28(const bool always_home_all) { set_bed_leveling_enabled(leveling_was_active); #endif - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); // Restore the active tool after homing #if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) @@ -423,9 +499,31 @@ void GcodeSuite::G28(const bool always_home_all) { tool_change(old_tool_index, NO_FETCH); #endif + #if HAS_HOMING_CURRENT + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Restore driver current..."); + #if HAS_CURRENT_HOME(X) + stepperX.rms_current(tmc_save_current_X); + #endif + #if HAS_CURRENT_HOME(X2) + stepperX2.rms_current(tmc_save_current_X2); + #endif + #if HAS_CURRENT_HOME(Y) + stepperY.rms_current(tmc_save_current_Y); + #endif + #if HAS_CURRENT_HOME(Y2) + stepperY2.rms_current(tmc_save_current_Y2); + #endif + #endif + + #if BOTH(STEALTHCHOP_XY, HOME_USING_SPREADCYCLE) + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set XY to StealthChop..."); + process_subcommands_now_P(PSTR("M569S1XY")); + #endif + ui.refresh(); report_current_position(); + #if ENABLED(NANODLP_Z_SYNC) #if ENABLED(NANODLP_ALL_AXIS) #define _HOME_SYNC true // For any axis, output sync text. diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 397f5d2f75e6..1931d226af28 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -70,7 +70,7 @@ enum CalEnum : char { // the 7 main calibration points - #define AC_CLEANUP() ac_cleanup() #endif -float lcd_probe_pt(const float &rx, const float &ry); +float lcd_probe_pt(const xy_pos_t &xy); void ac_home() { endstops.enable(true); @@ -84,7 +84,7 @@ void ac_setup(const bool reset_bed) { #endif planner.synchronize(); - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); #if HAS_LEVELING if (reset_bed) reset_bed_level(); // After full calibration bed-level data is no longer valid @@ -102,7 +102,7 @@ void ac_cleanup( #if HAS_BED_PROBE STOW_PROBE(); #endif - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); #if HOTENDS > 1 tool_change(old_tool_index, true); #endif @@ -122,9 +122,9 @@ void print_signed_float(PGM_P const prefix, const float &f) { static void print_calibration_settings(const bool end_stops, const bool tower_angles) { SERIAL_ECHOPAIR(".Height:", delta_height); if (end_stops) { - print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]); - print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]); - print_signed_float(PSTR("Ez"), delta_endstop_adj[C_AXIS]); + print_signed_float(PSTR("Ex"), delta_endstop_adj.a); + print_signed_float(PSTR("Ey"), delta_endstop_adj.b); + print_signed_float(PSTR("Ez"), delta_endstop_adj.c); } if (end_stops && tower_angles) { SERIAL_ECHOPAIR(" Radius:", delta_radius); @@ -133,9 +133,9 @@ static void print_calibration_settings(const bool end_stops, const bool tower_an SERIAL_ECHO_SP(13); } if (tower_angles) { - print_signed_float(PSTR("Tx"), delta_tower_angle_trim[A_AXIS]); - print_signed_float(PSTR("Ty"), delta_tower_angle_trim[B_AXIS]); - print_signed_float(PSTR("Tz"), delta_tower_angle_trim[C_AXIS]); + print_signed_float(PSTR("Tx"), delta_tower_angle_trim.a); + print_signed_float(PSTR("Ty"), delta_tower_angle_trim.b); + print_signed_float(PSTR("Tz"), delta_tower_angle_trim.c); } if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR SERIAL_ECHOPAIR(" Radius:", delta_radius); @@ -179,21 +179,21 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool S2 += sq(z_pt[rad]); N++; } - return LROUND(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001; + return LROUND(SQRT(S2 / N) * 1000.0f) / 1000.0f + 0.00001f; } } - return 0.00001; + return 0.00001f; } /** * - Probe a point */ -static float calibration_probe(const float &nx, const float &ny, const bool stow) { +static float calibration_probe(const xy_pos_t &xy, const bool stow) { #if HAS_BED_PROBE - return probe_pt(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false); + return probe_at_point(xy, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true); #else UNUSED(stow); - return lcd_probe_pt(nx, ny); + return lcd_probe_pt(xy); #endif } @@ -218,22 +218,26 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi _7p_6_center = probe_points >= 5 && probe_points <= 7, _7p_9_center = probe_points >= 8; - LOOP_CAL_ALL(rad) z_pt[rad] = 0.0; + LOOP_CAL_ALL(rad) z_pt[rad] = 0.0f; if (!_0p_calibration) { + const float dcr = delta_calibration_radius(); + if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center - z_pt[CEN] += calibration_probe(0, 0, stow_after_each); + const xy_pos_t center{0}; + z_pt[CEN] += calibration_probe(center, stow_after_each); if (isnan(z_pt[CEN])) return false; } 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; + const float start = _7p_9_center ? float(_CA) + _7P_STEP / 3.0f : _7p_6_center ? float(_CA) : float(__C), + steps = _7p_9_center ? _4P_STEP / 3.0f : _7p_6_center ? _7P_STEP : _4P_STEP; I_LOOP_CAL_PT(rad, start, steps) { const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = delta_calibration_radius * 0.1; - z_pt[CEN] += calibration_probe(cos(a) * r, sin(a) * r, stow_after_each); + r = dcr * 0.1; + const xy_pos_t vec = { cos(a), sin(a) }; + z_pt[CEN] += calibration_probe(vec * r, stow_after_each); if (isnan(z_pt[CEN])) return false; } z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points); @@ -241,13 +245,13 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi if (!_1p_calibration) { // probe the radius const CalEnum start = _4p_opposite_points ? _AB : __A; - const float steps = _7p_14_intermediates ? _7P_STEP / 15.0 : // 15r * 6 + 10c = 100 - _7p_11_intermediates ? _7P_STEP / 12.0 : // 12r * 6 + 9c = 81 - _7p_8_intermediates ? _7P_STEP / 9.0 : // 9r * 6 + 10c = 64 - _7p_6_intermediates ? _7P_STEP / 7.0 : // 7r * 6 + 7c = 49 - _7p_4_intermediates ? _7P_STEP / 5.0 : // 5r * 6 + 6c = 36 - _7p_2_intermediates ? _7P_STEP / 3.0 : // 3r * 6 + 7c = 25 - _7p_1_intermediates ? _7P_STEP / 2.0 : // 2r * 6 + 4c = 16 + const float steps = _7p_14_intermediates ? _7P_STEP / 15.0f : // 15r * 6 + 10c = 100 + _7p_11_intermediates ? _7P_STEP / 12.0f : // 12r * 6 + 9c = 81 + _7p_8_intermediates ? _7P_STEP / 9.0f : // 9r * 6 + 10c = 64 + _7p_6_intermediates ? _7P_STEP / 7.0f : // 7r * 6 + 7c = 49 + _7p_4_intermediates ? _7P_STEP / 5.0f : // 5r * 6 + 6c = 36 + _7p_2_intermediates ? _7P_STEP / 3.0f : // 3r * 6 + 7c = 25 + _7p_1_intermediates ? _7P_STEP / 2.0f : // 2r * 6 + 4c = 16 _7p_no_intermediates ? _7P_STEP : // 1r * 6 + 3c = 9 _4P_STEP; // .5r * 6 + 1c = 4 bool zig_zag = true; @@ -255,9 +259,10 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi 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)), + r = dcr * (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); + const xy_pos_t vec = { cos(a), sin(a) }; + const float z_temp = calibration_probe(vec * r, stow_after_each); if (isnan(z_temp)) return false; // 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))); @@ -269,7 +274,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi LOOP_CAL_RAD(rad) z_pt[rad] /= _7P_STEP / steps; - do_blocking_move_to_xy(0.0, 0.0); + do_blocking_move_to_xy(0.0f, 0.0f); } } return true; @@ -281,102 +286,90 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi * - 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 }; +static void reverse_kinematics_probe_points(float z_pt[NPP + 1], abc_float_t mm_at_pt_axis[NPP + 1]) { + xyz_pos_t pos{0}; + const float dcr = delta_calibration_radius(); 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]; + r = (rad == CEN ? 0.0f : dcr); + pos.set(cos(a) * r, sin(a) * r, z_pt[rad]); inverse_kinematics(pos); - LOOP_XYZ(axis) mm_at_pt_axis[rad][axis] = delta[axis]; + mm_at_pt_axis[rad] = delta; } } -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; +static void forward_kinematics_probe_points(abc_float_t mm_at_pt_axis[NPP + 1], 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 ZPP(N,I,A) (((1.0f + r_quot * (N)) / 3.0f) * 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); + z_pt[CEN] = Z00(CEN, a) + Z00(CEN, b) + Z00(CEN, c); + z_pt[__A] = Zp2(__A, a) + Zm1(__A, b) + Zm1(__A, c); + z_pt[__B] = Zm1(__B, a) + Zp2(__B, b) + Zm1(__B, c); + z_pt[__C] = Zm1(__C, a) + Zm1(__C, b) + Zp2(__C, c); + z_pt[_BC] = Zm2(_BC, a) + Zp1(_BC, b) + Zp1(_BC, c); + z_pt[_CA] = Zp1(_CA, a) + Zm2(_CA, b) + Zp1(_CA, c); + z_pt[_AB] = Zp1(_AB, a) + Zp1(_AB, b) + Zm2(_AB, c); } -static void calc_kinematics_diff_probe_points(float z_pt[NPP + 1], float delta_e[ABC], float delta_r, float delta_t[ABC]) { +static void calc_kinematics_diff_probe_points(float z_pt[NPP + 1], abc_float_t delta_e, const float delta_r, abc_float_t delta_t) { const float z_center = z_pt[CEN]; - float diff_mm_at_pt_axis[NPP + 1][ABC], - new_mm_at_pt_axis[NPP + 1][ABC]; + abc_float_t diff_mm_at_pt_axis[NPP + 1], new_mm_at_pt_axis[NPP + 1]; 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]; + delta_tower_angle_trim += delta_t; 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]; + LOOP_CAL_ALL(rad) diff_mm_at_pt_axis[rad] -= new_mm_at_pt_axis[rad] + delta_e; 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]; + delta_tower_angle_trim -= delta_t; 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; + const float r_quot = delta_calibration_radius() / delta_radius; + return RECIPROCAL(r_quot / (2.0f / 3.0f)); // (2/3)/CR } 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; + constexpr float diff = 0.01f, delta_r = diff; + float r_fac = 0.0f, z_pt[NPP + 1] = { 0.0f }; + abc_float_t delta_e = { 0.0f }, delta_t = { 0.0f }; + 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) + r_fac = -(z_pt[__A] + z_pt[__B] + z_pt[__C] + z_pt[_BC] + z_pt[_CA] + z_pt[_AB]) / 6.0f; + r_fac = diff / r_fac / 3.0f; // 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}; + constexpr float diff = 0.01f, delta_r = 0.0f; + float a_fac = 0.0f, z_pt[NPP + 1] = { 0.0f }; + abc_float_t delta_e = { 0.0f }, delta_t = { 0.0f }; + delta_t.reset(); 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; + delta_t[axis] = 0; + a_fac += z_pt[uint8_t((axis * _4P_STEP) - _7P_STEP + NPP) % NPP + 1] / 6.0f; + a_fac -= z_pt[uint8_t((axis * _4P_STEP) + 1 + _7P_STEP)] / 6.0f; } - a_fac = diff / a_fac / 3.0; // 1/(3*delta_Z) + a_fac = diff / a_fac / 3.0f; // 1/(3*delta_Z) return a_fac; } @@ -411,27 +404,27 @@ void GcodeSuite::G33() { const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); if (!WITHIN(probe_points, 0, 10)) { - SERIAL_ECHOLNPGM("?(P)oints is implausible (0-10)."); + SERIAL_ECHOLNPGM("?(P)oints implausible (0-10)."); return; } const bool towers_set = !parser.seen('T'); - const float calibration_precision = parser.floatval('C', 0.0); + const float calibration_precision = parser.floatval('C', 0.0f); if (calibration_precision < 0) { - SERIAL_ECHOLNPGM("?(C)alibration precision is implausible (>=0)."); + SERIAL_ECHOLNPGM("?(C)alibration precision implausible (>=0)."); return; } const int8_t force_iterations = parser.intval('F', 0); if (!WITHIN(force_iterations, 0, 30)) { - SERIAL_ECHOLNPGM("?(F)orce iteration is implausible (0-30)."); + SERIAL_ECHOLNPGM("?(F)orce iteration implausible (0-30)."); return; } const int8_t verbose_level = parser.byteval('V', 1); if (!WITHIN(verbose_level, 0, 3)) { - SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-3)."); + SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-3)."); return; } @@ -445,37 +438,28 @@ void GcodeSuite::G33() { _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; + _angle_results = probe_points >= 3 && towers_set; static const 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 = (verbose_level ? 999.0f : 0.0f), // 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] - }, + h_factor, r_factor, a_factor, r_old = delta_radius, - h_old = delta_height, - a_old[ABC] = { - delta_tower_angle_trim[A_AXIS], - delta_tower_angle_trim[B_AXIS], - delta_tower_angle_trim[C_AXIS] - }; + h_old = delta_height; + + abc_pos_t e_old = delta_endstop_adj, a_old = delta_tower_angle_trim; SERIAL_ECHOLNPGM("G33 Auto Calibrate"); + const float dcr = delta_calibration_radius(); + 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; - if (!position_is_reachable(cos(a) * r, sin(a) * r)) { - SERIAL_ECHOLNPGM("?(M665 B)ed radius is implausible."); + const float a = RADIANS(210 + (360 / NPP) * (axis - 1)); + if (!position_is_reachable(cos(a) * dcr, sin(a) * dcr)) { + SERIAL_ECHOLNPGM("?Bed calibration radius implausible."); return; } } @@ -496,9 +480,9 @@ void GcodeSuite::G33() { do { // start iterations - float z_at_pt[NPP + 1] = { 0.0 }; + float z_at_pt[NPP + 1] = { 0.0f }; - test_precision = zero_std_dev_old != 999.0 ? (zero_std_dev + zero_std_dev_old) / 2 : zero_std_dev; + test_precision = zero_std_dev_old != 999.0f ? (zero_std_dev + zero_std_dev_old) / 2.0f : zero_std_dev; iterations++; // Probe the points @@ -514,20 +498,19 @@ void GcodeSuite::G33() { if ((zero_std_dev < test_precision || iterations <= force_iterations) && zero_std_dev > calibration_precision) { #if !HAS_BED_PROBE - test_precision = 0.00; // forced end + test_precision = 0.0f; // forced end #endif if (zero_std_dev < zero_std_dev_min) { // set roll-back point - COPY(e_old, delta_endstop_adj); + e_old = delta_endstop_adj; r_old = delta_radius; h_old = delta_height; - COPY(a_old, delta_tower_angle_trim); + a_old = delta_tower_angle_trim; } - float e_delta[ABC] = { 0.0 }, - r_delta = 0.0, - t_delta[ABC] = { 0.0 }; + abc_float_t e_delta = { 0.0f }, t_delta = { 0.0f }; + float r_delta = 0.0f; /** * convergence matrices: @@ -535,7 +518,7 @@ void GcodeSuite::G33() { * - 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 ZP(N,I) ((N) * z_at_pt[I] / 4.0f) // 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) @@ -543,74 +526,73 @@ void GcodeSuite::G33() { #define Z0(I) ZP(0, I) // calculate factors - const float cr_old = delta_calibration_radius; - if (_7p_9_center) delta_calibration_radius *= 0.9; + if (_7p_9_center) calibration_radius_factor = 0.9f; h_factor = auto_tune_h(); r_factor = auto_tune_r(); a_factor = auto_tune_a(); - delta_calibration_radius = cr_old; + calibration_radius_factor = 1.0f; switch (probe_points) { case 0: - test_precision = 0.00; // forced end + test_precision = 0.0f; // forced end break; case 1: - test_precision = 0.00; // forced end + test_precision = 0.0f; // forced end LOOP_XYZ(axis) e_delta[axis] = +Z4(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; + e_delta.set((+Z4(__A) -Z2(__B) -Z2(__C)) * h_factor +Z4(CEN), + (-Z2(__A) +Z4(__B) -Z2(__C)) * h_factor +Z4(CEN), + (-Z2(__A) -Z2(__B) +Z4(__C)) * h_factor +Z4(CEN)); + r_delta = (+Z4(__A) +Z4(__B) +Z4(__C) -Z12(CEN)) * 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; + e_delta.set((-Z4(_BC) +Z2(_CA) +Z2(_AB)) * h_factor +Z4(CEN), + (+Z2(_BC) -Z4(_CA) +Z2(_AB)) * h_factor +Z4(CEN), + (+Z2(_BC) +Z2(_CA) -Z4(_AB)) * h_factor +Z4(CEN)); + r_delta = (+Z4(_BC) +Z4(_CA) +Z4(_AB) -Z12(CEN)) * 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; + e_delta.set((+Z2(__A) -Z1(__B) -Z1(__C) -Z2(_BC) +Z1(_CA) +Z1(_AB)) * h_factor +Z4(CEN), + (-Z1(__A) +Z2(__B) -Z1(__C) +Z1(_BC) -Z2(_CA) +Z1(_AB)) * h_factor +Z4(CEN), + (-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; 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; + t_delta.set((+Z0(__A) -Z4(__B) +Z4(__C) +Z0(_BC) -Z4(_CA) +Z4(_AB) +Z0(CEN)) * a_factor, + (+Z4(__A) +Z0(__B) -Z4(__C) +Z4(_BC) +Z0(_CA) -Z4(_AB) +Z0(CEN)) * a_factor, + (-Z4(__A) +Z4(__B) +Z0(__C) -Z4(_BC) +Z4(_CA) +Z0(_AB) +Z0(CEN)) * a_factor); } break; } - LOOP_XYZ(axis) delta_endstop_adj[axis] += e_delta[axis]; + delta_endstop_adj += e_delta; delta_radius += r_delta; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] += t_delta[axis]; + delta_tower_angle_trim += t_delta; } else if (zero_std_dev >= test_precision) { // roll back - COPY(delta_endstop_adj, e_old); + delta_endstop_adj = e_old; delta_radius = r_old; delta_height = h_old; - COPY(delta_tower_angle_trim, a_old); + delta_tower_angle_trim = a_old; } if (verbose_level != 0) { // !dry run // Normalize angles to least-squares if (_angle_results) { - float a_sum = 0.0; + float a_sum = 0.0f; LOOP_XYZ(axis) a_sum += delta_tower_angle_trim[axis]; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= a_sum / 3.0; + LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= a_sum / 3.0f; } // adjust delta_height and endstops by the max amount - const float z_temp = _MAX(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]); + const float z_temp = _MAX(delta_endstop_adj.a, delta_endstop_adj.b, delta_endstop_adj.c); delta_height -= z_temp; LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp; } @@ -638,7 +620,7 @@ void GcodeSuite::G33() { 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)LROUND(zero_std_dev_min * 1000.0f)); else sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min)); ui.set_status(mess); @@ -670,7 +652,7 @@ void GcodeSuite::G33() { 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)LROUND(zero_std_dev * 1000.0f)); else sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev)); ui.set_status(mess); diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index fee9ea218993..704d370c4f4e 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -25,28 +25,49 @@ #if ENABLED(Z_STEPPER_AUTO_ALIGN) #include "../gcode.h" -#include "../../module/delta.h" -#include "../../module/motion.h" +#include "../../module/planner.h" #include "../../module/stepper.h" -#include "../../module/endstops.h" +#include "../../module/motion.h" +#include "../../module/probe.h" #if HOTENDS > 1 #include "../../module/tool_change.h" #endif -#if HAS_BED_PROBE - #include "../../module/probe.h" -#endif - #if HAS_LEVELING #include "../../feature/bedlevel/bedlevel.h" #endif +#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #include "../../libs/least_squares_fit.h" +#endif + #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" -float z_auto_align_xpos[Z_STEPPER_COUNT] = Z_STEPPER_ALIGN_X, - z_auto_align_ypos[Z_STEPPER_COUNT] = Z_STEPPER_ALIGN_Y; +// Sanity-check the count of Z_STEPPER_ALIGN_XY points +constexpr xy_pos_t sanity_arr_z_align[] = Z_STEPPER_ALIGN_XY; +#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + static_assert(COUNT(sanity_arr_z_align) >= Z_STEPPER_COUNT, + "Z_STEPPER_ALIGN_XY requires at least three {X,Y} entries (Z, Z2, Z3, ...)." + ); +#else + static_assert(COUNT(sanity_arr_z_align) == Z_STEPPER_COUNT, + #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + "Z_STEPPER_ALIGN_XY requires three {X,Y} entries (Z, Z2, and Z3)." + #else + "Z_STEPPER_ALIGN_XY requires two {X,Y} entries (Z and Z2)." + #endif + ); +#endif + +static xy_pos_t z_auto_align_pos[Z_STEPPER_COUNT] = Z_STEPPER_ALIGN_XY; + +#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + static xy_pos_t z_stepper_pos[] = Z_STEPPER_ALIGN_STEPPER_XY; +#endif + +#define G34_PROBE_COUNT COUNT(z_auto_align_pos) inline void set_all_z_lock(const bool lock) { stepper.set_z_lock(lock); @@ -59,7 +80,9 @@ inline void set_all_z_lock(const bool lock) { /** * G34: Z-Stepper automatic alignment * - * Parameters: I T A + * I + * T + * A */ void GcodeSuite::G34() { if (DEBUGGING(LEVELING)) { @@ -81,11 +104,18 @@ void GcodeSuite::G34() { break; } - const float z_auto_align_amplification = parser.floatval('A', Z_STEPPER_ALIGN_AMP); - if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { - SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); - break; - } + const float z_auto_align_amplification = + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + Z_STEPPER_ALIGN_AMP; + #else + parser.floatval('A', Z_STEPPER_ALIGN_AMP); + if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { + SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); + break; + } + #endif + + const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; // Wait for planner moves to finish! planner.synchronize(); @@ -121,24 +151,26 @@ void GcodeSuite::G34() { #define Z_BASIC_CLEARANCE Z_CLEARANCE_BETWEEN_PROBES #endif + // Compute a worst-case clearance height to probe from. After the first + // iteration this will be re-calculated based on the actual bed position float z_probe = Z_BASIC_CLEARANCE + (G34_MAX_GRADE) * 0.01f * ( #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - SQRT(_MAX(HYPOT2(z_auto_align_xpos[0] - z_auto_align_ypos[0], z_auto_align_xpos[1] - z_auto_align_ypos[1]), - HYPOT2(z_auto_align_xpos[1] - z_auto_align_ypos[1], z_auto_align_xpos[2] - z_auto_align_ypos[2]), - HYPOT2(z_auto_align_xpos[2] - z_auto_align_ypos[2], z_auto_align_xpos[0] - z_auto_align_ypos[0]))) + SQRT(_MAX(HYPOT2(z_auto_align_pos[0].x - z_auto_align_pos[0].y, z_auto_align_pos[1].x - z_auto_align_pos[1].y), + HYPOT2(z_auto_align_pos[1].x - z_auto_align_pos[1].y, z_auto_align_pos[2].x - z_auto_align_pos[2].y), + HYPOT2(z_auto_align_pos[2].x - z_auto_align_pos[2].y, z_auto_align_pos[0].x - z_auto_align_pos[0].y))) #else - HYPOT(z_auto_align_xpos[0] - z_auto_align_ypos[0], z_auto_align_xpos[1] - z_auto_align_ypos[1]) + HYPOT(z_auto_align_pos[0].x - z_auto_align_pos[0].y, z_auto_align_pos[1].x - z_auto_align_pos[1].y) #endif ); // Home before the alignment procedure - if (homing_needed()) home_all_axes(); + if (!all_axes_known()) home_all_axes(); // Move the Z coordinate realm towards the positive - dirty trick - current_position[Z_AXIS] -= z_probe * 0.5; + current_position.z -= z_probe * 0.5f; float last_z_align_move[Z_STEPPER_COUNT] = ARRAY_N(Z_STEPPER_COUNT, 10000.0f, 10000.0f, 10000.0f), - z_measured[Z_STEPPER_COUNT] = { 0 }, + z_measured[G34_PROBE_COUNT] = { 0 }, z_maxdiff = 0.0f, amplification = z_auto_align_amplification; @@ -150,54 +182,79 @@ void GcodeSuite::G34() { SERIAL_ECHOLNPAIR("\nITERATION: ", int(iteration + 1)); // Initialize minimum value - float z_measured_min = 100000.0f; + float z_measured_min = 100000.0f, + z_measured_max = -100000.0f; + // Probe all positions (one per Z-Stepper) - for (uint8_t izstepper = 0; izstepper < Z_STEPPER_COUNT; ++izstepper) { + for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i) { // iteration odd/even --> downward / upward stepper sequence - const uint8_t zstepper = (iteration & 1) ? Z_STEPPER_COUNT - 1 - izstepper : izstepper; + const uint8_t iprobe = (iteration & 1) ? G34_PROBE_COUNT - 1 - i : i; // Safe clearance even on an incline - if (iteration == 0 || izstepper > 0) do_blocking_move_to_z(z_probe); + if (iteration == 0 || i > 0) do_blocking_move_to_z(z_probe); - // Probe a Z height for each stepper - if (isnan(probe_pt(z_auto_align_xpos[zstepper], z_auto_align_ypos[zstepper], PROBE_PT_RAISE, 0, true))) { + // Probe a Z height for each stepper. + const float z_probed_height = probe_at_point(z_auto_align_pos[iprobe], raise_after, 0, true); + if (isnan(z_probed_height)) { SERIAL_ECHOLNPGM("Probing failed."); err_break = true; break; } - // This is not the trigger Z value. It is the position of the probe after raising it. - // It is higher than the trigger value by a constant value (not known here). This value - // is more useful for determining the desired next iteration Z position for probing. It is - // equally well suited for determining the misalignment, just like the trigger position would be. - z_measured[zstepper] = current_position[Z_AXIS]; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(zstepper + 1), " measured position is ", z_measured[zstepper]); + // Add height to each value, to provide a more useful target height for + // the next iteration of probing. This allows adjustments to be made away from the bed. + z_measured[iprobe] = z_probed_height + Z_CLEARANCE_BETWEEN_PROBES; + + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("> Z", int(iprobe + 1), " measured position is ", z_measured[iprobe]); // Remember the minimum measurement to calculate the correction later on - z_measured_min = _MIN(z_measured_min, z_measured[zstepper]); - } // for (zstepper) + z_measured_min = _MIN(z_measured_min, z_measured[iprobe]); + z_measured_max = _MAX(z_measured_max, z_measured[iprobe]); + } // for (i) if (err_break) break; // Adapt the next probe clearance height based on the new measurements. // Safe_height = lowest distance to bed (= highest measurement) plus highest measured misalignment. - #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) - z_maxdiff = _MAX(ABS(z_measured[0] - z_measured[1]), ABS(z_measured[1] - z_measured[2]), ABS(z_measured[2] - z_measured[0])); - z_probe = Z_BASIC_CLEARANCE + _MAX(z_measured[0], z_measured[1], z_measured[2]) + z_maxdiff; - #else - z_maxdiff = ABS(z_measured[0] - z_measured[1]); - z_probe = Z_BASIC_CLEARANCE + _MAX(z_measured[0], z_measured[1]) + z_maxdiff; + z_maxdiff = z_measured_max - z_measured_min; + z_probe = Z_BASIC_CLEARANCE + z_measured_max + z_maxdiff; + + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Replace the initial values in z_measured with calculated heights at + // each stepper position. This allows the adjustment algorithm to be + // shared between both possible probing mechanisms. + + // This must be done after the next z_probe height is calculated, so that + // the height is calculated from actual print area positions, and not + // extrapolated motor movements. + + // Compute the least-squares fit for all probed points. + // Calculate the Z position of each stepper and store it in z_measured. + // This allows the actual adjustment logic to be shared by both algorithms. + linear_fit_data lfd; + incremental_LSF_reset(&lfd); + for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i) { + SERIAL_ECHOLNPAIR("PROBEPT_", int(i + 1), ": ", z_measured[i]); + incremental_LSF(&lfd, z_auto_align_pos[i], z_measured[i]); + } + finish_incremental_LSF(&lfd); + + z_measured_min = 100000.0f; + for (uint8_t i = 0; i < Z_STEPPER_COUNT; ++i) { + z_measured[i] = -(lfd.A * z_stepper_pos[i].x + lfd.B * z_stepper_pos[i].y); + z_measured_min = _MIN(z_measured_min, z_measured[i]); + } + + SERIAL_ECHOLNPAIR("CALCULATED STEPPER POSITIONS: Z1=", z_measured[0], " Z2=", z_measured[1], " Z3=", z_measured[2]); #endif - SERIAL_ECHOPAIR("\n" + SERIAL_ECHOLNPAIR("\n" "DIFFERENCE Z1-Z2=", ABS(z_measured[0] - z_measured[1]) #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) , " Z2-Z3=", ABS(z_measured[1] - z_measured[2]) , " Z3-Z1=", ABS(z_measured[2] - z_measured[0]) #endif ); - SERIAL_EOL(); - SERIAL_EOL(); // The following correction actions are to be enabled for select Z-steppers only stepper.set_separate_multi_axis(true); @@ -209,8 +266,10 @@ void GcodeSuite::G34() { const float z_align_move = z_measured[zstepper] - z_measured_min, z_align_abs = ABS(z_align_move); - // Optimize one iterations correction based on the first measurements - if (z_align_abs > 0.0f) amplification = iteration == 1 ? _MIN(last_z_align_move[zstepper] / z_align_abs, 2.0f) : z_auto_align_amplification; + #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Optimize one iteration's correction based on the first measurements + if (z_align_abs > 0.0f) amplification = iteration == 1 ? _MIN(last_z_align_move[zstepper] / z_align_abs, 2.0f) : z_auto_align_amplification; + #endif // Check for less accuracy compared to last move if (last_z_align_move[zstepper] < z_align_abs - 1.0) { @@ -238,7 +297,7 @@ void GcodeSuite::G34() { } // Do a move to correct part of the misalignment for the current stepper - do_blocking_move_to_z(amplification * z_align_move + current_position[Z_AXIS]); + do_blocking_move_to_z(amplification * z_align_move + current_position.z); } // for (zstepper) // Back to normal stepper operations @@ -255,7 +314,6 @@ void GcodeSuite::G34() { SERIAL_ECHOLNPAIR("Did ", int(iteration + (iteration != z_auto_align_iterations)), " iterations of ", int(z_auto_align_iterations)); SERIAL_ECHOLNPAIR_F("Accuracy: ", z_maxdiff); - SERIAL_EOL(); // Restore the active tool after homing #if HOTENDS > 1 @@ -275,42 +333,110 @@ void GcodeSuite::G34() { // After this operation the z position needs correction set_axis_is_not_at_home(Z_AXIS); - // Stow the probe, as the last call to probe_pt(...) left + // Stow the probe, as the last call to probe_at_point(...) left // the probe deployed if it was successful. STOW_PROBE(); // Home Z after the alignment procedure process_subcommands_now_P(PSTR("G28 Z")); - } while(0); + }while(0); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G34"); } /** - * M422: Z-Stepper automatic alignment parameter selection + * M422: Set a Z-Stepper automatic alignment XY point. + * Use repeatedly to set multiple points. + * + * S : Index of the probe point to set + * + * With Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS: + * W : Index of the Z stepper position to set + * The W and S parameters may not be combined. + * + * S and W require an X and/or Y parameter + * X : X position to set (Unchanged if omitted) + * Y : Y position to set (Unchanged if omitted) */ void GcodeSuite::M422() { - const int8_t zstepper = parser.intval('S') - 1; - if (!WITHIN(zstepper, 0, Z_STEPPER_COUNT - 1)) { - SERIAL_ECHOLNPGM("?(S) Z-Stepper index invalid."); + if (!parser.seen_any()) { + for (uint8_t i = 0; i < G34_PROBE_COUNT; ++i) + SERIAL_ECHOLNPAIR_P(PSTR("M422 S"), i + 1, SP_X_STR, z_auto_align_pos[i].x, SP_Y_STR, z_auto_align_pos[i].y); + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + for (uint8_t i = 0; i < Z_STEPPER_COUNT; ++i) + SERIAL_ECHOLNPAIR_P(PSTR("M422 W"), i + 1, SP_X_STR, z_stepper_pos[i].x, SP_Y_STR, z_stepper_pos[i].y); + #endif return; } - const float x_pos = parser.floatval('X', z_auto_align_xpos[zstepper]); - if (!WITHIN(x_pos, X_MIN_POS, X_MAX_POS)) { - SERIAL_ECHOLNPGM("?(X) out of bounds."); + const bool is_probe_point = parser.seen('S'); + + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + if (is_probe_point && parser.seen('W')) { + SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); + return; + } + #endif + + xy_pos_t *pos_dest = ( + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + !is_probe_point ? z_stepper_pos : + #endif + z_auto_align_pos + ); + + if (!is_probe_point + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + && !parser.seen('W') + #endif + ) { + SERIAL_ECHOLNPGM( + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + "?(S) or (W) is required." + #else + "?(S) is required." + #endif + ); return; } - const float y_pos = parser.floatval('Y', z_auto_align_ypos[zstepper]); - if (!WITHIN(y_pos, Y_MIN_POS, Y_MAX_POS)) { - SERIAL_ECHOLNPGM("?(Y) out of bounds."); - return; + // Get the Probe Position Index or Z Stepper Index + int8_t position_index; + if (is_probe_point) { + position_index = parser.intval('S') - 1; + if (!WITHIN(position_index, 0, int8_t(G34_PROBE_COUNT) - 1)) { + SERIAL_ECHOLNPGM("?(S) Z-ProbePosition index invalid."); + return; + } + } + else { + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + position_index = parser.intval('W') - 1; + if (!WITHIN(position_index, 0, Z_STEPPER_COUNT - 1)) { + SERIAL_ECHOLNPGM("?(W) Z-Stepper index invalid."); + return; + } + #endif + } + + const xy_pos_t pos = { + parser.floatval('X', pos_dest[position_index].x), + parser.floatval('Y', pos_dest[position_index].y) + }; + + if (is_probe_point) { + if (!position_is_reachable_by_probe(pos.x, Y_CENTER)) { + SERIAL_ECHOLNPGM("?(X) out of bounds."); + return; + } + if (!position_is_reachable_by_probe(pos)) { + SERIAL_ECHOLNPGM("?(Y) out of bounds."); + return; + } } - z_auto_align_xpos[zstepper] = x_pos; - z_auto_align_ypos[zstepper] = y_pos; + pos_dest[position_index] = pos; } #endif // Z_STEPPER_AUTO_ALIGN diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index c3356f078409..d251e89f8a94 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -61,20 +61,19 @@ enum side_t : uint8_t { TOP, RIGHT, FRONT, LEFT, BACK, NUM_SIDES }; -struct measurements_t { - static constexpr float dimensions[XYZ] = CALIBRATION_OBJECT_DIMENSIONS; - static constexpr float true_center[XYZ] = CALIBRATION_OBJECT_CENTER; +static constexpr xyz_pos_t true_center CALIBRATION_OBJECT_CENTER; +static constexpr xyz_float_t dimensions CALIBRATION_OBJECT_DIMENSIONS; +static constexpr xy_float_t nod = { CALIBRATION_NOZZLE_OUTER_DIAMETER, CALIBRATION_NOZZLE_OUTER_DIAMETER }; - float obj_center[XYZ] = CALIBRATION_OBJECT_CENTER; - float obj_side[NUM_SIDES]; +struct measurements_t { + xyz_pos_t obj_center = true_center; // Non-static must be assigned from xyz_pos_t - float backlash[NUM_SIDES]; - float pos_error[XYZ]; + float obj_side[NUM_SIDES], backlash[NUM_SIDES]; + xyz_float_t pos_error; - float nozzle_outer_dimension[2] = {CALIBRATION_NOZZLE_OUTER_DIAMETER, CALIBRATION_NOZZLE_OUTER_DIAMETER}; + xy_float_t nozzle_outer_dimension = nod; }; -#define TEMPORARY_BED_LEVELING_STATE(enable) TemporaryBedLevelingState tbls(enable) #define TEMPORARY_SOFT_ENDSTOP_STATE(enable) REMEMBER(tes, soft_endstops_enabled, enable); #if ENABLED(BACKLASH_GCODE) @@ -89,43 +88,8 @@ struct measurements_t { #define TEMPORARY_BACKLASH_SMOOTHING(value) #endif -/** - * A class to save and change the bed leveling state, - * then restore it when it goes out of scope. - */ -class TemporaryBedLevelingState { - bool saved; - - public: - TemporaryBedLevelingState(const bool enable) : saved(planner.leveling_active) { - set_bed_leveling_enabled(enable); - } - ~TemporaryBedLevelingState() { set_bed_leveling_enabled(saved); } -}; - -/** - * Move to a particular location. Up to three individual axes - * and their destinations can be specified, in any order. - */ -inline void move_to( - const AxisEnum a1 = NO_AXIS, const float p1 = 0, - const AxisEnum a2 = NO_AXIS, const float p2 = 0, - const AxisEnum a3 = NO_AXIS, const float p3 = 0 -) { - set_destination_from_current(); - - // Note: The order of p1, p2, p3 may not correspond to X, Y, Z - if (a1 != NO_AXIS) destination[a1] = p1; - if (a2 != NO_AXIS) destination[a2] = p2; - if (a3 != NO_AXIS) destination[a3] = p3; - - // Make sure coordinates are within bounds - destination[X_AXIS] = _MAX(_MIN(destination[X_AXIS], X_MAX_POS), X_MIN_POS); - destination[Y_AXIS] = _MAX(_MIN(destination[Y_AXIS], Y_MAX_POS), Y_MIN_POS); - destination[Z_AXIS] = _MAX(_MIN(destination[Z_AXIS], Z_MAX_POS), Z_MIN_POS); - - // Move to position - do_blocking_move_to(destination, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL)); +inline void calibration_move() { + do_blocking_move_to(current_position, MMM_TO_MMS(CALIBRATION_FEEDRATE_TRAVEL)); } /** @@ -136,10 +100,12 @@ inline void move_to( */ inline void park_above_object(measurements_t &m, const float uncertainty) { // Move to safe distance above calibration object - move_to(Z_AXIS, m.obj_center[Z_AXIS] + m.dimensions[Z_AXIS] / 2 + uncertainty); + current_position.z = m.obj_center.z + dimensions.z / 2 + uncertainty; + calibration_move(); // Move to center of calibration object in XY - move_to(X_AXIS, m.obj_center[X_AXIS], Y_AXIS, m.obj_center[Y_AXIS]); + current_position = xy_pos_t(m.obj_center); + calibration_move(); } #if HOTENDS > 1 @@ -154,14 +120,9 @@ inline void park_above_object(measurements_t &m, const float uncertainty) { #if HAS_HOTEND_OFFSET inline void normalize_hotend_offsets() { - for (uint8_t e = 1; e < HOTENDS; e++) { - hotend_offset[X_AXIS][e] -= hotend_offset[X_AXIS][0]; - hotend_offset[Y_AXIS][e] -= hotend_offset[Y_AXIS][0]; - hotend_offset[Z_AXIS][e] -= hotend_offset[Z_AXIS][0]; - } - hotend_offset[X_AXIS][0] = 0; - hotend_offset[Y_AXIS][0] = 0; - hotend_offset[Z_AXIS][0] = 0; + for (uint8_t e = 1; e < HOTENDS; e++) + hotend_offset[e] -= hotend_offset[0]; + hotend_offset[0].reset(); } #endif @@ -186,17 +147,16 @@ inline bool read_calibration_pin() { * fast in - Fast vs. precise measurement */ float measuring_movement(const AxisEnum axis, const int dir, const bool stop_state, const bool fast) { - const float step = fast ? 0.25 : CALIBRATION_MEASUREMENT_RESOLUTION; - const float mms = MMM_TO_MMS(fast ? CALIBRATION_FEEDRATE_FAST : CALIBRATION_FEEDRATE_SLOW); - const float limit = fast ? 50 : 5; + const float step = fast ? 0.25 : CALIBRATION_MEASUREMENT_RESOLUTION; + const feedRate_t mms = fast ? MMM_TO_MMS(CALIBRATION_FEEDRATE_FAST) : MMM_TO_MMS(CALIBRATION_FEEDRATE_SLOW); + const float limit = fast ? 50 : 5; - set_destination_from_current(); + destination = current_position; for (float travel = 0; travel < limit; travel += step) { destination[axis] += dir * step; do_blocking_move_to(destination, mms); planner.synchronize(); - if (read_calibration_pin() == stop_state) - break; + if (read_calibration_pin() == stop_state) break; } return destination[axis]; } @@ -215,7 +175,7 @@ inline float measure(const AxisEnum axis, const int dir, const bool stop_state, const bool fast = uncertainty == CALIBRATION_MEASUREMENT_UNKNOWN; // Save position - set_destination_from_current(); + destination = current_position; const float start_pos = destination[axis]; const float measured_pos = measuring_movement(axis, dir, stop_state, fast); // Measure backlash @@ -239,7 +199,7 @@ inline float measure(const AxisEnum axis, const int dir, const bool stop_state, * to find out height of edge */ inline void probe_side(measurements_t &m, const float uncertainty, const side_t side, const bool probe_top_at_edge=false) { - const float dimensions[] = CALIBRATION_OBJECT_DIMENSIONS; + const xyz_float_t dimensions = CALIBRATION_OBJECT_DIMENSIONS; AxisEnum axis; float dir; @@ -248,7 +208,7 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t switch (side) { case TOP: { const float measurement = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty); - m.obj_center[Z_AXIS] = measurement - dimensions[Z_AXIS] / 2; + m.obj_center.z = measurement - dimensions.z / 2; m.obj_side[TOP] = measurement; return; } @@ -256,22 +216,24 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t case FRONT: axis = Y_AXIS; dir = 1; break; case LEFT: axis = X_AXIS; dir = 1; break; case BACK: axis = Y_AXIS; dir = -1; break; - default: - return; + default: return; } if (probe_top_at_edge) { // Probe top nearest the side we are probing - move_to(axis, m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 - m.nozzle_outer_dimension[axis])); + current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 - m.nozzle_outer_dimension[axis]); + calibration_move(); m.obj_side[TOP] = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty); - m.obj_center[Z_AXIS] = m.obj_side[TOP] - dimensions[Z_AXIS] / 2; + m.obj_center.z = m.obj_side[TOP] - dimensions.z / 2; } // Move to safe distance to the side of the calibration object - move_to(axis, m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2 + uncertainty)); + current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2 + uncertainty); + calibration_move(); // Plunge below the side of the calibration object and measure - move_to(Z_AXIS, m.obj_side[TOP] - CALIBRATION_NOZZLE_TIP_HEIGHT * 0.7); + current_position.z = m.obj_side[TOP] - CALIBRATION_NOZZLE_TIP_HEIGHT * 0.7; + calibration_move(); const float measurement = measure(axis, dir, true, &m.backlash[side], uncertainty); m.obj_center[axis] = measurement + dir * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2); m.obj_side[side] = measurement; @@ -310,38 +272,36 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { // Compute the measured center of the calibration object. #if HAS_X_CENTER - m.obj_center[X_AXIS] = (m.obj_side[LEFT] + m.obj_side[RIGHT]) / 2; + m.obj_center.x = (m.obj_side[LEFT] + m.obj_side[RIGHT]) / 2; #endif #if HAS_Y_CENTER - m.obj_center[Y_AXIS] = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2; + m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2; #endif // Compute the outside diameter of the nozzle at the height // at which it makes contact with the calibration object #if HAS_X_CENTER - m.nozzle_outer_dimension[X_AXIS] = m.obj_side[RIGHT] - m.obj_side[LEFT] - m.dimensions[X_AXIS]; + m.nozzle_outer_dimension.x = m.obj_side[RIGHT] - m.obj_side[LEFT] - dimensions.x; #endif #if HAS_Y_CENTER - m.nozzle_outer_dimension[Y_AXIS] = m.obj_side[BACK] - m.obj_side[FRONT] - m.dimensions[Y_AXIS]; + m.nozzle_outer_dimension.y = m.obj_side[BACK] - m.obj_side[FRONT] - dimensions.y; #endif park_above_object(m, uncertainty); // The difference between the known and the measured location // of the calibration object is the positional error - m.pos_error[X_AXIS] = - #if HAS_X_CENTER - m.true_center[X_AXIS] - m.obj_center[X_AXIS]; - #else - 0; - #endif - m.pos_error[Y_AXIS] = - #if HAS_Y_CENTER - m.true_center[Y_AXIS] - m.obj_center[Y_AXIS]; - #else - 0; - #endif - m.pos_error[Z_AXIS] = m.true_center[Z_AXIS] - m.obj_center[Z_AXIS]; + m.pos_error.x = (0 + #if HAS_X_CENTER + + true_center.x - m.obj_center.x + #endif + ); + m.pos_error.y = (0 + #if HAS_Y_CENTER + + true_center.y - m.obj_center.y + #endif + ); + m.pos_error.z = true_center.z - m.obj_center.z; } #if ENABLED(CALIBRATION_REPORTING) @@ -366,12 +326,12 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { inline void report_measured_center(const measurements_t &m) { SERIAL_ECHOLNPGM("Center:"); #if HAS_X_CENTER - SERIAL_ECHOLNPAIR(" X", m.obj_center[X_AXIS]); + SERIAL_ECHOLNPAIR_P(SP_X_STR, m.obj_center.x); #endif #if HAS_Y_CENTER - SERIAL_ECHOLNPAIR(" Y", m.obj_center[Y_AXIS]); + SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.obj_center.y); #endif - SERIAL_ECHOLNPAIR(" Z", m.obj_center[Z_AXIS]); + SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.obj_center.z); SERIAL_EOL(); } @@ -398,24 +358,24 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { SERIAL_ECHO(int(active_extruder)); SERIAL_ECHOLNPGM(" Positional Error:"); #if HAS_X_CENTER - SERIAL_ECHOLNPAIR(" X", m.pos_error[X_AXIS]); + SERIAL_ECHOLNPAIR_P(SP_X_STR, m.pos_error.x); #endif #if HAS_Y_CENTER - SERIAL_ECHOLNPAIR(" Y", m.pos_error[Y_AXIS]); + SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.pos_error.y); #endif - SERIAL_ECHOLNPAIR(" Z", m.pos_error[Z_AXIS]); + SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z); SERIAL_EOL(); } inline void report_measured_nozzle_dimensions(const measurements_t &m) { SERIAL_ECHOLNPGM("Nozzle Tip Outer Dimensions:"); - #if HAS_X_CENTER - SERIAL_ECHOLNPAIR(" X", m.nozzle_outer_dimension[X_AXIS]); - #else - UNUSED(m); - #endif - #if HAS_Y_CENTER - SERIAL_ECHOLNPAIR(" Y", m.nozzle_outer_dimension[Y_AXIS]); + #if HAS_X_CENTER || HAS_Y_CENTER + #if HAS_X_CENTER + SERIAL_ECHOLNPAIR_P(SP_X_STR, m.nozzle_outer_dimension.x); + #endif + #if HAS_Y_CENTER + SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.nozzle_outer_dimension.y); + #endif #else UNUSED(m); #endif @@ -427,16 +387,11 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { // This function requires normalize_hotend_offsets() to be called // inline void report_hotend_offsets() { - for (uint8_t e = 1; e < HOTENDS; e++) { - SERIAL_ECHOPAIR("T", int(e)); - SERIAL_ECHOLNPGM(" Hotend Offset:"); - SERIAL_ECHOLNPAIR(" X: ", hotend_offset[X_AXIS][e]); - SERIAL_ECHOLNPAIR(" Y: ", hotend_offset[Y_AXIS][e]); - SERIAL_ECHOLNPAIR(" Z: ", hotend_offset[Z_AXIS][e]); - SERIAL_EOL(); - } + for (uint8_t e = 1; e < HOTENDS; e++) + SERIAL_ECHOLNPAIR_P(PSTR("T"), int(e), PSTR(" Hotend Offset X"), hotend_offset[e].x, SP_Y_STR, hotend_offset[e].y, SP_Z_STR, hotend_offset[e].z); } #endif + #endif // CALIBRATION_REPORTING /** @@ -457,49 +412,40 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) { #if ENABLED(BACKLASH_GCODE) #if HAS_X_CENTER - backlash.distance_mm[X_AXIS] = (m.backlash[LEFT] + m.backlash[RIGHT]) / 2; + backlash.distance_mm.x = (m.backlash[LEFT] + m.backlash[RIGHT]) / 2; #elif ENABLED(CALIBRATION_MEASURE_LEFT) - backlash.distance_mm[X_AXIS] = m.backlash[LEFT]; + backlash.distance_mm.x = m.backlash[LEFT]; #elif ENABLED(CALIBRATION_MEASURE_RIGHT) - backlash.distance_mm[X_AXIS] = m.backlash[RIGHT]; + backlash.distance_mm.x = m.backlash[RIGHT]; #endif #if HAS_Y_CENTER - backlash.distance_mm[Y_AXIS] = (m.backlash[FRONT] + m.backlash[BACK]) / 2; + backlash.distance_mm.y = (m.backlash[FRONT] + m.backlash[BACK]) / 2; #elif ENABLED(CALIBRATION_MEASURE_FRONT) - backlash.distance_mm[Y_AXIS] = m.backlash[FRONT]; + backlash.distance_mm.y = m.backlash[FRONT]; #elif ENABLED(CALIBRATION_MEASURE_BACK) - backlash.distance_mm[Y_AXIS] = m.backlash[BACK]; + backlash.distance_mm.y = m.backlash[BACK]; #endif - backlash.distance_mm[Z_AXIS] = m.backlash[TOP]; + backlash.distance_mm.z = m.backlash[TOP]; #endif } #if ENABLED(BACKLASH_GCODE) // Turn on backlash compensation and move in all // directions to take up any backlash - { // New scope for TEMPORARY_BACKLASH_CORRECTION TEMPORARY_BACKLASH_CORRECTION(all_on); TEMPORARY_BACKLASH_SMOOTHING(0.0f); - move_to( - X_AXIS, current_position[X_AXIS] + 3, - Y_AXIS, current_position[Y_AXIS] + 3, - Z_AXIS, current_position[Z_AXIS] + 3 - ); - move_to( - X_AXIS, current_position[X_AXIS] - 3, - Y_AXIS, current_position[Y_AXIS] - 3, - Z_AXIS, current_position[Z_AXIS] - 3 - ); + const xyz_float_t move = { 3, 3, 3 }; + current_position += move; calibration_move(); + current_position -= move; calibration_move(); } #endif } inline void update_measurements(measurements_t &m, const AxisEnum axis) { - const float true_center[XYZ] = CALIBRATION_OBJECT_CENTER; current_position[axis] += m.pos_error[axis]; m.obj_center[axis] = true_center[axis]; m.pos_error[axis] = 0; @@ -531,12 +477,12 @@ inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const // Adjust the hotend offset #if HAS_HOTEND_OFFSET #if HAS_X_CENTER - hotend_offset[X_AXIS][extruder] += m.pos_error[X_AXIS]; + hotend_offset[extruder].x += m.pos_error.x; #endif #if HAS_Y_CENTER - hotend_offset[Y_AXIS][extruder] += m.pos_error[Y_AXIS]; + hotend_offset[extruder].y += m.pos_error.y; #endif - hotend_offset[Z_AXIS][extruder] += m.pos_error[Z_AXIS]; + hotend_offset[extruder].z += m.pos_error.z; normalize_hotend_offsets(); #endif @@ -612,7 +558,8 @@ inline void calibrate_all() { // Do a slow and precise calibration of the toolheads calibrate_all_toolheads(m, CALIBRATION_MEASUREMENT_UNCERTAIN); - move_to(X_AXIS, 150); // Park nozzle away from calibration object + current_position.x = X_CENTER; + calibration_move(); // Park nozzle away from calibration object } /** diff --git a/Marlin/src/gcode/calibrate/M100.cpp b/Marlin/src/gcode/calibrate/M100.cpp index b6e22b30834c..a6f4f8f5d2e7 100644 --- a/Marlin/src/gcode/calibrate/M100.cpp +++ b/Marlin/src/gcode/calibrate/M100.cpp @@ -75,7 +75,7 @@ char *end_bss = &__bss_end__, *stacklimit = &__StackLimit, - *heaplimit = &__HeapLimit ; + *heaplimit = &__HeapLimit; #define MEMORY_END_CORRECTION 0x200 @@ -94,6 +94,20 @@ #define MEMORY_END_CORRECTION 0x10000 // need to stay well below 0x20080000 or M100 F crashes +#elif defined(__SAMD51__) + + extern unsigned int __bss_end__, __StackLimit, __HeapLimit; + extern "C" void * _sbrk(int incr); + + void *end_bss = &__bss_end__, + *stacklimit = &__StackLimit, + *heaplimit = &__HeapLimit; + + #define MEMORY_END_CORRECTION 0x400 + + char *free_memory_start = (char *)_sbrk(0) + 0x200, // Leave some heap space + *free_memory_end = (char *)stacklimit - MEMORY_END_CORRECTION; + #else #error "M100 - unsupported CPU" #endif diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index a9191d821702..a15287a5e638 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -46,10 +46,10 @@ void GcodeSuite::M425() { bool noArgs = true; - LOOP_XYZ(i) { - if (parser.seen(axis_codes[i])) { + LOOP_XYZ(a) { + if (parser.seen(axis_codes[a])) { planner.synchronize(); - backlash.distance_mm[i] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(i); + backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a)); noArgs = false; } } @@ -88,10 +88,10 @@ void GcodeSuite::M425() { #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) SERIAL_ECHOPGM(" Average measured backlash (mm):"); if (backlash.has_any_measurement()) { - LOOP_XYZ(a) if (backlash.has_measurement(a)) { + LOOP_XYZ(a) if (backlash.has_measurement(AxisEnum(a))) { SERIAL_CHAR(' '); SERIAL_CHAR(axis_codes[a]); - SERIAL_ECHO(backlash.get_measurement(a)); + SERIAL_ECHO(backlash.get_measurement(AxisEnum(a))); } } else diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index 9f0fc714d677..86b25d824004 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -30,6 +30,10 @@ #include "../../feature/bedlevel/bedlevel.h" +#if HAS_SPI_LCD + #include "../../lcd/ultralcd.h" +#endif + #if HAS_LEVELING #include "../../module/planner.h" #endif @@ -55,7 +59,7 @@ void GcodeSuite::M48() { const int8_t verbose_level = parser.byteval('V', 1); if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4)."); + SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); return; } @@ -70,13 +74,14 @@ void GcodeSuite::M48() { const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - float X_current = current_position[X_AXIS], - Y_current = current_position[Y_AXIS]; + xy_float_t next_pos = current_position; - 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); + const xy_pos_t probe_pos = { + parser.linearval('X', next_pos.x + probe_offset.x), + parser.linearval('Y', next_pos.y + probe_offset.y) + }; - if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) { + if (!position_is_reachable_by_probe(probe_pos)) { SERIAL_ECHOLNPGM("? (X,Y) out of bounds."); return; } @@ -107,88 +112,85 @@ void GcodeSuite::M48() { set_bed_leveling_enabled(false); #endif - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); float 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_at_point(probe_pos, raise_after, verbose_level); bool probing_good = !isnan(t); if (probing_good) { randomSeed(millis()); for (uint8_t n = 0; n < n_samples; n++) { + #if HAS_SPI_LCD + // Display M48 progress in the status bar + ui.status_printf_P(0, PSTR(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples)); + #endif if (n_legs) { const int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise float angle = random(0, 360); const float radius = random( #if ENABLED(DELTA) - (int) (0.1250000000 * (DELTA_PRINTABLE_RADIUS)), - (int) (0.3333333333 * (DELTA_PRINTABLE_RADIUS)) + int(0.1250000000 * (DELTA_PRINTABLE_RADIUS)), + int(0.3333333333 * (DELTA_PRINTABLE_RADIUS)) #else - (int) 5.0, (int) (0.125 * _MIN(X_BED_SIZE, Y_BED_SIZE)) + int(5), int(0.125 * _MIN(X_BED_SIZE, Y_BED_SIZE)) #endif ); if (verbose_level > 3) { - SERIAL_ECHOPAIR("Starting radius: ", radius); - SERIAL_ECHOPAIR(" angle: ", angle); - SERIAL_ECHOPGM(" Direction: "); - if (dir > 0) SERIAL_ECHOPGM("Counter-"); - SERIAL_ECHOLNPGM("Clockwise"); + SERIAL_ECHOPAIR("Start radius:", radius, " angle:", angle, " dir:"); + if (dir > 0) SERIAL_CHAR('C'); + SERIAL_ECHOLNPGM("CW"); } for (uint8_t l = 0; l < n_legs - 1; l++) { float delta_angle; - if (schizoid_flag) + if (schizoid_flag) { // The points of a 5 point star are 72 degrees apart. We need to // skip a point and go to the next one on the star. delta_angle = dir * 2.0 * 72.0; - - else + } + else { // If we do this line, we are just trying to move further // around the circle. delta_angle = dir * (float) random(25, 45); + } angle += delta_angle; + while (angle > 360.0) angle -= 360.0; // We probably do not need to keep the angle between 0 and 2*PI, but the + // Arduino documentation says the trig functions should not be given values + while (angle < 0.0) angle += 360.0; // outside of this range. It looks like they behave correctly with + // numbers outside of the range, but just to be safe we clamp them. - while (angle > 360.0) // We probably do not need to keep the angle between 0 and 2*PI, but the - angle -= 360.0; // Arduino documentation says the trig functions should not be given values - while (angle < 0.0) // outside of this range. It looks like they behave correctly with - angle += 360.0; // numbers outside of the range, but just to be safe we clamp them. - - X_current = X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER) + cos(RADIANS(angle)) * radius; - Y_current = Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER) + sin(RADIANS(angle)) * radius; + next_pos.set(probe_pos.x - probe_offset.x + cos(RADIANS(angle)) * radius, + probe_pos.y - probe_offset.y + sin(RADIANS(angle)) * radius); #if DISABLED(DELTA) - X_current = constrain(X_current, X_MIN_POS, X_MAX_POS); - Y_current = constrain(Y_current, Y_MIN_POS, Y_MAX_POS); + LIMIT(next_pos.x, X_MIN_POS, X_MAX_POS); + LIMIT(next_pos.y, Y_MIN_POS, Y_MAX_POS); #else // If we have gone out too far, we can do a simple fix and scale the numbers // back in closer to the origin. - while (!position_is_reachable_by_probe(X_current, Y_current)) { - X_current *= 0.8; - Y_current *= 0.8; - if (verbose_level > 3) { - SERIAL_ECHOPAIR("Pulling point towards center:", X_current); - SERIAL_ECHOLNPAIR(", ", Y_current); - } + while (!position_is_reachable_by_probe(next_pos)) { + next_pos *= 0.8f; + if (verbose_level > 3) + SERIAL_ECHOLNPAIR_P(PSTR("Moving inward: X"), next_pos.x, SP_Y_STR, next_pos.y); } #endif - if (verbose_level > 3) { - SERIAL_ECHOPGM("Going to:"); - SERIAL_ECHOPAIR(" X", X_current); - SERIAL_ECHOPAIR(" Y", Y_current); - SERIAL_ECHOLNPAIR(" Z", current_position[Z_AXIS]); - } - do_blocking_move_to_xy(X_current, Y_current); + + if (verbose_level > 3) + SERIAL_ECHOLNPAIR_P(PSTR("Going to: X"), next_pos.x, SP_Y_STR, next_pos.y); + + do_blocking_move_to_xy(next_pos); } // n_legs loop } // n_legs // Probe a single point - sample_set[n] = probe_pt(X_probe_location, Y_probe_location, raise_after, 0); + sample_set[n] = probe_at_point(probe_pos, raise_after, 0); // Break the loop if the probe fails probing_good = !isnan(sample_set[n]); @@ -216,7 +218,7 @@ void GcodeSuite::M48() { if (verbose_level > 0) { if (verbose_level > 1) { SERIAL_ECHO(n + 1); - SERIAL_ECHOPAIR(" of ", (int)n_samples); + SERIAL_ECHOPAIR(" of ", int(n_samples)); SERIAL_ECHOPAIR_F(": z: ", sample_set[n], 3); if (verbose_level > 2) { SERIAL_ECHOPAIR_F(" mean: ", mean, 4); @@ -246,9 +248,15 @@ void GcodeSuite::M48() { SERIAL_ECHOLNPAIR_F("Standard Deviation: ", sigma, 6); SERIAL_EOL(); + + #if HAS_SPI_LCD + // Display M48 results in the status bar + char sigma_str[8]; + ui.status_printf_P(0, PSTR(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str)); + #endif } - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); // Re-enable bed level correction if it had been on #if HAS_LEVELING diff --git a/Marlin/src/gcode/calibrate/M665.cpp b/Marlin/src/gcode/calibrate/M665.cpp index 6422057ef83c..6234265b3d20 100644 --- a/Marlin/src/gcode/calibrate/M665.cpp +++ b/Marlin/src/gcode/calibrate/M665.cpp @@ -37,20 +37,18 @@ * L = diagonal rod * R = delta radius * S = segments per second - * B = delta calibration radius * X = Alpha (Tower 1) angle trim * Y = Beta (Tower 2) angle trim * Z = Gamma (Tower 3) angle trim */ void GcodeSuite::M665() { - if (parser.seen('H')) delta_height = parser.value_linear_units(); - if (parser.seen('L')) delta_diagonal_rod = parser.value_linear_units(); - if (parser.seen('R')) delta_radius = parser.value_linear_units(); - if (parser.seen('S')) delta_segments_per_second = parser.value_float(); - if (parser.seen('B')) delta_calibration_radius = parser.value_float(); - if (parser.seen('X')) delta_tower_angle_trim[A_AXIS] = parser.value_float(); - if (parser.seen('Y')) delta_tower_angle_trim[B_AXIS] = parser.value_float(); - if (parser.seen('Z')) delta_tower_angle_trim[C_AXIS] = parser.value_float(); + if (parser.seen('H')) delta_height = parser.value_linear_units(); + if (parser.seen('L')) delta_diagonal_rod = parser.value_linear_units(); + if (parser.seen('R')) delta_radius = parser.value_linear_units(); + if (parser.seen('S')) delta_segments_per_second = parser.value_float(); + if (parser.seen('X')) delta_tower_angle_trim.a = parser.value_float(); + if (parser.seen('Y')) delta_tower_angle_trim.b = parser.value_float(); + if (parser.seen('Z')) delta_tower_angle_trim.c = parser.value_float(); recalc_delta_settings(); } @@ -76,13 +74,13 @@ #if HAS_SCARA_OFFSET - if (parser.seenval('Z')) scara_home_offset[Z_AXIS] = parser.value_linear_units(); + if (parser.seenval('Z')) scara_home_offset.z = parser.value_linear_units(); const bool hasA = parser.seenval('A'), hasP = parser.seenval('P'), hasX = parser.seenval('X'); const uint8_t sumAPX = hasA + hasP + hasX; if (sumAPX) { if (sumAPX == 1) - scara_home_offset[A_AXIS] = parser.value_float(); + scara_home_offset.a = parser.value_float(); else { SERIAL_ERROR_MSG("Only one of A, P, or X is allowed."); return; @@ -93,7 +91,7 @@ const uint8_t sumBTY = hasB + hasT + hasY; if (sumBTY) { if (sumBTY == 1) - scara_home_offset[B_AXIS] = parser.value_float(); + scara_home_offset.b = parser.value_float(); else { SERIAL_ERROR_MSG("Only one of B, T, or Y is allowed."); return; diff --git a/Marlin/src/gcode/calibrate/M852.cpp b/Marlin/src/gcode/calibrate/M852.cpp index 156d1f5bf63e..4bb068e5b272 100644 --- a/Marlin/src/gcode/calibrate/M852.cpp +++ b/Marlin/src/gcode/calibrate/M852.cpp @@ -93,13 +93,13 @@ void GcodeSuite::M852() { if (!ijk) { SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR_F(MSG_SKEW_FACTOR " XY: ", planner.skew_factor.xy, 6); + serialprintPGM(GET_TEXT(MSG_SKEW_FACTOR)); + SERIAL_ECHOPAIR_F(" XY: ", planner.skew_factor.xy, 6); #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPAIR(" XZ: ", planner.skew_factor.xz); - SERIAL_ECHOLNPAIR(" YZ: ", planner.skew_factor.yz); - #else - SERIAL_EOL(); + SERIAL_ECHOPAIR_F(" XZ: ", planner.skew_factor.xz, 6); + SERIAL_ECHOPAIR_F(" YZ: ", planner.skew_factor.yz, 6); #endif + SERIAL_EOL(); } } diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 8ae8e58d2ea1..aeeb38c91313 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -62,11 +62,9 @@ void GcodeSuite::M201() { LOOP_XYZE(i) { if (parser.seen(axis_codes[i])) { const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i); - planner.settings.max_acceleration_mm_per_s2[a] = parser.value_axis_units((AxisEnum)a); + planner.set_max_acceleration(a, parser.value_axis_units((AxisEnum)a)); } } - // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner) - planner.reset_acceleration_rates(); } /** @@ -82,7 +80,7 @@ void GcodeSuite::M203() { LOOP_XYZE(i) if (parser.seen(axis_codes[i])) { const uint8_t a = (i == E_AXIS ? uint8_t(E_AXIS_N(target_extruder)) : i); - planner.settings.max_feedrate_mm_s[a] = parser.value_axis_units((AxisEnum)a); + planner.set_max_feedrate(a, parser.value_axis_units((AxisEnum)a)); } } @@ -119,10 +117,10 @@ void GcodeSuite::M204() { * 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) + * J = Junction Deviation (mm) (If not using CLASSIC_JERK) */ void GcodeSuite::M205() { - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) #define J_PARAM "J" #else #define J_PARAM @@ -138,7 +136,7 @@ void GcodeSuite::M205() { if (parser.seen('B')) planner.settings.min_segment_time_us = parser.value_ulong(); if (parser.seen('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units(); if (parser.seen('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units(); - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) if (parser.seen('J')) { const float junc_dev = parser.value_linear_units(); if (WITHIN(junc_dev, 0.01f, 0.3f)) { @@ -152,17 +150,17 @@ void GcodeSuite::M205() { } #endif #if HAS_CLASSIC_JERK - 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('X')) planner.set_max_jerk(X_AXIS, parser.value_linear_units()); + if (parser.seen('Y')) planner.set_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) + planner.set_max_jerk(Z_AXIS, parser.value_linear_units()); + #if HAS_MESH && DISABLED(LIMITED_JERK_EDITING) + if (planner.max_jerk.z <= 0.1f) SERIAL_ECHOLNPGM("WARNING! Low Z Jerk may lead to unwanted pauses."); #endif } - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) - if (parser.seen('E')) planner.max_jerk[E_AXIS] = parser.value_linear_units(); + #if HAS_CLASSIC_E_JERK + if (parser.seen('E')) planner.set_max_jerk(E_AXIS, parser.value_linear_units()); #endif #endif } diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index e337992ab065..3fe3feb0decb 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -27,17 +27,22 @@ #include "../gcode.h" #include "../../module/tool_change.h" +#include "../../Marlin.h" // for SP_X_STR, etc. + +extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[]; + void M217_report(const bool eeprom=false) { #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) serialprintPGM(eeprom ? PSTR(" M217") : PSTR("Toolchange:")); SERIAL_ECHOPAIR(" S", LINEAR_UNIT(toolchange_settings.swap_length)); + SERIAL_ECHOPAIR_P(SP_E_STR, LINEAR_UNIT(toolchange_settings.extra_prime)); SERIAL_ECHOPAIR(" P", LINEAR_UNIT(toolchange_settings.prime_speed)); SERIAL_ECHOPAIR(" R", LINEAR_UNIT(toolchange_settings.retract_speed)); #if ENABLED(TOOLCHANGE_PARK) - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(toolchange_settings.change_point.x)); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(toolchange_settings.change_point.y)); + SERIAL_ECHOPAIR_P(SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x)); + SERIAL_ECHOPAIR_P(SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y)); #endif #else @@ -46,7 +51,7 @@ void M217_report(const bool eeprom=false) { #endif - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(toolchange_settings.z_raise)); + SERIAL_ECHOPAIR_P(SP_Z_STR, LINEAR_UNIT(toolchange_settings.z_raise)); SERIAL_EOL(); } @@ -54,6 +59,7 @@ void M217_report(const bool eeprom=false) { * M217 - Set SINGLENOZZLE toolchange parameters * * S[linear] Swap length + * E[linear] Purge length * P[linear/m] Prime speed * R[linear/m] Retract speed * X[linear] Park X (Requires TOOLCHANGE_PARK) @@ -68,18 +74,29 @@ void GcodeSuite::M217() { #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) #undef SPR_PARAM - #define SPR_PARAM "SPR" - - if (parser.seenval('S')) { const float v = parser.value_linear_units(); toolchange_settings.swap_length = constrain(v, 0, 500); } + #define SPR_PARAM "SPRE" + + static constexpr float max_extrude = + #if ENABLED(PREVENT_LENGTHY_EXTRUDE) + EXTRUDE_MAXLENGTH + #else + 500 + #endif + ; + + if (parser.seenval('S')) { const float v = parser.value_linear_units(); toolchange_settings.swap_length = constrain(v, 0, max_extrude); } + if (parser.seenval('E')) { const float v = parser.value_linear_units(); toolchange_settings.extra_prime = constrain(v, 0, max_extrude); } if (parser.seenval('P')) { const int16_t v = parser.value_linear_units(); toolchange_settings.prime_speed = constrain(v, 10, 5400); } if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); } #endif + #if ENABLED(TOOLCHANGE_PARK) #undef XY_PARAM #define XY_PARAM "XY" if (parser.seenval('X')) { toolchange_settings.change_point.x = parser.value_linear_units(); } if (parser.seenval('Y')) { toolchange_settings.change_point.y = parser.value_linear_units(); } #endif + if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); } if (!parser.seen(SPR_PARAM XY_PARAM "Z")) M217_report(); diff --git a/Marlin/src/gcode/config/M218.cpp b/Marlin/src/gcode/config/M218.cpp index d43991171316..790d7714a370 100644 --- a/Marlin/src/gcode/config/M218.cpp +++ b/Marlin/src/gcode/config/M218.cpp @@ -44,27 +44,27 @@ void GcodeSuite::M218() { const int8_t target_extruder = get_target_extruder_from_command(); if (target_extruder < 0) return; - 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 (parser.seenval('Z')) hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units(); + if (parser.seenval('X')) hotend_offset[target_extruder].x = parser.value_linear_units(); + if (parser.seenval('Y')) hotend_offset[target_extruder].y = parser.value_linear_units(); + if (parser.seenval('Z')) hotend_offset[target_extruder].z = parser.value_linear_units(); if (!parser.seen("XYZ")) { SERIAL_ECHO_START(); SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); HOTEND_LOOP() { SERIAL_CHAR(' '); - SERIAL_ECHO(hotend_offset[X_AXIS][e]); + SERIAL_ECHO(hotend_offset[e].x); SERIAL_CHAR(','); - SERIAL_ECHO(hotend_offset[Y_AXIS][e]); + SERIAL_ECHO(hotend_offset[e].y); SERIAL_CHAR(','); - SERIAL_ECHO_F(hotend_offset[Z_AXIS][e], 3); + SERIAL_ECHO_F(hotend_offset[e].z, 3); } SERIAL_EOL(); } #if ENABLED(DELTA) if (target_extruder == active_extruder) - do_blocking_move_to_xy(current_position[X_AXIS], current_position[Y_AXIS], planner.settings.max_feedrate_mm_s[X_AXIS]); + do_blocking_move_to_xy(current_position, planner.settings.max_feedrate_mm_s[X_AXIS]); #endif } diff --git a/Marlin/src/gcode/config/M220.cpp b/Marlin/src/gcode/config/M220.cpp index 50939b279b08..3710a30ab9cf 100644 --- a/Marlin/src/gcode/config/M220.cpp +++ b/Marlin/src/gcode/config/M220.cpp @@ -24,11 +24,23 @@ #include "../../module/motion.h" /** - * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) + * M220: Set speed percentage factor, aka "Feed Rate" + * + * Parameters + * S : Set the feed rate percentage factor + * + * With PRUSA_MMU2... + * B : Flag to back up the current factor + * R : Flag to restore the last-saved factor */ void GcodeSuite::M220() { - if (parser.seenval('S')) - feedrate_percentage = parser.value_int(); + #if ENABLED(PRUSA_MMU2) + static int16_t backup_feedrate_percentage = 100; + if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; + if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; + #endif + + if (parser.seenval('S')) feedrate_percentage = parser.value_int(); } diff --git a/Marlin/src/gcode/config/M221.cpp b/Marlin/src/gcode/config/M221.cpp index cbb31628af64..116ce776b2ea 100644 --- a/Marlin/src/gcode/config/M221.cpp +++ b/Marlin/src/gcode/config/M221.cpp @@ -23,6 +23,8 @@ #include "../gcode.h" #include "../../module/planner.h" +#if EXTRUDERS + /** * M221: Set extrusion percentage (M221 T0 S95) */ @@ -44,3 +46,5 @@ void GcodeSuite::M221() { SERIAL_EOL(); } } + +#endif // EXTRUDERS diff --git a/Marlin/src/gcode/config/M281.cpp b/Marlin/src/gcode/config/M281.cpp index ea9c032cf089..a694cb2df4c2 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -41,15 +41,14 @@ void GcodeSuite::M281() { } if (!angle_change) { SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" Servo ", servo_index); - SERIAL_ECHOPAIR(" L", servo_angles[servo_index][0]); - SERIAL_ECHOLNPAIR(" U", servo_angles[servo_index][1]); + SERIAL_ECHOLNPAIR(" Servo ", servo_index, + " L", servo_angles[servo_index][0], + " U", servo_angles[servo_index][1]); } } else { SERIAL_ERROR_START(); - SERIAL_ECHOPAIR("Servo ", servo_index); - SERIAL_ECHOLNPGM(" out of range"); + SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range"); } } diff --git a/Marlin/src/gcode/config/M301.cpp b/Marlin/src/gcode/config/M301.cpp index 6c66ab48cbeb..0449293bf537 100644 --- a/Marlin/src/gcode/config/M301.cpp +++ b/Marlin/src/gcode/config/M301.cpp @@ -38,6 +38,10 @@ * * C[float] Kc term * L[int] LPQ length + * + * With PID_FAN_SCALING: + * + * F[float] Kf term */ void GcodeSuite::M301() { @@ -56,18 +60,25 @@ void GcodeSuite::M301() { NOLESS(thermalManager.lpq_len, 0); #endif + #if ENABLED(PID_FAN_SCALING) + if (parser.seen('F')) PID_PARAM(Kf, e) = parser.value_float(); + #endif + thermalManager.updatePID(); SERIAL_ECHO_START(); #if ENABLED(PID_PARAMS_PER_HOTEND) SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output #endif // PID_PARAMS_PER_HOTEND - SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, e)); - SERIAL_ECHOPAIR(" i:", unscalePID_i(PID_PARAM(Ki, e))); - SERIAL_ECHOPAIR(" d:", unscalePID_d(PID_PARAM(Kd, e))); + SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, e), + " i:", unscalePID_i(PID_PARAM(Ki, e)), + " d:", unscalePID_d(PID_PARAM(Kd, e))); #if ENABLED(PID_EXTRUSION_SCALING) - //Kc does not have scaling applied above, or in resetting defaults SERIAL_ECHOPAIR(" c:", PID_PARAM(Kc, e)); #endif + #if ENABLED(PID_FAN_SCALING) + SERIAL_ECHOPAIR(" f:", PID_PARAM(Kf, e)); + #endif + SERIAL_EOL(); } else diff --git a/Marlin/src/gcode/config/M302.cpp b/Marlin/src/gcode/config/M302.cpp index e5ca1d36082c..891f3c82584a 100644 --- a/Marlin/src/gcode/config/M302.cpp +++ b/Marlin/src/gcode/config/M302.cpp @@ -56,8 +56,7 @@ void GcodeSuite::M302() { SERIAL_ECHO_START(); SERIAL_ECHOPGM("Cold extrudes are "); serialprintPGM(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis")); - SERIAL_ECHOPAIR("abled (min temp ", thermalManager.extrude_min_temp); - SERIAL_ECHOLNPGM("C)"); + SERIAL_ECHOLNPAIR("abled (min temp ", thermalManager.extrude_min_temp, "C)"); } } diff --git a/Marlin/src/gcode/config/M304.cpp b/Marlin/src/gcode/config/M304.cpp index f63fa03fce60..3048c228d5e8 100644 --- a/Marlin/src/gcode/config/M304.cpp +++ b/Marlin/src/gcode/config/M304.cpp @@ -33,9 +33,9 @@ void GcodeSuite::M304() { if (parser.seen('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float()); SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" p:", thermalManager.temp_bed.pid.Kp); - SERIAL_ECHOPAIR(" i:", unscalePID_i(thermalManager.temp_bed.pid.Ki)); - SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.temp_bed.pid.Kd)); + SERIAL_ECHOLNPAIR(" p:", thermalManager.temp_bed.pid.Kp, + " i:", unscalePID_i(thermalManager.temp_bed.pid.Ki), + " d:", unscalePID_d(thermalManager.temp_bed.pid.Kd)); } #endif // PIDTEMPBED diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 79428158e002..29fc0bdff1a3 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -42,6 +42,14 @@ #include "../../feature/host_actions.h" #endif +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extensible_ui/ui_api.h" +#endif + +#ifndef GET_PIN_MAP_PIN_M43 + #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q) +#endif + inline void toggle_pins() { const bool ignore_protection = parser.boolval('I'); const int repeat = parser.intval('R', 1), @@ -50,14 +58,14 @@ inline void toggle_pins() { wait = parser.intval('W', 500); for (uint8_t i = start; i <= end; i++) { - pin_t pin = GET_PIN_MAP_PIN(i); + pin_t pin = GET_PIN_MAP_PIN_M43(i); if (!VALID_PIN(pin)) continue; if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) { report_pin_state_extended(pin, ignore_protection, true, "Untouched "); SERIAL_EOL(); } else { - watchdog_reset(); + watchdog_refresh(); report_pin_state_extended(pin, ignore_protection, true, "Pulsing "); #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO if (pin == TEENSY_E2) { @@ -81,10 +89,10 @@ inline void toggle_pins() { { pinMode(pin, OUTPUT); for (int16_t j = 0; j < repeat; j++) { - watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_reset(); extDigitalWrite(pin, 1); safe_delay(wait); - watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_reset(); + watchdog_refresh(); extDigitalWrite(pin, 0); safe_delay(wait); + watchdog_refresh(); extDigitalWrite(pin, 1); safe_delay(wait); + watchdog_refresh(); extDigitalWrite(pin, 0); safe_delay(wait); + watchdog_refresh(); } } } @@ -306,7 +314,7 @@ void GcodeSuite::M43() { #endif uint8_t pin_state[last_pin - first_pin + 1]; for (uint8_t i = first_pin; i <= last_pin; i++) { - pin_t pin = GET_PIN_MAP_PIN(i); + pin_t pin = GET_PIN_MAP_PIN_M43(i); if (!VALID_PIN(pin)) continue; if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue; pinMode(pin, INPUT_PULLUP); @@ -323,13 +331,16 @@ void GcodeSuite::M43() { KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), CONTINUE_STR); + #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired_P(PSTR("M43 Wait Called")); #endif #endif for (;;) { for (uint8_t i = first_pin; i <= last_pin; i++) { - pin_t pin = GET_PIN_MAP_PIN(i); + pin_t pin = GET_PIN_MAP_PIN_M43(i); if (!VALID_PIN(pin)) continue; if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue; const byte val = @@ -355,7 +366,7 @@ void GcodeSuite::M43() { else { // Report current state of selected pin(s) for (uint8_t i = first_pin; i <= last_pin; i++) { - pin_t pin = GET_PIN_MAP_PIN(i); + pin_t pin = GET_PIN_MAP_PIN_M43(i); if (VALID_PIN(pin)) report_pin_state_extended(pin, ignore_protection, true); } } diff --git a/Marlin/src/gcode/config/M575.cpp b/Marlin/src/gcode/config/M575.cpp new file mode 100644 index 000000000000..0abc8f9fead2 --- /dev/null +++ b/Marlin/src/gcode/config/M575.cpp @@ -0,0 +1,74 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(BAUD_RATE_GCODE) + +#include "../gcode.h" + +/** + * M575 - Change serial baud rate + * + * P - Serial port index. Omit for all. + * B - Baud rate (bits per second) + */ +void GcodeSuite::M575() { + const int32_t baud = parser.ulongval('B'); + switch (baud) { + case 2400: case 9600: case 19200: case 38400: case 57600: + case 115200: case 250000: case 500000: case 1000000: { + const int8_t port = parser.intval('P', -99); + const bool set0 = (port == -99 || port == 0); + if (set0) { + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR(" Serial " + #if NUM_SERIAL > 1 + , '0', + #else + "0" + #endif + " baud rate set to ", baud + ); + } + #if NUM_SERIAL > 1 + const bool set1 = (port == -99 || port == 1); + if (set1) { + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR(" Serial ", '1', " baud rate set to ", baud); + } + #endif + + SERIAL_FLUSH(); + + if (set0) { MYSERIAL0.end(); MYSERIAL0.begin(baud); } + + #if NUM_SERIAL > 1 + if (set1) { MYSERIAL1.end(); MYSERIAL1.begin(baud); } + #endif + + } break; + default: SERIAL_ECHO_MSG("?(B)aud rate implausible."); + } +} + +#endif // NUM_SERIAL > 0 && BAUD_RATE_GCODE diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index dc4b134af7d6..212b6f83b7e6 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -25,11 +25,11 @@ void report_M92(const bool echo=true, const int8_t e=-1) { if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' '); - SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS])); + SERIAL_ECHOPAIR_P(PSTR(" M92 X"), LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]), + SP_Y_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]), + SP_Z_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS])); #if DISABLED(DISTINCT_E_FACTORS) - SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS])); + SERIAL_ECHOPAIR_P(SP_E_STR, VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS])); #endif SERIAL_EOL(); @@ -37,8 +37,8 @@ void report_M92(const bool echo=true, const int8_t e=-1) { for (uint8_t i = 0; i < E_STEPPERS; i++) { if (e >= 0 && i != e) continue; if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' '); - SERIAL_ECHOPAIR(" M92 T", (int)i); - SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)])); + SERIAL_ECHOLNPAIR_P(PSTR(" M92 T"), (int)i, + SP_E_STR, VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)])); } #endif @@ -76,8 +76,8 @@ void GcodeSuite::M92() { const float value = parser.value_per_axis_units((AxisEnum)(E_AXIS_N(target_extruder))); if (value < 20) { float factor = planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] / value; // increase e constants if M92 E14 is given for netfab. - #if HAS_CLASSIC_JERK && (DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE)) - planner.max_jerk[E_AXIS] *= factor; + #if HAS_CLASSIC_JERK && HAS_CLASSIC_E_JERK + planner.max_jerk.e *= factor; #endif planner.settings.max_feedrate_mm_s[E_AXIS_N(target_extruder)] *= factor; planner.max_acceleration_steps_per_s2[E_AXIS_N(target_extruder)] *= factor; @@ -98,15 +98,13 @@ void GcodeSuite::M92() { const float wanted = parser.floatval('L'); if (parser.seen('H') || wanted) { const uint16_t argH = parser.ushortval('H'), - micro_steps = argH ? argH : Z_MICROSTEPS; + micro_steps = argH ?: Z_MICROSTEPS; const float z_full_step_mm = micro_steps * planner.steps_to_mm[Z_AXIS]; SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("{ micro_steps:", micro_steps); - SERIAL_ECHOPAIR(", z_full_step_mm:", z_full_step_mm); + SERIAL_ECHOPAIR("{ micro_steps:", micro_steps, ", z_full_step_mm:", z_full_step_mm); if (wanted) { const float best = uint16_t(wanted / z_full_step_mm) * z_full_step_mm; - SERIAL_ECHOPGM(", best:["); - SERIAL_ECHO(best); + SERIAL_ECHOPAIR(", best:[", best); if (best != wanted) { SERIAL_CHAR(','); SERIAL_ECHO(best + z_full_step_mm); } SERIAL_CHAR(']'); } diff --git a/Marlin/src/gcode/control/M108_M112_M410.cpp b/Marlin/src/gcode/control/M108_M112_M410.cpp index 242aac1c0674..50feb8276f51 100644 --- a/Marlin/src/gcode/control/M108_M112_M410.cpp +++ b/Marlin/src/gcode/control/M108_M112_M410.cpp @@ -38,10 +38,10 @@ void GcodeSuite::M108() { } /** - * M112: Emergency Stop + * M112: Full Shutdown */ void GcodeSuite::M112() { - kill(); + kill(PSTR("M112 Shutdown"), nullptr, true); } /** diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index 6706cee008a0..de6eab4f7422 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -30,11 +30,21 @@ #endif /** - * M17: Enable power on all stepper motors + * M17: Enable stepper motors */ void GcodeSuite::M17() { - LCD_MESSAGEPGM(MSG_NO_MOVE); - enable_all_steppers(); + if (parser.seen("XYZE")) { + if (parser.seen('X')) enable_X(); + if (parser.seen('Y')) enable_Y(); + if (parser.seen('Z')) enable_Z(); + #if HAS_E_STEPPER_ENABLE + if (parser.seen('E')) enable_e_steppers(); + #endif + } + else { + LCD_MESSAGEPGM(MSG_NO_MOVE); + enable_all_steppers(); + } } /** @@ -45,20 +55,17 @@ void GcodeSuite::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')); - if (all_axis) { - planner.finish_and_disable(); - } - else { + if (parser.seen("XYZE")) { planner.synchronize(); if (parser.seen('X')) disable_X(); if (parser.seen('Y')) disable_Y(); if (parser.seen('Z')) disable_Z(); - // Only disable on boards that have separate ENABLE_PINS or another method for disabling the driver - #if (E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN) || AXIS_DRIVER_TYPE_E0(TMC2660) || AXIS_DRIVER_TYPE_E1(TMC2660) || AXIS_DRIVER_TYPE_E2(TMC2660) || AXIS_DRIVER_TYPE_E3(TMC2660) || AXIS_DRIVER_TYPE_E4(TMC2660) || AXIS_DRIVER_TYPE_E5(TMC2660) + #if HAS_E_STEPPER_ENABLE if (parser.seen('E')) disable_e_steppers(); #endif } + else + planner.finish_and_disable(); #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL) if (ubl.lcd_map_control) { diff --git a/Marlin/src/gcode/control/M211.cpp b/Marlin/src/gcode/control/M211.cpp index 64c27327559d..432ab1379af0 100644 --- a/Marlin/src/gcode/control/M211.cpp +++ b/Marlin/src/gcode/control/M211.cpp @@ -33,18 +33,14 @@ * Usage: M211 S1 to enable, M211 S0 to disable, M211 alone for report */ void GcodeSuite::M211() { + const xyz_pos_t l_soft_min = soft_endstop.min.asLogical(), + l_soft_max = soft_endstop.max.asLogical(); SERIAL_ECHO_START(); SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS); if (parser.seen('S')) soft_endstops_enabled = parser.value_bool(); serialprint_onoff(soft_endstops_enabled); - SERIAL_ECHOPGM(MSG_SOFT_MIN); - SERIAL_ECHOPAIR( MSG_X, LOGICAL_X_POSITION(soft_endstop[X_AXIS].min)); - SERIAL_ECHOPAIR(" " MSG_Y, LOGICAL_Y_POSITION(soft_endstop[Y_AXIS].min)); - SERIAL_ECHOPAIR(" " MSG_Z, LOGICAL_Z_POSITION(soft_endstop[Z_AXIS].min)); - SERIAL_ECHOPGM(MSG_SOFT_MAX); - SERIAL_ECHOPAIR( MSG_X, LOGICAL_X_POSITION(soft_endstop[X_AXIS].max)); - SERIAL_ECHOPAIR(" " MSG_Y, LOGICAL_Y_POSITION(soft_endstop[Y_AXIS].max)); - SERIAL_ECHOLNPAIR(" " MSG_Z, LOGICAL_Z_POSITION(soft_endstop[Z_AXIS].max)); + print_xyz(l_soft_min, PSTR(MSG_SOFT_MIN), PSTR(" ")); + print_xyz(l_soft_max, PSTR(MSG_SOFT_MAX)); } #endif diff --git a/Marlin/src/gcode/control/M280.cpp b/Marlin/src/gcode/control/M280.cpp index 3626f0bf670b..6b65e9b75310 100644 --- a/Marlin/src/gcode/control/M280.cpp +++ b/Marlin/src/gcode/control/M280.cpp @@ -43,14 +43,12 @@ void GcodeSuite::M280() { } else { SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" Servo ", servo_index); - SERIAL_ECHOLNPAIR(": ", servo[servo_index].read()); + SERIAL_ECHOLNPAIR(" Servo ", servo_index, ": ", servo[servo_index].read()); } } else { SERIAL_ERROR_START(); - SERIAL_ECHOPAIR("Servo ", servo_index); - SERIAL_ECHOLNPGM(" out of range"); + SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range"); } } diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index b5e789a92f26..81e164519325 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -29,10 +29,20 @@ #include "../../module/stepper.h" /** - * M3 - Cutter ON (Clockwise) - * M4 - Cutter ON (Counter-clockwise) + * Laser: * - * S - Set power. S0 turns it off. + * M3 - Laser ON/Power (Ramped power) + * M4 - Laser ON/Power (Continuous power) + * + * S - Set power. S0 will turn the laser off. + * O - Set power and OCR + * + * Spindle: + * + * M3 - Spindle ON (Clockwise) + * M4 - Spindle ON (Counter-clockwise) + * + * S - Set power. S0 will turn the spindle off. * O - Set power and OCR * * If no PWM pin is defined then M3/M4 just turns it on. @@ -61,12 +71,14 @@ */ void GcodeSuite::M3_M4(const bool is_M4) { - planner.synchronize(); // Wait for previous movement commands (G0/G0/G2/G3) to complete before changing power + #if ENABLED(SPINDLE_FEATURE) + planner.synchronize(); // Wait for movement to complete before changing power + #endif cutter.set_direction(is_M4); #if ENABLED(SPINDLE_LASER_PWM) - if (parser.seen('O')) + if (parser.seenval('O')) cutter.set_ocr_power(parser.value_byte()); // The OCR is a value from 0 to 255 (uint8_t) else cutter.set_power(parser.intval('S', 255)); @@ -79,7 +91,9 @@ void GcodeSuite::M3_M4(const bool is_M4) { * M5 - Cutter OFF */ void GcodeSuite::M5() { - planner.synchronize(); + #if ENABLED(SPINDLE_FEATURE) + planner.synchronize(); + #endif cutter.set_enabled(false); } diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index 4009a2370693..007c6fc6b826 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -79,9 +79,9 @@ } mirrored_duplication_mode = true; stepper.set_directions(); - float x_jog = current_position[X_AXIS] - .1; + float x_jog = current_position.x - .1; for (uint8_t i = 2; --i;) { - planner.buffer_line(x_jog, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate_mm_s, 0); + planner.buffer_line(x_jog, current_position.y, current_position.z, current_position.e, feedrate_mm_s, 0); x_jog += .1; } return; @@ -122,7 +122,7 @@ DEBUG_ECHOPAIR("\nActive Ext: ", int(active_extruder)); if (!active_extruder_parked) DEBUG_ECHOPGM(" NOT "); DEBUG_ECHOPGM(" parked."); - DEBUG_ECHOPAIR("\nactive_extruder_x_pos: ", current_position[X_AXIS]); + DEBUG_ECHOPAIR("\nactive_extruder_x_pos: ", current_position.x); DEBUG_ECHOPAIR("\ninactive_extruder_x_pos: ", inactive_extruder_x_pos); DEBUG_ECHOPAIR("\nextruder_duplication_enabled: ", int(extruder_duplication_enabled)); DEBUG_ECHOPAIR("\nduplicate_extruder_x_offset: ", duplicate_extruder_x_offset); @@ -137,8 +137,8 @@ DEBUG_EOL(); HOTEND_LOOP() { - DEBUG_ECHOPAIR(" nozzle:", int(e)); - LOOP_XYZ(j) DEBUG_ECHOPAIR(" hotend_offset[", axis_codes[j], "_AXIS][", int(e), "]=", hotend_offset[j][e]); + DEBUG_ECHOPAIR(" T", int(e)); + LOOP_XYZ(a) DEBUG_ECHOPAIR(" hotend_offset[", int(e), "].", axis_codes[a] | 0x20, "=", hotend_offset[e][a]); DEBUG_EOL(); } DEBUG_EOL(); diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index efb749501769..56533d45b8b1 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -35,7 +35,7 @@ #include "../../Marlin.h" #endif -#if HAS_POWER_SWITCH +#if ENABLED(PSU_CONTROL) #if ENABLED(AUTO_POWER_CONTROL) #include "../../feature/power.h" @@ -68,11 +68,11 @@ * a print without suicide... */ #if HAS_SUICIDE - OUT_WRITE(SUICIDE_PIN, HIGH); + OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING); #endif #if DISABLED(AUTO_POWER_CONTROL) - delay(100); // Wait for power to settle + delay(PSU_POWERUP_DELAY); // Wait for power to settle restore_stepper_drivers(); #endif @@ -81,12 +81,12 @@ #endif } -#endif // HAS_POWER_SWITCH +#endif // ENABLED(PSU_CONTROL) /** * M81: Turn off Power, including Power Supply, if there is one. * - * This code should ALWAYS be available for EMERGENCY SHUTDOWN! + * This code should ALWAYS be available for FULL SHUTDOWN! */ void GcodeSuite::M81() { thermalManager.disable_all_heaters(); @@ -105,11 +105,11 @@ void GcodeSuite::M81() { #if HAS_SUICIDE suicide(); - #elif HAS_POWER_SWITCH + #elif ENABLED(PSU_CONTROL) PSU_OFF(); #endif #if HAS_LCD_MENU - LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); + LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " MSG_OFF ".")); #endif } diff --git a/Marlin/src/gcode/eeprom/M500-M504.cpp b/Marlin/src/gcode/eeprom/M500-M504.cpp index 8a016e13e647..79bacf06623d 100644 --- a/Marlin/src/gcode/eeprom/M500-M504.cpp +++ b/Marlin/src/gcode/eeprom/M500-M504.cpp @@ -52,7 +52,7 @@ void GcodeSuite::M502() { * M503: print settings currently in memory */ void GcodeSuite::M503() { - (void)settings.report(parser.boolval('S', true)); + (void)settings.report(!parser.boolval('S', true)); } #endif // !DISABLE_M503 diff --git a/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin/src/gcode/feature/L6470/M122.cpp index 2e50d8ff7905..1fbb72aacf3a 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../libs/L6470/L6470_Marlin.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index 94c17f010ad1..72de90fc50bf 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../libs/L6470/L6470_Marlin.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" #include "../../../module/planner.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) @@ -101,10 +101,14 @@ void L6470_report_current(L6470 &motor, const uint8_t axis) { #endif sprintf_P(temp_buf, PSTR("\n...OverCurrent Threshold: %2d (%4d mA)"), overcurrent_threshold, (overcurrent_threshold + 1) * 375); SERIAL_ECHO(temp_buf); - sprintf_P(temp_buf, PSTR(" Stall Threshold: %2d (%7.2f mA)"), stall_threshold, (stall_threshold + 1) * 31.25); + + char numstr[11]; + dtostrf((stall_threshold + 1) * 31.25, 1, 2, numstr); + sprintf_P(temp_buf, PSTR(" Stall Threshold: %2d (%s mA)"), stall_threshold, numstr); SERIAL_ECHO(temp_buf); + SERIAL_ECHOPGM(" Motor Status: "); - const char * const stat_str; + const char *stat_str; switch (motor_status) { default: case 0: stat_str = PSTR("stopped"); break; @@ -114,24 +118,42 @@ void L6470_report_current(L6470 &motor, const uint8_t axis) { } serialprintPGM(stat_str); SERIAL_EOL(); + SERIAL_ECHOPAIR("...microsteps: ", microsteps); SERIAL_ECHOPAIR(" ADC_OUT: ", adc_out); SERIAL_ECHOPGM(" Vs_compensation: "); serialprintPGM((motor.GetParam(L6470_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED")); - sprintf_P(temp_buf, PSTR(" Compensation coefficient: ~%4.2f\n"), comp_coef * 0.01f); - SERIAL_ECHO(temp_buf); + + SERIAL_ECHOLNPAIR(" Compensation coefficient: ", dtostrf(comp_coef * 0.01f, 7, 2, numstr)); SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD)); SERIAL_ECHOPAIR(" KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN)); SERIAL_ECHOPAIR(" KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC)); SERIAL_ECHOPAIR(" KVAL_DEC: ", motor.GetParam(L6470_KVAL_DEC)); SERIAL_ECHOPGM(" V motor max = "); + float val; + PGM_P suf; switch (motor_status) { - case 0: sprintf_P(temp_buf, PSTR(" %4.1f%% (KVAL_HOLD)\n"), float(motor.GetParam(L6470_KVAL_HOLD)) * 100 / 256); break; - case 1: sprintf_P(temp_buf, PSTR(" %4.1f%% (KVAL_RUN) \n"), float(motor.GetParam(L6470_KVAL_RUN)) * 100 / 256); break; - case 2: sprintf_P(temp_buf, PSTR(" %4.1f%% (KVAL_ACC) \n"), float(motor.GetParam(L6470_KVAL_ACC)) * 100 / 256); break; - case 3: sprintf_P(temp_buf, PSTR(" %4.1f%% (KVAL_DEC) \n"), float(motor.GetParam(L6470_KVAL_DEC)) * 100 / 256); break; + case 0: + val = motor.GetParam(L6470_KVAL_HOLD); + suf = PSTR("(KVAL_HOLD)"); + break; + case 1: + val = motor.GetParam(L6470_KVAL_RUN); + suf = PSTR("(KVAL_RUN)"); + break; + case 2: + val = motor.GetParam(L6470_KVAL_ACC); + suf = PSTR("(KVAL_ACC)"); + break; + case 3: + val = motor.GetParam(L6470_KVAL_DEC); + suf = PSTR("(KVAL_DEC)"); + break; } - SERIAL_ECHO(temp_buf); + SERIAL_ECHO(dtostrf(val * 100 / 256, 10, 2, numstr)); + SERIAL_ECHOPGM("%% "); + serialprintPGM(suf); + SERIAL_EOL(); } void GcodeSuite::M906() { @@ -150,7 +172,7 @@ void GcodeSuite::M906() { report_current = false; if (planner.has_blocks_queued() || planner.cleaning_buffer_counter) { - SERIAL_ECHOLNPGM("ERROR - can't set KVAL_HOLD while steppers are moving"); + SERIAL_ECHOLNPGM("!Can't set KVAL_HOLD with steppers moving"); return; } diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index 66679a2e0ef5..96a27f3330eb 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -25,13 +25,26 @@ #if HAS_DRIVER(L6470) #include "../../gcode.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" #include "../../../module/planner.h" #include "../../../libs/L6470/L6470_Marlin.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../../core/debug_out.h" +static void jiggle_axis(const char axis_char, const float &min, const float &max, const feedRate_t &fr_mm_m) { + char gcode_string[30], str1[11], str2[11]; + + // Turn the motor(s) both directions + sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(min, 1, 3, str1), dtostrf(fr_mm_m, 1, 3, str2)); + gcode.process_subcommands_now(gcode_string); + + sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(max, 1, 3, str1), str2); + gcode.process_subcommands_now(gcode_string); + + planner.synchronize(); +} + /** * * M916: Increase KVAL_HOLD until thermal warning @@ -71,7 +84,7 @@ void GcodeSuite::M916() { uint8_t driver_count = 1; float position_max; float position_min; - float final_feedrate; + feedRate_t final_fr_mm_m; uint8_t kval_hold; uint8_t ocd_th_val = 0; uint8_t stall_th_val = 0; @@ -80,19 +93,16 @@ void GcodeSuite::M916() { uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) return; // quit if invalid user input - DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate); + DEBUG_ECHOLNPAIR("feedrate = ", final_fr_mm_m); - planner.synchronize(); // wait for all current movement commands to complete + planner.synchronize(); // Wait for moves to finish for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // clear out any pre-existing error flags + L6470.get_status(axis_index[j]); // Clear out error flags - char temp_axis_string[] = " "; - temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section - char gcode_string[80]; uint16_t status_composite = 0; DEBUG_ECHOLNPGM(".\n."); @@ -104,15 +114,8 @@ void GcodeSuite::M916() { for (j = 0; j < driver_count; j++) L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); - // turn the motor(s) both directions - sprintf_P(gcode_string, PSTR("G0 %s%4.3f F%4.3f"), temp_axis_string, position_min, final_feedrate); - process_subcommands_now(gcode_string); - - sprintf_P(gcode_string, PSTR("G0 %s%4.3f F%4.3f"), temp_axis_string, position_max, final_feedrate); - process_subcommands_now(gcode_string); - - // get the status after the motors have stopped - planner.synchronize(); + // Turn the motor(s) both directions + jiggle_axis(axis_mon[0][0], position_min, position_max, final_fr_mm_m); status_composite = 0; // clear out the old bits @@ -187,7 +190,7 @@ void GcodeSuite::M917() { uint8_t driver_count = 1; float position_max; float position_min; - float final_feedrate; + feedRate_t final_fr_mm_m; uint8_t kval_hold; uint8_t ocd_th_val = 0; uint8_t stall_th_val = 0; @@ -196,17 +199,14 @@ void GcodeSuite::M917() { uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) return; // quit if invalid user input - DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate); + DEBUG_ECHOLNPAIR("feedrate = ", final_fr_mm_m); - planner.synchronize(); // wait for all current movement commands to complete + planner.synchronize(); // Wait for moves to finish for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // clear out any pre-existing error flags - char temp_axis_string[] = " "; - temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section - char gcode_string[80]; + L6470.get_status(axis_index[j]); // Clear out error flags uint16_t status_composite = 0; uint8_t test_phase = 0; // 0 - decreasing OCD - exit when OCD warning occurs (ignore STALL) @@ -225,13 +225,7 @@ void GcodeSuite::M917() { DEBUG_ECHOPAIR("STALL threshold : ", (stall_th_val + 1) * 31.25); DEBUG_ECHOLNPAIR(" OCD threshold : ", (ocd_th_val + 1) * 375); - sprintf_P(gcode_string, PSTR("G0 %s%4.3f F%4.3f"), temp_axis_string, position_min, final_feedrate); - process_subcommands_now(gcode_string); - - sprintf_P(gcode_string, PSTR("G0 %s%4.3f F%4.3f"), temp_axis_string, position_max, final_feedrate); - process_subcommands_now(gcode_string); - - planner.synchronize(); + jiggle_axis(axis_mon[0][0], position_min, position_max, final_fr_mm_m); status_composite = 0; // clear out the old bits @@ -264,7 +258,7 @@ void GcodeSuite::M917() { } DEBUG_ECHOLNPGM("."); reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered - watchdog_reset(); // beat the dog + watchdog_refresh(); safe_delay(5000); status_composite_temp = 0; for (j = 0; j < driver_count; j++) { @@ -458,7 +452,7 @@ void GcodeSuite::M918() { uint16_t axis_status[3]; uint8_t driver_count = 1; float position_max, position_min; - float final_feedrate; + feedRate_t final_fr_mm_m; uint8_t kval_hold; uint8_t ocd_th_val = 0; uint8_t stall_th_val = 0; @@ -467,7 +461,7 @@ void GcodeSuite::M918() { uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) return; // quit if invalid user input uint8_t m_steps = parser.byteval('M'); @@ -495,42 +489,29 @@ void GcodeSuite::M918() { for (j = 0; j < driver_count; j++) L6470.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps - DEBUG_ECHOLNPAIR("target (maximum) feedrate = ",final_feedrate); - - float feedrate_inc = final_feedrate / 10, // start at 1/10 of max & go up by 1/10 per step) - current_feedrate = 0; + DEBUG_ECHOLNPAIR("target (maximum) feedrate = ", final_fr_mm_m); - planner.synchronize(); // wait for all current movement commands to complete + planner.synchronize(); // Wait for moves to finish for (j = 0; j < driver_count; j++) - L6470.get_status(axis_index[j]); // clear all error flags + L6470.get_status(axis_index[j]); // Clear all error flags - char temp_axis_string[2]; - temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section - temp_axis_string[1] = '\n'; - - char gcode_string[80]; uint16_t status_composite = 0; - DEBUG_ECHOLNPGM(".\n.\n."); // make the feedrate prints easier to see + DEBUG_ECHOLNPGM(".\n.\n."); // Make the feedrate prints easier to see - do { - current_feedrate += feedrate_inc; - DEBUG_ECHOLNPAIR("...feedrate = ", current_feedrate); + constexpr uint8_t iterations = 10; + for (uint8_t i = 1; i <= iterations; i++) { + const feedRate_t fr_mm_m = i * final_fr_mm_m / iterations; + DEBUG_ECHOLNPAIR("...feedrate = ", fr_mm_m); - sprintf_P(gcode_string, PSTR("G0 %s%4.3f F%4.3f"), temp_axis_string, position_min, current_feedrate); - process_subcommands_now(gcode_string); - - sprintf_P(gcode_string, PSTR("G0 %s%4.3f F%4.3f"), temp_axis_string, position_max, current_feedrate); - process_subcommands_now(gcode_string); - - planner.synchronize(); + jiggle_axis(axis_mon[0][0], position_min, position_max, fr_mm_m); for (j = 0; j < driver_count; j++) { axis_status[j] = (~L6470.get_status(axis_index[j])) & 0x0800; // bits of interest are all active low status_composite |= axis_status[j]; } if (status_composite) break; // quit if any errors flags are raised - } while (current_feedrate < final_feedrate * 0.99); + } DEBUG_ECHOPGM("Completed with errors"); if (status_composite) { diff --git a/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin/src/gcode/feature/advance/M900.cpp index 251051d312c9..f030511422bd 100644 --- a/Marlin/src/gcode/feature/advance/M900.cpp +++ b/Marlin/src/gcode/feature/advance/M900.cpp @@ -44,10 +44,10 @@ void GcodeSuite::M900() { #if EXTRUDERS < 2 - constexpr uint8_t tmp_extruder = 0; + constexpr uint8_t tool_index = 0; #else - const uint8_t tmp_extruder = parser.intval('T', active_extruder); - if (tmp_extruder >= EXTRUDERS) { + const uint8_t tool_index = parser.intval('T', active_extruder); + if (tool_index >= EXTRUDERS) { SERIAL_ECHOLNPGM("?T value out of range."); return; } @@ -55,17 +55,17 @@ void GcodeSuite::M900() { #if ENABLED(EXTRA_LIN_ADVANCE_K) - bool ext_slot = TEST(lin_adv_slot, tmp_extruder); + bool ext_slot = TEST(lin_adv_slot, tool_index); if (parser.seenval('S')) { const bool slot = parser.value_bool(); if (ext_slot != slot) { ext_slot = slot; - SET_BIT_TO(lin_adv_slot, tmp_extruder, slot); + SET_BIT_TO(lin_adv_slot, tool_index, slot); planner.synchronize(); - const float temp = planner.extruder_advance_K[tmp_extruder]; - planner.extruder_advance_K[tmp_extruder] = saved_extruder_advance_K[tmp_extruder]; - saved_extruder_advance_K[tmp_extruder] = temp; + const float temp = planner.extruder_advance_K[tool_index]; + planner.extruder_advance_K[tool_index] = saved_extruder_advance_K[tool_index]; + saved_extruder_advance_K[tool_index] = temp; } } @@ -73,10 +73,10 @@ void GcodeSuite::M900() { const float newK = parser.value_float(); if (WITHIN(newK, 0, 10)) { if (ext_slot) - saved_extruder_advance_K[tmp_extruder] = newK; + saved_extruder_advance_K[tool_index] = newK; else { planner.synchronize(); - planner.extruder_advance_K[tmp_extruder] = newK; + planner.extruder_advance_K[tool_index] = newK; } } else @@ -87,10 +87,10 @@ void GcodeSuite::M900() { const float newL = parser.value_float(); if (WITHIN(newL, 0, 10)) { if (!ext_slot) - saved_extruder_advance_K[tmp_extruder] = newL; + saved_extruder_advance_K[tool_index] = newL; else { planner.synchronize(); - planner.extruder_advance_K[tmp_extruder] = newL; + planner.extruder_advance_K[tool_index] = newL; } } else @@ -99,13 +99,13 @@ void GcodeSuite::M900() { if (!parser.seen_any()) { #if EXTRUDERS < 2 - SERIAL_ECHOLNPAIR("Advance S", ext_slot, " K", planner.extruder_advance_K[0]); - SERIAL_ECHOLNPAIR("(Slot ", 1 - ext_slot, " K", saved_extruder_advance_K[0], ")"); + SERIAL_ECHOLNPAIR("Advance S", ext_slot, " K", planner.extruder_advance_K[0], + "(Slot ", 1 - ext_slot, " K", saved_extruder_advance_K[0], ")"); #else LOOP_L_N(i, EXTRUDERS) { const int slot = (int)TEST(lin_adv_slot, i); - SERIAL_ECHOLNPAIR("Advance T", int(i), " S", slot, " K", planner.extruder_advance_K[i]); - SERIAL_ECHOLNPAIR("(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")"); + SERIAL_ECHOLNPAIR("Advance T", int(i), " S", slot, " K", planner.extruder_advance_K[i], + "(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")"); SERIAL_EOL(); } #endif @@ -117,7 +117,7 @@ void GcodeSuite::M900() { const float newK = parser.value_float(); if (WITHIN(newK, 0, 10)) { planner.synchronize(); - planner.extruder_advance_K[tmp_extruder] = newK; + planner.extruder_advance_K[tool_index] = newK; } else SERIAL_ECHOLNPGM("?K value out of range (0-10)."); diff --git a/Marlin/src/gcode/feature/camera/M240.cpp b/Marlin/src/gcode/feature/camera/M240.cpp index b4234cb823e8..ac6729053dba 100644 --- a/Marlin/src/gcode/feature/camera/M240.cpp +++ b/Marlin/src/gcode/feature/camera/M240.cpp @@ -31,6 +31,10 @@ millis_t chdk_timeout; // = 0 #endif +#if defined(PHOTO_POSITION) && PHOTO_DELAY_MS > 0 + #include "../../../Marlin.h" // for idle() +#endif + #ifdef PHOTO_RETRACT_MM #define _PHOTO_RETRACT_MM (PHOTO_RETRACT_MM + 0) @@ -43,13 +47,13 @@ #endif #ifdef PHOTO_RETRACT_MM - inline void e_move_m240(const float length, const float fr_mm_s) { + inline void e_move_m240(const float length, const feedRate_t &fr_mm_s) { if (length && thermalManager.hotEnoughToExtrude(active_extruder)) { #if ENABLED(ADVANCED_PAUSE_FEATURE) do_pause_e_move(length, fr_mm_s); #else - current_position[E_AXIS] += length / planner.e_factor[active_extruder]; - planner.buffer_line(current_position, fr_mm_s, active_extruder); + current_position.e += length / planner.e_factor[active_extruder]; + line_to_current_position(fr_mm_s); #endif } } @@ -97,14 +101,15 @@ void GcodeSuite::M240() { if (axis_unhomed_error()) return; - const float old_pos[XYZ] = { - current_position[X_AXIS] + parser.linearval('A'), - current_position[Y_AXIS] + parser.linearval('B'), - current_position[Z_AXIS] + const xyz_pos_t old_pos = { + current_position.x + parser.linearval('A'), + current_position.y + parser.linearval('B'), + current_position.z }; #ifdef PHOTO_RETRACT_MM - constexpr float rfr = (MMS_TO_MMM( + const float rval = parser.seenval('R') ? parser.value_linear_units() : _PHOTO_RETRACT_MM; + feedRate_t sval = ( #if ENABLED(ADVANCED_PAUSE_FEATURE) PAUSE_PARK_RETRACT_FEEDRATE #elif ENABLED(FWRETRACT) @@ -112,31 +117,30 @@ void GcodeSuite::M240() { #else 45 #endif - )); - const float rval = parser.seenval('R') ? parser.value_linear_units() : _PHOTO_RETRACT_MM, - sval = parser.seenval('S') ? MMM_TO_MMS(parser.value_feedrate()) : rfr; + ); + if (parser.seenval('S')) sval = parser.value_feedrate(); e_move_m240(-rval, sval); #endif - float fr_mm_s = MMM_TO_MMS(parser.linearval('F')); + feedRate_t fr_mm_s = MMM_TO_MMS(parser.linearval('F')); if (fr_mm_s) NOLESS(fr_mm_s, 10.0f); - constexpr float photo_position[XYZ] = PHOTO_POSITION; - float raw[XYZ] = { - parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : photo_position[X_AXIS], - parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : photo_position[Y_AXIS], - (parser.seenval('Z') ? parser.value_linear_units() : photo_position[Z_AXIS]) + current_position[Z_AXIS] + constexpr xyz_pos_t photo_position = PHOTO_POSITION; + xyz_pos_t raw = { + parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : photo_position.x, + parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : photo_position.y, + (parser.seenval('Z') ? parser.value_linear_units() : photo_position.z) + current_position.z }; apply_motion_limits(raw); do_blocking_move_to(raw, fr_mm_s); #ifdef PHOTO_SWITCH_POSITION - constexpr float photo_switch_position[2] = PHOTO_SWITCH_POSITION; - const float sraw[] = { - parser.seenval('I') ? RAW_X_POSITION(parser.value_linear_units()) : photo_switch_position[X_AXIS], - parser.seenval('J') ? RAW_Y_POSITION(parser.value_linear_units()) : photo_switch_position[Y_AXIS] + constexpr xy_pos_t photo_switch_position = PHOTO_SWITCH_POSITION; + const xy_pos_t sraw = { + parser.seenval('I') ? RAW_X_POSITION(parser.value_linear_units()) : photo_switch_position.x, + parser.seenval('J') ? RAW_Y_POSITION(parser.value_linear_units()) : photo_switch_position.y }; - do_blocking_move_to_xy(sraw[X_AXIS], sraw[Y_AXIS], get_homing_bump_feedrate(X_AXIS)); + do_blocking_move_to_xy(sraw, get_homing_bump_feedrate(X_AXIS)); #if PHOTO_SWITCH_MS > 0 safe_delay(parser.intval('D', PHOTO_SWITCH_MS)); #endif @@ -148,7 +152,7 @@ void GcodeSuite::M240() { #if PIN_EXISTS(CHDK) OUT_WRITE(CHDK_PIN, HIGH); - chdk_timeout = millis() + PHOTO_SWITCH_MS; + chdk_timeout = millis() + parser.intval('D', PHOTO_SWITCH_MS); #elif HAS_PHOTOGRAPH @@ -160,7 +164,8 @@ void GcodeSuite::M240() { #ifdef PHOTO_POSITION #if PHOTO_DELAY_MS > 0 - safe_delay(parser.intval('P', PHOTO_DELAY_MS)); + const millis_t timeout = millis() + parser.intval('P', PHOTO_DELAY_MS); + while (PENDING(millis(), timeout)) idle(); #endif do_blocking_move_to(old_pos, fr_mm_s); #ifdef PHOTO_RETRACT_MM diff --git a/Marlin/src/gcode/feature/cancel/M486.cpp b/Marlin/src/gcode/feature/cancel/M486.cpp new file mode 100644 index 000000000000..2fcb4840f6e7 --- /dev/null +++ b/Marlin/src/gcode/feature/cancel/M486.cpp @@ -0,0 +1,57 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if ENABLED(CANCEL_OBJECTS) + +#include "../../gcode.h" +#include "../../../feature/cancel_object.h" + +/** + * M486: A simple interface to cancel objects + * + * T[count] : Reset objects and/or set the count + * S : Start an object with the given index + * P : Cancel the object with the given index + * U : Un-cancel object with the given index + * C : Cancel the current object (the last index given by S) + * S-1 : Start a non-object like a brim or purge tower that should always print + */ +void GcodeSuite::M486() { + + if (parser.seen('T')) { + cancelable.reset(); + cancelable.object_count = parser.intval('T', 1); + } + + if (parser.seen('S')) + cancelable.set_active_object(parser.value_int()); + + if (parser.seen('C')) cancelable.cancel_active_object(); + + if (parser.seen('P')) cancelable.cancel_object(parser.value_int()); + + if (parser.seen('U')) cancelable.uncancel_object(parser.value_int()); +} + +#endif // CANCEL_OBJECTS diff --git a/Marlin/src/gcode/feature/clean/G12.cpp b/Marlin/src/gcode/feature/clean/G12.cpp index d0aa0c16edb3..30c71264eb88 100644 --- a/Marlin/src/gcode/feature/clean/G12.cpp +++ b/Marlin/src/gcode/feature/clean/G12.cpp @@ -47,17 +47,20 @@ void GcodeSuite::G12() { objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES); const float radius = parser.floatval('R', NOZZLE_CLEAN_CIRCLE_RADIUS); - #if HAS_LEVELING - const bool was_enabled = planner.leveling_active; - set_bed_leveling_enabled(false); - #endif + const bool seenxyz = parser.seen("XYZ"); + const uint8_t cleans = (!seenxyz || parser.boolval('X') ? _BV(X_AXIS) : 0) + | (!seenxyz || parser.boolval('Y') ? _BV(Y_AXIS) : 0) + #if DISABLED(NOZZLE_CLEAN_NO_Z) + | (!seenxyz || parser.boolval('Z') ? _BV(Z_AXIS) : 0) + #endif + ; - Nozzle::clean(pattern, strokes, radius, objects); - - // Re-enable bed level correction if it had been on #if HAS_LEVELING - set_bed_leveling_enabled(was_enabled); + // Disable bed leveling if cleaning Z + TEMPORARY_BED_LEVELING_STATE(!TEST(cleans, Z_AXIS) && planner.leveling_active); #endif + + nozzle.clean(pattern, strokes, radius, objects, cleans); } #endif // NOZZLE_CLEAN_FEATURE diff --git a/Marlin/src/gcode/feature/digipot/M907-M910.cpp b/Marlin/src/gcode/feature/digipot/M907-M910.cpp index 4f48bb77ed44..a7546b28339b 100644 --- a/Marlin/src/gcode/feature/digipot/M907-M910.cpp +++ b/Marlin/src/gcode/feature/digipot/M907-M910.cpp @@ -65,8 +65,10 @@ void GcodeSuite::M907() { #if ENABLED(DIGIPOT_I2C) // this one uses actual amps in floating point LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) digipot_i2c_set_current(i, parser.value_float()); - // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...) - for (uint8_t i = NUM_AXIS; i < DIGIPOT_I2C_NUM_CHANNELS; i++) if (parser.seenval('B' + i - (NUM_AXIS))) digipot_i2c_set_current(i, parser.value_float()); + // Additional extruders use B,C,D for channels 4,5,6. + // TODO: Change these parameters because 'E' is used. B? + for (uint8_t i = E_AXIS + 1; i < DIGIPOT_I2C_NUM_CHANNELS; i++) + if (parser.seenval('B' + i - (E_AXIS + 1))) digipot_i2c_set_current(i, parser.value_float()); #endif #if ENABLED(DAC_STEPPER_CURRENT) diff --git a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp index e65a59850a0b..5b58416b4313 100644 --- a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp +++ b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp @@ -34,12 +34,12 @@ * M404: Display or set (in current units) the nominal filament width (3mm, 1.75mm ) W<3.0> */ void GcodeSuite::M404() { - if (parser.seen('W')) { - filament_width_nominal = parser.value_linear_units(); - planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5); + if (parser.seenval('W')) { + filwidth.nominal_mm = parser.value_linear_units(); + planner.volumetric_area_nominal = CIRCLE_AREA(filwidth.nominal_mm * 0.5); } else - SERIAL_ECHOLNPAIR("Filament dia (nominal mm):", filament_width_nominal); + SERIAL_ECHOLNPAIR("Filament dia (nominal mm):", filwidth.nominal_mm); } /** @@ -48,28 +48,17 @@ void GcodeSuite::M404() { void GcodeSuite::M405() { // This is technically a linear measurement, but since it's quantized to centimeters and is a different // unit than everything else, it uses parser.value_byte() instead of parser.value_linear_units(). - if (parser.seen('D')) { - meas_delay_cm = parser.value_byte(); - NOMORE(meas_delay_cm, MAX_MEASUREMENT_DELAY); - } - - if (filwidth_delay_index[1] == -1) { // Initialize the ring buffer if not done since startup - const int8_t temp_ratio = thermalManager.widthFil_to_size_ratio(); - - for (uint8_t i = 0; i < COUNT(measurement_delay); ++i) - measurement_delay[i] = temp_ratio; - - filwidth_delay_index[0] = filwidth_delay_index[1] = 0; - } + if (parser.seenval('D')) + filwidth.set_delay_cm(parser.value_byte()); - filament_sensor = true; + filwidth.enable(true); } /** * M406: Turn off filament sensor for control */ void GcodeSuite::M406() { - filament_sensor = false; + filwidth.enable(false); planner.calculate_volumetric_multipliers(); // Restore correct 'volumetric_multiplier' value } @@ -77,7 +66,7 @@ void GcodeSuite::M406() { * M407: Get measured filament diameter on serial output */ void GcodeSuite::M407() { - SERIAL_ECHOLNPAIR("Filament dia (measured mm):", filament_width_meas); + SERIAL_ECHOLNPAIR("Filament dia (measured mm):", filwidth.measured_mm); } #endif // FILAMENT_WIDTH_SENSOR diff --git a/Marlin/src/gcode/feature/leds/M150.cpp b/Marlin/src/gcode/feature/leds/M150.cpp index 1e98ffca2a1d..405be898ae12 100644 --- a/Marlin/src/gcode/feature/leds/M150.cpp +++ b/Marlin/src/gcode/feature/leds/M150.cpp @@ -50,7 +50,7 @@ void GcodeSuite::M150() { parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0, parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0, parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness() + parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : neo.brightness() )); } diff --git a/Marlin/src/gcode/feature/leds/M7219.cpp b/Marlin/src/gcode/feature/leds/M7219.cpp index aa8d063a6e04..c3d264353511 100644 --- a/Marlin/src/gcode/feature/leds/M7219.cpp +++ b/Marlin/src/gcode/feature/leds/M7219.cpp @@ -33,13 +33,16 @@ * I - Initialize (clear) the matrix * F - Fill the matrix (set all bits) * P - Dump the led_line[] 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) + * C - Set a column to the bitmask given by 'V' (Units 0-3 in portrait layout) + * R - Set a row to the bitmask given by 'V' (Units 0-3 in landscape layout) + * X - X index of an LED to set or toggle + * Y - Y index of an LED to set or toggle + * V - LED on/off state or row/column bitmask (8, 16, 24, or 32-bits) + * ('C' / 'R' can be used to update up to 4 units at once) + * + * Directly set a native matrix row to the 8-bit value 'V': + * D - Display line (0..7) + * U - Unit index (0..MAX7219_NUMBER_UNITS-1) */ void GcodeSuite::M7219() { if (parser.seen('I')) { @@ -62,12 +65,13 @@ void GcodeSuite::M7219() { 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')); + max7219.led_set(x, y, v > 0); else max7219.led_toggle(x, y); } else if (parser.seen('D')) { - const uint8_t line = parser.byteval('D') + (parser.byteval('U') << 3); + const uint8_t uline = parser.value_byte() & 0x7, + line = uline + (parser.byteval('U') << 3); if (line < MAX7219_LINES) { max7219.led_line[line] = v; return max7219.refresh_line(line); diff --git a/Marlin/src/gcode/feature/mixing/M163-M165.cpp b/Marlin/src/gcode/feature/mixing/M163-M165.cpp index 05654d389acc..cc0a46836645 100644 --- a/Marlin/src/gcode/feature/mixing/M163-M165.cpp +++ b/Marlin/src/gcode/feature/mixing/M163-M165.cpp @@ -79,20 +79,7 @@ void GcodeSuite::M164() { // Get mixing parameters from the GCode // The total "must" be 1.0 (but it will be normalized) // If no mix factors are given, the old mix is preserved - 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[] = { LIST_N(MIXING_STEPPERS, 'A', 'B', 'C', 'D', 'H', 'I') }; uint8_t mix_bits = 0; MIXER_STEPPER_LOOP(i) { if (parser.seenval(mixing_codes[i])) { diff --git a/Marlin/src/gcode/feature/mixing/M166.cpp b/Marlin/src/gcode/feature/mixing/M166.cpp index 1bb2e4b8f195..cb3541eb8fd0 100644 --- a/Marlin/src/gcode/feature/mixing/M166.cpp +++ b/Marlin/src/gcode/feature/mixing/M166.cpp @@ -30,15 +30,12 @@ #include "../../../feature/mixing.h" inline void echo_mix() { - SERIAL_ECHOPAIR(" (", int(mixer.mix[0])); - SERIAL_ECHOPAIR("%|", int(mixer.mix[1])); - SERIAL_ECHOPGM("%)"); + SERIAL_ECHOPAIR(" (", int(mixer.mix[0]), "%|", int(mixer.mix[1]), "%)"); } inline void echo_zt(const int t, const float &z) { mixer.update_mix_from_vtool(t); - SERIAL_ECHOPAIR(" Z", z); - SERIAL_ECHOPAIR(" T", t); + SERIAL_ECHOPAIR_P(SP_Z_STR, z, PSTR(" T"), t); echo_mix(); } diff --git a/Marlin/src/gcode/feature/pause/G27.cpp b/Marlin/src/gcode/feature/pause/G27.cpp index 3b49ae283e09..4f4c9e469840 100644 --- a/Marlin/src/gcode/feature/pause/G27.cpp +++ b/Marlin/src/gcode/feature/pause/G27.cpp @@ -35,7 +35,7 @@ void GcodeSuite::G27() { // Don't allow nozzle parking without homing first if (axis_unhomed_error()) return; - Nozzle::park(parser.ushortval('P')); + nozzle.park(parser.ushortval('P')); } #endif // NOZZLE_PARK_FEATURE diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index 86e8f61c1cd2..22aaf2c446f1 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -58,7 +58,7 @@ void GcodeSuite::M125() { #endif ); - point_t park_point = NOZZLE_PARK_POINT; + xyz_pos_t park_point = NOZZLE_PARK_POINT; // Move XY axes to filament change position or given position if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X')); @@ -68,8 +68,7 @@ void GcodeSuite::M125() { if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA) - park_point.x += hotend_offset[X_AXIS][active_extruder]; - park_point.y += hotend_offset[Y_AXIS][active_extruder]; + park_point += hotend_offset[active_extruder]; #endif #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 6cadbe60800e..4056a398e4f1 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -60,7 +60,6 @@ * Default values are used for omitted arguments. */ void GcodeSuite::M600() { - point_t park_point = NOZZLE_PARK_POINT; #if ENABLED(MIXING_EXTRUDER) const int8_t target_e_stepper = get_target_e_stepper_from_command(); @@ -98,7 +97,7 @@ void GcodeSuite::M600() { #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) // Don't allow filament change without homing first - if (axis_unhomed_error()) home_all_axes(); + if (axes_need_homing()) home_all_axes(); #endif #if EXTRUDERS > 1 @@ -119,6 +118,8 @@ void GcodeSuite::M600() { #endif ); + xyz_pos_t park_point NOZZLE_PARK_POINT; + // Lift Z axis if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); @@ -127,8 +128,7 @@ void GcodeSuite::M600() { if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA) - park_point.x += hotend_offset[X_AXIS][active_extruder]; - park_point.y += hotend_offset[Y_AXIS][active_extruder]; + park_point += hotend_offset[active_extruder]; #endif #if ENABLED(MMU2_MENUS) diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index b127a9fbadc9..ffc04915dae7 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -28,7 +28,7 @@ #include "../../../Marlin.h" #include "../../../module/motion.h" #include "../../../module/temperature.h" -#include "../../../libs/point_t.h" +#include "../../../feature/pause.h" #if EXTRUDERS > 1 #include "../../../module/tool_change.h" @@ -57,11 +57,11 @@ * Default values are used for omitted arguments. */ void GcodeSuite::M701() { - point_t park_point = NOZZLE_PARK_POINT; + xyz_pos_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; + // Don't raise Z if the machine isn't homed + if (axes_need_homing()) park_point.z = 0; #endif #if ENABLED(MIXING_EXTRUDER) @@ -97,26 +97,31 @@ void GcodeSuite::M701() { // 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); + do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); // Load filament #if ENABLED(PRUSA_MMU2) mmu2.load_filament_to_nozzle(target_extruder); #else - 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) - : fc_settings[active_extruder].load_length); - load_filament(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS, - true, thermalManager.still_heating(target_extruder), PAUSE_MODE_LOAD_FILAMENT - #if ENABLED(DUAL_X_CARRIAGE) - , target_extruder - #endif - ); + constexpr float purge_length = ADVANCED_PAUSE_PURGE_LENGTH, + slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; + const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) + : fc_settings[active_extruder].load_length); + load_filament( + slow_load_length, fast_load_length, purge_length, + FILAMENT_CHANGE_ALERT_BEEPS, + true, // show_lcd + thermalManager.still_heating(target_extruder), // pause_for_user + PAUSE_MODE_LOAD_FILAMENT // pause_mode + #if ENABLED(DUAL_X_CARRIAGE) + , target_extruder // Dual X target + #endif + ); #endif // 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); + do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Restore toolhead if it was changed @@ -146,11 +151,11 @@ void GcodeSuite::M701() { * Default values are used for omitted arguments. */ void GcodeSuite::M702() { - point_t park_point = NOZZLE_PARK_POINT; + xyz_pos_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; + // Don't raise Z if the machine isn't homed + if (axes_need_homing()) park_point.z = 0; #endif #if ENABLED(MIXING_EXTRUDER) @@ -196,7 +201,7 @@ void GcodeSuite::M702() { // 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); + do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); // Unload filament #if ENABLED(PRUSA_MMU2) @@ -226,7 +231,7 @@ void GcodeSuite::M702() { // 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); + do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Restore toolhead if it was changed diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index c454a34c05e3..f14dc6068599 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -52,8 +52,13 @@ inline void plr_error(PGM_P const prefix) { void GcodeSuite::M1000() { if (recovery.valid()) { - if (parser.seen('S')) - ui.goto_screen(menu_job_recovery); + if (parser.seen('S')) { + #if HAS_LCD_MENU + ui.goto_screen(menu_job_recovery); + #else + SERIAL_ECHO_MSG("Resume requires LCD."); + #endif + } else recovery.resume(); } diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 49f4c250afc9..cd1dd801b909 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -47,7 +47,7 @@ void GcodeSuite::M413() { } #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - if (parser.seen('R') || parser.seen('L')) recovery.load(); + if (parser.seen("RL")) recovery.load(); if (parser.seen('W')) recovery.save(true); if (parser.seen('P')) recovery.purge(); if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("PLR Exists\n") : PSTR("No PLR\n")); diff --git a/Marlin/src/gcode/feature/runout/M412.cpp b/Marlin/src/gcode/feature/runout/M412.cpp index 5064b6f5b00b..7a5dd65e0e88 100644 --- a/Marlin/src/gcode/feature/runout/M412.cpp +++ b/Marlin/src/gcode/feature/runout/M412.cpp @@ -31,12 +31,12 @@ * M412: Enable / Disable filament runout detection */ void GcodeSuite::M412() { - if (parser.seen("HS" + if (parser.seen("RS" #ifdef FILAMENT_RUNOUT_DISTANCE_MM "D" #endif #if ENABLED(HOST_ACTION_COMMANDS) - "R" + "H" #endif )) { #if ENABLED(HOST_ACTION_COMMANDS) diff --git a/Marlin/src/gcode/feature/trinamic/M122.cpp b/Marlin/src/gcode/feature/trinamic/M122.cpp index bbbe86bdb89f..a7e6d65172ae 100644 --- a/Marlin/src/gcode/feature/trinamic/M122.cpp +++ b/Marlin/src/gcode/feature/trinamic/M122.cpp @@ -31,8 +31,8 @@ * M122: Debug TMC drivers */ void GcodeSuite::M122() { - bool print_axis[XYZE] = { false, false, false, false }, - print_all = true; + xyze_bool_t print_axis = { false, false, false, false }; + bool print_all = true; LOOP_XYZE(i) if (parser.seen(axis_codes[i])) { print_axis[i] = true; print_all = false; } if (print_all) LOOP_XYZE(i) print_axis[i] = true; @@ -45,12 +45,12 @@ void GcodeSuite::M122() { #endif if (parser.seen('V')) - tmc_get_registers(print_axis[X_AXIS], print_axis[Y_AXIS], print_axis[Z_AXIS], print_axis[E_AXIS]); + tmc_get_registers(print_axis.x, print_axis.y, print_axis.z, print_axis.e); else - tmc_report_all(print_axis[X_AXIS], print_axis[Y_AXIS], print_axis[Z_AXIS], print_axis[E_AXIS]); + tmc_report_all(print_axis.x, print_axis.y, print_axis.z, print_axis.e); #endif - test_tmc_connection(print_axis[X_AXIS], print_axis[Y_AXIS], print_axis[Z_AXIS], print_axis[E_AXIS]); + test_tmc_connection(print_axis.x, print_axis.y, print_axis.z, print_axis.e); } #endif // HAS_TRINAMIC diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp index 6463889c2a25..e8239838d79c 100644 --- a/Marlin/src/gcode/feature/trinamic/M569.cpp +++ b/Marlin/src/gcode/feature/trinamic/M569.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../feature/tmc_util.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" template void tmc_say_stealth_status(TMC &st) { diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index ba57fbb4ce38..072f7ba1fdd7 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../feature/tmc_util.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" /** * M906: Set motor current in milliamps. diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index 459c3f6aa846..feb891544d08 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../feature/tmc_util.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" #include "../../../module/planner.h" #include "../../queue.h" @@ -104,25 +104,25 @@ */ void GcodeSuite::M912() { #if M91x_SOME_X - const bool hasX = parser.seen(axis_codes[X_AXIS]); + const bool hasX = parser.seen(axis_codes.x); #else constexpr bool hasX = false; #endif #if M91x_SOME_Y - const bool hasY = parser.seen(axis_codes[Y_AXIS]); + const bool hasY = parser.seen(axis_codes.y); #else constexpr bool hasY = false; #endif #if M91x_SOME_Z - const bool hasZ = parser.seen(axis_codes[Z_AXIS]); + const bool hasZ = parser.seen(axis_codes.z); #else constexpr bool hasZ = false; #endif #if M91x_SOME_E - const bool hasE = parser.seen(axis_codes[E_AXIS]); + const bool hasE = parser.seen(axis_codes.e); #else constexpr bool hasE = false; #endif @@ -130,7 +130,7 @@ const bool hasNone = !hasX && !hasY && !hasZ && !hasE; #if M91x_SOME_X - const int8_t xval = int8_t(parser.byteval(axis_codes[X_AXIS], 0xFF)); + const int8_t xval = int8_t(parser.byteval(axis_codes.x, 0xFF)); #if M91x_USE(X) if (hasNone || xval == 1 || (hasX && xval < 0)) tmc_clear_otpw(stepperX); #endif @@ -140,7 +140,7 @@ #endif #if M91x_SOME_Y - const int8_t yval = int8_t(parser.byteval(axis_codes[Y_AXIS], 0xFF)); + const int8_t yval = int8_t(parser.byteval(axis_codes.y, 0xFF)); #if M91x_USE(Y) if (hasNone || yval == 1 || (hasY && yval < 0)) tmc_clear_otpw(stepperY); #endif @@ -150,7 +150,7 @@ #endif #if M91x_SOME_Z - const int8_t zval = int8_t(parser.byteval(axis_codes[Z_AXIS], 0xFF)); + const int8_t zval = int8_t(parser.byteval(axis_codes.z, 0xFF)); #if M91x_USE(Z) if (hasNone || zval == 1 || (hasZ && zval < 0)) tmc_clear_otpw(stepperZ); #endif @@ -163,7 +163,7 @@ #endif #if M91x_SOME_E - const int8_t eval = int8_t(parser.byteval(axis_codes[E_AXIS], 0xFF)); + const int8_t eval = int8_t(parser.byteval(axis_codes.e, 0xFF)); #if M91x_USE_E(0) if (hasNone || eval == 0 || (hasE && eval < 0)) tmc_clear_otpw(stepperE0); #endif diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index ec76671f1c1b..92928cf8b335 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -45,11 +45,22 @@ GcodeSuite gcode; #include "../feature/power_loss_recovery.h" #endif +#if ENABLED(CANCEL_OBJECTS) + #include "../feature/cancel_object.h" +#endif + #include "../Marlin.h" // for idle() and suspend_auto_report millis_t GcodeSuite::previous_move_ms; -bool GcodeSuite::axis_relative_modes[] = AXIS_RELATIVE_MODES; +// Relative motion mode for each logical axis +static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES; +uint8_t GcodeSuite::axis_relative = ( + (ar_init.x ? _BV(REL_X) : 0) + | (ar_init.y ? _BV(REL_Y) : 0) + | (ar_init.z ? _BV(REL_Z) : 0) + | (ar_init.e ? _BV(REL_E) : 0) +); #if ENABLED(HOST_KEEPALIVE_FEATURE) GcodeSuite::MarlinBusyState GcodeSuite::busy_state = NOT_BUSY; @@ -62,7 +73,7 @@ bool GcodeSuite::axis_relative_modes[] = AXIS_RELATIVE_MODES; #if ENABLED(CNC_COORDINATE_SYSTEMS) int8_t GcodeSuite::active_coordinate_system = -1; // machine space - float GcodeSuite::coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; + xyz_pos_t GcodeSuite::coordinate_system[MAX_COORDINATE_SYSTEMS]; #endif /** @@ -106,30 +117,47 @@ int8_t GcodeSuite::get_target_e_stepper_from_command() { * - Set the feedrate, if included */ void GcodeSuite::get_destination_from_command() { - bool seen[XYZE] = { false, false, false, false }; - LOOP_XYZE(i) { + xyze_bool_t seen = { false, false, false, false }; + + #if ENABLED(CANCEL_OBJECTS) + const bool &skip_move = cancelable.skipping; + #else + constexpr bool skip_move = false; + #endif + + // Get new XYZ position, whether absolute or relative + LOOP_XYZ(i) { if ( (seen[i] = parser.seenval(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_AXIS) ? v : LOGICAL_TO_NATIVE(v, i); + if (skip_move) + destination[i] = current_position[i]; + else + destination[i] = axis_is_relative(AxisEnum(i)) ? current_position[i] + v : LOGICAL_TO_NATIVE(v, i); } else destination[i] = current_position[i]; } - #if ENABLED(POWER_LOSS_RECOVERY) + // Get new E position, whether absolute or relative + if ( (seen.e = parser.seenval('E')) ) { + const float v = parser.value_axis_units(E_AXIS); + destination.e = axis_is_relative(E_AXIS) ? current_position.e + v : v; + } + else + destination.e = current_position.e; + + #if ENABLED(POWER_LOSS_RECOVERY) && !PIN_EXISTS(POWER_LOSS) // Only update power loss recovery on moves with E - if (recovery.enabled && IS_SD_PRINTING() && seen[E_AXIS] && (seen[X_AXIS] || seen[Y_AXIS])) + if (recovery.enabled && IS_SD_PRINTING() && seen.e && (seen.x || seen.y)) recovery.save(); #endif if (parser.linearval('F') > 0) - feedrate_mm_s = MMM_TO_MMS(parser.value_feedrate()); + feedrate_mm_s = parser.value_feedrate(); #if ENABLED(PRINTCOUNTER) - if (!DEBUGGING(DRYRUN)) - print_job_timer.incFilamentUsed(destination[E_AXIS] - current_position[E_AXIS]); + if (!DEBUGGING(DRYRUN) && !skip_move) + print_job_timer.incFilamentUsed(destination.e - current_position.e); #endif // Get ABCDHI mixing factors @@ -295,8 +323,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 80: G80(); break; // G80: Reset the current motion mode #endif - case 90: relative_mode = false; break; // G90: Relative Mode - case 91: relative_mode = true; break; // G91: Absolute Mode + case 90: set_relative_mode(false); break; // G90: Absolute Mode + case 91: set_relative_mode(true); break; // G91: Relative Mode case 92: G92(); break; // G92: Set current axis position(s) @@ -317,6 +345,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { break; case 'M': switch (parser.codenum) { + #if HAS_RESUME_CONTINUE case 0: // M0: Unconditional stop - Wait for user button press on LCD case 1: M0_M1(); break; // M1: Conditional stop - Wait for user button press on LCD @@ -342,6 +371,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 12: M12(); break; // M12: Synchronize and optionally force a CLC set #endif + #if ENABLED(EXPECTED_PRINTER_CHECK) + case 16: M16(); break; // M16: Expected printer check + #endif + case 17: M17(); break; // M17: Enable all stepper motors #if ENABLED(SDSUPPORT) @@ -396,17 +429,27 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 100: M100(); break; // M100: Free Memory Report #endif - case 104: M104(); break; // M104: Set hot end temperature - case 109: M109(); break; // M109: Wait for hotend temperature to reach target + #if EXTRUDERS + case 104: M104(); break; // M104: Set hot end temperature + case 109: M109(); break; // M109: Wait for hotend temperature to reach target + #endif + + case 105: M105(); return; // M105: Report Temperatures (and say "ok") + + #if FAN_COUNT > 0 + case 106: M106(); break; // M106: Fan On + case 107: M107(); break; // M107: Fan Off + #endif + case 110: M110(); break; // M110: Set Current Line Number case 111: M111(); break; // M111: Set debug level #if DISABLED(EMERGENCY_PARSER) case 108: M108(); break; // M108: Cancel Waiting - case 112: M112(); break; // M112: Emergency Stop + case 112: M112(); break; // M112: Full Shutdown case 410: M410(); break; // M410: Quickstop - Abort all the planned moves. #if ENABLED(HOST_PROMPT_SUPPORT) - case 876: M876(); break; // M876: Handle Host prompt responses + case 876: M876(); break; // M876: Handle Host prompt responses #endif #else case 108: case 112: case 410: @@ -427,20 +470,13 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #if HAS_HEATED_CHAMBER case 141: M141(); break; // M141: Set chamber temperature - //case 191: M191(); break; // M191: Wait for chamber temperature to reach target + case 191: M191(); break; // M191: Wait for chamber temperature to reach target #endif - case 105: M105(); return; // M105: Report Temperatures (and say "ok") - #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR case 155: M155(); break; // M155: Set temperature auto-report interval #endif - #if FAN_COUNT > 0 - case 106: M106(); break; // M106: Fan On - case 107: M107(); break; // M107: Fan Off - #endif - #if ENABLED(PARK_HEAD_ON_PAUSE) case 125: M125(); break; // M125: Store current position and move to filament change position #endif @@ -459,7 +495,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #endif // BARICUDA - #if HAS_POWER_SWITCH + #if ENABLED(PSU_CONTROL) case 80: M80(); break; // M80: Turn on Power Supply #endif case 81: M81(); break; // M81: Turn off Power, including Power Supply, if possible @@ -477,7 +513,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 120: M120(); break; // M120: Enable endstops case 121: M121(); break; // M121: Disable endstops - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU case 145: M145(); break; // M145: Set material heatup parameters #endif @@ -549,7 +585,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif case 220: M220(); break; // M220: Set Feedrate Percentage: S ("FR" on your LCD) - case 221: M221(); break; // M221: Set Flow Percentage + + #if EXTRUDERS + case 221: M221(); break; // M221: Set Flow Percentage + #endif + case 226: M226(); break; // M226: Wait until a pin reaches a state #if HAS_SERVOS @@ -651,6 +691,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 428: M428(); break; // M428: Apply current_position to home_offset #endif + #if ENABLED(CANCEL_OBJECTS) + case 486: M486(); break; // M486: Identify and cancel objects + #endif + case 500: M500(); break; // M500: Store settings in EEPROM case 501: M501(); break; // M501: Read settings from EEPROM case 502: M502(); break; // M502: Revert to default settings @@ -669,6 +713,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 540: M540(); break; // M540: Set abort on endstop hit for SD printing #endif + #if ENABLED(BAUD_RATE_GCODE) + case 575: M575(); break; // M575: Set serial baudrate + #endif + #if HAS_BED_PROBE case 851: M851(); break; // M851: Set Z Probe Z Offset #endif @@ -804,16 +852,20 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { * This is called from the main loop() */ void GcodeSuite::process_next_command() { - char * const current_command = queue.buffer[queue.index_r]; + char * const current_command = queue.command_buffer[queue.index_r]; PORT_REDIRECT(queue.port[queue.index_r]); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.queue_index_r = queue.index_r; + #endif + if (DEBUGGING(ECHO)) { SERIAL_ECHO_START(); SERIAL_ECHOLN(current_command); #if ENABLED(M100_FREE_MEMORY_DUMPER) SERIAL_ECHOPAIR("slot:", queue.index_r); - M100_dump_routine(PSTR(" Command Queue:"), queue.buffer, queue.buffer + sizeof(queue.buffer)); + M100_dump_routine(PSTR(" Command Queue:"), queue.command_buffer, queue.command_buffer + sizeof(queue.command_buffer)); #endif } diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 93b91e3eec81..9f4675291fc8 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -83,6 +83,7 @@ * M8 - Turn flood coolant ON. (Requires COOLANT_CONTROL) * M9 - Turn coolant OFF. (Requires COOLANT_CONTROL) * M12 - Set up closed loop control system. (Requires EXTERNAL_CLOSED_LOOP_CONTROLLER) + * M16 - Expected printer check. (Requires EXPECTED_PRINTER_CHECK) * M17 - Enable/Power all stepper motors * M18 - Disable all stepper motors; same as M84 * M20 - List SD card. (Requires SDSUPPORT) @@ -131,7 +132,7 @@ * If AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F * M110 - Set the current line number. (Used by host printing) * M111 - Set debug flags: "M111 S". See flag bits defined in enum.h. - * M112 - Emergency stop. + * M112 - Full Shutdown. * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE) * M114 - Report current position. * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT) @@ -176,6 +177,7 @@ * M217 - Set filament swap parameters: "M217 S P R". (Requires SINGLENOZZLE) * M218 - Set/get a tool offset: "M218 T X Y". (Requires 2 or more extruders) * M220 - Set Feedrate Percentage: "M220 S" (i.e., "FR" on the LCD) + * Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires PRUSA_MMU2) * M221 - Set Flow Percentage: "M221 S" * M226 - Wait until a pin is in a given state: "M226 P S" * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE) @@ -212,6 +214,7 @@ * M422 - Set Z Stepper automatic alignment position using probe. X Y A (Requires Z_STEPPER_AUTO_ALIGN) * M425 - Enable/Disable and tune backlash correction. (Requires BACKLASH_COMPENSATION and BACKLASH_GCODE) * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA) + * M486 - Identify and cancel objects. (Requires CANCEL_OBJECTS) * 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! ** @@ -228,7 +231,7 @@ * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS) - * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.) + * M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below) * 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. * M861 - Report the status of position encoder modules. @@ -274,7 +277,6 @@ * T0-T3 - Select an extruder (tool) by index: "T F" * */ -#pragma once #include "../inc/MarlinConfig.h" #include "parser.h" @@ -283,12 +285,31 @@ #include "../feature/I2CPositionEncoder.h" #endif +enum AxisRelative : uint8_t { REL_X, REL_Y, REL_Z, REL_E, E_MODE_ABS, E_MODE_REL }; + class GcodeSuite { public: - GcodeSuite() {} - - static bool axis_relative_modes[]; + static uint8_t axis_relative; + + static inline bool axis_is_relative(const AxisEnum a) { + if (a == E_AXIS) { + if (TEST(axis_relative, E_MODE_REL)) return true; + if (TEST(axis_relative, E_MODE_ABS)) return false; + } + return TEST(axis_relative, a); + } + static inline void set_relative_mode(const bool rel) { + axis_relative = rel ? _BV(REL_X) | _BV(REL_Y) | _BV(REL_Z) | _BV(REL_E) : 0; + } + static inline void set_e_relative() { + CBI(axis_relative, E_MODE_ABS); + SBI(axis_relative, E_MODE_REL); + } + static inline void set_e_absolute() { + CBI(axis_relative, E_MODE_REL); + SBI(axis_relative, E_MODE_ABS); + } #if ENABLED(CNC_WORKSPACE_PLANES) /** @@ -302,7 +323,7 @@ class GcodeSuite { #define MAX_COORDINATE_SYSTEMS 9 #if ENABLED(CNC_COORDINATE_SYSTEMS) static int8_t active_coordinate_system; - static float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; + static xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS]; static bool select_coordinate_system(const int8_t _new); #endif @@ -320,7 +341,10 @@ class GcodeSuite { static void process_subcommands_now_P(PGM_P pgcode); static void process_subcommands_now(char * gcode); - static inline void home_all_axes() { process_subcommands_now_P(PSTR("G28")); } + static inline void home_all_axes() { + extern const char G28_STR[]; + process_subcommands_now_P(G28_STR); + } #if ENABLED(HOST_KEEPALIVE_FEATURE) /** @@ -351,7 +375,7 @@ class GcodeSuite { static void G0_G1( #if IS_SCARA || defined(G0_FEEDRATE) - bool fast_move=false + const bool fast_move=false #endif ); @@ -473,6 +497,10 @@ class GcodeSuite { static void M12(); #endif + #if ENABLED(EXPECTED_PRINTER_CHECK) + static void M16(); + #endif + static void M17(); static void M18_M84(); @@ -525,7 +553,7 @@ class GcodeSuite { static void M78(); #endif - #if HAS_POWER_SWITCH + #if ENABLED(PSU_CONTROL) static void M80(); #endif @@ -539,10 +567,17 @@ class GcodeSuite { static void M100(); #endif - static void M104(); + #if EXTRUDERS + static void M104(); + static void M109(); + #endif + static void M105(); - static void M106(); - static void M107(); + + #if FAN_COUNT > 0 + static void M106(); + static void M107(); + #endif #if DISABLED(EMERGENCY_PARSER) static void M108(); @@ -553,8 +588,6 @@ class GcodeSuite { #endif #endif - static void M109(); - static void M110(); static void M111(); @@ -592,10 +625,10 @@ class GcodeSuite { #if HAS_HEATED_CHAMBER static void M141(); - //static void M191(); + static void M191(); #endif - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU static void M145(); #endif @@ -656,7 +689,11 @@ class GcodeSuite { #endif static void M220(); - static void M221(); + + #if EXTRUDERS + static void M221(); + #endif + static void M226(); #if ENABLED(PHOTO_GCODE) @@ -764,6 +801,10 @@ class GcodeSuite { static void M428(); #endif + #if ENABLED(CANCEL_OBJECTS) + static void M486(); + #endif + static void M500(); static void M501(); static void M502(); @@ -782,6 +823,10 @@ class GcodeSuite { static void M540(); #endif + #if ENABLED(BAUD_RATE_GCODE) + static void M575(); + #endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) static void M600(); static void M603(); diff --git a/Marlin/src/gcode/geometry/G53-G59.cpp b/Marlin/src/gcode/geometry/G53-G59.cpp index 813c026e7502..38f72ae62e7d 100644 --- a/Marlin/src/gcode/geometry/G53-G59.cpp +++ b/Marlin/src/gcode/geometry/G53-G59.cpp @@ -27,23 +27,21 @@ #include "../../module/stepper.h" +//#define DEBUG_M53 + /** * Select a coordinate system and update the workspace offset. * System index -1 is used to specify machine-native. */ bool GcodeSuite::select_coordinate_system(const int8_t _new) { if (active_coordinate_system == _new) return false; - planner.synchronize(); - float old_offset[XYZ] = { 0 }, new_offset[XYZ] = { 0 }; - if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1)) - COPY(old_offset, coordinate_system[active_coordinate_system]); - if (WITHIN(_new, 0, MAX_COORDINATE_SYSTEMS - 1)) - COPY(new_offset, coordinate_system[_new]); active_coordinate_system = _new; + xyz_float_t new_offset{0}; + if (WITHIN(_new, 0, MAX_COORDINATE_SYSTEMS - 1)) + new_offset = coordinate_system[_new]; LOOP_XYZ(i) { - const float diff = new_offset[i] - old_offset[i]; - if (diff) { - position_shift[i] += diff; + if (position_shift[i] != new_offset[i]) { + position_shift[i] = new_offset[i]; update_workspace_offset((AxisEnum)i); } } @@ -60,11 +58,20 @@ bool GcodeSuite::select_coordinate_system(const int8_t _new) { * Marlin also uses G53 on a line by itself to go back to native space. */ void GcodeSuite::G53() { - const int8_t _system = active_coordinate_system; - active_coordinate_system = -1; - if (parser.chain()) { // If this command has more following... - process_parsed_command(); - active_coordinate_system = _system; + const int8_t old_system = active_coordinate_system; + select_coordinate_system(-1); // Always remove workspace offsets + #ifdef DEBUG_M53 + SERIAL_ECHOLNPGM("Go to native space"); + report_current_position(); + #endif + + if (parser.chain()) { // Command to chain? + process_parsed_command(); // ...process the chained command + select_coordinate_system(old_system); + #ifdef DEBUG_M53 + SERIAL_ECHOLNPAIR("Go back to workspace ", old_system); + report_current_position(); + #endif } } diff --git a/Marlin/src/gcode/geometry/G92.cpp b/Marlin/src/gcode/geometry/G92.cpp index 9304274520ee..2f69654b0e5c 100644 --- a/Marlin/src/gcode/geometry/G92.cpp +++ b/Marlin/src/gcode/geometry/G92.cpp @@ -33,12 +33,7 @@ */ void GcodeSuite::G92() { - bool didE = false; - #if IS_SCARA || !HAS_POSITION_SHIFT - bool didXYZ = false; - #else - constexpr bool didXYZ = false; - #endif + bool sync_E = false, sync_XYZ = false; #if USE_GCODE_SUBCODES const uint8_t subcode_G92 = parser.subcode; @@ -52,12 +47,9 @@ void GcodeSuite::G92() { case 1: { // Zero the G92 values and restore current position #if !IS_SCARA - LOOP_XYZ(i) { - const float v = position_shift[i]; - if (v) { - position_shift[i] = 0; - update_workspace_offset((AxisEnum)i); - } + LOOP_XYZ(i) if (position_shift[i]) { + position_shift[i] = 0; + update_workspace_offset((AxisEnum)i); } #endif // Not SCARA } return; @@ -67,11 +59,7 @@ void GcodeSuite::G92() { LOOP_XYZE(i) { if (parser.seenval(axis_codes[i])) { current_position[i] = parser.value_axis_units((AxisEnum)i); - #if IS_SCARA || !HAS_POSITION_SHIFT - if (i == E_AXIS) didE = true; else didXYZ = true; - #elif HAS_POSITION_SHIFT - if (i == E_AXIS) didE = true; - #endif + if (i == E_AXIS) sync_E = true; else sync_XYZ = true; } } } break; @@ -84,12 +72,12 @@ void GcodeSuite::G92() { d = v - current_position[i]; if (!NEAR_ZERO(d)) { #if IS_SCARA || !HAS_POSITION_SHIFT - if (i == E_AXIS) didE = true; else didXYZ = true; + if (i == E_AXIS) sync_E = true; else sync_XYZ = true; current_position[i] = v; // Without workspaces revert to Marlin 1.0 behavior #elif HAS_POSITION_SHIFT if (i == E_AXIS) { - didE = true; - current_position[E_AXIS] = v; // When using coordinate spaces, only E is set directly + sync_E = true; + current_position.e = v; // When using coordinate spaces, only E is set directly } else { position_shift[i] += d; // Other axes simply offset the coordinate space @@ -105,11 +93,11 @@ void GcodeSuite::G92() { #if ENABLED(CNC_COORDINATE_SYSTEMS) // Apply workspace offset to the active coordinate system if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1)) - COPY(coordinate_system[active_coordinate_system], position_shift); + coordinate_system[active_coordinate_system] = position_shift; #endif - if (didXYZ) sync_plan_position(); - else if (didE) sync_plan_position_e(); + if (sync_XYZ) sync_plan_position(); + else if (sync_E) sync_plan_position_e(); report_current_position(); } diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index f2d166e0a899..6e2b46081c34 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -63,14 +63,14 @@ void GcodeSuite::M206() { void GcodeSuite::M428() { if (axis_unhomed_error()) return; - float diff[XYZ]; + xyz_float_t diff; LOOP_XYZ(i) { diff[i] = base_home_pos((AxisEnum)i) - current_position[i]; if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0) diff[i] = -current_position[i]; if (!WITHIN(diff[i], -20, 20)) { SERIAL_ERROR_MSG(MSG_ERR_M428_TOO_FAR); - LCD_ALERTMESSAGEPGM("Err: Too far!"); + LCD_ALERTMESSAGEPGM_P(PSTR("Err: Too far!")); BUZZ(200, 40); return; } diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 1a53406288e1..68cbd2b8a478 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -31,38 +31,43 @@ #if HAS_DRIVER(L6470) //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\gcode\host\M114.cpp //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\module\bob_L6470.cpp - #include "../../module/L6470/L6470_Marlin.h" + #include "../../libs/L6470/L6470_Marlin.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../core/debug_out.h" #endif - void report_xyze(const float pos[], const uint8_t n = 4, const uint8_t precision = 3) { + void report_xyze(const xyze_pos_t &pos, const uint8_t n=4, const uint8_t precision=3) { char str[12]; - for (uint8_t i = 0; i < n; i++) { + for (uint8_t a = 0; a < n; a++) { SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[i]); + SERIAL_CHAR(axis_codes[a]); SERIAL_CHAR(':'); - SERIAL_ECHO(dtostrf(pos[i], 8, precision, str)); + SERIAL_ECHO(dtostrf(pos[a], 1, precision, str)); } SERIAL_EOL(); } - inline void report_xyz(const float pos[]) { report_xyze(pos, 3); } + void report_xyz(const xyz_pos_t &pos, const uint8_t precision=3) { + char str[12]; + for (uint8_t a = X_AXIS; a <= Z_AXIS; a++) { + SERIAL_CHAR(' '); + SERIAL_CHAR(axis_codes[a]); + SERIAL_CHAR(':'); + SERIAL_ECHO(dtostrf(pos[a], 1, precision, str)); + } + SERIAL_EOL(); + } + inline void report_xyz(const xyze_pos_t &pos) { report_xyze(pos, 3); } void report_current_position_detail() { SERIAL_ECHOPGM("\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_xyz(current_position.asLogical()); SERIAL_ECHOPGM("Raw: "); report_xyz(current_position); - float leveled[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; + xyze_pos_t leveled = current_position; #if HAS_LEVELING SERIAL_ECHOPGM("Leveled:"); @@ -70,7 +75,7 @@ report_xyz(leveled); SERIAL_ECHOPGM("UnLevel:"); - float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] }; + xyze_pos_t unleveled = leveled; planner.unapply_leveling(unleveled); report_xyz(unleveled); #endif @@ -153,7 +158,7 @@ SERIAL_EOL(); #if IS_SCARA - const float deg[XYZ] = { + const xy_float_t deg = { planner.get_axis_position_degrees(A_AXIS), planner.get_axis_position_degrees(B_AXIS) }; @@ -162,17 +167,12 @@ #endif SERIAL_ECHOPGM("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) }; + get_cartesian_from_steppers(); // writes 'cartes' (with forward kinematics) + xyze_pos_t from_steppers = { cartes.x, cartes.y, cartes.z, planner.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_AXIS] - current_position[E_AXIS] - }; - SERIAL_ECHOPGM("Differ: "); + const xyze_float_t diff = from_steppers - leveled; + SERIAL_ECHOPGM("Diff: "); report_xyze(diff); } @@ -188,6 +188,10 @@ void GcodeSuite::M114() { report_current_position_detail(); return; } + if (parser.seen('E')) { + SERIAL_ECHOLNPAIR("Count E:", stepper.position(E_AXIS)); + return; + } #endif planner.synchronize(); diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index eb32119ef9cc..8871644ff132 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -112,7 +112,7 @@ void GcodeSuite::M115() { // SOFTWARE_POWER (M80, M81) cap_line(PSTR("SOFTWARE_POWER") - #if HAS_POWER_SWITCH + #if ENABLED(PSU_CONTROL) , true #endif ); diff --git a/Marlin/src/gcode/host/M118.cpp b/Marlin/src/gcode/host/M118.cpp index 7655a27f15fb..3d8a84fb5f7c 100644 --- a/Marlin/src/gcode/host/M118.cpp +++ b/Marlin/src/gcode/host/M118.cpp @@ -21,24 +21,55 @@ */ #include "../gcode.h" +#include "../../core/serial.h" /** * M118: Display a message in the host console. * * A1 Prepend '// ' for an action command, as in OctoPrint * E1 Have the host 'echo:' the text + * Pn Redirect to another serial port + * 0 : Announce to all ports + * 1-9 : Serial ports 1 to 9 */ void GcodeSuite::M118() { bool hasE = false, hasA = false; + #if NUM_SERIAL > 1 + int8_t port = -1; // Assume no redirect + #endif 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; + for (uint8_t i = 3; i--;) { + // A1, E1, and Pn are always parsed out + if (!( ((p[0] == 'A' || p[0] == 'E') && p[1] == '1') || (p[0] == 'P' && NUMERIC(p[1])) )) break; + switch (p[0]) { + case 'A': hasA = true; break; + case 'E': hasE = true; break; + #if NUM_SERIAL > 1 + case 'P': port = p[1] - '0'; break; + #endif } + p += 2; + while (*p == ' ') ++p; + } + + #if NUM_SERIAL > 1 + const int8_t old_serial = serial_port_index; + if (WITHIN(port, 0, NUM_SERIAL)) + serial_port_index = ( + port == 0 ? SERIAL_BOTH + : port == 1 ? SERIAL_PORT + #ifdef SERIAL_PORT_2 + : port == 2 ? SERIAL_PORT_2 + #endif + : SERIAL_PORT + ); + #endif + if (hasE) SERIAL_ECHO_START(); if (hasA) SERIAL_ECHOPGM("// "); SERIAL_ECHOLN(p); + + #if NUM_SERIAL > 1 + serial_port_index = old_serial; + #endif } diff --git a/Marlin/src/gcode/host/M119.cpp b/Marlin/src/gcode/host/M119.cpp index ec7dde7fcca8..a13fa67b7946 100644 --- a/Marlin/src/gcode/host/M119.cpp +++ b/Marlin/src/gcode/host/M119.cpp @@ -28,6 +28,6 @@ */ void GcodeSuite::M119() { - endstops.M119(); + endstops.report_states(); } diff --git a/Marlin/src/gcode/host/M16.cpp b/Marlin/src/gcode/host/M16.cpp new file mode 100644 index 000000000000..921915501165 --- /dev/null +++ b/Marlin/src/gcode/host/M16.cpp @@ -0,0 +1,40 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(EXPECTED_PRINTER_CHECK) + +#include "../gcode.h" +#include "../../Marlin.h" + +/** + * M16: Expected Printer Check + */ +void GcodeSuite::M16() { + + if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME))) + kill(GET_TEXT(MSG_EXPECTED_PRINTER)); + +} + +#endif diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 3bbf32991890..5bf9e94325df 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -80,7 +80,10 @@ void GcodeSuite::M0_M1() { #elif ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired(has_message ? args : MSG_USERWAIT); // SRAM string + if (has_message) + ExtUI::onUserConfirmRequired(args); // Can this take an SRAM string?? + else + ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT)); #else @@ -95,7 +98,7 @@ void GcodeSuite::M0_M1() { wait_for_user = true; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), CONTINUE_STR); #endif if (ms > 0) { @@ -105,10 +108,6 @@ void GcodeSuite::M0_M1() { else while (wait_for_user) idle(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onUserConfirmRequired(nullptr); - #endif - #if HAS_LEDS_OFF_FLAG printerEventLEDs.onResumeAfterWait(); #endif diff --git a/Marlin/src/gcode/lcd/M117.cpp b/Marlin/src/gcode/lcd/M117.cpp index 19cbbc258096..118b55fe3754 100644 --- a/Marlin/src/gcode/lcd/M117.cpp +++ b/Marlin/src/gcode/lcd/M117.cpp @@ -28,6 +28,9 @@ */ void GcodeSuite::M117() { - ui.set_status(parser.string_arg); + if (parser.string_arg && parser.string_arg[0]) + ui.set_status(parser.string_arg); + else + ui.reset_status(); } diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index 693a32d242c6..297ece268e0d 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if HAS_LCD_MENU +#if HOTENDS && HAS_LCD_MENU #include "../gcode.h" #include "../../lcd/ultralcd.h" @@ -58,4 +58,4 @@ void GcodeSuite::M145() { } } -#endif // HAS_LCD_MENU +#endif // HOTENDS && HAS_LCD_MENU diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index 4ed7559835d5..14d4d63813e5 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && EITHER(EXTENSIBLE_UI, ULTRA_LCD) +#if ENABLED(LCD_SET_PROGRESS_MANUALLY) #include "../gcode.h" #include "../../lcd/ultralcd.h" @@ -38,8 +38,14 @@ * This has no effect during an SD print job */ void GcodeSuite::M73() { - if (parser.seen('P') && !IS_SD_PRINTING()) - ui.set_progress(parser.value_byte()); + if (parser.seen('P')) + ui.set_progress((PROGRESS_SCALE) > 1 + ? parser.value_float() * (PROGRESS_SCALE) + : parser.value_byte() + ); + #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) + if (parser.seen('R')) ui.set_remaining_time(60 * parser.value_ulong()); + #endif } -#endif // LCD_SET_PROGRESS_MANUALLY && (EXTENSIBLE_UI || ULTRA_LCD) +#endif // LCD_SET_PROGRESS_MANUALLY diff --git a/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin/src/gcode/motion/G0_G1.cpp index 8d88ac91dd60..36bc29026ef7 100644 --- a/Marlin/src/gcode/motion/G0_G1.cpp +++ b/Marlin/src/gcode/motion/G0_G1.cpp @@ -35,10 +35,10 @@ #include "../../module/stepper.h" #endif -extern float destination[XYZE]; +extern xyze_pos_t destination; #if ENABLED(VARIABLE_G0_FEEDRATE) - float saved_g0_feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); + feedRate_t fast_move_feedrate = MMM_TO_MMS(G0_FEEDRATE); #endif /** @@ -46,34 +46,37 @@ extern float destination[XYZE]; */ void GcodeSuite::G0_G1( #if IS_SCARA || defined(G0_FEEDRATE) - bool fast_move/*=false*/ + const bool fast_move/*=false*/ #endif ) { if (IsRunning() #if ENABLED(NO_MOTION_BEFORE_HOMING) - && !axis_unhomed_error(parser.seen('X'), parser.seen('Y'), parser.seen('Z')) + && !axis_unhomed_error( + (parser.seen('X') ? _BV(X_AXIS) : 0) + | (parser.seen('Y') ? _BV(Y_AXIS) : 0) + | (parser.seen('Z') ? _BV(Z_AXIS) : 0) ) #endif ) { #ifdef G0_FEEDRATE - float saved_feedrate_mm_s; + feedRate_t old_feedrate; #if ENABLED(VARIABLE_G0_FEEDRATE) if (fast_move) { - saved_feedrate_mm_s = feedrate_mm_s; // Back up the (old) motion mode feedrate - feedrate_mm_s = saved_g0_feedrate_mm_s; // Get G0 feedrate from last usage + old_feedrate = feedrate_mm_s; // Back up the (old) motion mode feedrate + feedrate_mm_s = fast_move_feedrate; // Get G0 feedrate from last usage } #endif #endif - get_destination_from_command(); // For X Y Z E F + get_destination_from_command(); // Process X Y Z E F parameters #ifdef G0_FEEDRATE if (fast_move) { #if ENABLED(VARIABLE_G0_FEEDRATE) - saved_g0_feedrate_mm_s = feedrate_mm_s; // Save feedrate for the next G0 + fast_move_feedrate = feedrate_mm_s; // Save feedrate for the next G0 #else - saved_feedrate_mm_s = feedrate_mm_s; // Back up the (new) motion mode feedrate + old_feedrate = feedrate_mm_s; // Back up the (new) motion mode feedrate feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); // Get the fixed G0 feedrate #endif } @@ -84,12 +87,12 @@ void GcodeSuite::G0_G1( if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { // When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves if (fwretract.autoretract_enabled && parser.seen('E') && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z'))) { - const float echange = destination[E_AXIS] - current_position[E_AXIS]; + const float echange = destination.e - current_position.e; // Is this a retract or recover move? if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.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/recover (double-retract ignored) + current_position.e = destination.e; // 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/recover (double-retract ignored) } } } @@ -97,14 +100,14 @@ void GcodeSuite::G0_G1( #endif // FWRETRACT #if IS_SCARA - fast_move ? prepare_uninterpolated_move_to_destination() : prepare_move_to_destination(); + fast_move ? prepare_fast_move_to_destination() : prepare_move_to_destination(); #else prepare_move_to_destination(); #endif #ifdef G0_FEEDRATE // Restore the motion mode feedrate - if (fast_move) feedrate_mm_s = saved_feedrate_mm_s; + if (fast_move) feedrate_mm_s = old_feedrate; #endif #if ENABLED(NANODLP_Z_SYNC) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 030675c230a7..6fecbdc0cced 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -50,38 +50,38 @@ * options for G2/G3 arc generation. In future these options may be GCode tunable. */ void plan_arc( - const float (&cart)[XYZE], // Destination position - const float (&offset)[2], // Center of rotation relative to current_position - const uint8_t clockwise // Clockwise? + const xyze_pos_t &cart, // Destination position + const ab_float_t &offset, // Center of rotation relative to current_position + const uint8_t clockwise // Clockwise? ) { #if ENABLED(CNC_WORKSPACE_PLANES) AxisEnum p_axis, q_axis, l_axis; switch (gcode.workspace_plane) { default: case GcodeSuite::PLANE_XY: p_axis = X_AXIS; q_axis = Y_AXIS; l_axis = Z_AXIS; break; - case GcodeSuite::PLANE_ZX: p_axis = Z_AXIS; q_axis = X_AXIS; l_axis = Y_AXIS; break; case GcodeSuite::PLANE_YZ: p_axis = Y_AXIS; q_axis = Z_AXIS; l_axis = X_AXIS; break; + case GcodeSuite::PLANE_ZX: p_axis = Z_AXIS; q_axis = X_AXIS; l_axis = Y_AXIS; break; } #else constexpr AxisEnum p_axis = X_AXIS, q_axis = Y_AXIS, l_axis = Z_AXIS; #endif // Radius vector from center to current location - float r_P = -offset[0], r_Q = -offset[1]; + ab_float_t rvec = -offset; - const float radius = HYPOT(r_P, r_Q), + const float radius = HYPOT(rvec.a, rvec.b), #if ENABLED(AUTO_BED_LEVELING_UBL) start_L = current_position[l_axis], #endif - center_P = current_position[p_axis] - r_P, - center_Q = current_position[q_axis] - r_Q, + center_P = current_position[p_axis] - rvec.a, + center_Q = current_position[q_axis] - rvec.b, 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_AXIS] - current_position[E_AXIS]; + extruder_travel = cart.e - current_position.e; // 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); + float angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y); if (angular_travel < 0) angular_travel += RADIANS(360); #ifdef MIN_ARC_SEGMENTS uint16_t min_segments = CEIL((MIN_ARC_SEGMENTS) * (angular_travel / RADIANS(360))); @@ -133,7 +133,7 @@ void plan_arc( * This is important when there are successive arc motions. */ // Vector rotation matrix values - float raw[XYZE]; + xyze_pos_t raw; const float theta_per_segment = angular_travel / segments, linear_per_segment = linear_travel / segments, extruder_per_segment = extruder_travel / segments, @@ -144,12 +144,12 @@ void plan_arc( raw[l_axis] = current_position[l_axis]; // Initialize the extruder axis - raw[E_AXIS] = current_position[E_AXIS]; + raw.e = current_position.e; - const float fr_mm_s = MMS_SCALED(feedrate_mm_s); + const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = fr_mm_s / MM_PER_ARC_SEGMENT; + const float inv_duration = scaled_fr_mm_s / MM_PER_ARC_SEGMENT; #endif millis_t next_idle_ms = millis() + 200UL; @@ -168,10 +168,10 @@ void plan_arc( #if N_ARC_CORRECTION > 1 if (--arc_recalc_count) { - // Apply vector rotation matrix to previous r_P / 1 - const float r_new_Y = r_P * sin_T + r_Q * cos_T; - r_P = r_P * cos_T - r_Q * sin_T; - r_Q = r_new_Y; + // Apply vector rotation matrix to previous rvec.a / 1 + const float r_new_Y = rvec.a * sin_T + rvec.b * cos_T; + rvec.a = rvec.a * cos_T - rvec.b * sin_T; + rvec.b = r_new_Y; } else #endif @@ -185,20 +185,20 @@ void plan_arc( // To reduce stuttering, the sin and cos could be computed at different times. // For now, compute both at the same time. const float cos_Ti = cos(i * theta_per_segment), sin_Ti = sin(i * theta_per_segment); - r_P = -offset[0] * cos_Ti + offset[1] * sin_Ti; - r_Q = -offset[0] * sin_Ti - offset[1] * cos_Ti; + rvec.a = -offset[0] * cos_Ti + offset[1] * sin_Ti; + rvec.b = -offset[0] * sin_Ti - offset[1] * cos_Ti; } // Update raw location - raw[p_axis] = center_P + r_P; - raw[q_axis] = center_Q + r_Q; + raw[p_axis] = center_P + rvec.a; + raw[q_axis] = center_Q + rvec.b; #if ENABLED(AUTO_BED_LEVELING_UBL) raw[l_axis] = start_L; UNUSED(linear_per_segment); #else raw[l_axis] += linear_per_segment; #endif - raw[E_AXIS] += extruder_per_segment; + raw.e += extruder_per_segment; apply_motion_limits(raw); @@ -206,7 +206,7 @@ void plan_arc( planner.apply_leveling(raw); #endif - if (!planner.buffer_line(raw, fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT + if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -215,16 +215,18 @@ void plan_arc( } // Ensure last segment arrives at target location. - COPY(raw, cart); + raw = cart; #if ENABLED(AUTO_BED_LEVELING_UBL) raw[l_axis] = start_L; #endif + apply_motion_limits(raw); + #if HAS_LEVELING && !PLANNER_LEVELING planner.apply_leveling(raw); #endif - planner.buffer_line(raw, fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT + planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -233,26 +235,27 @@ void plan_arc( #if ENABLED(AUTO_BED_LEVELING_UBL) raw[l_axis] = start_L; #endif - COPY(current_position, raw); + current_position = raw; } // plan_arc /** * G2: Clockwise Arc * G3: Counterclockwise Arc * - * This command has two forms: IJ-form and R-form. + * This command has two forms: IJ-form (JK, KI) and R-form. * - * - I specifies an X offset. J specifies a Y offset. - * At least one of the IJ parameters is required. - * X and Y can be omitted to do a complete circle. - * The given XY is not error-checked. The arc ends - * based on the angle of the destination. - * Mixing I or J with R will throw an error. + * - Depending on the current Workspace Plane orientation, + * use parameters IJ/JK/KI to specify the XY/YZ/ZX offsets. + * At least one of the IJ/JK/KI parameters is required. + * XY/YZ/ZX can be omitted to do a complete circle. + * The given XY/YZ/ZX is not error-checked. The arc ends + * based on the angle of the destination. + * Mixing IJ/JK/KI with R will throw an error. * - * - R specifies the radius. X or Y is required. - * Omitting both X and Y will throw an error. - * X or Y must differ from the current XY. - * Mixing R with I or J will throw an error. + * - R specifies the radius. X or Y (Y or Z / Z or X) is required. + * Omitting both XY/YZ/ZX will throw an error. + * XY/YZ/ZX must differ from the current XY/YZ/ZX. + * Mixing R with IJ/JK/KI will throw an error. * * - P specifies the number of full circles to do * before the specified arc move. @@ -276,30 +279,39 @@ void GcodeSuite::G2_G3(const bool clockwise) { relative_mode = relative_mode_backup; #endif - float arc_offset[2] = { 0, 0 }; + ab_float_t arc_offset = { 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 - dinv = 1/d, // Inverse of d - 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 * dinv, sy = dx * dinv, // 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; + const float r = parser.value_linear_units(); + if (r) { + const xy_pos_t p1 = current_position, p2 = destination; + if (p1 != p2) { + const xy_pos_t d2 = (p2 - p1) * 0.5f; // XY vector to midpoint of move from current + const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 + len = d2.magnitude(), // Distance to mid-point of move from current + h2 = (r - len) * (r + len), // factored to reduce rounding error + h = (h2 >= 0) ? SQRT(h2) : 0.0f; // Distance to the arc pivot-point from midpoint + const xy_pos_t s = { -d2.y, d2.x }; // Perpendicular bisector. (Divide by len for unit vector.) + arc_offset = d2 + s / len * e * h; // The calculated offset (mid-point if |r| <= len) + } } } else { - if (parser.seenval('I')) arc_offset[0] = parser.value_linear_units(); - if (parser.seenval('J')) arc_offset[1] = parser.value_linear_units(); + #if ENABLED(CNC_WORKSPACE_PLANES) + char achar, bchar; + switch (gcode.workspace_plane) { + default: + case GcodeSuite::PLANE_XY: achar = 'I'; bchar = 'J'; break; + case GcodeSuite::PLANE_YZ: achar = 'J'; bchar = 'K'; break; + case GcodeSuite::PLANE_ZX: achar = 'K'; bchar = 'I'; break; + } + #else + constexpr char achar = 'I', bchar = 'J'; + #endif + if (parser.seenval(achar)) arc_offset.a = parser.value_linear_units(); + if (parser.seenval(bchar)) arc_offset.b = parser.value_linear_units(); } - if (arc_offset[0] || arc_offset[1]) { + if (arc_offset) { #if ENABLED(ARC_P_CIRCLES) // P indicates number of circles to do diff --git a/Marlin/src/gcode/motion/G5.cpp b/Marlin/src/gcode/motion/G5.cpp index f392668ced79..7125532e9b9a 100644 --- a/Marlin/src/gcode/motion/G5.cpp +++ b/Marlin/src/gcode/motion/G5.cpp @@ -27,11 +27,6 @@ #include "../../module/motion.h" #include "../../module/planner_bezier.h" -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); -} - /** * Parameters interpreted according to: * http://linuxcnc.org/docs/2.6/html/gcode/parser.html#sec:G5-Cubic-Spline @@ -57,14 +52,13 @@ void GcodeSuite::G5() { get_destination_from_command(); - const float offset[4] = { - parser.linearval('I'), - parser.linearval('J'), - parser.linearval('P'), - parser.linearval('Q') + const xy_pos_t offsets[2] = { + { parser.linearval('I'), parser.linearval('J') }, + { parser.linearval('P'), parser.linearval('Q') } }; - plan_cubic_move(destination, offset); + cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder); + current_position = destination; } } diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index d3eb81a8fc29..e5b5b7e76d7e 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -34,25 +34,29 @@ #include "../../core/serial.h" #endif +#if ENABLED(MESH_BED_LEVELING) + #include "../../feature/bedlevel/bedlevel.h" +#endif + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - FORCE_INLINE void mod_zprobe_zoffset(const float &offs) { + FORCE_INLINE void mod_probe_offset(const float &offs) { if (true #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && active_extruder == 0 #endif ) { - zprobe_zoffset += offs; + probe_offset.z += offs; SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset); + SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", probe_offset.z); } - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - else { - hotend_offset[Z_AXIS][active_extruder] -= offs; + else { + #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) + hotend_offset[active_extruder].z -= offs; SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_Z_OFFSET ": ", hotend_offset[Z_AXIS][active_extruder]); - } - #endif + SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", hotend_offset[active_extruder].z); + #endif + } } #endif @@ -60,13 +64,15 @@ /** * M290: Babystepping * + * Send 'R' or no parameters for a report. + * * X - Distance to step X * Y - Distance to step Y * Z - Distance to step Z * S - Distance to step Z (alias for Z) * * With BABYSTEP_ZPROBE_OFFSET: - * P0 - Don't adjust the Z probe offset. + * P0 - Don't adjust the Z probe offset */ void GcodeSuite::M290() { #if ENABLED(BABYSTEP_XY) @@ -75,7 +81,7 @@ void GcodeSuite::M290() { const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2); babystep.add_mm((AxisEnum)a, offs); #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - if (a == Z_AXIS && (!parser.seen('P') || parser.value_bool())) mod_zprobe_zoffset(offs); + if (a == Z_AXIS && (!parser.seen('P') || parser.value_bool())) mod_probe_offset(offs); #endif } #else @@ -83,10 +89,53 @@ void GcodeSuite::M290() { const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2); babystep.add_mm(Z_AXIS, offs); #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - if (!parser.seen('P') || parser.value_bool()) mod_zprobe_zoffset(offs); + if (!parser.seen('P') || parser.value_bool()) mod_probe_offset(offs); #endif } #endif + + if (!parser.seen("XYZ") || parser.seen('R')) { + SERIAL_ECHO_START(); + + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET " " MSG_Z, probe_offset.z); + #endif + + #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) + { + SERIAL_ECHOLNPAIR_P( + PSTR("Hotend "), int(active_extruder) + #if ENABLED(BABYSTEP_XY) + , PSTR("Offset X"), hotend_offset[active_extruder].x + , SP_Y_STR, hotend_offset[active_extruder].y + , SP_Z_STR + #else + , PSTR("Offset Z") + #endif + , hotend_offset[active_extruder].z + ); + } + #endif + + #if ENABLED(MESH_BED_LEVELING) + SERIAL_ECHOLNPAIR("MBL Adjust Z", mbl.z_offset); + #endif + + #if ENABLED(BABYSTEP_DISPLAY_TOTAL) + { + SERIAL_ECHOLNPAIR_P( + #if ENABLED(BABYSTEP_XY) + PSTR("Babystep X"), babystep.axis_total[X_AXIS] + , SP_Y_STR, babystep.axis_total[Y_AXIS] + , SP_Z_STR + #else + PSTR("Babystep Z") + #endif + , babystep.axis_total[BS_TODO_AXIS(Z_AXIS)] + ); + } + #endif + } } #endif // BABYSTEPPING diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index de87103ff955..bcb3e69e3d7d 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -138,7 +138,9 @@ void GCodeParser::parse(char *p) { switch (letter) { case 'G': case 'M': case 'T': - + #if ENABLED(CANCEL_OBJECTS) + case 'O': + #endif // Skip spaces to get the numeric part while (*p == ' ') p++; @@ -222,13 +224,22 @@ void GCodeParser::parse(char *p) { // Only use string_arg for these M codes if (letter == 'M') switch (codenum) { #if ENABLED(GCODE_MACROS) - case 810: case 811: case 812: case 813: case 814: - case 815: case 816: case 817: case 818: case 819: + case 810 ... 819: + #endif + #if ENABLED(EXPECTED_PRINTER_CHECK) + case 16: #endif case 23: case 28: case 30: case 117: case 118: case 928: string_arg = p; return; default: break; } - +/* + #if ENABLED(CANCEL_OBJECTS) + if (letter == 'O') switch (codenum) { + case 1: string_arg = p; return; + default: break; + } + #endif +*/ #if ENABLED(DEBUG_GCODE_PARSER) const bool debug = codenum == 800; #endif @@ -242,7 +253,7 @@ void GCodeParser::parse(char *p) { * For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A' */ string_arg = nullptr; - while (const char code = *p++) { // Get the next parameter. A NUL ends the loop + 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 diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 8798ed486ab5..2e91216a6402 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -34,6 +34,14 @@ #include "../libs/hex_print_routines.h" #endif +#if ENABLED(TEMPERATURE_UNITS_SUPPORT) + typedef enum : uint8_t { TEMPUNIT_C, TEMPUNIT_K, TEMPUNIT_F } TempUnit; +#endif + +#if ENABLED(INCH_MODE_SUPPORT) + typedef enum : uint8_t { LINEARUNIT_MM, LINEARUNIT_INCH } LinearUnit; +#endif + /** * GCode parser * @@ -254,7 +262,6 @@ class GCodeParser { // Units modes: Inches, Fahrenheit, Kelvin #if ENABLED(INCH_MODE_SUPPORT) - static inline float mm_to_linear_unit(const float mm) { return mm / linear_unit_factor; } static inline float mm_to_volumetric_unit(const float mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } @@ -263,13 +270,9 @@ class GCodeParser { static inline void set_input_linear_units(const LinearUnit units) { switch (units) { - case LINEARUNIT_INCH: - linear_unit_factor = 25.4f; - break; - case LINEARUNIT_MM: default: - linear_unit_factor = 1; - break; + case LINEARUNIT_MM: linear_unit_factor = 1.0f; break; + case LINEARUNIT_INCH: linear_unit_factor = 25.4f; break; } volumetric_unit_factor = POW(linear_unit_factor, 3); } @@ -287,9 +290,9 @@ class GCodeParser { static inline float mm_to_linear_unit(const float mm) { return mm; } static inline float mm_to_volumetric_unit(const float mm) { return mm; } - static inline float linear_value_to_mm(const float v) { return v; } - static inline float axis_value_to_mm(const AxisEnum axis, const float v) { UNUSED(axis); return v; } - static inline float per_axis_value(const AxisEnum axis, const float v) { UNUSED(axis); return v; } + static inline float linear_value_to_mm(const float v) { return v; } + static inline float axis_value_to_mm(const AxisEnum, const float v) { return v; } + static inline float per_axis_value(const AxisEnum, const float v) { return v; } #endif @@ -302,7 +305,7 @@ class GCodeParser { #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; } + static inline void set_input_temp_units(const TempUnit units) { input_temp_units = units; } #if HAS_LCD_MENU && DISABLED(DISABLE_M503) @@ -361,7 +364,7 @@ class GCodeParser { #endif // !TEMPERATURE_UNITS_SUPPORT - static inline float value_feedrate() { return value_linear_units(); } + static inline feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); } void unknown_command_error(); diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 08f978bf93a7..e91e3e9d8ba8 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -39,28 +39,24 @@ * E Engage the probe for each probe (default 1) */ void GcodeSuite::G30() { - const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER), - ypos = parser.linearval('Y', current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER); + const xy_pos_t pos = { parser.linearval('X', current_position.x + probe_offset.x), + parser.linearval('Y', current_position.y + probe_offset.y) }; - if (!position_is_reachable_by_probe(xpos, ypos)) return; + if (!position_is_reachable_by_probe(pos)) return; // Disable leveling so the planner won't mess with us #if HAS_LEVELING set_bed_leveling_enabled(false); #endif - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; - const float measured_z = probe_pt(xpos, ypos, raise_after, 1); + const float measured_z = probe_at_point(pos, raise_after, 1); + if (!isnan(measured_z)) + SERIAL_ECHOLNPAIR("Bed X: ", FIXFLOAT(pos.x), " Y: ", FIXFLOAT(pos.y), " Z: ", FIXFLOAT(measured_z)); - if (!isnan(measured_z)) { - SERIAL_ECHOPAIR("Bed X: ", FIXFLOAT(xpos)); - SERIAL_ECHOPAIR(" Y: ", FIXFLOAT(ypos)); - SERIAL_ECHOLNPAIR(" Z: ", FIXFLOAT(measured_z)); - } - - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); #ifdef Z_AFTER_PROBING if (raise_after == PROBE_PT_STOW) move_z_after_probing(); diff --git a/Marlin/src/gcode/probe/G38.cpp b/Marlin/src/gcode/probe/G38.cpp index 14445213508e..cb298bcccb28 100644 --- a/Marlin/src/gcode/probe/G38.cpp +++ b/Marlin/src/gcode/probe/G38.cpp @@ -48,7 +48,7 @@ inline bool G38_run_probe() { #if MULTIPLE_PROBING > 1 // Get direction of move and retract - float retract_mm[XYZ]; + xyz_float_t retract_mm; LOOP_XYZ(i) { const 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); @@ -75,8 +75,7 @@ inline bool G38_run_probe() { #if MULTIPLE_PROBING > 1 // Move away by the retract distance - set_destination_from_current(); - LOOP_XYZ(i) destination[i] += retract_mm[i]; + destination = current_position + retract_mm; endstops.enable(false); prepare_move_to_destination(); planner.synchronize(); @@ -84,7 +83,7 @@ inline bool G38_run_probe() { REMEMBER(fr, feedrate_mm_s, feedrate_mm_s * 0.25); // Bump the target more slowly - LOOP_XYZ(i) destination[i] -= retract_mm[i] * 2; + destination -= retract_mm * 2; G38_single_probe(move_value); #endif @@ -109,7 +108,7 @@ void GcodeSuite::G38(const int8_t subcode) { // Get X Y Z E F get_destination_from_command(); - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); const bool error_on_fail = #if ENABLED(G38_PROBE_AWAY) @@ -128,7 +127,7 @@ void GcodeSuite::G38(const int8_t subcode) { break; } - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); } #endif // G38_PROBE_TARGET diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index 6ab53f9f77d0..431fe6fa0914 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -28,17 +28,55 @@ #include "../../feature/bedlevel/bedlevel.h" #include "../../module/probe.h" +extern const char SP_Y_STR[], SP_Z_STR[]; + +/** + * M851: Set the nozzle-to-probe offsets in current units + */ void GcodeSuite::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_MSG("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")"); + + // Show usage with no parameters + if (!parser.seen("XYZ")) { + SERIAL_ECHOLNPAIR_P(PSTR(MSG_PROBE_OFFSET " X"), probe_offset.x, SP_Y_STR, probe_offset.y, SP_Z_STR, probe_offset.z); return; } - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset); + + xyz_pos_t offs = probe_offset; + + bool ok = true; + + if (parser.seenval('X')) { + const float x = parser.value_float(); + if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE)) + offs.x = x; + else { + SERIAL_ECHOLNPAIR("?X out of range (-", int(X_BED_SIZE), " to ", int(X_BED_SIZE), ")"); + ok = false; + } + } + + if (parser.seenval('Y')) { + const float y = parser.value_float(); + if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE)) + offs.y = y; + else { + SERIAL_ECHOLNPAIR("?Y out of range (-", int(Y_BED_SIZE), " to ", int(Y_BED_SIZE), ")"); + ok = false; + } + } + + if (parser.seenval('Z')) { + const float z = parser.value_float(); + if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + offs.z = z; + else { + SERIAL_ECHOLNPAIR("?Z out of range (", int(Z_PROBE_OFFSET_RANGE_MIN), " to ", int(Z_PROBE_OFFSET_RANGE_MAX), ")"); + ok = false; + } + } + + // Save the new offsets + if (ok) probe_offset = offs; } #endif // HAS_BED_PROBE diff --git a/Marlin/src/gcode/probe/M951.cpp b/Marlin/src/gcode/probe/M951.cpp index 3e27a7397fd7..d8d2e8f8e0cd 100644 --- a/Marlin/src/gcode/probe/M951.cpp +++ b/Marlin/src/gcode/probe/M951.cpp @@ -28,11 +28,10 @@ #include "../../module/tool_change.h" #include "../../module/motion.h" - mpe_settings_t mpe_settings; inline void mpe_settings_report() { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Magnetic Parking Extruder"); + SERIAL_ECHO_MSG("Magnetic Parking Extruder"); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("L: Left parking :", mpe_settings.parking_xpos[0]); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("R: Right parking :", mpe_settings.parking_xpos[1]); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("I: Grab Offset :", mpe_settings.grab_distance); diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index d519378a2969..a9bd714c1e38 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -39,6 +39,14 @@ GCodeQueue queue; #include "../feature/leds/printer_event_leds.h" #endif +#if ENABLED(BINARY_FILE_TRANSFER) + #include "../feature/binary_protocol.h" +#endif + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../feature/power_loss_recovery.h" +#endif + /** * GCode line number handling. Hosts may opt to include line numbers when * sending commands to Marlin, and lines will be checked for sequentiality. @@ -59,7 +67,7 @@ uint8_t GCodeQueue::length = 0, // Count of commands in the queue GCodeQueue::index_r = 0, // Ring buffer read position GCodeQueue::index_w = 0; // Ring buffer write position -char GCodeQueue::buffer[BUFSIZE][MAX_CMD_SIZE]; +char GCodeQueue::command_buffer[BUFSIZE][MAX_CMD_SIZE]; /* * The port that the command was received on @@ -115,6 +123,9 @@ void GCodeQueue::_commit_command(bool say_ok #if NUM_SERIAL > 1 port[index_w] = p; #endif + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.commit_sdpos(index_w); + #endif if (++index_w >= BUFSIZE) index_w = 0; length++; } @@ -130,7 +141,7 @@ bool GCodeQueue::_enqueue(const char* cmd, bool say_ok/*=false*/ #endif ) { if (*cmd == ';' || length >= BUFSIZE) return false; - strcpy(buffer[index_w], cmd); + strcpy(command_buffer[index_w], cmd); _commit_command(say_ok #if NUM_SERIAL > 1 , pn @@ -170,16 +181,19 @@ bool GCodeQueue::process_injected_command() { char c; size_t i = 0; while ((c = pgm_read_byte(&injected_commands_P[i])) && c != '\n') i++; - if (i) { - char cmd[i + 1]; - memcpy_P(cmd, injected_commands_P, i); - cmd[i] = '\0'; + // Extract current command and move pointer to next command + char cmd[i + 1]; + memcpy_P(cmd, injected_commands_P, i); + cmd[i] = '\0'; + injected_commands_P = c ? injected_commands_P + i + 1 : nullptr; + + // Execute command if non-blank + if (i) { parser.parse(cmd); PORT_REDIRECT(SERIAL_PORT); gcode.process_parsed_command(); } - injected_commands_P = c ? injected_commands_P + i + 1 : nullptr; return true; } @@ -234,7 +248,7 @@ void GCodeQueue::ok_to_send() { if (!send_ok[index_r]) return; SERIAL_ECHOPGM(MSG_OK); #if ENABLED(ADVANCED_OK) - char* p = buffer[index_r]; + char* p = command_buffer[index_r]; if (*p == 'N') { SERIAL_ECHO(' '); SERIAL_ECHO(*p++); @@ -282,256 +296,6 @@ inline int read_serial(const uint8_t index) { } } -#if ENABLED(BINARY_FILE_TRANSFER) - - inline bool serial_data_available(const uint8_t index) { - switch (index) { - case 0: return MYSERIAL0.available(); - #if NUM_SERIAL > 1 - case 1: return MYSERIAL1.available(); - #endif - default: return false; - } - } - - class BinaryStream { - public: - enum class StreamState : uint8_t { - STREAM_RESET, - PACKET_RESET, - STREAM_HEADER, - PACKET_HEADER, - PACKET_DATA, - PACKET_VALIDATE, - PACKET_RESEND, - PACKET_FLUSHRX, - PACKET_TIMEOUT, - STREAM_COMPLETE, - STREAM_FAILED, - }; - - #pragma pack(push, 1) - - struct StreamHeader { - uint16_t token; - uint32_t filesize; - }; - union { - uint8_t stream_header_bytes[sizeof(StreamHeader)]; - StreamHeader stream_header; - }; - - struct Packet { - struct Header { - uint32_t id; - uint16_t size, checksum; - }; - union { - uint8_t header_bytes[sizeof(Header)]; - Header header; - }; - uint32_t bytes_received; - uint16_t checksum; - millis_t timeout; - } packet{}; - - #pragma pack(pop) - - void packet_reset() { - packet.header.id = 0; - packet.header.size = 0; - packet.header.checksum = 0; - packet.bytes_received = 0; - packet.checksum = 0x53A2; - packet.timeout = millis() + STREAM_MAX_WAIT; - } - - void stream_reset() { - packets_received = 0; - bytes_received = 0; - packet_retries = 0; - buffer_next_index = 0; - stream_header.token = 0; - stream_header.filesize = 0; - } - - uint32_t checksum(uint32_t seed, uint8_t value) { - return ((seed ^ value) ^ (seed << 8)) & 0xFFFF; - } - - // read the next byte from the data stream keeping track of - // whether the stream times out from data starvation - // takes the data variable by reference in order to return status - bool stream_read(uint8_t& data) { - if (ELAPSED(millis(), packet.timeout)) { - stream_state = StreamState::PACKET_TIMEOUT; - return false; - } - if (!serial_data_available(card.transfer_port_index)) return false; - data = read_serial(card.transfer_port_index); - packet.timeout = millis() + STREAM_MAX_WAIT; - return true; - } - - template - void receive(char (&buffer)[buffer_size]) { - uint8_t data = 0; - millis_t transfer_timeout = millis() + RX_TIMESLICE; - - #if ENABLED(SDSUPPORT) - PORT_REDIRECT(card.transfer_port_index); - #endif - - while (PENDING(millis(), transfer_timeout)) { - switch (stream_state) { - case StreamState::STREAM_RESET: - stream_reset(); - case StreamState::PACKET_RESET: - packet_reset(); - stream_state = StreamState::PACKET_HEADER; - break; - case StreamState::STREAM_HEADER: // The filename could also be in this packet, rather than handling it in the gcode - for (size_t i = 0; i < sizeof(stream_header); ++i) - stream_header_bytes[i] = buffer[i]; - - if (stream_header.token == 0x1234) { - stream_state = StreamState::PACKET_RESET; - bytes_received = 0; - time_stream_start = millis(); - // confirm active stream and the maximum block size supported - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Datastream initialized (", stream_header.filesize, " bytes expected)"); - SERIAL_ECHOLNPAIR("so", buffer_size); - } - else { - SERIAL_ECHO_MSG("Datastream init error (invalid token)"); - stream_state = StreamState::STREAM_FAILED; - } - buffer_next_index = 0; - break; - case StreamState::PACKET_HEADER: - if (!stream_read(data)) break; - - packet.header_bytes[packet.bytes_received++] = data; - if (packet.bytes_received == sizeof(Packet::Header)) { - if (packet.header.id == packets_received) { - buffer_next_index = 0; - packet.bytes_received = 0; - stream_state = StreamState::PACKET_DATA; - } - else { - SERIAL_ECHO_MSG("Datastream packet out of order"); - stream_state = StreamState::PACKET_FLUSHRX; - } - } - break; - case StreamState::PACKET_DATA: - if (!stream_read(data)) break; - - if (buffer_next_index < buffer_size) - buffer[buffer_next_index] = data; - else { - SERIAL_ECHO_MSG("Datastream packet data buffer overrun"); - stream_state = StreamState::STREAM_FAILED; - break; - } - - packet.checksum = checksum(packet.checksum, data); - packet.bytes_received++; - buffer_next_index++; - - if (packet.bytes_received == packet.header.size) - stream_state = StreamState::PACKET_VALIDATE; - - break; - case StreamState::PACKET_VALIDATE: - if (packet.header.checksum == packet.checksum) { - packet_retries = 0; - packets_received++; - bytes_received += packet.header.size; - - if (packet.header.id == 0) // id 0 is always the stream descriptor - stream_state = StreamState::STREAM_HEADER; // defer packet confirmation to STREAM_HEADER state - else { - if (bytes_received < stream_header.filesize) { - stream_state = StreamState::PACKET_RESET; // reset and receive next packet - SERIAL_ECHOLNPAIR("ok", packet.header.id); // transmit confirm packet received and valid token - } - else - stream_state = StreamState::STREAM_COMPLETE; // no more data required - - if (card.write(buffer, buffer_next_index) < 0) { - stream_state = StreamState::STREAM_FAILED; - SERIAL_ECHO_MSG("SDCard IO Error"); - break; - }; - } - } - else { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Block(", packet.header.id, ") Corrupt"); - stream_state = StreamState::PACKET_FLUSHRX; - } - break; - case StreamState::PACKET_RESEND: - if (packet_retries < MAX_RETRIES) { - packet_retries++; - stream_state = StreamState::PACKET_RESET; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Resend request ", int(packet_retries)); - SERIAL_ECHOLNPAIR("rs", packet.header.id); // transmit resend packet token - } - else { - stream_state = StreamState::STREAM_FAILED; - } - break; - case StreamState::PACKET_FLUSHRX: - if (ELAPSED(millis(), packet.timeout)) { - stream_state = StreamState::PACKET_RESEND; - break; - } - if (!serial_data_available(card.transfer_port_index)) break; - read_serial(card.transfer_port_index); // throw away data - packet.timeout = millis() + STREAM_MAX_WAIT; - break; - case StreamState::PACKET_TIMEOUT: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Datastream timeout"); - stream_state = StreamState::PACKET_RESEND; - break; - case StreamState::STREAM_COMPLETE: - stream_state = StreamState::STREAM_RESET; - card.flag.binary_mode = false; - SERIAL_ECHO_START(); - SERIAL_ECHO(card.filename); - SERIAL_ECHOLNPAIR(" transfer completed @ ", ((bytes_received / (millis() - time_stream_start) * 1000) / 1024), "KiB/s"); - SERIAL_ECHOLNPGM("sc"); // transmit stream complete token - card.closefile(); - return; - case StreamState::STREAM_FAILED: - stream_state = StreamState::STREAM_RESET; - card.flag.binary_mode = false; - card.closefile(); - card.removeFile(card.filename); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("File transfer failed"); - SERIAL_ECHOLNPGM("sf"); // transmit stream failed token - return; - } - } - } - - static const uint16_t STREAM_MAX_WAIT = 500, RX_TIMESLICE = 20, MAX_RETRIES = 3; - uint8_t packet_retries; - uint16_t buffer_next_index; - uint32_t packets_received, bytes_received; - millis_t time_stream_start; - StreamState stream_state = StreamState::STREAM_RESET; - - } binaryStream{}; - -#endif // BINARY_FILE_TRANSFER - void GCodeQueue::gcode_line_error(PGM_P const err, const int8_t port) { PORT_REDIRECT(port); SERIAL_ERROR_START(); @@ -561,13 +325,13 @@ void GCodeQueue::get_serial_commands() { ; #if ENABLED(BINARY_FILE_TRANSFER) - if (card.flag.saving && card.flag.binary_mode) { + if (card.flag.binary_mode) { /** * For binary stream file transfer, use serial_line_buffer as the working * receive buffer (which limits the packet size to MAX_CMD_SIZE). * The receive buffer also limits the packet size for reliable transmission. */ - binaryStream.receive(serial_line_buffer[card.transfer_port_index]); + binaryStream[card.transfer_port_index].receive(serial_line_buffer[card.transfer_port_index]); return; } #endif @@ -795,10 +559,14 @@ void GCodeQueue::get_serial_commands() { // Skip empty lines and comments if (!sd_count) { thermalManager.manage_heater(); continue; } - buffer[index_w][sd_count] = '\0'; // terminate string + command_buffer[index_w][sd_count] = '\0'; // terminate string sd_count = 0; // clear sd line buffer _commit_command(false); + + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.cmd_sdpos = card.getIndex(); // Prime for the next _commit_command + #endif } else if (sd_count >= MAX_CMD_SIZE - 1) { /** @@ -816,7 +584,7 @@ void GCodeQueue::get_serial_commands() { #if ENABLED(PAREN_COMMENTS) && ! sd_comment_paren_mode #endif - ) buffer[index_w][sd_count++] = sd_char; + ) command_buffer[index_w][sd_count++] = sd_char; } } } @@ -852,7 +620,7 @@ void GCodeQueue::advance() { #if ENABLED(SDSUPPORT) if (card.flag.saving) { - char* command = buffer[index_r]; + char* command = command_buffer[index_r]; if (is_M29(command)) { // M29 closes the file card.closefile(); diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 671793e2bdf4..173cadc68ebc 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -51,7 +51,7 @@ class GCodeQueue { static uint8_t length, // Count of commands in the queue index_r; // Ring buffer read position - static char buffer[BUFSIZE][MAX_CMD_SIZE]; + static char command_buffer[BUFSIZE][MAX_CMD_SIZE]; /* * The port that the command was received on diff --git a/Marlin/src/gcode/scara/M360-M364.cpp b/Marlin/src/gcode/scara/M360-M364.cpp index 585c4d8c8670..0e6f51b6280e 100644 --- a/Marlin/src/gcode/scara/M360-M364.cpp +++ b/Marlin/src/gcode/scara/M360-M364.cpp @@ -32,7 +32,7 @@ inline bool SCARA_move_to_cal(const uint8_t delta_a, const uint8_t delta_b) { if (IsRunning()) { forward_kinematics_SCARA(delta_a, delta_b); - do_blocking_move_to_xy(cartes[X_AXIS], cartes[Y_AXIS]); + do_blocking_move_to_xy(cartes); return true; } return false; diff --git a/Marlin/src/gcode/sdcard/M21_M22.cpp b/Marlin/src/gcode/sdcard/M21_M22.cpp index 91b117602dc2..9362db0808e9 100644 --- a/Marlin/src/gcode/sdcard/M21_M22.cpp +++ b/Marlin/src/gcode/sdcard/M21_M22.cpp @@ -30,7 +30,7 @@ /** * M21: Init SD Card */ -void GcodeSuite::M21() { card.initsd(); } +void GcodeSuite::M21() { card.mount(); } /** * M22: Release SD Card diff --git a/Marlin/src/gcode/sdcard/M23.cpp b/Marlin/src/gcode/sdcard/M23.cpp index 87aa213ddc29..7dd4ad9203ab 100644 --- a/Marlin/src/gcode/sdcard/M23.cpp +++ b/Marlin/src/gcode/sdcard/M23.cpp @@ -26,6 +26,7 @@ #include "../gcode.h" #include "../../sd/cardreader.h" +#include "../../lcd/ultralcd.h" /** * M23: Open a file @@ -35,7 +36,11 @@ void GcodeSuite::M23() { // 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); + card.openFileRead(parser.string_arg); + + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) + ui.set_progress(0); + #endif } #endif // SDSUPPORT diff --git a/Marlin/src/gcode/sdcard/M24_M25.cpp b/Marlin/src/gcode/sdcard/M24_M25.cpp index 81b7350f7247..d1a9c2f23f29 100644 --- a/Marlin/src/gcode/sdcard/M24_M25.cpp +++ b/Marlin/src/gcode/sdcard/M24_M25.cpp @@ -38,6 +38,12 @@ #include "../../feature/host_actions.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../feature/power_loss_recovery.h" +#endif + +#include "../../Marlin.h" // for startOrResumeJob + /** * M24: Start or Resume SD Print */ @@ -50,23 +56,26 @@ void GcodeSuite::M24() { #if ENABLED(PARK_HEAD_ON_PAUSE) if (did_pause_print) { - resume_print(); + resume_print(); // will call print_job_timer.start() return; } #endif if (card.isFileOpen()) { - card.startFileprint(); - print_job_timer.start(); + card.startFileprint(); // SD card will now be read for commands + startOrResumeJob(); // Start (or resume) the print job timer + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.prepare(); + #endif } #if ENABLED(HOST_ACTION_COMMANDS) - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Resume SD")); - #endif #ifdef ACTION_ON_RESUME host_action_resume(); #endif + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_open(PROMPT_INFO, PSTR("Resuming SD"), PSTR("Dismiss")); + #endif #endif ui.reset_status(); diff --git a/Marlin/src/gcode/sdcard/M26.cpp b/Marlin/src/gcode/sdcard/M26.cpp index e14ee5b34966..000375880440 100644 --- a/Marlin/src/gcode/sdcard/M26.cpp +++ b/Marlin/src/gcode/sdcard/M26.cpp @@ -31,7 +31,7 @@ * M26: Set SD Card file index */ void GcodeSuite::M26() { - if (card.isDetected() && parser.seenval('S')) + if (card.isMounted() && parser.seenval('S')) card.setIndex(parser.value_long()); } diff --git a/Marlin/src/gcode/sdcard/M28_M29.cpp b/Marlin/src/gcode/sdcard/M28_M29.cpp index 271c7321024f..c64ce7bb8639 100644 --- a/Marlin/src/gcode/sdcard/M28_M29.cpp +++ b/Marlin/src/gcode/sdcard/M28_M29.cpp @@ -48,20 +48,17 @@ void GcodeSuite::M28() { // Binary transfer mode if ((card.flag.binary_mode = binary_mode)) { - SERIAL_ECHO_START(); - SERIAL_ECHO(" preparing to receive: "); - SERIAL_ECHOLN(p); - card.openFile(p, false); + SERIAL_ECHO_MSG("Switching to Binary Protocol"); #if NUM_SERIAL > 1 card.transfer_port_index = queue.port[queue.index_r]; #endif } else - card.openFile(p, false); + card.openFileWrite(p); #else - card.openFile(parser.string_arg, false); + card.openFileWrite(parser.string_arg); #endif } diff --git a/Marlin/src/gcode/sdcard/M30.cpp b/Marlin/src/gcode/sdcard/M30.cpp index f4e67c0a4a4f..2f318687ad45 100644 --- a/Marlin/src/gcode/sdcard/M30.cpp +++ b/Marlin/src/gcode/sdcard/M30.cpp @@ -31,7 +31,7 @@ * M30 : Delete SD Card file */ void GcodeSuite::M30() { - if (card.isDetected()) { + if (card.isMounted()) { card.closefile(); card.removeFile(parser.string_arg); } diff --git a/Marlin/src/gcode/sdcard/M32.cpp b/Marlin/src/gcode/sdcard/M32.cpp index dde94c1d89f5..559d1d503bf7 100644 --- a/Marlin/src/gcode/sdcard/M32.cpp +++ b/Marlin/src/gcode/sdcard/M32.cpp @@ -26,8 +26,9 @@ #include "../gcode.h" #include "../../sd/cardreader.h" -#include "../../module/printcounter.h" -#include "../../module/planner.h" +#include "../../module/planner.h" // for synchronize() + +#include "../../Marlin.h" // for startOrResumeJob /** * M32: Select file and start SD Print @@ -42,17 +43,17 @@ void GcodeSuite::M32() { if (IS_SD_PRINTING()) planner.synchronize(); - if (card.isDetected()) { - const bool call_procedure = parser.boolval('P'); + if (card.isMounted()) { + const uint8_t call_procedure = parser.boolval('P'); - card.openFile(parser.string_arg, true, call_procedure); + card.openFileRead(parser.string_arg, call_procedure); if (parser.seenval('S')) card.setIndex(parser.value_long()); card.startFileprint(); // Procedure calls count as normal print time. - if (!call_procedure) print_job_timer.start(); + if (!call_procedure) startOrResumeJob(); } } diff --git a/Marlin/src/gcode/stats/M31.cpp b/Marlin/src/gcode/stats/M31.cpp index 39c922071c40..fdad76e99a85 100644 --- a/Marlin/src/gcode/stats/M31.cpp +++ b/Marlin/src/gcode/stats/M31.cpp @@ -31,8 +31,8 @@ */ void GcodeSuite::M31() { char buffer[21]; - duration_t elapsed = print_job_timer.duration(); - elapsed.toString(buffer); + duration_t(print_job_timer.duration()).toString(buffer); + ui.set_status(buffer); SERIAL_ECHO_START(); diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 8749a59868c1..8fcc44028503 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -24,18 +24,13 @@ #include "../../module/printcounter.h" #include "../../lcd/ultralcd.h" -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif +#include "../../Marlin.h" // for startOrResumeJob /** * M75: Start print timer */ void GcodeSuite::M75() { - print_job_timer.start(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStarted(); - #endif + startOrResumeJob(); } /** @@ -43,19 +38,13 @@ void GcodeSuite::M75() { */ void GcodeSuite::M76() { print_job_timer.pause(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerPaused(); - #endif } /** * M77: Stop print timer */ void GcodeSuite::M77() { - print_job_timer.stop(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStopped(); - #endif + print_job_timer.stop(); } #if ENABLED(PRINTCOUNTER) diff --git a/Marlin/src/gcode/temperature/M104_M109.cpp b/Marlin/src/gcode/temperature/M104_M109.cpp index b17243851dfb..59394dabfa84 100644 --- a/Marlin/src/gcode/temperature/M104_M109.cpp +++ b/Marlin/src/gcode/temperature/M104_M109.cpp @@ -20,15 +20,23 @@ * */ +#include "../../inc/MarlinConfigPre.h" + +#if EXTRUDERS + #include "../gcode.h" #include "../../module/temperature.h" #include "../../module/motion.h" #include "../../module/planner.h" #include "../../lcd/ultralcd.h" -#include "../../Marlin.h" + +#include "../../Marlin.h" // for startOrResumeJob, etc. #if ENABLED(PRINTJOB_TIMER_AUTOSTART) #include "../../module/printcounter.h" + #if ENABLED(CANCEL_OBJECTS) + #include "../../feature/cancel_object.h" + #endif #endif #if ENABLED(SINGLENOZZLE) @@ -122,10 +130,10 @@ void GcodeSuite::M109() { ui.reset_status(); } else - print_job_timer.start(); + startOrResumeJob(); #endif - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + #if HAS_DISPLAY if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling) thermalManager.set_heating_message(target_extruder); #endif @@ -138,3 +146,5 @@ void GcodeSuite::M109() { if (set_temp) (void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling); } + +#endif // EXTRUDERS diff --git a/Marlin/src/gcode/temperature/M105.cpp b/Marlin/src/gcode/temperature/M105.cpp index bf11017a5728..3dbbb5eb7b4e 100644 --- a/Marlin/src/gcode/temperature/M105.cpp +++ b/Marlin/src/gcode/temperature/M105.cpp @@ -31,16 +31,21 @@ void GcodeSuite::M105() { const int8_t target_extruder = get_target_extruder_from_command(); if (target_extruder < 0) return; + SERIAL_ECHOPGM(MSG_OK); + #if HAS_TEMP_SENSOR - SERIAL_ECHOPGM(MSG_OK); + thermalManager.print_heater_states(target_extruder #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) , parser.boolval('R') #endif ); - #else // !HAS_TEMP_SENSOR - SERIAL_ERROR_MSG(MSG_ERR_NO_THERMISTORS); - #endif - SERIAL_EOL(); + SERIAL_EOL(); + + #else + + SERIAL_ECHOLNPGM(" T:0"); // Some hosts send M105 to test the serial connection + + #endif } diff --git a/Marlin/src/gcode/temperature/M140_M190.cpp b/Marlin/src/gcode/temperature/M140_M190.cpp index a0d132f6b7b2..67a423a2de68 100644 --- a/Marlin/src/gcode/temperature/M140_M190.cpp +++ b/Marlin/src/gcode/temperature/M140_M190.cpp @@ -37,7 +37,7 @@ #include "../../feature/leds/leds.h" #endif -#include "../../Marlin.h" // for wait_for_heatup and idle() +#include "../../Marlin.h" // for wait_for_heatup, idle, startOrResumeJob /** * M140: Set bed temperature @@ -59,12 +59,12 @@ void GcodeSuite::M190() { thermalManager.setTargetBed(parser.value_celsius()); #if ENABLED(PRINTJOB_TIMER_AUTOSTART) if (parser.value_celsius() > BED_MINTEMP) - print_job_timer.start(); + startOrResumeJob(); #endif } else return; - ui.set_status_P(thermalManager.isHeatingBed() ? PSTR(MSG_BED_HEATING) : PSTR(MSG_BED_COOLING)); + ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING)); thermalManager.wait_for_bed(no_wait_for_cooling); } diff --git a/Marlin/src/gcode/temperature/M141_M191.cpp b/Marlin/src/gcode/temperature/M141_M191.cpp index 53deb25d2f6b..65cd7b028056 100644 --- a/Marlin/src/gcode/temperature/M141_M191.cpp +++ b/Marlin/src/gcode/temperature/M141_M191.cpp @@ -27,7 +27,6 @@ #include "../gcode.h" #include "../../module/temperature.h" -/* #include "../../module/motion.h" #include "../../lcd/ultralcd.h" @@ -39,8 +38,7 @@ #include "../../feature/leds/leds.h" #endif -#include "../../Marlin.h" // for wait_for_heatup and idle() -*/ +#include "../../Marlin.h" // for wait_for_heatup, idle, startOrResumeJob /** * M141: Set chamber temperature @@ -54,7 +52,6 @@ void GcodeSuite::M141() { * M191: Sxxx Wait for chamber current temp to reach target temp. Waits only when heating * Rxxx Wait for chamber current temp to reach target temp. Waits when heating and cooling */ -/* void GcodeSuite::M191() { if (DEBUGGING(DRYRUN)) return; @@ -62,16 +59,17 @@ void GcodeSuite::M191() { if (no_wait_for_cooling || parser.seenval('R')) { thermalManager.setTargetChamber(parser.value_celsius()); #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - if (parser.value_celsius() > BED_MINTEMP) - print_job_timer.start(); + if (parser.value_celsius() > CHAMBER_MINTEMP) + startOrResumeJob(); #endif } else return; - lcd_setstatusPGM(thermalManager.isHeatingChamber() ? PSTR(MSG_CHAMBER_HEATING) : PSTR(MSG_CHAMBER_COOLING)); - - thermalManager.wait_for_chamber(no_wait_for_cooling); + const bool is_heating = thermalManager.isHeatingChamber(); + if (is_heating || !no_wait_for_cooling) { + ui.set_status_P(is_heating ? GET_TEXT(MSG_CHAMBER_HEATING) : GET_TEXT(MSG_CHAMBER_COOLING)); + thermalManager.wait_for_chamber(false); + } } -*/ #endif // HAS_HEATED_CHAMBER diff --git a/Marlin/src/gcode/units/M82_M83.cpp b/Marlin/src/gcode/units/M82_M83.cpp index 110701b6b024..11868b6ddc43 100644 --- a/Marlin/src/gcode/units/M82_M83.cpp +++ b/Marlin/src/gcode/units/M82_M83.cpp @@ -25,9 +25,9 @@ /** * M82: Set E codes absolute (default) */ -void GcodeSuite::M82() { axis_relative_modes[E_AXIS] = false; } +void GcodeSuite::M82() { set_e_absolute(); } /** * M83: Set E codes relative while in Absolute Coordinates (G90) mode */ -void GcodeSuite::M83() { axis_relative_modes[E_AXIS] = true; } +void GcodeSuite::M83() { set_e_relative(); } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index b55c6580242b..713de59c6277 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -29,22 +29,15 @@ #if ENABLED(CARTESIO_UI) #define DOGLCD - #define ULTIPANEL - #define DEFAULT_LCD_CONTRAST 90 - #define LCD_CONTRAST_MIN 60 - #define LCD_CONTRAST_MAX 140 - -#elif ENABLED(MAKRPANEL) - - #define U8GLIB_ST7565_64128N + #define IS_ULTIPANEL #elif ENABLED(ZONESTAR_LCD) #define ADC_KEYPAD - #define REPRAPWORLD_KEYPAD + #define IS_RRW_KEYPAD #define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 #define ADC_KEY_NUM 8 - #define ULTIPANEL + #define IS_ULTIPANEL // This helps to implement ADC_KEYPAD menus #define REVERSE_MENU_DIRECTION @@ -53,66 +46,50 @@ #define ENCODER_FEEDRATE_DEADZONE 2 #elif ENABLED(RADDS_DISPLAY) - #define ULTIPANEL + #define IS_ULTIPANEL #define ENCODER_PULSES_PER_STEP 2 -#elif ENABLED(ANET_FULL_GRAPHICS_LCD) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +#elif EITHER(ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER) -#elif ENABLED(BQ_LCD_SMART_CONTROLLER) - - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + #define IS_RRD_FG_SC #elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864) - #define ULTRA_LCD + #define IS_ULTRA_LCD #define DOGLCD - #define ULTIMAKERCONTROLLER + #define IS_ULTIPANEL #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(AZSMZ_12864) - #define LCD_CONTRAST_MIN 120 - #define LCD_CONTRAST_MAX 255 - #define DEFAULT_LCD_CONTRAST 190 #define U8GLIB_ST7565_64128N #endif #elif ENABLED(OLED_PANEL_TINYBOY2) - #define U8GLIB_SSD1306 - #define ULTIPANEL + #define IS_U8GLIB_SSD1306 + #define IS_ULTIPANEL #elif ENABLED(RA_CONTROL_PANEL) #define LCD_I2C_TYPE_PCA8574 #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander - #define ULTIPANEL + #define IS_ULTIPANEL #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define DOGLCD #define U8GLIB_ST7920 - #define ULTIPANEL + #define IS_ULTIPANEL #elif ENABLED(CR10_STOCKDISPLAY) - #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + #define IS_RRD_FG_SC #ifndef ST7920_DELAY_1 #define ST7920_DELAY_1 DELAY_NS(125) #endif @@ -125,30 +102,25 @@ #elif ENABLED(MKS_12864OLED) - #define REPRAP_DISCOUNT_SMART_CONTROLLER + #define IS_RRD_SC #define U8GLIB_SH1106 #elif ENABLED(MKS_12864OLED_SSD1306) - #define REPRAP_DISCOUNT_SMART_CONTROLLER - #define U8GLIB_SSD1306 + #define IS_RRD_SC + #define IS_U8GLIB_SSD1306 #elif ENABLED(MKS_MINI_12864) #define MINIPANEL - #define DEFAULT_LCD_CONTRAST 150 - #define LCD_CONTRAST_MAX 255 #elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) #define FYSETC_MINI_12864 #define DOGLCD - #define ULTIPANEL - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 255 - #define DEFAULT_LCD_CONTRAST 220 + #define IS_ULTIPANEL #define LED_COLORS_REDUCE_GREEN - #if (HAS_POWER_SWITCH && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)) + #if ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) #define LED_BACKLIGHT_TIMEOUT 10000 #endif @@ -156,96 +128,113 @@ #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #define RGB_LED #elif ENABLED(FYSETC_MINI_12864_2_1) + #define LED_CONTROL_MENU #define NEOPIXEL_LED #undef NEOPIXEL_TYPE #define NEOPIXEL_TYPE NEO_RGB - #undef NEOPIXEL_PIXELS - #define NEOPIXEL_PIXELS 3 + #if NEOPIXEL_PIXELS < 3 + #undef NEOPIXELS_PIXELS + #define NEOPIXEL_PIXELS 3 + #endif #ifndef NEOPIXEL_BRIGHTNESS #define NEOPIXEL_BRIGHTNESS 127 #endif - #define NEOPIXEL_STARTUP_TEST + //#define NEOPIXEL_STARTUP_TEST #endif +#elif ENABLED(ULTI_CONTROLLER) + + #define IS_ULTIPANEL + #define U8GLIB_SSD1309 + #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin + #define ENCODER_PULSES_PER_STEP 2 + #define ENCODER_STEPS_PER_MENU_ITEM 2 + +#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) + + #define IS_RRD_SC + #define LCD_WIDTH 16 + #define LCD_HEIGHT 2 + +#endif + +#if ENABLED(IS_RRD_FG_SC) + #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER #endif #if EITHER(MAKRPANEL, MINIPANEL) + #define IS_ULTIPANEL #define DOGLCD - #define ULTIPANEL - #ifndef DEFAULT_LCD_CONTRAST - #define DEFAULT_LCD_CONTRAST 17 + #if ENABLED(MAKRPANEL) + #define U8GLIB_ST7565_64128N #endif #endif -#if ENABLED(ULTI_CONTROLLER) - #define U8GLIB_SSD1309 - #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 +#if ENABLED(IS_U8GLIB_SSD1306) + #define U8GLIB_SSD1306 +#endif + +#if ENABLED(OVERLORD_OLED) + #define IS_ULTIPANEL + #define U8GLIB_SH1106 + /** + * PCA9632 for buzzer and LEDs via i2c + * No auto-inc, red and green leds switched, buzzer + */ + #define PCA9632 + #define PCA9632_NO_AUTO_INC + #define PCA9632_GRN 0x00 + #define PCA9632_RED 0x02 + #define PCA9632_BUZZER + #define PCA9632_BUZZER_DATA { 0x09, 0x02 } + + #define ENCODER_PULSES_PER_STEP 1 // Overlord uses buttons + #define ENCODER_STEPS_PER_MENU_ITEM 1 #endif // 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106 #define HAS_SSD1306_OLED_I2C ANY(U8GLIB_SSD1306, U8GLIB_SSD1309, U8GLIB_SH1106) #if HAS_SSD1306_OLED_I2C - #define ULTRA_LCD + #define IS_ULTRA_LCD #define DOGLCD #endif -#if EITHER(PANEL_ONE, 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 - +// ST7920-based graphical displays #if ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 - #define REPRAP_DISCOUNT_SMART_CONTROLLER -#endif - -#if ANY(ULTIMAKERCONTROLLER, REPRAP_DISCOUNT_SMART_CONTROLLER, G3D_PANEL, RIGIDBOT_PANEL, ULTI_CONTROLLER) - #define ULTIPANEL + #define IS_RRD_SC #endif -#if ENABLED(REPRAPWORLD_KEYPAD) - #define NEWPANEL - #if ENABLED(ULTIPANEL) && !defined(REPRAPWORLD_KEYPAD_MOVE_STEP) - #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 - #endif +// RepRapDiscount LCD or Graphical LCD with rotary click encoder +#if ENABLED(IS_RRD_SC) + #define REPRAP_DISCOUNT_SMART_CONTROLLER #endif /** - * SPI PANELS + * SPI Ultipanels */ - // Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h - #if ENABLED(U8GLIB_SH1106_EINSTART) - #define ULTRA_LCD - #define DOGLCD - #define ULTIPANEL - #define NEWPANEL - #endif - - /** - * FSMC/SPI TFT PANELS - */ - #if ENABLED(MKS_ROBIN_TFT) - #define ULTRA_LCD - #define DOGLCD - #define ULTIPANEL - #endif +// Basic Ultipanel-like displays +#if ANY(ULTIMAKERCONTROLLER, REPRAP_DISCOUNT_SMART_CONTROLLER, G3D_PANEL, RIGIDBOT_PANEL, PANEL_ONE, U8GLIB_SH1106) + #define IS_ULTIPANEL +#endif + +// Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h +#if ENABLED(U8GLIB_SH1106_EINSTART) + #define DOGLCD + #define IS_ULTIPANEL +#endif + +// FSMC/SPI TFT Panels +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define DOGLCD + #define IS_ULTIPANEL + #define DELAYED_BACKLIGHT_INIT +#endif /** - * I2C PANELS + * I2C Panels */ #if EITHER(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) @@ -265,7 +254,7 @@ #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 + #define IS_ULTIPANEL #elif ENABLED(LCD_I2C_VIKI) @@ -280,7 +269,7 @@ #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 IS_ULTIPANEL #define ENCODER_FEEDRATE_DEADZONE 4 @@ -292,7 +281,7 @@ #define STD_ENCODER_PULSES_PER_STEP 2 #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2, REPRAP_DISCOUNT_SMART_CONTROLLER) +#elif ANY(REPRAP_DISCOUNT_SMART_CONTROLLER, miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2) #define STD_ENCODER_PULSES_PER_STEP 4 #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 @@ -300,7 +289,11 @@ #endif #ifndef STD_ENCODER_PULSES_PER_STEP - #define STD_ENCODER_PULSES_PER_STEP 5 + #if ENABLED(TOUCH_BUTTONS) + #define STD_ENCODER_PULSES_PER_STEP 2 + #else + #define STD_ENCODER_PULSES_PER_STEP 5 + #endif #endif #ifndef STD_ENCODER_STEPS_PER_MENU_ITEM #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 @@ -321,21 +314,41 @@ // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection #if ENABLED(FF_INTERFACEBOARD) #define SR_LCD_3W_NL // Non latching 3 wire shift register - #define ULTIPANEL + #define IS_ULTIPANEL +#elif ENABLED(SAV_3DLCD) + #define SR_LCD_2W_NL // Non latching 2 wire shift register + #define IS_ULTIPANEL #endif -#if ENABLED(SAV_3DLCD) - #define SR_LCD_2W_NL // Non latching 2 wire shift register +#if ENABLED(IS_ULTIPANEL) #define ULTIPANEL #endif - #if ENABLED(ULTIPANEL) - #define NEWPANEL // Disable this if you actually have no click-encoder panel + #define IS_ULTRA_LCD + #ifndef NEWPANEL + #define NEWPANEL + #endif +#endif + +#if ENABLED(IS_ULTRA_LCD) #define ULTRA_LCD #endif +#if ENABLED(IS_RRW_KEYPAD) + #define REPRAPWORLD_KEYPAD +#endif + +// Keypad needs a move step +#if ENABLED(REPRAPWORLD_KEYPAD) + #define NEWPANEL + #ifndef REPRAPWORLD_KEYPAD_MOVE_STEP + #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 + #endif +#endif + // Extensible UI serial touch screens. (See src/lcd/extensible_ui) -#if EITHER(DGUS_LCD, MALYAN_LCD) +#if ANY(MALYAN_LCD, DGUS_LCD, TOUCH_UI_FTDI_EVE) + #define IS_EXTUI #define EXTENSIBLE_UI #endif @@ -345,24 +358,7 @@ #define HAS_GRAPHICAL_LCD ENABLED(DOGLCD) #define HAS_CHARACTER_LCD (HAS_SPI_LCD && !HAS_GRAPHICAL_LCD) #define HAS_LCD_MENU (ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS)) - -#define HAS_ADC_BUTTONS ENABLED(ADC_KEYPAD) - -/** - * Default LCD contrast for Graphical LCD displays - */ -#define HAS_LCD_CONTRAST (HAS_GRAPHICAL_LCD && defined(DEFAULT_LCD_CONTRAST)) -#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 +#define HAS_ADC_BUTTONS ENABLED(ADC_KEYPAD) /** * Extruders have some combination of stepper motors and hotends @@ -420,7 +416,6 @@ #if EITHER(SINGLENOZZLE, 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 @@ -505,8 +500,8 @@ #define PROBE_SELECTED (HAS_BED_PROBE || EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) #if HAS_BED_PROBE - #define USES_Z_MIN_PROBE_ENDSTOP DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !USES_Z_MIN_PROBE_ENDSTOP) + #define HAS_CUSTOM_PROBE_PIN DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN) #ifndef Z_PROBE_LOW_POINT #define Z_PROBE_LOW_POINT -5 #endif @@ -529,13 +524,14 @@ #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) #endif -#define HAS_SOFTWARE_ENDSTOPS EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) -#define HAS_RESUME_CONTINUE ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER) -#define HAS_COLOR_LEDS ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) -#define HAS_LEDS_OFF_FLAG (BOTH(PRINTER_EVENT_LEDS, SDSUPPORT) && HAS_RESUME_CONTINUE) -#define HAS_PRINT_PROGRESS EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) -#define HAS_SERVICE_INTERVALS (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0) -#define HAS_FILAMENT_SENSOR ENABLED(FILAMENT_RUNOUT_SENSOR) +#define HAS_SOFTWARE_ENDSTOPS EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) +#define HAS_RESUME_CONTINUE ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER) +#define HAS_COLOR_LEDS ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) +#define HAS_LEDS_OFF_FLAG (BOTH(PRINTER_EVENT_LEDS, SDSUPPORT) && HAS_RESUME_CONTINUE) +#define HAS_PRINT_PROGRESS EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) +#define HAS_PRINT_PROGRESS_PERMYRIAD (HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)) +#define HAS_SERVICE_INTERVALS (ENABLED(PRINTCOUNTER) && (SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0)) +#define HAS_FILAMENT_SENSOR ENABLED(FILAMENT_RUNOUT_SENSOR) #define Z_MULTI_STEPPER_DRIVERS EITHER(Z_DUAL_STEPPER_DRIVERS, Z_TRIPLE_STEPPER_DRIVERS) #define Z_MULTI_ENDSTOPS EITHER(Z_DUAL_ENDSTOPS, Z_TRIPLE_ENDSTOPS) @@ -561,34 +557,16 @@ #define INVERT_E_DIR false #endif -#if ENABLED(HOST_ACTION_COMMANDS) - #ifndef ACTION_ON_PAUSE - #define ACTION_ON_PAUSE "pause" - #endif - #ifndef ACTION_ON_RESUME - #define ACTION_ON_RESUME "resume" - #endif - #ifndef ACTION_ON_PAUSED - #define ACTION_ON_PAUSED "paused" - #endif - #ifndef ACTION_ON_RESUMED - #define ACTION_ON_RESUMED "resumed" - #endif - #ifndef ACTION_ON_CANCEL - #define ACTION_ON_CANCEL "cancel" - #endif - #if ENABLED(G29_RETRY_AND_RECOVER) - #ifndef ACTION_ON_G29_RECOVER - #define ACTION_ON_G29_RECOVER "probe_rewipe" - #endif - #ifndef ACTION_ON_G29_FAILURE - #define ACTION_ON_G29_FAILURE "probe_failed" - #endif - #endif -#endif - #if ENABLED(SLIM_LCD_MENUS) #define BOOT_MARLIN_LOGO_SMALL #endif -#define IS_RE_ARM_BOARD (MB(RAMPS_14_RE_ARM_EFB) || MB(RAMPS_14_RE_ARM_EEB) || MB(RAMPS_14_RE_ARM_EFF) || MB(RAMPS_14_RE_ARM_EEF) || MB(RAMPS_14_RE_ARM_SF)) +#define IS_RE_ARM_BOARD MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF) + +#define HAS_SDCARD_CONNECTION EITHER(TARGET_LPC1768, ADAFRUIT_GRAND_CENTRAL_M4) + +#define HAS_LINEAR_E_JERK (DISABLED(CLASSIC_JERK) && ENABLED(LIN_ADVANCE)) + +#ifndef SPI_SPEED + #define SPI_SPEED SPI_FULL_SPEED +#endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 168bc9cc17c3..0f62a7b5773b 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -26,6 +26,34 @@ * Defines that depend on advanced configuration. */ +#if EXTRUDERS == 0 + #define NO_VOLUMETRICS + #undef TEMP_SENSOR_0 + #undef TEMP_SENSOR_1 + #undef TEMP_SENSOR_2 + #undef TEMP_SENSOR_3 + #undef TEMP_SENSOR_4 + #undef TEMP_SENSOR_5 + #undef FWRETRACT + #undef PIDTEMP + #undef AUTOTEMP + #undef PID_EXTRUSION_SCALING + #undef LIN_ADVANCE + #undef FILAMENT_RUNOUT_SENSOR + #undef ADVANCED_PAUSE_FEATURE + #undef FILAMENT_RUNOUT_DISTANCE_MM + #undef FILAMENT_LOAD_UNLOAD_GCODES + #undef DISABLE_INACTIVE_EXTRUDER + #undef FILAMENT_LOAD_UNLOAD_GCODES + #undef EXTRUDER_RUNOUT_PREVENT + #undef PREVENT_COLD_EXTRUSION + #undef PREVENT_LENGTHY_EXTRUDE + #undef THERMAL_PROTECTION_HOTENDS + #undef THERMAL_PROTECTION_PERIOD + #undef WATCH_TEMP_PERIOD + #undef SHOW_TEMP_ADC_VALUES +#endif + #define HAS_CUTTER EITHER(SPINDLE_FEATURE, LASER_FEATURE) #if !defined(__AVR__) || !defined(USBCON) @@ -99,3 +127,11 @@ #define LED_USER_PRESET_BRIGHTNESS 255 #endif #endif + +// Extensible UI pin mapping for RepRapDiscount +#define TOUCH_UI_ULTIPANEL ENABLED(TOUCH_UI_FTDI_EVE) && ANY(AO_EXP1_PINMAP, AO_EXP2_PINMAP, CR10_TFT_PINMAP) + +// Poll-based jogging for joystick and other devices +#if ENABLED(JOYSTICK) + #define POLL_JOG +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 8d6da94e8e77..717204768cd4 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -43,17 +43,8 @@ #define NOT_A_PIN 0 // For PINS_DEBUGGING #endif -#if EXTRUDERS == 0 - #define NO_VOLUMETRICS - #undef FWRETRACT - #undef LIN_ADVANCE - #undef ADVANCED_PAUSE_FEATURE - #undef DISABLE_INACTIVE_EXTRUDER - #undef EXTRUDER_RUNOUT_PREVENT - #undef FILAMENT_LOAD_UNLOAD_GCODES -#endif - -#define HAS_CLASSIC_JERK (IS_KINEMATIC || DISABLED(JUNCTION_DEVIATION)) +#define HAS_CLASSIC_JERK (ENABLED(CLASSIC_JERK) || IS_KINEMATIC) +#define HAS_CLASSIC_E_JERK (ENABLED(CLASSIC_JERK) || DISABLED(LIN_ADVANCE)) /** * Axis lengths and center @@ -76,20 +67,21 @@ #endif // Define center values for future use +#define _X_HALF_BED ((X_BED_SIZE) / 2) +#define _Y_HALF_BED ((Y_BED_SIZE) / 2) #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) + #define X_CENTER _X_HALF_BED + #define Y_CENTER _Y_HALF_BED #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) +#define X_MIN_BED (X_CENTER - _X_HALF_BED) +#define X_MAX_BED (X_MIN_BED + X_BED_SIZE) +#define Y_MIN_BED (Y_CENTER - _Y_HALF_BED) +#define Y_MAX_BED (Y_MIN_BED + Y_BED_SIZE) /** * Dual X Carriage @@ -140,10 +132,12 @@ /** * SCARA cannot use SLOWDOWN and requires QUICKHOME + * Printable radius assumes joints can fully extend */ #if IS_SCARA #undef SLOWDOWN #define QUICK_HOME + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) #endif /** @@ -209,6 +203,10 @@ #undef SLOWDOWN #endif +#ifndef MESH_INSET + #define MESH_INSET 0 +#endif + /** * Safe Homing Options */ @@ -225,11 +223,6 @@ #ifndef Z_SAFE_HOMING_Y_POINT #define Z_SAFE_HOMING_Y_POINT _SAFE_POINT(Y) #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 /** @@ -246,6 +239,67 @@ #define MAX_AUTORETRACT 99 #endif +/** + * LCD Contrast for Graphical Displays + */ +#if ENABLED(CARTESIO_UI) + #define _LCD_CONTRAST_MIN 60 + #define _LCD_CONTRAST_INIT 90 + #define _LCD_CONTRAST_MAX 140 +#elif ENABLED(miniVIKI) + #define _LCD_CONTRAST_MIN 75 + #define _LCD_CONTRAST_INIT 95 + #define _LCD_CONTRAST_MAX 115 +#elif ENABLED(VIKI2) + #define _LCD_CONTRAST_INIT 140 +#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + #define _LCD_CONTRAST_MIN 90 + #define _LCD_CONTRAST_INIT 110 + #define _LCD_CONTRAST_MAX 130 +#elif ENABLED(AZSMZ_12864) + #define _LCD_CONTRAST_MIN 120 + #define _LCD_CONTRAST_INIT 190 +#elif ENABLED(MKS_LCD12864B) + #define _LCD_CONTRAST_MIN 120 + #define _LCD_CONTRAST_INIT 205 +#elif ENABLED(MKS_MINI_12864) + #define _LCD_CONTRAST_MIN 120 + #define _LCD_CONTRAST_INIT 195 +#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) + #define _LCD_CONTRAST_INIT 220 +#elif ENABLED(ULTI_CONTROLLER) + #define _LCD_CONTRAST_INIT 127 + #define _LCD_CONTRAST_MAX 254 +#elif EITHER(MAKRPANEL, MINIPANEL) + #define _LCD_CONTRAST_INIT 17 +#endif + +#define HAS_LCD_CONTRAST defined(_LCD_CONTRAST_INIT) +#if HAS_LCD_CONTRAST + #ifndef LCD_CONTRAST_MIN + #ifdef _LCD_CONTRAST_MIN + #define LCD_CONTRAST_MIN _LCD_CONTRAST_MIN + #else + #define LCD_CONTRAST_MIN 0 + #endif + #endif + #ifndef LCD_CONTRAST_INIT + #define LCD_CONTRAST_INIT _LCD_CONTRAST_INIT + #endif + #ifndef LCD_CONTRAST_MAX + #ifdef _LCD_CONTRAST_MAX + #define LCD_CONTRAST_MAX _LCD_CONTRAST_MAX + #elif _LCD_CONTRAST_INIT > 63 + #define LCD_CONTRAST_MAX 255 + #else + #define LCD_CONTRAST_MAX 63 // ST7567 6-bits contrast + #endif + #endif + #ifndef DEFAULT_LCD_CONTRAST + #define DEFAULT_LCD_CONTRAST LCD_CONTRAST_INIT + #endif +#endif + /** * Override here because this is set in Configuration_adv.h */ @@ -270,21 +324,21 @@ #endif /** - * Power Supply Control + * Power Supply */ #ifndef PSU_NAME - #if ENABLED(PSU_CONTROL) - #if PSU_ACTIVE_HIGH - #define PSU_NAME "XBox" // X-Box 360 (203W) - #else - #define PSU_NAME "ATX" // ATX style - #endif + #if DISABLED(PSU_CONTROL) + #define PSU_NAME "Generic" // No control + #elif PSU_ACTIVE_HIGH + #define PSU_NAME "XBox" // X-Box 360 (203W) #else - #define PSU_NAME "Generic" // No control + #define PSU_NAME "ATX" // ATX style #endif #endif -#define HAS_POWER_SWITCH (ENABLED(PSU_CONTROL) && PIN_EXISTS(PS_ON)) +#if !defined(PSU_POWERUP_DELAY) && ENABLED(PSU_CONTROL) + #define PSU_POWERUP_DELAY 100 +#endif /** * Temp Sensor defines @@ -294,17 +348,22 @@ #define HAS_USER_THERMISTORS ANY_TEMP_SENSOR_IS(1000) -#if TEMP_SENSOR_0 == -4 - #define HEATER_0_USES_AD8495 -#elif TEMP_SENSOR_0 == -3 +#if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2 #define HEATER_0_USES_MAX6675 - #define MAX6675_IS_MAX31855 - #define HEATER_0_MAX6675_TMIN -270 - #define HEATER_0_MAX6675_TMAX 1800 -#elif TEMP_SENSOR_0 == -2 - #define HEATER_0_USES_MAX6675 - #define HEATER_0_MAX6675_TMIN 0 - #define HEATER_0_MAX6675_TMAX 1024 + #if TEMP_SENSOR_0 == -3 + #define HEATER_0_MAX6675_TMIN -270 + #define HEATER_0_MAX6675_TMAX 1800 + #else + #define HEATER_0_MAX6675_TMIN 0 + #define HEATER_0_MAX6675_TMAX 1024 + #endif + #if TEMP_SENSOR_0 == -5 + #define MAX6675_IS_MAX31865 + #elif TEMP_SENSOR_0 == -3 + #define MAX6675_IS_MAX31855 + #endif +#elif TEMP_SENSOR_0 == -4 + #define HEATER_0_USES_AD8495 #elif TEMP_SENSOR_0 == -1 #define HEATER_0_USES_AD595 #elif TEMP_SENSOR_0 > 0 @@ -318,22 +377,26 @@ #undef HEATER_0_MAXTEMP #endif -#if TEMP_SENSOR_1 == -4 - #define HEATER_1_USES_AD8495 -#elif TEMP_SENSOR_1 == -3 - #if TEMP_SENSOR_0 == -2 - #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." - #endif +#if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2 #define HEATER_1_USES_MAX6675 - #define HEATER_1_MAX6675_TMIN -270 - #define HEATER_1_MAX6675_TMAX 1800 -#elif TEMP_SENSOR_1 == -2 - #if TEMP_SENSOR_0 == -3 - #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_0 then TEMP_SENSOR_1 must match." + #if TEMP_SENSOR_1 == -3 + #define HEATER_1_MAX6675_TMIN -270 + #define HEATER_1_MAX6675_TMAX 1800 + #else + #define HEATER_1_MAX6675_TMIN 0 + #define HEATER_1_MAX6675_TMAX 1024 + #endif + #if TEMP_SENSOR_1 != TEMP_SENSOR_0 + #if TEMP_SENSOR_1 == -5 + #error "If MAX31865 Thermocouple (-5) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." + #elif TEMP_SENSOR_1 == -3 + #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." + #elif TEMP_SENSOR_1 == -2 + #error "If MAX6675 Thermocouple (-2) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." + #endif #endif - #define HEATER_1_USES_MAX6675 - #define HEATER_1_MAX6675_TMIN 0 - #define HEATER_1_MAX6675_TMAX 1024 +#elif TEMP_SENSOR_1 == -4 + #define HEATER_1_USES_AD8495 #elif TEMP_SENSOR_1 == -1 #define HEATER_1_USES_AD595 #elif TEMP_SENSOR_1 > 0 @@ -481,13 +544,13 @@ /** * ARRAY_BY_EXTRUDERS based on EXTRUDERS */ -#define ARRAY_BY_EXTRUDERS(...) ARRAY_N(EXTRUDERS, __VA_ARGS__) +#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) #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_HOTENDS(V...) ARRAY_N(HOTENDS, V) #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) /** @@ -498,26 +561,30 @@ #define TRINAMICS (HAS_TRINAMIC || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC2209_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) || HAS_DRIVER(TMC2160_STANDALONE)) -#ifndef MINIMUM_STEPPER_DIR_DELAY +#ifndef MINIMUM_STEPPER_POST_DIR_DELAY #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_DIR_DELAY 15000 + #define MINIMUM_STEPPER_POST_DIR_DELAY 15000 #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_DIR_DELAY 1500 + #define MINIMUM_STEPPER_POST_DIR_DELAY 1500 #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_DIR_DELAY 650 + #define MINIMUM_STEPPER_POST_DIR_DELAY 650 #elif HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_DIR_DELAY 500 + #define MINIMUM_STEPPER_POST_DIR_DELAY 500 #elif HAS_DRIVER(A5984) - #define MINIMUM_STEPPER_DIR_DELAY 400 + #define MINIMUM_STEPPER_POST_DIR_DELAY 400 #elif HAS_DRIVER(A4988) - #define MINIMUM_STEPPER_DIR_DELAY 200 + #define MINIMUM_STEPPER_POST_DIR_DELAY 200 #elif TRINAMICS - #define MINIMUM_STEPPER_DIR_DELAY 20 + #define MINIMUM_STEPPER_POST_DIR_DELAY 20 #else - #define MINIMUM_STEPPER_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire + #define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire #endif #endif +#ifndef MINIMUM_STEPPER_PRE_DIR_DELAY + #define MINIMUM_STEPPER_PRE_DIR_DELAY MINIMUM_STEPPER_POST_DIR_DELAY +#endif + #ifndef MINIMUM_STEPPER_PULSE #if HAS_DRIVER(TB6560) #define MINIMUM_STEPPER_PULSE 30 @@ -527,9 +594,13 @@ #define MINIMUM_STEPPER_PULSE 2 #elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984) #define MINIMUM_STEPPER_PULSE 1 - #elif HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_PULSE 0 #elif TRINAMICS + #if ENABLED(LIN_ADVANCE) && (HAS_TMC_STANDALONE_E_DRIVER || (HAS_TMC_E_DRIVER && DISABLED(SQUARE_WAVE_STEPPING))) + #define MINIMUM_STEPPER_PULSE 1 + #else + #define MINIMUM_STEPPER_PULSE 0 + #endif + #elif HAS_DRIVER(LV8729) #define MINIMUM_STEPPER_PULSE 0 #else #define MINIMUM_STEPPER_PULSE 2 @@ -772,12 +843,12 @@ // Is an endstop plug used for the Z2 endstop or the bed probe? #define IS_Z2_OR_PROBE(A,M) ( \ (Z_MULTI_ENDSTOPS && Z2_USE_ENDSTOP == _##A##M##_) \ - || (USES_Z_MIN_PROBE_ENDSTOP && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) + || (HAS_CUSTOM_PROBE_PIN && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) // Is an endstop plug used for the Z3 endstop or the bed probe? #define IS_Z3_OR_PROBE(A,M) ( \ (ENABLED(Z_TRIPLE_ENDSTOPS) && Z3_USE_ENDSTOP == _##A##M##_) \ - || (USES_Z_MIN_PROBE_ENDSTOP && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) + || (HAS_CUSTOM_PROBE_PIN && Z_MIN_PROBE_PIN == A##_##M##_PIN ) ) /** * Set ENDSTOPPULLUPS for active endstop switches @@ -909,7 +980,7 @@ #define HAS_TMCX1X0 (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2160) || HAS_DRIVER(TMC5130) || HAS_DRIVER(TMC5160)) #define TMC_HAS_SPI (HAS_TMCX1X0 || HAS_DRIVER(TMC2660)) #define HAS_STALLGUARD (HAS_TMCX1X0 || HAS_DRIVER(TMC2209) || HAS_DRIVER(TMC2660)) - #define HAS_STEALTHCHOP (HAS_TMCX1X0 || HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)) + #define HAS_STEALTHCHOP (HAS_TMCX1X0 || HAS_TMC220x) #define STEALTHCHOP_ENABLED ANY(STEALTHCHOP_XY, STEALTHCHOP_Z, STEALTHCHOP_E) #define USE_SENSORLESS EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) @@ -917,11 +988,25 @@ #if HOMING_Z_WITH_PROBE #undef Z_STALL_SENSITIVITY #endif - #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_STALL_SENSITIVITY)) - #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_STALL_SENSITIVITY)) - #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_STALL_SENSITIVITY)) + #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_STALL_SENSITIVITY)) + #define X2_SENSORLESS (AXIS_HAS_STALLGUARD(X2) && defined(X2_STALL_SENSITIVITY)) + #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_STALL_SENSITIVITY)) + #define Y2_SENSORLESS (AXIS_HAS_STALLGUARD(Y2) && defined(Y2_STALL_SENSITIVITY)) + #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_STALL_SENSITIVITY)) + #define Z2_SENSORLESS (AXIS_HAS_STALLGUARD(Z2) && defined(Z2_STALL_SENSITIVITY)) + #define Z3_SENSORLESS (AXIS_HAS_STALLGUARD(Z3) && defined(Z3_STALL_SENSITIVITY)) + #if ENABLED(SPI_ENDSTOPS) + #define X_SPI_SENSORLESS X_SENSORLESS + #define Y_SPI_SENSORLESS Y_SENSORLESS + #define Z_SPI_SENSORLESS Z_SENSORLESS + #endif #endif +#define HAS_E_STEPPER_ENABLE (HAS_E_DRIVER(TMC2660) \ + || ( E0_ENABLE_PIN != X_ENABLE_PIN && E1_ENABLE_PIN != X_ENABLE_PIN \ + && E0_ENABLE_PIN != Y_ENABLE_PIN && E1_ENABLE_PIN != Y_ENABLE_PIN ) \ +) + // Endstops and bed probe #define _HAS_STOP(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(X,MIN) @@ -938,7 +1023,7 @@ #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) #define HAS_Z3_MIN (PIN_EXISTS(Z3_MIN)) #define HAS_Z3_MAX (PIN_EXISTS(Z3_MAX)) -#define HAS_Z_MIN_PROBE_PIN (USES_Z_MIN_PROBE_ENDSTOP && PIN_EXISTS(Z_MIN_PROBE)) +#define HAS_Z_MIN_PROBE_PIN (HAS_CUSTOM_PROBE_PIN && PIN_EXISTS(Z_MIN_PROBE)) #define HAS_CALIBRATION_PIN (PIN_EXISTS(CALIBRATION)) // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) @@ -952,11 +1037,18 @@ #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_HOTEND (HOTENDS > 0 && (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 #define HAS_HEATED_CHAMBER (HAS_TEMP_CHAMBER && PIN_EXISTS(HEATER_CHAMBER)) +#if ENABLED(JOYSTICK) + #define HAS_JOY_ADC_X PIN_EXISTS(JOY_X) + #define HAS_JOY_ADC_Y PIN_EXISTS(JOY_Y) + #define HAS_JOY_ADC_Z PIN_EXISTS(JOY_Z) + #define HAS_JOY_ADC_EN PIN_EXISTS(JOY_EN) +#endif + // Heaters #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0)) #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1)) @@ -968,7 +1060,12 @@ // 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) +#define BED_OR_CHAMBER (HAS_HEATED_BED || HAS_TEMP_CHAMBER) +#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || BED_OR_CHAMBER) + +#if !HAS_TEMP_SENSOR + #undef AUTO_REPORT_TEMPERATURES +#endif // PID heating #if !HAS_HEATED_BED @@ -984,14 +1081,23 @@ #define WATCH_CHAMBER (HAS_HEATED_CHAMBER && ENABLED(THERMAL_PROTECTION_CHAMBER) && WATCH_CHAMBER_TEMP_PERIOD > 0) // Auto fans -#define HAS_AUTO_FAN_0 (PIN_EXISTS(E0_AUTO_FAN)) +#define HAS_AUTO_FAN_0 (HOTENDS > 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_5 (HOTENDS > 5 && PIN_EXISTS(E5_AUTO_FAN)) #define HAS_AUTO_CHAMBER_FAN (HAS_TEMP_CHAMBER && 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_FAN_4 || HAS_AUTO_FAN_5 || HAS_AUTO_CHAMBER_FAN) +#define _FANOVERLAP(A,B) (A##_AUTO_FAN_PIN == E##B##_AUTO_FAN_PIN) +#if HAS_AUTO_FAN + #define AUTO_CHAMBER_IS_E (_FANOVERLAP(CHAMBER,0) || _FANOVERLAP(CHAMBER,1) || _FANOVERLAP(CHAMBER,2) || _FANOVERLAP(CHAMBER,3) || _FANOVERLAP(CHAMBER,4) || _FANOVERLAP(CHAMBER,5)) +#endif + +#if !HAS_AUTO_CHAMBER_FAN || AUTO_CHAMBER_IS_E + #undef AUTO_POWER_CHAMBER_FAN +#endif // Other fans #define HAS_FAN0 (PIN_EXISTS(FAN)) @@ -1000,11 +1106,11 @@ #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) +#define HAS_SERVO_0 (PIN_EXISTS(SERVO0) && NUM_SERVOS > 0) +#define HAS_SERVO_1 (PIN_EXISTS(SERVO1) && NUM_SERVOS > 1) +#define HAS_SERVO_2 (PIN_EXISTS(SERVO2) && NUM_SERVOS > 2) +#define HAS_SERVO_3 (PIN_EXISTS(SERVO3) && NUM_SERVOS > 3) +#define HAS_SERVOS (NUM_SERVOS > 0) #if HAS_SERVOS && !defined(Z_PROBE_SERVO_NR) #define Z_PROBE_SERVO_NR -1 @@ -1024,7 +1130,8 @@ #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_BUZZER (PIN_EXISTS(BEEPER) || EITHER(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)) +#define USE_BEEPER (HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)) #define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)) // Digital control @@ -1153,10 +1260,17 @@ #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v) #endif +#ifndef MIN_POWER + #define MIN_POWER 0 +#endif + /** * Heated bed requires settings */ #if HAS_HEATED_BED + #ifndef MIN_BED_POWER + #define MIN_BED_POWER 0 + #endif #ifndef MAX_BED_POWER #define MAX_BED_POWER 255 #endif @@ -1208,8 +1322,15 @@ /** * MIN/MAX fan PWM scaling */ +#ifndef FAN_OFF_PWM + #define FAN_OFF_PWM 0 +#endif #ifndef FAN_MIN_PWM - #define FAN_MIN_PWM 0 + #if FAN_OFF_PWM > 0 + #define FAN_MIN_PWM (FAN_OFF_PWM + 1) + #else + #define FAN_MIN_PWM 0 + #endif #endif #ifndef FAN_MAX_PWM #define FAN_MAX_PWM 255 @@ -1220,6 +1341,8 @@ #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." +#elif FAN_OFF_PWM > FAN_MIN_PWM + #error "FAN_OFF_PWM must be less than or equal to FAN_MIN_PWM." #endif /** @@ -1229,6 +1352,17 @@ #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1)) // Fan frequency default #endif +/** + * MIN/MAX case light PWM scaling + */ +#if HAS_CASE_LIGHT + #ifndef CASE_LIGHT_MAX_PWM + #define CASE_LIGHT_MAX_PWM 255 + #elif !WITHIN(CASE_LIGHT_MAX_PWM, 1, 255) + #error "CASE_LIGHT_MAX_PWM must be a value from 1 to 255." + #endif +#endif + /** * Bed Probe dependencies */ @@ -1249,13 +1383,11 @@ #define XY_PROBE_SPEED 4000 #endif #endif + #ifndef NOZZLE_TO_PROBE_OFFSET + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } + #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 + #undef NOZZLE_TO_PROBE_OFFSET #endif /** @@ -1309,6 +1441,7 @@ #define PLANNER_LEVELING (HAS_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)) #define HAS_PROBING_PROCEDURE (HAS_ABL_OR_UBL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) #define HAS_POSITION_MODIFIERS (ENABLED(FWRETRACT) || HAS_LEVELING || ENABLED(SKEW_CORRECTION)) +#define NEEDS_THREE_PROBE_POINTS EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT) #if ENABLED(AUTO_BED_LEVELING_UBL) #undef LCD_BED_LEVELING @@ -1345,84 +1478,55 @@ #endif /** - * Bed Probing rectangular bounds - * These can be further constrained in code for Delta and SCARA + * Bed Probing bounds */ #ifndef MIN_PROBE_EDGE #define MIN_PROBE_EDGE 0 #endif +#if IS_KINEMATIC + #undef MIN_PROBE_EDGE_LEFT + #undef MIN_PROBE_EDGE_RIGHT + #undef MIN_PROBE_EDGE_FRONT + #undef MIN_PROBE_EDGE_BACK +#else + #ifndef MIN_PROBE_EDGE_LEFT + #define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + #endif + #ifndef MIN_PROBE_EDGE_RIGHT + #define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + #endif + #ifndef MIN_PROBE_EDGE_FRONT + #define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + #endif + #ifndef MIN_PROBE_EDGE_BACK + #define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE + #endif +#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 - _MAX(ABS(X_PROBE_OFFSET_FROM_EXTRUDER), ABS(Y_PROBE_OFFSET_FROM_EXTRUDER), ABS(MIN_PROBE_EDGE))) - #else - #define DELTA_CALIBRATION_RADIUS _PROBE_RADIUS - #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} + #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } #endif #ifndef DELTA_RADIUS_TRIM_TOWER - #define DELTA_RADIUS_TRIM_TOWER {0, 0, 0} + #define DELTA_RADIUS_TRIM_TOWER { 0, 0, 0 } #endif #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER - #define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0} + #define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0, 0, 0 } #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) - -#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. */ @@ -1437,17 +1541,10 @@ #define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET)) #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)) - #else - #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 + #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 NOZZLE_TO_PROBE_OFFSET 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)) #endif // These may be overridden in Configuration.h if a smaller area is desired @@ -1463,72 +1560,18 @@ #ifndef MESH_MAX_Y #define MESH_MAX_Y _MESH_MAX_Y #endif - -#endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL - -#if EITHER(AUTO_BED_LEVELING_UBL, 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) - #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) - #endif - #else - #ifndef PROBE_PT_1_X - #define PROBE_PT_1_X MIN_PROBE_X - #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 - #endif - #endif +#else + #undef MESH_MIN_X + #undef MESH_MIN_Y + #undef MESH_MAX_X + #undef MESH_MAX_Y #endif -#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) - #ifndef LEFT_PROBE_BED_POSITION - #define LEFT_PROBE_BED_POSITION MIN_PROBE_X - #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 +#if (defined(PROBE_PT_1_X) && defined(PROBE_PT_2_X) && defined(PROBE_PT_3_X) && defined(PROBE_PT_1_Y) && defined(PROBE_PT_2_Y) && defined(PROBE_PT_3_Y)) + #define HAS_FIXED_3POINT #endif + /** * Buzzer/Speaker */ @@ -1539,7 +1582,7 @@ #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 #endif -#else +#elif HAS_BUZZER #ifndef LCD_FEEDBACK_FREQUENCY_HZ #define LCD_FEEDBACK_FREQUENCY_HZ 5000 #endif @@ -1551,7 +1594,7 @@ /** * Make sure DOGLCD_SCK and DOGLCD_MOSI are defined. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD #ifndef DOGLCD_SCK #define DOGLCD_SCK SCK_PIN #endif @@ -1660,8 +1703,9 @@ #endif // Force SDCARD_SORT_ALPHA to be enabled for Graphical LCD on LPC1768 +// on boards where SD card and LCD display share the same SPI bus // because of a bug in the shared SPI implementation. (See #8122) -#if defined(TARGET_LPC1768) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) +#if defined(TARGET_LPC1768) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && (SCK_PIN == LCD_PINS_D4) #define SDCARD_SORT_ALPHA // Keeps one directory level in RAM. Changing // directory levels still glitches the screen, // but the following LCD update cleans it up. @@ -1703,33 +1747,35 @@ #define Z_STEPPER_COUNT 1 #endif -// Get LCD character width/height, which may be overridden by pins, configs, etc. -#ifndef LCD_WIDTH - #if HAS_GRAPHICAL_LCD - #define LCD_WIDTH 21 - #elif ENABLED(ULTIPANEL) - #define LCD_WIDTH 20 - #elif HAS_SPI_LCD - #define LCD_WIDTH 16 +#if HAS_SPI_LCD + // Get LCD character width/height, which may be overridden by pins, configs, etc. + #ifndef LCD_WIDTH + #if HAS_GRAPHICAL_LCD + #define LCD_WIDTH 21 + #elif ENABLED(ULTIPANEL) + #define LCD_WIDTH 20 + #else + #define LCD_WIDTH 16 + #endif #endif -#endif -#ifndef LCD_HEIGHT - #if HAS_GRAPHICAL_LCD - #define LCD_HEIGHT 5 - #elif ENABLED(ULTIPANEL) - #define LCD_HEIGHT 4 - #elif HAS_SPI_LCD - #define LCD_HEIGHT 2 + #ifndef LCD_HEIGHT + #if HAS_GRAPHICAL_LCD + #define LCD_HEIGHT 5 + #elif ENABLED(ULTIPANEL) + #define LCD_HEIGHT 4 + #else + #define LCD_HEIGHT 2 + #endif #endif #endif -// -// The external SD card is not used. Hardware SPI is used to access the card. -// When sharing the SD card with a PC we want the menu options to -// mount/unmount the card and refresh it. So we disable card detect. -// #if ENABLED(SDSUPPORT) #if SD_CONNECTION_IS(ONBOARD) && DISABLED(NO_SD_HOST_DRIVE) + // + // The external SD card is not used. Hardware SPI is used to access the card. + // When sharing the SD card with a PC we want the menu options to + // mount/unmount the card and refresh it. So we disable card detect. + // #undef SD_DETECT_PIN #define SHARED_SD_CARD #endif @@ -1737,3 +1783,14 @@ #define INIT_SDCARD_ON_BOOT #endif #endif + +#if !NUM_SERIAL + #undef BAUD_RATE_GCODE +#endif + +#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #undef Z_STEPPER_ALIGN_AMP +#endif +#ifndef Z_STEPPER_ALIGN_AMP + #define Z_STEPPER_ALIGN_AMP 1.0 +#endif diff --git a/Marlin/src/inc/MarlinConfig.h b/Marlin/src/inc/MarlinConfig.h index 94aa1939bac3..fc26862853bc 100644 --- a/Marlin/src/inc/MarlinConfig.h +++ b/Marlin/src/inc/MarlinConfig.h @@ -27,24 +27,19 @@ #include "MarlinConfigPre.h" -#include HAL_PATH(../HAL, HAL.h) +#include "../HAL/HAL.h" #include "../pins/pins.h" - #include HAL_PATH(../HAL, spi_pins.h) -#if defined(__AVR__) && !defined(USBCON) - #define HardwareSerial_h // trick to disable the standard HWserial -#endif - #include "Conditionals_post.h" -#include "SanityCheck.h" +#include HAL_PATH(../HAL, inc/Conditionals_post.h) -#include HAL_PATH(../HAL, SanityCheck.h) +#include "SanityCheck.h" +#include HAL_PATH(../HAL, inc/SanityCheck.h) // Include all core headers -#include "../core/enum.h" +#include "../core/types.h" #include "../core/language.h" #include "../core/utility.h" #include "../core/serial.h" -#include "../core/minmax.h" diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index ef998c654a9f..e11f171c6efd 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -21,19 +21,38 @@ */ #pragma once +#ifndef __MARLIN_FIRMWARE__ #define __MARLIN_FIRMWARE__ +#endif // // Prefix header to acquire configurations // +#include #include "../HAL/platforms.h" + #include "../core/boards.h" #include "../core/macros.h" -#include "../core/millis_t.h" -#include "Version.h" #include "../../Configuration.h" + +#ifdef CUSTOM_VERSION_FILE + #if defined(__has_include) + #if __has_include(XSTR(../../CUSTOM_VERSION_FILE)) + #include XSTR(../../CUSTOM_VERSION_FILE) + #endif + #else + #include XSTR(../../CUSTOM_VERSION_FILE) + #endif +#endif + +#include "Version.h" + #include "Conditionals_LCD.h" +#include HAL_PATH(../HAL, inc/Conditionals_LCD.h) + #include "../core/drivers.h" #include "../../Configuration_adv.h" + #include "Conditionals_adv.h" +#include HAL_PATH(../HAL, inc/Conditionals_adv.h) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b11d091e3a4e..d1e1e52b998b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -74,7 +74,9 @@ #elif defined(CUSTOM_MENDEL_NAME) #error "CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration." #elif defined(HAS_AUTOMATIC_VERSIONING) - #error "HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration." + #error "HAS_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." +#elif defined(USE_AUTOMATIC_VERSIONING) + #error "USE_AUTOMATIC_VERSIONING is now CUSTOM_VERSION_FILE. Please update your configuration." #elif defined(SDSLOW) #error "SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead." #elif defined(SDEXTRASLOW) @@ -227,6 +229,8 @@ #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions." #elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN) #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h." +#elif defined(PID_FAN_SCALING) && FAN_COUNT <= 0 + #error "PID_FAN_SCALING needs at least one fan enabled." #elif defined(min_software_endstops) || defined(max_software_endstops) #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration." #elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN) @@ -243,14 +247,24 @@ #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 ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS) + #error "Remove DELTA_CALIBRATION_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." + #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h." #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." + #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h." +#elif defined(LEFT_PROBE_BED_POSITION) + #error "LEFT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_LEFT. Please update your configuration." +#elif defined(RIGHT_PROBE_BED_POSITION) + #error "RIGHT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_RIGHT. Please update your configuration." +#elif defined(FRONT_PROBE_BED_POSITION) + #error "FRONT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_FRONT. Please update your configuration." +#elif defined(BACK_PROBE_BED_POSITION) + #error "BACK_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_BACK. 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) @@ -302,7 +316,7 @@ #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) +#elif DISABLED(CLASSIC_JERK) && 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." @@ -382,12 +396,43 @@ #error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_HIGH to 'true'." #elif defined(POWER_SUPPLY) #error "POWER_SUPPLY is now obsolete. Please remove it from Configuration.h." -#endif - -#define BOARD_MKS_13 -47 -#define BOARD_TRIGORILLA -343 -#define BOARD_RURAMPS4D -1550 -#define BOARD_FORMBOT_TREX2 -81 +#elif defined(MKS_ROBIN_TFT) + #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT. Please update your configuration." +#elif defined(SDPOWER) + #error "SDPOWER is now SDPOWER_PIN. Please update your configuration and/or pins." +#elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2) + #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them from Configuration.h." +#elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X) + #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting. Please update your configuration." +#elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER) + #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET. Please update your configuration." +#elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y) + #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them from Configuration.h." +#elif defined(Z_STEPPER_ALIGN_X) || defined(Z_STEPPER_ALIGN_X) + #error "Z_STEPPER_ALIGN_X and Z_STEPPER_ALIGN_Y are now combined as Z_STEPPER_ALIGN_XY. Please update your Configuration_adv.h." +#elif defined(JUNCTION_DEVIATION) + #error "JUNCTION_DEVIATION is no longer required. (See CLASSIC_JERK). Please remove it from Configuration.h." +#elif defined(BABYSTEP_MULTIPLICATOR) + #error "BABYSTEP_MULTIPLICATOR is now BABYSTEP_MULTIPLICATOR_[XY|Z]. Please update Configuration_adv.h." +#elif defined(LULZBOT_TOUCH_UI) + #error "LULZBOT_TOUCH_UI is now TOUCH_UI_FTDI_EVE. Please update your configuration." +#elif defined(PS_DEFAULT_OFF) + #error "PS_DEFAULT_OFF is now PSU_DEFAULT_OFF. Please update your configuration." +#elif defined(FILAMENT_UNLOAD_RETRACT_LENGTH) + #error "FILAMENT_UNLOAD_RETRACT_LENGTH is now FILAMENT_UNLOAD_PURGE_RETRACT. Please update Configuration_adv.h." +#elif defined(FILAMENT_UNLOAD_DELAY) + #error "FILAMENT_UNLOAD_DELAY is now FILAMENT_UNLOAD_PURGE_DELAY. Please update Configuration_adv.h." +#endif + +#define BOARD_MKS_13 -1000 +#define BOARD_TRIGORILLA -1001 +#define BOARD_RURAMPS4D -1002 +#define BOARD_FORMBOT_TREX2 -1003 +#define BOARD_BIQU_SKR_V1_1 -1004 +#define BOARD_STM32F1R -1005 +#define BOARD_STM32F103R -1006 +#define BOARD_ESP32 -1007 +#define BOARD_BIGTREE_SKR_MINI_E3 -1008 #if MB(MKS_13) #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." #elif MB(TRIGORILLA) @@ -396,11 +441,26 @@ #error "BOARD_RURAMPS4D has been renamed BOARD_RURAMPS4D_11. Please update your configuration." #elif MB(FORMBOT_TREX2) #error "FORMBOT_TREX2 has been renamed BOARD_FORMBOT_TREX2PLUS. Please update your configuration." +#elif MB(BIQU_SKR_V1_1) + #error "BOARD_BIQU_SKR_V1_1 has been renamed BOARD_BIGTREE_SKR_V1_1. Please update your configuration." +#elif MB(STM32F1R) + #error "BOARD_STM32F1R has been renamed BOARD_STM32F103RE. Please update your configuration." +#elif MB(STM32F103R) + #error "BOARD_STM32F103R has been renamed BOARD_STM32F103RE. Please update your configuration." +#elif MOTHERBOARD == BOARD_ESP32 + #error "BOARD_ESP32 has been renamed BOARD_ESPRESSIF_ESP32. Please update your configuration." +#elif MOTHERBOARD == BOARD_BIGTREE_SKR_MINI_E3 + #error "BOARD_BIGTREE_SKR_MINI_E3 has been renamed BOARD_BTT_SKR_MINI_E3_V1_0. Please update your configuration." #endif #undef BOARD_MKS_13 #undef BOARD_TRIGORILLA #undef BOARD_RURAMPS4D #undef BOARD_FORMBOT_TREX2 +#undef BOARD_BIQU_SKR_V1_1 +#undef BOARD_STM32F1R +#undef BOARD_STM32F103R +#undef BOARD_ESP32 +#undef BOARD_BIGTREE_SKR_MINI_E3 /** * Marlin release, version and default string @@ -490,14 +550,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if !defined(TARGET_LPC1768) && ( \ - ENABLED(ENDSTOPPULLDOWNS) \ - || ENABLED(ENDSTOPPULLDOWN_XMAX) \ - || ENABLED(ENDSTOPPULLDOWN_YMAX) \ - || ENABLED(ENDSTOPPULLDOWN_ZMAX) \ - || ENABLED(ENDSTOPPULLDOWN_XMIN) \ - || ENABLED(ENDSTOPPULLDOWN_YMIN) \ - || ENABLED(ENDSTOPPULLDOWN_ZMIN) ) +#if !defined(TARGET_LPC1768) && ANY( \ + ENDSTOPPULLDOWNS, \ + ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, \ + ENDSTOPPULLDOWN_ZMAX, ENDSTOPPULLDOWN_XMIN, \ + ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN \ + ) #error "PULLDOWN pin mode is not available on the selected board." #endif @@ -549,11 +607,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Graphical LCD, or EXTENSIBLE_UI." #endif +#if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu." +#endif + /** * Custom Boot and Status screens */ -#if DISABLED(DOGLCD) && EITHER(SHOW_CUSTOM_BOOTSCREEN, CUSTOM_STATUS_SCREEN_IMAGE) - #error "Graphical LCD is required for SHOW_CUSTOM_BOOTSCREEN and CUSTOM_STATUS_SCREEN_IMAGE." +#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && !(HAS_GRAPHICAL_LCD || ENABLED(TOUCH_UI_FTDI_EVE)) + #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE." +#elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_GRAPHICAL_LCD + #error "CUSTOM_STATUS_SCREEN_IMAGE requires a Graphical LCD." #endif /** @@ -598,7 +662,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * I2C Position Encoders */ #if ENABLED(I2C_POSITION_ENCODERS) - #if DISABLED(BABYSTEPPING) || DISABLED(BABYSTEP_XY) + #if !BOTH(BABYSTEPPING, BABYSTEP_XY) #error "I2C_POSITION_ENCODERS requires BABYSTEPPING and BABYSTEP_XY." #elif !WITHIN(I2CPE_ENCODER_CNT, 1, 5) #error "I2CPE_ENCODER_CNT must be between 1 and 5." @@ -617,7 +681,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination" #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE #error "BABYSTEP_ZPROBE_OFFSET requires a probe." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(DOGLCD) + #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !HAS_GRAPHICAL_LCD #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD." #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET) #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET." @@ -699,10 +763,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Marlin supports a maximum of 6 EXTRUDERS." #endif - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - #error "EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." - #endif - #if ENABLED(HEATERS_PARALLEL) #error "EXTRUDERS must be 1 with HEATERS_PARALLEL." #endif @@ -819,7 +879,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS */ #if ENABLED(MIXING_EXTRUDER) #if EXTRUDERS > 1 - #error "MIXING_EXTRUDER currently only supports one extruder." + #error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1." #elif MIXING_STEPPERS < 2 #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." #elif ENABLED(FILAMENT_SENSOR) @@ -884,7 +944,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Switching Toolhead requirements */ #if ENABLED(SWITCHING_TOOLHEAD) - #if !defined(SWITCHING_TOOLHEAD_SERVO_NR) + #ifndef SWITCHING_TOOLHEAD_SERVO_NR #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR." #elif EXTRUDERS < 2 #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS." @@ -905,12 +965,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if ANY(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - #if ENABLED(EXT_SOLENOID) - #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)" - #elif !PIN_EXISTS(SOL0) - #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN." - #elif !defined(SWITCHING_TOOLHEAD_Y_POS) +/** + * (Electro)magnetic Switching Toolhead requirements + */ +#if EITHER(MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #ifndef SWITCHING_TOOLHEAD_Y_POS #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_POS" #elif !defined(SWITCHING_TOOLHEAD_X_POS) #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_X_POS" @@ -918,6 +977,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP." #elif !defined(SWITCHING_TOOLHEAD_Y_CLEAR) #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Y_CLEAR." + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #if ENABLED(EXT_SOLENOID) + #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD and EXT_SOLENOID are incompatible. (Pins are used twice.)" + #elif !PIN_EXISTS(SOL0) + #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN." + #endif #endif #endif @@ -949,7 +1014,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Required LCD language */ -#if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780) +#if HAS_CHARACTER_LCD && !defined(DISPLAY_CHARSET_HD44780) #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller." #endif @@ -998,6 +1063,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif +/** + * Junction deviation is incompatible with kinematic systems. + */ +#if DISABLED(CLASSIC_JERK) && IS_KINEMATIC + #error "CLASSIC_JERK is required for DELTA and SCARA." +#endif + /** * Probes */ @@ -1014,15 +1086,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + ENABLED(SOLENOID_PROBE) \ + ENABLED(Z_PROBE_ALLEN_KEY) \ + ENABLED(Z_PROBE_SLED) \ - + ENABLED(RACK_AND_PINION_PROBE) - #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." + + ENABLED(RACK_AND_PINION_PROBE) \ + + ENABLED(SENSORLESS_PROBING) + #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." #endif #if HAS_BED_PROBE - static_assert(FLOOR(float(X_PROBE_OFFSET_FROM_EXTRUDER)) == float(X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer!"); - static_assert(FLOOR(float(Y_PROBE_OFFSET_FROM_EXTRUDER)) == float(Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer!"); - /** * Z_PROBE_SLED is incompatible with DELTA */ @@ -1063,7 +1133,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(BLTOUCH) #if BLTOUCH_DELAY < 200 #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported." - #elif DISABLED(BLTOUCH_SET_5V_MODE) && NONE(ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE) + #elif DISABLED(BLTOUCH_SET_5V_MODE) && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN, ENDSTOPPULLUP_ZMIN_PROBE) #error "BLTOUCH without BLTOUCH_SET_5V_MODE requires ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN or ENDSTOPPULLUP_ZMIN_PROBE." #endif #endif @@ -1088,6 +1158,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false." #elif DISABLED(BABYSTEP_ZPROBE_OFFSET) #error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET." + #elif !HAS_RESUME_CONTINUE + #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER." #endif #endif @@ -1172,15 +1244,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Bed Leveling Requirements */ -#if EITHER(AUTO_BED_LEVELING_UBL, 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) /** @@ -1213,20 +1276,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option." #endif - /** - * Check auto bed leveling probe points - */ - #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."); - - #endif - #elif ENABLED(MESH_BED_LEVELING) // Hide PROBE_MANUALLY from the rest of the code @@ -1245,14 +1294,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #if HAS_MESH - #if DISABLED(JUNCTION_DEVIATION) + #if HAS_CLASSIC_JERK static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); #endif #elif ENABLED(G26_MESH_VALIDATION) #error "G26_MESH_VALIDATION requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL." #endif -#if ENABLED(MESH_EDIT_GFX_OVERLAY) && (DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(DOGLCD)) +#if ENABLED(MESH_EDIT_GFX_OVERLAY) && !(ENABLED(AUTO_BED_LEVELING_UBL) && HAS_GRAPHICAL_LCD) #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD." #endif @@ -1294,9 +1343,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * 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."); + #if HAS_BED_PROBE && (ENABLED(DELTA) || IS_SCARA) + static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, PROBE_X_MIN, PROBE_X_MAX), "Z_SAFE_HOMING_X_POINT is outside the probe region."); + static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, PROBE_Y_MIN, PROBE_Y_MAX), "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."); @@ -1408,10 +1457,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif /** - * Test case light not using the same pin as the fan + * Case Light requirements */ -#if ENABLED(CASE_LIGHT_ENABLE) && CASE_LIGHT_PIN == FAN_PIN - #error "You cannot set CASE_LIGHT_PIN equal to FAN_PIN." +#if ENABLED(CASE_LIGHT_ENABLE) + #if !PIN_EXISTS(CASE_LIGHT) + #error "CASE_LIGHT_ENABLE requires CASE_LIGHT_PIN to be defined." + #elif CASE_LIGHT_PIN == FAN_PIN + #error "CASE_LIGHT_PIN conflicts with FAN_PIN. Resolve before continuing." + #endif #endif /** @@ -1446,8 +1499,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP, E0_DIR) || !HAS_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." +#elif EXTRUDERS && TEMP_SENSOR_0 == 0 + #error "TEMP_SENSOR_0 is required with any extruders." #endif // Pins are required for heaters @@ -1464,6 +1517,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." #elif !ANY_PIN(TEMP_1, MAX6675_SS2) #error "TEMP_1_PIN not defined for this board." + #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + #error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." #endif #if HOTENDS > 2 #if TEMP_SENSOR_2 == 0 @@ -1554,8 +1609,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * LED Backlight Timeout */ -#if defined(LED_BACKLIGHT_TIMEOUT) && !(EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && HAS_POWER_SWITCH) - #error "LED_BACKLIGHT_TIMEOUT requires a Fysetc Mini Panel and a Power Switch." +#if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)) + #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch." #endif /** @@ -1826,76 +1881,70 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Make sure only one display is enabled - * - * Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER - * 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 - * AZSMZ_12864 => ULTIMAKERCONTROLLER - * PANEL_ONE => ULTIMAKERCONTROLLER */ #if 1 < 0 \ - + ( ENABLED(ULTIMAKERCONTROLLER) \ - && DISABLED(SAV_3DGLCD) \ - && DISABLED(miniVIKI) \ - && DISABLED(VIKI2) \ - && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - && DISABLED(AZSMZ_12864) \ - && DISABLED(PANEL_ONE) \ - && DISABLED(MKS_12864OLED) \ - && DISABLED(MKS_12864OLED_SSD1306) ) \ - + ( 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(REPRAP_DISCOUNT_SMART_CONTROLLER) && DISABLED(IS_RRD_SC)) \ + + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(IS_RRD_FG_SC)) \ + + (ENABLED(ULTRA_LCD) && DISABLED(IS_ULTRA_LCD)) \ + + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \ + + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \ + + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(IS_RRW_KEYPAD)) \ + + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \ + + (ENABLED(ULTIPANEL) && DISABLED(IS_ULTIPANEL)) \ + + ENABLED(RADDS_DISPLAY) \ + + ENABLED(ULTIMAKERCONTROLLER) \ + ENABLED(PANEL_ONE) \ - + ENABLED(MAKRPANEL) \ - + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \ - + ENABLED(VIKI2) \ - + ENABLED(miniVIKI) \ - + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ - + ENABLED(AZSMZ_12864) \ + ENABLED(G3D_PANEL) \ - + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \ - + ENABLED(MKS_MINI_12864) \ - + ENABLED(FYSETC_MINI_12864_X_X) \ - + ENABLED(FYSETC_MINI_12864_1_2) \ - + ENABLED(FYSETC_MINI_12864_2_0) \ - + ENABLED(FYSETC_MINI_12864_2_1) \ - + (ENABLED(REPRAPWORLD_KEYPAD) && NONE(CARTESIO_UI, ZONESTAR_LCD)) \ + ENABLED(RIGIDBOT_PANEL) \ + + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ + + ENABLED(ZONESTAR_LCD) \ + 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) && NONE(OLED_PANEL_TINYBOY2, MKS_12864OLED_SSD1306)) \ + ENABLED(SAV_3DLCD) \ + + ENABLED(FF_INTERFACEBOARD) \ + + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \ + + ENABLED(VIKI2) \ + + ENABLED(miniVIKI) \ + + ENABLED(MAKRPANEL) \ + + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ + ENABLED(BQ_LCD_SMART_CONTROLLER) \ + + ENABLED(CARTESIO_UI) \ + + ENABLED(LCD_FOR_MELZI) \ + + ENABLED(ULTI_CONTROLLER) \ + + ENABLED(MKS_MINI_12864) \ + + ENABLED(FYSETC_MINI_12864_X_X) \ + + ENABLED(FYSETC_MINI_12864_1_2) \ + + ENABLED(FYSETC_MINI_12864_2_0) \ + + ENABLED(FYSETC_MINI_12864_2_1) \ + + ENABLED(CR10_STOCKDISPLAY) \ + + ENABLED(ANET_FULL_GRAPHICS_LCD) \ + + ENABLED(AZSMZ_12864) \ + + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \ + ENABLED(SAV_3DGLCD) \ + ENABLED(OLED_PANEL_TINYBOY2) \ - + ENABLED(ZONESTAR_LCD) \ - + ENABLED(ULTI_CONTROLLER) \ - + ENABLED(MALYAN_LCD) \ + + ENABLED(MKS_12864OLED) \ + + ENABLED(MKS_12864OLED_SSD1306) \ + + ENABLED(U8GLIB_SH1106_EINSTART) \ + + ENABLED(OVERLORD_OLED) \ + ENABLED(DGUS_LCD) \ - + (ENABLED(EXTENSIBLE_UI) && NONE(MALYAN_LCD, DGUS_LCD)) + + ENABLED(MALYAN_LCD) \ + + ENABLED(TOUCH_UI_FTDI_EVE) \ + + ENABLED(FSMC_GRAPHICAL_TFT) #error "Please select no more than one LCD controller option." #endif +#undef IS_RRD_SC +#undef IS_RRD_FG_SC +#undef IS_ULTRA_LCD +#undef IS_U8GLIB_SSD1306 +#undef IS_RRW_KEYPAD +#undef IS_EXTUI +#undef IS_ULTIPANEL + /** * FYSETC Mini 12864 RGB backlighting required */ @@ -2007,40 +2056,29 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * TMC2208/2209 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI) */ -#if (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)) && 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(Z3_HARDWARE_SERIAL) \ - || defined(E0_HARDWARE_SERIAL) \ - || defined(E1_HARDWARE_SERIAL) \ - || defined(E2_HARDWARE_SERIAL) \ - || defined(E3_HARDWARE_SERIAL) \ - || defined(E4_HARDWARE_SERIAL) \ +#if HAS_TMC220x && !defined(TARGET_LPC1768) && 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(Z3_HARDWARE_SERIAL) || defined(E0_HARDWARE_SERIAL) \ + || defined(E1_HARDWARE_SERIAL) || defined(E2_HARDWARE_SERIAL) \ + || defined(E3_HARDWARE_SERIAL) || defined(E4_HARDWARE_SERIAL) \ || defined(E5_HARDWARE_SERIAL) ) #error "Select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE." #endif /** - * TMC2208/2209 software UART is only supported on AVR and LPC + * TMC2208/2209 software UART is only supported on AVR, LPC, STM32F1 and STM32F4 */ -#if (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)) && !defined(__AVR__) && !defined(TARGET_LPC1768) && !( \ - 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) \ +#if HAS_TMC220x && !defined(__AVR__) && !defined(TARGET_LPC1768) && !defined(TARGET_STM32F1) && !defined(TARGET_STM32F4) && !( \ + 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(Z3_HARDWARE_SERIAL) || defined(E0_HARDWARE_SERIAL) \ + || defined(E1_HARDWARE_SERIAL) || defined(E2_HARDWARE_SERIAL) \ + || defined(E3_HARDWARE_SERIAL) || defined(E4_HARDWARE_SERIAL) \ || defined(E5_HARDWARE_SERIAL) ) - #error "TMC2208 Software Serial is supported only on AVR and LPC1768 platforms." + #error "TMC2208 Software Serial is supported only on AVR, LPC1768, STM32F1 and STM32F4 platforms." #endif #if ENABLED(SENSORLESS_HOMING) @@ -2057,18 +2095,54 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z) #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z." - #elif X_SENSORLESS && X_HOME_DIR == -1 && (X_MIN_ENDSTOP_INVERTING != X_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 != X_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 != Y_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 != Y_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 != Z_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 != Z_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMAX)) - #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX." + #elif X_SENSORLESS && X_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_XMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN." + #elif X_SENSORLESS && X_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_XMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX." + #elif Y_SENSORLESS && Y_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_YMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN." + #elif Y_SENSORLESS && Y_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_YMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX." + #elif Z_SENSORLESS && Z_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN." + #elif Z_SENSORLESS && Z_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX." + #elif X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING + #if X_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN." + #else + #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN." + #endif + #elif X_SENSORLESS && X_HOME_DIR > 0 && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING + #if X_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX." + #else + #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX." + #endif + #elif Y_SENSORLESS && Y_HOME_DIR < 0 && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING + #if Y_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN." + #else + #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN." + #endif + #elif Y_SENSORLESS && Y_HOME_DIR > 0 && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING + #if Y_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX." + #else + #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX." + #endif + #elif Z_SENSORLESS && Z_HOME_DIR < 0 && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING + #if Z_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN." + #else + #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN." + #endif + #elif Z_SENSORLESS && Z_HOME_DIR > 0 && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING + #if Z_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX." + #else + #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX." + #endif #elif ENDSTOP_NOISE_THRESHOLD #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD." #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS) @@ -2109,6 +2183,59 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers." #endif +#define IN_CHAIN(A) (A##_CHAIN_POS > 0) +// TMC SPI Chaining +#if IN_CHAIN(X) || IN_CHAIN(Y) || IN_CHAIN(Z) || IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) + #if (IN_CHAIN(X) && !PIN_EXISTS(X_CS) ) || (IN_CHAIN(Y) && !PIN_EXISTS(Y_CS) ) \ + || (IN_CHAIN(Z) && !PIN_EXISTS(Z_CS) ) || (IN_CHAIN(X2) && !PIN_EXISTS(X2_CS)) \ + || (IN_CHAIN(Y2) && !PIN_EXISTS(Y2_CS)) || (IN_CHAIN(Z2) && !PIN_EXISTS(Z2_CS)) \ + || (IN_CHAIN(Z3) && !PIN_EXISTS(Z3_CS)) || (IN_CHAIN(E0) && !PIN_EXISTS(E0_CS)) \ + || (IN_CHAIN(E1) && !PIN_EXISTS(E1_CS)) || (IN_CHAIN(E2) && !PIN_EXISTS(E2_CS)) \ + || (IN_CHAIN(E3) && !PIN_EXISTS(E3_CS)) || (IN_CHAIN(E4) && !PIN_EXISTS(E4_CS)) \ + || (IN_CHAIN(E5) && !PIN_EXISTS(E5_CS)) + #error "All chained TMC drivers need a CS pin." + #else + #if IN_CHAIN(X) + #define CS_COMPARE X_CS_PIN + #elif IN_CHAIN(Y) + #define CS_COMPARE Y_CS_PIN + #elif IN_CHAIN(Z) + #define CS_COMPARE Z_CS_PIN + #elif IN_CHAIN(X2) + #define CS_COMPARE X2_CS_PIN + #elif IN_CHAIN(Y2) + #define CS_COMPARE Y2_CS_PIN + #elif IN_CHAIN(Z2) + #define CS_COMPARE Z2_CS_PIN + #elif IN_CHAIN(Z3) + #define CS_COMPARE Z3_CS_PIN + #elif IN_CHAIN(E0) + #define CS_COMPARE E0_CS_PIN + #elif IN_CHAIN(E1) + #define CS_COMPARE E1_CS_PIN + #elif IN_CHAIN(E2) + #define CS_COMPARE E2_CS_PIN + #elif IN_CHAIN(E3) + #define CS_COMPARE E3_CS_PIN + #elif IN_CHAIN(E4) + #define CS_COMPARE E4_CS_PIN + #elif IN_CHAIN(E5) + #define CS_COMPARE E5_CS_PIN + #endif + #if (IN_CHAIN(X) && X_CS_PIN != CS_COMPARE) || (IN_CHAIN(Y) && Y_CS_PIN != CS_COMPARE) \ + || (IN_CHAIN(Z) && Z_CS_PIN != CS_COMPARE) || (IN_CHAIN(X2) && X2_CS_PIN != CS_COMPARE) \ + || (IN_CHAIN(Y2) && Y2_CS_PIN != CS_COMPARE) || (IN_CHAIN(Z2) && Z2_CS_PIN != CS_COMPARE) \ + || (IN_CHAIN(Z3) && Z3_CS_PIN != CS_COMPARE) || (IN_CHAIN(E0) && E0_CS_PIN != CS_COMPARE) \ + || (IN_CHAIN(E1) && E1_CS_PIN != CS_COMPARE) || (IN_CHAIN(E2) && E2_CS_PIN != CS_COMPARE) \ + || (IN_CHAIN(E3) && E3_CS_PIN != CS_COMPARE) || (IN_CHAIN(E4) && E4_CS_PIN != CS_COMPARE) \ + || (IN_CHAIN(E5) && E5_CS_PIN != CS_COMPARE) + #error "All chained TMC drivers must use the same CS pin." + #endif + #endif + #undef CS_COMPARE +#endif +#undef IN_CHAIN + #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z)) #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA." #endif @@ -2132,27 +2259,63 @@ constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT, #define _ARR_TEST(N,I) (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0) -static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements."); +static_assert(COUNT(sanity_arr_1) >= XYZE, "DEFAULT_AXIS_STEPS_PER_UNIT requires X, Y, Z and E elements."); static_assert(COUNT(sanity_arr_1) <= XYZE_N, "DEFAULT_AXIS_STEPS_PER_UNIT has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)"); static_assert( _ARR_TEST(1,0) && _ARR_TEST(1,1) && _ARR_TEST(1,2) && _ARR_TEST(1,3) && _ARR_TEST(1,4) && _ARR_TEST(1,5) && _ARR_TEST(1,6) && _ARR_TEST(1,7) && _ARR_TEST(1,8), "DEFAULT_AXIS_STEPS_PER_UNIT values must be positive."); -static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements."); +static_assert(COUNT(sanity_arr_2) >= XYZE, "DEFAULT_MAX_FEEDRATE requires X, Y, Z and E elements."); static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)"); static_assert( _ARR_TEST(2,0) && _ARR_TEST(2,1) && _ARR_TEST(2,2) && _ARR_TEST(2,3) && _ARR_TEST(2,4) && _ARR_TEST(2,5) && _ARR_TEST(2,6) && _ARR_TEST(2,7) && _ARR_TEST(2,8), "DEFAULT_MAX_FEEDRATE values must be positive."); -static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements."); +static_assert(COUNT(sanity_arr_3) >= XYZE, "DEFAULT_MAX_ACCELERATION requires X, Y, Z and E elements."); static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements. (Did you forget to enable DISTINCT_E_FACTORS?)"); static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) && _ARR_TEST(3,3) && _ARR_TEST(3,4) && _ARR_TEST(3,5) && _ARR_TEST(3,6) && _ARR_TEST(3,7) && _ARR_TEST(3,8), "DEFAULT_MAX_ACCELERATION values must be positive."); +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #ifdef MAX_ACCEL_EDIT_VALUES + constexpr float sanity_arr_4[] = MAX_ACCEL_EDIT_VALUES; + static_assert(COUNT(sanity_arr_4) >= XYZE, "MAX_ACCEL_EDIT_VALUES requires X, Y, Z and E elements."); + static_assert(COUNT(sanity_arr_4) <= XYZE, "MAX_ACCEL_EDIT_VALUES has too many elements. X, Y, Z and E elements only."); + static_assert( _ARR_TEST(4,0) && _ARR_TEST(4,1) && _ARR_TEST(4,2) + && _ARR_TEST(4,3) && _ARR_TEST(4,4) && _ARR_TEST(4,5) + && _ARR_TEST(4,6) && _ARR_TEST(4,7) && _ARR_TEST(4,8), + "MAX_ACCEL_EDIT_VALUES values must be positive."); + #endif +#endif + +#if ENABLED(LIMITED_MAX_FR_EDITING) + #ifdef MAX_FEEDRATE_EDIT_VALUES + constexpr float sanity_arr_5[] = MAX_FEEDRATE_EDIT_VALUES; + static_assert(COUNT(sanity_arr_5) >= XYZE, "MAX_FEEDRATE_EDIT_VALUES requires X, Y, Z and E elements."); + static_assert(COUNT(sanity_arr_5) <= XYZE, "MAX_FEEDRATE_EDIT_VALUES has too many elements. X, Y, Z and E elements only."); + static_assert( _ARR_TEST(5,0) && _ARR_TEST(5,1) && _ARR_TEST(5,2) + && _ARR_TEST(5,3) && _ARR_TEST(5,4) && _ARR_TEST(5,5) + && _ARR_TEST(5,6) && _ARR_TEST(5,7) && _ARR_TEST(5,8), + "MAX_FEEDRATE_EDIT_VALUES values must be positive."); + #endif +#endif + +#if ENABLED(LIMITED_JERK_EDITING) + #ifdef MAX_JERK_EDIT_VALUES + constexpr float sanity_arr_6[] = MAX_JERK_EDIT_VALUES; + static_assert(COUNT(sanity_arr_6) >= XYZE, "MAX_JERK_EDIT_VALUES requires X, Y, Z and E elements."); + static_assert(COUNT(sanity_arr_6) <= XYZE, "MAX_JERK_EDIT_VALUES has too many elements. X, Y, Z and E elements only."); + static_assert( _ARR_TEST(6,0) && _ARR_TEST(6,1) && _ARR_TEST(6,2) + && _ARR_TEST(6,3) && _ARR_TEST(6,4) && _ARR_TEST(6,5) + && _ARR_TEST(6,6) && _ARR_TEST(6,7) && _ARR_TEST(6,8), + "MAX_JERK_EDIT_VALUES values must be positive."); + #endif +#endif + #undef _ARR_TEST #if BOTH(CNC_COORDINATE_SYSTEMS, NO_WORKSPACE_OFFSETS) @@ -2185,21 +2348,29 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif -#if ENABLED(POWER_LOSS_RECOVERY) && DISABLED(ULTIPANEL) - #error "POWER_LOSS_RECOVERY currently requires an LCD Controller." +#if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS) + #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN." #endif #if ENABLED(Z_STEPPER_AUTO_ALIGN) + #if !Z_MULTI_STEPPER_DRIVERS #error "Z_STEPPER_AUTO_ALIGN requires Z_DUAL_STEPPER_DRIVERS or Z_TRIPLE_STEPPER_DRIVERS." #elif !HAS_BED_PROBE #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe." #endif - constexpr float sanity_arr_z_align_x[] = Z_STEPPER_ALIGN_X, sanity_arr_z_align_y[] = Z_STEPPER_ALIGN_Y; - static_assert( - COUNT(sanity_arr_z_align_x) == Z_STEPPER_COUNT && COUNT(sanity_arr_z_align_y) == Z_STEPPER_COUNT, - "Z_STEPPER_ALIGN_[XY]POS settings require one element per Z stepper." - ); + + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if DISABLED(Z_TRIPLE_STEPPER_DRIVERS) + #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS requires Z_TRIPLE_STEPPER_DRIVERS." + #endif + constexpr float sanity_arr_screw_xy[][2] = Z_STEPPER_ALIGN_STEPPER_XY; + static_assert( + COUNT(sanity_arr_screw_xy) == Z_STEPPER_COUNT, + "Z_STEPPER_ALIGN_STEPPER_XY requires three {X,Y} entries (one per Z stepper)." + ); + #endif + #endif #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS) @@ -2241,8 +2412,16 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif -#if ENABLED(BACKLASH_COMPENSATION) && IS_CORE - #error "BACKLASH_COMPENSATION is incompatible with CORE kinematics." +#if ENABLED(BACKLASH_COMPENSATION) + #if IS_CORE + #error "BACKLASH_COMPENSATION is incompatible with CORE kinematics." + #endif + #ifndef BACKLASH_DISTANCE_MM + #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM" + #endif + #ifndef BACKLASH_CORRECTION + #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION" + #endif #endif #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2 @@ -2253,7 +2432,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) * Photo G-code requirements */ #if ENABLED(PHOTO_GCODE) - #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH_PIN) + defined(PHOTO_SWITCH_POSITION)) > 1 + #if (PIN_EXISTS(CHDK) + PIN_EXISTS(PHOTOGRAPH) + defined(PHOTO_SWITCH_POSITION)) > 1 #error "Please define only one of CHDK_PIN, PHOTOGRAPH_PIN, or PHOTO_SWITCH_POSITION." #elif defined(PHOTO_SWITCH_POSITION) && !defined(PHOTO_POSITION) #error "PHOTO_SWITCH_POSITION requires PHOTO_POSITION. Please update your Configuration_adv.h." @@ -2306,8 +2485,14 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) /** * Ensure this option is set intentionally */ -#if ENABLED(PSU_CONTROL) && !defined(PSU_ACTIVE_HIGH) - #error "PSU_CONTROL requires PSU_ACTIVE_HIGH to be defined as 'true' or 'false'." +#if ENABLED(PSU_CONTROL) + #ifndef PSU_ACTIVE_HIGH + #error "PSU_CONTROL requires PSU_ACTIVE_HIGH to be defined as 'true' or 'false'." + #elif !PIN_EXISTS(PS_ON) + #error "PSU_CONTROL requires PS_ON_PIN." + #endif +#elif ENABLED(AUTO_POWER_CONTROL) + #error "AUTO_POWER_CONTROL requires PSU_CONTROL." #endif #if HAS_CUTTER @@ -2369,3 +2554,19 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #undef _PIN_CONFLICT #endif + +#if !HAS_GRAPHICAL_LCD + #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) + #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD." + #elif ENABLED(SHOW_REMAINING_TIME) + #error "SHOW_REMAINING_TIME currently requires a Graphical LCD." + #endif +#endif + +#if ENABLED(LIN_ADVANCE) && MINIMUM_STEPPER_PULSE < 1 + #if HAS_TMC_STANDALONE_E_DRIVER + #error "LIN_ADVANCE with TMC standalone driver on extruder requires MIMIMUM_STEPPER_PULSE >= 1" + #elif HAS_TMC_E_DRIVER && DISABLED(SQUARE_WAVE_STEPPING) + #error "LIN_ADVANCE with TMC driver on extruder requires SQUARE_WAVE_STEPPING or MINIMUM_STEPPER_PULSE >= 1" + #endif +#endif diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a38ce7a98126..f67928f1c064 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -21,77 +21,102 @@ */ #pragma once -#include "../core/macros.h" // for ENABLED - /** - * This file is the standard Marlin version identifier file. - * Use -DUSE_AUTOMATIC_VERSIONING=1 and a custom _Version.h - * to override these values. + * Release version. Leave the Marlin version or apply a custom scheme. */ - -#if ENABLED(USE_AUTOMATIC_VERSIONING) - - #include "_Version.h" - -#else - - /** - * Marlin release version identifier - */ +#ifndef SHORT_BUILD_VERSION #define SHORT_BUILD_VERSION "bugfix-2.0.x" +#endif - /** - * 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)" +/** + * Verbose version identifier containing a unique identifier, such as the + * vendor name, download location, GitHub account, etc. + */ +#ifndef DETAILED_BUILD_VERSION + #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (GitHub)" +#endif - /** - * 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-07-05" +/** + * 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. + */ +#ifndef STRING_DISTRIBUTION_DATE + #define STRING_DISTRIBUTION_DATE "2019-12-11" +#endif - /** - * Required minimum Configuration.h and Configuration_adv.h file versions. - * - * You must increment this version number for every significant change such as, - * but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on - * the configuration files. - */ - #define REQUIRED_CONFIGURATION_H_VERSION 020000 - #define REQUIRED_CONFIGURATION_ADV_H_VERSION 020000 +/** + * Minimum Configuration.h and Configuration_adv.h file versions. + * Set based on the release version number. Used to catch an attempt to use + * older configurations. Override these if using a custom versioning scheme + * to alert users to major changes. + */ - /** - * The protocol for communication to the host. Protocol indicates communication - * standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc. - * (Other behaviors are given by the firmware version and capabilities report.) - */ +#define MARLIN_HEX_VERSION 020000 +#ifndef REQUIRED_CONFIGURATION_H_VERSION + #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION +#endif +#ifndef REQUIRED_CONFIGURATION_ADV_H_VERSION + #define REQUIRED_CONFIGURATION_ADV_H_VERSION MARLIN_HEX_VERSION +#endif + +/** + * The protocol for communication to the host. Protocol indicates communication + * standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc. + * (Other behaviors are given by the firmware version and capabilities report.) + */ +#ifndef PROTOCOL_VERSION #define PROTOCOL_VERSION "1.0" +#endif - /** - * Defines a generic printer name to be output to the LCD after booting Marlin. - */ +/** + * Define a generic printer name to be output to the LCD after booting Marlin. + */ +#ifndef MACHINE_NAME #define MACHINE_NAME "3D Printer" +#endif - /** - * The SOURCE_CODE_URL is the location where users will find the Marlin Source - * Code which is installed on the device. In most cases —unless the manufacturer - * has a distinct Github fork— the Source Code URL should just be the main - * Marlin repository. - */ +/** + * Website where users can find Marlin source code for the binary installed on the + * device. Override this if you provide public source code download. (GPLv3 requires + * providing the source code to your customers.) + */ +#ifndef SOURCE_CODE_URL #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" +#endif - /** - * Default generic printer UUID. - */ +/** + * Default generic printer UUID. + */ +#ifndef DEFAULT_MACHINE_UUID #define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff" +#endif /** * The WEBSITE_URL is the location where users can get more information such as - * documentation about a specific Marlin release. + * documentation about a specific Marlin release. Displayed in the Info Menu. */ +#ifndef WEBSITE_URL #define WEBSITE_URL "http://marlinfw.org" +#endif -#endif // USE_AUTOMATIC_VERSIONING +/** + * Set the vendor info the serial USB interface, if changable + * Currently only supported by DUE platform + */ +#ifndef USB_DEVICE_VENDOR_ID + #define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */ +#endif +#ifndef USB_DEVICE_PRODUCT_ID + #define USB_DEVICE_PRODUCT_ID 0x2424 /* MSC / CDC */ +#endif +//! USB Device string definitions (Optional) +#ifndef USB_DEVICE_MANUFACTURE_NAME + #define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL +#endif +#ifdef CUSTOM_MACHINE_NAME + #define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME +#else + #define USB_DEVICE_PRODUCT_NAME MACHINE_NAME +#endif +#define USB_DEVICE_SERIAL_NAME "123985739853" diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index 08cc468d208e..af1fa56460bb 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -29,7 +29,7 @@ #endif extern LCD_CLASS lcd; -int lcd_glyph_height(void) { return 1; } +int lcd_glyph_height() { return 1; } typedef struct _hd44780_charmap_t { wchar_t uchar; // the unicode char @@ -877,7 +877,7 @@ static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data return hd44780_charmap_compare(&localval, (hd44780_charmap_t *)data_pin); } -void lcd_moveto(const uint8_t col, const uint8_t row) { lcd.setCursor(col, row); } +void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { lcd.setCursor(col, row); } void lcd_put_int(const int i) { lcd.print(i); } @@ -1012,7 +1012,7 @@ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { return 0; } - int test_hd44780_charmap_all(void) { + int test_hd44780_charmap_all() { int flg_error = 0; if (test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 0) < 0) { flg_error = 1; diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp index 888158c663ec..d6ce8bfdd637 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp @@ -47,7 +47,7 @@ #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../../feature/bedlevel/ubl/ubl.h" + #include "../../feature/bedlevel/bedlevel.h" #endif // @@ -111,6 +111,12 @@ static void createChar_P(const char c, const byte * const ptr) { #define LCD_STR_PROGRESS "\x03\x04\x05" #endif +#if ENABLED(LCD_USE_I2C_BUZZER) + void MarlinUI::buzz(const long duration, const uint16_t freq) { + lcd.buzz(duration, freq); + } +#endif + void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) { #if NONE(LCD_PROGRESS_BAR, SHOW_BOOTSCREEN) UNUSED(screen_charset); @@ -269,7 +275,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif // LCD_PROGRESS_BAR - #if ENABLED(SDSUPPORT) + #if ENABLED(SDSUPPORT) && HAS_LCD_MENU // CHARSET_MENU const static PROGMEM byte refresh[8] = { @@ -319,7 +325,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif { createChar_P(LCD_STR_UPLEVEL[0], uplevel); - #if ENABLED(SDSUPPORT) + #if ENABLED(SDSUPPORT) && HAS_LCD_MENU // SD Card sub-menu special characters createChar_P(LCD_STR_REFRESH[0], refresh); createChar_P(LCD_STR_FOLDER[0], folder); @@ -360,23 +366,48 @@ void MarlinUI::init_lcd() { lcd.clear(); } +bool MarlinUI::detected() { + return true + #if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE) + && lcd.LcdDetected() == 1 + #endif + ; +} + +#if HAS_SLOW_BUTTONS + uint8_t MarlinUI::read_slow_buttons() { + #if ENABLED(LCD_I2C_TYPE_MCP23017) + // Reading these buttons is too slow for interrupt context + // so they are read during LCD update in the main loop. + uint8_t slow_bits = lcd.readButtons() + #if !BUTTON_EXISTS(ENC) + << B_I2C_BTN_OFFSET + #endif + ; + #if ENABLED(LCD_I2C_VIKI) + if ((slow_bits & (B_MI | B_RI)) && PENDING(millis(), next_button_update_ms)) // LCD clicked + slow_bits &= ~(B_MI | B_RI); // Disable LCD clicked buttons if screen is updated + #endif + return slow_bits; + #endif // LCD_I2C_TYPE_MCP23017 + } +#endif + void MarlinUI::clear_lcd() { lcd.clear(); } #if ENABLED(SHOW_BOOTSCREEN) - void lcd_erase_line(const int16_t line) { + void lcd_erase_line(const lcd_uint_t line) { lcd_moveto(0, line); for (uint8_t i = LCD_WIDTH + 1; --i;) lcd_put_wchar(' '); } // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line - void lcd_scroll(const uint8_t col, const uint8_t line, PGM_P const text, const uint8_t len, const int16_t time) { + void lcd_scroll(const lcd_uint_t col, const lcd_uint_t line, PGM_P const text, const uint8_t len, const int16_t time) { uint8_t slen = utf8_strlen_P(text); if (slen < len) { - // Fits into, - lcd_moveto(col, line); - lcd_put_u8str_max_P(text, len); + lcd_put_u8str_max_P(col, line, text, len); for (; slen < len; ++slen) lcd_put_wchar(' '); safe_delay(time); } @@ -385,11 +416,8 @@ void MarlinUI::clear_lcd() { lcd.clear(); } int dly = time / _MAX(slen, 1); for (uint8_t i = 0; i <= slen; i++) { - // Go to the correct place - lcd_moveto(col, line); - - // Print the text - lcd_put_u8str_max_P(p, len); + // Print the text at the correct place + lcd_put_u8str_max_P(col, line, p, len); // Fill with spaces for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_wchar(' '); @@ -406,9 +434,9 @@ void MarlinUI::clear_lcd() { lcd.clear(); } static void logo_lines(PGM_P const extra) { int16_t indent = (LCD_WIDTH - 8 - utf8_strlen_P(extra)) / 2; - lcd_moveto(indent, 0); lcd_put_wchar('\x00'); lcd_put_u8str_P(PSTR( "------" )); lcd_put_wchar('\x01'); - lcd_moveto(indent, 1); lcd_put_u8str_P(PSTR("|Marlin|")); lcd_put_u8str_P(extra); - lcd_moveto(indent, 2); lcd_put_wchar('\x02'); lcd_put_u8str_P(PSTR( "------" )); lcd_put_wchar('\x03'); + lcd_put_wchar(indent, 0, '\x00'); lcd_put_u8str_P(PSTR( "------" )); lcd_put_wchar('\x01'); + lcd_put_u8str_P(indent, 1, PSTR("|Marlin|")); lcd_put_u8str_P(extra); + lcd_put_wchar(indent, 2, '\x02'); lcd_put_u8str_P(PSTR( "------" )); lcd_put_wchar('\x03'); } void MarlinUI::show_bootscreen() { @@ -420,67 +448,36 @@ void MarlinUI::clear_lcd() { lcd.clear(); } #define CENTER_OR_SCROLL(STRING,DELAY) \ lcd_erase_line(3); \ if (utf8_strlen(STRING) <= LCD_WIDTH) { \ - lcd_moveto((LCD_WIDTH - utf8_strlen_P(PSTR(STRING))) / 2, 3); \ - lcd_put_u8str_P(PSTR(STRING)); \ + lcd_put_u8str_P((LCD_WIDTH - utf8_strlen_P(PSTR(STRING))) / 2, 3, PSTR(STRING)); \ safe_delay(DELAY); \ } \ else { \ lcd_scroll(0, 3, PSTR(STRING), LCD_WIDTH, DELAY); \ } - #ifdef STRING_SPLASH_LINE1 - // - // Show the Marlin logo with splash line 1 - // - if (LCD_EXTRA_SPACE >= utf8_strlen(STRING_SPLASH_LINE1) + 1) { - // - // Show the Marlin logo, splash line1, and splash line 2 - // - logo_lines(PSTR(" " STRING_SPLASH_LINE1)); - #ifdef STRING_SPLASH_LINE2 - CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000); - #else - safe_delay(2000); - #endif - } - else { - // - // Show the Marlin logo with splash line 1 - // After a delay show splash line 2, if it exists - // - #ifdef STRING_SPLASH_LINE2 - #define _SPLASH_WAIT_1 1500 - #else - #define _SPLASH_WAIT_1 2000 - #endif - logo_lines(PSTR("")); - CENTER_OR_SCROLL(STRING_SPLASH_LINE1, _SPLASH_WAIT_1); - #ifdef STRING_SPLASH_LINE2 - CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 1500); - #ifdef STRING_SPLASH_LINE3 - CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500); - #endif - #endif - } - #elif defined(STRING_SPLASH_LINE2) + // + // Show the Marlin logo with splash line 1 + // + if (LCD_EXTRA_SPACE >= utf8_strlen(SHORT_BUILD_VERSION) + 1) { // - // Show splash line 2 only, alongside the logo if possible + // Show the Marlin logo, splash line1, and splash line 2 // - if (LCD_EXTRA_SPACE >= utf8_strlen(STRING_SPLASH_LINE2) + 1) { - logo_lines(PSTR(" " STRING_SPLASH_LINE2)); - safe_delay(2000); - } - else { - logo_lines(PSTR("")); - CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000); - } - #else + logo_lines(PSTR(" " SHORT_BUILD_VERSION)); + CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000); + } + else { // - // Show only the Marlin logo + // Show the Marlin logo and short build version + // After a delay show the website URL // - logo_lines(PSTR("")); - safe_delay(2000); - #endif + extern const char NUL_STR[]; + logo_lines(NUL_STR); + CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500); + CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500); + #ifdef STRING_SPLASH_LINE3 + CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500); + #endif + } lcd.clear(); safe_delay(100); @@ -491,16 +488,12 @@ void MarlinUI::clear_lcd() { lcd.clear(); } #endif // SHOW_BOOTSCREEN void MarlinUI::draw_kill_screen() { - lcd_moveto(0, 0); - lcd_put_u8str(status_message); - #if LCD_HEIGHT < 4 - lcd_moveto(0, 2); - #else - lcd_moveto(0, 2); - lcd_put_u8str_P(PSTR(MSG_HALTED)); - lcd_moveto(0, 3); + lcd_put_u8str(0, 0, status_message); + lcd_uint_t y = 2; + #if LCD_HEIGHT >= 4 + lcd_put_u8str_P(0, y++, GET_TEXT(MSG_HALTED)); #endif - lcd_put_u8str_P(PSTR(MSG_PLEASE_RESET)); + lcd_put_u8str_P(0, y, GET_TEXT(MSG_PLEASE_RESET)); } // @@ -568,17 +561,19 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const char pref FORCE_INLINE void _draw_bed_status(const bool blink) { _draw_heater_status(H_BED, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_STR_BEDTEMP[0] - ), blink); + #if HAS_LEVELING + planner.leveling_active && blink ? '_' : + #endif + LCD_STR_BEDTEMP[0] + ), + blink + ); } #if HAS_PRINT_PROGRESS FORCE_INLINE void _draw_print_progress() { - const uint8_t progress = ui.get_progress(); + const uint8_t progress = ui.get_progress_percent(); lcd_put_u8str_P(PSTR( #if ENABLED(SDSUPPORT) "SD" @@ -625,7 +620,7 @@ void MarlinUI::draw_status_message(const bool blink) { // Draw the progress bar if the message has shown long enough // or if there is no message set. if (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !has_status()) { - const uint8_t progress = get_progress(); + const uint8_t progress = get_progress_percent(); if (progress > 2) return draw_progress_bar(progress); } @@ -634,14 +629,9 @@ void MarlinUI::draw_status_message(const bool blink) { // Alternate Status message and Filament display if (ELAPSED(millis(), next_filament_display)) { lcd_put_u8str_P(PSTR("Dia ")); - lcd_put_u8str(ftostr12ns(filament_width_meas)); + lcd_put_u8str(ftostr12ns(filwidth.measured_mm)); lcd_put_u8str_P(PSTR(" V")); - lcd_put_u8str(i16tostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); + lcd_put_u8str(i16tostr3(planner.volumetric_percent(parser.volumetric_enabled))); lcd_put_wchar('%'); return; } @@ -832,22 +822,35 @@ void MarlinUI::draw_status_screen() { sprintf_P(mixer_messages, PSTR("%s %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); lcd_put_u8str(mixer_messages); - #else - - _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); - - lcd_put_wchar(' '); + #else // !DUAL_MIXING_EXTRUDER - _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); + if (true + #if ENABLED(LCD_SHOW_E_TOTAL) + && !printingIsActive() + #endif + ) { + xy_pos_t lpos = current_position; toLogical(lpos); + _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); + lcd_put_wchar(' '); + _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); + } + else { + #if ENABLED(LCD_SHOW_E_TOTAL) + char tmp[20]; + const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm + sprintf_P(tmp, PSTR("E %ld%cm "), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm + lcd_put_u8str(tmp); + #endif + } - #endif + #endif // !DUAL_MIXING_EXTRUDER #endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) #endif // LCD_WIDTH >= 20 lcd_moveto(LCD_WIDTH - 8, 1); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); + _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); #if HAS_LEVELING && !HAS_HEATED_BED lcd_put_wchar(planner.leveling_active || blink ? '_' : ' '); @@ -859,8 +862,7 @@ void MarlinUI::draw_status_screen() { #if LCD_HEIGHT > 3 - lcd_moveto(0, 2); - lcd_put_wchar(LCD_STR_FEEDRATE[0]); + lcd_put_wchar(0, 2, LCD_STR_FEEDRATE[0]); lcd_put_u8str(i16tostr3(feedrate_percentage)); lcd_put_wchar('%'); @@ -868,8 +870,7 @@ void MarlinUI::draw_status_screen() { duration_t elapsed = print_job_timer.duration(); const uint8_t len = elapsed.toDigital(buffer), timepos = LCD_WIDTH - len - 1; - lcd_moveto(timepos, 2); - lcd_put_wchar(LCD_STR_CLOCK[0]); + lcd_put_wchar(timepos, 2, LCD_STR_CLOCK[0]); lcd_put_u8str(buffer); #if LCD_WIDTH >= 20 @@ -880,7 +881,11 @@ void MarlinUI::draw_status_screen() { char c; uint16_t per; #if HAS_FAN0 - if (blink || thermalManager.fan_speed_scaler[0] < 128) { + if (true + #if EXTRUDERS && ENABLED(ADAPTIVE_FAN_SLOWING) + && (blink || thermalManager.fan_speed_scaler[0] < 128) + #endif + ) { uint16_t spd = thermalManager.fan_speed[0]; if (blink) c = 'F'; #if ENABLED(ADAPTIVE_FAN_SLOWING) @@ -891,8 +896,10 @@ void MarlinUI::draw_status_screen() { else #endif { - c = 'E'; - per = planner.flow_percentage[0]; + #if EXTRUDERS + c = 'E'; + per = planner.flow_percentage[0]; + #endif } lcd_put_wchar(c); lcd_put_u8str(i16tostr3(per)); @@ -915,11 +922,10 @@ void MarlinUI::draw_status_screen() { // Z Coordinate // lcd_moveto(LCD_WIDTH - 9, 0); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); + _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); #if HAS_LEVELING && (HOTENDS > 1 || !HAS_HEATED_BED) - lcd_moveto(LCD_WIDTH - 1, 0); - lcd_put_wchar(planner.leveling_active || blink ? '_' : ' '); + lcd_put_wchar(LCD_WIDTH - 1, 0, planner.leveling_active || blink ? '_' : ' '); #endif // ========== Line 2 ========== @@ -934,8 +940,7 @@ void MarlinUI::draw_status_screen() { _draw_bed_status(blink); #endif - lcd_moveto(LCD_WIDTH - 9, 1); - lcd_put_wchar(LCD_STR_FEEDRATE[0]); + lcd_put_wchar(LCD_WIDTH - 9, 1, LCD_STR_FEEDRATE[0]); lcd_put_u8str(i16tostr3(feedrate_percentage)); lcd_put_wchar('%'); @@ -980,6 +985,8 @@ void MarlinUI::draw_status_screen() { #if HAS_LCD_MENU + #include "../menu/menu.h" + #if ENABLED(ADVANCED_PAUSE_FEATURE) void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) { @@ -991,52 +998,55 @@ void MarlinUI::draw_status_screen() { #endif // ADVANCED_PAUSE_FEATURE - void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char *valstr/*=nullptr*/) { - UNUSED(invert); + // Draw a static item with no left-right margin required. Centered by default. + void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { int8_t n = LCD_WIDTH; lcd_moveto(0, row); - if (center && !valstr) { + if ((style & SS_CENTER) && !valstr) { int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd_put_wchar(' '); n--; } } - n -= lcd_put_u8str_max_P(pstr, n); + n = lcd_put_u8str_ind_P(pstr, itemIndex, n); if (valstr) n -= lcd_put_u8str_max(valstr, n); for (; n > 0; --n) lcd_put_wchar(' '); } - void draw_menu_item(const bool sel, const uint8_t row, PGM_P pstr, const char pre_char, const char post_char) { - uint8_t n = LCD_WIDTH - 2; - lcd_moveto(0, row); - lcd_put_wchar(sel ? pre_char : ' '); - n -= lcd_put_u8str_max_P(pstr, n); + // Draw a generic menu item with pre_char (if selected) and post_char + void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) { + lcd_put_wchar(0, row, sel ? pre_char : ' '); + uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2); for (; n; --n) lcd_put_wchar(' '); lcd_put_wchar(post_char); } - void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P pstr, const char* const data, const bool pgm) { - uint8_t n = LCD_WIDTH - 2 - (pgm ? utf8_strlen_P(data) : utf8_strlen(data)); - lcd_moveto(0, row); - lcd_put_wchar(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - n -= lcd_put_u8str_max_P(pstr, n); - lcd_put_wchar(':'); - for (; n; --n) lcd_put_wchar(' '); - if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str(data); + // Draw a menu item with a (potentially) editable value + void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { + const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0; + lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); + uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2 - vlen); + if (vlen) { + lcd_put_wchar(':'); + for (; n; --n) lcd_put_wchar(' '); + if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str(data); + } } - void draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { - lcd_moveto(0, 1); - lcd_put_u8str_P(pstr); + // Low-level draw_edit_screen can be used to draw an edit screen from anyplace + void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { + ui.encoder_direction_normal(); + + uint8_t n = lcd_put_u8str_ind_P(0, 1, pstr, itemIndex, LCD_WIDTH - 1); if (value != nullptr) { lcd_put_wchar(':'); int len = utf8_strlen(value); - const uint8_t valrow = (utf8_strlen_P(pstr) + 1 + len + 1) > (LCD_WIDTH - 2) ? 2 : 1; // Value on the next row if it won't fit - lcd_moveto((LCD_WIDTH - 1) - (len + 1), valrow); // Right-justified, padded by spaces - lcd_put_wchar(' '); // Overwrite char if value gets shorter + const lcd_uint_t valrow = (n < len + 1) ? 2 : 1; // Value on the next row if it won't fit + lcd_put_wchar((LCD_WIDTH - 1) - (len + 1), valrow, ' '); // Right-justified, padded, leading space lcd_put_u8str(value); } } - void draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff) { + // The Select Screen presents a prompt and two "buttons" + void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { ui.draw_select_screen_prompt(pref, string, suff); SETCURSOR(0, LCD_HEIGHT - 1); lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd_put_wchar(yesno ? ' ' : ']'); @@ -1046,29 +1056,30 @@ void MarlinUI::draw_status_screen() { #if ENABLED(SDSUPPORT) - void draw_sd_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir) { - UNUSED(pstr); - - lcd_moveto(0, row); - lcd_put_wchar(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); constexpr uint8_t maxlen = LCD_WIDTH - 2; uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); for (; n; --n) lcd_put_wchar(' '); lcd_put_wchar(isDir ? LCD_STR_FOLDER[0] : ' '); } - #endif // SDSUPPORT + #endif #if ENABLED(LCD_HAS_STATUS_INDICATORS) - static void MarlinUI::update_indicators() { + void MarlinUI::update_indicators() { // Set the LEDS - referred to as backlights by the LiquidTWI2 library static uint8_t ledsprev = 0; uint8_t leds = 0; - if (thermalManager.degTargetBed() > 0) leds |= LED_A; + #if HAS_HEATED_BED + if (thermalManager.degTargetBed() > 0) leds |= LED_A; + #endif - if (thermalManager.degTargetHotend(0) > 0) leds |= LED_B; + #if HOTENDS + if (thermalManager.degTargetHotend(0) > 0) leds |= LED_B; + #endif #if FAN_COUNT > 0 if (0 @@ -1142,9 +1153,9 @@ void MarlinUI::draw_status_screen() { } custom_char; typedef struct { - uint8_t column, row, - x_pixel_offset, y_pixel_offset, - x_pixel_mask; + lcd_uint_t column, row, + x_pixel_offset, y_pixel_offset; + uint8_t x_pixel_mask; } coordinate; void add_edges_to_custom_char(custom_char &custom, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cell_location); @@ -1172,22 +1183,21 @@ void MarlinUI::draw_status_screen() { return ret_val; } - inline coordinate pixel_location(const uint8_t x, const uint8_t y) { return pixel_location((int16_t)x, (int16_t)y); } + inline coordinate pixel_location(const lcd_uint_t x, const lcd_uint_t y) { return pixel_location((int16_t)x, (int16_t)y); } - void prep_and_put_map_char(custom_char &chrdata, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cl, const char c, const uint8_t x, const uint8_t y) { + void prep_and_put_map_char(custom_char &chrdata, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cl, const char c, const lcd_uint_t x, const lcd_uint_t y) { add_edges_to_custom_char(chrdata, ul, lr, brc, cl); lcd.createChar(c, (uint8_t*)&chrdata); - lcd_moveto(x, y); - lcd_put_wchar(c); + lcd_put_wchar(x, y, c); } - void MarlinUI::ubl_plot(const uint8_t x, const uint8_t inverted_y) { + void MarlinUI::ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { #if LCD_WIDTH >= 20 #define _LCD_W_POS 12 #define _PLOT_X 1 #define _MAP_X 3 - #define _LABEL(C,X,Y) lcd_moveto(X, Y); lcd_put_u8str(C) + #define _LABEL(C,X,Y) lcd_put_u8str(X, Y, C) #define _XLABEL(X,Y) _LABEL("X:",X,Y) #define _YLABEL(X,Y) _LABEL("Y:",X,Y) #define _ZLABEL(X,Y) _LABEL("Z:",X,Y) @@ -1195,7 +1205,7 @@ void MarlinUI::draw_status_screen() { #define _LCD_W_POS 8 #define _PLOT_X 0 #define _MAP_X 1 - #define _LABEL(X,Y,C) lcd_moveto(X, Y); lcd_put_wchar(C) + #define _LABEL(X,Y,C) lcd_put_wchar(X, Y, C) #define _XLABEL(X,Y) _LABEL('X',X,Y) #define _YLABEL(X,Y) _LABEL('Y',X,Y) #define _ZLABEL(X,Y) _LABEL('Z',X,Y) @@ -1207,10 +1217,9 @@ void MarlinUI::draw_status_screen() { * Show X and Y positions */ _XLABEL(_PLOT_X, 0); - lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); - + lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos(x_plot)))); _YLABEL(_LCD_W_POS, 0); - lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); + lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos(y_plot)))); lcd_moveto(_PLOT_X, 0); @@ -1218,13 +1227,13 @@ void MarlinUI::draw_status_screen() { coordinate upper_left, lower_right, bottom_right_corner; custom_char new_char; - uint8_t i, j, k, l, m, n, n_rows, n_cols, y, - bottom_line, right_edge, - x_map_pixels, y_map_pixels, - pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt, - suppress_x_offset = 0, suppress_y_offset = 0; + uint8_t i, n, n_rows, n_cols; + lcd_uint_t j, k, l, m, bottom_line, right_edge, + x_map_pixels, y_map_pixels, + pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt, + suppress_x_offset = 0, suppress_y_offset = 0; - y = GRID_MAX_POINTS_Y - inverted_y - 1; + const uint8_t y_plot_inv = (GRID_MAX_POINTS_Y - 1) - y_plot; upper_left.column = 0; upper_left.row = 0; @@ -1259,17 +1268,13 @@ void MarlinUI::draw_status_screen() { n_cols = right_edge / (HD44780_CHAR_WIDTH) + 1; for (i = 0; i < n_cols; i++) { - lcd_moveto(i, 0); - lcd_put_wchar(CHAR_LINE_TOP); // Box Top line - lcd_moveto(i, n_rows - 1); - lcd_put_wchar(CHAR_LINE_BOT); // Box Bottom line + lcd_put_wchar(i, 0, CHAR_LINE_TOP); // Box Top line + lcd_put_wchar(i, n_rows - 1, CHAR_LINE_BOT); // Box Bottom line } for (j = 0; j < n_rows; j++) { - lcd_moveto(0, j); - lcd_put_wchar(CHAR_EDGE_L); // Box Left edge - lcd_moveto(n_cols - 1, j); - lcd_put_wchar(CHAR_EDGE_R); // Box Right edge + lcd_put_wchar(0, j, CHAR_EDGE_L); // Box Left edge + lcd_put_wchar(n_cols - 1, j, CHAR_EDGE_R); // Box Right edge } /** @@ -1279,10 +1284,8 @@ void MarlinUI::draw_status_screen() { k = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 2; l = (HD44780_CHAR_HEIGHT) * n_rows; if (l > k && l - k >= (HD44780_CHAR_HEIGHT) / 2) { - lcd_moveto(0, n_rows - 1); // Box Left edge - lcd_put_wchar(' '); - lcd_moveto(n_cols - 1, n_rows - 1); // Box Right edge - lcd_put_wchar(' '); + lcd_put_wchar(0, n_rows - 1, ' '); // Box Left edge + lcd_put_wchar(n_cols - 1, n_rows - 1, ' '); // Box Right edge } clear_custom_char(&new_char); @@ -1308,12 +1311,12 @@ void MarlinUI::draw_status_screen() { new_char.custom_char_bits[j] = (uint8_t)_BV(i); // Char #3 is used for the box right edge lcd.createChar(CHAR_EDGE_R, (uint8_t*)&new_char); - i = x * pixels_per_x_mesh_pnt - suppress_x_offset; - j = y * pixels_per_y_mesh_pnt - suppress_y_offset; + i = x_plot * pixels_per_x_mesh_pnt - suppress_x_offset; + j = y_plot_inv * pixels_per_y_mesh_pnt - suppress_y_offset; upper_left = pixel_location(i, j); - k = (x + 1) * pixels_per_x_mesh_pnt - 1 - suppress_x_offset; - l = (y + 1) * pixels_per_y_mesh_pnt - 1 - suppress_y_offset; + k = (x_plot + 1) * pixels_per_x_mesh_pnt - 1 - suppress_x_offset; + l = (y_plot_inv + 1) * pixels_per_y_mesh_pnt - 1 - suppress_y_offset; lower_right = pixel_location(k, l); bottom_right_corner = pixel_location(x_map_pixels, y_map_pixels); @@ -1325,7 +1328,7 @@ void MarlinUI::draw_status_screen() { */ clear_custom_char(&new_char); - const uint8_t ypix = _MIN(upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, HD44780_CHAR_HEIGHT); + const lcd_uint_t ypix = _MIN(upper_left.y_pixel_offset + pixels_per_y_mesh_pnt, HD44780_CHAR_HEIGHT); 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++) { @@ -1396,11 +1399,10 @@ void MarlinUI::draw_status_screen() { /** * Print plot position */ - lcd_moveto(_LCD_W_POS, 0); - lcd_put_wchar('('); - lcd_put_u8str(ui8tostr3(x)); + lcd_put_wchar(_LCD_W_POS, 0, '('); + lcd_put_u8str(ui8tostr3(x_plot)); lcd_put_wchar(','); - lcd_put_u8str(ui8tostr3(inverted_y)); + lcd_put_u8str(ui8tostr3(y_plot)); lcd_put_wchar(')'); #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display @@ -1409,8 +1411,8 @@ void MarlinUI::draw_status_screen() { * Print Z values */ _ZLABEL(_LCD_W_POS, 1); - if (!isnan(ubl.z_values[x][inverted_y])) - lcd_put_u8str(ftostr43sign(ubl.z_values[x][inverted_y])); + if (!isnan(ubl.z_values[x_plot][y_plot])) + lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); else lcd_put_u8str_P(PSTR(" -----")); @@ -1420,16 +1422,16 @@ void MarlinUI::draw_status_screen() { * Show all values at right of screen */ _XLABEL(_LCD_W_POS, 1); - lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x])))); + lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos(x_plot)))); _YLABEL(_LCD_W_POS, 2); - lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[inverted_y])))); + lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos(y_plot)))); /** * Show the location value */ _ZLABEL(_LCD_W_POS, 3); - if (!isnan(ubl.z_values[x][inverted_y])) - lcd_put_u8str(ftostr43sign(ubl.z_values[x][inverted_y])); + if (!isnan(ubl.z_values[x_plot][y_plot])) + lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); else lcd_put_u8str_P(PSTR(" -----")); diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index c9b112ced8bc..427685cadb66 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -23,68 +23,99 @@ // Use this file to select the com driver for device drivers that are NOT in the U8G library -#ifndef U8G_HAL_LINKS +#include +#ifndef U8G_HAL_LINKS #ifdef __SAM3X8E__ + uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_DUE_sw_spi_fn uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_DUE_sw_spi_fn + #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_DUE_ST7920_sw_spi_fn + + #elif defined(__SAMD51__) + + #define U8G_COM_HAL_HW_SPI_FN u8g_com_samd51_hw_spi_fn + #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_samd51_st7920_hw_spi_fn + #elif defined(__STM32F1__) + uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_STM32F1_sw_spi_fn - uint8_t u8g_com_arduino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn - uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn - #else + uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_STM32F1_sw_spi_fn + #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn + #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_std_sw_spi_fn + #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_stm32duino_hw_spi_fn + + #elif defined(ARDUINO_ARCH_STM32) + + uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn + + #elif defined(__AVR__) + uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_AVR_sw_sp_fn // AVR ? - uint8_t u8g_com_arduino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn - uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_AVR_sw_sp_fn + + #endif + + #ifndef U8G_COM_HAL_SW_SPI_FN + #define U8G_COM_HAL_SW_SPI_FN u8g_com_arduino_std_sw_spi_fn + #endif + #ifndef U8G_COM_HAL_HW_SPI_FN + #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn + #endif + #ifndef U8G_COM_ST7920_HAL_SW_SPI #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn #endif + #ifndef U8G_COM_ST7920_HAL_HW_SPI + #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn + #endif - uint8_t u8g_com_arduino_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn + #ifdef TARGET_LPC1768 + uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #endif - uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn + #define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn - #if defined(ARDUINO_ARCH_STM32F1) && PIN_EXISTS(FSMC_CS) + #if PIN_EXISTS(FSMC_CS) uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_FSMC_FN u8g_com_stm32duino_fsmc_fn - #else - #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn + #define U8G_COM_HAL_FSMC_FN u8g_com_stm32duino_fsmc_fn #endif -#elif TARGET_LPC1768 - uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_LPC1768_sw_spi_fn - uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_LPC1768_hw_spi_fn +#elif defined(TARGET_LPC1768) + uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_LPC1768_ST7920_sw_spi_fn - uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_HAL_LPC1768_ST7920_hw_spi_fn - uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_SSD_I2C_HAL u8g_com_HAL_LPC1768_ssd_hw_i2c_fn + #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_LPC1768_sw_spi_fn + #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_LPC1768_hw_spi_fn + #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_LPC1768_ST7920_sw_spi_fn + #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_HAL_LPC1768_ST7920_hw_spi_fn + #define U8G_COM_SSD_I2C_HAL u8g_com_HAL_LPC1768_ssd_hw_i2c_fn - #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn +#endif -#else // need to give them some definition or else get compiler errors - uint8_t u8g_com_null_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_null_fn - #define U8G_COM_HAL_HW_SPI_FN u8g_com_null_fn +#ifndef U8G_COM_HAL_SW_SPI_FN + #define U8G_COM_HAL_SW_SPI_FN u8g_com_null_fn +#endif +#ifndef U8G_COM_HAL_HW_SPI_FN + #define U8G_COM_HAL_HW_SPI_FN u8g_com_null_fn +#endif +#ifndef U8G_COM_ST7920_HAL_SW_SPI #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_null_fn +#endif +#ifndef U8G_COM_ST7920_HAL_HW_SPI #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_null_fn - #define U8G_COM_SSD_I2C_HAL u8g_com_null_fn - #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn +#endif +#ifndef U8G_COM_SSD_I2C_HAL + #define U8G_COM_SSD_I2C_HAL u8g_com_null_fn +#endif +#ifndef U8G_COM_HAL_FSMC_FN + #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn #endif diff --git a/Marlin/src/lcd/dogm/dogm_Bootscreen.h b/Marlin/src/lcd/dogm/dogm_Bootscreen.h index 7f0c175124a5..ea8ce5e38a3a 100644 --- a/Marlin/src/lcd/dogm/dogm_Bootscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Bootscreen.h @@ -35,7 +35,7 @@ #include "../../../_Bootscreen.h" #ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH - #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH ((CUSTOM_BOOTSCREEN_BMPWIDTH + 7) / 8) + #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8) #endif #ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT #define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH)) @@ -69,6 +69,142 @@ B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; + #if ENABLED(BOOT_MARLIN_LOGO_ANIMATED) + + const unsigned char start_bmp1[] 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, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char start_bmp2[] 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,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000111, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000011, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char start_bmp3[] 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,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000000,B00000000,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000000,B00000000,B00000000,B00000011, + B10001100,B00110000,B11011100,B11100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11010000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011100,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11001111,B01110000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000111,B01110000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char start_bmp4[] 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,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10000000,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000111,B11000000,B00000000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11100000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01100000,B00000000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char start_bmp5[] 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,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00001100,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10001100,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000111,B11001100,B00000000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11101100,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01101100,B00000000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00001100,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00001100,B00000000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00001110,B00000000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000111,B10000000,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000011,B10000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char start_bmp6[] 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,B00000111, + B10001100,B00110000,B11001111,B11000111,B11001100,B00110000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11101100,B00110000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01101100,B00110000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00001100,B00110000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00001100,B00110000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00001110,B00111000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000111,B10011100,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000011,B10001100,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + #endif + #else #define START_BMPWIDTH 112 @@ -114,10 +250,269 @@ B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 }; + #if ENABLED(BOOT_MARLIN_LOGO_ANIMATED) + + const unsigned char start_bmp1[] 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,B00000000,B00000000,B00000000,B00111111,B11111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,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 + }; + + const unsigned char start_bmp2[] 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,B00000000,B00000000,B00000000,B00111111,B11111111, + B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111, + B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, + B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111, + B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111, + B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,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 + }; + + const unsigned char start_bmp3[] 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,B00000000,B00000000,B00000000,B00111111,B11111111, + B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111, + B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, + B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111, + B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111, + B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,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 + }; + + const unsigned char start_bmp4[] 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,B00000000,B00000000,B00000000,B00111111,B11111111, + B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111, + B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, + B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111, + B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111, + B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B00000000,B00000000,B00000000,B00000000,B00111111, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B00000000,B00000000,B00000000,B00000000,B00011111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00001111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B00000000,B00000000,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B00000000,B00000000,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,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 + }; + + const unsigned char start_bmp5[] 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,B00000000,B00000000,B00011111,B11111111, + B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00001111,B11111111, + B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000111,B11111111, + B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,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,B00000000,B00000000,B00000000,B01111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00000000,B00000000,B00000000,B00111111, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00000000,B00000000,B00000000,B00011111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00000000,B00000000,B00000000,B00001111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00000000,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00000000,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B00000000,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B00000000,B00000000,B00000000,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 + }; + + const unsigned char start_bmp6[] 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,B00000000,B00000000,B01111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000000,B00000000,B00111111, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00000000,B00000000,B00011111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00000000,B00000000,B00001111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00000000,B00000000,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B00000000,B00000000,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B00000000,B00000000,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 + }; + + #endif + +#endif + +#if ENABLED(BOOT_MARLIN_LOGO_ANIMATED) + #ifndef MARLIN_BOOTSCREEN_FRAME_TIME + #define MARLIN_BOOTSCREEN_FRAME_TIME 100 // (ms) + #endif + const unsigned char * const marlin_bootscreen_animation[] PROGMEM = { + start_bmp1, start_bmp2, start_bmp3, start_bmp4, start_bmp5, start_bmp6, start_bmp + }; #endif #ifndef START_BMP_BYTEWIDTH - #define START_BMP_BYTEWIDTH ((START_BMPWIDTH + 7) / 8) + #define START_BMP_BYTEWIDTH CEILING(START_BMPWIDTH, 8) #endif #ifndef START_BMPHEIGHT #define START_BMPHEIGHT (sizeof(start_bmp) / (START_BMP_BYTEWIDTH)) diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index 6f0d10831adb..f9bfd00cec9a 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -29,11 +29,14 @@ */ #include "../../inc/MarlinConfig.h" +#include "ultralcd_DOGM.h" #define BW(N) ((N + 7) / 8) -#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) +#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && DISABLED(STATUS_COMBINE_HEATERS) + #undef STATUS_HEATERS_X + #undef STATUS_BED_X /** * Custom _Statusscreen.h files can define: * - A custom logo image @@ -50,54 +53,44 @@ #endif -#if ENABLED(STATUS_COMBINE_HEATERS) - #undef STATUS_HOTEND_ANIM - #undef STATUS_BED_ANIM -#endif - // // Default Status Screen Heater or Hotends bitmaps // - #if !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH #if ENABLED(STATUS_COMBINE_HEATERS) + #undef STATUS_HOTEND_ANIM + #undef STATUS_BED_ANIM + #define STATUS_HEATERS_XSPACE 24 + // // Status Screen Combined Heater bitmaps // - - #if HAS_HEATED_BED && HOTENDS == 0 - #define STATUS_HEATERS_X 80 - #endif - - #if HAS_HEATED_BED && HOTENDS <= 3 - - #define STATUS_BED_WIDTH 21 + #if HAS_HEATED_BED && HOTENDS <= 4 #if HOTENDS == 0 - #define STATUS_HEATERS_WIDTH 21 + #define STATUS_HEATERS_WIDTH 96 const unsigned char status_heaters_bmp[] PROGMEM = { - B00000100,B00010000,B01000000, - B00000010,B00001000,B00100000, - B00000010,B00001000,B00100000, - B00000100,B00010000,B01000000, - B00001000,B00100000,B10000000, - B00010000,B01000001,B00000000, - B00010000,B01000001,B00000000, - B00001000,B00100000,B10000000, - B00000100,B00010000,B01000000, - B00000000,B00000000,B00000000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 }; #elif HOTENDS == 1 - #define STATUS_HEATERS_WIDTH 90 - #define STATUS_BED_X 80 + #define STATUS_HEATERS_WIDTH 96 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, @@ -116,7 +109,7 @@ #elif HOTENDS == 2 - #define STATUS_HEATERS_WIDTH 90 + #define STATUS_HEATERS_WIDTH 96 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, @@ -133,9 +126,9 @@ B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 }; - #else // HOTENDS > 2 + #elif HOTENDS == 3 - #define STATUS_HEATERS_WIDTH 90 + #define STATUS_HEATERS_WIDTH 96 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, @@ -152,13 +145,38 @@ B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000 }; + #else // HOTENDS > 3 + + #define STATUS_HEATERS_WIDTH 120 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00000100,B00010000,B01000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00001000,B00100000,B10000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00001000,B00100000,B10000000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000 + }; + #endif // HOTENDS + #define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10) + #else // !HAS_HEATED_BED || HOTENDS > 3 - #if HOTENDS == 1 + #if HOTENDS == 0 + + #define STATUS_HEATERS_WIDTH 0 + + #elif HOTENDS == 1 - #define STATUS_HEATERS_WIDTH 11 + #define STATUS_HEATERS_WIDTH 12 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000, @@ -213,7 +231,7 @@ B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 }; - #elif HOTENDS > 3 + #elif HOTENDS == 4 #define STATUS_HEATERS_WIDTH 84 @@ -232,6 +250,25 @@ B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 }; + #else // HOTENDS > 4 + + #define STATUS_HEATERS_WIDTH 108 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111000,B01110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B11110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00111000,B11110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00011111,B01100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00011111,B01100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00111100,B11110000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 + }; + #endif // HOTENDS #endif // !HAS_HEATED_BED || HOTENDS > 3 @@ -241,10 +278,16 @@ // // Status Screen Hotends bitmaps // - #if HOTENDS - #define STATUS_HOTEND1_WIDTH 12 + #define STATUS_HOTEND1_WIDTH 16 + + #define MAX_HOTEND_BITMAPS 5 + #if HOTENDS > MAX_HOTEND_BITMAPS + #define STATUS_HOTEND_BITMAPS MAX_HOTEND_BITMAPS + #else + #define STATUS_HOTEND_BITMAPS HOTENDS + #endif #if HOTENDS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS) @@ -282,116 +325,101 @@ #endif - #else - - #if HOTENDS >= 2 - - #if HAS_HEATED_BED - #define MAX_HOTEND_BITMAPS 3 - #else - #define MAX_HOTEND_BITMAPS 4 - #endif - #if HOTENDS > MAX_HOTEND_BITMAPS - #define STATUS_HOTEND_BITMAPS MAX_HOTEND_BITMAPS - #else - #define STATUS_HOTEND_BITMAPS HOTENDS - #endif - - #ifdef STATUS_HOTEND_ANIM + #elif HOTENDS >= 2 - const unsigned char status_hotend1_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111110,B11110000, - B00111100,B11110000, - B00011010,B11100000, - B00011110,B11100000, - B00111110,B11110000, - B00111110,B11110000, - B00111110,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; + #ifdef STATUS_HOTEND_ANIM - const unsigned char status_hotend1_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100001,B00010000, - B00100011,B00010000, - B00010101,B00100000, - B00010001,B00100000, - B00100001,B00010000, - B00100001,B00010000, - B00110001,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; + const unsigned char status_hotend1_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111110,B11110000, + B00111100,B11110000, + B00011010,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111110,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; - const unsigned char status_hotend2_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111100,B11110000, - B00111011,B01110000, - B00011111,B01100000, - B00011110,B11100000, - B00111101,B11110000, - B00111011,B11110000, - B00111000,B01110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; + const unsigned char status_hotend1_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100001,B00010000, + B00100011,B00010000, + B00010101,B00100000, + B00010001,B00100000, + B00100001,B00010000, + B00100001,B00010000, + B00110001,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; - const unsigned char status_hotend2_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100011,B00010000, - B00100100,B10010000, - B00010000,B10100000, - B00010001,B00100000, - B00100010,B00010000, - B00100100,B00010000, - B00110111,B10110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; + const unsigned char status_hotend2_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011110,B11100000, + B00111101,B11110000, + B00111011,B11110000, + B00111000,B01110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; - #else + const unsigned char status_hotend2_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010001,B00100000, + B00100010,B00010000, + B00100100,B00010000, + B00110111,B10110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; - const unsigned char status_hotend1_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111110,B11110000, - B00111100,B11110000, - B00111010,B11110000, - B00011110,B11100000, - B00011110,B11100000, - B00111110,B11110000, - B00111110,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; + #else - const unsigned char status_hotend2_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111100,B11110000, - B00111011,B01110000, - B00111111,B01110000, - B00011110,B11100000, - B00011101,B11100000, - B00111011,B11110000, - B00111000,B01110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; + const unsigned char status_hotend1_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111110,B11110000, + B00111100,B11110000, + B00111010,B11110000, + B00011110,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; - #endif + const unsigned char status_hotend2_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011110,B11100000, + B00011101,B11100000, + B00111011,B11110000, + B00111000,B01110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; #endif @@ -450,7 +478,7 @@ #endif - #if STATUS_HOTEND_BITMAPS >= 4 && !HAS_HEATED_BED + #if STATUS_HOTEND_BITMAPS >= 4 #ifdef STATUS_HOTEND_ANIM @@ -505,7 +533,7 @@ #endif - #if STATUS_HOTEND_BITMAPS >= 5 && !HAS_HEATED_BED + #if STATUS_HOTEND_BITMAPS >= 5 #ifdef STATUS_HOTEND_ANIM @@ -562,26 +590,126 @@ #endif + #else + #define STATUS_HEATERS_HEIGHT 20 #endif #endif #endif // !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH +// LASER / SPINDLE +#if !STATUS_CUTTER_WIDTH && HAS_CUTTER + #define STATUS_CUTTER_WIDTH 24 + #define STATUS_CUTTER_X 80 + #if ENABLED(LASER_FEATURE) + #ifdef STATUS_CUTTER_ANIM + const unsigned char status_cutter_on_bmp[] PROGMEM = { + B00000000,B00100100,B00000000, + B00000000,B01100110,B00000000, + B00000000,B11000011,B00000000, + B00000001,B10011001,B10000000, + B00000011,B00100100,B11000000, + B00000000,B01000010,B00000000, + B00000000,B01000010,B00000000, + B00000011,B00100100,B11000000, + B00000001,B10011001,B10000000, + B00000000,B11000011,B00000000, + B00000000,B01100110,B00000000, + B00000000,B00100100,B00000000 + }; + const unsigned char status_cutter_bmp[] PROGMEM = { + B00000000,B00100100,B00000000, + B00000000,B01100110,B00000000, + B00000000,B00000000,B00000000, + B00000001,B00000000,B10000000, + B00000011,B00000000,B11000000, + B00000000,B00011000,B00000000, + B00000000,B00011000,B00000000, + B00000011,B00000000,B11000000, + B00000001,B00000000,B10000000, + B00000000,B00000000,B00000000, + B00000000,B01100110,B00000000, + B00000000,B00100100,B00000000 + }; + #else + const unsigned char status_cutter_bmp[] PROGMEM = { + B00000000,B00100100,B00000000, + B00000000,B01100110,B00000000, + B00000000,B11000011,B00000000, + B00000001,B10000001,B10000000, + B00000011,B00000000,B11000000, + B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000, + B00000011,B00000000,B11000000, + B00000001,B10000001,B10000000, + B00000000,B11000011,B00000000, + B00000000,B01100110,B00000000, + B00000000,B00100100,B00000000 + }; + #endif + #else + #ifdef STATUS_CUTTER_ANIM + const unsigned char status_cutter_on_bmp[] PROGMEM = { + B00000001,B11111110,B10000000, + B00000000,B11000000,B00000000, + B00000001,B10000000,B10000000, + B00000001,B00000000,B10000000, + B00000001,B11111100,B10000000, + B00000000,B11100000,B00000000, + B00000001,B11000000,B10000000, + B00000000,B10000001,B00000000, + B00000000,B01111010,B00000000, + B00000000,B00110100,B00000000, + B00000000,B00011000,B00000000, + B00000000,B00000000,B00000000 + }; + const unsigned char status_cutter_bmp[] PROGMEM = { + B00000001,B11111110,B10000000, + B00000000,B11000000,B00000000, + B00000001,B10000000,B10000000, + B00000001,B00000000,B10000000, + B00000001,B11111100,B10000000, + B00000000,B11100000,B00000000, + B00000001,B11000000,B10000000, + B00000000,B10000001,B00000000, + B00000000,B01111010,B00000000, + B00000000,B00110100,B00000000, + B00000000,B00011000,B00000000, + B00000000,B00000000,B00000000 + }; + #else + const unsigned char status_cutter_bmp[] PROGMEM = { + B00000001,B11000010,B10000000, + B00000001,B00011100,B10000000, + B00000000,B11100001,B00000000, + B00000001,B00001110,B10000000, + B00000001,B01110000,B10000000, + B00000000,B10000111,B10000000, + B00000001,B00111111,B10000000, + B00000000,B11111111,B00000000, + B00000000,B01111110,B00000000, + B00000000,B00111100,B00000000, + B00000000,B00011000,B00000000, + B00000000,B00000000,B00000000 + }; + #endif + #endif +#endif // LASER / SPINDLE + // // Default Status Screen Bed bitmaps // - -#if !STATUS_BED_WIDTH && DISABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_BED && HOTENDS < 4 +#if !STATUS_BED_WIDTH && HAS_HEATED_BED && DISABLED(STATUS_COMBINE_HEATERS) #if ENABLED(STATUS_ALT_BED_BITMAP) #define STATUS_BED_ANIM #define STATUS_BED_WIDTH 24 #ifndef STATUS_BED_X - #define STATUS_BED_X 72 + #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) #endif - #define STATUS_BED_TEXT_X (STATUS_BED_X + 13) + #define STATUS_BED_TEXT_X (STATUS_BED_X + 11) const unsigned char status_bed_bmp[] PROGMEM = { B11111111,B11111111,B11000000, @@ -612,7 +740,7 @@ #define STATUS_BED_WIDTH 21 #ifndef STATUS_BED_X - #define STATUS_BED_X 80 + #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) #endif #ifdef STATUS_BED_ANIM @@ -657,81 +785,100 @@ #endif #endif +#else + #define STATUS_BED_WIDTH 0 +#endif -#endif // !STATUS_BED_WIDTH && !STATUS_COMBINE_HEATERS && HAS_HEATED_BED && HOTENDS < 4 - -#if HAS_HEATED_CHAMBER - - #define STATUS_CHAMBER_WIDTH 16 +#if !STATUS_CHAMBER_WIDTH && HAS_TEMP_CHAMBER && ((HOTENDS <= 4 && !HAS_HEATED_BED) || (HOTENDS <= 3 && HAS_HEATED_BED)) + #define STATUS_CHAMBER_WIDTH 21 + #if STATUS_HEATERS_WIDTH + #if ENABLED(STATUS_COMBINE_HEATERS) + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_CHAMBER_BYTEWIDTH) * 8) + #elif HAS_FAN0 && HAS_HEATED_BED && HOTENDS <= 2 + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_HEATERS_BYTEWIDTH - STATUS_CHAMBER_BYTEWIDTH) * 8) + #elif HAS_FAN0 && !HAS_HEATED_BED + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) + #else + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH) * 8) + #endif + #endif #ifdef STATUS_CHAMBER_ANIM const unsigned char status_chamber_bmp[] PROGMEM = { - B11111111,B11111111, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B11111111,B11111111, - B11111111,B11111111 + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 }; - const unsigned char status_chamber_on_bmp[] PROGMEM = { - B11111111,B11111111, - B10000000,B00000001, - B10000100,B00100001, - B10000010,B00010001, - B10000010,B00010001, - B10000100,B00100001, - B10001000,B01000001, - B10001000,B01000001, - B10000100,B00100001, - B10000000,B00000001, - B11111111,B11111111, - B11111111,B11111111 + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B01000010,B00001000, + B00010000,B01000010,B00001000, + B00010000,B10000100,B00001000, + B00010001,B00001000,B00001000, + B00010001,B00001000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 }; #else const unsigned char status_chamber_bmp[] PROGMEM = { - B11111111,B11111111, - B10000000,B00000001, - B10000100,B00100001, - B10000010,B00010001, - B10000010,B00010001, - B10000100,B00100001, - B10001000,B01000001, - B10001000,B01000001, - B10000100,B00100001, - B10000000,B00000001, - B11111111,B11111111, - B11111111,B11111111 + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B01000010,B00001000, + B00010000,B01000010,B00001000, + B00010000,B10000100,B00001000, + B00010001,B00001000,B00001000, + B00010001,B00001000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 }; #endif +#else // HAS_HEATED_CHAMBER + #define STATUS_CHAMBER_WIDTH 0 +#endif -#endif // HAS_HEATED_CHAMBER +#define BED_OR_CHAMBER_OR_FAN (BED_OR_CHAMBER || HAS_FAN0) -// Can also be overridden in Configuration.h +// Can also be overridden in Configuration_adv.h // If you can afford it, try the 3-frame fan animation! // Don't compile in the fan animation with no fan -#if !HAS_FAN0 +#if !HAS_FAN0 || (HOTENDS == 5 || (HOTENDS == 4 && BED_OR_CHAMBER) || (ENABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_CHAMBER)) #undef STATUS_FAN_FRAMES -#elif !defined(STATUS_FAN_FRAMES) +#elif !STATUS_FAN_FRAMES #define STATUS_FAN_FRAMES 2 #elif STATUS_FAN_FRAMES > 4 #error "A maximum of 4 fan animation frames is currently supported." #endif +#if HOTENDS > 4 + #undef STATUS_LOGO_WIDTH + #undef STATUS_HEATERS_XSPACE + #define STATUS_HEATERS_XSPACE 24 +#endif + // // Provide default Fan Bitmaps // -#if !defined(STATUS_FAN_WIDTH) && STATUS_FAN_FRAMES > 0 +#if !STATUS_FAN_WIDTH && STATUS_FAN_FRAMES > 0 // Provide a fan animation if none exists @@ -836,7 +983,7 @@ #elif STATUS_FAN_FRAMES == 3 - #define STATUS_FAN_WIDTH 21 + #define STATUS_FAN_WIDTH 20 #if ENABLED(STATUS_ALT_FAN_BITMAP) @@ -974,7 +1121,7 @@ #elif STATUS_FAN_FRAMES == 4 - #define STATUS_FAN_WIDTH 21 + #define STATUS_FAN_WIDTH 20 #if ENABLED(STATUS_ALT_FAN_BITMAP) @@ -1153,6 +1300,57 @@ #endif // !STATUS_ALT_FAN_BITMAP #endif +#else + #undef STATUS_FAN_FRAMES + #define STATUS_FAN_WIDTH 0 +#endif + +#define _EXTRA_WIDTH (STATUS_FAN_WIDTH + STATUS_CHAMBER_WIDTH + STATUS_BED_WIDTH) + +// +// Heater Bitmap X Space Requirements +// +#if !defined(STATUS_HEATERS_XSPACE) && (STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH) + #if (HOTENDS == 3 || HOTENDS == 4) && ENABLED(STATUS_COMBINE_HEATERS) + // If more heaters or they're combined, 3 bytes + #define STATUS_HEATERS_XSPACE 24 + #elif STATUS_LOGO_WIDTH > (LCD_PIXEL_WIDTH - (_EXTRA_WIDTH) - 26 * (HOTENDS)) // 128 - (20 + 24 + 26) == 58 + // If the logo won't fit at 26 width + #define STATUS_HEATERS_XSPACE 24 + #else + #define STATUS_HEATERS_XSPACE 26 + #endif +#endif + +#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) + + // + // Disable the logo bitmap if insufficient space + // + #if STATUS_HEATERS_XSPACE + #define _HEATERS_WIDTH (HOTENDS * (STATUS_HEATERS_XSPACE)) // as many hotends as possible + #elif STATUS_HEATERS_WIDTH + #define _HEATERS_WIDTH STATUS_HEATERS_WIDTH + #elif HOTENDS + #error "Status screen heaters region was not specified." + #endif + #if STATUS_LOGO_WIDTH > (LCD_PIXEL_WIDTH - (_EXTRA_WIDTH + _HEATERS_WIDTH)) + #warning "Unable to fit custom Status Screen logo. Disabling." + #undef STATUS_LOGO_WIDTH + #endif + + #if (HOTENDS > 1 && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN) + #define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2) + #if STATUS_HOTEND1_WIDTH + #if HOTENDS > 2 + #define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 6) + #else + #define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 4) + #endif + #else + #define STATUS_HEATERS_X _STATUS_HEATERS_X(1, STATUS_HEATERS_WIDTH, 4) + #endif + #endif #endif @@ -1182,22 +1380,21 @@ #endif // -// Heater Bitmap Properties +// Hotend Heater Bitmap starting X position // -#if STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH - - #ifndef STATUS_HEATERS_XSPACE - #define STATUS_HEATERS_XSPACE 24 // Like the included bitmaps - #endif - - #ifndef STATUS_HEATERS_X - #if STATUS_LOGO_BYTEWIDTH - #define STATUS_HEATERS_X ((STATUS_LOGO_BYTEWIDTH + 0) * 8) +#if !defined(STATUS_HEATERS_X) && (STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH) + #if STATUS_LOGO_BYTEWIDTH + #define STATUS_HEATERS_X (STATUS_LOGO_BYTEWIDTH * 8) + #elif ((STATUS_CHAMBER_WIDTH || STATUS_FAN_WIDTH) && (STATUS_BED_WIDTH && STATUS_HOTEND_BITMAPS == 3)) || \ + ((STATUS_CHAMBER_WIDTH || STATUS_FAN_WIDTH || STATUS_BED_WIDTH) && STATUS_HOTEND_BITMAPS == 4) + #define STATUS_HEATERS_X 5 + #else + #if ENABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_BED && HOTENDS <= 4 + #define STATUS_HEATERS_X 5 #else #define STATUS_HEATERS_X 8 // Like the included bitmaps #endif #endif - #endif #if STATUS_HOTEND1_WIDTH @@ -1205,7 +1402,6 @@ // // Hotend images. A base hotend image and optional "ON" state image. // - #ifndef STATUS_HOTEND_BITMAPS #define STATUS_HOTEND_BITMAPS 1 #endif @@ -1220,10 +1416,10 @@ #define STATUS_HOTEND4_WIDTH STATUS_HOTEND3_WIDTH #endif #ifndef STATUS_HOTEND5_WIDTH - #define STATUS_HOTEND5_WIDTH STATUS_HOTEND5_WIDTH + #define STATUS_HOTEND5_WIDTH STATUS_HOTEND4_WIDTH #endif #ifndef STATUS_HOTEND6_WIDTH - #define STATUS_HOTEND6_WIDTH STATUS_HOTEND6_WIDTH + #define STATUS_HOTEND6_WIDTH STATUS_HOTEND5_WIDTH #endif constexpr uint8_t status_hotend_width[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_WIDTH, STATUS_HOTEND2_WIDTH, STATUS_HOTEND3_WIDTH, STATUS_HOTEND4_WIDTH, STATUS_HOTEND5_WIDTH, STATUS_HOTEND6_WIDTH); @@ -1257,20 +1453,21 @@ #ifndef STATUS_HOTEND2_X #define STATUS_HOTEND2_X STATUS_HOTEND1_X + STATUS_HEATERS_XSPACE #endif - #ifndef STATUS_HOTEND3_X - #define STATUS_HOTEND3_X STATUS_HOTEND2_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND4_X - #define STATUS_HOTEND4_X STATUS_HOTEND3_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND5_X - #define STATUS_HOTEND5_X STATUS_HOTEND5_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND6_X - #define STATUS_HOTEND6_X STATUS_HOTEND6_X + STATUS_HEATERS_XSPACE - #endif #if HOTENDS > 2 + #ifndef STATUS_HOTEND3_X + #define STATUS_HOTEND3_X STATUS_HOTEND2_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND4_X + #define STATUS_HOTEND4_X STATUS_HOTEND3_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND5_X + #define STATUS_HOTEND5_X STATUS_HOTEND4_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND6_X + #define STATUS_HOTEND6_X STATUS_HOTEND5_X + STATUS_HEATERS_XSPACE + #endif + constexpr uint8_t status_hotend_x[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_X, STATUS_HOTEND2_X, STATUS_HOTEND3_X, STATUS_HOTEND4_X, STATUS_HOTEND5_X, STATUS_HOTEND6_X); #define STATUS_HOTEND_X(N) status_hotend_x[N] #elif HOTENDS > 1 @@ -1291,10 +1488,10 @@ #define STATUS_HOTEND4_TEXT_X STATUS_HOTEND3_TEXT_X + STATUS_HEATERS_XSPACE #endif #ifndef STATUS_HOTEND5_TEXT_X - #define STATUS_HOTEND5_TEXT_X STATUS_HOTEND5_TEXT_X + STATUS_HEATERS_XSPACE + #define STATUS_HOTEND5_TEXT_X STATUS_HOTEND4_TEXT_X + STATUS_HEATERS_XSPACE #endif #ifndef STATUS_HOTEND6_TEXT_X - #define STATUS_HOTEND6_TEXT_X STATUS_HOTEND6_TEXT_X + STATUS_HEATERS_XSPACE + #define STATUS_HOTEND6_TEXT_X STATUS_HOTEND5_TEXT_X + STATUS_HEATERS_XSPACE #endif constexpr uint8_t status_hotend_text_x[] = ARRAY_N(HOTENDS, STATUS_HOTEND1_TEXT_X, STATUS_HOTEND2_TEXT_X, STATUS_HOTEND3_TEXT_X, STATUS_HOTEND4_TEXT_X, STATUS_HOTEND5_TEXT_X, STATUS_HOTEND6_TEXT_X); #define STATUS_HOTEND_TEXT_X(N) status_hotend_text_x[N] @@ -1303,7 +1500,7 @@ #endif #endif - #if STATUS_HOTEND_BITMAPS > 1 + #if STATUS_HOTEND_BITMAPS > 1 && DISABLED(STATUS_HOTEND_NUMBERLESS) #define TEST_BITMAP_OFF status_hotend1_a_bmp #define TEST_BITMAP_ON status_hotend1_b_bmp #else @@ -1341,7 +1538,11 @@ #define STATUS_HOTEND_X(N) (STATUS_HEATERS_X + 2 + (N) * (STATUS_HEATERS_XSPACE)) #endif #ifndef STATUS_HOTEND_TEXT_X - #define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) + #if HOTENDS == 4 && STATUS_LOGO_WIDTH + #define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) + #else + #define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) + #endif #endif #ifndef STATUS_HEATERS_BYTEWIDTH #define STATUS_HEATERS_BYTEWIDTH BW(STATUS_HEATERS_WIDTH) @@ -1358,21 +1559,68 @@ "Status heaters bitmap (status_heaters_bmp) dimensions don't match data." ); +#else // HOTENDS == 0 + + #define STATUS_HOTEND_TEXT_X(N) 0 + #define STATUS_HEATERS_Y 0 + #endif // -// Chamber Bitmap Properties +// Cutter Bitmap Properties // -#ifndef STATUS_CHAMBER_WIDTH - #define STATUS_CHAMBER_WIDTH 0 +#ifndef STATUS_CUTTER_BYTEWIDTH + #define STATUS_CUTTER_BYTEWIDTH BW(STATUS_CUTTER_WIDTH) #endif +#if STATUS_CUTTER_WIDTH + + #ifndef STATUS_CUTTER_X + #define STATUS_CUTTER_X (LCD_PIXEL_WIDTH - (STATUS_CUTTER_BYTEWIDTH + STATUS_CUTTER_BYTEWIDTH) * 8) + #endif + + #ifndef STATUS_CUTTER_HEIGHT + #ifdef STATUS_CUTTER_ANIM + #define STATUS_CUTTER_HEIGHT(S) ((S) ? sizeof(status_cutter_on_bmp) / (STATUS_CUTTER_BYTEWIDTH) : sizeof(status_cutter_bmp) / (STATUS_CUTTER_BYTEWIDTH)) + #else + #define STATUS_CUTTER_HEIGHT(S) (sizeof(status_cutter_bmp) / (STATUS_CUTTER_BYTEWIDTH)) + #endif + #endif + + #ifndef STATUS_CUTTER_Y + #define STATUS_CUTTER_Y(S) 4 + #endif + + #ifndef STATUS_CUTTER_TEXT_X + #define STATUS_CUTTER_TEXT_X (STATUS_CUTTER_X -1) + #endif + + #ifndef STATUS_CUTTER_TEXT_Y + #define STATUS_CUTTER_TEXT_Y 28 + #endif + + static_assert( + sizeof(status_cutter_bmp) == (STATUS_CUTTER_BYTEWIDTH) * (STATUS_CUTTER_HEIGHT(0)), + "Status cutter bitmap (status_cutter_bmp) dimensions don't match data." + ); + #ifdef STATUS_CUTTER_ANIM + static_assert( + sizeof(status_cutter_on_bmp) == (STATUS_CUTTER_BYTEWIDTH) * (STATUS_CUTTER_HEIGHT(1)), + "Status cutter bitmap (status_cutter_on_bmp) dimensions don't match data." + ); + #endif + +#endif + +// +// Chamber Bitmap Properties +// #ifndef STATUS_CHAMBER_BYTEWIDTH #define STATUS_CHAMBER_BYTEWIDTH BW(STATUS_CHAMBER_WIDTH) #endif -#if STATUS_CHAMBER_WIDTH && !STATUS_HEATERS_WIDTH +#if STATUS_CHAMBER_WIDTH #ifndef STATUS_CHAMBER_X - #define STATUS_CHAMBER_X (128 - (STATUS_FAN_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH) * 8) + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) #endif #ifndef STATUS_CHAMBER_HEIGHT @@ -1388,7 +1636,7 @@ #endif #ifndef STATUS_CHAMBER_TEXT_X - #define STATUS_CHAMBER_TEXT_X (STATUS_CHAMBER_X + 7) + #define STATUS_CHAMBER_TEXT_X (STATUS_CHAMBER_X + 11) #endif static_assert( @@ -1407,16 +1655,13 @@ // // Bed Bitmap Properties // -#ifndef STATUS_BED_WIDTH - #define STATUS_BED_WIDTH 0 -#endif #ifndef STATUS_BED_BYTEWIDTH #define STATUS_BED_BYTEWIDTH BW(STATUS_BED_WIDTH) #endif #if STATUS_BED_WIDTH && !STATUS_HEATERS_WIDTH #ifndef STATUS_BED_X - #define STATUS_BED_X (128 - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_BED_BYTEWIDTH) * 8) + #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_BED_BYTEWIDTH) * 8) #endif #ifndef STATUS_BED_HEIGHT @@ -1432,7 +1677,7 @@ #endif #ifndef STATUS_BED_TEXT_X - #define STATUS_BED_TEXT_X (STATUS_BED_X + 11) + #define STATUS_BED_TEXT_X (STATUS_BED_X + 9) #endif static_assert( @@ -1445,27 +1690,23 @@ "Status bed bitmap (status_bed_on_bmp) dimensions don't match data." ); #endif - #endif // // Fan Bitmap Properties // -#ifndef STATUS_FAN_WIDTH - #define STATUS_FAN_WIDTH 0 -#endif #ifndef STATUS_FAN_BYTEWIDTH #define STATUS_FAN_BYTEWIDTH BW(STATUS_FAN_WIDTH) #endif #if STATUS_FAN_FRAMES #ifndef STATUS_FAN_X - #define STATUS_FAN_X (128 - (STATUS_FAN_BYTEWIDTH) * 8) + #define STATUS_FAN_X (LCD_PIXEL_WIDTH - (STATUS_FAN_BYTEWIDTH) * 8) #endif #ifndef STATUS_FAN_Y #define STATUS_FAN_Y 1 #endif #ifndef STATUS_FAN_TEXT_X - #define STATUS_FAN_TEXT_X 103 + #define STATUS_FAN_TEXT_X (STATUS_FAN_X - 1) #endif #ifndef STATUS_FAN_TEXT_Y #define STATUS_FAN_TEXT_Y 28 @@ -1485,3 +1726,17 @@ #endif #endif #endif + +#define DO_DRAW_LOGO (STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) +#define DO_DRAW_HOTENDS (HOTENDS > 0) +#define DO_DRAW_CUTTER (HAS_CUTTER) +#define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH && HOTENDS <= 4) +#define DO_DRAW_CHAMBER (HAS_TEMP_CHAMBER && STATUS_CHAMBER_WIDTH && HOTENDS <= 4) +#define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES)) + +#define ANIM_HOTEND (HOTENDS && ENABLED(STATUS_HOTEND_ANIM)) +#define ANIM_BED (DO_DRAW_BED && ENABLED(STATUS_BED_ANIM)) +#define ANIM_CHAMBER (DO_DRAW_CHAMBER && ENABLED(STATUS_CHAMBER_ANIM)) +#define ANIM_CUTTER (DO_DRAW_CUTTER && ENABLED(STATUS_CUTTER_ANIM)) + +#define ANIM_HBCC (ANIM_HOTEND || ANIM_BED || ANIM_CHAMBER || ANIM_CUTTER) diff --git a/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h b/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h index 78f6f3262d2b..be304b1a14e5 100644 --- a/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h +++ b/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h @@ -22,18 +22,18 @@ // reduced font (only symbols 1 - 127) - saves about 1278 bytes of FLASH /* - Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1 + Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1 Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1 Capital A Height: 7, '1' Height: 7 Calculated Max Values w= 5 h=10 x= 5 y= 5 dx= 6 dy= 0 ascent= 8 len=10 - Font Bounding box w= 6 h=12 x= 0 y=-2 + Font Bounding box w=12 h=13 x= 0 y=-2 Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 Pure Font ascent = 7 descent=-2 X Font ascent = 8 descent=-2 Max Font ascent = 8 descent=-2 */ const u8g_fntpgm_uint8_t ISO10646_1_5x7[1325] U8G_FONT_SECTION("ISO10646_1_5x7") = { - 0x00,0x06,0x0c,0x00,0xfe,0x07,0x02,0x26,0x03,0xbc,0x01,0x7f,0xfe,0x08,0xfe,0x08, + 0x00,0x0c,0x0d,0x00,0xfe,0x07,0x02,0x26,0x03,0xbc,0x01,0x7f,0xfe,0x08,0xfe,0x08, 0xfe,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xf0,0xc8,0x88,0x88,0x98,0x78,0x10,0x05, 0x08,0x08,0x06,0x00,0x00,0xc0,0xf8,0x88,0x88,0x88,0x88,0x88,0xf8,0x05,0x05,0x05, 0x06,0x00,0x01,0x20,0x30,0xf8,0x30,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x70, @@ -120,18 +120,18 @@ const u8g_fntpgm_uint8_t ISO10646_1_5x7[1325] U8G_FONT_SECTION("ISO10646_1_5x7") // extended (original) font (symbols 1 - 255) /* - Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1 + Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1 Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1 Capital A Height: 7, '1' Height: 7 Calculated Max Values w= 6 h=10 x= 5 y= 7 dx= 6 dy= 0 ascent=10 len=10 - Font Bounding box w= 6 h=12 x= 0 y=-2 + Font Bounding box w=12 h=13 x= 0 y=-2 Calculated Min Values x= 0 y=-2 dx= 0 dy= 0 Pure Font ascent = 7 descent=-2 X Font ascent = 8 descent=-2 Max Font ascent =10 descent=-2 */ const u8g_fntpgm_uint8_t ISO10646_1_5x7[2648] U8G_FONT_SECTION("ISO10646_1_5x7") = { - 0x00,0x06,0x0c,0x00,0xfe,0x07,0x02,0x26,0x03,0xbc,0x01,0xff,0xfe,0x0a,0xfe,0x08, + 0x00,0x0c,0x0d,0x00,0xfe,0x07,0x02,0x26,0x03,0xbc,0x01,0xff,0xfe,0x0a,0xfe,0x08, 0xfe,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xf0,0xc8,0x88,0x88,0x98,0x78,0x10,0x05, 0x08,0x08,0x06,0x00,0x00,0xc0,0xf8,0x88,0x88,0x88,0x88,0x88,0xf8,0x05,0x05,0x05, 0x06,0x00,0x01,0x20,0x30,0xf8,0x30,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x70, diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_el-gr.h b/Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h similarity index 100% rename from Marlin/src/lcd/dogm/fontdata/langdata_el-gr.h rename to Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_jp-kana.h b/Marlin/src/lcd/dogm/fontdata/langdata_jp-kana.h deleted file mode 100644 index e2ff9129b456..000000000000 --- a/Marlin/src/lcd/dogm/fontdata/langdata_jp-kana.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Generated automatically by buildroot/share/fonts/uxggenpages.sh - * Contents will be REPLACED by future processing! - * Use genallfont.sh to generate font data for updated languages. - */ -#include - -const u8g_fntpgm_uint8_t fontpage_97_161_164[61] U8G_FONT_SECTION("fontpage_97_161_164") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa4,0x00,0x06,0x00,0x00, - 0x00,0x04,0x04,0x04,0x06,0x00,0x00,0xf0,0x10,0x60,0x40,0x05,0x06,0x06,0x06,0x00, - 0x00,0xf8,0x08,0x28,0x30,0x20,0x40,0x03,0x04,0x04,0x06,0x01,0x00,0x20,0x40,0xc0, - 0x40,0x04,0x06,0x06,0x06,0x00,0x00,0x10,0x20,0x60,0xa0,0x20,0x20}; -const u8g_fntpgm_uint8_t fontpage_97_166_166[29] U8G_FONT_SECTION("fontpage_97_166_166") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x06,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x20,0xf8,0x88,0x08,0x10,0x20}; -const u8g_fntpgm_uint8_t fontpage_97_168_168[28] U8G_FONT_SECTION("fontpage_97_168_168") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0xf8}; -const u8g_fntpgm_uint8_t fontpage_97_170_181[167] U8G_FONT_SECTION("fontpage_97_170_181") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaa,0xb5,0x00,0x08,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x10,0xf8,0x30,0x50,0x90,0x10,0x05,0x06,0x06, - 0x06,0x00,0x00,0x40,0xf8,0x48,0x48,0x48,0x90,0x05,0x08,0x08,0x06,0x00,0x00,0x28, - 0x00,0x40,0xf8,0x48,0x48,0x48,0x90,0x05,0x06,0x06,0x06,0x00,0x00,0x20,0xf8,0x20, - 0xf8,0x20,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x28,0x00,0x20,0xf8,0x20,0xf8,0x20, - 0x20,0x04,0x05,0x05,0x06,0x00,0x00,0x70,0x90,0x10,0x20,0xc0,0x05,0x07,0x07,0x06, - 0x00,0x00,0x28,0x00,0x70,0x90,0x10,0x20,0xc0,0x05,0x06,0x06,0x06,0x00,0x00,0x40, - 0x78,0x90,0x10,0x10,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x28,0x00,0x40,0x78,0x90, - 0x10,0x10,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0x08,0x08,0xf8,0x05,0x07, - 0x07,0x06,0x00,0x00,0x28,0x00,0xf8,0x08,0x08,0x08,0xf8,0x05,0x06,0x06,0x06,0x00, - 0x00,0x50,0xf8,0x50,0x10,0x20,0x40}; -const u8g_fntpgm_uint8_t fontpage_97_183_187[77] U8G_FONT_SECTION("fontpage_97_183_187") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xbb,0x00,0x07,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0xc0,0x08,0xc8,0x10,0xe0,0x05,0x07,0x07,0x06, - 0x00,0x00,0x28,0x00,0xc0,0x08,0xc8,0x10,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8, - 0x10,0x20,0x50,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0xf8,0x10,0x20,0x50, - 0x88,0x05,0x06,0x06,0x06,0x00,0x00,0x40,0xf8,0x48,0x50,0x40,0x38}; -const u8g_fntpgm_uint8_t fontpage_97_189_193[77] U8G_FONT_SECTION("fontpage_97_189_193") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbd,0xc1,0x00,0x07,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x48,0x10,0x60,0x05,0x07,0x07,0x06, - 0x00,0x00,0x28,0x00,0x88,0x88,0x48,0x10,0x60,0x05,0x05,0x05,0x06,0x00,0x00,0x78, - 0x48,0xa8,0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x00,0x78,0x48,0xa8,0x10, - 0x60,0x05,0x06,0x06,0x06,0x00,0x00,0x10,0xe0,0x20,0xf8,0x20,0x40}; -const u8g_fntpgm_uint8_t fontpage_97_195_196[38] U8G_FONT_SECTION("fontpage_97_195_196") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc3,0xc4,0x00,0x05,0x00,0x00, - 0x00,0x05,0x04,0x04,0x06,0x00,0x00,0xa8,0xa8,0x08,0x30,0x05,0x05,0x05,0x06,0x00, - 0x00,0xa8,0xa8,0x08,0x10,0x20}; -const u8g_fntpgm_uint8_t fontpage_97_198_211[190] U8G_FONT_SECTION("fontpage_97_198_211") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc6,0xd3,0x00,0x08,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x70,0x00,0xf8,0x20,0x20,0x40,0x05,0x08,0x08, - 0x06,0x00,0x00,0x28,0x00,0x70,0x00,0xf8,0x20,0x20,0x40,0x03,0x06,0x06,0x06,0x01, - 0x00,0x80,0x80,0xc0,0xa0,0x80,0x80,0x04,0x08,0x08,0x06,0x01,0x00,0x50,0x00,0x80, - 0x80,0xc0,0xa0,0x80,0x80,0x05,0x06,0x06,0x06,0x00,0x00,0x20,0xf8,0x20,0x20,0x40, - 0x80,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x00,0x00,0x00,0xf8,0x05,0x05,0x05,0x06, - 0x00,0x00,0xf8,0x08,0x50,0x20,0xd0,0x05,0x06,0x06,0x06,0x00,0x00,0x20,0xf8,0x10, - 0x20,0x70,0xa8,0x03,0x06,0x06,0x06,0x01,0x00,0x20,0x20,0x20,0x20,0x40,0x80,0x05, - 0x05,0x05,0x06,0x00,0x00,0x10,0x88,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00, - 0x28,0x00,0x10,0x88,0x88,0x88,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x18,0x18,0x00, - 0x10,0x88,0x88,0x88,0x88,0x05,0x06,0x06,0x06,0x00,0x00,0x80,0x80,0xf8,0x80,0x80, - 0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x28,0x80,0x80,0xf8,0x80,0x80,0x78}; -const u8g_fntpgm_uint8_t fontpage_97_213_217[77] U8G_FONT_SECTION("fontpage_97_213_217") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd5,0xd9,0x00,0x08,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0x08,0x10,0x60,0x05,0x07,0x07,0x06, - 0x00,0x00,0x28,0x00,0xf8,0x08,0x08,0x10,0x60,0x05,0x08,0x08,0x06,0x00,0x00,0x18, - 0x18,0x00,0xf8,0x08,0x08,0x10,0x60,0x05,0x04,0x04,0x06,0x00,0x01,0x40,0xa0,0x10, - 0x08,0x05,0x06,0x06,0x06,0x00,0x01,0x28,0x00,0x40,0xa0,0x10,0x08}; -const u8g_fntpgm_uint8_t fontpage_97_219_220[43] U8G_FONT_SECTION("fontpage_97_219_220") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdb,0xdc,0x00,0x08,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x20,0xf8,0x20,0xa8,0xa8,0x20,0x05,0x08,0x08, - 0x06,0x00,0x00,0x28,0x00,0x20,0xf8,0x20,0xa8,0xa8,0x20}; -const u8g_fntpgm_uint8_t fontpage_97_222_223[39] U8G_FONT_SECTION("fontpage_97_222_223") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xdf,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0x50,0x20,0x10,0x04,0x05,0x05,0x06, - 0x01,0x00,0xe0,0x00,0xe0,0x00,0xf0}; -const u8g_fntpgm_uint8_t fontpage_97_225_226[39] U8G_FONT_SECTION("fontpage_97_225_226") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe2,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x08,0x28,0x10,0x28,0xc0,0x05,0x05,0x05,0x06, - 0x00,0x00,0xf8,0x40,0xf8,0x40,0x38}; -const u8g_fntpgm_uint8_t fontpage_97_228_229[39] U8G_FONT_SECTION("fontpage_97_228_229") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe4,0xe5,0x00,0x06,0x00,0x00, - 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x40,0xf8,0x48,0x50,0x40,0x40,0x04,0x04,0x04, - 0x06,0x00,0x00,0x60,0x20,0x20,0xf0}; -const u8g_fntpgm_uint8_t fontpage_97_231_237[96] U8G_FONT_SECTION("fontpage_97_231_237") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe7,0xed,0x00,0x06,0x00,0x00, - 0x00,0x04,0x05,0x05,0x06,0x00,0x00,0xf0,0x10,0xf0,0x10,0xf0,0x05,0x05,0x05,0x06, - 0x00,0x00,0xf8,0x08,0xf8,0x08,0xf8,0x05,0x06,0x06,0x06,0x00,0x00,0x70,0x00,0xf8, - 0x08,0x10,0x20,0x04,0x06,0x06,0x06,0x00,0x00,0x90,0x90,0x90,0x90,0x10,0x20,0x05, - 0x05,0x05,0x06,0x00,0x00,0x20,0xa0,0xa8,0xa8,0xb0,0x04,0x05,0x05,0x06,0x00,0x00, - 0x80,0x80,0x90,0xa0,0xc0,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0xf8 - }; -const u8g_fntpgm_uint8_t fontpage_97_242_243[39] U8G_FONT_SECTION("fontpage_97_242_243") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf3,0x00,0x05,0x00,0x00, - 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x08,0xf8,0x08,0x30,0x05,0x05,0x05,0x06, - 0x00,0x00,0xc0,0x08,0x08,0x10,0xe0}; -const u8g_fntpgm_uint8_t fontpage_97_252_252[24] U8G_FONT_SECTION("fontpage_97_252_252") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0x00,0x03,0x00,0x00, - 0x00,0x05,0x01,0x01,0x06,0x00,0x02,0xf8}; - -#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } -static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { - FONTDATA_ITEM(97, 161, 164, fontpage_97_161_164), // 'ァ' -- 'イ' - FONTDATA_ITEM(97, 166, 166, fontpage_97_166_166), // 'ウ' -- 'ウ' - FONTDATA_ITEM(97, 168, 168, fontpage_97_168_168), // 'エ' -- 'エ' - FONTDATA_ITEM(97, 170, 181, fontpage_97_170_181), // 'オ' -- 'サ' - FONTDATA_ITEM(97, 183, 187, fontpage_97_183_187), // 'シ' -- 'セ' - FONTDATA_ITEM(97, 189, 193, fontpage_97_189_193), // 'ソ' -- 'チ' - FONTDATA_ITEM(97, 195, 196, fontpage_97_195_196), // 'ッ' -- 'ツ' - FONTDATA_ITEM(97, 198, 211, fontpage_97_198_211), // 'テ' -- 'ビ' - FONTDATA_ITEM(97, 213, 217, fontpage_97_213_217), // 'フ' -- 'ベ' - FONTDATA_ITEM(97, 219, 220, fontpage_97_219_220), // 'ホ' -- 'ボ' - FONTDATA_ITEM(97, 222, 223, fontpage_97_222_223), // 'マ' -- 'ミ' - FONTDATA_ITEM(97, 225, 226, fontpage_97_225_226), // 'メ' -- 'モ' - FONTDATA_ITEM(97, 228, 229, fontpage_97_228_229), // 'ヤ' -- 'ュ' - FONTDATA_ITEM(97, 231, 237, fontpage_97_231_237), // 'ョ' -- 'ロ' - FONTDATA_ITEM(97, 242, 243, fontpage_97_242_243), // 'ヲ' -- 'ン' - FONTDATA_ITEM(97, 252, 252, fontpage_97_252_252), // 'ー' -- 'ー' -}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_jp_kana.h b/Marlin/src/lcd/dogm/fontdata/langdata_jp_kana.h new file mode 100644 index 000000000000..97d82c0293dc --- /dev/null +++ b/Marlin/src/lcd/dogm/fontdata/langdata_jp_kana.h @@ -0,0 +1,111 @@ +/** + * Generated automatically by buildroot/share/fonts/uxggenpages.sh + * Contents will be REPLACED by future processing! + * Use genallfont.sh to generate font data for updated languages. + */ +#include + +const u8g_fntpgm_uint8_t fontpage_97_161_164[65] U8G_FONT_SECTION("fontpage_97_161_164") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa4,0x00,0x07,0x00,0x00, + 0x00,0x04,0x05,0x05,0x06,0x00,0x00,0xf0,0x10,0x60,0x40,0x80,0x05,0x07,0x07,0x06, + 0x00,0x00,0xf8,0x08,0x28,0x30,0x20,0x20,0x40,0x04,0x05,0x05,0x06,0x00,0x00,0x10, + 0x20,0x60,0xa0,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x10,0x20,0x60,0xa0,0x20, + 0x20}; +const u8g_fntpgm_uint8_t fontpage_97_166_166[30] U8G_FONT_SECTION("fontpage_97_166_166") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x07,0x00,0x00, + 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xf8,0x88,0x88,0x08,0x10,0x60}; +const u8g_fntpgm_uint8_t fontpage_97_168_168[29] U8G_FONT_SECTION("fontpage_97_168_168") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa8,0xa8,0x00,0x06,0x00,0x00, + 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0xf8}; +const u8g_fntpgm_uint8_t fontpage_97_170_187[268] U8G_FONT_SECTION("fontpage_97_170_187") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaa,0xbb,0x00,0x0d,0x00,0x00, + 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0xf8,0x10,0x30,0x50,0x90,0x10,0x05,0x07, + 0x07,0x06,0x00,0x00,0x40,0xf8,0x48,0x48,0x48,0x48,0x98,0x05,0x09,0x09,0x06,0x00, + 0x00,0x28,0x08,0x40,0xf8,0x48,0x48,0x48,0x48,0x98,0x05,0x07,0x07,0x06,0x00,0x00, + 0x20,0xf8,0x20,0x20,0xf8,0x10,0x10,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x20, + 0xf8,0x20,0x20,0xf8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0x78,0x48,0x88, + 0x08,0x10,0x60,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x40,0x78,0x48,0x88,0x08, + 0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0xf8,0x90,0x90,0x10,0x10,0x20,0x05, + 0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x80,0xf8,0x90,0x90,0x10,0x10,0x20,0x05,0x06, + 0x06,0x06,0x00,0x00,0xf8,0x08,0x08,0x08,0x08,0xf8,0x05,0x09,0x09,0x06,0x00,0x00, + 0x28,0x28,0x00,0xf8,0x08,0x08,0x08,0x08,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x50, + 0xf8,0x50,0x50,0x50,0x10,0x20,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x50,0xf8, + 0x50,0x50,0x50,0x10,0x20,0x05,0x06,0x06,0x06,0x00,0x00,0xc0,0x08,0xc8,0x08,0x10, + 0xe0,0x07,0x0d,0x0d,0x06,0x00,0x00,0x02,0x00,0x00,0x00,0x28,0x28,0x00,0xc0,0x08, + 0xc8,0x08,0x10,0xe0,0x05,0x06,0x06,0x06,0x00,0x00,0x70,0x10,0x10,0x20,0x50,0x88, + 0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00,0x70,0x10,0x10,0x20,0x50,0x88,0x05, + 0x07,0x07,0x06,0x00,0x00,0x40,0x40,0xf8,0x48,0x50,0x40,0x38}; +const u8g_fntpgm_uint8_t fontpage_97_189_193[85] U8G_FONT_SECTION("fontpage_97_189_193") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbd,0xc1,0x00,0x09,0x00,0x00, + 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x88,0x48,0x48,0x10,0x10,0x20,0x05,0x09,0x09, + 0x06,0x00,0x00,0x28,0x28,0x00,0x88,0x48,0x48,0x10,0x10,0x20,0x05,0x07,0x07,0x06, + 0x00,0x00,0x40,0x78,0x48,0xa8,0x18,0x10,0x60,0x05,0x09,0x09,0x06,0x00,0x00,0x28, + 0x08,0x40,0x78,0x48,0xa8,0x18,0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x60, + 0x20,0xf8,0x20,0x20,0x40}; +const u8g_fntpgm_uint8_t fontpage_97_195_211[241] U8G_FONT_SECTION("fontpage_97_195_211") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc3,0xd3,0x00,0x09,0x00,0x00, + 0x00,0x05,0x04,0x04,0x06,0x00,0x00,0xa8,0xa8,0x08,0x30,0x05,0x06,0x06,0x06,0x00, + 0x00,0xa8,0xa8,0xa8,0x08,0x10,0x60,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00, + 0xa8,0xa8,0xa8,0x08,0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x00,0xf8,0x20, + 0x20,0x20,0x40,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x08,0x70,0x00,0xf8,0x20,0x20, + 0x20,0x40,0x04,0x07,0x07,0x06,0x01,0x00,0x80,0x80,0xc0,0xa0,0x90,0x80,0x80,0x04, + 0x09,0x09,0x06,0x01,0x00,0x50,0x10,0x80,0x80,0xc0,0xa0,0x90,0x80,0x80,0x05,0x07, + 0x07,0x06,0x00,0x00,0x20,0x20,0xf8,0x20,0x20,0x40,0x80,0x05,0x06,0x06,0x06,0x00, + 0x00,0x70,0x00,0x00,0x00,0x00,0xf8,0x05,0x06,0x06,0x06,0x00,0x00,0x78,0x08,0x28, + 0x10,0x28,0xc0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x70,0x10,0x20,0x70,0xa8,0x20, + 0x03,0x06,0x06,0x06,0x01,0x00,0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x06,0x06,0x06, + 0x00,0x00,0x10,0x50,0x50,0x48,0x88,0x88,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28, + 0x00,0x10,0x50,0x50,0x48,0x88,0x88,0x05,0x09,0x09,0x06,0x00,0x00,0x18,0x18,0x00, + 0x10,0x50,0x50,0x48,0x88,0x88,0x04,0x06,0x06,0x06,0x00,0x00,0x80,0x90,0xe0,0x80, + 0x80,0x70,0x05,0x09,0x09,0x06,0x00,0x00,0x28,0x28,0x00,0x80,0x90,0xe0,0x80,0x80, + 0x70}; +const u8g_fntpgm_uint8_t fontpage_97_213_217[84] U8G_FONT_SECTION("fontpage_97_213_217") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd5,0xd9,0x00,0x09,0x00,0x00, + 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0x08,0x08,0x10,0x60,0x05,0x09,0x09, + 0x06,0x00,0x00,0x28,0x28,0x00,0xf8,0x08,0x08,0x08,0x10,0x60,0x05,0x09,0x09,0x06, + 0x00,0x00,0x18,0x18,0x00,0xf8,0x08,0x08,0x08,0x10,0x60,0x05,0x05,0x05,0x06,0x00, + 0x01,0x60,0xa0,0x10,0x10,0x08,0x05,0x08,0x08,0x06,0x00,0x01,0x28,0x28,0x00,0x60, + 0xa0,0x10,0x10,0x08}; +const u8g_fntpgm_uint8_t fontpage_97_219_220[45] U8G_FONT_SECTION("fontpage_97_219_220") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdb,0xdc,0x00,0x09,0x00,0x00, + 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xf8,0x20,0xa8,0xa8,0xa8,0x20,0x05,0x09, + 0x09,0x06,0x00,0x00,0x28,0x08,0x20,0xf8,0x20,0xa8,0xa8,0xa8,0x20}; +const u8g_fntpgm_uint8_t fontpage_97_222_223[41] U8G_FONT_SECTION("fontpage_97_222_223") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xdf,0x00,0x06,0x00,0x00, + 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0x08,0x50,0x20,0x10,0x04,0x06,0x06, + 0x06,0x01,0x00,0xe0,0x00,0xe0,0x00,0xc0,0x30}; +const u8g_fntpgm_uint8_t fontpage_97_225_237[174] U8G_FONT_SECTION("fontpage_97_225_237") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xed,0x00,0x07,0x00,0x00, + 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0x08,0x48,0x30,0x10,0x28,0xc0,0x05,0x06,0x06, + 0x06,0x00,0x00,0xf0,0x40,0xf8,0x40,0x40,0x38,0x05,0x05,0x05,0x06,0x00,0x00,0x40, + 0xf8,0x48,0x50,0x40,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0x40,0xf8,0x48,0x50,0x40, + 0x40,0x04,0x05,0x05,0x06,0x00,0x00,0x60,0x20,0x20,0x20,0xf0,0x05,0x06,0x06,0x06, + 0x00,0x00,0x70,0x10,0x10,0x10,0x10,0xf8,0x04,0x05,0x05,0x06,0x00,0x00,0xf0,0x10, + 0xf0,0x10,0xf0,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0xf8,0x08,0x08,0xf8,0x05, + 0x07,0x07,0x06,0x00,0x00,0x70,0x00,0xf8,0x08,0x08,0x10,0x60,0x04,0x07,0x07,0x06, + 0x00,0x00,0x10,0x90,0x90,0x90,0x90,0x10,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x20, + 0x20,0xa0,0xa0,0xa8,0xa8,0xb0,0x05,0x06,0x06,0x06,0x00,0x00,0x80,0x80,0x80,0x88, + 0xb0,0xc0,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x88,0x88,0x88,0x88,0xf8}; +const u8g_fntpgm_uint8_t fontpage_97_242_243[41] U8G_FONT_SECTION("fontpage_97_242_243") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf2,0xf3,0x00,0x06,0x00,0x00, + 0x00,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0xf8,0x08,0x10,0x60,0x05,0x06,0x06, + 0x06,0x00,0x00,0xc0,0x08,0x08,0x08,0x10,0xe0}; +const u8g_fntpgm_uint8_t fontpage_97_252_252[25] U8G_FONT_SECTION("fontpage_97_252_252") = { + 0x00,0x0c,0x0f,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0x00,0x05,0x00,0x00, + 0x00,0x05,0x02,0x02,0x06,0x00,0x03,0x80,0x78}; + +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } +static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { + FONTDATA_ITEM(97, 161, 164, fontpage_97_161_164), // 'ァ' -- 'イ' + FONTDATA_ITEM(97, 166, 166, fontpage_97_166_166), // 'ウ' -- 'ウ' + FONTDATA_ITEM(97, 168, 168, fontpage_97_168_168), // 'エ' -- 'エ' + FONTDATA_ITEM(97, 170, 187, fontpage_97_170_187), // 'オ' -- 'セ' + FONTDATA_ITEM(97, 189, 193, fontpage_97_189_193), // 'ソ' -- 'チ' + FONTDATA_ITEM(97, 195, 211, fontpage_97_195_211), // 'ッ' -- 'ビ' + FONTDATA_ITEM(97, 213, 217, fontpage_97_213_217), // 'フ' -- 'ベ' + FONTDATA_ITEM(97, 219, 220, fontpage_97_219_220), // 'ホ' -- 'ボ' + FONTDATA_ITEM(97, 222, 223, fontpage_97_222_223), // 'マ' -- 'ミ' + FONTDATA_ITEM(97, 225, 237, fontpage_97_225_237), // 'メ' -- 'ロ' + FONTDATA_ITEM(97, 242, 243, fontpage_97_242_243), // 'ヲ' -- 'ン' + FONTDATA_ITEM(97, 252, 252, fontpage_97_252_252), // 'ー' -- 'ー' +}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_pt-br.h b/Marlin/src/lcd/dogm/fontdata/langdata_pt_br.h similarity index 100% rename from Marlin/src/lcd/dogm/fontdata/langdata_pt-br.h rename to Marlin/src/lcd/dogm/fontdata/langdata_pt_br.h diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_vi.h b/Marlin/src/lcd/dogm/fontdata/langdata_vi.h new file mode 100644 index 000000000000..7c309907cdcd --- /dev/null +++ b/Marlin/src/lcd/dogm/fontdata/langdata_vi.h @@ -0,0 +1,232 @@ +/** + * Generated automatically by buildroot/share/fonts/uxggenpages.sh + * Contents will be REPLACED by future processing! + * Use genallfont.sh to generate font data for updated languages. + */ +#include + +const u8g_fntpgm_uint8_t fontpage_2_131_131[31] U8G_FONT_SECTION("fontpage_2_131_131") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x08,0x00,0x00, + 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x88,0x70,0x00,0x70,0x08,0x78,0x88,0x78}; +const u8g_fntpgm_uint8_t fontpage_2_144_145[44] U8G_FONT_SECTION("fontpage_2_144_145") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x91,0x00,0x08,0x00,0x00, + 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0xe8,0x48,0x48,0xf0,0x06,0x08, + 0x08,0x06,0x00,0x00,0x08,0x1c,0x08,0x78,0x88,0x88,0x88,0x78}; +const u8g_fntpgm_uint8_t fontpage_2_169_169[31] U8G_FONT_SECTION("fontpage_2_169_169") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xa9,0x00,0x08,0x00,0x00, + 0x00,0x04,0x08,0x08,0x06,0x00,0x00,0x50,0xa0,0x00,0x60,0x20,0x20,0x20,0x70}; +const u8g_fntpgm_uint8_t fontpage_3_161_161[30] U8G_FONT_SECTION("fontpage_3_161_161") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x07,0x00,0x00, + 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x08,0x70,0x88,0x88,0x88,0x70}; +const u8g_fntpgm_uint8_t fontpage_3_175_176[43] U8G_FONT_SECTION("fontpage_3_175_176") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xb0,0x00,0x08,0x00,0x00, + 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x08,0x98,0x90,0x90,0x90,0x90,0x90,0x60,0x05, + 0x06,0x06,0x06,0x00,0x00,0x08,0x98,0x90,0x90,0xb0,0x50}; +const u8g_fntpgm_uint8_t fontpage_6_131_131[25] U8G_FONT_SECTION("fontpage_6_131_131") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x02,0x02,0x06,0x00,0x08,0x68,0xb0}; +const u8g_fntpgm_uint8_t fontpage_6_137_137[26] U8G_FONT_SECTION("fontpage_6_137_137") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0a,0x00,0x00, + 0x00,0x03,0x03,0x03,0x06,0x01,0x07,0xc0,0x20,0x40}; +const u8g_fntpgm_uint8_t fontpage_6_163_163[24] U8G_FONT_SECTION("fontpage_6_163_163") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa3,0xa3,0x00,0x00,0xfe,0x00, + 0x00,0x01,0x01,0x01,0x06,0x02,0xfe,0x80}; +const u8g_fntpgm_uint8_t fontpage_6_192_193[33] U8G_FONT_SECTION("fontpage_6_192_193") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc1,0x00,0x0a,0x00,0x00, + 0x00,0x02,0x02,0x02,0x06,0x01,0x08,0x80,0x40,0x02,0x02,0x02,0x06,0x02,0x08,0x40, + 0x80}; +const u8g_fntpgm_uint8_t fontpage_61_161_161[30] U8G_FONT_SECTION("fontpage_61_161_161") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa1,0x00,0x05,0xfe,0x00, + 0x00,0x05,0x07,0x07,0x07,0x00,0xfe,0x70,0x08,0x78,0x88,0x78,0x00,0x20}; +const u8g_fntpgm_uint8_t fontpage_61_163_163[32] U8G_FONT_SECTION("fontpage_61_163_163") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa3,0xa3,0x00,0x09,0x00,0x00, + 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x30,0x10,0x20,0x00,0x70,0x08,0x78,0x88,0x78 + }; +const u8g_fntpgm_uint8_t fontpage_61_165_165[33] U8G_FONT_SECTION("fontpage_61_165_165") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa5,0xa5,0x00,0x0a,0x00,0x00, + 0x00,0x06,0x0a,0x0a,0x07,0x00,0x00,0x04,0x08,0x30,0x48,0x00,0x70,0x08,0x78,0x88, + 0x78}; +const u8g_fntpgm_uint8_t fontpage_61_167_167[33] U8G_FONT_SECTION("fontpage_61_167_167") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa7,0xa7,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x10,0x08,0x30,0x48,0x00,0x70,0x08,0x78,0x88, + 0x78}; +const u8g_fntpgm_uint8_t fontpage_61_169_169[34] U8G_FONT_SECTION("fontpage_61_169_169") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa9,0xa9,0x00,0x0b,0x00,0x00, + 0x00,0x06,0x0b,0x0b,0x07,0x00,0x00,0x0c,0x04,0x08,0x30,0x48,0x00,0x70,0x08,0x78, + 0x88,0x78}; +const u8g_fntpgm_uint8_t fontpage_61_173_173[33] U8G_FONT_SECTION("fontpage_61_173_173") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xad,0xad,0x00,0x08,0xfe,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0xfe,0x30,0x48,0x00,0x70,0x08,0x78,0x88,0x78,0x00, + 0x20}; +const u8g_fntpgm_uint8_t fontpage_61_175_175[33] U8G_FONT_SECTION("fontpage_61_175_175") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xaf,0xaf,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x08,0x10,0x48,0x30,0x00,0x70,0x08,0x78,0x88, + 0x78}; +const u8g_fntpgm_uint8_t fontpage_61_177_177[33] U8G_FONT_SECTION("fontpage_61_177_177") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb1,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x40,0x20,0x48,0x30,0x00,0x70,0x08,0x78,0x88, + 0x78}; +const u8g_fntpgm_uint8_t fontpage_61_179_179[34] U8G_FONT_SECTION("fontpage_61_179_179") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb3,0xb3,0x00,0x0b,0x00,0x00, + 0x00,0x05,0x0b,0x0b,0x07,0x00,0x00,0x18,0x08,0x10,0x48,0x30,0x00,0x70,0x08,0x78, + 0x88,0x78}; +const u8g_fntpgm_uint8_t fontpage_61_181_181[34] U8G_FONT_SECTION("fontpage_61_181_181") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb5,0xb5,0x00,0x0b,0x00,0x00, + 0x00,0x06,0x0b,0x0b,0x07,0x00,0x00,0x14,0x28,0x00,0x48,0x30,0x00,0x70,0x08,0x78, + 0x88,0x78}; +const u8g_fntpgm_uint8_t fontpage_61_183_183[33] U8G_FONT_SECTION("fontpage_61_183_183") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xb7,0x00,0x08,0xfe,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0xfe,0x48,0x30,0x00,0x70,0x08,0x78,0x88,0x78,0x00, + 0x20}; +const u8g_fntpgm_uint8_t fontpage_61_187_187[32] U8G_FONT_SECTION("fontpage_61_187_187") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbb,0xbb,0x00,0x09,0x00,0x00, + 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x30,0x10,0x20,0x00,0x70,0x88,0xf0,0x80,0x78 + }; +const u8g_fntpgm_uint8_t fontpage_61_191_191[33] U8G_FONT_SECTION("fontpage_61_191_191") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x0a,0x00,0x00, + 0x00,0x06,0x0a,0x0a,0x07,0x00,0x00,0x04,0x08,0x20,0x50,0x00,0x70,0x88,0xf0,0x80, + 0x78}; +const u8g_fntpgm_uint8_t fontpage_61_193_193[33] U8G_FONT_SECTION("fontpage_61_193_193") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc1,0xc1,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x10,0x08,0x20,0x50,0x00,0x70,0x88,0xf0,0x80, + 0x78}; +const u8g_fntpgm_uint8_t fontpage_61_195_195[34] U8G_FONT_SECTION("fontpage_61_195_195") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0x00,0x0b,0x00,0x00, + 0x00,0x05,0x0b,0x0b,0x07,0x00,0x00,0x18,0x08,0x10,0x60,0x90,0x00,0x60,0x90,0xf0, + 0x80,0x70}; +const u8g_fntpgm_uint8_t fontpage_61_199_199[33] U8G_FONT_SECTION("fontpage_61_199_199") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc7,0xc7,0x00,0x08,0xfe,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0xfe,0x20,0x50,0x00,0x70,0x88,0xf0,0x80,0x78,0x00, + 0x20}; +const u8g_fntpgm_uint8_t fontpage_61_201_201[32] U8G_FONT_SECTION("fontpage_61_201_201") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x09,0x00,0x00, + 0x00,0x03,0x09,0x09,0x07,0x02,0x00,0x60,0x20,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0 + }; +const u8g_fntpgm_uint8_t fontpage_61_203_203[32] U8G_FONT_SECTION("fontpage_61_203_203") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcb,0xcb,0x00,0x07,0xfe,0x00, + 0x00,0x03,0x09,0x09,0x07,0x02,0xfe,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0,0x00,0x40 + }; +const u8g_fntpgm_uint8_t fontpage_61_205_205[30] U8G_FONT_SECTION("fontpage_61_205_205") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcd,0xcd,0x00,0x05,0xfe,0x00, + 0x00,0x05,0x07,0x07,0x07,0x00,0xfe,0x70,0x88,0x88,0x88,0x70,0x00,0x20}; +const u8g_fntpgm_uint8_t fontpage_61_207_207[32] U8G_FONT_SECTION("fontpage_61_207_207") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xcf,0xcf,0x00,0x09,0x00,0x00, + 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x30,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_61_209_209[33] U8G_FONT_SECTION("fontpage_61_209_209") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x0a,0x00,0x00, + 0x00,0x06,0x0a,0x0a,0x07,0x00,0x00,0x04,0x08,0x20,0x50,0x00,0x70,0x88,0x88,0x88, + 0x70}; +const u8g_fntpgm_uint8_t fontpage_61_211_211[33] U8G_FONT_SECTION("fontpage_61_211_211") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd3,0xd3,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x10,0x08,0x20,0x50,0x00,0x70,0x88,0x88,0x88, + 0x70}; +const u8g_fntpgm_uint8_t fontpage_61_213_213[33] U8G_FONT_SECTION("fontpage_61_213_213") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd5,0xd5,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x18,0x08,0x30,0x50,0x00,0x70,0x88,0x88,0x88, + 0x70}; +const u8g_fntpgm_uint8_t fontpage_61_215_215[34] U8G_FONT_SECTION("fontpage_61_215_215") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd7,0xd7,0x00,0x0b,0x00,0x00, + 0x00,0x05,0x0b,0x0b,0x07,0x00,0x00,0x28,0x50,0x00,0x20,0x50,0x00,0x70,0x88,0x88, + 0x88,0x70}; +const u8g_fntpgm_uint8_t fontpage_61_217_217[33] U8G_FONT_SECTION("fontpage_61_217_217") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd9,0xd9,0x00,0x08,0xfe,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0xfe,0x20,0x50,0x00,0x70,0x88,0x88,0x88,0x70,0x00, + 0x20}; +const u8g_fntpgm_uint8_t fontpage_61_219_219[32] U8G_FONT_SECTION("fontpage_61_219_219") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdb,0xdb,0x00,0x09,0x00,0x00, + 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x20,0x40,0x10,0x08,0x70,0x88,0x88,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_61_221_221[32] U8G_FONT_SECTION("fontpage_61_221_221") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdd,0xdd,0x00,0x09,0x00,0x00, + 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x80,0x40,0x10,0x08,0x70,0x88,0x88,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_61_223_223[33] U8G_FONT_SECTION("fontpage_61_223_223") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x60,0x20,0x40,0x10,0x08,0x70,0x88,0x88,0x88, + 0x70}; +const u8g_fntpgm_uint8_t fontpage_61_225_225[32] U8G_FONT_SECTION("fontpage_61_225_225") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe1,0xe1,0x00,0x09,0x00,0x00, + 0x00,0x05,0x09,0x09,0x07,0x00,0x00,0x50,0xa0,0x10,0x08,0x70,0x88,0x88,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_61_227_227[32] U8G_FONT_SECTION("fontpage_61_227_227") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe3,0xe3,0x00,0x07,0xfe,0x00, + 0x00,0x05,0x09,0x09,0x00,0x00,0xfe,0x10,0x08,0x70,0x88,0x88,0x88,0x70,0x00,0x20 + }; +const u8g_fntpgm_uint8_t fontpage_61_229_229[30] U8G_FONT_SECTION("fontpage_61_229_229") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe5,0xe5,0x00,0x05,0xfe,0x00, + 0x00,0x05,0x07,0x07,0x07,0x00,0xfe,0x88,0x88,0x88,0x88,0x70,0x00,0x20}; +const u8g_fntpgm_uint8_t fontpage_61_231_231[33] U8G_FONT_SECTION("fontpage_61_231_231") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe7,0xe7,0x00,0x0a,0x00,0x00, + 0x00,0x05,0x0a,0x0a,0x07,0x00,0x00,0x30,0x10,0x20,0x00,0x00,0x88,0x88,0x88,0x88, + 0x70}; +const u8g_fntpgm_uint8_t fontpage_61_233_233[32] U8G_FONT_SECTION("fontpage_61_233_233") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xe9,0xe9,0x00,0x09,0x00,0x00, + 0x00,0x06,0x09,0x09,0x07,0x00,0x00,0x10,0x20,0x0c,0x04,0x88,0x88,0x88,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_61_235_235[32] U8G_FONT_SECTION("fontpage_61_235_235") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xeb,0xeb,0x00,0x09,0x00,0x00, + 0x00,0x06,0x09,0x09,0x07,0x00,0x00,0x40,0x20,0x0c,0x04,0x88,0x88,0x88,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_61_237_237[33] U8G_FONT_SECTION("fontpage_61_237_237") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xed,0xed,0x00,0x0a,0x00,0x00, + 0x00,0x06,0x0a,0x0a,0x07,0x00,0x00,0x30,0x10,0x20,0x0c,0x04,0x88,0x88,0x88,0x88, + 0x70}; +const u8g_fntpgm_uint8_t fontpage_61_239_239[32] U8G_FONT_SECTION("fontpage_61_239_239") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x09,0x00,0x00, + 0x00,0x06,0x09,0x09,0x07,0x00,0x00,0x28,0x50,0x0c,0x04,0x88,0x88,0x88,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_61_241_241[32] U8G_FONT_SECTION("fontpage_61_241_241") = { + 0x00,0x0c,0x0d,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf1,0xf1,0x00,0x07,0xfe,0x00, + 0x00,0x06,0x09,0x09,0x07,0x00,0xfe,0x0c,0x04,0x88,0x88,0x88,0x88,0x70,0x00,0x20 + }; + +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } +static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { + FONTDATA_ITEM(2, 131, 131, fontpage_2_131_131), // 'ă' -- 'ă' + FONTDATA_ITEM(2, 144, 145, fontpage_2_144_145), // 'Đ' -- 'đ' + FONTDATA_ITEM(2, 169, 169, fontpage_2_169_169), // 'ĩ' -- 'ĩ' + FONTDATA_ITEM(3, 161, 161, fontpage_3_161_161), // 'ơ' -- 'ơ' + FONTDATA_ITEM(3, 175, 176, fontpage_3_175_176), // 'Ư' -- 'ư' + FONTDATA_ITEM(6, 131, 131, fontpage_6_131_131), // '̃' -- '̃' + FONTDATA_ITEM(6, 137, 137, fontpage_6_137_137), // '̉' -- '̉' + FONTDATA_ITEM(6, 163, 163, fontpage_6_163_163), // '̣' -- '̣' + FONTDATA_ITEM(6, 192, 193, fontpage_6_192_193), // '̀' -- '́' + FONTDATA_ITEM(61, 161, 161, fontpage_61_161_161), // 'ạ' -- 'ạ' + FONTDATA_ITEM(61, 163, 163, fontpage_61_163_163), // 'ả' -- 'ả' + FONTDATA_ITEM(61, 165, 165, fontpage_61_165_165), // 'ấ' -- 'ấ' + FONTDATA_ITEM(61, 167, 167, fontpage_61_167_167), // 'ầ' -- 'ầ' + FONTDATA_ITEM(61, 169, 169, fontpage_61_169_169), // 'ẩ' -- 'ẩ' + FONTDATA_ITEM(61, 173, 173, fontpage_61_173_173), // 'ậ' -- 'ậ' + FONTDATA_ITEM(61, 175, 175, fontpage_61_175_175), // 'ắ' -- 'ắ' + FONTDATA_ITEM(61, 177, 177, fontpage_61_177_177), // 'ằ' -- 'ằ' + FONTDATA_ITEM(61, 179, 179, fontpage_61_179_179), // 'ẳ' -- 'ẳ' + FONTDATA_ITEM(61, 181, 181, fontpage_61_181_181), // 'ẵ' -- 'ẵ' + FONTDATA_ITEM(61, 183, 183, fontpage_61_183_183), // 'ặ' -- 'ặ' + FONTDATA_ITEM(61, 187, 187, fontpage_61_187_187), // 'ẻ' -- 'ẻ' + FONTDATA_ITEM(61, 191, 191, fontpage_61_191_191), // 'ế' -- 'ế' + FONTDATA_ITEM(61, 193, 193, fontpage_61_193_193), // 'ề' -- 'ề' + FONTDATA_ITEM(61, 195, 195, fontpage_61_195_195), // 'ể' -- 'ể' + FONTDATA_ITEM(61, 199, 199, fontpage_61_199_199), // 'ệ' -- 'ệ' + FONTDATA_ITEM(61, 201, 201, fontpage_61_201_201), // 'ỉ' -- 'ỉ' + FONTDATA_ITEM(61, 203, 203, fontpage_61_203_203), // 'ị' -- 'ị' + FONTDATA_ITEM(61, 205, 205, fontpage_61_205_205), // 'ọ' -- 'ọ' + FONTDATA_ITEM(61, 207, 207, fontpage_61_207_207), // 'ỏ' -- 'ỏ' + FONTDATA_ITEM(61, 209, 209, fontpage_61_209_209), // 'ố' -- 'ố' + FONTDATA_ITEM(61, 211, 211, fontpage_61_211_211), // 'ồ' -- 'ồ' + FONTDATA_ITEM(61, 213, 213, fontpage_61_213_213), // 'ổ' -- 'ổ' + FONTDATA_ITEM(61, 215, 215, fontpage_61_215_215), // 'ỗ' -- 'ỗ' + FONTDATA_ITEM(61, 217, 217, fontpage_61_217_217), // 'ộ' -- 'ộ' + FONTDATA_ITEM(61, 219, 219, fontpage_61_219_219), // 'ớ' -- 'ớ' + FONTDATA_ITEM(61, 221, 221, fontpage_61_221_221), // 'ờ' -- 'ờ' + FONTDATA_ITEM(61, 223, 223, fontpage_61_223_223), // 'ở' -- 'ở' + FONTDATA_ITEM(61, 225, 225, fontpage_61_225_225), // 'ỡ' -- 'ỡ' + FONTDATA_ITEM(61, 227, 227, fontpage_61_227_227), // 'ợ' -- 'ợ' + FONTDATA_ITEM(61, 229, 229, fontpage_61_229_229), // 'ụ' -- 'ụ' + FONTDATA_ITEM(61, 231, 231, fontpage_61_231_231), // 'ủ' -- 'ủ' + FONTDATA_ITEM(61, 233, 233, fontpage_61_233_233), // 'ứ' -- 'ứ' + FONTDATA_ITEM(61, 235, 235, fontpage_61_235_235), // 'ừ' -- 'ừ' + FONTDATA_ITEM(61, 237, 237, fontpage_61_237_237), // 'ử' -- 'ử' + FONTDATA_ITEM(61, 239, 239, fontpage_61_239_239), // 'ữ' -- 'ữ' + FONTDATA_ITEM(61, 241, 241, fontpage_61_241_241), // 'ự' -- 'ự' +}; diff --git a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp index d46eb85903b8..0ad5e998ab1b 100644 --- a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -20,9 +20,9 @@ #include "u8g_fontutf8.h" #include "../lcdprint.h" -int lcd_glyph_height(void) { return u8g_GetFontBBXHeight(u8g.getU8g()); } +int lcd_glyph_height() { return u8g_GetFontBBXHeight(u8g.getU8g()); } -void lcd_moveto(const uint8_t col, const uint8_t row) { u8g.setPrintPos(col, row); } +void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { u8g.setPrintPos(col, row); } void lcd_put_int(const int i) { u8g.print(i); } @@ -33,26 +33,22 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { u8g.print((char)c); return u8g_GetFontBBXWidth(u8g.getU8g()); } - unsigned int x = u8g.getPrintCol(), - y = u8g.getPrintRow(), - ret = uxg_DrawWchar(u8g.getU8g(), x, y, c, max_length); + u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), + ret = uxg_DrawWchar(u8g.getU8g(), x, y, c, max_length); u8g.setPrintPos(x + ret, y); - return ret; } int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { - unsigned int x = u8g.getPrintCol(), - y = u8g.getPrintRow(), - ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length); + u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), + ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length); u8g.setPrintPos(x + ret, y); return ret; } int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { - unsigned int x = u8g.getPrintCol(), - y = u8g.getPrintRow(), - ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_str_P, max_length); + u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), + ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_str_P, max_length); u8g.setPrintPos(x + ret, y); return ret; } diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 0e259f9439e0..2f6da518bdba 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -44,6 +44,10 @@ #include "../../gcode/parser.h" #endif +#if HAS_CUTTER + #include "../../feature/spindle_laser.h" +#endif + #if ENABLED(SDSUPPORT) #include "../../sd/cardreader.h" #endif @@ -56,14 +60,6 @@ #include "../../feature/mixing.h" #endif -FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) { - const char *str = i16tostr3(temp); - const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1; - lcd_moveto(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty); - lcd_put_u8str(&str[3-len]); - lcd_put_wchar(LCD_STR_DEGREE[0]); -} - #define X_LABEL_POS 3 #define X_VALUE_POS 11 #define XYZ_SPACING 37 @@ -71,140 +67,116 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons #define EXTRAS_BASELINE (40 + INFO_FONT_ASCENT) #define STATUS_BASELINE (LCD_PIXEL_HEIGHT - INFO_FONT_DESCENT) -#define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH && HOTENDS <= 3 && DISABLED(STATUS_COMBINE_HEATERS)) -#define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && STATUS_FAN_FRAMES) -#define ANIM_HOTEND (HOTENDS && ENABLED(STATUS_HOTEND_ANIM)) -#define ANIM_BED (DO_DRAW_BED && ENABLED(STATUS_BED_ANIM)) -#define ANIM_CHAMBER (HAS_HEATED_CHAMBER && ENABLED(STATUS_CHAMBER_ANIM)) - -#if ANIM_HOTEND || ANIM_BED - uint8_t heat_bits; +#if ANIM_HBCC + enum HeatBits : uint8_t { + HEATBIT_HOTEND, + HEATBIT_BED = HOTENDS, + HEATBIT_CHAMBER, + HEATBIT_CUTTER + }; + IF<(HEATBIT_CUTTER > 7), uint16_t, uint8_t>::type heat_bits; #endif + #if ANIM_HOTEND - #define HOTEND_ALT(N) TEST(heat_bits, N) + #define HOTEND_ALT(N) TEST(heat_bits, HEATBIT_HOTEND + N) #else #define HOTEND_ALT(N) false #endif #if ANIM_BED - #define BED_ALT() TEST(heat_bits, 7) + #define BED_ALT() TEST(heat_bits, HEATBIT_BED) #else #define BED_ALT() false #endif #if ANIM_CHAMBER - #define CHAMBER_ALT() TEST(heat_bits, 6) + #define CHAMBER_ALT() TEST(heat_bits, HEATBIT_CHAMBER) #else #define CHAMBER_ALT() false #endif - -#define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE))) -#define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1) - -#if ENABLED(MARLIN_DEV_MODE) - #define SHOW_ON_STATE READ(X_MIN_PIN) +#if ANIM_CUTTER + #define CUTTER_ALT(N) TEST(heat_bits, HEATBIT_CUTTER) #else - #define SHOW_ON_STATE false + #define CUTTER_ALT() false #endif -FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blink) { - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #endif +#if DO_DRAW_HOTENDS + #define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE))) + #define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1) +#endif - #if HAS_HEATED_BED - const bool isBed = heater < 0; - #define IFBED(A,B) (isBed ? (A) : (B)) - #else - #define IFBED(A,B) (B) - #endif +#define PROGRESS_BAR_X 54 +#define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) - #if ENABLED(MARLIN_DEV_MODE) - constexpr bool isHeat = true; - #else - const bool isHeat = IFBED(BED_ALT(), HOTEND_ALT(heater)); - #endif +FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) { + const char *str = i16tostr3(temp); + const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1; + lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]); + lcd_put_wchar(LCD_STR_DEGREE[0]); +} - const uint8_t tx = IFBED(STATUS_BED_TEXT_X, STATUS_HOTEND_TEXT_X(heater)); +#if DO_DRAW_HOTENDS - #if ENABLED(MARLIN_DEV_MODE) - const float temp = 20 + (millis() >> 8) % IFBED(100, 200); - const float target = IFBED(100, 200); - #else - const float temp = IFBED(thermalManager.degBed(), thermalManager.degHotend(heater)), - target = IFBED(thermalManager.degTargetBed(), thermalManager.degTargetHotend(heater)); - #endif + // Draw hotend bitmap with current and target temperatures + FORCE_INLINE void _draw_hotend_status(const heater_ind_t heater, const bool blink) { + #if !HEATER_IDLE_HANDLER + UNUSED(blink); + #endif - #if HAS_HEATED_CHAMBER - FORCE_INLINE void _draw_chamber_status(const bool blink) { - const float temp = thermalManager.degChamber(), - target = thermalManager.degTargetChamber(); - #if !HEATER_IDLE_HANDLER - UNUSED(blink); - #endif - if (PAGE_UNDER(7)) { - #if HEATER_IDLE_HANDLER - const bool is_idle = false, // thermalManager.chamber_idle.timed_out, - dodraw = (blink || !is_idle); - #else - constexpr bool dodraw = true; - #endif - if (dodraw) _draw_centered_temp(target + 0.5, STATUS_CHAMBER_TEXT_X, 7); - } - if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) - _draw_centered_temp(temp + 0.5f, STATUS_CHAMBER_TEXT_X, 28); - } - #endif + const bool isHeat = HOTEND_ALT(heater); - #if DISABLED(STATUS_HOTEND_ANIM) - #define STATIC_HOTEND true - #define HOTEND_DOT isHeat - #else - #define STATIC_HOTEND false - #define HOTEND_DOT false - #endif + const uint8_t tx = STATUS_HOTEND_TEXT_X(heater); - #if HAS_HEATED_BED && DISABLED(STATUS_BED_ANIM) - #define STATIC_BED true - #define BED_DOT isHeat - #else - #define STATIC_BED false - #define BED_DOT false - #endif + const float temp = thermalManager.degHotend(heater), + target = thermalManager.degTargetHotend(heater); - #if ANIM_HOTEND && ENABLED(STATUS_HOTEND_INVERTED) - #define OFF_BMP(N) status_hotend##N##_b_bmp - #define ON_BMP(N) status_hotend##N##_a_bmp - #else - #define OFF_BMP(N) status_hotend##N##_a_bmp - #define ON_BMP(N) status_hotend##N##_b_bmp - #endif + #if DISABLED(STATUS_HOTEND_ANIM) + #define STATIC_HOTEND true + #define HOTEND_DOT isHeat + #else + #define STATIC_HOTEND false + #define HOTEND_DOT false + #endif - #if STATUS_HOTEND_BITMAPS > 1 - static const unsigned char* const status_hotend_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, OFF_BMP(1), OFF_BMP(2), OFF_BMP(3), OFF_BMP(4), OFF_BMP(5), OFF_BMP(6)); - #if ANIM_HOTEND - static const unsigned char* const status_hotend_on_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, ON_BMP(1), ON_BMP(2), ON_BMP(3), ON_BMP(4), ON_BMP(5), ON_BMP(6)); - #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr((S) ? &status_hotend_on_gfx[(N) % (STATUS_HOTEND_BITMAPS)] : &status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)]) + #if ANIM_HOTEND && BOTH(STATUS_HOTEND_INVERTED, STATUS_HOTEND_NUMBERLESS) + #define OFF_BMP(N) status_hotend_b_bmp + #define ON_BMP(N) status_hotend_a_bmp + #elif ANIM_HOTEND && DISABLED(STATUS_HOTEND_INVERTED) && ENABLED(STATUS_HOTEND_NUMBERLESS) + #define OFF_BMP(N) status_hotend_a_bmp + #define ON_BMP(N) status_hotend_b_bmp + #elif ANIM_HOTEND && ENABLED(STATUS_HOTEND_INVERTED) + #define OFF_BMP(N) status_hotend##N##_b_bmp + #define ON_BMP(N) status_hotend##N##_a_bmp #else - #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr(&status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)]) + #define OFF_BMP(N) status_hotend##N##_a_bmp + #define ON_BMP(N) status_hotend##N##_b_bmp + #endif + + #if STATUS_HOTEND_BITMAPS > 1 + static const unsigned char* const status_hotend_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, OFF_BMP(1), OFF_BMP(2), OFF_BMP(3), OFF_BMP(4), OFF_BMP(5), OFF_BMP(6)); + #if ANIM_HOTEND + static const unsigned char* const status_hotend_on_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, ON_BMP(1), ON_BMP(2), ON_BMP(3), ON_BMP(4), ON_BMP(5), ON_BMP(6)); + #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr((S) ? &status_hotend_on_gfx[(N) % (STATUS_HOTEND_BITMAPS)] : &status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)]) + #else + #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr(&status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)]) + #endif + #elif ANIM_HOTEND + #define HOTEND_BITMAP(N,S) ((S) ? ON_BMP() : OFF_BMP()) + #else + #define HOTEND_BITMAP(N,S) status_hotend_a_bmp #endif - #elif ANIM_HOTEND - #define HOTEND_BITMAP(N,S) ((S) ? ON_BMP() : OFF_BMP()) - #else - #define HOTEND_BITMAP(N,S) status_hotend_a_bmp - #endif - if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) { + if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) { - #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) + #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) - const float prop = target - 20, - perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; - uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); - NOMORE(tall, BAR_TALL); + const float prop = target - 20, + perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; + uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); + NOMORE(tall, BAR_TALL); - #ifdef STATUS_HOTEND_ANIM - // Draw hotend bitmap, either whole or split by the heating percent - if (IFBED(0, 1)) { - const uint8_t hx = STATUS_HOTEND_X(heater), bw = STATUS_HOTEND_BYTEWIDTH(heater); + #if ANIM_HOTEND + // Draw hotend bitmap, either whole or split by the heating percent + const uint8_t hx = STATUS_HOTEND_X(heater), + bw = STATUS_HOTEND_BYTEWIDTH(heater); #if ENABLED(STATUS_HEAT_PERCENT) if (isHeat && tall <= BAR_TALL) { const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; @@ -214,46 +186,131 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin else #endif u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(heater, isHeat)); - } - #endif + #endif - // Draw a heating progress bar, if specified - #if ENABLED(STATUS_HEAT_PERCENT) + // Draw a heating progress bar, if specified + #if DO_DRAW_BED && ENABLED(STATUS_HEAT_PERCENT) - if (IFBED(true, STATIC_HOTEND) && isHeat) { - const uint8_t bx = IFBED(STATUS_BED_X + STATUS_BED_WIDTH, STATUS_HOTEND_X(heater) + STATUS_HOTEND_WIDTH(heater)) + 1; - u8g.drawFrame(bx, STATUS_HEATERS_Y, 3, STATUS_HEATERS_HEIGHT); - if (tall) { - const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; - if (PAGE_OVER(STATUS_HEATERS_Y + ph)) - u8g.drawVLine(bx + 1, STATUS_HEATERS_Y + ph, tall); + if (STATIC_HOTEND && isHeat) { + const uint8_t bx = STATUS_HOTEND_X(heater) + STATUS_HOTEND_WIDTH(heater) + 1; + u8g.drawFrame(bx, STATUS_HEATERS_Y, 3, STATUS_HEATERS_HEIGHT); + if (tall) { + const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; + if (PAGE_OVER(STATUS_HEATERS_Y + ph)) + u8g.drawVLine(bx + 1, STATUS_HEATERS_Y + ph, tall); + } } - } + #endif + + } // PAGE_CONTAINS + + if (PAGE_UNDER(7)) { + #if HEATER_IDLE_HANDLER + const bool dodraw = (blink || !thermalManager.hotend_idle[heater].timed_out); + #else + constexpr bool dodraw = true; + #endif + if (dodraw) _draw_centered_temp(target + 0.5, tx, 7); + } + + if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) + _draw_centered_temp(temp + 0.5f, tx, 28); + + if (STATIC_HOTEND && HOTEND_DOT && PAGE_CONTAINS(17, 19)) { + u8g.setColorIndex(0); // set to white on black + u8g.drawBox(tx, 20 - 3, 2, 2); + u8g.setColorIndex(1); // restore black on white + } + + } + +#endif // DO_DRAW_HOTENDS + +#if DO_DRAW_BED + + // Draw bed bitmap with current and target temperatures + FORCE_INLINE void _draw_bed_status(const bool blink) { + #if !HEATER_IDLE_HANDLER + UNUSED(blink); #endif - } // PAGE_CONTAINS + const bool isHeat = BED_ALT(); + + const uint8_t tx = STATUS_BED_TEXT_X; - if (PAGE_UNDER(7)) { - #if HEATER_IDLE_HANDLER - const bool is_idle = IFBED(thermalManager.bed_idle.timed_out, thermalManager.hotend_idle[heater].timed_out), - dodraw = (blink || !is_idle); + const float temp = thermalManager.degBed(), + target = thermalManager.degTargetBed(); + + #if DO_DRAW_BED && DISABLED(STATUS_BED_ANIM) + #define STATIC_BED true + #define BED_DOT isHeat #else - constexpr bool dodraw = true; + #define STATIC_BED false + #define BED_DOT false #endif - if (dodraw) _draw_centered_temp(target + 0.5, tx, 7); + + if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) { + + #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) + + const float prop = target - 20, + perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; + uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); + NOMORE(tall, BAR_TALL); + + // Draw a heating progress bar, if specified + #if ENABLED(STATUS_HEAT_PERCENT) + + if (isHeat) { + const uint8_t bx = STATUS_BED_X + STATUS_BED_WIDTH; + u8g.drawFrame(bx, STATUS_HEATERS_Y, 3, STATUS_HEATERS_HEIGHT); + if (tall) { + const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; + if (PAGE_OVER(STATUS_HEATERS_Y + ph)) + u8g.drawVLine(bx + 1, STATUS_HEATERS_Y + ph, tall); + } + } + + #endif + + } // PAGE_CONTAINS + + if (PAGE_UNDER(7)) { + #if HEATER_IDLE_HANDLER + const bool dodraw = (blink || !thermalManager.bed_idle.timed_out); + #else + constexpr bool dodraw = true; + #endif + if (dodraw) _draw_centered_temp(target + 0.5, tx, 7); + } + + if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) + _draw_centered_temp(temp + 0.5f, tx, 28); + + if (STATIC_BED && BED_DOT && PAGE_CONTAINS(17, 19)) { + u8g.setColorIndex(0); // set to white on black + u8g.drawBox(tx, 20 - 2, 2, 2); + u8g.setColorIndex(1); // restore black on white + } + } - if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) - _draw_centered_temp(temp + 0.5f, tx, 28); +#endif // DO_DRAW_BED + +#if DO_DRAW_CHAMBER - if (IFBED(STATIC_BED && BED_DOT, STATIC_HOTEND && HOTEND_DOT) && PAGE_CONTAINS(17, 19)) { - u8g.setColorIndex(0); // set to white on black - u8g.drawBox(tx, IFBED(20-2, 20-3), 2, 2); - u8g.setColorIndex(1); // restore black on white + FORCE_INLINE void _draw_chamber_status() { + #if HAS_HEATED_CHAMBER + if (PAGE_UNDER(7)) + _draw_centered_temp(thermalManager.degTargetChamber() + 0.5f, STATUS_CHAMBER_TEXT_X, 7); + #endif + + if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) + _draw_centered_temp(thermalManager.degChamber() + 0.5f, STATUS_CHAMBER_TEXT_X, 28); } -} +#endif // DO_DRAW_CHAMBER // // Before homing, blink '123' <-> '???'. @@ -261,9 +318,14 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin // Homed and known, display constantly. // FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - const uint8_t offs = (XYZ_SPACING) * axis; - lcd_moveto(X_LABEL_POS + offs, XYZ_BASELINE); - lcd_put_wchar('X' + axis); + const AxisEnum a = ( + #if ENABLED(LCD_SHOW_E_TOTAL) + axis == E_AXIS ? X_AXIS : + #endif + axis + ); + const uint8_t offs = (XYZ_SPACING) * a; + lcd_put_wchar(X_LABEL_POS + offs, XYZ_BASELINE, axis_codes[axis]); lcd_moveto(X_VALUE_POS + offs, XYZ_BASELINE); if (blink) lcd_put_u8str(value); @@ -281,48 +343,155 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const } } -#if ENABLED(MARLIN_DEV_MODE) - uint16_t count_renders = 0; - uint32_t total_cycles = 0; -#endif - void MarlinUI::draw_status_screen() { - #if ENABLED(MARLIN_DEV_MODE) - if (first_page) count_renders++; - #endif - - static char xstring[5], ystring[5], zstring[8]; + static char xstring[5 + #if ENABLED(LCD_SHOW_E_TOTAL) + + 7 + #endif + ], ystring[5], zstring[8]; #if ENABLED(FILAMENT_LCD_DISPLAY) static char wstring[5], mstring[4]; #endif + #if HAS_PRINT_PROGRESS + #if DISABLED(DOGM_SD_PERCENT) + #define _SD_INFO_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2) + #else + #define _SD_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH)) + #endif + + #if ENABLED(DOGM_SD_PERCENT) + static char progress_string[5]; + #endif + static uint8_t lastElapsed = 0xFF, lastProgress = 0xFF; + static u8g_uint_t elapsed_x_pos = 0, progress_bar_solid_width = 0; + static char elapsed_string[16]; + #if ENABLED(SHOW_REMAINING_TIME) + static u8g_uint_t estimation_x_pos = 0; + static char estimation_string[10]; + #if BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY) + static u8g_uint_t progress_x_pos = 0; + static uint8_t progress_state = 0; + static bool prev_blink = 0; + #endif + #endif + #endif + + const bool showxy = (true + #if ENABLED(LCD_SHOW_E_TOTAL) + && !printingIsActive() + #endif + ); + // At the first page, generate new display values if (first_page) { - #if ANIM_HOTEND || ANIM_BED || ANIM_CHAMBER + #if ANIM_HBCC uint8_t new_bits = 0; #if ANIM_HOTEND - HOTEND_LOOP() if (thermalManager.isHeatingHotend(e) ^ SHOW_ON_STATE) SBI(new_bits, e); + HOTEND_LOOP() if (thermalManager.isHeatingHotend(e)) SBI(new_bits, HEATBIT_HOTEND + e); #endif #if ANIM_BED - if (thermalManager.isHeatingBed() ^ SHOW_ON_STATE) SBI(new_bits, 7); + if (thermalManager.isHeatingBed()) SBI(new_bits, HEATBIT_BED); + #endif + #if DO_DRAW_CHAMBER && HAS_HEATED_CHAMBER + if (thermalManager.isHeatingChamber()) SBI(new_bits, HEATBIT_CHAMBER); #endif - #if ANIM_CHAMBER - if (thermalManager.isHeatingChamber() ^ SHOW_ON_STATE) SBI(new_bits, 6); + #if ANIM_CUTTER + if (cutter.enabled()) SBI(new_bits, HEATBIT_CUTTER); #endif heat_bits = new_bits; #endif - strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS]))); - strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS]))); - strcpy(zstring, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS]))); + + const xyz_pos_t lpos = current_position.asLogical(); + strcpy(zstring, ftostr52sp(lpos.z)); + + if (showxy) { + strcpy(xstring, ftostr4sign(lpos.x)); + strcpy(ystring, ftostr4sign(lpos.y)); + } + else { + #if ENABLED(LCD_SHOW_E_TOTAL) + const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm + sprintf_P(xstring, PSTR("%ld%cm"), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm + #endif + } + #if ENABLED(FILAMENT_LCD_DISPLAY) - strcpy(wstring, ftostr12ns(filament_width_meas)); - strcpy(mstring, i16tostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); + strcpy(wstring, ftostr12ns(filwidth.measured_mm)); + strcpy(mstring, i16tostr3(planner.volumetric_percent(parser.volumetric_enabled))); + #endif + + // Progress / elapsed / estimation updates and string formatting to avoid float math on each LCD draw + #if HAS_PRINT_PROGRESS + const progress_t progress = + #if HAS_PRINT_PROGRESS_PERMYRIAD + get_progress_permyriad() + #else + get_progress_percent() + #endif + ; + duration_t elapsed = print_job_timer.duration(); + const uint8_t p = progress & 0xFF, ev = elapsed.value & 0xFF; + if (p != lastProgress) { + lastProgress = p; + + progress_bar_solid_width = u8g_uint_t((PROGRESS_BAR_WIDTH - 2) * progress / (PROGRESS_SCALE) * 0.01f); + + #if ENABLED(DOGM_SD_PERCENT) + if (progress == 0) { + progress_string[0] = '\0'; + #if ENABLED(SHOW_REMAINING_TIME) + estimation_string[0] = '\0'; + estimation_x_pos = _SD_INFO_X(0); + #endif + } + else { + strcpy(progress_string, ( + #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) + permyriadtostr4(progress) + #else + ui8tostr3(progress / (PROGRESS_SCALE)) + #endif + )); + } + #if BOTH(SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) // Tri-state progress display mode + progress_x_pos = _SD_INFO_X(strlen(progress_string) + 1); + #endif + #endif + } + + if (ev != lastElapsed) { + lastElapsed = ev; + const bool has_days = (elapsed.value >= 60*60*24L); + const uint8_t len = elapsed.toDigital(elapsed_string, has_days); + elapsed_x_pos = _SD_INFO_X(len); + + #if ENABLED(SHOW_REMAINING_TIME) + if (!(ev & 0x3)) { + uint32_t timeval = (0 + #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) + + get_remaining_time() + #endif + ); + if (!timeval && progress > 0) timeval = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress; + if (!timeval) { + estimation_string[0] = '\0'; + estimation_x_pos = _SD_INFO_X(0); + } + else { + duration_t estimation = timeval; + const bool has_days = (estimation.value >= 60*60*24L); + const uint8_t len = estimation.toDigital(estimation_string, has_days); + estimation_x_pos = _SD_INFO_X(len + #if !BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY) + + 1 + #endif + ); + } + } + #endif + } #endif } @@ -331,11 +500,7 @@ void MarlinUI::draw_status_screen() { // Status Menu Font set_font(FONT_STATUSMENU); - #if ENABLED(MARLIN_DEV_MODE) - TCNT5 = 0; - #endif - - #if STATUS_LOGO_WIDTH + #if DO_DRAW_LOGO if (PAGE_CONTAINS(STATUS_LOGO_Y, STATUS_LOGO_Y + STATUS_LOGO_HEIGHT - 1)) u8g.drawBitmapP(STATUS_LOGO_X, STATUS_LOGO_Y, STATUS_LOGO_BYTEWIDTH, STATUS_LOGO_HEIGHT, status_logo_bmp); #endif @@ -346,29 +511,40 @@ void MarlinUI::draw_status_screen() { u8g.drawBitmapP(STATUS_HEATERS_X, STATUS_HEATERS_Y, STATUS_HEATERS_BYTEWIDTH, STATUS_HEATERS_HEIGHT, status_heaters_bmp); #endif - #if DO_DRAW_BED + #if DO_DRAW_CUTTER + #if ANIM_CUTTER + #define CUTTER_BITMAP(S) ((S) ? status_cutter_on_bmp : status_cutter_bmp) + #else + #define CUTTER_BITMAP(S) status_cutter_bmp + #endif + const uint8_t cuttery = STATUS_CUTTER_Y(CUTTER_ALT()), + cutterh = STATUS_CUTTER_HEIGHT(CUTTER_ALT()); + if (PAGE_CONTAINS(cuttery, cuttery + cutterh - 1)) + u8g.drawBitmapP(STATUS_CUTTER_X, cuttery, STATUS_CUTTER_BYTEWIDTH, cutterh, CUTTER_BITMAP(CUTTER_ALT())); + #endif + + #if DO_DRAW_BED && DISABLED(STATUS_COMBINE_HEATERS) #if ANIM_BED #define BED_BITMAP(S) ((S) ? status_bed_on_bmp : status_bed_bmp) #else #define BED_BITMAP(S) status_bed_bmp #endif - const uint8_t bedy = STATUS_BED_Y(BED_ALT()), bedh = STATUS_BED_HEIGHT(BED_ALT()); + const uint8_t bedy = STATUS_BED_Y(BED_ALT()), + bedh = STATUS_BED_HEIGHT(BED_ALT()); if (PAGE_CONTAINS(bedy, bedy + bedh - 1)) u8g.drawBitmapP(STATUS_BED_X, bedy, STATUS_BED_BYTEWIDTH, bedh, BED_BITMAP(BED_ALT())); #endif #if DO_DRAW_CHAMBER - #if ANIM_HAMBER + #if ANIM_CHAMBER #define CHAMBER_BITMAP(S) ((S) ? status_chamber_on_bmp : status_chamber_bmp) #else #define CHAMBER_BITMAP(S) status_chamber_bmp #endif - if (PAGE_CONTAINS(STATUS_CHAMBER_Y, STATUS_CHAMBER_Y + STATUS_CHAMBER_HEIGHT - 1)) - u8g.drawBitmapP( - STATUS_CHAMBER_X, STATUS_CHAMBER_Y, - STATUS_CHAMBER_BYTEWIDTH, STATUS_CHAMBER_HEIGHT, - CHAMBER_BITMAP(CHAMBER_ALT()) - ); + const uint8_t chambery = STATUS_CHAMBER_Y(CHAMBER_ALT()), + chamberh = STATUS_CHAMBER_HEIGHT(CHAMBER_ALT()); + if (PAGE_CONTAINS(chambery, chambery + chamberh - 1)) + u8g.drawBitmapP(STATUS_CHAMBER_X, chambery, STATUS_CHAMBER_BYTEWIDTH, chamberh, CHAMBER_BITMAP(CHAMBER_ALT())); #endif #if DO_DRAW_FAN @@ -381,9 +557,7 @@ void MarlinUI::draw_status_screen() { } #endif if (PAGE_CONTAINS(STATUS_FAN_Y, STATUS_FAN_Y + STATUS_FAN_HEIGHT - 1)) - u8g.drawBitmapP( - STATUS_FAN_X, STATUS_FAN_Y, - STATUS_FAN_BYTEWIDTH, STATUS_FAN_HEIGHT, + u8g.drawBitmapP(STATUS_FAN_X, STATUS_FAN_Y, STATUS_FAN_BYTEWIDTH, STATUS_FAN_HEIGHT, #if STATUS_FAN_FRAMES > 2 fan_frame == 1 ? status_fan1_bmp : fan_frame == 2 ? status_fan2_bmp : @@ -400,19 +574,29 @@ void MarlinUI::draw_status_screen() { // // Temperature Graphics and Info // - if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) { // Extruders - for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e) - _draw_heater_status((heater_ind_t)e, blink); + #if DO_DRAW_HOTENDS + for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e) + _draw_hotend_status((heater_ind_t)e, blink); + #endif - // Heated bed - #if HAS_HEATED_BED && HOTENDS < 4 - _draw_heater_status(H_BED, blink); + // Laser / Spindle + #if DO_DRAW_CUTTER + if (cutter.power && PAGE_CONTAINS(STATUS_CUTTER_TEXT_Y - INFO_FONT_ASCENT, STATUS_CUTTER_TEXT_Y - 1)) { + lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, i16tostr3(cutter.powerPercent(cutter.power))); + lcd_put_wchar('%'); + } #endif - #if HAS_HEATED_CHAMBER - _draw_chamber_status(blink); + // Heated Bed + #if DO_DRAW_BED + _draw_bed_status(blink); + #endif + + // Heated Chamber + #if DO_DRAW_CHAMBER + _draw_chamber_status(); #endif // Fan, if a bitmap was provided @@ -427,18 +611,13 @@ void MarlinUI::draw_status_screen() { c = '*'; } #endif - lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y); - lcd_put_u8str(i16tostr3(thermalManager.fanPercent(spd))); + lcd_put_u8str(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y, i16tostr3(thermalManager.fanPercent(spd))); lcd_put_wchar(c); } } #endif } - #if ENABLED(MARLIN_DEV_MODE) - total_cycles += TCNT5; - #endif - #if ENABLED(SDSUPPORT) // // SD Card Symbol @@ -459,57 +638,68 @@ void MarlinUI::draw_status_screen() { // // Progress bar frame // - #define PROGRESS_BAR_X 54 - #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) if (PAGE_CONTAINS(49, 52)) u8g.drawFrame(PROGRESS_BAR_X, 49, PROGRESS_BAR_WIDTH, 4); - const uint8_t progress = get_progress(); + // + // Progress bar solid part + // - if (progress > 1) { + if (PAGE_CONTAINS(50, 51)) // 50-51 (or just 50) + u8g.drawBox(PROGRESS_BAR_X + 1, 50, progress_bar_solid_width, 2); - // - // Progress bar solid part - // + if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) { - if (PAGE_CONTAINS(50, 51)) // 50-51 (or just 50) - u8g.drawBox( - PROGRESS_BAR_X + 1, 50, - (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress * 0.01), 2 - ); + #if ALL(DOGM_SD_PERCENT, SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) - // - // SD Percent Complete - // + if (prev_blink != blink) { + prev_blink = blink; + if (++progress_state >= 3) progress_state = 0; + } - #if ENABLED(DOGM_SD_PERCENT) - if (PAGE_CONTAINS(41, 48)) { - // Percent complete - lcd_moveto(55, 48); - lcd_put_u8str(ui8tostr3(progress)); - lcd_put_wchar('%'); + if (progress_state == 0) { + if (progress_string[0]) { + lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string); + lcd_put_wchar('%'); + } + } + else if (progress_state == 2 && estimation_string[0]) { + lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, "R:"); + lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string); + } + else if (elapsed_string[0]) { + lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, "E:"); + lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string); } - #endif - } - // - // Elapsed Time - // + #else // !DOGM_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY - #if DISABLED(DOGM_SD_PERCENT) - #define SD_DURATION_X (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH / 2) - len * (MENU_FONT_WIDTH / 2)) - #else - #define SD_DURATION_X (LCD_PIXEL_WIDTH - len * MENU_FONT_WIDTH) - #endif + // + // SD Percent Complete + // - if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) { - char buffer[13]; - duration_t elapsed = print_job_timer.duration(); - bool has_days = (elapsed.value >= 60*60*24L); - uint8_t len = elapsed.toDigital(buffer, has_days); - lcd_moveto(SD_DURATION_X, EXTRAS_BASELINE); - lcd_put_u8str(buffer); + #if ENABLED(DOGM_SD_PERCENT) + if (progress_string[0]) { + lcd_put_u8str(55, 48, progress_string); // Percent complete + lcd_put_wchar('%'); + } + #endif + + // + // Elapsed Time + // + + #if ENABLED(SHOW_REMAINING_TIME) + if (blink && estimation_string[0]) { + lcd_put_wchar(estimation_x_pos, EXTRAS_BASELINE, 'R'); + lcd_put_u8str(estimation_string); + } + else + #endif + lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string); + + #endif // !DOGM_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY } #endif // HAS_PRINT_PROGRESS @@ -518,10 +708,6 @@ void MarlinUI::draw_status_screen() { // XYZ Coordinates // - #define X_LABEL_POS 3 - #define X_VALUE_POS 11 - #define XYZ_SPACING 37 - #if ENABLED(XYZ_HOLLOW_FRAME) #define XYZ_FRAME_TOP 29 #define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 3 @@ -548,8 +734,6 @@ void MarlinUI::draw_status_screen() { // Two-component mix / gradient instead of XY - lcd_moveto(X_LABEL_POS, XYZ_BASELINE); - char mixer_messages[12]; const char *mix_label; #if ENABLED(GRADIENT_MIX) @@ -564,12 +748,18 @@ void MarlinUI::draw_status_screen() { mix_label = "Mx"; } sprintf_P(mixer_messages, PSTR("%s %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); - lcd_put_u8str(mixer_messages); + lcd_put_u8str(X_LABEL_POS, XYZ_BASELINE, mixer_messages); #else - _draw_axis_value(X_AXIS, xstring, blink); - _draw_axis_value(Y_AXIS, ystring, blink); + if (showxy) { + _draw_axis_value(X_AXIS, xstring, blink); + _draw_axis_value(Y_AXIS, ystring, blink); + } + else { + _draw_axis_value(E_AXIS, xstring, true); + lcd_put_u8str_P(PSTR(" ")); + } #endif @@ -584,40 +774,32 @@ void MarlinUI::draw_status_screen() { // // Feedrate // - #define EXTRAS_2_BASELINE (EXTRAS_BASELINE + 3) if (PAGE_CONTAINS(EXTRAS_2_BASELINE - INFO_FONT_ASCENT, EXTRAS_2_BASELINE - 1)) { set_font(FONT_MENU); - lcd_moveto(3, EXTRAS_2_BASELINE); - lcd_put_wchar(LCD_STR_FEEDRATE[0]); + lcd_put_wchar(3, EXTRAS_2_BASELINE, LCD_STR_FEEDRATE[0]); set_font(FONT_STATUSMENU); - lcd_moveto(12, EXTRAS_2_BASELINE); - lcd_put_u8str(i16tostr3(feedrate_percentage)); + lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3(feedrate_percentage)); lcd_put_wchar('%'); // // Filament sensor display if SD is disabled // #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) - lcd_moveto(56, EXTRAS_2_BASELINE); - lcd_put_u8str(wstring); - lcd_moveto(102, EXTRAS_2_BASELINE); - lcd_put_u8str(mstring); + lcd_put_u8str(56, EXTRAS_2_BASELINE, wstring); + lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring); lcd_put_wchar('%'); set_font(FONT_MENU); - lcd_moveto(47, EXTRAS_2_BASELINE); - lcd_put_wchar(LCD_STR_FILAM_DIA[0]); // lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA)); - lcd_moveto(93, EXTRAS_2_BASELINE); - lcd_put_wchar(LCD_STR_FILAM_MUL[0]); + lcd_put_wchar(47, EXTRAS_2_BASELINE, LCD_STR_FILAM_DIA[0]); // lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA)); + lcd_put_wchar(93, EXTRAS_2_BASELINE, LCD_STR_FILAM_MUL[0]); #endif } // // Status line // - if (PAGE_CONTAINS(STATUS_BASELINE - INFO_FONT_ASCENT, STATUS_BASELINE + INFO_FONT_DESCENT)) { lcd_moveto(0, STATUS_BASELINE); @@ -640,17 +822,6 @@ void MarlinUI::draw_status_screen() { void MarlinUI::draw_status_message(const bool blink) { - #if ENABLED(MARLIN_DEV_MODE) - if (PAGE_CONTAINS(64-8, 64-1)) { - lcd_put_int(total_cycles); - lcd_put_wchar('/'); - lcd_put_int(count_renders); - lcd_put_wchar('='); - lcd_put_int(int(total_cycles / count_renders)); - return; - } - #endif - // Get the UTF8 character count of the string uint8_t slen = utf8_strlen(status_message); diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 20c360f51988..439078b51e48 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -59,6 +59,12 @@ #include "../../sd/cardreader.h" #endif +#if ENABLED(LCD_SHOW_E_TOTAL) + #include "../../Marlin.h" // for printingIsActive +#endif + +#define TEXT_MODE_LCD_WIDTH 16 + #define BUFFER_WIDTH 256 #define BUFFER_HEIGHT 32 @@ -610,6 +616,8 @@ void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percenta begin_data(); write_number(percentage, 3); write_byte('%'); + #else + UNUSED(percentage); #endif } @@ -619,13 +627,12 @@ void ST7920_Lite_Status_Screen::draw_status_message() { set_ddram_address(DDRAM_LINE_4); begin_data(); #if ENABLED(STATUS_MESSAGE_SCROLLING) - uint8_t slen = utf8_strlen(str); - if (slen <= LCD_WIDTH) { + if (slen <= TEXT_MODE_LCD_WIDTH) { // String fits the LCD, so just print it write_str(str); - while (slen < LCD_WIDTH) { write_byte(' '); ++slen; } + while (slen < TEXT_MODE_LCD_WIDTH) { write_byte(' '); ++slen; } } else { // String is larger than the available space in screen. @@ -634,12 +641,12 @@ void ST7920_Lite_Status_Screen::draw_status_message() { // and the string remaining length uint8_t rlen; const char *stat = ui.status_and_len(rlen); - write_str(stat, LCD_WIDTH); + write_str(stat, TEXT_MODE_LCD_WIDTH); // If the remaining string doesn't completely fill the screen - if (rlen < LCD_WIDTH) { + if (rlen < TEXT_MODE_LCD_WIDTH) { write_byte('.'); // Always at 1+ spaces left, draw a dot - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters + uint8_t chars = TEXT_MODE_LCD_WIDTH - rlen; // Amount of space left in characters if (--chars) { // Draw a second dot if there's space write_byte('.'); if (--chars) write_str(str, chars); // Print a second copy of the message @@ -651,13 +658,13 @@ void ST7920_Lite_Status_Screen::draw_status_message() { #else uint8_t slen = utf8_strlen(str); - write_str(str, LCD_WIDTH); - for (; slen < LCD_WIDTH; ++slen) write_byte(' '); + write_str(str, TEXT_MODE_LCD_WIDTH); + for (; slen < TEXT_MODE_LCD_WIDTH; ++slen) write_byte(' '); #endif } -void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, const float z, bool position_known) { +void ST7920_Lite_Status_Screen::draw_position(const xyze_pos_t &pos, const bool position_known) { char str[7]; set_ddram_address(DDRAM_LINE_4); begin_data(); @@ -665,17 +672,28 @@ void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, cons // If position is unknown, flash the labels. const unsigned char alt_label = position_known ? 0 : (ui.get_blink() ? ' ' : 0); - dtostrf(x, -4, 0, str); - write_byte(alt_label ? alt_label : 'X'); - write_str(str, 4); + if (true + #if ENABLED(LCD_SHOW_E_TOTAL) + && !printingIsActive() + #endif + ) { + write_byte(alt_label ? alt_label : 'X'); + write_str(dtostrf(pos.x, -4, 0, str), 4); - dtostrf(y, -4, 0, str); - write_byte(alt_label ? alt_label : 'Y'); - write_str(str, 4); + write_byte(alt_label ? alt_label : 'Y'); + write_str(dtostrf(pos.y, -4, 0, str), 4); + } + else { + #if ENABLED(LCD_SHOW_E_TOTAL) + char tmp[15]; + const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm + sprintf_P(tmp, PSTR("E%-7ld%cm "), uint32_t(_MAX(e_move_accumulator, 0.0f)) / escale, escale == 10 ? 'c' : 'm'); // 1234567mm + write_str(tmp); + #endif + } - dtostrf(z, -5, 1, str); write_byte(alt_label ? alt_label : 'Z'); - write_str(str, 5); + write_str(dtostrf(pos.z, -5, 1, str), 5); } bool ST7920_Lite_Status_Screen::indicators_changed() { @@ -750,8 +768,8 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { } bool ST7920_Lite_Status_Screen::position_changed() { - const float x_pos = current_position[X_AXIS], y_pos = current_position[Y_AXIS], z_pos = current_position[Z_AXIS]; - const uint8_t checksum = uint8_t(x_pos) ^ uint8_t(y_pos) ^ uint8_t(z_pos); + const xyz_pos_t pos = current_position; + const uint8_t checksum = uint8_t(pos.x) ^ uint8_t(pos.y) ^ uint8_t(pos.z); static uint8_t last_checksum = 0, changed = last_checksum != checksum; if (changed) last_checksum = checksum; return changed; @@ -760,7 +778,8 @@ bool ST7920_Lite_Status_Screen::position_changed() { bool ST7920_Lite_Status_Screen::status_changed() { uint8_t checksum = 0; for (const char *p = ui.status_message; *p; p++) checksum ^= *p; - static uint8_t last_checksum = 0, changed = last_checksum != checksum; + static uint8_t last_checksum = 0; + bool changed = last_checksum != checksum; if (changed) last_checksum = checksum; return changed; } @@ -805,7 +824,7 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { } #if !STATUS_EXPIRE_SECONDS #if ENABLED(STATUS_MESSAGE_SCROLLING) - else + else if (blink_changed()) draw_status_message(); #endif #else @@ -827,16 +846,14 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { } } - if (countdown == 0 && (forceUpdate || position_changed() || + if (countdown == 0 && (forceUpdate || position_changed() #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - blink_changed() + || blink_changed() #endif )) { - draw_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - #if ENABLED(DISABLE_REDUCED_ACCURACY_WARNING) - true - #else - all_axes_known() + draw_position(current_position, true + #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) + && all_axes_known() #endif ); } @@ -851,7 +868,7 @@ void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) { // when an update is actually necessary. static uint8_t last_progress = 0; - const uint8_t progress = ui.get_progress(); + const uint8_t progress = ui.get_progress_percent(); if (forceUpdate || last_progress != progress) { last_progress = progress; draw_progress_bar(progress); diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h index 1fb707ca1db1..bc18c43f107f 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h @@ -17,6 +17,7 @@ #include "../../HAL/shared/HAL_ST7920.h" +#include "../../core/types.h" #include "../../core/macros.h" #include "../../libs/duration_t.h" @@ -86,7 +87,7 @@ class ST7920_Lite_Status_Screen { static void draw_print_time(const duration_t &elapsed); static void draw_feedrate_percentage(const uint16_t percentage); static void draw_status_message(); - static void draw_position(const float x, const float y, const float z, bool position_known = true); + static void draw_position(const xyze_pos_t &pos, bool position_known = true); static bool indicators_changed(); static bool position_changed(); diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp index 82bfca8197bf..d1d740e23570 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp @@ -69,7 +69,6 @@ #if HAS_GRAPHICAL_LCD -#include #include "HAL_LCD_com_defines.h" #define WIDTH 128 diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp index c1961117c4d2..8db341293a66 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp @@ -58,7 +58,6 @@ #if HAS_GRAPHICAL_LCD #include - #include "HAL_LCD_com_defines.h" #define WIDTH 128 diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp index 71c8efd5005d..1b9a80f9d2a7 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp @@ -57,8 +57,6 @@ #if HAS_GRAPHICAL_LCD -#include - #include "HAL_LCD_com_defines.h" #define LCD_PIXEL_WIDTH 128 @@ -203,7 +201,7 @@ u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_f U8G_PB_DEV(u8g_dev_st7920_128x64_HAL_hw_spi, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT, PAGE_HEIGHT, u8g_dev_st7920_128x64_HAL_fn, U8G_COM_ST7920_HAL_HW_SPI); u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_HW_SPI }; -#if defined(U8G_HAL_LINKS) || defined(__SAM3X8E__) +#if NONE(__AVR__, ARDUINO_ARCH_STM32) || defined(U8G_HAL_LINKS) // Also use this device for HAL version of rrd class. This results in the same device being used // for the ST7920 for HAL systems no matter what is selected in ultralcd_impl_DOGM.h. u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI }; diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp index ca3d7f5757e8..8c1dfa3ffeba 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp @@ -59,41 +59,142 @@ #if HAS_GRAPHICAL_LCD && PIN_EXISTS(FSMC_CS) -#include "U8glib.h" #include "HAL_LCD_com_defines.h" -#include "string.h" +#include "ultralcd_DOGM.h" -#define WIDTH 128 -#define HEIGHT 64 +#include + +#if ENABLED(LCD_USE_DMA_FSMC) + extern void LCD_IO_WriteSequence(uint16_t *data, uint16_t length); + extern void LCD_IO_WriteSequence_Async(uint16_t *data, uint16_t length); + extern void LCD_IO_WaitSequence_Async(); + extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); +#endif + +#define WIDTH LCD_PIXEL_WIDTH +#define HEIGHT LCD_PIXEL_HEIGHT #define PAGE_HEIGHT 8 -#define X_MIN 32 -#define Y_MIN 56 -#define X_MAX (X_MIN + 2 * WIDTH - 1) -#define Y_MAX (Y_MIN + 2 * HEIGHT - 1) +#define X_LO LCD_PIXEL_OFFSET_X +#define Y_LO LCD_PIXEL_OFFSET_Y +#define X_HI (X_LO + 2 * WIDTH - 1) +#define Y_HI (Y_LO + 2 * HEIGHT - 1) #define LCD_COLUMN 0x2A /* Colomn address register */ #define LCD_ROW 0x2B /* Row address register */ #define LCD_WRITE_RAM 0x2C +// see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html + +#define COLOR_BLACK 0x0000 // #000000 +#define COLOR_WHITE 0xFFFF // #FFFFFF +#define COLOR_SILVER 0xC618 // #C0C0C0 +#define COLOR_GREY 0x7BEF // #808080 +#define COLOR_DARKGREY 0x4208 // #404040 +#define COLOR_DARKGREY2 0x39E7 // #303030 +#define COLOR_DARK 0x0003 // Some dark color + +#define COLOR_RED 0xF800 // #FF0000 +#define COLOR_LIME 0x7E00 // #00FF00 +#define COLOR_BLUE 0x001F // #0000FF +#define COLOR_YELLOW 0xFFE0 // #FFFF00 +#define COLOR_MAGENTA 0xF81F // #FF00FF +#define COLOR_FUCHSIA 0xF81F // #FF00FF +#define COLOR_CYAN 0x07FF // #00FFFF +#define COLOR_AQUA 0x07FF // #00FFFF + +#define COLOR_MAROON 0x7800 // #800000 +#define COLOR_GREEN 0x03E0 // #008000 +#define COLOR_NAVY 0x000F // #000080 +#define COLOR_OLIVE 0x8400 // #808000 +#define COLOR_PURPLE 0x8010 // #800080 +#define COLOR_TEAL 0x0410 // #008080 + +#define COLOR_ORANGE 0xFC00 // #FF7F00 + +#ifndef TFT_MARLINUI_COLOR + #define TFT_MARLINUI_COLOR COLOR_WHITE +#endif +#ifndef TFT_MARLINBG_COLOR + #define TFT_MARLINBG_COLOR COLOR_BLACK +#endif +#ifndef TFT_DISABLED_COLOR + #define TFT_DISABLED_COLOR COLOR_DARK +#endif +#ifndef TFT_BTCANCEL_COLOR + #define TFT_BTCANCEL_COLOR COLOR_RED +#endif +#ifndef TFT_BTARROWS_COLOR + #define TFT_BTARROWS_COLOR COLOR_BLUE +#endif +#ifndef TFT_BTOKMENU_COLOR + #define TFT_BTOKMENU_COLOR COLOR_RED +#endif + static uint32_t lcd_id = 0; #define U8G_ESC_DATA(x) (uint8_t)(x >> 8), (uint8_t)(x & 0xFF) static const uint8_t page_first_sequence[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(X_MIN), U8G_ESC_DATA(X_MAX), - U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(Y_MIN), U8G_ESC_DATA(Y_MAX), + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(X_LO), U8G_ESC_DATA(X_HI), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(Y_LO), U8G_ESC_DATA(Y_HI), U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), U8G_ESC_END }; static const uint8_t clear_screen_sequence[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, 0x01, 0x3F, - U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), 0x00, 0x00, 0x00, 0xEF, + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, U8G_ESC_DATA(LCD_FULL_PIXEL_WIDTH), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), 0x00, 0x00, U8G_ESC_DATA(LCD_FULL_PIXEL_HEIGHT), U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), U8G_ESC_END }; +#if ENABLED(TOUCH_BUTTONS) + + static const uint8_t separation_line_sequence_left[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(10), U8G_ESC_DATA(159), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(170), U8G_ESC_DATA(173), + U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), + U8G_ESC_END + }; + + static const uint8_t separation_line_sequence_right[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(160), U8G_ESC_DATA(309), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(170), U8G_ESC_DATA(173), + U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), + U8G_ESC_END + }; + + static const uint8_t buttonD_sequence[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(14), U8G_ESC_DATA(77), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(185), U8G_ESC_DATA(224), + U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), + U8G_ESC_END + }; + + static const uint8_t buttonA_sequence[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(90), U8G_ESC_DATA(153), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(185), U8G_ESC_DATA(224), + U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), + U8G_ESC_END + }; + + static const uint8_t buttonB_sequence[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(166), U8G_ESC_DATA(229), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(185), U8G_ESC_DATA(224), + U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), + U8G_ESC_END + }; + + static const uint8_t buttonC_sequence[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(242), U8G_ESC_DATA(305), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(185), U8G_ESC_DATA(224), + U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), + U8G_ESC_END + }; + +#endif + static const uint8_t st7789v_init_sequence[] = { // 0x8552 - ST7789V U8G_ESC_ADR(0), 0x10, @@ -120,53 +221,328 @@ static const uint8_t st7789v_init_sequence[] = { // 0x8552 - ST7789V U8G_ESC_END }; +static const uint8_t ili9341_init_sequence[] = { // 0x9341 - ILI9341 + U8G_ESC_ADR(0), + 0x10, + U8G_ESC_DLY(10), + 0x01, + U8G_ESC_DLY(100), U8G_ESC_DLY(100), + 0x36, U8G_ESC_ADR(1), 0xE8, + U8G_ESC_ADR(0), 0x3A, U8G_ESC_ADR(1), 0x55, + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, 0x01, 0x3F, + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), 0x00, 0x00, 0x00, 0xEF, + U8G_ESC_ADR(0), 0xC5, U8G_ESC_ADR(1), 0x3E, 0x28, + U8G_ESC_ADR(0), 0xC7, U8G_ESC_ADR(1), 0x86, + U8G_ESC_ADR(0), 0xB1, U8G_ESC_ADR(1), 0x00, 0x18, + U8G_ESC_ADR(0), 0xC0, U8G_ESC_ADR(1), 0x23, + U8G_ESC_ADR(0), 0xC1, U8G_ESC_ADR(1), 0x10, + U8G_ESC_ADR(0), 0x29, + U8G_ESC_ADR(0), 0x11, + U8G_ESC_DLY(100), + U8G_ESC_END +}; + +#if ENABLED(TOUCH_BUTTONS) + + static const uint8_t buttonD[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00011000,B00110000,B00000001, + B10000000,B00001100,B01100000,B00000001, + B10000000,B00000110,B11000000,B00000001, + B10000000,B00000011,B10000000,B00000001, + B10000000,B00000011,B10000000,B00000001, + B10000000,B00000110,B11000000,B00000001, + B10000000,B00001100,B01100000,B00000001, + B10000000,B00011000,B00110000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + + #if ENABLED(REVERSE_MENU_DIRECTION) + + static const uint8_t buttonA[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00111111,B11100001, + B10000111,B11111100,B00111111,B11100001, + B10000011,B11111000,B00000000,B00000001, + B10000001,B11110000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B01000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + static const uint8_t buttonB[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B01100000,B00000010,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00001111,B10000001, + B10000000,B01100000,B00011111,B11000001, + B10000111,B11111110,B00111111,B11100001, + B10000111,B11111110,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + + #else + + static const uint8_t buttonA[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B01000000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000001,B11110000,B00000000,B00000001, + B10000011,B11111000,B00000000,B00000001, + B10000111,B11111100,B00111111,B11100001, + B10000000,B11100000,B00111111,B11100001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + + static const uint8_t buttonB[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000111,B11111110,B00000111,B00000001, + B10000111,B11111110,B00111111,B11100001, + B10000000,B01100000,B00011111,B11000001, + B10000000,B01100000,B00001111,B10000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000010,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + + #endif + + static const uint8_t buttonC[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00011100,B00000001, + B10000000,B00000100,B00011100,B00000001, + B10000000,B00001100,B00011100,B00000001, + B10000000,B00011111,B11111100,B00000001, + B10000000,B00111111,B11111100,B00000001, + B10000000,B00011111,B11111100,B00000001, + B10000000,B00001100,B00000000,B00000001, + B10000000,B00000100,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + + void drawImage(const uint8_t *data, u8g_t *u8g, u8g_dev_t *dev, uint16_t length, uint16_t height, uint16_t color) { + uint16_t buffer[128]; + + for (uint16_t i = 0; i < height; i++) { + uint16_t k = 0; + for (uint16_t j = 0; j < length; j++) { + uint16_t v = TFT_MARLINBG_COLOR; + if (*(data + (i * (length >> 3) + (j >> 3))) & (0x80 >> (j & 7))) + v = color; + else + v = TFT_MARLINBG_COLOR; + buffer[k++] = v; buffer[k++] = v; + } + #ifdef LCD_USE_DMA_FSMC + if (k <= 80) { // generally is... for our buttons + memcpy(&buffer[k], &buffer[0], k * sizeof(uint16_t)); + LCD_IO_WriteSequence(buffer, k * sizeof(uint16_t)); + } + else { + LCD_IO_WriteSequence(buffer, k); + LCD_IO_WriteSequence(buffer, k); + } + #else + u8g_WriteSequence(u8g, dev, k << 1, (uint8_t *)buffer); + u8g_WriteSequence(u8g, dev, k << 1, (uint8_t *)buffer); + #endif + } + } + +#endif // TOUCH_BUTTONS + +// Used to fill RGB565 (16bits) background +inline void memset2(const void *ptr, uint16_t fill, size_t cnt) { + uint16_t* wptr = (uint16_t*)ptr; + for (size_t i = 0; i < cnt; i += 2) { *wptr = fill; wptr++; } +} + +static bool preinit = true; +static uint8_t page; + uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); - uint16_t buffer[256]; - uint32_t i, j, k; - + #ifdef LCD_USE_DMA_FSMC + static uint16_t bufferA[512], bufferB[512]; + uint16_t* buffer = &bufferA[0]; + bool allow_async = true; + #else + uint16_t buffer[WIDTH*2]; // 16-bit RGB 565 pixel line buffer + #endif switch (msg) { case U8G_DEV_MSG_INIT: dev->com_fn(u8g, U8G_COM_MSG_INIT, U8G_SPI_CLK_CYCLE_NONE, &lcd_id); if (lcd_id == 0x040404) return 0; // No connected display on FSMC if (lcd_id == 0xFFFFFF) return 0; // No connected display on SPI - memset(buffer, 0x00, sizeof(buffer)); - if ((lcd_id & 0xFFFF) == 0x8552) // ST7789V u8g_WriteEscSeqP(u8g, dev, st7789v_init_sequence); + if ((lcd_id & 0xFFFF) == 0x9341) // ILI9341 + u8g_WriteEscSeqP(u8g, dev, ili9341_init_sequence); + + if (preinit) { + preinit = false; + return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); + } + // Clear Screen Sequence u8g_WriteEscSeqP(u8g, dev, clear_screen_sequence); - for (i = 0; i < 960; i++) - u8g_WriteSequence(u8g, dev, 160, (uint8_t *)buffer); - break; + #ifdef LCD_USE_DMA_FSMC + LCD_IO_WriteMultiple(TFT_MARLINBG_COLOR, (320*240)); + #else + memset2(buffer, TFT_MARLINBG_COLOR, 160); + for (uint16_t i = 0; i < 960; i++) + u8g_WriteSequence(u8g, dev, 160, (uint8_t *)buffer); + #endif - case U8G_DEV_MSG_STOP: - break; + // bottom line and buttons + #if ENABLED(TOUCH_BUTTONS) + + #ifdef LCD_USE_DMA_FSMC + u8g_WriteEscSeqP(u8g, dev, separation_line_sequence_left); + LCD_IO_WriteMultiple(TFT_DISABLED_COLOR, 300); + u8g_WriteEscSeqP(u8g, dev, separation_line_sequence_right); + LCD_IO_WriteMultiple(TFT_DISABLED_COLOR, 300); + #else + memset2(buffer, TFT_DISABLED_COLOR, 150); + u8g_WriteEscSeqP(u8g, dev, separation_line_sequence_left); + for (uint8_t i = 4; i--;) + u8g_WriteSequence(u8g, dev, 150, (uint8_t *)buffer); + u8g_WriteEscSeqP(u8g, dev, separation_line_sequence_right); + for (uint8_t i = 4; i--;) + u8g_WriteSequence(u8g, dev, 150, (uint8_t *)buffer); + #endif + + u8g_WriteEscSeqP(u8g, dev, buttonD_sequence); + drawImage(buttonD, u8g, dev, 32, 20, TFT_BTCANCEL_COLOR); + + u8g_WriteEscSeqP(u8g, dev, buttonA_sequence); + drawImage(buttonA, u8g, dev, 32, 20, TFT_BTARROWS_COLOR); + + u8g_WriteEscSeqP(u8g, dev, buttonB_sequence); + drawImage(buttonB, u8g, dev, 32, 20, TFT_BTARROWS_COLOR); + + u8g_WriteEscSeqP(u8g, dev, buttonC_sequence); + drawImage(buttonC, u8g, dev, 32, 20, TFT_BTOKMENU_COLOR); + #endif // TOUCH_BUTTONS + + return 0; + + case U8G_DEV_MSG_STOP: preinit = true; break; case U8G_DEV_MSG_PAGE_FIRST: + page = 0; u8g_WriteEscSeqP(u8g, dev, page_first_sequence); break; case U8G_DEV_MSG_PAGE_NEXT: - for (j = 0; j < 8; j++) { - k = 0; - for (i = 0; i < (uint32_t)pb->width; i++) { + if (++page > (HEIGHT / PAGE_HEIGHT)) return 1; + + for (uint8_t y = 0; y < PAGE_HEIGHT; y++) { + uint32_t k = 0; + #ifdef LCD_USE_DMA_FSMC + buffer = (y & 1) ? bufferB : bufferA; + #endif + for (uint16_t i = 0; i < (uint32_t)pb->width; i++) { const uint8_t b = *(((uint8_t *)pb->buf) + i); - const uint16_t c = TEST(b, j) ? 0x7FFF : 0x0000; + const uint16_t c = TEST(b, y) ? TFT_MARLINUI_COLOR : TFT_MARLINBG_COLOR; buffer[k++] = c; buffer[k++] = c; } - for (k = 0; k < 2; k++) { - u8g_WriteSequence(u8g, dev, 128, (uint8_t*)buffer); - u8g_WriteSequence(u8g, dev, 128, (uint8_t*)&(buffer[64])); - u8g_WriteSequence(u8g, dev, 128, (uint8_t*)&(buffer[128])); - u8g_WriteSequence(u8g, dev, 128, (uint8_t*)&(buffer[192])); - } + #ifdef LCD_USE_DMA_FSMC + memcpy(&buffer[256], &buffer[0], 512); + if (allow_async) { + if (y > 0 || page > 1) LCD_IO_WaitSequence_Async(); + if (y == 7 && page == 8) + LCD_IO_WriteSequence(buffer, 512); // last line of last page + else + LCD_IO_WriteSequence_Async(buffer, 512); + } + else + LCD_IO_WriteSequence(buffer, 512); + #else + uint8_t* bufptr = (uint8_t*) buffer; + for (uint8_t i = 2; i--;) { + u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[0]); + u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[WIDTH]); + u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[WIDTH*2]); + u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[WIDTH*3]); + } + #endif } break; case U8G_DEV_MSG_SLEEP_ON: + // Enter Sleep Mode (10h) + return 1; case U8G_DEV_MSG_SLEEP_OFF: + // Sleep Out (11h) return 1; } return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); @@ -174,4 +550,4 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_tft_320x240_upscale_from_128x64_fn, U8G_COM_HAL_FSMC_FN); -#endif // HAS_GRAPHICAL_LCD +#endif // HAS_GRAPHICAL_LCD && FSMC_CS diff --git a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp index e7750b4ac494..1e12ba84d0ee 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp @@ -57,8 +57,6 @@ #if HAS_GRAPHICAL_LCD -#include - #include "HAL_LCD_com_defines.h" #define WIDTH 128 @@ -75,7 +73,8 @@ #define UC1701_V5_RATIO(N) (0x20 | ((N) & 0x7)) #define UC1701_CONTRAST(N) (0x81), (N) -#define UC1701_COLUMN_ADR(N) (0x10 | (((N) >> 4) & 0xF)), ((N) & 0xF) +#define UC1701_COLUMN_HI(N) (0x10 | (((N) >> 4) & 0xF)) +#define UC1701_COLUMN_ADR(N) UC1701_COLUMN_HI(N), ((N) & 0xF) #define UC1701_PAGE_ADR(N) (0xB0 | (N)) #define UC1701_START_LINE(N) (0x40 | (N)) #define UC1701_INDICATOR(N) (0xAC), (N) @@ -84,43 +83,59 @@ #define UC1701_BOOST_RATIO(N) (0xF8), (N) static const uint8_t u8g_dev_uc1701_mini12864_HAL_init_seq[] PROGMEM = { - U8G_ESC_CS(0), /* disable chip */ - U8G_ESC_ADR(0), /* instruction mode */ - U8G_ESC_RST(1), /* do reset low pulse with (1*16)+2 milliseconds */ - U8G_ESC_CS(1), /* enable chip */ - - UC1701_RESET(), /* soft reset */ - UC1701_START_LINE(0), /* set display start line to 0 */ - UC1701_ADC_REVERSE(0), /* ADC set to reverse */ - UC1701_OUT_MODE(1), /* common output mode */ - UC1701_INVERTED(0), /* display normal, bit val 0: LCD pixel off. */ - UC1701_BIAS_MODE(0), /* LCD bias 1/9 */ - UC1701_POWER_CONTROL(0x7), /* all power control circuits on */ - UC1701_BOOST_RATIO(0x0), /* set booster ratio to 4x */ - UC1701_V5_RATIO(3), /* set V0 voltage resistor ratio to large */ - UC1701_CONTRAST(0x27), /* set contrast */ - UC1701_INDICATOR(0), /* indicator */ - UC1701_ON(1), /* display on */ - - U8G_ESC_CS(0), /* disable chip */ - U8G_ESC_DLY(100), /* delay 100 ms */ - U8G_ESC_CS(1), /* enable chip */ - - UC1701_ALL_PIX(1), /* display all points, ST7565 */ - U8G_ESC_CS(0), /* disable chip */ - U8G_ESC_DLY(100), /* delay 100 ms */ - U8G_ESC_DLY(100), /* delay 100 ms */ - U8G_ESC_CS(1), /* enable chip */ - UC1701_ALL_PIX(0), /* normal display */ - U8G_ESC_CS(0), /* disable chip */ - U8G_ESC_END /* end of sequence */ + U8G_ESC_CS(0), // disable chip + U8G_ESC_ADR(0), // instruction mode + U8G_ESC_RST(1), // do reset low pulse with (1*16)+2 milliseconds + U8G_ESC_CS(1), // enable chip + + UC1701_RESET(), // soft reset + UC1701_START_LINE(0), // set display start line to 0 + UC1701_ADC_REVERSE(0), // ADC set to reverse + UC1701_OUT_MODE(1), // common output mode + UC1701_INVERTED(0), // display normal, bit val 0: LCD pixel off + UC1701_BIAS_MODE(0), // LCD bias 1/9 + UC1701_POWER_CONTROL(0x7), // all power control circuits on + UC1701_BOOST_RATIO(0x0), // set booster ratio to 4x + UC1701_V5_RATIO(3), // set V0 voltage resistor ratio to large + UC1701_CONTRAST(0x27), // set contrast + UC1701_INDICATOR(0), // indicator disable + UC1701_ON(1), // display on + + U8G_ESC_CS(0), // disable chip + U8G_ESC_DLY(100), // delay 100 ms + U8G_ESC_CS(1), // enable chip + + UC1701_ALL_PIX(1), // display all points, ST7565 + U8G_ESC_CS(0), // disable chip + U8G_ESC_DLY(100), // delay 100 ms + U8G_ESC_DLY(100), // delay 100 ms + U8G_ESC_CS(1), // enable chip + UC1701_ALL_PIX(0), // normal display + U8G_ESC_CS(0), // disable chip + U8G_ESC_END // end of sequence }; static const uint8_t u8g_dev_uc1701_mini12864_HAL_data_start[] PROGMEM = { - U8G_ESC_ADR(0), /* instruction mode */ - U8G_ESC_CS(1), /* enable chip */ - UC1701_COLUMN_ADR(0), /* address 0 */ - U8G_ESC_END /* end of sequence */ + U8G_ESC_ADR(0), // instruction mode + U8G_ESC_CS(1), // enable chip + #if ENABLED(MKS_MINI_12864) + UC1701_START_LINE(0), // set display start line to 0 + UC1701_ADC_REVERSE(0), // ADC set to reverse + UC1701_OUT_MODE(1), // common output mode + UC1701_INVERTED(0), // display normal, bit val 0: LCD pixel off + UC1701_BIAS_MODE(0), // LCD bias 1/9 + UC1701_POWER_CONTROL(0x7),// all power control circuits on + UC1701_BOOST_RATIO(0x0), // set booster ratio to 4x + UC1701_V5_RATIO(3), // set V0 voltage resistor ratio to large + UC1701_INDICATOR(0), // indicator disable + UC1701_ON(1), // display on + UC1701_COLUMN_HI(0), // set upper 4 bit of the col adr to 0 + U8G_ESC_END, // end of sequence + U8G_ESC_DLY(5) // delay 5 ms + #else + UC1701_COLUMN_ADR(0), // address 0 + U8G_ESC_END // end of sequence + #endif }; uint8_t u8g_dev_uc1701_mini12864_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { @@ -163,23 +178,21 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t m case U8G_DEV_MSG_PAGE_NEXT: { u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); - u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start); - u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page)); /* select current page */ - u8g_SetAddress(u8g, dev, 1); /* data mode */ + u8g_WriteByte(u8g, dev, 0x0B0 | (2 * pb->p.page)); /* select current page */ + u8g_SetAddress(u8g, dev, 1); /* data mode */ u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf); u8g_SetChipSelect(u8g, dev, 0); - u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start); - u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page+1)); /* select current page */ - u8g_SetAddress(u8g, dev, 1); /* data mode */ + u8g_WriteByte(u8g, dev, 0x0B0 | (2 * pb->p.page + 1)); /* select current page */ + u8g_SetAddress(u8g, dev, 1); /* data mode */ u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)(pb->buf)+pb->width); u8g_SetChipSelect(u8g, dev, 0); } break; case U8G_DEV_MSG_CONTRAST: u8g_SetChipSelect(u8g, dev, 1); - u8g_SetAddress(u8g, dev, 0); /* instruction mode */ + u8g_SetAddress(u8g, dev, 0); /* instruction mode */ u8g_WriteByte(u8g, dev, 0x081); u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2); u8g_SetChipSelect(u8g, dev, 0); diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp index fe6cf9266c96..b976e2777cf4 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -119,7 +119,7 @@ static font_group_t g_fontgroup_root = { nullptr, 0 }; /** * @brief check if font is loaded */ -static inline bool uxg_Utf8FontIsInited(void) { return flag_fontgroup_was_inited; } +static inline bool uxg_Utf8FontIsInited() { return flag_fontgroup_was_inited; } int uxg_SetUtf8Fonts (const uxg_fontinfo_t * fntinfo, int number) { flag_fontgroup_was_inited = 1; diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp b/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp index c978a07d0f30..ae9614d67744 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp @@ -21,7 +21,7 @@ */ /** - * ultralcd_DOGM.cpp + * lcd/dogm/ultralcd_DOGM.h * * Implementation of the LCD display routines for a DOGM128 graphic display. * by STB for ErikZalm/Marlin. Common LCD 128x64 pixel graphic displays. @@ -30,9 +30,9 @@ * License: http://opensource.org/licenses/BSD-3-Clause * * With the use of: - * u8glib by Oliver Kraus - * https://github.com/olikraus/U8glib_Arduino - * License: http://opensource.org/licenses/BSD-3-Clause + * u8glib by Oliver Kraus + * https://github.com/olikraus/U8glib_Arduino + * License: http://opensource.org/licenses/BSD-3-Clause */ #include "../../inc/MarlinConfigPre.h" @@ -60,7 +60,7 @@ #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../../feature/bedlevel/ubl/ubl.h" + #include "../../feature/bedlevel/bedlevel.h" #endif /** @@ -81,7 +81,7 @@ U8G_CLASS u8g(U8G_PARAM); #if HAS_LCD_CONTRAST - int16_t MarlinUI::contrast; // Initialized by settings.load() + int16_t MarlinUI::contrast = DEFAULT_LCD_CONTRAST; void MarlinUI::set_contrast(const int16_t value) { contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); @@ -102,77 +102,79 @@ void MarlinUI::set_font(const MarlinFont font_nr) { } } +bool MarlinUI::detected() { return true; } + #if ENABLED(SHOW_BOOTSCREEN) #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - - FORCE_INLINE void draw_custom_bootscreen(const u8g_pgm_uint8_t * const bmp, const bool erase=true) { - constexpr u8g_uint_t left = (LCD_PIXEL_WIDTH - (CUSTOM_BOOTSCREEN_BMPWIDTH)) / 2, - top = (LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2; + // Draws a slice of a particular frame of the custom bootscreen, without the u8g loop + void MarlinUI::draw_custom_bootscreen(const uint8_t frame/*=0*/) { + constexpr u8g_uint_t left = u8g_uint_t((LCD_PIXEL_WIDTH - (CUSTOM_BOOTSCREEN_BMPWIDTH)) / 2), + top = u8g_uint_t((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, bmp - ); - #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - if (erase) { - 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); - } + + const u8g_pgm_uint8_t * const bmp = + #if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED) + (u8g_pgm_uint8_t*)pgm_read_ptr(&custom_bootscreen_animation[frame]) #else - UNUSED(erase); + custom_start_bmp #endif - } while (u8g.nextPage()); - } + ; + + u8g.drawBitmapP(left, top, CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH, CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp); - void lcd_custom_bootscreen() { - #if ENABLED(ANIMATED_BOOTSCREEN) - LOOP_L_N(f, COUNT(custom_bootscreen_animation)) { - if (f) safe_delay(CUSTOM_BOOTSCREEN_FRAME_TIME); - draw_custom_bootscreen((u8g_pgm_uint8_t*)pgm_read_ptr(&custom_bootscreen_animation[f]), f == 0); + #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) + if (frame == 0) { + 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 + } + + // Shows the custom bootscreen, with the u8g loop, animations and delays + void MarlinUI::show_custom_bootscreen() { + #if DISABLED(CUSTOM_BOOTSCREEN_ANIMATED) + constexpr millis_t d = 0; + constexpr uint8_t f = 0; #else - draw_custom_bootscreen(custom_start_bmp); + constexpr millis_t d = CUSTOM_BOOTSCREEN_FRAME_TIME; + LOOP_L_N(f, COUNT(custom_bootscreen_animation)) #endif + { + u8g.firstPage(); + do { draw_custom_bootscreen(f); } while (u8g.nextPage()); + if (d) safe_delay(d); + } + #ifndef CUSTOM_BOOTSCREEN_TIMEOUT #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 #endif safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); } - #endif // SHOW_CUSTOM_BOOTSCREEN - void MarlinUI::show_bootscreen() { - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - lcd_custom_bootscreen(); - #endif + // Two-part needed to display all info + constexpr bool two_part = ((LCD_PIXEL_HEIGHT) - (START_BMPHEIGHT)) < ((MENU_FONT_ASCENT) * 2); - // Screen dimensions. - //const uint8_t width = u8g.getWidth(), height = u8g.getHeight(); - constexpr uint8_t width = LCD_PIXEL_WIDTH, height = LCD_PIXEL_HEIGHT; + // Draw the static Marlin bootscreen from a u8g loop + // or the animated boot screen within its own u8g loop + void MarlinUI::draw_marlin_bootscreen(const bool line2/*=false*/) { // Determine text space needed - #ifndef STRING_SPLASH_LINE2 - constexpr uint8_t text_total_height = MENU_FONT_HEIGHT, - text_width_1 = uint8_t(sizeof(STRING_SPLASH_LINE1) - 1) * uint8_t(MENU_FONT_WIDTH), - text_width_2 = 0; - #else - constexpr uint8_t text_total_height = uint8_t(MENU_FONT_HEIGHT) * 2, - text_width_1 = uint8_t(sizeof(STRING_SPLASH_LINE1) - 1) * uint8_t(MENU_FONT_WIDTH), - text_width_2 = uint8_t(sizeof(STRING_SPLASH_LINE2) - 1) * uint8_t(MENU_FONT_WIDTH); - #endif - constexpr uint8_t text_max_width = _MAX(text_width_1, text_width_2), - rspace = width - (START_BMPWIDTH); + constexpr u8g_uint_t text_width_1 = u8g_uint_t((sizeof(SHORT_BUILD_VERSION) - 1) * (MENU_FONT_WIDTH)), + text_width_2 = u8g_uint_t((sizeof(MARLIN_WEBSITE_URL) - 1) * (MENU_FONT_WIDTH)), + text_max_width = _MAX(text_width_1, text_width_2), + text_total_height = (MENU_FONT_HEIGHT) * 2, + width = LCD_PIXEL_WIDTH, height = LCD_PIXEL_HEIGHT, + rspace = width - (START_BMPWIDTH); - int8_t offx, offy, txt_base, txt_offx_1, txt_offx_2; + u8g_int_t offx, offy, txt_base, txt_offx_1, txt_offx_2; // Can the text fit to the right of the bitmap? if (text_max_width < rspace) { @@ -184,8 +186,8 @@ void MarlinUI::set_font(const MarlinFont font_nr) { } else { constexpr int8_t inter = (height - text_total_height - (START_BMPHEIGHT)) / 3; // Evenly distribute vertical space - offy = inter; // V-align boot logo proportionally offx = rspace / 2; // Center the boot logo in the whole space + offy = inter; // V-align boot logo proportionally txt_offx_1 = (width - text_width_1) / 2; // Text 1 centered txt_offx_2 = (width - text_width_2) / 2; // Text 2 centered txt_base = offy + START_BMPHEIGHT + offy + text_total_height - (MENU_FONT_DESCENT); // Even spacing looks best @@ -193,21 +195,45 @@ void MarlinUI::set_font(const MarlinFont font_nr) { NOLESS(offx, 0); NOLESS(offy, 0); - u8g.firstPage(); - do { - u8g.drawBitmapP(offx, offy, (START_BMPWIDTH + 7) / 8, START_BMPHEIGHT, start_bmp); + auto _draw_bootscreen_bmp = [&](const uint8_t *bitmap) { + u8g.drawBitmapP(offx, offy, START_BMP_BYTEWIDTH, START_BMPHEIGHT, bitmap); set_font(FONT_MENU); - #ifndef STRING_SPLASH_LINE2 - u8g.drawStr(txt_offx_1, txt_base, STRING_SPLASH_LINE1); - #else - u8g.drawStr(txt_offx_1, txt_base - (MENU_FONT_HEIGHT), STRING_SPLASH_LINE1); - u8g.drawStr(txt_offx_2, txt_base, STRING_SPLASH_LINE2); - #endif - } while (u8g.nextPage()); + if (!two_part || !line2) lcd_put_u8str_P(txt_offx_1, txt_base - (MENU_FONT_HEIGHT), PSTR(SHORT_BUILD_VERSION)); + if (!two_part || line2) lcd_put_u8str_P(txt_offx_2, txt_base, PSTR(MARLIN_WEBSITE_URL)); + }; + + auto draw_bootscreen_bmp = [&](const uint8_t *bitmap) { + u8g.firstPage(); do { _draw_bootscreen_bmp(bitmap); } while (u8g.nextPage()); + }; + + #if DISABLED(BOOT_MARLIN_LOGO_ANIMATED) + draw_bootscreen_bmp(start_bmp); + #else + constexpr millis_t d = MARLIN_BOOTSCREEN_FRAME_TIME; + LOOP_L_N(f, COUNT(marlin_bootscreen_animation)) { + draw_bootscreen_bmp((uint8_t*)pgm_read_ptr(&marlin_bootscreen_animation[f])); + if (d) safe_delay(d); + } + #endif + } + + // Show the Marlin bootscreen, with the u8g loop and delays + void MarlinUI::show_marlin_bootscreen() { #ifndef BOOTSCREEN_TIMEOUT #define BOOTSCREEN_TIMEOUT 2500 #endif - safe_delay(BOOTSCREEN_TIMEOUT); + constexpr uint8_t pages = two_part ? 2 : 1; + for (uint8_t q = pages; q--;) { + draw_marlin_bootscreen(q == 0); + safe_delay((BOOTSCREEN_TIMEOUT) / pages); + } + } + + void MarlinUI::show_bootscreen() { + #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + show_custom_bootscreen(); + #endif + show_marlin_bootscreen(); } #endif // SHOW_BOOTSCREEN @@ -218,40 +244,51 @@ void MarlinUI::set_font(const MarlinFont font_nr) { // Initialize or re-initialize the LCD void MarlinUI::init_lcd() { + #if DISABLED(MKS_LCD12864B) - #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight - OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); - #endif + #if PIN_EXISTS(LCD_BACKLIGHT) + OUT_WRITE(LCD_BACKLIGHT_PIN, ( + #if ENABLED(DELAYED_BACKLIGHT_INIT) + LOW // Illuminate after reset + #else + HIGH // Illuminate right away + #endif + )); + #endif - #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) - SET_OUTPUT(LCD_PINS_DC); - #if !defined(LCD_RESET_PIN) - #define LCD_RESET_PIN LCD_PINS_RS + #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) + SET_OUTPUT(LCD_PINS_DC); + #ifndef LCD_RESET_PIN + #define LCD_RESET_PIN LCD_PINS_RS + #endif #endif - #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 initialize - #endif + #if PIN_EXISTS(LCD_RESET) + // Perform a clean hardware reset with needed delays + OUT_WRITE(LCD_RESET_PIN, LOW); + _delay_ms(5); + WRITE(LCD_RESET_PIN, HIGH); + _delay_ms(5); + u8g.begin(); + #endif - #if PIN_EXISTS(LCD_RESET) - u8g.begin(); - #endif + #if PIN_EXISTS(LCD_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT) + WRITE(LCD_BACKLIGHT_PIN, HIGH); + #endif - #if HAS_LCD_CONTRAST - refresh_contrast(); - #endif + #if HAS_LCD_CONTRAST + refresh_contrast(); + #endif - #if ENABLED(LCD_SCREEN_ROT_90) - u8g.setRot90(); // Rotate screen by 90° - #elif ENABLED(LCD_SCREEN_ROT_180) - u8g.setRot180(); // Rotate screen by 180° - #elif ENABLED(LCD_SCREEN_ROT_270) - u8g.setRot270(); // Rotate screen by 270° - #endif + #if ENABLED(LCD_SCREEN_ROT_90) + u8g.setRot90(); + #elif ENABLED(LCD_SCREEN_ROT_180) + u8g.setRot180(); + #elif ENABLED(LCD_SCREEN_ROT_270) + u8g.setRot270(); + #endif + + #endif // !MKS_LCD12864B uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo)); } @@ -261,16 +298,13 @@ void MarlinUI::draw_kill_screen() { #if ENABLED(LIGHTWEIGHT_UI) ST7920_Lite_Status_Screen::clear_text_buffer(); #endif - const uint8_t h4 = u8g.getHeight() / 4; + const u8g_uint_t h4 = u8g.getHeight() / 4; u8g.firstPage(); do { set_font(FONT_MENU); - lcd_moveto(0, h4 * 1); - lcd_put_u8str(status_message); - lcd_moveto(0, h4 * 2); - lcd_put_u8str_P(PSTR(MSG_HALTED)); - lcd_moveto(0, h4 * 3); - lcd_put_u8str_P(PSTR(MSG_PLEASE_RESET)); + lcd_put_u8str(0, h4 * 1, status_message); + lcd_put_u8str_P(0, h4 * 2, GET_TEXT(MSG_HALTED)); + lcd_put_u8str_P(0, h4 * 3, GET_TEXT(MSG_PLEASE_RESET)); } while (u8g.nextPage()); } @@ -278,7 +312,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #if HAS_LCD_MENU - uint8_t row_y1, row_y2; + #include "../menu/menu.h" + + u8g_uint_t row_y1, row_y2; #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -288,8 +324,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return; - lcd_moveto(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), row_y2); - lcd_put_wchar('E'); + lcd_put_wchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), row_y2, 'E'); lcd_put_wchar((char)('1' + extruder)); lcd_put_wchar(' '); lcd_put_u8str(i16tostr3(thermalManager.degHotend(extruder))); @@ -331,58 +366,56 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // Draw a static line of text in the same idiom as a menu item - void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char* valstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { - if (mark_as_selected(row, invert)) { + if (mark_as_selected(row, style & SS_INVERT)) { - uint8_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed + u8g_uint_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed - if (center && !valstr) { + if ((style & SS_CENTER) && !valstr) { int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd_put_wchar(' '); n--; } } - n -= lcd_put_u8str_max_P(pstr, n); + n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH) * (MENU_FONT_WIDTH); if (valstr) n -= lcd_put_u8str_max(valstr, n); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } } // Draw a generic menu item - void draw_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) { - UNUSED(pre_char); - + void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) { if (mark_as_selected(row, sel)) { - uint8_t n = (LCD_WIDTH - 2) * (MENU_FONT_WIDTH); - n -= lcd_put_u8str_max_P(pstr, n); + u8g_uint_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2) * (MENU_FONT_WIDTH); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); - lcd_moveto(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2); - lcd_put_wchar(post_char); + lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); lcd_put_wchar(' '); } } // Draw a menu item with an editable value - void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { if (mark_as_selected(row, sel)) { const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)); - uint8_t n = (LCD_WIDTH - 2 - vallen) * (MENU_FONT_WIDTH); - n -= lcd_put_u8str_max_P(pstr, n); - lcd_put_wchar(':'); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); - lcd_moveto(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH) * vallen, row_y2); - if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str((char*)data); + u8g_uint_t n = lcd_put_u8str_ind_P(pstr, itemIndex, LCD_WIDTH - 2 - vallen) * (MENU_FONT_WIDTH); + if (vallen) { + lcd_put_wchar(':'); + while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); + lcd_moveto(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH) * vallen, row_y2); + if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str((char*)data); + } } } - void draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { - const uint8_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); + void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { + ui.encoder_direction_normal(); + const u8g_uint_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); bool extra_row = labellen > LCD_WIDTH - 2 - vallen; #if ENABLED(USE_BIG_EDIT_FONT) // Use the menu font if the label won't fit on a single line - constexpr uint8_t lcd_edit_width = (LCD_PIXEL_WIDTH) / (EDIT_FONT_WIDTH); - uint8_t lcd_chr_fit, one_chr_width; + constexpr u8g_uint_t lcd_edit_width = (LCD_PIXEL_WIDTH) / (EDIT_FONT_WIDTH); + u8g_uint_t lcd_chr_fit, one_chr_width; if (labellen <= lcd_edit_width - 1) { if (labellen + vallen + 1 > lcd_edit_width) extra_row = true; lcd_chr_fit = lcd_edit_width + 1; @@ -395,20 +428,17 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop ui.set_font(FONT_MENU); } #else - constexpr uint8_t lcd_chr_fit = LCD_WIDTH, - one_chr_width = MENU_FONT_WIDTH; + constexpr u8g_uint_t lcd_chr_fit = LCD_WIDTH, + one_chr_width = MENU_FONT_WIDTH; #endif // Center the label and value lines on the middle line - uint8_t baseline = extra_row ? (LCD_PIXEL_HEIGHT) / 2 - 1 - : (LCD_PIXEL_HEIGHT + EDIT_FONT_ASCENT) / 2; + u8g_uint_t baseline = extra_row ? (LCD_PIXEL_HEIGHT) / 2 - 1 + : (LCD_PIXEL_HEIGHT + EDIT_FONT_ASCENT) / 2; // Assume the label is alpha-numeric (with a descender) bool onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline + EDIT_FONT_DESCENT); - if (onpage) { - lcd_moveto(0, baseline); - lcd_put_u8str_P(pstr); - } + if (onpage) lcd_put_u8str_ind_P(0, baseline, pstr, itemIndex); // If a value is included, print a colon, then print the value right-justified if (value != nullptr) { @@ -419,27 +449,25 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline); } if (onpage) { - lcd_moveto(((lcd_chr_fit - 1) - (vallen + 1)) * one_chr_width, baseline); // Right-justified, leaving padded by spaces - lcd_put_wchar(' '); // overwrite char if value gets shorter + lcd_put_wchar(((lcd_chr_fit - 1) - (vallen + 1)) * one_chr_width, baseline, ' '); // Right-justified, padded, add a leading space lcd_put_u8str(value); } } } - inline void draw_boxed_string(const uint8_t x, const uint8_t y, PGM_P const pstr, const bool inv) { - const uint8_t len = utf8_strlen_P(pstr), bw = len * (MENU_FONT_WIDTH), - bx = x * (MENU_FONT_WIDTH), by = (y + 1) * (MENU_FONT_HEIGHT); + inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) { + const u8g_uint_t len = utf8_strlen_P(pstr), bw = len * (MENU_FONT_WIDTH), + bx = x * (MENU_FONT_WIDTH), by = (y + 1) * (MENU_FONT_HEIGHT); if (inv) { u8g.setColorIndex(1); u8g.drawBox(bx - 1, by - (MENU_FONT_ASCENT) + 1, bw + 2, MENU_FONT_HEIGHT - 1); u8g.setColorIndex(0); } - lcd_moveto(bx, by); - lcd_put_u8str_P(pstr); + lcd_put_u8str_P(bx, by, pstr); if (inv) u8g.setColorIndex(1); } - void draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff) { + void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { ui.draw_select_screen_prompt(pref, string, suff); draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) + 1), LCD_HEIGHT - 1, yes, yesno); @@ -447,14 +475,12 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #if ENABLED(SDSUPPORT) - void draw_sd_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir) { - UNUSED(pstr); - + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]); constexpr uint8_t maxlen = LCD_WIDTH - 1; - const uint8_t pixw = maxlen * (MENU_FONT_WIDTH); - uint8_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); + const u8g_uint_t pixw = maxlen * (MENU_FONT_WIDTH); + u8g_uint_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } } @@ -473,8 +499,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop void MarlinUI::ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { // Scale the box pixels appropriately - uint8_t x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X), - y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y), + u8g_uint_t x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X), + y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y), pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X), pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y), @@ -496,8 +522,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Display Mesh Point Locations u8g.setColorIndex(1); - const uint8_t sx = x_offset + pixels_per_x_mesh_pnt / 2; - uint8_t y = y_offset + pixels_per_y_mesh_pnt / 2; + const u8g_uint_t sx = x_offset + pixels_per_x_mesh_pnt / 2; + u8g_uint_t y = y_offset + pixels_per_y_mesh_pnt / 2; for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++, y += pixels_per_y_mesh_pnt) if (PAGE_CONTAINS(y, y)) for (uint8_t i = 0, x = sx; i < GRID_MAX_POINTS_X; i++, x += pixels_per_x_mesh_pnt) @@ -505,10 +531,10 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Fill in the Specified Mesh Point - uint8_t inverted_y = GRID_MAX_POINTS_Y - y_plot - 1; // The origin is typically in the lower right corner. We need to - // invert the Y to get it to plot in the right location. + const uint8_t y_plot_inv = (GRID_MAX_POINTS_Y - 1) - y_plot; // The origin is typically in the lower right corner. We need to + // invert the Y to get it to plot in the right location. - const uint8_t by = y_offset + inverted_y * pixels_per_y_mesh_pnt; + const u8g_uint_t by = y_offset + y_plot_inv * pixels_per_y_mesh_pnt; if (PAGE_CONTAINS(by, by + pixels_per_y_mesh_pnt)) u8g.drawBox( x_offset + x_plot * pixels_per_x_mesh_pnt, by, @@ -520,26 +546,24 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Show X and Y positions at top of screen u8g.setColorIndex(1); if (PAGE_UNDER(7)) { - lcd_moveto(5, 7); - lcd_put_u8str("X:"); - lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot])))); - lcd_moveto(74, 7); - lcd_put_u8str("Y:"); - lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot])))); + const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }, + lpos = pos.asLogical(); + lcd_put_u8str(5, 7, "X:"); + lcd_put_u8str(ftostr52(lpos.x)); + lcd_put_u8str(74, 7, "Y:"); + lcd_put_u8str(ftostr52(lpos.y)); } // Print plot position if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) { - lcd_moveto(5, LCD_PIXEL_HEIGHT); - lcd_put_wchar('('); + lcd_put_wchar(5, LCD_PIXEL_HEIGHT, '('); u8g.print(x_plot); lcd_put_wchar(','); u8g.print(y_plot); lcd_put_wchar(')'); // Show the location value - lcd_moveto(74, LCD_PIXEL_HEIGHT); - lcd_put_u8str("Z:"); + lcd_put_u8str(74, LCD_PIXEL_HEIGHT, "Z:"); if (!isnan(ubl.z_values[x_plot][y_plot])) lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); else @@ -553,20 +577,20 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) const unsigned char cw_bmp[] PROGMEM = { - B00000001,B11111100,B00000000, - B00000111,B11111111,B00000000, - B00001111,B00000111,B10000000, - B00001110,B00000001,B11000000, - B00000000,B00000001,B11000000, + B00000000,B11111110,B00000000, + B00000011,B11111111,B10000000, + B00000111,B11000111,B11000000, + B00000111,B00000001,B11100000, B00000000,B00000000,B11100000, - B00001000,B00000000,B11100000, - B00011100,B00000000,B11100000, - B00111110,B00000000,B11100000, - B01111111,B00000000,B11100000, - B00011100,B00000000,B11100000, + B00000000,B00000000,B11110000, + B00000000,B00000000,B01110000, + B00000100,B00000000,B01110000, + B00001110,B00000000,B01110000, + B00011111,B00000000,B01110000, + B00111111,B10000000,B11110000, B00001110,B00000000,B11100000, - B00001110,B00000001,B11000000, - B00000111,B10000011,B11000000, + B00001111,B00000001,B11100000, + B00000111,B11000111,B11000000, B00000011,B11111111,B10000000, B00000000,B11111110,B00000000 }; @@ -574,20 +598,20 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop const unsigned char ccw_bmp[] PROGMEM = { B00000000,B11111110,B00000000, B00000011,B11111111,B10000000, - B00000111,B10000011,B11000000, - B00001110,B00000001,B11000000, + B00000111,B11000111,B11000000, + B00001111,B00000001,B11100000, B00001110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B01111111,B00000000,B11100000, - B00111110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B00001000,B00000000,B11100000, + B00111111,B10000000,B11110000, + B00011111,B00000000,B01110000, + B00001110,B00000000,B01110000, + B00000100,B00000000,B01110000, + B00000000,B00000000,B01110000, + B00000000,B00000000,B11110000, B00000000,B00000000,B11100000, - B00000000,B00000001,B11000000, - B00001110,B00000001,B11000000, - B00001111,B00000111,B10000000, - B00000111,B11111111,B00000000, - B00000001,B11111100,B00000000 + B00000111,B00000001,B11100000, + B00000111,B11000111,B11000000, + B00000011,B11111111,B10000000, + B00000000,B11111110,B00000000 }; const unsigned char up_arrow_bmp[] PROGMEM = { diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.h b/Marlin/src/lcd/dogm/ultralcd_DOGM.h index 409b2b30628c..8ff2dbc85b91 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.h +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.h @@ -22,7 +22,7 @@ #pragma once /** - * ultralcd_DOGM.h + * lcd/dogm/ultralcd_DOGM.h */ #include "../../inc/MarlinConfigPre.h" @@ -30,7 +30,8 @@ #include #include "HAL_LCD_class_defines.h" -// LCD selection +//#define ALTERNATIVE_LCD + #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define U8G_CLASS U8GLIB_ST7920_128X64_4X #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) @@ -40,102 +41,159 @@ #endif #elif ENABLED(U8GLIB_ST7920) + // RepRap Discount Full Graphics Smart Controller + #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) - #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL - #define U8G_PARAM LCD_PINS_RS // 2 stripes, HW SPI (shared with SD card, on AVR does not use standard LCD adapter) + #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL // 2 stripes, HW SPI (Shared with SD card. Non-standard LCD adapter on AVR.) + #define U8G_PARAM LCD_PINS_RS #else - //#define U8G_CLASS U8GLIB_ST7920_128X64_4X - //#define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // Original u8glib device. 2 stripes, SW SPI - #define U8G_CLASS U8GLIB_ST7920_128X64_RRD - #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // Number of stripes can be adjusted in ultralcd_st7920_u8glib_rrd.h with PAGE_HEIGHT - // AVR version ignores these pin settings - // HAL version uses these pin settings + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_ST7920_128X64_4X // 2 stripes, SW SPI (Original u8glib device) + #else + #define U8G_CLASS U8GLIB_ST7920_128X64_RRD // Adjust stripes with PAGE_HEIGHT in ultralcd_st7920_u8glib_rrd.h + #endif + #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // AVR version ignores these pin settings + // HAL version uses these pin settings #endif #elif ENABLED(CARTESIO_UI) - // The CartesioUI display - //#define U8G_CLASS U8GLIB_DOGM128_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes - #define U8G_CLASS U8GLIB_DOGM128_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes + + // CartesioUI LCD + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_DOGM128_2X // 4 stripes + #define FORCE_SOFT_SPI // SW-SPI + #else + #define U8G_CLASS U8GLIB_DOGM128_2X // 4 stripes (HW-SPI) + #endif #elif ENABLED(U8GLIB_LM6059_AF) + // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) - //#define U8G_CLASS U8GLIB_LM6059 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes - #define U8G_CLASS U8GLIB_LM6059_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes -#elif ENABLED(U8GLIB_ST7565_64128N) - // The MaKrPanel, Mini Viki, Viki 2.0 & AZSMZ 12864 ST7565 controller - #define SMART_RAMPS (MB(RAMPS_SMART_EFB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_SMART_EFF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_SMART_SF)) - #if DOGLCD_SCK == SCK_PIN && DOGLCD_MOSI == MOSI_PIN && !SMART_RAMPS - #define U8G_CLASS U8GLIB_64128N_2X_HAL - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // using HW-SPI + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_LM6059 // 8 stripes (HW-SPI) #else - #define U8G_CLASS U8GLIB_64128N_2X_HAL - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // using SW-SPI + #define U8G_CLASS U8GLIB_LM6059_2X // 4 stripes (HW-SPI) + #endif + +#elif ENABLED(U8GLIB_ST7565_64128N) + + // MaKrPanel, Mini Viki, Viki 2.0, AZSMZ 12864 ST7565 controller + + #define SMART_RAMPS MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF) + #define U8G_CLASS U8GLIB_64128N_2X_HAL // 4 stripes (HW-SPI) + #if SMART_RAMPS || DOGLCD_SCK != SCK_PIN || DOGLCD_MOSI != MOSI_PIN + #define FORCE_SOFT_SPI // SW-SPI #endif #elif ENABLED(MKS_12864OLED_SSD1306) + // MKS 128x64 (SSD1306) OLED I2C LCD - #define U8G_CLASS U8GLIB_SSD1306_128X64 - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 8 stripes - //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes + + #define FORCE_SOFT_SPI // SW-SPI + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SSD1306_128X64_2X // 4 stripes + #else + #define U8G_CLASS U8GLIB_SSD1306_128X64 // 8 stripes + #endif #elif ENABLED(U8GLIB_SSD1306) - // Generic support for SSD1306 OLED I2C LCDs - //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE - //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes - #define U8G_CLASS U8GLIB_SSD1306_128X64_2X - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes + + // Generic SSD1306 OLED I2C LCD + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE // 4 stripes + #else + #define U8G_CLASS U8GLIB_SSD1306_128X64_2X // 4 stripes + #endif + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) #elif ENABLED(MKS_12864OLED) + // MKS 128x64 (SH1106) OLED I2C LCD - #define U8G_CLASS U8GLIB_SH1106_128X64 - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 8 stripes - //#define U8G_CLASS U8GLIB_SH1106_128X64_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes + + #define FORCE_SOFT_SPI // SW-SPI + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SH1106_128X64_2X // 4 stripes + #else + #define U8G_CLASS U8GLIB_SH1106_128X64 // 8 stripes + #endif + #elif ENABLED(U8GLIB_SH1106) - // Generic support for SH1106 OLED I2C LCDs - //#define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE - //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes - #define U8G_CLASS U8GLIB_SH1106_128X64_2X - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes + + // Generic SH1106 OLED I2C LCD + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE // 4 stripes + #else + #define U8G_CLASS U8GLIB_SH1106_128X64_2X // 4 stripes + #endif + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // I2C + #elif ENABLED(U8GLIB_SSD1309) + // Generic support for SSD1309 OLED I2C LCDs + #define U8G_CLASS U8GLIB_SSD1309_128X64 - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) -#elif ENABLED(MINIPANEL) - // MINIPanel display - //#define U8G_CLASS U8GLIB_MINI12864 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes - #define U8G_CLASS U8GLIB_MINI12864_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // I2C + #elif ENABLED(FYSETC_MINI_12864) - // The FYSETC_MINI_12864 display - #define U8G_CLASS U8GLIB_MINI12864_2X_HAL - #if ENABLED(FORCE_SOFT_SPI) - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes SW-SPI + + // The FYSETC Mini 12864 display + + #define U8G_CLASS U8GLIB_MINI12864_2X_HAL // 4 stripes + +#elif ENABLED(MKS_MINI_12864) + + // The MKS_MINI_12864 V1/V2 aren't exact copies of the MiniPanel. + // Panel management is in u8g_dev_uc1701_mini12864_HAL.cpp with + // extra delays added to remove glitches seen with fast MCUs. + + #define U8G_CLASS U8GLIB_MINI12864_2X_HAL // 8 stripes (HW-SPI) + +#elif ENABLED(MINIPANEL) + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_MINI12864 #else - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes HW-SPI + #define U8G_CLASS U8GLIB_MINI12864_2X // 8 stripes (HW-SPI) #endif + #elif ENABLED(U8GLIB_SH1106_EINSTART) + // Connected via motherboard header + #define U8G_CLASS U8GLIB_SH1106_128X64 #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS -#elif ENABLED(MKS_ROBIN_TFT) + +#elif ENABLED(FSMC_GRAPHICAL_TFT) + // Unspecified 320x240 TFT pre-initialized by built-in bootloader + #define U8G_CLASS U8GLIB_TFT_320X240_UPSCALE_FROM_128X64 #define U8G_PARAM FSMC_CS_PIN, FSMC_RS_PIN + #else - // for regular DOGM128 display with HW-SPI - //#define U8G_CLASS U8GLIB_DOGM128 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI Com: CS, A0 // 8 stripes - #define U8G_CLASS U8GLIB_DOGM128_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI Com: CS, A0 // 4 stripes + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_DOGM128 // 8 stripes (HW-SPI) + #else + #define U8G_CLASS U8GLIB_DOGM128_2X // 4 stripes (HW-SPI) + #endif + +#endif + +// Use HW-SPI if no other option is specified +#ifndef U8G_PARAM + #if ENABLED(FORCE_SOFT_SPI) + #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // SW-SPI + #else + #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI + #endif #endif #ifndef LCD_PIXEL_WIDTH @@ -145,6 +203,15 @@ #define LCD_PIXEL_HEIGHT 64 #endif +// LCD_FULL_PIXEL_WIDTH = +// LCD_PIXEL_OFFSET_X + (LCD_PIXEL_WIDTH * 2) + LCD_PIXEL_OFFSET_X +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define LCD_FULL_PIXEL_WIDTH 320 + #define LCD_PIXEL_OFFSET_X 32 + #define LCD_FULL_PIXEL_HEIGHT 240 + #define LCD_PIXEL_OFFSET_Y 32 +#endif + // For selective rendering within a Y range #define PAGE_OVER(ya) ((ya) <= u8g.getU8g()->current_page.y1) // Does the current page follow a region top? #define PAGE_UNDER(yb) ((yb) >= u8g.getU8g()->current_page.y0) // Does the current page precede a region bottom? diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp index ae92e861a1f6..218718514653 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -23,9 +23,13 @@ // NOTE - the HAL version of the rrd device uses a generic ST7920 device. See the // file u8g_dev_st7920_128x64_HAL.cpp for the HAL version. +#include "../../inc/MarlinConfigPre.h" + +#if !defined(U8G_HAL_LINKS) && ANY(__AVR__, ARDUINO_ARCH_STM32) + #include "../../inc/MarlinConfig.h" -#if ENABLED(U8GLIB_ST7920) && !defined(U8G_HAL_LINKS) && !defined(__SAM3X8E__) +#if ENABLED(U8GLIB_ST7920) #include "ultralcd_st7920_u8glib_rrd_AVR.h" @@ -42,11 +46,17 @@ // Optimize this code with -O3 #pragma GCC optimize (3) -#define ST7920_SND_BIT \ - WRITE(ST7920_CLK_PIN, LOW); ST7920_DELAY_1; \ - WRITE(ST7920_DAT_PIN, val & 0x80); ST7920_DELAY_2; \ - WRITE(ST7920_CLK_PIN, HIGH); ST7920_DELAY_3; \ - val <<= 1 + +#ifdef ARDUINO_ARCH_STM32F1 + #define ST7920_DAT(V) !!((V) & 0x80) +#else + #define ST7920_DAT(V) ((V) & 0x80) +#endif +#define ST7920_SND_BIT do{ \ + WRITE(ST7920_CLK_PIN, LOW); ST7920_DELAY_1; \ + WRITE(ST7920_DAT_PIN, ST7920_DAT(val)); ST7920_DELAY_2; \ + WRITE(ST7920_CLK_PIN, HIGH); ST7920_DELAY_3; \ + val <<= 1; }while(0) // Optimize this code with -O3 #pragma GCC optimize (3) @@ -129,8 +139,8 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo } uint8_t u8g_dev_st7920_128x64_rrd_buf[(LCD_PIXEL_WIDTH) * (PAGE_HEIGHT) / 8] U8G_NOCOMMON; -u8g_pb_t u8g_dev_st7920_128x64_rrd_pb = {{PAGE_HEIGHT, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7920_128x64_rrd_buf}; -u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g_dev_st7920_128x64_rrd_pb, &u8g_com_null_fn}; +u8g_pb_t u8g_dev_st7920_128x64_rrd_pb = { { PAGE_HEIGHT, LCD_PIXEL_HEIGHT, 0, 0, 0 }, LCD_PIXEL_WIDTH, u8g_dev_st7920_128x64_rrd_buf }; +u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_rrd_st7920_128x64_fn, &u8g_dev_st7920_128x64_rrd_pb, &u8g_com_null_fn }; #pragma GCC reset_options @@ -143,4 +153,5 @@ u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g void ST7920_write_byte(const uint8_t val) { ST7920_WRITE_BYTE(val); } #endif -#endif // U8GLIB_ST7920 && !U8G_HAL_LINKS && !__SAM3X8E__ +#endif // U8GLIB_ST7920 +#endif // __AVR__ && !U8G_HAL_LINKS diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h index 12f5ef9a86cd..858cbe88240e 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h @@ -25,9 +25,6 @@ // file u8g_dev_st7920_128x64_HAL.cpp for the HAL version. #include "../../inc/MarlinConfig.h" - -#if ENABLED(U8GLIB_ST7920) && !defined(U8G_HAL_LINKS) && !defined(__SAM3X8E__) - #include "../../HAL/shared/Delay.h" #define ST7920_CLK_PIN LCD_PINS_D4 @@ -52,11 +49,11 @@ #define CPU_ST7920_DELAY_1 DELAY_NS(0) #define CPU_ST7920_DELAY_2 DELAY_NS(0) #define CPU_ST7920_DELAY_3 DELAY_NS(50) -#elif MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE) +#elif MB(3DRAG, K8200, K8400, 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) +#elif MB(MINIRAMBO, EINSY_RAMBO, 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) @@ -94,5 +91,3 @@ void ST7920_SWSPI_SND_8BIT(uint8_t val); #define ST7920_SET_DAT() { ST7920_SWSPI_SND_8BIT(0xFA); U8G_DELAY(); } #define ST7920_WRITE_BYTE(a) { ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xF0u)); ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4u)); U8G_DELAY(); } #define ST7920_WRITE_BYTES(p,l) { for (uint8_t i = l + 1; --i;) { ST7920_SWSPI_SND_8BIT(*p&0xF0); ST7920_SWSPI_SND_8BIT(*p<<4); p++; } U8G_DELAY(); } - -#endif // U8GLIB_ST7920 && !U8G_HAL_LINKS && !__SAM3X8E__ diff --git a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp index b3aba94d3853..c6692941252c 100644 --- a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp @@ -103,7 +103,7 @@ class DGUSSerial { // ISR for Rx void store_rxd_char(); // ISR for Tx (UDRE vector) - void tx_udr_empty_irq(void); + void tx_udr_empty_irq(); inline volatile bool is_rx_overrun() { return dgus_rx_overrun; @@ -289,11 +289,11 @@ void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable // Don't let the user in the dark why there is no reaction. if (!ExtUI::isMediaInserted()) { - setstatusmessagePGM(PSTR("No SD Card")); + setstatusmessagePGM(GET_TEXT(MSG_NO_MEDIA)); return; } if (card.flag.abort_sd_printing) { - setstatusmessagePGM(PSTR("Aborting...")); + setstatusmessagePGM(GET_TEXT(MSG_MEDIA_ABORTING)); return; } } @@ -313,7 +313,7 @@ void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable DEBUG_ECHOPAIR("new topfile calculated:", top_file); if (top_file < 0) { top_file = 0; - DEBUG_ECHOLN("Top of filelist reached"); + DEBUG_ECHOLNPGM("Top of filelist reached"); } else { int16_t max_top = filelist.count() - DGUS_SD_FILESPERSCREEN; @@ -343,7 +343,7 @@ void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable } void DGUSScreenVariableHandler::DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr) { - if(!filelist.seek(file_to_print)) return; + if (!filelist.seek(file_to_print)) return; ExtUI::printFile(filelist.filename()); ScreenHandler.GotoScreen(DGUSLCD_SCREEN_STATUS); } @@ -472,13 +472,13 @@ void DGUSScreenVariableHandler::HandleTemperatureChanged(DGUS_VP_Variable &var, switch (var.VP) { default: return; #if HOTENDS >= 1 - case VP_T_E1_Set: + case VP_T_E0_Set: thermalManager.setTargetHotend(newvalue, 0); acceptedvalue = thermalManager.temp_hotend[0].target; break; #endif #if HOTENDS >= 2 - case VP_T_E2_Set: + case VP_T_E1_Set: thermalManager.setTargetHotend(newvalue, 1); acceptedvalue = thermalManager.temp_hotend[1].target; break; @@ -497,21 +497,25 @@ void DGUSScreenVariableHandler::HandleTemperatureChanged(DGUS_VP_Variable &var, } void DGUSScreenVariableHandler::HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr) { - uint16_t newvalue = swap16(*(uint16_t*)val_ptr); - uint8_t target_extruder; - switch (var.VP) { - default: return; - #if (HOTENDS >= 1) - case VP_Flowrate_E1: target_extruder = 0; break; - #endif - #if (HOTENDS >= 2) - case VP_Flowrate_E2: target_extruder = 1; break; - #endif - } + #if EXTRUDERS + uint16_t newvalue = swap16(*(uint16_t*)val_ptr); + uint8_t target_extruder; + switch (var.VP) { + default: return; + #if (HOTENDS >= 1) + case VP_Flowrate_E0: target_extruder = 0; break; + #endif + #if (HOTENDS >= 2) + case VP_Flowrate_E1: target_extruder = 1; break; + #endif + } - planner.flow_percentage[target_extruder] = newvalue; - planner.refresh_e_factor(target_extruder); - ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel + planner.flow_percentage[target_extruder] = newvalue; + planner.refresh_e_factor(target_extruder); + ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel + #else + UNUSED(var); UNUSED(val_ptr); + #endif } void DGUSScreenVariableHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr) { @@ -522,11 +526,11 @@ void DGUSScreenVariableHandler::HandleManualExtrude(DGUS_VP_Variable &var, void ExtUI::extruder_t target_extruder; switch (var.VP) { - #if HOTENDS >=1 - case VP_MOVE_E1: target_extruder = ExtUI::extruder_t::E0; break; + #if HOTENDS >= 1 + case VP_MOVE_E0: target_extruder = ExtUI::extruder_t::E0; break; #endif - #if HOTENDS >=2 - case VP_MOVE_E2: target_extruder = ExtUI::extruder_t::E1; break + #if HOTENDS >= 2 + case VP_MOVE_E1: target_extruder = ExtUI::extruder_t::E1; break #endif default: return; } @@ -575,7 +579,7 @@ void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *va buf[4] = axiscode; //DEBUG_ECHOPAIR(" ", buf); while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLN(" ✓"); + //DEBUG_ECHOLNPGM(" ✓"); ScreenHandler.ForceCompleteUpdate(); return; } @@ -584,7 +588,7 @@ void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *va DEBUG_ECHOPAIR(" move ", axiscode); bool old_relative_mode = relative_mode; if (!relative_mode) { - //DEBUG_ECHO(" G91"); + //DEBUG_ECHOPGM(" G91"); while (!enqueue_and_echo_command("G91")) idle(); //DEBUG_ECHOPGM(" ✓ "); } @@ -597,18 +601,18 @@ void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *va snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed); //DEBUG_ECHOPAIR(" ", buf); while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLN(" ✓ "); + //DEBUG_ECHOLNPGM(" ✓ "); if (backup_speed != speed) { snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed); while (!enqueue_and_echo_command(buf)) idle(); //DEBUG_ECHOPAIR(" ", buf); } //while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLN(" ✓ "); + //DEBUG_ECHOLNPGM(" ✓ "); if (!old_relative_mode) { - //DEBUG_ECHO("G90"); + //DEBUG_ECHOPGM("G90"); while (!enqueue_and_echo_command("G90")) idle(); - //DEBUG_ECHO(" ✓ "); + //DEBUG_ECHOPGM(" ✓ "); } } @@ -1009,7 +1013,7 @@ FORCE_INLINE void DGUSSerial::store_rxd_char() { } // (called with TX irqs disabled) -FORCE_INLINE void DGUSSerial::tx_udr_empty_irq(void) { +FORCE_INLINE void DGUSSerial::tx_udr_empty_irq() { // Read positions uint8_t t = tx_buffer.tail; const uint8_t h = tx_buffer.head; @@ -1035,7 +1039,7 @@ FORCE_INLINE void DGUSSerial::tx_udr_empty_irq(void) { if (h == t) CBI(DGUS_UCSRxB, UDRIEx); } -r_ring_buffer_pos_t DGUSSerial::available(void) { +r_ring_buffer_pos_t DGUSSerial::available() { const r_ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; return (r_ring_buffer_pos_t) (DGUS_RX_BUFFER_SIZE + h - t) & (DGUS_RX_BUFFER_SIZE - 1); } diff --git a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp index 88308732027a..de15d545977f 100644 --- a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp @@ -46,10 +46,10 @@ const uint16_t VPList_Main[] PROGMEM = { const uint16_t VPList_Temp[] PROGMEM = { #if HOTENDS >= 1 - VP_T_E1_Is, VP_T_E1_Set, + VP_T_E0_Is, VP_T_E0_Set, #endif #if HOTENDS >= 2 - VP_T_E2_I, VP_T_E2_S, + VP_T_E1_I, VP_T_E1_S, #endif #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, @@ -60,10 +60,10 @@ const uint16_t VPList_Temp[] PROGMEM = { const uint16_t VPList_Status[] PROGMEM = { /* VP_M117, for completeness, but it cannot be auto-uploaded */ #if HOTENDS >= 1 - VP_T_E1_Is, VP_T_E1_Set, + VP_T_E0_Is, VP_T_E0_Set, #endif #if HOTENDS >= 2 - VP_T_E2_I, VP_T_E2_S, + VP_T_E1_I, VP_T_E1_S, #endif #if HAS_HEATED_BED VP_T_Bed_Is, VP_T_Bed_Set, @@ -81,10 +81,10 @@ const uint16_t VPList_Status[] PROGMEM = { const uint16_t VPList_Status2[] PROGMEM = { /* VP_M117, for completeness, but it cannot be auto-uploaded */ #if HOTENDS >= 1 - VP_Flowrate_E1, + VP_Flowrate_E0, #endif #if HOTENDS >= 2 - VP_Flowrate_E2, + VP_Flowrate_E1, #endif VP_PrintProgress_Percentage, VP_PrintTime, @@ -107,7 +107,7 @@ const uint16_t VPList_FanAndFeedrate[] PROGMEM = { }; const uint16_t VPList_SD_FlowRates[] PROGMEM = { - VP_Flowrate_E1, VP_Flowrate_E2, + VP_Flowrate_E0, VP_Flowrate_E1, 0x0000 }; @@ -166,23 +166,23 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // Temperature Data #if HOTENDS >= 1 - VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[0].current, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), - VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[0].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Flowrate_E1, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_EPos, &destination[3], nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - VPHELPER(VP_MOVE_E1, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), + VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Flowrate_E0, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_EPos, &destination.e, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_MOVE_E0, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), #endif #if HOTENDS >= 2 - VPHELPER(VP_T_E2_I, &thermalManager.temp_hotend[1].current, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>), - VPHELPER(VP_T_E2_S, &thermalManager.temp_hotend[1].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Flowrate_E2, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_MOVE_E2, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), + VPHELPER(VP_T_E1_I, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_E1_S, &thermalManager.temp_hotend[1].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Flowrate_E1, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_MOVE_E1, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), #endif #if HOTENDS >= 3 #error More than 2 Hotends currently not implemented on the Display UI design. #endif #if HAS_HEATED_BED - VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.current, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), #endif @@ -195,12 +195,12 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, DGUSScreenVariableHandler::DGUSLCD_SetValueDirectly, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), // Position Data. - VPHELPER(VP_XPos, ¤t_position[0], nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - VPHELPER(VP_YPos, ¤t_position[1], nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), - VPHELPER(VP_ZPos, ¤t_position[2], nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_XPos, ¤t_position.x, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_YPos, ¤t_position.y, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), + VPHELPER(VP_ZPos, ¤t_position.z, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), // Print Progress. - VPHELPER(VP_PrintProgress_Percentage, &MarlinUI::progress_bar_percent, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), + VPHELPER(VP_PrintProgress_Percentage, &ui.progress_override, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), // Print Time VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay ), diff --git a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.h b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.h index f54a2938ec7c..f90cfa948b60 100644 --- a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.h +++ b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.h @@ -109,12 +109,12 @@ constexpr uint16_t VP_SD_AbortPrintConfirmed = 0x2028; // Abort print confirmati constexpr uint16_t VP_MOVE_X = 0x2100; constexpr uint16_t VP_MOVE_Y = 0x2102; constexpr uint16_t VP_MOVE_Z = 0x2104; -constexpr uint16_t VP_MOVE_E1 = 0x2110; -constexpr uint16_t VP_MOVE_E2 = 0x2112; -//constexpr uint16_t VP_MOVE_E3 = 0x2114; -//constexpr uint16_t VP_MOVE_E4 = 0x2116; -//constexpr uint16_t VP_MOVE_E5 = 0x2118; -//constexpr uint16_t VP_MOVE_E6 = 0x211A; +constexpr uint16_t VP_MOVE_E0 = 0x2110; +constexpr uint16_t VP_MOVE_E1 = 0x2112; +//constexpr uint16_t VP_MOVE_E2 = 0x2114; +//constexpr uint16_t VP_MOVE_E3 = 0x2116; +//constexpr uint16_t VP_MOVE_E4 = 0x2118; +//constexpr uint16_t VP_MOVE_E5 = 0x211A; constexpr uint16_t VP_HOME_ALL = 0x2120; // Firmware version on the boot screen. @@ -126,34 +126,34 @@ constexpr uint16_t VP_M117 = 0x3020; constexpr uint8_t VP_M117_LEN = 0x20; // Temperatures. -constexpr uint16_t VP_T_E1_Is = 0x3060; // 4 Byte Integer -constexpr uint16_t VP_T_E1_Set = 0x3062; // 2 Byte Integer -constexpr uint16_t VP_T_E2_Is = 0x3064; // 4 Byte Integer +constexpr uint16_t VP_T_E0_Is = 0x3060; // 4 Byte Integer +constexpr uint16_t VP_T_E0_Set = 0x3062; // 2 Byte Integer +constexpr uint16_t VP_T_E1_Is = 0x3064; // 4 Byte Integer // reserved to support up to 6 Extruders: -//constexpr uint16_t VP_T_E2_Set = 0x3066; // 2 Byte Integer -//constexpr uint16_t VP_T_E3_Is = 0x3068; // 4 Byte Integer -//constexpr uint16_t VP_T_E3_Set = 0x306A; // 2 Byte Integer -//constexpr uint16_t VP_T_E4_Is = 0x306C; // 4 Byte Integer -//constexpr uint16_t VP_T_E4_Set = 0x306E; // 2 Byte Integer -//constexpr uint16_t VP_T_E5_Is = 0x3070; // 4 Byte Integer -//constexpr uint16_t VP_T_E5_Set = 0x3072; // 2 Byte Integer -//constexpr uint16_t VP_T_E5_Is = 0x3074; // 4 Byte Integer -//constexpr uint16_t VP_T_E5_Set = 0x3076; // 2 Byte Integer -//constexpr uint16_t VP_T_E6_Is = 0x3078; // 4 Byte Integer -//constexpr uint16_t VP_T_E6_Set = 0x307A; // 2 Byte Integer +//constexpr uint16_t VP_T_E1_Set = 0x3066; // 2 Byte Integer +//constexpr uint16_t VP_T_E2_Is = 0x3068; // 4 Byte Integer +//constexpr uint16_t VP_T_E2_Set = 0x306A; // 2 Byte Integer +//constexpr uint16_t VP_T_E3_Is = 0x306C; // 4 Byte Integer +//constexpr uint16_t VP_T_E3_Set = 0x306E; // 2 Byte Integer +//constexpr uint16_t VP_T_E4_Is = 0x3070; // 4 Byte Integer +//constexpr uint16_t VP_T_E4_Set = 0x3072; // 2 Byte Integer +//constexpr uint16_t VP_T_E4_Is = 0x3074; // 4 Byte Integer +//constexpr uint16_t VP_T_E4_Set = 0x3076; // 2 Byte Integer +//constexpr uint16_t VP_T_E5_Is = 0x3078; // 4 Byte Integer +//constexpr uint16_t VP_T_E5_Set = 0x307A; // 2 Byte Integer constexpr uint16_t VP_T_Bed_Is = 0x3080; // 4 Byte Integer constexpr uint16_t VP_T_Bed_Set = 0x3082; // 2 Byte Integer -constexpr uint16_t VP_Flowrate_E1 = 0x3090; // 2 Byte Integer -constexpr uint16_t VP_Flowrate_E2 = 0x3092; // 2 Byte Integer +constexpr uint16_t VP_Flowrate_E0 = 0x3090; // 2 Byte Integer +constexpr uint16_t VP_Flowrate_E1 = 0x3092; // 2 Byte Integer // reserved for up to 6 Extruders: -//constexpr uint16_t VP_Flowrate_E3 = 0x3094; -//constexpr uint16_t VP_Flowrate_E4 = 0x3096; -//constexpr uint16_t VP_Flowrate_E5 = 0x3098; -//constexpr uint16_t VP_Flowrate_E6 = 0x309A; +//constexpr uint16_t VP_Flowrate_E2 = 0x3094; +//constexpr uint16_t VP_Flowrate_E3 = 0x3096; +//constexpr uint16_t VP_Flowrate_E4 = 0x3098; +//constexpr uint16_t VP_Flowrate_E5 = 0x309A; constexpr uint16_t VP_Fan_Percentage = 0x3100; // 2 Byte Integer (0..100) constexpr uint16_t VP_Feedrate_Percentage = 0x3102; // 2 Byte Integer (0..100) @@ -182,9 +182,9 @@ constexpr uint16_t VP_SD_FileName4 = 0x3280; // located at 0x5000 and up // Not used yet! // This can be used e.g to make controls / data display invisible -constexpr uint16_t SP_T_E1_Is = 0x5000; -constexpr uint16_t SP_T_E1_Set = 0x5010; -constexpr uint16_t SP_T_E2_Is = 0x5020; +constexpr uint16_t SP_T_E0_Is = 0x5000; +constexpr uint16_t SP_T_E0_Set = 0x5010; +constexpr uint16_t SP_T_E1_Is = 0x5020; constexpr uint16_t SP_T_Bed_Is = 0x5030; constexpr uint16_t SP_T_Bed_Set = 0x5040; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp new file mode 100644 index 000000000000..c8cc6e8e9d67 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp @@ -0,0 +1,559 @@ +/********************* + * flash_storage.cpp * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../compat.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "../ftdi_eve_lib/ftdi_eve_lib.h" + +#include "media_file_reader.h" +#include "flash_storage.h" + +// The following must be changed whenever the layout of the flash +// data is changed in a manner that would render the data invalid. + +constexpr uint32_t flash_eeprom_version = 1; + +/* SPI Flash Memory Map: + * + * The following offsets and sizes are specified in 4k erase units: + * + * Page Size Description + * 0 16 DATA STORAGE AREA + * 16 1 VERSIONING DATA + * 17 inf MEDIA STORAGE AREA + * + */ + +#define DATA_STORAGE_SIZE_64K + +using namespace FTDI::SPI; +using namespace FTDI::SPI::most_significant_byte_first; + +bool UIFlashStorage::is_present = false; + +#ifdef SPI_FLASH_SS +/************************** SPI Flash Chip Interface **************************/ + + void SPIFlash::wait_while_busy() { + uint8_t status; + safe_delay(1); + do { + spi_flash_select(); + spi_write_8(READ_STATUS_1); + status = spi_read_8(); + spi_flash_deselect(); + safe_delay(1); + } while (status & 1); + } + + void SPIFlash::erase_sector_4k(uint32_t addr) { + spi_flash_select(); + spi_write_8(WRITE_ENABLE); + spi_flash_deselect(); + + spi_flash_select(); + spi_write_8(ERASE_4K); + spi_write_24(addr); + spi_flash_deselect(); + + wait_while_busy(); + } + + void SPIFlash::erase_sector_64k(uint32_t addr) { + spi_flash_select(); + spi_write_8(WRITE_ENABLE); + spi_flash_deselect(); + + spi_flash_select(); + spi_write_8(ERASE_64K); + spi_write_24(addr); + spi_flash_deselect(); + + wait_while_busy(); + } + + void SPIFlash::spi_write_begin(uint32_t addr) { + spi_flash_select(); + spi_write_8(WRITE_ENABLE); + spi_flash_deselect(); + + spi_flash_select(); + spi_write_8(PAGE_PROGRAM); + spi_write_24(addr); + } + + void SPIFlash::spi_write_end() { + spi_flash_deselect(); + wait_while_busy(); + } + + void SPIFlash::spi_read_begin(uint32_t addr) { + spi_flash_select(); + spi_write_8(READ_DATA); + spi_write_24(addr); + } + + void SPIFlash::spi_read_end() { + spi_flash_deselect(); + } + + void SPIFlash::erase_chip() { + spi_flash_select(); + spi_write_8(WRITE_ENABLE); + spi_flash_deselect(); + + spi_flash_select(); + spi_write_8(ERASE_CHIP); + spi_flash_deselect(); + wait_while_busy(); + } + + void SPIFlash::read_jedec_id(uint8_t &manufacturer_id, uint8_t &device_type, uint8_t &capacity) { + spi_flash_select(); + spi_write_8(READ_JEDEC_ID); + manufacturer_id = spi_recv(); + device_type = spi_recv(); + capacity = spi_recv(); + spi_flash_deselect (); + } + + /* This function writes "size" bytes from "data" starting at addr, while properly + * taking into account the special case of writing across a 256 byte page boundary. + * Returns the addr directly after the write. + */ + uint32_t SPIFlash::write(uint32_t addr, const void *_data, size_t size) { + const uint8_t *data = (const uint8_t*) _data; + while (size) { + const uint32_t page_start = addr & 0xFFFF00ul; + const uint32_t page_end = page_start + 256; + const uint32_t write_size = min(page_end - addr, size); + spi_write_begin(addr); + spi_write_bulk(data, write_size); + spi_write_end(); + addr += write_size; + size -= write_size; + data += write_size; + } + return addr; + } + + uint32_t SPIFlash::read(uint32_t addr, void *data, size_t size) { + spi_read_begin(addr); + spi_read_bulk(data, size); + spi_read_end(); + return addr + size; + } + + /********************************** UTILITY ROUTINES *********************************/ + + bool UIFlashStorage::check_known_device() { + uint8_t manufacturer_id, device_type, capacity; + read_jedec_id(manufacturer_id, device_type, capacity); + + const bool is_known = + ((manufacturer_id == 0xEF) && (device_type == 0x40) && (capacity == 0x15)) || // unknown + ((manufacturer_id == 0x01) && (device_type == 0x40) && (capacity == 0x15)) || // Cypress S25FL116K + ((manufacturer_id == 0xEF) && (device_type == 0x14) && (capacity == 0x15)) || // Winbond W25Q16JV + ((manufacturer_id == 0x1F) && (device_type == 0x86) && (capacity == 0x01)) ; // Adesto AT255F161 + + if (!is_known) { + SERIAL_ECHO_MSG("Unable to locate supported SPI Flash Memory."); + SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Manufacturer ID, got: ", manufacturer_id); + SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Device Type , got: ", device_type); + SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Capacity , got: ", capacity); + } + + return is_known; + } + + void UIFlashStorage::initialize() { + for(uint8_t i = 0; i < 10; i++) { + if (check_known_device()) { + is_present = true; + break; + } + safe_delay(1000); + } + } + + /**************************** DATA STORAGE AREA (first 4K or 64k) ********************/ + + #ifdef DATA_STORAGE_SIZE_64K + constexpr uint32_t data_storage_area_size = 64 * 1024; // Large erase unit + #else + constexpr uint32_t data_storage_area_size = 4 * 1024; // Small erase unit + #endif + + /* In order to provide some degree of wear leveling, each data write to the + * SPI Flash chip is appended to data that was already written before, until + * the data storage area is completely filled. New data is written preceeded + * with a 32-bit delimiter 'LULZ', so that we can distinguish written and + * unwritten data: + * + * 'LULZ' <--- 1st record delimiter + * + * + * + * 'LULZ' <--- 2nd record delimiter + * + * + * + * ... + * 'LULZ' <--- Last record delimiter + * + * + * + * 0xFF <--- Start of free space + * 0xFF + * ... + * + * This function walks down the data storage area, verifying that the + * delimiters are either 'LULZ' or 0xFFFFFFFF. In the case that an invalid + * delimiter is found, this function returns -1, indicating that the Flash + * data is invalid (this will happen if the block_size changed with respect + * to earlier firmware). Otherwise, it returns the offset of the last + * valid delimiter 'LULZ', indicating the most recently written data. + */ + int32_t UIFlashStorage::get_config_read_offset(uint32_t block_size) { + uint16_t stride = 4 + block_size; + int32_t read_offset = -1; + + for(uint32_t offset = 0; offset < (data_storage_area_size - stride); offset += stride) { + uint32_t delim; + spi_read_begin(offset); + spi_read_bulk (&delim, sizeof(delim)); + spi_read_end(); + switch (delim) { + case 0xFFFFFFFFul: return read_offset; + case delimiter: read_offset = offset; break; + default: + SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Invalid delimiter in Flash: ", delim); + return -1; + } + } + SERIAL_ECHO_MSG("No LULZ delimiter found."); + return -1; + } + + /* This function returns the offset at which new data should be + * appended, or -1 if the Flash needs to be erased */ + int32_t UIFlashStorage::get_config_write_offset(uint32_t block_size) { + int32_t read_offset = get_config_read_offset(block_size); + if (read_offset == -1) return -1; // The SPI flash is invalid + + int32_t write_offset = read_offset + 4 + block_size; + if ((write_offset + 4 + block_size) > data_storage_area_size) { + SERIAL_ECHO_MSG("Not enough free space in Flash."); + return -1; // Not enough free space + } + return write_offset; + } + + bool UIFlashStorage::verify_config_data(const void *data, size_t size) { + if (!is_present) return false; + + int32_t read_addr = get_config_read_offset(size); + if (read_addr == -1) return false; + + uint32_t delim; + spi_read_begin(read_addr); + spi_read_bulk (&delim, sizeof(delim)); + bool ok = spi_verify_bulk(data,size); + spi_read_end(); + return ok && delim == delimiter; + } + + bool UIFlashStorage::read_config_data(void *data, size_t size) { + if (!is_present) return false; + + int32_t read_addr = get_config_read_offset(size); + if (read_addr == -1) return false; + + uint32_t delim; + spi_read_begin(read_addr); + spi_read_bulk (&delim, sizeof(delim)); + spi_read_bulk (data, size); + spi_read_end(); + return delim == delimiter; + } + + void UIFlashStorage::write_config_data(const void *data, size_t size) { + if (!is_present) { + SERIAL_ECHO_MSG("SPI Flash chip not present. Not saving UI settings."); + return; + } + + // Since Flash storage has a limited number of write cycles, + // make sure that the data is different before rewriting. + + if (verify_config_data(data, size)) { + SERIAL_ECHO_MSG("UI settings already written, skipping write."); + return; + } + + int16_t write_addr = get_config_write_offset(size); + if (write_addr == -1) { + SERIAL_ECHO_START(); + SERIAL_ECHOPGM("Erasing UI settings from SPI Flash... "); + #ifdef DATA_STORAGE_SIZE_64K + erase_sector_64k(0); + #else + erase_sector_4k(0); + #endif + write_addr = 0; + SERIAL_ECHOLNPGM("DONE"); + } + + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR("Writing UI settings to SPI Flash (offset ", write_addr); + SERIAL_ECHOPGM(")..."); + + const uint32_t delim = delimiter; + write_addr = write(write_addr, &delim, sizeof(delim)); + write_addr = write(write_addr, data, size); + + SERIAL_ECHOLNPGM("DONE"); + } + + /************************** VERSIONING INFO AREA ************************/ + + /* The version info area follows the data storage area. If the version + * is incorrect, the data on the chip is invalid and format_flash should + * be called. + */ + + typedef struct { + uint32_t magic; + uint32_t version; + } flash_version_info; + + constexpr uint32_t version_info_addr = data_storage_area_size; + constexpr uint32_t version_info_size = 4 * 1024; // Small erase unit + + bool UIFlashStorage::is_valid() { + flash_version_info info; + + spi_read_begin(version_info_addr); + spi_read_bulk (&info, sizeof(flash_version_info)); + spi_read_end(); + + return info.magic == delimiter && info.version == flash_eeprom_version; + } + + void UIFlashStorage::write_version_info() { + flash_version_info info; + + info.magic = delimiter; + info.version = flash_eeprom_version; + + spi_write_begin(version_info_addr); + spi_write_bulk(&info, sizeof(flash_version_info)); + spi_write_end(); + } + + /**************************** MEDIA STORAGE AREA *****************************/ + + /* The media storage area follows the versioning info area. It consists + * of a file index followed by the data for one or more media files. + * + * The file index consists of an array of 32-bit file sizes. If a file + * is not present, the file's size will be set to 0xFFFFFFFF + */ + + constexpr uint32_t media_storage_addr = version_info_addr + version_info_size; + constexpr uint8_t media_storage_slots = 4; + + void UIFlashStorage::format_flash() { + SERIAL_ECHO_START(); SERIAL_ECHOPGM("Erasing SPI Flash..."); + SPIFlash::erase_chip(); + SERIAL_ECHOLNPGM("DONE"); + + write_version_info(); + } + + uint32_t UIFlashStorage::get_media_file_start(uint8_t slot) { + uint32_t addr = media_storage_addr + sizeof(uint32_t) * media_storage_slots; + spi_read_begin(media_storage_addr); + for(uint8_t i = 0; i < slot; i++) { + addr += spi_read_32(); + } + spi_read_end(); + return addr; + } + + void UIFlashStorage::set_media_file_size(uint8_t slot, uint32_t size) { + spi_write_begin(media_storage_addr + sizeof(uint32_t) * slot); + spi_write_32(size); + spi_write_end(); + } + + uint32_t UIFlashStorage::get_media_file_size(uint8_t slot) { + spi_read_begin(media_storage_addr + sizeof(uint32_t) * slot); + uint32_t size = spi_read_32(); + spi_read_end(); + return size; + } + + /* Writes a media file from the SD card/USB flash drive into a slot on the SPI Flash. Media + * files must be written sequentially following by a chip erase and it is not possible to + * overwrite files. */ + UIFlashStorage::error_t UIFlashStorage::write_media_file(progmem_str filename, uint8_t slot) { + #if ENABLED(SDSUPPORT) + uint32_t addr; + uint8_t buff[write_page_size]; + + strcpy_P( (char*) buff, (const char*) filename); + + MediaFileReader reader; + if (!reader.open((char*) buff)) { + SERIAL_ECHO_MSG("Unable to find media file"); + return FILE_NOT_FOUND; + } + + if (get_media_file_size(slot) != 0xFFFFFFFFUL) { + SERIAL_ECHO_MSG("Media file already exists"); + return WOULD_OVERWRITE; + } + + SERIAL_ECHO_START(); SERIAL_ECHOPGM("Writing SPI Flash..."); + + set_media_file_size(slot, reader.size()); + addr = get_media_file_start(slot); + + // Write out the file itself + for(;;) { + const int16_t nBytes = reader.read(buff, write_page_size); + if (nBytes == -1) { + SERIAL_ECHOLNPGM("Failed to read from file"); + return READ_ERROR; + } + + addr = write(addr, buff, nBytes); + if (nBytes != write_page_size) + break; + + #if ENABLED(EXTENSIBLE_UI) + ExtUI::yield(); + #endif + } + + SERIAL_ECHOLNPGM("DONE"); + + SERIAL_ECHO_START(); SERIAL_ECHOPGM("Verifying SPI Flash..."); + + bool verifyOk = true; + + // Verify the file index + + if (get_media_file_start(slot+1) != (get_media_file_start(slot) + reader.size())) { + SERIAL_ECHOLNPGM("File index verification failed. "); + verifyOk = false; + } + + // Verify the file itself + addr = get_media_file_start(slot); + reader.rewind(); + + while (verifyOk) { + const int16_t nBytes = reader.read(buff, write_page_size); + if (nBytes == -1) { + SERIAL_ECHOPGM("Failed to read from file"); + verifyOk = false; + break; + } + + spi_read_begin(addr); + if (!spi_verify_bulk(buff, nBytes)) { + verifyOk = false; + spi_read_end(); + break; + } + spi_read_end(); + + addr += nBytes; + if (nBytes != write_page_size) break; + #if ENABLED(EXTENSIBLE_UI) + ExtUI::yield(); + #endif + }; + + if (verifyOk) { + SERIAL_ECHOLNPGM("DONE"); + return SUCCESS; + } else { + SERIAL_ECHOLNPGM("FAIL"); + return VERIFY_ERROR; + } + #else + return VERIFY_ERROR; + #endif // ENABLED(SDSUPPORT) + } + + bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t slot) { + if (!is_present) return false; + + bytes_remaining = get_media_file_size(slot); + if (bytes_remaining != 0xFFFFFFFFUL) { + SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Boot media file size:", bytes_remaining); + addr = get_media_file_start(slot); + return true; + } + return false; + } + + int16_t UIFlashStorage::BootMediaReader::read(void *data, const size_t size) { + if (bytes_remaining == 0xFFFFFFFFUL) return -1; + + if (size > bytes_remaining) + return read(data, bytes_remaining); + + if (size > 0) { + spi_read_begin(addr); + spi_read_bulk(data, size); + spi_read_end(); + addr += size; + bytes_remaining -= size; + } + + return size; + } + + int16_t UIFlashStorage::BootMediaReader::read(void *obj, void *data, const size_t size) { + return reinterpret_cast(obj)->read(data, size); + } + +#else + void UIFlashStorage::initialize() {} + bool UIFlashStorage::is_valid() {return true;} + void UIFlashStorage::write_config_data(const void *, size_t) {} + bool UIFlashStorage::verify_config_data(const void *, size_t) {return false;} + bool UIFlashStorage::read_config_data(void *, size_t ) {return false;} + UIFlashStorage::error_t UIFlashStorage::write_media_file(progmem_str, uint8_t) {return FILE_NOT_FOUND;} + void UIFlashStorage::format_flash() {} + + bool UIFlashStorage::BootMediaReader::isAvailable(uint32_t) {return false;} + int16_t UIFlashStorage::BootMediaReader::read(void *, const size_t) {return -1;} + int16_t UIFlashStorage::BootMediaReader::read(void *, void *, const size_t) {return -1;} +#endif // SPI_FLASH_SS +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h new file mode 100644 index 000000000000..2917cb0b1e7b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h @@ -0,0 +1,106 @@ +/******************* + * flash_storage.h * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +class SPIFlash { + public: + static constexpr uint32_t erase_unit_size = 4 * 1024; // Minimum erase unit + static constexpr uint32_t write_page_size = 256; // Minimum page write unit + + enum { + READ_STATUS_1 = 0x05, + READ_STATUS_2 = 0x35, + READ_STATUS_3 = 0x33, + WRITE_ENABLE = 0x06, + WRITE_DISABLE = 0x04, + READ_ID = 0x90, + READ_JEDEC_ID = 0x9F, + READ_DATA = 0x03, + PAGE_PROGRAM = 0x02, + ERASE_4K = 0x20, + ERASE_64K = 0xD8, + ERASE_CHIP = 0xC7 + }; + + static void wait_while_busy(); + static void erase_sector_4k(uint32_t addr); + static void erase_sector_64k(uint32_t addr); + static void erase_chip (); + + static void read_jedec_id(uint8_t &manufacturer_id, uint8_t &device_type, uint8_t &capacity); + + static void spi_read_begin(uint32_t addr); + static void spi_read_end(); + + static void spi_write_begin(uint32_t addr); + static void spi_write_end(); + + static uint32_t write(uint32_t addr, const void *data, size_t size); + static uint32_t read(uint32_t addr, void *data, size_t size); +}; + +class UIFlashStorage : private SPIFlash { + private: + + static bool is_present; + static int32_t get_config_read_offset(uint32_t block_size); + static int32_t get_config_write_offset(uint32_t block_size); + + static uint32_t get_media_file_start(uint8_t slot); + static void set_media_file_size(uint8_t slot, uint32_t size); + static uint32_t get_media_file_size(uint8_t slot); + + static constexpr uint32_t delimiter = 0x4D524C4E; // 'MRLN' + public: + enum error_t { + SUCCESS, + FILE_NOT_FOUND, + READ_ERROR, + VERIFY_ERROR, + WOULD_OVERWRITE + }; + + static void initialize (); + static void format_flash (); + static bool check_known_device(); + + static bool is_valid (); + static void write_version_info(); + + static void write_config_data (const void *data, size_t size); + static bool verify_config_data (const void *data, size_t size); + static bool read_config_data (void *data, size_t size); + static error_t write_media_file (progmem_str filename, uint8_t slot = 0); + + class BootMediaReader; +}; + +class UIFlashStorage::BootMediaReader { + private: + uint32_t addr; + uint32_t bytes_remaining; + + public: + bool isAvailable(uint32_t slot = 0); + int16_t read(void *buffer, size_t const size); + + static int16_t read(void *obj, void *buffer, const size_t size); +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp new file mode 100644 index 000000000000..68886166c2d3 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp @@ -0,0 +1,63 @@ +/************************ + * media_filereader.cpp * + ************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../compat.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + #include "media_file_reader.h" + + #if ENABLED(SDSUPPORT) + bool MediaFileReader::open(const char* filename) { + card.init(SPI_SPEED, SDSS); + volume.init(&card); + root.openRoot(&volume); + return file.open(&root, filename, O_READ); + } + + int16_t MediaFileReader::read(void *buff, size_t bytes) { + return file.read(buff, bytes); + } + + void MediaFileReader::close() { + file.close(); + } + + uint32_t MediaFileReader::size() { + return file.fileSize(); + } + + void MediaFileReader::rewind() { + file.rewind(); + } + + int16_t MediaFileReader::read(void *obj, void *buff, size_t bytes) { + return reinterpret_cast(obj)->read(buff, bytes); + } + #else + bool MediaFileReader::open(const char*) {return -1;} + int16_t MediaFileReader::read(void *, size_t) {return 0;} + void MediaFileReader::close() {} + uint32_t MediaFileReader::size() {return 0;} + void MediaFileReader::rewind() {} + int16_t MediaFileReader::read(void *, void *, size_t) {return 0;} + #endif +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h new file mode 100644 index 000000000000..d64182fd5b0b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h @@ -0,0 +1,48 @@ +/********************** + * media_filereader.h * + **********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "../../../../../inc/MarlinConfigPre.h" + +#if ENABLED(SDSUPPORT) + #include "../../../../../sd/SdFile.h" + #include "../../../../../sd/cardreader.h" +#endif + +class MediaFileReader { + private: + #if ENABLED(SDSUPPORT) + Sd2Card card; + SdVolume volume; + SdFile root, file; + #endif + + public: + bool open(const char* filename); + int16_t read(void *buff, size_t bytes); + uint32_t size(); + void rewind(); + void close(); + + static int16_t read(void *obj, void *buff, size_t bytes); +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h new file mode 100644 index 000000000000..90fd615a5d73 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h @@ -0,0 +1,48 @@ +/************ + * compat.h * + ************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/** + * This following provides compatibility whether compiling + * as a part of Marlin or outside it + */ + +#ifdef __has_include + #if __has_include("../../ui_api.h") + #include "../../ui_api.h" + #endif +#else + #include "../../ui_api.h" +#endif + +#ifdef __MARLIN_FIRMWARE__ + // __MARLIN_FIRMWARE__ exists when compiled within Marlin. + #include "pin_mappings.h" +#else + namespace UI { + static inline uint32_t safe_millis() {return millis();}; + static inline void yield() {}; + }; +#endif + +class __FlashStringHelper; +typedef const __FlashStringHelper *progmem_str; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/config.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/config.h new file mode 100644 index 000000000000..458c9012065c --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/config.h @@ -0,0 +1,124 @@ +/************ + * config.h * + ************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "compat.h" + +// Define the display board used (see "ftdi_eve_boards.h" for definitions) + +//#define LCD_FTDI_VM800B35A // FTDI 3.5" 320x240 with FT800 +//#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" 480x272 +//#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" 480x272 +//#define LCD_HAOYU_FT810CB // Haoyu with 5" 800x480 +//#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD User Interface + +// Leave the following commented out to use a board's default resolution. +// If you have changed the LCD panel, you may override the resolution +// below (see "ftdi_eve_resolutions.h" for definitions): + +//#define TOUCH_UI_320x240 +//#define TOUCH_UI_480x272 +//#define TOUCH_UI_800x480 + +// Define the printer interface or pins used (see "ui_pin_mappings.h" for definitions): + +//#define CR10_TFT_PINMAP +//#define AO_EXP1_DEPRECATED_PINMAP // UltraLCD EXP1 connector, old AlephObject's wiring +//#define AO_EXP1_PINMAP // UltraLCD EXP1 connector, new AlephObject's wiring +//#define AO_EXP2_PINMAP // UltraLCD EXP2 connector, new AlephObject's wiring +//#define OTHER_PIN_LAYOUT + +// Otherwise. Define all the pins manually: + +#ifdef OTHER_PIN_LAYOUT + // Select interfacing pins, the following pin specifiers are supported: + // + // ARDUINO_DIGITAL_1 - Arduino pin via digitalWrite/digitalRead + // AVR_A1 - Fast AVR port access via PORTA/PINA/DDRA + // 1 - When compiling Marlin, use Marlin pin IDs. + + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #ifdef CLCD_USE_SOFT_SPI + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif +#endif + +// Defines how to orient the display. An inverted (i.e. upside-down) display +// is supported on the FT800. The FT810 or better also support a portrait +// and mirrored orientation. +//#define TOUCH_UI_INVERTED +//#define TOUCH_UI_PORTRAIT +//#define TOUCH_UI_MIRRORED + +// Enable UTF8 processing and rendering. Unsupported characters +// will be shown as '?'. +//#define TOUCH_UI_USE_UTF8 +#ifdef TOUCH_UI_USE_UTF8 + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif +#endif + +// When labels do not fit buttons, use smaller font +//#define TOUCH_UI_FIT_TEXT + +// Enable support for selection of languages at run-time +// (otherwise will use the value of LCD_LANGUAGE) +//#define TOUCH_UI_LANGUAGE_MENU + +// Use a numeric passcode for "Parental lock". +// This is a recommended for smaller displays. +//#define TOUCH_UI_PASSCODE + +// The timeout (in ms) to return to the status screen from sub-menus +//#define LCD_TIMEOUT_TO_STATUS 15000 + +// Enable this to debug the event framework +//#define TOUCH_UI_DEBUG + +// Enable the developer's menu and screens +//#define DEVELOPER_SCREENS + +// Sets the SPI speed in Hz + +#define SPI_FREQUENCY 8000000 >> SPI_SPEED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt new file mode 100644 index 000000000000..94a9ed024d38 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/README.md b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/README.md new file mode 100644 index 000000000000..6ba985d60030 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/README.md @@ -0,0 +1,28 @@ +FTDI EVE Library +---------------- + +The FTDI EVE Library is a fully open-source library and UI framework for the FTDI +FT800 and FT810 graphics processor. + +Although the library has been developed within Lulzbot for providing a user interface +for Marlin, the library has been written so that it can be used in any Arduino sketch. + +The library is split into two parts. The "basic" API provides a shallow interface to +the underlying FTDI hardware and command FIFO and provides low-level access to the +hardware as closely as possible to the API described in the FTDI Programmer's Guide. + +The "extended" API builds on top of the "basic" API to provide a GUI framework for +handling common challenges in building a usable GUI. The GUI framework provides the +following features: + +- Macros for a resolution-independent placement of widgets based on a grid. +- Class-based UI screens, with press and unpress touch events, as well as touch repeat. +- Event loop with button debouncing and button push visual and auditory feedback. +- Easy screen-to-screen navigation including a navigation stack for going backwards. +- Visual feedback for disabled vs enabled buttons, and custom button styles. +- A sound player class for playing individual notes or complete sound sequences. +- Display list caching, for storing static background elements of a screen in RAM_G. + +See the "examples" folder for Arduino sketches. Modify the "src/config.h" file in +each to suit your particular setup. The "sample_configs" contain sample configuration +files for running the sketches on our 3D printer boards. diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h new file mode 100644 index 000000000000..1863d0ec29d1 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h @@ -0,0 +1,183 @@ +/************ + * boards.h * + ************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define HAS_RESOLUTION (defined(TOUCH_UI_320x240) || defined(TOUCH_UI_480x272) || defined(TOUCH_UI_800x480)) + +#define IS_FT800 \ + constexpr uint16_t ftdi_chip = 800; \ + using namespace FTDI_FT800; \ + namespace DL { \ + using namespace FTDI_FT800_DL; \ + } \ + typedef ft800_memory_map ftdi_memory_map; \ + typedef ft800_registers ftdi_registers; + +#define IS_FT810 \ + constexpr uint16_t ftdi_chip = 810; \ + using namespace FTDI_FT810; \ + namespace DL { \ + using namespace FTDI_FT800_DL; \ + using namespace FTDI_FT810_DL; \ + } \ + typedef ft810_memory_map ftdi_memory_map; \ + typedef ft810_registers ftdi_registers; + + +#ifdef LCD_FTDI_VM800B35A + #if !HAS_RESOLUTION + #define TOUCH_UI_320x240 + #endif + #ifndef FTDI_API_LEVEL + #define FTDI_API_LEVEL 800 + #endif + namespace FTDI { + IS_FT800 + constexpr bool Use_Crystal = true; // 0 = use internal oscillator, 1 = module has a crystal populated + constexpr bool GPIO_0_Audio_Enable = false; /* 1 = does use GPIO00 for amplifier control, 0 = not in use for Audio */ + constexpr bool GPIO_1_Audio_Shutdown = true; /* 1 = does use GPIO01 for amplifier control, 0 = not in use for Audio */ + constexpr uint8_t Swizzle = 2; + constexpr uint8_t CSpread = 1; + + constexpr uint16_t touch_threshold = 1200; /* touch-sensitivity */ + } + +/* + * Settings for the Haoyu Electronics, 4.3" Graphical LCD Touchscreen, 480x272, SPI, FT800 (FT800CB-HY43B) + * Haoyu Electronics, 5" Graphical LCD Touchscreen, 480x272, SPI, FT800 (FT800CB-HY50B) + * + * http://www.hotmcu.com/43-graphical-lcd-touchscreen-480x272-spi-ft800-p-111.html?cPath=6_16 + * http://www.hotmcu.com/5-graphical-lcd-touchscreen-480x272-spi-ft800-p-124.html?cPath=6_16 + * + * Datasheet: + * + * http://www.hantronix.com/files/data/1278363262430-3.pdf + * http://www.haoyuelectronics.com/Attachment/HY43-LCD/LCD%20DataSheet.pdf + * http://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf + * + */ + +#elif defined(LCD_HAOYU_FT800CB) + #if !HAS_RESOLUTION + #define TOUCH_UI_480x272 + #endif + #ifndef FTDI_API_LEVEL + #define FTDI_API_LEVEL 800 + #endif + namespace FTDI { + IS_FT800 + constexpr bool Use_Crystal = true; // 0 = use internal oscillator, 1 = module has a crystal populated + constexpr bool GPIO_0_Audio_Enable = false; + constexpr bool GPIO_1_Audio_Shutdown = false; + constexpr uint8_t Swizzle = 0; + constexpr uint8_t CSpread = 1; + constexpr uint16_t touch_threshold = 2000; /* touch-sensitivity */ + } + +/* + * Settings for the Haoyu Electronics, 5" Graphical LCD Touchscreen, 800x480, SPI, FT810 + * + * http://www.hotmcu.com/5-graphical-lcd-touchscreen-800x480-spi-ft810-p-286.html + * + * Datasheet: + * + * http://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf + * + */ + +#elif defined(LCD_HAOYU_FT810CB) + #if !HAS_RESOLUTION + #define TOUCH_UI_800x480 + #endif + #ifndef FTDI_API_LEVEL + #define FTDI_API_LEVEL 810 + #endif + namespace FTDI { + IS_FT810 + constexpr bool Use_Crystal = true; // 0 = use internal oscillator, 1 = module has a crystal populated + constexpr bool GPIO_0_Audio_Enable = false; + constexpr bool GPIO_1_Audio_Shutdown = false; + constexpr uint8_t Swizzle = 0; + constexpr uint8_t CSpread = 1; + constexpr uint16_t touch_threshold = 2000; /* touch-sensitivity */ + } + +/* + * Settings for the 4D Systems, 4.3" Embedded SPI Display 480x272, SPI, FT800 (4DLCD-FT843) + * + * http://www.4dsystems.com.au/product/4DLCD_FT843/ + * + * Datasheet: + * + * http://www.4dsystems.com.au/productpages/4DLCD-FT843/downloads/FT843-4.3-Display_datasheet_R_1_2.pdf + * + */ + +#elif defined(LCD_4DSYSTEMS_4DLCD_FT843) + #if !HAS_RESOLUTION + #define TOUCH_UI_480x272 + #endif + #ifndef FTDI_API_LEVEL + #define FTDI_API_LEVEL 800 + #endif + namespace FTDI { + IS_FT800 + constexpr bool Use_Crystal = true; // 0 = use internal oscillator, 1 = module has a crystal populated + constexpr bool GPIO_0_Audio_Enable = false; + constexpr bool GPIO_1_Audio_Shutdown = true; + constexpr uint8_t Swizzle = 0; + constexpr uint8_t CSpread = 1; + constexpr uint16_t touch_threshold = 1200; /* touch-sensitivity */ + } + +/* + * Settings for the Aleph Objects Color LCD User Interface + * + * https://code.alephobjects.com/source/aotctl/ + * + * Datasheet: + * + * http://www.hantronix.com/files/data/s1501799605s500-gh7.pdf + * + */ +#elif defined(LCD_ALEPHOBJECTS_CLCD_UI) + #if !HAS_RESOLUTION + #define TOUCH_UI_800x480 + #endif + #ifndef FTDI_API_LEVEL + #define FTDI_API_LEVEL 810 + #endif + namespace FTDI { + IS_FT810 + constexpr bool Use_Crystal = false; // 0 = use internal oscillator, 1 = module has a crystal populated + constexpr bool GPIO_0_Audio_Enable = true; // The AO CLCD uses GPIO0 to enable audio + constexpr bool GPIO_1_Audio_Shutdown = false; + constexpr uint8_t Swizzle = 0; + constexpr uint8_t CSpread = 0; + constexpr uint16_t touch_threshold = 2000; /* touch-sensitivity */ + } + +#else + + #error Unknown or no TOUCH_UI_FTDI_EVE board specified. To add a new board, modify "ftdi_eve_boards.h" +#endif diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp new file mode 100644 index 000000000000..d21511856fde --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -0,0 +1,1188 @@ +/**************** + * commands.cpp * + ****************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_basic.h" + +#ifdef FTDI_BASIC + +#define MULTIPLE_OF_4(val) ((((val)+3)>>2)<<2) + +using namespace FTDI; +using namespace FTDI::SPI; + +void CLCD::enable() { + mem_write_8(REG::PCLK, Pclk); +} + +void CLCD::disable() { + mem_write_8(REG::PCLK, 0x00); +} + +void CLCD::set_brightness(uint8_t brightness) { + mem_write_8(REG::PWM_DUTY, min(128,brightness)); +} + +uint8_t CLCD::get_brightness() { + return mem_read_8(REG::PWM_DUTY); +} + +void CLCD::turn_on_backlight() { + mem_write_8(REG::PWM_DUTY, 128); +} + +void CLCD::FontMetrics::load(const uint8_t font) { + static_assert(sizeof(FontMetrics) == 148, "Sizeof font metrics is incorrect"); + uint32_t rom_fontroot = mem_read_32(MAP::ROM_FONT_ADDR); + mem_read_bulk(rom_fontroot + 148 * (font - 16), (uint8_t*) this, 148); +} + +uint16_t CLCD::FontMetrics::get_text_width(const char *str, size_t n) const { + uint16_t width = 0; + const uint8_t *p = (const uint8_t *) str; + for(;;) { + const uint8_t val = *p++; n--; + if (!val || n == 0) break; + width += val < 128 ? char_widths[val] : 0; + } + return width; +} + +uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const { + uint16_t width = 0; + const uint8_t *p = (const uint8_t *) str; + for(;;) { + const uint8_t val = pgm_read_byte(p++); n--; + if (!val || n == 0) break; + width += val < 128 ? char_widths[val] : 0; + } + return width; +} + +/************************** HOST COMMAND FUNCTION *********************************/ + +void CLCD::host_cmd (unsigned char host_command, unsigned char byte2) { // Sends 24-Bit Host Command to LCD + if (host_command != ACTIVE) { + host_command |= 0x40; + } + spi_ftdi_select(); + spi_send(host_command); + spi_send(byte2); + spi_send(0x00); + spi_ftdi_deselect(); +} + +/************************** MEMORY READ FUNCTIONS *********************************/ + +void CLCD::spi_read_addr (uint32_t reg_address) { + spi_send((reg_address >> 16) & 0x3F); // Address [21:16] + spi_send((reg_address >> 8 ) & 0xFF); // Address [15:8] + spi_send((reg_address >> 0) & 0xFF); // Address [7:0] + spi_send(0x00); // Dummy Byte +} + +// Write 4-Byte Address, Read Multiple Bytes +void CLCD::mem_read_bulk (uint32_t reg_address, uint8_t *data, uint16_t len) { + spi_ftdi_select(); + spi_read_addr(reg_address); + spi_read_bulk (data, len); + spi_ftdi_deselect(); +} + +// Write 4-Byte Address, Read 1-Byte Data +uint8_t CLCD::mem_read_8 (uint32_t reg_address) { + spi_ftdi_select(); + spi_read_addr(reg_address); + uint8_t r_data = spi_read_8(); + spi_ftdi_deselect(); + return r_data; +} + +// Write 4-Byte Address, Read 2-Bytes Data +uint16_t CLCD::mem_read_16 (uint32_t reg_address) { + using namespace SPI::least_significant_byte_first; + spi_ftdi_select(); + spi_read_addr(reg_address); + uint16_t r_data = spi_read_16(); + spi_ftdi_deselect(); + return r_data; +} + +// Write 4-Byte Address, Read 4-Bytes Data +uint32_t CLCD::mem_read_32 (uint32_t reg_address) { + using namespace SPI::least_significant_byte_first; + spi_ftdi_select(); + spi_read_addr(reg_address); + uint32_t r_data = spi_read_32(); + spi_ftdi_deselect(); + return r_data; +} + +/************************** MEMORY WRITE FUNCTIONS *********************************/ + +// Generic operations for transforming a byte, for use with _mem_write_bulk: +static inline uint8_t reverse_byte(uint8_t a) { + return ((a & 0x1) << 7) | ((a & 0x2) << 5) | + ((a & 0x4) << 3) | ((a & 0x8) << 1) | + ((a & 0x10) >> 1) | ((a & 0x20) >> 3) | + ((a & 0x40) >> 5) | ((a & 0x80) >> 7); +} +static inline uint8_t xbm_write(const uint8_t *p) {return reverse_byte(pgm_read_byte(p));} + +void CLCD::spi_write_addr (uint32_t reg_address) { + spi_send((reg_address >> 16) | 0x80); // Address [21:16] + spi_send((reg_address >> 8 ) & 0xFF); // Address [15:8] + spi_send((reg_address >> 0) & 0xFF); // Address [7:0] +} + +// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from RAM +void CLCD::mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) { + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_bulk(data, len, padding); + spi_ftdi_deselect(); +} + +// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM +void CLCD::mem_write_bulk (uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding) { + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_bulk(str, len, padding); + spi_ftdi_deselect(); +} + + // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM +void CLCD::mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) { + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_bulk(data, len, padding); + spi_ftdi_deselect(); +} + +// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images) +void CLCD::mem_write_xbm (uint32_t reg_address, progmem_str data, uint16_t len, uint8_t padding) { + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_bulk(data, len, padding); + spi_ftdi_deselect(); +} + +// Write 3-Byte Address, Write 1-Byte Data +void CLCD::mem_write_8 (uint32_t reg_address, uint8_t data) { + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_8(data); + spi_ftdi_deselect(); +} + +// Write 3-Byte Address, Write 2-Bytes Data +void CLCD::mem_write_16 (uint32_t reg_address, uint16_t data) { + using namespace SPI::least_significant_byte_first; + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_32(data); + spi_ftdi_deselect(); +} + +// Write 3-Byte Address, Write 4-Bytes Data +void CLCD::mem_write_32 (uint32_t reg_address, uint32_t data) { + using namespace SPI::least_significant_byte_first; + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_32(data); + spi_ftdi_deselect(); +} + +/******************* FT800/810 Co-processor Commands *********************************/ + +#if FTDI_API_LEVEL == 800 +uint32_t CLCD::CommandFifo::command_write_ptr = 0xFFFFFFFFul; +#endif + +void CLCD::CommandFifo::cmd(uint32_t cmd32) { + write((void*)&cmd32, sizeof(uint32_t)); +} + +void CLCD::CommandFifo::cmd(void* data, uint16_t len) { + write(data, len); +} + +void CLCD::CommandFifo::bgcolor(uint32_t rgb) { + cmd(CMD_BGCOLOR); + cmd(rgb); +} + +void CLCD::CommandFifo::fgcolor(uint32_t rgb) { + cmd(CMD_FGCOLOR); + cmd(rgb); +} + +void CLCD::CommandFifo::gradcolor(uint32_t rgb) { + cmd(CMD_GRADCOLOR); + cmd(rgb); +} + +// This sends the a text command to the command preprocessor, must be followed by str() +void CLCD::CommandFifo::button(int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t option) { + struct { + int32_t type = CMD_BUTTON; + int16_t x; + int16_t y; + int16_t w; + int16_t h; + int16_t font; + uint16_t option; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.h = h; + cmd_data.font = font; + cmd_data.option = option; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +// This sends the a text command to the command preprocessor, must be followed by str() +void CLCD::CommandFifo::text(int16_t x, int16_t y, int16_t font, uint16_t options) { + struct { + int32_t type = CMD_TEXT; + int16_t x; + int16_t y; + int16_t font; + uint16_t options; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.font = font; + cmd_data.options = options; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +// This sends the a toggle command to the command preprocessor, must be followed by str() +void CLCD::CommandFifo::toggle (int16_t x, int16_t y, int16_t w, int16_t font, uint16_t options, bool state) { + struct { + int32_t type = CMD_TOGGLE; + int16_t x; + int16_t y; + int16_t w; + int16_t font; + uint16_t options; + uint16_t state; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.font = font; + cmd_data.options = options; + cmd_data.state = state ? 65535 : 0; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +// This sends the a keys command to the command preprocessor, must be followed by str() +void CLCD::CommandFifo::keys (int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t options) { + struct { + int32_t type = CMD_KEYS; + int16_t x; + int16_t y; + int16_t w; + int16_t h; + int16_t font; + uint16_t options; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.h = h; + cmd_data.font = font; + cmd_data.options = options; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::clock (int16_t x, int16_t y, int16_t r, uint16_t options, int16_t h, int16_t m, int16_t s, int16_t ms) +{ + struct { + int32_t type = CMD_CLOCK; + int16_t x; + int16_t y; + int16_t r; + uint16_t options; + int16_t h; + int16_t m; + int16_t s; + int16_t ms; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.r = r; + cmd_data.options = options; + cmd_data.h = h; + cmd_data.m = m; + cmd_data.s = s; + cmd_data.ms = ms; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::gauge (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range) +{ + struct { + int32_t type = CMD_GAUGE; + int16_t x; + int16_t y; + int16_t r; + uint16_t options; + uint16_t major; + uint16_t minor; + uint16_t val; + uint16_t range; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.r = r; + cmd_data.options = options; + cmd_data.major = major; + cmd_data.minor = minor; + cmd_data.val = val; + cmd_data.range = range; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::dial (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val) +{ + struct { + int32_t type = CMD_DIAL; + int16_t x; + int16_t y; + int16_t r; + uint16_t options; + uint16_t val; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.r = r; + cmd_data.options = options; + cmd_data.val = val; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::scrollbar (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range) { + struct { + int32_t type = CMD_SCROLLBAR; + int16_t x; + int16_t y; + int16_t w; + uint16_t h; + uint16_t options; + uint16_t val; + uint16_t size; + uint16_t range; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.h = h; + cmd_data.options = options; + cmd_data.val = val; + cmd_data.size = size; + cmd_data.range = range; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::progress (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range) { + struct { + int32_t type = CMD_PROGRESS; + int16_t x; + int16_t y; + int16_t w; + int16_t h; + uint16_t options; + uint16_t val; + uint16_t range; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.h = h; + cmd_data.options = options; + cmd_data.val = val; + cmd_data.range = range; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::slider (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range) { + struct { + int32_t type = CMD_SLIDER; + int16_t x; + int16_t y; + int16_t w; + int16_t h; + uint16_t options; + uint16_t val; + uint16_t range; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.h = h; + cmd_data.options = options; + cmd_data.val = val; + cmd_data.range = range; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::gradient (int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1) { + struct { + int32_t type = CMD_GRADIENT; + int16_t x0; + int16_t y0; + uint32_t rgb0; + int16_t x1; + int16_t y1; + uint32_t rgb1; + } cmd_data; + + cmd_data.x0 = x0; + cmd_data.y0 = y0; + cmd_data.rgb0 = rgb0; + cmd_data.x1 = x1; + cmd_data.y1 = y1; + cmd_data.rgb1 = rgb1; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::number (int16_t x, int16_t y, int16_t font, uint16_t options, int32_t n) { + struct { + int32_t type = CMD_NUMBER; + int16_t x; + int16_t y; + int16_t font; + uint16_t options; + int16_t n; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.font = font; + cmd_data.options = options; + cmd_data.n = n; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::memzero (uint32_t ptr, uint32_t size) { + struct { + uint32_t type = CMD_MEMZERO; + uint32_t ptr; + uint32_t size; + } cmd_data; + + cmd_data.ptr = ptr; + cmd_data.size = size; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::memset (uint32_t ptr, uint32_t val, uint32_t size) { + struct { + uint32_t type = CMD_MEMSET; + uint32_t ptr; + uint32_t val; + uint32_t size; + } cmd_data; + + cmd_data.ptr = ptr; + cmd_data.val = val; + cmd_data.size = size; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::memcpy (uint32_t dst, uint32_t src, uint32_t size) { + struct { + uint32_t type = CMD_MEMCPY; + uint32_t dst; + uint32_t src; + uint32_t size; + } cmd_data; + + cmd_data.dst = dst; + cmd_data.src = src; + cmd_data.size = size; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::memcrc (uint32_t ptr, uint32_t num, uint32_t result) { + struct { + uint32_t type = CMD_MEMCRC; + uint32_t ptr; + uint32_t num; + uint32_t result; + } cmd_data; + + cmd_data.ptr = ptr; + cmd_data.num = num; + cmd_data.result = result; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::memwrite (uint32_t ptr, uint32_t value) { + struct { + uint32_t type = CMD_MEMWRITE; + uint32_t ptr; + uint32_t num; + uint32_t value; + } cmd_data; + + cmd_data.ptr = ptr; + cmd_data.num = 4; + cmd_data.value = value; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::append (uint32_t ptr, uint32_t size) { + struct { + uint32_t type = CMD_APPEND; + uint32_t ptr; + uint32_t size; + } cmd_data; + + cmd_data.ptr = ptr; + cmd_data.size = size; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::inflate (uint32_t ptr) { + struct { + uint32_t type = CMD_INFLATE; + uint32_t ptr; + } cmd_data; + + cmd_data.ptr = ptr; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::getptr (uint32_t result) { + struct { + uint32_t type = CMD_GETPTR; + uint32_t result; + } cmd_data; + + cmd_data.result = result; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::track(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t tag) { + struct { + uint32_t type = CMD_TRACK; + int16_t x; + int16_t y; + int16_t w; + int16_t h; + int16_t tag; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.h = h; + cmd_data.tag = tag; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::sketch(int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format) { + struct { + uint32_t type = CMD_SKETCH; + int16_t x; + int16_t y; + uint16_t w; + uint16_t h; + uint32_t ptr; + uint16_t format; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.h = h; + cmd_data.ptr = ptr; + cmd_data.format = format; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::snapshot(uint32_t ptr) { + struct { + uint32_t type = CMD_SNAPSHOT; + uint32_t ptr; + } cmd_data; + + cmd_data.ptr = ptr; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::spinner(int16_t x, int16_t y, uint16_t style, uint16_t scale) { + struct { + uint32_t type = CMD_SPINNER; + uint16_t x; + uint16_t y; + uint16_t style; + uint16_t scale; + } cmd_data; + + cmd_data.x = x; + cmd_data.y = y; + cmd_data.style = style; + cmd_data.scale = scale; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::loadimage(uint32_t ptr, uint32_t options) { + struct { + uint32_t type = CMD_LOADIMAGE; + uint32_t ptr; + uint32_t options; + } cmd_data; + + cmd_data.ptr = ptr; + cmd_data.options = options; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::getprops (uint32_t ptr, uint32_t width, uint32_t height) { + struct { + uint32_t type = CMD_GETPROPS; + uint32_t ptr; + uint32_t width; + uint32_t height; + } cmd_data; + + cmd_data.ptr = ptr; + cmd_data.width = width; + cmd_data.height = height; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::scale(int32_t sx, int32_t sy) { + struct { + uint32_t type = CMD_SCALE; + int32_t sx; + int32_t sy; + } cmd_data; + + cmd_data.sx = sx; + cmd_data.sy = sy; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::rotate(int32_t a) { + struct { + uint32_t type = CMD_ROTATE; + int32_t a; + } cmd_data; + + cmd_data.a = a; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +void CLCD::CommandFifo::translate (int32_t tx, int32_t ty) { + struct { + uint32_t type = CMD_TRANSLATE; + int32_t tx; + int32_t ty; + } cmd_data; + + cmd_data.tx = tx; + cmd_data.ty = ty; + + cmd( &cmd_data, sizeof(cmd_data) ); +} + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::setbase (uint8_t base) { + struct { + int32_t type = CMD_SETBASE; + uint32_t base; + } cmd_data; + + cmd_data.base = base; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::setbitmap(uint32_t addr, uint16_t fmt, uint16_t w, uint16_t h) { + struct { + uint32_t type = CMD_SETBITMAP; + uint32_t addr; + uint16_t fmt; + uint16_t w; + uint16_t h; + uint16_t dummy; + } cmd_data; + + cmd_data.addr = addr; + cmd_data.fmt = fmt; + cmd_data.w = w; + cmd_data.h = h; + cmd_data.dummy = 0; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::snapshot2(uint32_t format, uint32_t ptr, int16_t x, int16_t y, uint16_t w, uint16_t h) { + struct { + uint32_t type = CMD_SNAPSHOT2; + uint32_t format; + uint32_t ptr; + int16_t x; + int16_t y; + uint16_t w; + uint16_t h; + } cmd_data; + + cmd_data.format = format; + cmd_data.ptr = ptr; + cmd_data.x = x; + cmd_data.y = y; + cmd_data.w = w; + cmd_data.h = h; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::mediafifo(uint32_t ptr, uint32_t size) { + struct { + uint32_t type = CMD_MEDIAFIFO; + uint32_t ptr; + uint32_t size; + } cmd_data; + + cmd_data.ptr = ptr; + cmd_data.size = size; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::videostart() { + cmd( CMD_VIDEOSTART ); +} +#endif + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::videoframe(uint32_t dst, uint32_t ptr) { + struct { + uint32_t type = CMD_VIDEOFRAME; + uint32_t dst; + uint32_t ptr; + } cmd_data; + + cmd_data.dst = dst; + cmd_data.ptr = ptr; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::playvideo(uint32_t options) { + struct { + uint32_t type = CMD_PLAYVIDEO; + uint32_t options; + } cmd_data; + + cmd_data.options = options; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::setrotate (uint8_t rotation) { + struct { + uint32_t type = CMD_SETROTATE; + uint32_t rotation; + } cmd_data; + + cmd_data.rotation = rotation; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::romfont (uint8_t font, uint8_t romslot) { + struct { + uint32_t type = CMD_ROMFONT; + uint32_t font; + uint32_t romslot; + } cmd_data; + + cmd_data.font = font; + cmd_data.romslot = romslot; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + +/**************************** FT800/810 Co-Processor Command FIFO ****************************/ + +bool CLCD::CommandFifo::is_processing() { + return (mem_read_32(REG::CMD_READ) & 0x0FFF) != (mem_read_32(REG::CMD_WRITE) & 0x0FFF); +} + +bool CLCD::CommandFifo::has_fault() { + uint16_t Cmd_Read_Reg = mem_read_32(REG::CMD_READ) & 0x0FFF; + return Cmd_Read_Reg == 0x0FFF; +} + +#if FTDI_API_LEVEL == 800 +void CLCD::CommandFifo::start() { + if (command_write_ptr == 0xFFFFFFFFul) { + command_write_ptr = mem_read_32(REG::CMD_WRITE) & 0x0FFF; + } +} + +void CLCD::CommandFifo::execute() { + if (command_write_ptr != 0xFFFFFFFFul) { + mem_write_32(REG::CMD_WRITE, command_write_ptr); + } +} + +void CLCD::CommandFifo::reset() { + safe_delay(100); + mem_write_32(REG::CPURESET, 0x00000001); + mem_write_32(REG::CMD_WRITE, 0x00000000); + mem_write_32(REG::CMD_READ, 0x00000000); + mem_write_32(REG::CPURESET, 0x00000000); + safe_delay(300); + command_write_ptr = 0xFFFFFFFFul; +}; + +template bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len) { + const char *ptr = (const char*)data; + uint32_t bytes_tail, bytes_head; + uint32_t command_read_ptr; + + #if ENABLED(TOUCH_UI_DEBUG) + if (command_write_ptr == 0xFFFFFFFFul) { + SERIAL_ECHO_MSG("Attempt to write to FIFO before CommandFifo::Cmd_Start()."); + } + #endif + + /* Wait until there is enough space in the circular buffer for the transfer */ + do { + command_read_ptr = mem_read_32(REG::CMD_READ) & 0x0FFF; + if (command_read_ptr <= command_write_ptr) { + bytes_tail = 4096U - command_write_ptr; + bytes_head = command_read_ptr; + } else { + bytes_tail = command_read_ptr - command_write_ptr; + bytes_head = 0; + } + // Check for faults which can lock up the command processor + if (has_fault()) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHOLNPGM("Fault waiting for space in the command processor"); + #endif + return false; + } + } while ((bytes_tail + bytes_head) < len); + + /* Write as many bytes as possible following REG::CMD_WRITE */ + uint16_t bytes_to_write = min(len, bytes_tail); + mem_write_bulk (MAP::RAM_CMD + command_write_ptr, T(ptr), bytes_to_write); + command_write_ptr += bytes_to_write; + ptr += bytes_to_write; + len -= bytes_to_write; + + if (len > 0) { + /* Write remaining bytes at start of circular buffer */ + mem_write_bulk (MAP::RAM_CMD, T(ptr), len); + command_write_ptr = len; + } + + if (command_write_ptr == 4096U) { + command_write_ptr = 0; + } + return true; +} + +// Writes len bytes into the FIFO, if len is not +// divisible by four, zero bytes will be written +// to align to the boundary. + +template bool CLCD::CommandFifo::write(T data, uint16_t len) { + const uint8_t padding = MULTIPLE_OF_4(len) - len; + + uint8_t pad_bytes[] = {0, 0, 0, 0}; + return _write_unaligned(data, len) && + _write_unaligned(pad_bytes, padding); +} +#else +void CLCD::CommandFifo::start() { +} + +void CLCD::CommandFifo::execute() { +} + +void CLCD::CommandFifo::reset() { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHOLNPGM("Resetting command processor"); + #endif + safe_delay(100); + mem_write_32(REG::CPURESET, 0x00000001); + mem_write_32(REG::CMD_WRITE, 0x00000000); + mem_write_32(REG::CMD_READ, 0x00000000); + mem_write_32(REG::CPURESET, 0x00000000); + safe_delay(300); +}; + +// Writes len bytes into the FIFO, if len is not +// divisible by four, zero bytes will be written +// to align to the boundary. + +template bool CLCD::CommandFifo::write(T data, uint16_t len) { + const uint8_t padding = MULTIPLE_OF_4(len) - len; + + if (has_fault()) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHOLNPGM("Faulted... ignoring write."); + #endif + return false; + } + // The FT810 provides a special register that can be used + // for writing data without us having to do our own FIFO + // management. + uint16_t Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; + if (Command_Space < (len + padding)) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR("Waiting for ", len + padding); + SERIAL_ECHOLNPAIR(" bytes in command queue, now free: ", Command_Space); + #endif + do { + Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; + if (has_fault()) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHOLNPGM("... fault"); + #endif + return false; + } + } while (Command_Space < len + padding); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHOLNPGM("... done"); + #endif + } + mem_write_bulk(REG::CMDB_WRITE, data, len, padding); + return true; +} +#endif + +template bool CLCD::CommandFifo::write(const void*, uint16_t); +template bool CLCD::CommandFifo::write(progmem_str, uint16_t); + +// CO_PROCESSOR COMMANDS + +void CLCD::CommandFifo::str(const char * data) { + write(data, strlen(data)+1); +} + +void CLCD::CommandFifo::str(progmem_str data) { + write(data, strlen_P((const char*)data)+1); +} + +/******************* LCD INITIALIZATION ************************/ + +void CLCD::init() { + spi_init(); // Set Up I/O Lines for SPI and FT800/810 Control + ftdi_reset(); // Power down/up the FT8xx with the apropriate delays + + if (Use_Crystal == 1) { + host_cmd(CLKEXT, 0); + } + else { + host_cmd(CLKINT, 0); + } + + host_cmd(ACTIVE, 0); // Activate the System Clock + + /* read the device-id until it returns 0x7c or times out, should take less than 150ms */ + uint8_t counter; + for(counter = 0; counter < 250; counter++) { + uint8_t device_id = mem_read_8(REG::ID); // Read Device ID, Should Be 0x7C; + if (device_id == 0x7c) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("FTDI chip initialized "); + #endif + break; + } + else { + delay(1); + } + if (counter == 249) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("Timeout waiting for device ID, should be 124, got ", device_id); + #endif + } + } + + mem_write_8(REG::PWM_DUTY, 0); // turn off Backlight, Frequency already is set to 250Hz default + + /* Configure the FT8xx Registers */ + mem_write_16(REG::HCYCLE, FTDI::Hcycle); + mem_write_16(REG::HOFFSET, FTDI::Hoffset); + mem_write_16(REG::HSYNC0, FTDI::Hsync0); + mem_write_16(REG::HSYNC1, FTDI::Hsync1); + mem_write_16(REG::VCYCLE, FTDI::Vcycle); + mem_write_16(REG::VOFFSET, FTDI::Voffset); + mem_write_16(REG::VSYNC0, FTDI::Vsync0); + mem_write_16(REG::VSYNC1, FTDI::Vsync1); + mem_write_16(REG::HSIZE, FTDI::Hsize); + mem_write_16(REG::VSIZE, FTDI::Vsize); + mem_write_8(REG::SWIZZLE, FTDI::Swizzle); + mem_write_8(REG::PCLK_POL, FTDI::Pclkpol); + mem_write_8(REG::CSPREAD, FTDI::CSpread); + + /* write a basic display-list to get things started */ + mem_write_32(MAP::RAM_DL, DL::CLEAR_COLOR_RGB); + mem_write_32(MAP::RAM_DL + 4, (DL::CLEAR | 0x07)); /* clear color, stencil and tag buffer */ + mem_write_32(MAP::RAM_DL + 8, DL::DL_DISPLAY); /* end of display list */ + + mem_write_8(REG::DLSWAP, 0x02); // activate display list, Bad Magic Cookie 2 = switch to new list after current frame is scanned out + + //mem_write_8(REG::TOUCH_MODE, 0x03); // Configure the Touch Screen, Bad Magic Cookie, 3 = CONTINUOUS = Reset Default + //mem_write_8(REG::TOUCH_ADC_MODE, 0x01); // Bad Magic Cookie, 1 = single touch = Reset Default + //mem_write_8(REG::TOUCH_OVERSAMPLE, 0x0F); // Reset Default = 7 - why 15? + mem_write_16(REG::TOUCH_RZTHRESH, touch_threshold); /* setup touch sensitivity */ + mem_write_8(REG::VOL_SOUND, 0x00); // Turn Synthesizer Volume Off + + /* turn on the display by setting DISP high */ + /* turn on the Audio Amplifier by setting GPIO_1 high for the select few modules supporting this */ + /* no need to use GPIOX here since DISP/GPIO_0 and GPIO_1 are on REG::GPIO for FT81x as well */ + if (GPIO_1_Audio_Shutdown) { + mem_write_8(REG::GPIO_DIR, GPIO_DISP | GPIO_GP1); + mem_write_8(REG::GPIO, GPIO_DISP | GPIO_GP1); + } else if (GPIO_0_Audio_Enable) { + mem_write_8(REG::GPIO_DIR, GPIO_DISP | GPIO_GP0); + mem_write_8(REG::GPIO, GPIO_DISP | GPIO_GP0); + } + else { + mem_write_8(REG::GPIO, GPIO_DISP); /* REG::GPIO_DIR is set to output for GPIO_DISP by default */ + } + + mem_write_8(REG::PCLK, Pclk); // Turns on Clock by setting PCLK Register to the value necessary for the module + + mem_write_16(REG::PWM_HZ, 0x00FA); + + // Turning off dithering seems to help prevent horizontal line artifacts on certain colors + mem_write_8(REG::DITHER, 0); + + // Initialize the command FIFO + CommandFifo::reset(); + + default_touch_transform(); + default_display_orientation(); +} + +void CLCD::default_touch_transform() { + // Set Initial Values for Touch Transform Registers + mem_write_32(REG::ROTATE, 0); + mem_write_32(REG::TOUCH_TRANSFORM_A, FTDI::default_transform_a); + mem_write_32(REG::TOUCH_TRANSFORM_B, FTDI::default_transform_b); + mem_write_32(REG::TOUCH_TRANSFORM_C, FTDI::default_transform_c); + mem_write_32(REG::TOUCH_TRANSFORM_D, FTDI::default_transform_d); + mem_write_32(REG::TOUCH_TRANSFORM_E, FTDI::default_transform_e); + mem_write_32(REG::TOUCH_TRANSFORM_F, FTDI::default_transform_f); +} + +void CLCD::default_display_orientation() { + #if FTDI_API_LEVEL >= 810 + // Set the initial display orientation. On the FT810, we use the command + // processor to do this since it will also update the transform matrices. + if (FTDI::ftdi_chip >= 810) { + CommandFifo cmd; + cmd.setrotate(0 + #if ENABLED(TOUCH_UI_MIRRORED) + + 4 + #endif + #if ENABLED(TOUCH_UI_PORTRAIT) + + 2 + #endif + #if ENABLED(TOUCH_UI_INVERTED) + + 1 + #endif + ); + cmd.execute(); + } + else { + #if ENABLED(TOUCH_UI_INVERTED) + mem_write_32(REG::ROTATE, 1); + #endif + } + #elif ANY(TOUCH_UI_PORTRAIT, TOUCH_UI_MIRRORED) + #error PORTRAIT or MIRRORED orientation not supported on the FT800 + #elif ENABLED(TOUCH_UI_INVERTED) + mem_write_32(REG::ROTATE, 1); + #endif +} + +#endif // FTDI_BASIC diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h new file mode 100644 index 000000000000..0426911edb27 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h @@ -0,0 +1,260 @@ +/**************** + * commands.cpp * + ****************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + + /**************************************************************************** + * FUNCTION MAP * + * * + * SPI and FT800/810 Commands * + * * + * CLCD::spi_select() Set CS line to 0 * + * CLCD::spi_deselect() Set CS Line to 1 * + * CLCD::reset() Toggle FT800/810 Power Down Line 50 ms * + * CLCD::spi_init() Configure I/O Lines for SPI * + * CLCD::spi_transfer() Send/Receive 1 SPI Byte * + * CLCD::init() Set FT800/810 Registers * + * CLCD::enable() Turn On FT800/810 PCLK * + * CLCD::disable() Turn Off FT8880/810 PCLK * + * CLCD::set_backlight() Set LCD Backlight Level * + * * + * MEMORY READ FUNCTIONS * + * * + * CLCD::mem_read_addr() Send 32-Bit Address * + * CLCD::mem_read_8() Read 1 Byte * + * CLCD::mem_read_16() Read 2 Bytes * + * CLCD::mem_read_32() Read 4 Bytes * + * * + * MEMORY WRITE FUNCTIONS * + * * + * CLCD::mem_write_addr() Send 24-Bit Address * + * CLCD::mem_write_8() Write 1 Byte * + * CLCD::mem_write_16() Write 2 Bytes * + * CLCD::mem_write_32() Write 4 Bytes * + * * + * HOST COMMAND FUNCTION * + * * + * CLCD::host_cmd() Send 24-Bit Host Command * + * * + * COMMAND BUFFER FUNCTIONS * + * * + * CLCD::cmd() Send 32-Bit Value(4 Bytes)CMD Buffer * + * CLCD::cmd() Send Data Structure with 32-Bit Cmd * + * CLCD::str() Send Text String in 32-Bit Multiples * + + * * + * FT800/810 GRAPHIC COMMANDS * + * * + * class CLCD:CommandFifo {} Class to control Cmd FIFO * + + * CommandFifo::start() Wait for CP finish - Set FIFO Ptr * + * CommandFifo::execute() Set REG_CMD_WRITE and start CP * + * CommandFifo::reset() Set Cmd Buffer Pointers to 0 * + * + * CommandFifo::fgcolor Set Graphic Item Foreground Color * + * CommandFifo::bgcolor Set Graphic Item Background Color * + * CommandFifo::begin() Begin Drawing a Primative * + * CommandFifo::mem_copy() Copy a Block of Memory * + * CommandFifo::append() Append Commands to Current DL * + * CommandFifo::gradient_color() Set 3D Button Highlight Color * + * CommandFifo::button() Draw Button with Bulk Write * + * CommandFifo::text() Draw Text with Bulk Write * + *****************************************************************************/ + + /************************************************** + * RAM_G Graphics RAM Allocation * + * * + * Address Use * + * * + * 8000 Extruder Bitmap * + * 8100 Bed Heat Bitmap * + * 8200 Fan Bitmap * + * 8300 Thumb Drive Symbol Bitmap * + * 35000 Static DL Space (FT800) * + * F5000 Static DL Space (FT810) * + **************************************************/ + +#pragma once + +typedef const __FlashStringHelper *progmem_str; + +class UIStorage; + +class CLCD { + friend class UIStorage; + + public: + typedef FTDI::ftdi_registers REG; + typedef FTDI::ftdi_memory_map MAP; + + static void spi_write_addr (uint32_t reg_address); + static void spi_read_addr (uint32_t reg_address); + + static uint8_t mem_read_8 (uint32_t reg_address); + static uint16_t mem_read_16 (uint32_t reg_address); + static uint32_t mem_read_32 (uint32_t reg_address); + static void mem_read_bulk (uint32_t reg_address, uint8_t *data, uint16_t len); + + static void mem_write_8 (uint32_t reg_address, uint8_t w_data); + static void mem_write_16 (uint32_t reg_address, uint16_t w_data); + static void mem_write_32 (uint32_t reg_address, uint32_t w_data); + static void mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); + static void mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); + static void mem_write_bulk (uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding = 0); + static void mem_write_xbm (uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding = 0); + + public: + class CommandFifo; + class FontMetrics; + + static void init(); + static void default_touch_transform(); + static void default_display_orientation(); + static void turn_on_backlight(); + static void enable(); + static void disable(); + static void set_brightness (uint8_t brightness); + static uint8_t get_brightness(); + static void host_cmd (unsigned char host_command, unsigned char byte2); + + static void get_font_metrics (uint8_t font, struct FontMetrics &fm); + static uint16_t get_text_width(const uint8_t font, const char *str); + static uint16_t get_text_width_P(const uint8_t font, const char *str); + + static uint8_t get_tag () {return mem_read_8(REG::TOUCH_TAG);} + static bool is_touching () {return (mem_read_32(REG::TOUCH_DIRECT_XY) & 0x80000000) == 0;} + + static uint8_t get_tracker (uint16_t &value) { + uint32_t tracker = mem_read_32(REG::TRACKER); + value = tracker >> 16; + return tracker & 0xFF; + } +}; + +/*************************** FT800/810 Font Metrics ****************************/ + +class CLCD::FontMetrics { + public: + uint8_t char_widths[128]; + uint32_t format; + uint32_t stride; + uint32_t width; + uint32_t height; + uint32_t ptr; + + FontMetrics() {} + FontMetrics(uint8_t font) {load(font);} + + void load(uint8_t font); + + // Returns width of string, up to a maximum of n characters. + uint16_t get_text_width(const char *str, size_t n = SIZE_MAX) const; + uint16_t get_text_width(progmem_str str, size_t n = SIZE_MAX) const; +}; + +/******************* FT800/810 Graphic Commands *********************************/ + +class CLCD::CommandFifo { + protected: + #if FTDI_API_LEVEL >= 810 + uint32_t getRegCmdBSpace(); + #else + static uint32_t command_write_ptr; + template bool _write_unaligned(T data, uint16_t len); + #endif + void start(); + + public: + template bool write(T data, uint16_t len); + + public: + CommandFifo() {start();} + + static void reset(); + static bool is_processing(); + static bool has_fault(); + + void execute(); + + void cmd(uint32_t cmd32); + void cmd(void* data, uint16_t len); + + void dlstart() {cmd(FTDI::CMD_DLSTART);} + void swap() {cmd(FTDI::CMD_SWAP);} + void coldstart() {cmd(FTDI::CMD_COLDSTART);} + void screensaver() {cmd(FTDI::CMD_SCREENSAVER);} + void stop() {cmd(FTDI::CMD_STOP);} + void loadidentity() {cmd(FTDI::CMD_LOADIDENTITY);} + void setmatrix() {cmd(FTDI::CMD_SETMATRIX);} + + void fgcolor (uint32_t rgb); + void bgcolor (uint32_t rgb); + void gradcolor (uint32_t rgb); + + void track (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t tag); + void clock (int16_t x, int16_t y, int16_t r, uint16_t options, int16_t h, int16_t m, int16_t s, int16_t ms); + void gauge (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range); + void dial (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val); + void slider (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range); + void progress (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range); + void scrollbar (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range); + void number (int16_t x, int16_t y, int16_t font, uint16_t options, int32_t n); + void spinner (int16_t x, int16_t y, uint16_t style, uint16_t scale); + void sketch (int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format); + void gradient (int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1); + void snapshot (uint32_t ptr); + void loadimage (uint32_t ptr, uint32_t options); + void getprops (uint32_t ptr, uint32_t width, uint32_t height); + + void scale (int32_t sx, int32_t sy); + void rotate (int32_t a); + void translate (int32_t tx, int32_t ty); + + #if FTDI_API_LEVEL >= 810 + void setbase (uint8_t base); + void setrotate (uint8_t rotation); + void setbitmap (uint32_t ptr, uint16_t fmt, uint16_t w, uint16_t h); + void snapshot2 (uint32_t fmt, uint32_t ptr, int16_t x, int16_t y, uint16_t w, uint16_t h); + void mediafifo (uint32_t ptr, uint32_t size); + void playvideo (uint32_t options); + void videostart(); + void videoframe(uint32_t dst, uint32_t ptr); + void romfont (uint8_t font, uint8_t romslot); + #endif + + // All the following must be followed by str() + void text (int16_t x, int16_t y, int16_t font, uint16_t options); + void button (int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t option); + void toggle (int16_t x, int16_t y, int16_t w, int16_t font, uint16_t options, bool state); + void keys (int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t options); + + // Sends the string portion of text, button, toggle and keys. + void str (const char * data); + void str (progmem_str data); + + void memzero (uint32_t ptr, uint32_t size); + void memset (uint32_t ptr, uint32_t value, uint32_t size); + void memcpy (uint32_t dst, uint32_t src, uint32_t size); + void memcrc (uint32_t ptr, uint32_t num, uint32_t result); + void memwrite (uint32_t ptr, uint32_t value); + void inflate (uint32_t ptr); + void getptr (uint32_t result); + void append (uint32_t ptr, uint32_t size); +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h new file mode 100644 index 000000000000..5f60881bdd0e --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h @@ -0,0 +1,414 @@ +/*************** + * constants.h * + ***************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/**************************************************************************** + * This header defines constants and commands for the FTDI FT810 LCD Driver * + * chip. * + ****************************************************************************/ + +#pragma once + +// OPTIONS + +namespace FTDI { + constexpr uint16_t OPT_3D = 0x0000; + constexpr uint16_t OPT_RGB565 = 0x0000; + constexpr uint16_t OPT_MONO = 0x0001; + constexpr uint16_t OPT_NODL = 0x0002; + constexpr uint16_t OPT_FLAT = 0x0100; + constexpr uint16_t OPT_SIGNED = 0x0100; + constexpr uint16_t OPT_CENTERX = 0x0200; + constexpr uint16_t OPT_CENTERY = 0x0400; + constexpr uint16_t OPT_CENTER = (OPT_CENTERX | OPT_CENTERY); + constexpr uint16_t OPT_RIGHTX = 0x0800; + constexpr uint16_t OPT_NOBACK = 0x1000; + constexpr uint16_t OPT_NOTICKS = 0x2000; + constexpr uint16_t OPT_NOHM = 0x4000; + constexpr uint16_t OPT_NOPOINTER = 0x4000; + constexpr uint16_t OPT_NOSECS = 0x8000; + constexpr uint16_t OPT_NOHANDS = (OPT_NOPOINTER | OPT_NOSECS); +} + +namespace FTDI_FT810 { + constexpr uint16_t OPT_NOTEAR = 0x0004; + constexpr uint16_t OPT_FULLSCREEN = 0x0008; + constexpr uint16_t OPT_MEDIAFIFO = 0x0010; + constexpr uint16_t OPT_SOUND = 0x0020; +} + +// GPIO Bits + +namespace FTDI { + constexpr uint8_t GPIO_GP0 = 1 << 0; + constexpr uint8_t GPIO_GP1 = 1 << 1; + constexpr uint8_t GPIO_DISP = 1 << 7; +} + +namespace FTDI_FT810 { + constexpr uint16_t GPIOX_GP0 = 1 << 0; + constexpr uint16_t GPIOX_GP1 = 1 << 1; + constexpr uint16_t GPIOX_DISP = 1 << 15; +} + +// HOST COMMANDS + +namespace FTDI { + constexpr uint8_t ACTIVE = 0x00; + constexpr uint8_t STANDBY = 0x41; + constexpr uint8_t SLEEP = 0x42; + constexpr uint8_t PWRDOWN = 0x50; + constexpr uint8_t CLKEXT = 0x44; + constexpr uint8_t CLKINT = 0x48; + constexpr uint8_t CORESET = 0x68; +} + +namespace FTDI_FT800 { + constexpr uint8_t CLK48M = 0x62; + constexpr uint8_t CLK36M = 0x61; +} + +namespace FTDI_FT810 { + constexpr uint8_t CLKSEL = 0x61; +} + +// DISPLAY LIST COMMANDS + +namespace FTDI { + constexpr uint8_t ARGB1555 = 0; + constexpr uint8_t L1 = 1; + constexpr uint8_t L4 = 2; + constexpr uint8_t L8 = 3; + constexpr uint8_t RGB332 = 4; + constexpr uint8_t ARGB2 = 5; + constexpr uint8_t ARGB4 = 6; + constexpr uint8_t RGB565 = 7; + constexpr uint8_t PALETTED = 8; + constexpr uint8_t TEXT8X8 = 9; + constexpr uint8_t TEXTVGA = 10; + constexpr uint8_t BARGRAPH = 11; + + constexpr uint8_t ALPHA_FUNC_NEVER = 0; + constexpr uint8_t ALPHA_FUNC_LESS = 1; + constexpr uint8_t ALPHA_FUNC_LEQUAL = 2; + constexpr uint8_t ALPHA_FUNC_GREATER = 3; + constexpr uint8_t ALPHA_FUNC_GEQUAL = 4; + constexpr uint8_t ALPHA_FUNC_EQUAL = 5; + constexpr uint8_t ALPHA_FUNC_NOTEQUAL = 6; + constexpr uint8_t ALPHA_FUNC_ALWAYS = 7; + + constexpr uint8_t NEAREST = 0; + constexpr uint8_t BILINEAR = 1; + constexpr uint8_t BORDER = 0; + constexpr uint8_t REPEAT = 1; + + constexpr uint8_t BLEND_FUNC_ZERO = 0; + constexpr uint8_t BLEND_FUNC_ONE = 1; + constexpr uint8_t BLEND_FUNC_SRC_ALPHA = 2; + constexpr uint8_t BLEND_FUNC_DST_ALPHA = 3; + constexpr uint8_t BLEND_FUNC_ONE_MINUS_SRC_ALPHA = 4; + constexpr uint8_t BLEND_FUNC_ONE_MINUS_DST_ALPHA = 5; + + constexpr uint32_t COLOR_MASK_RED = 8; + constexpr uint32_t COLOR_MASK_GRN = 4; + constexpr uint32_t COLOR_MASK_BLU = 2; + constexpr uint32_t COLOR_MASK_ALPHA = 1; + + constexpr uint8_t STENCIL_FUNC_NEVER = 0; + constexpr uint8_t STENCIL_FUNC_LESS = 1; + constexpr uint8_t STENCIL_FUNC_LEQUAL = 2; + constexpr uint8_t STENCIL_FUNC_GREATER = 3; + constexpr uint8_t STENCIL_FUNC_GEQUAL = 4; + constexpr uint8_t STENCIL_FUNC_EQUAL = 5; + constexpr uint8_t STENCIL_FUNC_NOTEQUAL = 6; + constexpr uint8_t STENCIL_FUNC_ALWAYS = 7; + + constexpr uint8_t STENCIL_OP_ZERO = 0; + constexpr uint8_t STENCIL_OP_KEEP = 1; + constexpr uint8_t STENCIL_OP_REPLACE = 2; + constexpr uint8_t STENCIL_OP_INCR = 3; + constexpr uint8_t STENCIL_OP_DECR = 4; + constexpr uint8_t STENCIL_OP_INVERT = 5; + + typedef enum : uint32_t { + BITMAPS = 1, + POINTS = 2, + LINES = 3, + LINE_STRIP = 4, + EDGE_STRIP_R = 5, + EDGE_STRIP_L = 6, + EDGE_STRIP_A = 7, + EDGE_STRIP_B = 8, + RECTS = 9 + } begin_t; +} + +namespace FTDI_FT800_DL { + constexpr uint32_t ALPHA_FUNC = 0x09000000; + constexpr uint32_t BEGIN = 0x1F000000; + constexpr uint32_t BITMAP_HANDLE = 0x05000000; + constexpr uint32_t BITMAP_LAYOUT = 0x07000000; + constexpr uint32_t BITMAP_SIZE = 0x08000000; + constexpr uint32_t BITMAP_SOURCE = 0x01000000; + constexpr uint32_t BITMAP_TRANSFORM_A = 0x15000000; + constexpr uint32_t BITMAP_TRANSFORM_B = 0x16000000; + constexpr uint32_t BITMAP_TRANSFORM_C = 0x17000000; + constexpr uint32_t BITMAP_TRANSFORM_D = 0x18000000; + constexpr uint32_t BITMAP_TRANSFORM_E = 0x19000000; + constexpr uint32_t BITMAP_TRANSFORM_F = 0x1A000000; + constexpr uint32_t BLEND_FUNC = 0x0B000000; + constexpr uint32_t CALL = 0x1D000000; + constexpr uint32_t CELL = 0x06000000; + constexpr uint32_t CLEAR = 0x26000000; + constexpr uint32_t CLEAR_COLOR_BUFFER = 0x00000004; + constexpr uint32_t CLEAR_STENCIL_BUFFER = 0x00000002; + constexpr uint32_t CLEAR_TAG_BUFFER = 0x00000001; + constexpr uint32_t CLEAR_COLOR_A = 0x0F000000; + constexpr uint32_t CLEAR_COLOR_RGB = 0x02000000; + constexpr uint32_t CLEAR_STENCIL = 0x11000000; + constexpr uint32_t CLEAR_TAG = 0x12000000; + constexpr uint32_t COLOR_A = 0x10000000; + constexpr uint32_t COLOR_MASK = 0x20000000; + constexpr uint32_t COLOR_RGB = 0x04000000; + constexpr uint32_t DL_DISPLAY = 0x00000000; + constexpr uint32_t END = 0x21000000; + constexpr uint32_t JUMP = 0x1E000000; + constexpr uint32_t LINE_WIDTH = 0x0E000000; + constexpr uint32_t MACRO = 0x25000000; + constexpr uint32_t POINT_SIZE = 0x0D000000; + constexpr uint32_t RESTORE_CONTEXT = 0x23000000; + constexpr uint32_t RETURN = 0x24000000; + constexpr uint32_t SAVE_CONTEXT = 0x22000000; + constexpr uint32_t SCISSOR_SIZE = 0x1C000000; + constexpr uint32_t SCISSOR_XY = 0x1B000000; + constexpr uint32_t STENCIL_FUNC = 0x0A000000; + constexpr uint32_t STENCIL_MASK = 0x13000000; + constexpr uint32_t STENCIL_OP = 0x0C000000; + constexpr uint32_t TAG = 0x03000000; + constexpr uint32_t TAG_MASK = 0x14000000; + constexpr uint32_t VERTEX2F = 0x40000000; + constexpr uint32_t VERTEX2II = 0x80000000; +} + +namespace FTDI_FT810_DL { + constexpr uint32_t NOP = 0x25000000; + constexpr uint32_t BITMAP_LAYOUT_H = 0x28000000; + constexpr uint32_t BITMAP_SIZE_H = 0x29000000; + constexpr uint32_t VERTEX_FORMAT = 0x27000000; + constexpr uint32_t VERTEX_TRANSLATE_X = 0x2B000000; + constexpr uint32_t VERTEX_TRANSLATE_Y = 0x2C000000; +} + +// CO-PROCESSOR ENGINE COMMANDS +namespace FTDI { + constexpr uint32_t CMD_DLSTART = 0xFFFFFF00; + constexpr uint32_t CMD_SWAP = 0xFFFFFF01; + constexpr uint32_t CMD_COLDSTART = 0xFFFFFF32; + constexpr uint32_t CMD_INTERRUPT = 0xFFFFFF02; + constexpr uint32_t CMD_APPEND = 0xFFFFFF1E; + constexpr uint32_t CMD_REGREAD = 0xFFFFFF19; + constexpr uint32_t CMD_MEMWRITE = 0xFFFFFF1A; + constexpr uint32_t CMD_INFLATE = 0xFFFFFF22; + constexpr uint32_t CMD_LOADIMAGE = 0xFFFFFF24; + constexpr uint32_t CMD_MEMCRC = 0xFFFFFF18; + constexpr uint32_t CMD_MEMZERO = 0xFFFFFF1C; + constexpr uint32_t CMD_MEMSET = 0xFFFFFF1B; + constexpr uint32_t CMD_MEMCPY = 0xFFFFFF1D; + constexpr uint32_t CMD_BUTTON = 0xFFFFFF0D; + constexpr uint32_t CMD_CLOCK = 0xFFFFFF14; + constexpr uint32_t CMD_FGCOLOR = 0xFFFFFF0A; + constexpr uint32_t CMD_BGCOLOR = 0xFFFFFF09; + constexpr uint32_t CMD_GRADCOLOR = 0xFFFFFF34; + constexpr uint32_t CMD_GAUGE = 0xFFFFFF13; + constexpr uint32_t CMD_GRADIENT = 0xFFFFFF0B; + constexpr uint32_t CMD_KEYS = 0xFFFFFF0E; + constexpr uint32_t CMD_PROGRESS = 0xFFFFFF0F; + constexpr uint32_t CMD_SCROLLBAR = 0xFFFFFF11; + constexpr uint32_t CMD_SLIDER = 0xFFFFFF10; + constexpr uint32_t CMD_DIAL = 0xFFFFFF2D; + constexpr uint32_t CMD_TOGGLE = 0xFFFFFF12; + constexpr uint32_t CMD_TEXT = 0xFFFFFF0C; + constexpr uint32_t CMD_NUMBER = 0xFFFFFF2E; + constexpr uint32_t CMD_LOADIDENTITY = 0xFFFFFF26; + constexpr uint32_t CMD_SETMATRIX = 0xFFFFFF2A; + constexpr uint32_t CMD_GETMATRIX = 0xFFFFFF33; + constexpr uint32_t CMD_GETPTR = 0xFFFFFF23; + constexpr uint32_t CMD_GETPROPS = 0xFFFFFF25; + constexpr uint32_t CMD_SCALE = 0xFFFFFF28; + constexpr uint32_t CMD_ROTATE = 0xFFFFFF29; + constexpr uint32_t CMD_TRANSLATE = 0xFFFFFF27; + constexpr uint32_t CMD_CALIBRATE = 0xFFFFFF15; + constexpr uint32_t CMD_SPINNER = 0xFFFFFF16; + constexpr uint32_t CMD_SCREENSAVER = 0xFFFFFF2F; + constexpr uint32_t CMD_SKETCH = 0xFFFFFF30; + constexpr uint32_t CMD_STOP = 0xFFFFFF17; + constexpr uint32_t CMD_SETFONT = 0xFFFFFF2B; + constexpr uint32_t CMD_TRACK = 0xFFFFFF2C; + constexpr uint32_t CMD_SNAPSHOT = 0xFFFFFF1F; + constexpr uint32_t CMD_LOGO = 0xFFFFFF31; +} + +namespace FTDI_FT810 { + constexpr uint32_t CMD_SETROTATE = 0xFFFFFF36; + constexpr uint32_t CMD_SNAPSHOT2 = 0xFFFFFF37; + constexpr uint32_t CMD_SETBASE = 0xFFFFFF38; + constexpr uint32_t CMD_MEDIAFIFO = 0xFFFFFF39; + constexpr uint32_t CMD_PLAYVIDEO = 0xFFFFFF3A; + constexpr uint32_t CMD_SETFONT2 = 0xFFFFFF3B; + constexpr uint32_t CMD_SETSCRATCH = 0xFFFFFF3C; + constexpr uint32_t CMD_ROMFONT = 0xFFFFFF3F; + constexpr uint32_t CMD_VIDEOSTART = 0xFFFFFF40; + constexpr uint32_t CMD_VIDEOFRAME = 0xFFFFFF41; + constexpr uint32_t CMD_SETBITMAP = 0xFFFFFF43; +} + +namespace FTDI { + enum effect_t : unsigned char { + SILENCE = 0x00, + SQUARE_WAVE = 0x01, + SINE_WAVE = 0x02, + SAWTOOTH_WAVE = 0x03, + TRIANGLE_WAVE = 0x04, + BEEPING = 0x05, + ALARM = 0x06, + WARBLE = 0x07, + CAROUSEL = 0x08, + SHORT_PIPS_1 = 0x10, + SHORT_PIPS_2 = 0x11, + SHORT_PIPS_3 = 0x12, + SHORT_PIPS_4 = 0x13, + SHORT_PIPS_5 = 0x14, + SHORT_PIPS_6 = 0x15, + SHORT_PIPS_7 = 0x16, + SHORT_PIPS_8 = 0x17, + SHORT_PIPS_9 = 0x18, + SHORT_PIPS_10 = 0x19, + SHORT_PIPS_11 = 0x1A, + SHORT_PIPS_12 = 0x1B, + SHORT_PIPS_13 = 0x1C, + SHORT_PIPS_14 = 0x1D, + SHORT_PIPS_15 = 0x1E, + SHORT_PIPS_16 = 0x1F, + DTMF_POUND = 0x23, + DTMF_STAR = 0x2C, + DTMF_0 = 0x30, + DTMF_1 = 0x31, + DTMF_2 = 0x32, + DTMF_3 = 0x33, + DTMF_4 = 0x34, + DTMF_5 = 0x35, + DTMF_6 = 0x36, + DTMF_7 = 0x37, + DTMF_8 = 0x38, + DTMF_9 = 0x39, + HARP = 0x40, + XYLOPHONE = 0x41, + TUBA = 0x42, + GLOCKENSPIEL = 0x43, + ORGAN = 0x44, + TRUMPET = 0x45, + PIANO = 0x46, + CHIMES = 0x47, + MUSIC_BOX = 0x48, + BELL = 0x49, + CLICK = 0x50, + SWITCH = 0x51, + COWBELL = 0x52, + NOTCH = 0x53, + HIHAT = 0x54, + KICKDRUM = 0x55, + POP = 0x56, + CLACK = 0x57, + CHACK = 0x58, + MUTE = 0x60, + UNMUTE = 0x61 + }; + + enum note_t : unsigned char { + END_SONG = 0xFF, + REST = 0x00, + + NOTE_C1 = 0x18, // 24 + NOTE_C1S = 0x19, + NOTE_D1 = 0x1A, + NOTE_D1S = 0x1B, + NOTE_E1 = 0x1C, + NOTE_F1 = 0x1D, + NOTE_F1S = 0x1E, + NOTE_G1 = 0x1F, + NOTE_G1S = 0x20, + NOTE_A1 = 0x21, + NOTE_A1S = 0x22, + NOTE_B1 = 0x23, + + NOTE_C2 = 0x24, //36 + NOTE_C2S = 0x25, + NOTE_D2 = 0x26, + NOTE_D2S = 0x27, + NOTE_E2 = 0x28, + NOTE_F2 = 0x29, + NOTE_F2S = 0x2A, + NOTE_G2 = 0x2B, + NOTE_G2S = 0x2C, + NOTE_A2 = 0x2D, + NOTE_A2S = 0x2E, + NOTE_B2 = 0x2F, + + NOTE_C3 = 0x30, + NOTE_C3S = 0x31, + NOTE_D3 = 0x32, + NOTE_D3S = 0x33, + NOTE_E3 = 0x34, + NOTE_F3 = 0x35, + NOTE_F3S = 0x36, + NOTE_G3 = 0x37, + NOTE_G3S = 0x38, + NOTE_A3 = 0x39, + NOTE_A3S = 0x3A, + NOTE_B3 = 0x3B, + + NOTE_C4 = 0x3C, + NOTE_C4S = 0x3D, + NOTE_D4 = 0x3E, + NOTE_D4S = 0x3F, + NOTE_E4 = 0x40, + NOTE_F4 = 0x41, + NOTE_F4S = 0x42, + NOTE_G4 = 0x43, + NOTE_G4S = 0x44, + NOTE_A4 = 0x45, + NOTE_A4S = 0x46, + NOTE_B4 = 0x47, + + NOTE_C5 = 0x48, + NOTE_C5S = 0x49, + NOTE_D5 = 0x4A, + NOTE_D5S = 0x4B, + NOTE_E5 = 0x4C, + NOTE_F5 = 0x4D, + NOTE_F5S = 0x4E, + NOTE_G5 = 0x4F, + NOTE_G5S = 0x50, + NOTE_A5 = 0x51, + NOTE_A5S = 0x52, + NOTE_B5 = 0x53, + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/display_list.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/display_list.h new file mode 100644 index 000000000000..99a9e0e81089 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/display_list.h @@ -0,0 +1,118 @@ +/****************** + * display_list.h * + *****************/ + +/********************************************************************************** + * Adapted from: * + * https://github.com/RudolphRiedel/FT800-FT813 * + * By Rudolph Riedel * + * * + * MIT License * + * * + * Copyright (c) 2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy * + * of this software and associated documentation files (the "Software"), to deal * + * in the Software without restriction, including without limitation the rights * + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included in all * + * copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * + * SOFTWARE. * + * * + **********************************************************************************/ + +#pragma once + +namespace FTDI { + /* FT8xx graphics engine specific macros useful for static display list generation */ + inline uint32_t ALPHA_FUNC(uint8_t func, uint8_t ref) {return DL::ALPHA_FUNC|((func&7UL)<<8)|(ref&255UL);} + inline uint32_t BEGIN(begin_t prim) {return DL::BEGIN|(prim&15UL);} + + inline uint32_t BITMAP_SOURCE(uint32_t ram_g_addr) {return DL::BITMAP_SOURCE|(ram_g_addr);} + inline uint32_t BITMAP_HANDLE(uint8_t handle) {return DL::BITMAP_HANDLE|(handle&31UL);} + inline uint32_t BITMAP_LAYOUT(uint8_t format, uint16_t linestride, uint16_t height) + {return DL::BITMAP_LAYOUT|((format&31UL)<<19)|((linestride&1023UL)<<9)|(height&511UL);} + + inline uint32_t BITMAP_SIZE(uint8_t filter, uint8_t wrapx, uint8_t wrapy, uint16_t width, uint16_t height) + {return DL::BITMAP_SIZE|((filter&1UL)<<20)|((wrapx&1UL)<<19)|((wrapy&1UL)<<18)|((width&511UL)<<9)|(height&511UL);} + #if FTDI_API_LEVEL >= 810 + inline uint32_t BITMAP_LAYOUT_H(uint8_t linestride, uint8_t height) + {return DL::BITMAP_LAYOUT_H|((linestride&3UL)<<2)|(height&3UL);} + inline uint32_t BITMAP_SIZE_H(uint8_t width, uint8_t height) + {return DL::BITMAP_SIZE_H|((width&3UL)<<2)|(height&3UL);} + #endif + inline uint32_t BITMAP_TRANSFORM_A(uint16_t a) {return DL::BITMAP_TRANSFORM_A|(a&131071UL);} + inline uint32_t BITMAP_TRANSFORM_B(uint16_t b) {return DL::BITMAP_TRANSFORM_B|(b&131071UL);} + inline uint32_t BITMAP_TRANSFORM_C(uint32_t c) {return DL::BITMAP_TRANSFORM_C|(c&16777215UL);} + inline uint32_t BITMAP_TRANSFORM_D(uint16_t d) {return DL::BITMAP_TRANSFORM_D|(d&131071UL);} + inline uint32_t BITMAP_TRANSFORM_E(uint16_t e) {return DL::BITMAP_TRANSFORM_E|(e&131071UL);} + inline uint32_t BITMAP_TRANSFORM_F(uint32_t f) {return DL::BITMAP_TRANSFORM_F|(f&16777215UL);} + inline uint32_t BLEND_FUNC(uint8_t src,uint8_t dst) {return DL::BLEND_FUNC|((src&7UL)<<3)|(dst&7UL);} + inline uint32_t CALL(uint16_t dest) {return DL::CALL|(dest&65535UL);} + inline uint32_t CELL(uint8_t cell) {return DL::CELL|(cell&127UL);} + inline uint32_t CLEAR(bool c,bool s,bool t) {return DL::CLEAR|((c?1UL:0UL)<<2)|((s?1UL:0UL)<<1)|(t?1UL:0UL);} + inline uint32_t CLEAR_COLOR_A(uint8_t alpha) {return DL::CLEAR_COLOR_A|(alpha&255UL);} + inline uint32_t CLEAR_COLOR_RGB(uint8_t red, uint8_t green, uint8_t blue) + {return DL::CLEAR_COLOR_RGB|((red&255UL)<<16)|((green&255UL)<<8)|(blue&255UL);} + inline uint32_t CLEAR_COLOR_RGB(uint32_t rgb) {return DL::CLEAR_COLOR_RGB|rgb;} + inline uint32_t CLEAR_STENCIL(uint8_t s) {return DL::CLEAR_STENCIL|(s&255UL);} + inline uint32_t CLEAR_TAG(uint8_t s) {return DL::CLEAR_TAG|(s&255UL);} + inline uint32_t COLOR_A(uint8_t alpha) {return DL::COLOR_A|(alpha&255UL);} + inline uint32_t COLOR_MASK(bool r, bool g, bool b, bool a) {return DL::COLOR_MASK|((r?1UL:0UL)<<3)|((g?1UL:0UL)<<2)|((b?1UL:0UL)<<1)|(a?1UL:0UL);} + inline uint32_t COLOR_RGB(uint8_t red,uint8_t green,uint8_t blue) + {return DL::COLOR_RGB|((red&255UL)<<16)|((green&255UL)<<8)|(blue&255UL);} + inline uint32_t COLOR_RGB(uint32_t rgb) {return DL::COLOR_RGB|rgb;} + /* inline uint32_t DISPLAY() {return (0UL<<24)) */ + inline uint32_t END() {return DL::END;} + inline uint32_t JUMP(uint16_t dest) {return DL::JUMP|(dest&65535UL);} + inline uint32_t LINE_WIDTH(uint16_t width) {return DL::LINE_WIDTH|(width&4095UL);} + inline uint32_t MACRO(uint8_t m) {return DL::MACRO|(m&1UL);} + inline uint32_t POINT_SIZE(uint16_t size) {return DL::POINT_SIZE|(size&8191UL);} + inline uint32_t RESTORE_CONTEXT() {return DL::RESTORE_CONTEXT;} + inline uint32_t RETURN () {return DL::RETURN;} + inline uint32_t SAVE_CONTEXT() {return DL::SAVE_CONTEXT;} + inline uint32_t SCISSOR_XY(uint16_t x,uint16_t y) { + return DL::SCISSOR_XY | + (FTDI::ftdi_chip >= 810 + ? ((x&2047UL)<<11)|(y&2047UL) + : ((x& 511UL)<<10)|(y&511UL)); + } + inline uint32_t SCISSOR_SIZE(uint16_t w,uint16_t h) { + return DL::SCISSOR_SIZE | + (FTDI::ftdi_chip >= 810 + ? ((w&4095UL)<<12)|(h&4095UL) + : ((w&1023UL)<<10)|(h&1023UL)); + } + inline uint32_t SCISSOR_XY() {return DL::SCISSOR_XY;} + inline uint32_t SCISSOR_SIZE() { + return DL::SCISSOR_SIZE | + (FTDI::ftdi_chip >= 810 + ? (2048UL<<12)|(2048UL) + : ( 512UL<<10)|( 512UL)); + } + inline uint32_t STENCIL_FUNC(uint16_t func, uint8_t ref, uint8_t mask) + {return DL::STENCIL_FUNC|((func&7UL)<<16)|((ref&255UL)<<8)|(mask&255UL);} + inline uint32_t STENCIL_MASK(uint8_t mask) {return DL::STENCIL_MASK|(mask&255UL);} + inline uint32_t STENCIL_OP(uint8_t sfail, uint8_t spass) {return DL::STENCIL_OP|(((sfail)&7UL)<<3)|(spass&7UL);} + inline uint32_t TAG(uint8_t s) {return DL::TAG|(s&255UL);} + inline uint32_t TAG_MASK(bool mask) {return DL::TAG_MASK|(mask?1:0);} + inline uint32_t VERTEX2F(uint16_t x, uint16_t y) {return DL::VERTEX2F|((x&32767UL)<<15)|(y&32767UL);} + inline uint32_t VERTEX2II(uint16_t x,uint16_t y, uint8_t handle = 0, uint8_t cell = 0) + {return DL::VERTEX2II|((x&511UL)<<21)|((y&511UL)<<12)|((handle&31UL)<<7)|(cell&127UL);} + + #if FTDI_API_LEVEL >= 810 + inline uint32_t VERTEX_FORMAT(uint8_t frac) {return DL::VERTEX_FORMAT|(frac&7UL);} + inline uint32_t VERTEX_TRANSLATE_X(int32_t x) {return DL::VERTEX_TRANSLATE_X|(x&131071UL);} + inline uint32_t VERTEX_TRANSLATE_Y(int32_t y) {return DL::VERTEX_TRANSLATE_Y|(y&131071UL);} + #endif +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h new file mode 100644 index 000000000000..e8f9f424d0a0 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h @@ -0,0 +1,40 @@ +/**************** + * ftdi_basic.h * + ****************/ + +/**************************************************************************** + * Written By Mark Pelletier 2019 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "../compat.h" + +#ifndef __MARLIN_FIRMWARE__ + #define FTDI_BASIC +#endif + +#ifdef FTDI_BASIC + #include "registers_ft800.h" + #include "registers_ft810.h" + #include "constants.h" + #include "boards.h" + #include "commands.h" + #include "spi.h" + #include "display_list.h" + #include "resolutions.h" +#endif diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h new file mode 100644 index 000000000000..ff17d019d788 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h @@ -0,0 +1,150 @@ +/********************* + * registers_ft800.h * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/**************************************************************************** + * This header defines registers for the FTDI FT800 LCD Driver chip. * + ****************************************************************************/ + +/******************************************************************************* + * FT810 * + * * + * START END ADDR SIZE NAME DESCRIPTION * + * * + * 0x000000 0x03FFFF 256 kB RAM_G Main Graphics RAM * + * * + * 0x0C0000 0x0C0003 4 B ROM_CHIPID [0:1] 0x800 Chip Id * + * [1:2] 0x0100 Vers ID * + * * + * 0x0BB23C 0x0FFFFB 275 kB ROM_FONT Font table and bitmap * + * * + * 0x0FFFFC 0x0FFFFF 4 B ROM_FONT_ADDR Font table pointer address * + * * + * 0x100000 0x101FFF 8 kB RAM_DL Display List RAM * + * * + * 0x102000 0x1023FF 1 kB RAM_PAL Palette RAM * + * * + * 0x102400 0x10257F 380 B * Registers * + * * + * 0x108000 0x108FFF 4 kB RAM_CMD Command Buffer * + * * + *******************************************************************************/ + +#pragma once + +namespace FTDI { + struct ft800_memory_map { + + // MEMORY LOCATIONS FT800 + static constexpr uint32_t RAM_G = 0x000000; // Main Graphics RAM + static constexpr uint32_t ROM_CHIPID = 0x0C0000; // Chip ID/Version ID + static constexpr uint32_t ROM_FONT = 0x0BB23C; // Font ROM + static constexpr uint32_t ROM_FONT_ADDR = 0x0FFFFC; // Font Table Pointer + static constexpr uint32_t RAM_DL = 0x100000; // Display List RAM + static constexpr uint32_t RAM_PAL = 0x102000; // Palette RAM + static constexpr uint32_t RAM_REG = 0x102400; // Registers + static constexpr uint32_t RAM_CMD = 0x108000; // Command Buffer + + static constexpr uint32_t RAM_G_SIZE = 256*1024l; // 256k + }; + + struct ft800_registers { + // REGISTERS AND ADDRESSES FT800 + + // REGISTER ADDRESS SIZE RESET VALUE TYPE DESCRIPTION + + static constexpr uint32_t ID = 0x102400; // 8 0x7C r Identification Register, Always 0x7C + static constexpr uint32_t FRAMES = 0x102404; // 32 0x00000000 r Frame Counter, Since Reset + static constexpr uint32_t CLOCK = 0x102408; // 32 0x00000000 r Clock cycles, Since Reset + static constexpr uint32_t FREQUENCY = 0x10240C; // 28 0x03938700 r/w Main Clock Frequency + static constexpr uint32_t RENDERMODE = 0x102410; // 1 0x00 r/w Rendering Mode: 0 = normal, 1 = single-line + static constexpr uint32_t SNAPY = 0x102414; // 11 0x0000 r/w Scan Line Select for RENDERMODE 1 + static constexpr uint32_t SNAPSHOT = 0x102418; // 1 - r Trigger for RENDERMODE 1 + static constexpr uint32_t CPURESET = 0x10241C; // 3 0x02 r/w RESET Bit2 Audio - Bit1 Touch - Bit0 Graphics + static constexpr uint32_t TAP_CRC = 0x102420; // 32 - r Live Video Tap + static constexpr uint32_t TAP_MASK = 0x102424; // 32 0xFFFFFFFF r/w Live Video Tap Mask + static constexpr uint32_t HCYCLE = 0x102428; // 12 0x224 r/w Horizontal Total Cycle Count + static constexpr uint32_t HOFFSET = 0x10242C; // 12 0x02B r/w Horizontal Display Start Offset + static constexpr uint32_t HSIZE = 0x102430; // 12 0x1E0 r/w Horizontal Display Pixel Count + static constexpr uint32_t HSYNC0 = 0x102434; // 12 0x000 r/w Horizontal Sync Fall Offset + static constexpr uint32_t HSYNC1 = 0x102438; // 12 0x029 r/w Horizontal Sync Rise Offset + static constexpr uint32_t VCYCLE = 0x10243C; // 12 0x124 r/w Vertical Total Cycle Count + static constexpr uint32_t VOFFSET = 0x102440; // 12 0x00C r/w Vertical Display Start Offset + static constexpr uint32_t VSIZE = 0x102444; // 12 0x110 r/w Vertical Display Line Count + static constexpr uint32_t VSYNC0 = 0x102448; // 10 0x000 r/w Vertical Sync Fall Offset + static constexpr uint32_t VSYNC1 = 0x10244C; // 10 0x00A r/w Vertical Sync Rise Offset + static constexpr uint32_t DLSWAP = 0x102450; // 2 0x00 r/w Display List Swap Control + static constexpr uint32_t ROTATE = 0x102454; // 3 0x00 r/w Screen 90,180, 270 degree rotate + static constexpr uint32_t OUTBITS = 0x102458; // 9 0x1B6 r/w Output Resolution, 3x3x3 Bits + static constexpr uint32_t DITHER = 0x10245C; // 1 0x01 r/w Output Dither Enable + static constexpr uint32_t SWIZZLE = 0x102460; // 4 0x00 r/w Output RGB Swizzle, Pin Change for PCB Routing + static constexpr uint32_t CSPREAD = 0x102464; // 1 0x01 r/w Output Clock Spreading Enable + static constexpr uint32_t PCLK_POL = 0x102468; // 1 0x00 r/w PCLK Polarity: 0 = Rising Edge, 1 = Falling Edge + static constexpr uint32_t PCLK = 0x10246C; // 8 0x00 r/w PCLK Frequency Divider, 0 = Disable Clock + static constexpr uint32_t TAG_X = 0x102470; // 11 0x000 r/w Tag Query X Coordinate + static constexpr uint32_t TAG_Y = 0x102474; // 11 0x000 r/w Tag Query Y Coordinate + static constexpr uint32_t TAG = 0x102478; // 8 0x00 r Tag Query Result + static constexpr uint32_t VOL_PB = 0x10247C; // 8 0xFF r/w Audio Playback Volume + static constexpr uint32_t VOL_SOUND = 0x102480; // 8 0xFF r/w Audio Synthesizer Volume + static constexpr uint32_t SOUND = 0x102484; // 16 0x0000 r/w Audio Sound Effect Select + static constexpr uint32_t PLAY = 0x102488; // 1 0x00 r/w Audio Start Effect Playback + static constexpr uint32_t GPIO_DIR = 0x10248C; // 8 0x80 r/w GPIO Pin Direction: 0 = Input , 1 = Output + static constexpr uint32_t GPIO = 0x102490; // 8 0x00 r/w GPIO Pin Values for 0, 1, 7 Drive Strength 2, 3, 4, 5, 6 + static constexpr uint32_t INT_FLAGS = 0x102498; // 8 0x00 r Interrupt Flags, Clear by Reading + static constexpr uint32_t INT_EN = 0x10249C; // 1 0x00 r/w Global Interrupt Enable + static constexpr uint32_t INT_MASK = 0x1024A0; // 8 0xFF r/w Interrupt Enable Mask + static constexpr uint32_t PLAYBACK_START = 0x1024A4; // 20 0x00000 r/w Audio Playback RAM Start Address + static constexpr uint32_t PLAYBACK_LENGTH = 0x1024A8; // 20 0x00000 r/w Audio Playback Sample Length (Bytes) + static constexpr uint32_t PLAYBACK_READPTR = 0x1024AC; // 20 - r Audio Playback Read Pointer + static constexpr uint32_t PLAYBACK_FREQ = 0x1024B0; // 16 0x1F40 r/w Audio Playback Frequency (Hz) + static constexpr uint32_t PLAYBACK_FORMAT = 0x1024B4; // 2 0x00 r/w Audio Playback Format + static constexpr uint32_t PLAYBACK_LOOP = 0x1024B8; // 1 0x00 r/w Audio Playback Loop Enable + static constexpr uint32_t PLAYBACK_PLAY = 0x1024BC; // 1 0x00 r Audio Start Playback + static constexpr uint32_t PWM_HZ = 0x1024C0; // 14 0x00FA r/w Backlight PWM Frequency (Hz) + static constexpr uint32_t PWM_DUTY = 0x1024C4; // 8 0x80 r/w Backlight PWM Duty Cycle: 0 = 0%, 128 = 100% + static constexpr uint32_t MACRO_0 = 0x1024C8; // 32 0x00000000 r/w Display List Macro Command 0 + static constexpr uint32_t MACRO_1 = 0x1024CC; // 32 0x00000000 r/w Display List Macro Command 1 + static constexpr uint32_t CMD_READ = 0x1024E4; // 12 0x000 r/w Command Buffer Read Pointer + static constexpr uint32_t CMD_WRITE = 0x1024E8; // 12 0x000 r/w Command Buffer Write Pointer + static constexpr uint32_t CMD_DL = 0x1024EC; // 13 0x0000 r/w Command Display List Offset + static constexpr uint32_t TOUCH_MODE = 0x1024F0; // 2 0x03 r/w Touch-Screen Sampling Mode + static constexpr uint32_t TOUCH_ADC_MODE = 0x1024F4; // 1 0x01 r/w Select Single Ended or Differential Sampling + static constexpr uint32_t TOUCH_CHARGE = 0x1024F8; // 16 0x1770 r/w Touch Screen Charge Time, n x 6 Clocks + static constexpr uint32_t TOUCH_SETTLE = 0x1024FC; // 4 0x03 r/w Touch-Screen Settle Time, n x 6 Clocks + static constexpr uint32_t TOUCH_OVERSAMPLE = 0x102500; // 4 0x07 r/w Touch-Screen Oversample Factor + static constexpr uint32_t TOUCH_RZTHRESH = 0x102504; // 16 0xFFFF r/w Touch-Screen Resistance Threshold + static constexpr uint32_t TOUCH_RAW_XY = 0x102508; // 32 - r Touch-Screen Raw (x-MSB16; y-LSB16) + static constexpr uint32_t TOUCH_RZ = 0x10250C; // 16 - r Touch-Screen Resistance + static constexpr uint32_t TOUCH_SCREEN_XY = 0x102510; // 32 - r Touch-Screen Screen (x-MSB16; y-LSB16) + static constexpr uint32_t TOUCH_TAG_XY = 0x102514; // 32 - r Touch-Screen Tag 0 Lookup (x-MSB16; y-LSB16) + static constexpr uint32_t TOUCH_TAG = 0x102518; // 8 - r Touch-Screen Tag 0 Result + static constexpr uint32_t TOUCH_TRANSFORM_A = 0x10251C; // 32 0x00010000 r/w Touch-Screen Transform Coefficient A (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_B = 0x102520; // 32 0x00000000 r/w Touch-Screen Transform Coefficient B (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_C = 0x102524; // 32 0x00000000 r/w Touch-Screen Transform Coefficient C (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_D = 0x102528; // 32 0x00000000 r/w Touch-Screen Transform Coefficient D (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_E = 0x10252C; // 32 0x00010000 r/w Touch-Screen Transform Coefficient E (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_F = 0x102530; // 32 0x00000000 r/w Touch-Screen Transform Coefficient F (s15.16) + // Reserved Addresses 0x102434 - 0x102470 + static constexpr uint32_t TOUCH_DIRECT_XY = 0x102574; // 32 - r Touch-Screen Direct Conversions XY (x-MSB16; y-LSB16) + static constexpr uint32_t TOUCH_DIRECT_Z1Z2 = 0x102578; // 32 - r Touch-Screen Direct Conversions Z (z1-MSB16; z2-LSB16) + static constexpr uint32_t TRACKER = 0x109000; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h new file mode 100644 index 000000000000..3e4044e1947d --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h @@ -0,0 +1,187 @@ +/********************* + * registers_ft810.h * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/**************************************************************************** + * This header defines registers for the FTDI FT810 LCD Driver chip. * + ****************************************************************************/ + +/******************************************************************************* + * FT810 * + * * + * START END ADDR SIZE NAME DESCRIPTION * + * * + * 0x000000 0x0FFFFF 1024 kB RAM_G Main Graphics RAM (0 to 1048572) * + * * + * 0x0C0000 0x0C0003 4 B ROM_CHIPID [0:1] 0x800 Chip Id * + * [1:2] 0x0100 Vers ID * + * * + * 0x1E0000 0x2FFFFB 1152 kB ROM_FONT Font table and bitmap * + * * + * 0x201EE0 0x2029DC 2812 B ROM_FONT_ROOT ROM font table * + * * + * 0x2FFFFC 0x2FFFFF 4 B ROM_FONT_ADDR Font table pointer address * + * * + * 0x300000 0x301FFF 8 kB RAM_DL Display List RAM * + * * + * 0x302000 0x302FFF 4 kB * Registers * + * * + * 0x308000 0x308FFF 4 kB RAM_CMD Command Buffer * + * * + *******************************************************************************/ + +#pragma once + +namespace FTDI { + struct ft810_memory_map { + // MEMORY LOCATIONS FT810 + static constexpr uint32_t RAM_G = 0x000000; // Main Graphics RAM + static constexpr uint32_t ROM_CHIPID = 0x0C0000; // Chip ID/Version ID + static constexpr uint32_t ROM_FONT = 0x1E0000; // Font ROM + static constexpr uint32_t ROM_FONT_ADDR = 0x2FFFFC; // Font Table Pointer + static constexpr uint32_t RAM_DL = 0x300000; // Display List RAM + static constexpr uint32_t RAM_REG = 0x302000; // Registers + static constexpr uint32_t RAM_CMD = 0x308000; // Command Buffer + + static constexpr uint32_t RAM_G_SIZE = 1024*1024l; // 1024k + }; + + struct ft810_registers { + // REGISTERS AND ADDRESSES FT810 + + // REGISTER ADDRESS SIZE RESET VALUE TYPE DESCRIPTION + + static constexpr uint32_t ID = 0x302000; // 8 0x7C r Identification Register, Always 0x7C + static constexpr uint32_t FRAMES = 0x302004; // 32 0x00000000 r Frame Counter, Since Reset + static constexpr uint32_t CLOCK = 0x302008; // 32 0x00000000 r Clock cycles, Since Reset + static constexpr uint32_t FREQUENCY = 0x30200C; // 28 0x03938700 r/w Main Clock Frequency + static constexpr uint32_t RENDERMODE = 0x302010; // 1 0x00 r/w Rendering Mode: 0 = normal, 1 = single-line + static constexpr uint32_t SNAPY = 0x302014; // 11 0x0000 r/w Scan Line Select for RENDERMODE 1 + static constexpr uint32_t SNAPSHOT = 0x302018; // 1 - r Trigger for RENDERMODE 1 + static constexpr uint32_t SNAPFORMAT = 0x30201C; // 6 0x20 r/w Pixel Format for Scanline Readout + static constexpr uint32_t CPURESET = 0x302020; // 3 0x02 r/w RESET Bit2 Audio - Bit1 Touch - Bit0 Graphics + static constexpr uint32_t TAP_CRC = 0x302024; // 32 - r Live Video Tap + static constexpr uint32_t TAP_MASK = 0x302028; // 32 0xFFFFFFFF r/w Live Video Tap Mask + static constexpr uint32_t HCYCLE = 0x30202C; // 12 0x224 r/w Horizontal Total Cycle Count + static constexpr uint32_t HOFFSET = 0x302030; // 12 0x02B r/w Horizontal Display Start Offset + static constexpr uint32_t HSIZE = 0x302034; // 12 0x1E0 r/w Horizontal Display Pixel Count + static constexpr uint32_t HSYNC0 = 0x302038; // 12 0x000 r/w Horizontal Sync Fall Offset + static constexpr uint32_t HSYNC1 = 0x30203C; // 12 0x029 r/w Horizontal Sync Rise Offset + static constexpr uint32_t VCYCLE = 0x302040; // 12 0x124 r/w Vertical Total Cycle Count + static constexpr uint32_t VOFFSET = 0x302044; // 12 0x00C r/w Vertical Display Start Offset + static constexpr uint32_t VSIZE = 0x302048; // 12 0x110 r/w Vertical Display Line Count + static constexpr uint32_t VSYNC0 = 0x30204C; // 10 0x000 r/w Vertical Sync Fall Offset + static constexpr uint32_t VSYNC1 = 0x302050; // 10 0x00A r/w Vertical Sync Rise Offset + static constexpr uint32_t DLSWAP = 0x302054; // 2 0x00 r/w Display List Swap Control + static constexpr uint32_t ROTATE = 0x302058; // 3 0x00 r/w Screen 90,180, 270 degree rotate + static constexpr uint32_t OUTBITS = 0x30205C; // 9 0x1B6 r/w Output Resolution, 3x3x3 Bits + static constexpr uint32_t DITHER = 0x302060; // 1 0x01 r/w Output Dither Enable + static constexpr uint32_t SWIZZLE = 0x302064; // 4 0x00 r/w Output RGB Swizzle, Pin Change for PCB Routing + static constexpr uint32_t CSPREAD = 0x302068; // 1 0x01 r/w Output Clock Spreading Enable + static constexpr uint32_t PCLK_POL = 0x30206C; // 1 0x00 r/w PCLK Polarity: 0 = Rising Edge, 1 = Falling Edge + static constexpr uint32_t PCLK = 0x302070; // 8 0x00 r/w PCLK Frequency Divider, 0 = Disable Clock + static constexpr uint32_t TAG_X = 0x302074; // 11 0x000 r/w Tag Query X Coordinate + static constexpr uint32_t TAG_Y = 0x302078; // 11 0x000 r/w Tag Query Y Coordinate + static constexpr uint32_t TAG = 0x30207C; // 8 0x00 r Tag Query Result + static constexpr uint32_t VOL_PB = 0x302080; // 8 0xFF r/w Audio Playback Volume + static constexpr uint32_t VOL_SOUND = 0x302084; // 8 0xFF r/w Audio Synthesizer Volume + static constexpr uint32_t SOUND = 0x302088; // 16 0x0000 r/w Audio Sound Effect Select + static constexpr uint32_t PLAY = 0x30208C; // 1 0x00 r/w Audio Start Effect Playback + static constexpr uint32_t GPIO_DIR = 0x302090; // 8 0x80 r/w GPIO Pin Direction: 0 = Input , 1 = Output + static constexpr uint32_t GPIO = 0x302094; // 8 0x00 r/w GPIO Pin Values for 0, 1, 7 Drive Strength 2, 3, 4, 5, 6 + static constexpr uint32_t GPIOX_DIR = 0x302098; // 16 0x8000 r/w Extended GPIO Pin Direction + static constexpr uint32_t GPIOX = 0x30209C; // 16 0x0080 r/w Extended GPIO Pin Values + // Reserved Addr 0x3020A0 + // Reserved Addr 0x3020A4 + static constexpr uint32_t INT_FLAGS = 0x3020A8; // 8 0x00 r Interrupt Flags, Clear by Reading + static constexpr uint32_t INT_EN = 0x3020AC; // 1 0x00 r/w Global Interrupt Enable + static constexpr uint32_t INT_MASK = 0x3020B0; // 8 0xFF r/w Interrupt Enable Mask + static constexpr uint32_t PLAYBACK_START = 0x3020B4; // 20 0x00000 r/w Audio Playback RAM Start Address + static constexpr uint32_t PLAYBACK_LENGTH = 0x3020B8; // 20 0x00000 r/w Audio Playback Sample Length (Bytes) + static constexpr uint32_t PLAYBACK_READPTR = 0x3020BC; // 20 - r Audio Playback Read Pointer + static constexpr uint32_t PLAYBACK_FREQ = 0x3020C0; // 16 0x1F40 r/w Audio Playback Frequency (Hz) + static constexpr uint32_t PLAYBACK_FORMAT = 0x3020C4; // 2 0x00 r/w Audio Playback Format + static constexpr uint32_t PLAYBACK_LOOP = 0x3020C8; // 1 0x00 r/w Audio Playback Loop Enable + static constexpr uint32_t PLAYBACK_PLAY = 0x3020CC; // 1 0x00 r Audio Start Playback + static constexpr uint32_t PWM_HZ = 0x3020D0; // 14 0x00FA r/w Backlight PWM Frequency (Hz) + static constexpr uint32_t PWM_DUTY = 0x3020D4; // 8 0x80 r/w Backlight PWM Duty Cycle: 0 = 0%, 128 = 100% + static constexpr uint32_t MACRO_0 = 0x3020D8; // 32 0x00000000 r/w Display List Macro Command 0 + static constexpr uint32_t MACRO_1 = 0x3020DC; // 32 0x00000000 r/w Display List Macro Command 1 + // Reserved Addr 0x3020E0 + // Reserved Addr 0x3020E4 + // Reserved Addr 0x3020E8 + // Reserved Addr 0x3020EC + // Reserved Addr 0x3020F0 + // Reserved Addr 0x3020F4 + static constexpr uint32_t CMD_READ = 0x3020F8; // 12 0x000 r/w Command Buffer Read Pointer + static constexpr uint32_t CMD_WRITE = 0x3020FC; // 12 0x000 r/w Command Buffer Write Pointer + static constexpr uint32_t CMD_DL = 0x302100; // 13 0x0000 r/w Command Display List Offset + static constexpr uint32_t TOUCH_MODE = 0x302104; // 2 0x03 r/w Touch-Screen Sampling Mode + static constexpr uint32_t TOUCH_ADC_MODE = 0x302108; // 1 0x01 r/w Select Single Ended or Differential Sampling + static constexpr uint32_t TOUCH_CHARGE = 0x30210C; // 16 0x1770 r/w Touch Screen Charge Time, n x 6 Clocks + static constexpr uint32_t TOUCH_SETTLE = 0x302110; // 4 0x03 r/w Touch-Screen Settle Time, n x 6 Clocks + static constexpr uint32_t TOUCH_OVERSAMPLE = 0x302114; // 4 0x07 r/w Touch-Screen Oversample Factor + static constexpr uint32_t TOUCH_RZTHRESH = 0x302118; // 16 0xFFFF r/w Touch-Screen Resistance Threshold + static constexpr uint32_t TOUCH_RAW_XY = 0x30211C; // 32 - r Touch-Screen Raw (x-MSB16; y-LSB16) + static constexpr uint32_t TOUCH_RZ = 0x302120; // 16 - r Touch-Screen Resistance + static constexpr uint32_t TOUCH_SCREEN_XY = 0x302124; // 32 - r Touch-Screen Screen (x-MSB16; y-LSB16) + static constexpr uint32_t TOUCH_TAG_XY = 0x302128; // 32 - r Touch-Screen Tag 0 Lookup (x-MSB16; y-LSB16) + static constexpr uint32_t TOUCH_TAG = 0x30212C; // 8 - r Touch-Screen Tag 0 Result + static constexpr uint32_t TOUCH_TAG1_XY = 0x302130; // 32 - r Touch-Screen Tag 1 Lookup + static constexpr uint32_t TOUCH_TAG1 = 0x302134; // 8 - r Touch-Screen Tag 1 Result + static constexpr uint32_t TOUCH_TAG2_XY = 0x302138; // 32 - r Touch-Screen Tag 2 Lookup + static constexpr uint32_t TOUCH_TAG2 = 0x30213C; // 8 - r Touch-Screen Tag 2 Result + static constexpr uint32_t TOUCH_TAG3_XY = 0x302140; // 32 - r Touch-Screen Tag 3 Lookup + static constexpr uint32_t TOUCH_TAG3 = 0x302144; // 8 - r Touch-Screen Tag 3 Result + static constexpr uint32_t TOUCH_TAG4_XY = 0x302148; // 32 - r Touch-Screen Tag 4 Lookup + static constexpr uint32_t TOUCH_TAG4 = 0x30214C; // 8 - r Touch-Screen Tag 4 Result + static constexpr uint32_t TOUCH_TRANSFORM_A = 0x302150; // 32 0x00010000 r/w Touch-Screen Transform Coefficient A (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_B = 0x302154; // 32 0x00000000 r/w Touch-Screen Transform Coefficient B (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_C = 0x302158; // 32 0x00000000 r/w Touch-Screen Transform Coefficient C (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_D = 0x30215C; // 32 0x00000000 r/w Touch-Screen Transform Coefficient D (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_E = 0x302160; // 32 0x00010000 r/w Touch-Screen Transform Coefficient E (s15.16) + static constexpr uint32_t TOUCH_TRANSFORM_F = 0x302164; // 32 0x00000000 r/w Touch-Screen Transform Coefficient F (s15.16) + static constexpr uint32_t TOUCH_CONFIG = 0x302168; // 16 0x8381 r/w Touch Configuration + static constexpr uint32_t CTOUCH_TOUCH4_X = 0x30216C; // 16 - r Extended Mode Touch Screen + // Reserved Addresses 0x302170 + static constexpr uint32_t BIST_EN = 0x302174; // 1 0 r/w BIST Memory Mapping Enable + // Reserved Addr 0x302178 + // Reserved Addr 0x30217C + static constexpr uint32_t TRIM = 0x302180; // 8 0 r/w Internal Clock Trimming + static constexpr uint32_t ANA_COMP = 0x302184; // 8 0 r/w Analog Control Register + static constexpr uint32_t SPI_WIDTH = 0x302188; // 3 0 r/w QSPI Bus Width Setting + static constexpr uint32_t TOUCH_DIRECT_XY = 0x30218C; // 32 - r Touch-Screen Direct Conversions XY (x-MSB16; y-LSB16) + static constexpr uint32_t TOUCH_DIRECT_Z1Z2 = 0x302190; // 32 - r Touch-Screen Direct Conversions Z (z1-MSB16; z2-LSB16) + // Reserved Addresses 0x302194 - 0x302560 + static constexpr uint32_t DATESTAMP = 0x320564; // 128 - r Stamp Date Code + static constexpr uint32_t CMDB_SPACE = 0x302574; // 12 0xFFC r/w Command DL Space Available + static constexpr uint32_t CMDB_WRITE = 0x302578; // 32 0 w Command DL Write + + static constexpr uint32_t TRACKER = 0x309000; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) + static constexpr uint32_t TRACKER_1 = 0x309004; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) + static constexpr uint32_t TRACKER_2 = 0x309008; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) + static constexpr uint32_t TRACKER_3 = 0x30900C; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) + static constexpr uint32_t TRACKER_4 = 0x309010; // 32 0x00000000 r/w Track Register (Track Value MSB16; Tag Value - LSB8) + + static constexpr uint32_t MEDIAFIFO_READ = 0x309014; // 32 0x00000000 r/w Media FIFO read pointer + static constexpr uint32_t MEDIAFIFO_WRITE = 0x309018; // 32 0x00000000 r/w Media FIFO write pointer + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h new file mode 100644 index 000000000000..e1439a75c663 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h @@ -0,0 +1,128 @@ +/***************** + * resolutions.h * + *****************/ + +/**************************************************************************** + * Written By Mark Pelletier 2019 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/*** + * The FT8xx has odd registers that don't correspond to timing values in + * display datasheets. This macro computes the register values using the + * formulas given in the document: + * + * Bridgetek Application Note + * AN_336 FT8xx + * Selecting an LCD Display + * Version 2.1 + * Issue Date: 2017-11-14 + * + */ +#define COMPUTE_REGS_FROM_DATASHEET \ + constexpr uint16_t Hoffset = thfp + thb - 1; \ + constexpr uint16_t Hcycle = th; \ + constexpr uint16_t Hsync0 = thfp - 1 ; \ + constexpr uint16_t Hsync1 = thfp + thpw - 1; \ + constexpr uint16_t Voffset = tvfp + tvb - 1; \ + constexpr uint16_t Vcycle = tv; \ + constexpr uint16_t Vsync0 = tvfp - 1; \ + constexpr uint16_t Vsync1 = tvfp + tvpw - 1; \ + static_assert(thfp + thb + Hsize == th, "Mismatch in display th"); \ + static_assert(tvfp + tvb + Vsize == tv, "Mismatch in display tv"); + +#ifdef TOUCH_UI_320x240 + namespace FTDI { + constexpr uint8_t Pclk = 8; + constexpr uint8_t Pclkpol = 0; + constexpr uint16_t Hsize = 320; + constexpr uint16_t Vsize = 240; + constexpr uint16_t Vsync0 = 0; + constexpr uint16_t Vsync1 = 2; + constexpr uint16_t Voffset = 13; + constexpr uint16_t Vcycle = 263; + constexpr uint16_t Hsync0 = 0; + constexpr uint16_t Hsync1 = 10; + constexpr uint16_t Hoffset = 70; + constexpr uint16_t Hcycle = 408; + + constexpr uint32_t default_transform_a = 0x000054ad; + constexpr uint32_t default_transform_b = 0xffffff52; + constexpr uint32_t default_transform_c = 0xfff7f6e4; + constexpr uint32_t default_transform_d = 0x00000065; + constexpr uint32_t default_transform_e = 0xffffbe3b; + constexpr uint32_t default_transform_f = 0x00f68e75; + } + +#elif defined(TOUCH_UI_480x272) + namespace FTDI { + constexpr uint8_t Pclk = 7; + constexpr uint8_t Pclkpol = 1; + constexpr uint16_t Hsize = 480; + constexpr uint16_t Vsize = 272; + + constexpr uint16_t th = 525; // One horizontal line + constexpr uint16_t thfp = 43; // HS Front porch + constexpr uint16_t thb = 2; // HS Back porch (blanking) + constexpr uint16_t thpw = 41; // HS pulse width + + constexpr uint16_t tv = 286; // Vertical period time + constexpr uint16_t tvfp = 12; // VS Front porch + constexpr uint16_t tvb = 2; // VS Back porch (blanking) + constexpr uint16_t tvpw = 10; // VS pulse width + + COMPUTE_REGS_FROM_DATASHEET + + constexpr uint32_t default_transform_a = 0x00008100; + constexpr uint32_t default_transform_b = 0x00000000; + constexpr uint32_t default_transform_c = 0xFFF18000; + constexpr uint32_t default_transform_d = 0x00000000; + constexpr uint32_t default_transform_e = 0xFFFFB100; + constexpr uint32_t default_transform_f = 0x0120D000; + } + +#elif defined(TOUCH_UI_800x480) + namespace FTDI { + constexpr uint8_t Pclk = 3; + constexpr uint8_t Pclkpol = 1; + constexpr uint16_t Hsize = 800; + constexpr uint16_t Vsize = 480; + + constexpr uint16_t th = 1056; // One horizontal line + constexpr uint16_t thfp = 210; // HS Front porch + constexpr uint16_t thb = 46; // HS Back porch (blanking) + constexpr uint16_t thpw = 23; // HS pulse width + + constexpr uint16_t tv = 525; // Vertical period time + constexpr uint16_t tvfp = 22; // VS Front porch + constexpr uint16_t tvb = 23; // VS Back porch (blanking) + constexpr uint16_t tvpw = 10; // VS pulse width + + COMPUTE_REGS_FROM_DATASHEET + + constexpr uint32_t default_transform_a = 0x0000D8B9; + constexpr uint32_t default_transform_b = 0x00000124; + constexpr uint32_t default_transform_c = 0xFFE23926; + constexpr uint32_t default_transform_d = 0xFFFFFF51; + constexpr uint32_t default_transform_e = 0xFFFF7E4F; + constexpr uint32_t default_transform_f = 0x01F0AF70; + } + +#else + #error Unknown or no TOUCH_UI_FTDI_EVE display resolution specified. To add a display resolution, modify "ftdi_eve_resolutions.h" +#endif diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp new file mode 100644 index 000000000000..7f666be45b56 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp @@ -0,0 +1,161 @@ +/*********** + * spi.cpp * + ***********/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_basic.h" + +#ifdef FTDI_BASIC + +/********************************* SPI Functions *********************************/ + +namespace FTDI { + #ifndef CLCD_USE_SOFT_SPI + SPISettings SPI::spi_settings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0); + #endif + + void SPI::spi_init() { + SET_OUTPUT(CLCD_MOD_RESET); // Module Reset (a.k.a. PD, not SPI) + WRITE(CLCD_MOD_RESET, 0); // start with module in power-down + + SET_OUTPUT(CLCD_SPI_CS); + WRITE(CLCD_SPI_CS, 1); + + #ifdef SPI_FLASH_SS + SET_OUTPUT(SPI_FLASH_SS); + WRITE(SPI_FLASH_SS, 1); + #endif + + #ifdef CLCD_USE_SOFT_SPI + SET_OUTPUT(CLCD_SOFT_SPI_MOSI); + WRITE(CLCD_SOFT_SPI_MOSI, 1); + + SET_OUTPUT(CLCD_SOFT_SPI_SCLK); + WRITE(CLCD_SOFT_SPI_SCLK, 0); + + SET_INPUT_PULLUP(CLCD_SOFT_SPI_MISO); + #else + ::SPI.begin(); + #endif + } + + #ifdef CLCD_USE_SOFT_SPI + uint8_t SPI::_soft_spi_xfer (uint8_t spiOutByte) { + uint8_t spiIndex = 0x80; + uint8_t spiInByte = 0; + uint8_t k; + + noInterrupts(); + for (k = 0; k < 8; k++) { // Output and Read each bit of spiOutByte and spiInByte + WRITE(CLCD_SOFT_SPI_MOSI, (spiOutByte & spiIndex) ? 1 : 0); // Output MOSI Bit + WRITE(CLCD_SOFT_SPI_SCLK, 1); // Pulse Clock + WRITE(CLCD_SOFT_SPI_SCLK, 0); + if (READ(CLCD_SOFT_SPI_MISO)) spiInByte |= spiIndex; + spiIndex >>= 1; + } + interrupts(); + return spiInByte; + } + #endif + + #ifdef CLCD_USE_SOFT_SPI + void SPI::_soft_spi_send (uint8_t spiOutByte) { + uint8_t k, spiIndex = 0x80; + + noInterrupts(); + for (k = 0; k < 8; k++) { // Output each bit of spiOutByte + WRITE(CLCD_SOFT_SPI_MOSI, (spiOutByte & spiIndex) ? 1 : 0); // Output MOSI Bit + WRITE(CLCD_SOFT_SPI_SCLK, 1); // Pulse Clock + WRITE(CLCD_SOFT_SPI_SCLK, 0); + spiIndex >>= 1; + } + interrupts(); + } + #endif + + void SPI::spi_read_bulk (void *data, uint16_t len) { + uint8_t* p = (uint8_t *)data; + #ifndef CLCD_USE_SOFT_SPI + ::SPI.transfer(p, len); + #else + while (len--) *p++ = spi_recv(); + #endif + } + + bool SPI::spi_verify_bulk (const void *data, uint16_t len) { + const uint8_t* p = (const uint8_t *)data; + while (len--) if (*p++ != spi_recv()) return false; + return true; + } + + // CLCD SPI - Chip Select + void SPI::spi_ftdi_select() { + #ifndef CLCD_USE_SOFT_SPI + ::SPI.beginTransaction(spi_settings); + #endif + WRITE(CLCD_SPI_CS, 0); + delayMicroseconds(1); + } + + // CLCD SPI - Chip Deselect + void SPI::spi_ftdi_deselect() { + WRITE(CLCD_SPI_CS, 1); + #ifndef CLCD_USE_SOFT_SPI + ::SPI.endTransaction(); + #endif + } + + #ifdef SPI_FLASH_SS + // Serial SPI Flash SPI - Chip Select + void SPI::spi_flash_select () { + #ifndef CLCD_USE_SOFT_SPI + ::SPI.beginTransaction(spi_settings); + #endif + WRITE(SPI_FLASH_SS, 0); + delayMicroseconds(1); + } + + // Serial SPI Flash SPI - Chip Deselect + void SPI::spi_flash_deselect () { + WRITE(SPI_FLASH_SS, 1); + #ifndef CLCD_USE_SOFT_SPI + ::SPI.endTransaction(); + #endif + } + #endif + + // Not really a SPI signal... + void SPI::ftdi_reset() { + WRITE(CLCD_MOD_RESET, 0); + delay(6); /* minimum time for power-down is 5ms */ + WRITE(CLCD_MOD_RESET, 1); + delay(21); /* minimum time to allow from rising PD_N to first access is 20ms */ + } + + // Not really a SPI signal... + void SPI::test_pulse() { + #ifdef CLCD_AUX_0 + WRITE(CLCD_AUX_0, 1); + delayMicroseconds(10); + WRITE(CLCD_AUX_0, 0); + #endif + } +} +#endif // FTDI_BASIC diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h new file mode 100644 index 000000000000..38f0e35d5a3e --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h @@ -0,0 +1,128 @@ +/********* + * spi.h * + *********/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#ifndef CLCD_USE_SOFT_SPI + #include +#endif + +namespace FTDI { + namespace SPI { + #ifndef CLCD_USE_SOFT_SPI + extern SPISettings spi_settings; + #endif + + uint8_t _soft_spi_xfer (uint8_t val); + void _soft_spi_send (uint8_t val); + + void spi_init (); + + void spi_ftdi_select (); + void spi_ftdi_deselect (); + + void spi_flash_select (); + void spi_flash_deselect (); + + inline uint8_t spi_recv() { + #ifdef CLCD_USE_SOFT_SPI + return _soft_spi_xfer(0x00); + #else + return ::SPI.transfer(0x00); + #endif + }; + + inline void spi_send (uint8_t val) { + #ifdef CLCD_USE_SOFT_SPI + _soft_spi_send(val); + #else + ::SPI.transfer(val); + #endif + }; + + inline void spi_write_8 (uint8_t val) {spi_send(val);}; + inline uint8_t spi_read_8 () {return spi_recv();}; + + namespace least_significant_byte_first { + inline void spi_write_16 (uint16_t val) {spi_send(val >> 0); + spi_send(val >> 8);}; + inline void spi_write_32 (uint32_t val) {spi_send(val >> 0); + spi_send(val >> 8); + spi_send(val >> 16); + spi_send(val >> 24);}; + + inline uint8_t spi_read_8 () {return spi_recv();}; + inline uint16_t spi_read_16 () {return (((uint16_t) spi_recv()) << 0) | + (((uint16_t) spi_recv()) << 8);}; + inline uint32_t spi_read_32 () {return (((uint32_t) spi_recv()) << 0) | + (((uint32_t) spi_recv()) << 8) | + (((uint32_t) spi_recv()) << 16) | + (((uint32_t) spi_recv()) << 24);}; + } + + namespace most_significant_byte_first { + inline void spi_write_16 (uint16_t val) {spi_send(val >> 8); + spi_send(val >> 0);}; + inline void spi_write_24 (uint32_t val) {spi_send(val >> 16); + spi_send(val >> 8); + spi_send(val >> 0);}; + inline void spi_write_32 (uint32_t val) {spi_send(val >> 24); + spi_send(val >> 16); + spi_send(val >> 8); + spi_send(val >> 0);}; + + inline uint16_t spi_read_16 () {return (((uint16_t) spi_recv()) << 8) | + (((uint16_t) spi_recv()) << 0);}; + inline uint32_t spi_read_32 () {return (((uint32_t) spi_recv()) << 24) | + (((uint32_t) spi_recv()) << 16) | + (((uint32_t) spi_recv()) << 8) | + (((uint32_t) spi_recv()) << 0);}; + } + + inline uint8_t ram_write(const uint8_t *p) {return *p;} + inline uint8_t pgm_write(const uint8_t *p) {return pgm_read_byte(p);} + + typedef uint8_t (*bulk_write_op)(const uint8_t*); + + // Generic template for function for writing multiple bytes, plus padding bytes. + // The template parameter op is an inlineable function which is applied to each byte. + + template + void spi_write_bulk(const void *data, uint16_t len, uint8_t padding) { + const uint8_t* p = (const uint8_t *)data; + while (len--) spi_send(byte_op(p++)); + while (padding--) spi_send(0); + } + + template + void spi_write_bulk(const void *data, uint16_t len) { + const uint8_t* p = (const uint8_t *)data; + while (len--) spi_send(byte_op(p++)); + } + + void spi_read_bulk( void *data, uint16_t len); + bool spi_verify_bulk(const void *data, uint16_t len); + + void ftdi_reset(); + void test_pulse(); + } +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h new file mode 100644 index 000000000000..0ef9779c7178 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h @@ -0,0 +1,224 @@ +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "../config.h" + +#ifdef __MARLIN_FIRMWARE__ + + // Marlin will define the I/O functions for us + #if ENABLED(TOUCH_UI_FTDI_EVE) + #define FTDI_BASIC + #define FTDI_EXTENDED + #endif + +#else // !__MARLIN_FIRMWARE__ + + #include + + #ifndef CLCD_USE_SOFT_SPI + #include + #endif + + namespace fast_io { + + template + struct port_pin { + typedef port_t port; + static inline void set_high() {port::port() = (port::port() | bits);} + static inline void set_low() {port::port() = (port::port() & (~bits));} + static inline void set_input() {port::ddr() = (port::ddr() & (~bits));} + static inline void set_input_pullup() {set_input(); set_high();} + static inline void set_output() {port::ddr() = (port::ddr() | bits);} + static inline uint8_t read() {return port::pin() & bits;} + static inline void write(bool v) {if (v) set_high(); else set_low();} + }; + + #define MAKE_AVR_PORT_PINS(ID) \ + struct port_##ID { \ + static volatile uint8_t &pin() {return PIN##ID;}; \ + static volatile uint8_t &port() {return PORT##ID;}; \ + static volatile uint8_t &ddr() {return DDR##ID;}; \ + }; \ + typedef port_pin AVR_##ID##0; \ + typedef port_pin AVR_##ID##1; \ + typedef port_pin AVR_##ID##2; \ + typedef port_pin AVR_##ID##3; \ + typedef port_pin AVR_##ID##4; \ + typedef port_pin AVR_##ID##5; \ + typedef port_pin AVR_##ID##6; \ + typedef port_pin AVR_##ID##7; + + #ifdef PORTA + MAKE_AVR_PORT_PINS(A); + #endif + #ifdef PORTB + MAKE_AVR_PORT_PINS(B); + #endif + #ifdef PORTC + MAKE_AVR_PORT_PINS(C); + #endif + #ifdef PORTD + MAKE_AVR_PORT_PINS(D); + #endif + #ifdef PORTE + MAKE_AVR_PORT_PINS(E); + #endif + #ifdef PORTF + MAKE_AVR_PORT_PINS(F); + #endif + #ifdef PORTG + MAKE_AVR_PORT_PINS(G); + #endif + #ifdef PORTH + MAKE_AVR_PORT_PINS(H); + #endif + #ifdef PORTJ + MAKE_AVR_PORT_PINS(J); + #endif + #ifdef PORTK + MAKE_AVR_PORT_PINS(K); + #endif + #ifdef PORTL + MAKE_AVR_PORT_PINS(L); + #endif + #ifdef PORTQ + MAKE_AVR_PORT_PINS(Q); + #endif + #ifdef PORTR + MAKE_AVR_PORT_PINS(R); + #endif + + #undef MAKE_AVR_PORT_PINS + + template + struct arduino_digital_pin { + static constexpr uint8_t pin = p; + static inline void set_high() {digitalWrite(p, HIGH);} + static inline void set_low() {digitalWrite(p, LOW);} + static inline void set_input() {pinMode(p, INPUT);} + static inline void set_input_pullup() {pinMode(p, INPUT_PULLUP);} + static inline void set_output() {pinMode(p, OUTPUT);} + static inline uint8_t read() {return digitalRead(p);} + static inline void write(bool v) {digitalWrite(p, v ? HIGH : LOW);} + }; + + #define MAKE_ARDUINO_PINS(ID) typedef arduino_digital_pin ARDUINO_DIGITAL_##ID; + MAKE_ARDUINO_PINS( 0); + MAKE_ARDUINO_PINS( 1); + MAKE_ARDUINO_PINS( 2); + MAKE_ARDUINO_PINS( 3); + MAKE_ARDUINO_PINS( 4); + MAKE_ARDUINO_PINS( 5); + MAKE_ARDUINO_PINS( 6); + MAKE_ARDUINO_PINS( 7); + MAKE_ARDUINO_PINS( 8); + MAKE_ARDUINO_PINS( 9); + MAKE_ARDUINO_PINS(10); + MAKE_ARDUINO_PINS(11); + MAKE_ARDUINO_PINS(12); + MAKE_ARDUINO_PINS(13); + MAKE_ARDUINO_PINS(14); + MAKE_ARDUINO_PINS(15); + MAKE_ARDUINO_PINS(16); + MAKE_ARDUINO_PINS(17); + MAKE_ARDUINO_PINS(18); + MAKE_ARDUINO_PINS(19); + MAKE_ARDUINO_PINS(10); + MAKE_ARDUINO_PINS(21); + MAKE_ARDUINO_PINS(22); + MAKE_ARDUINO_PINS(23); + MAKE_ARDUINO_PINS(24); + MAKE_ARDUINO_PINS(25); + MAKE_ARDUINO_PINS(26); + MAKE_ARDUINO_PINS(27); + MAKE_ARDUINO_PINS(28); + MAKE_ARDUINO_PINS(29); + MAKE_ARDUINO_PINS(30); + MAKE_ARDUINO_PINS(31); + MAKE_ARDUINO_PINS(32); + MAKE_ARDUINO_PINS(33); + MAKE_ARDUINO_PINS(34); + MAKE_ARDUINO_PINS(35); + MAKE_ARDUINO_PINS(36); + MAKE_ARDUINO_PINS(37); + MAKE_ARDUINO_PINS(38); + MAKE_ARDUINO_PINS(39); + MAKE_ARDUINO_PINS(40); + MAKE_ARDUINO_PINS(41); + MAKE_ARDUINO_PINS(42); + MAKE_ARDUINO_PINS(43); + MAKE_ARDUINO_PINS(44); + MAKE_ARDUINO_PINS(45); + MAKE_ARDUINO_PINS(46); + MAKE_ARDUINO_PINS(47); + MAKE_ARDUINO_PINS(48); + MAKE_ARDUINO_PINS(49); + MAKE_ARDUINO_PINS(50); + MAKE_ARDUINO_PINS(51); + MAKE_ARDUINO_PINS(52); + MAKE_ARDUINO_PINS(53); + #undef MAKE_ARDUINO_PINS + } // namespace fast_io + + #define SET_INPUT(pin) fast_io::pin::set_input() + #define SET_INPUT_PULLUP(pin) fast_io::pin::set_input(); fast_io::pin::set_high() + #define SET_OUTPUT(pin) fast_io::pin::set_output() + #define READ(pin) fast_io::pin::read() + #define WRITE(pin, value) fast_io::pin::write(value) + + #ifndef pgm_read_word_far + #define pgm_read_word_far pgm_read_word + #endif + + #ifndef pgm_read_dword_far + #define pgm_read_dword_far pgm_read_dword + #endif + + #ifndef pgm_read_ptr_far + #define pgm_read_ptr_far pgm_read_ptr + #endif + + #define SERIAL_ECHO_START() + #define SERIAL_ECHOLNPGM(str) Serial.println(F(str)) + #define SERIAL_ECHOPGM(str) Serial.print(F(str)) + #define SERIAL_ECHO_MSG(str) Serial.println(str) + #define SERIAL_ECHOLNPAIR(str, val) {Serial.print(F(str)); Serial.println(val);} + #define SERIAL_ECHOPAIR(str, val) {Serial.print(F(str)); Serial.print(val);} + + #define safe_delay delay + + // Define macros for compatibility + + #define _CAT(a, ...) a ## __VA_ARGS__ + #define SWITCH_ENABLED_ 1 + #define ENABLED(b) _CAT(SWITCH_ENABLED_, b) + #define DISABLED(b) !ENABLED(b) + #define ANY(A,B) (ENABLED(A) || ENABLED(B)) + #define BOTH(A,B) (ENABLED(A) && ENABLED(B)) + + // Remove compiler warning on an unused variable + #ifndef UNUSED + #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + #define UNUSED(X) (void)X + #else + #define UNUSED(x) ((void)(x)) + #endif + #endif + +#endif // !__MARLIN_FIRMWARE__ diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h new file mode 100644 index 000000000000..2a095c344553 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h @@ -0,0 +1,49 @@ +/***************** + * bitmap_info.h * + *****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#ifndef FORCEDINLINE + #define FORCEDINLINE __attribute__((always_inline)) inline +#endif + +namespace FTDI { + // The following functions *must* be inlined since we are relying on the compiler to do + // substitution of the constants from the data structure rather than actually storing + // it in PROGMEM (which would fail, since we are not using pgm_read to read them). + // Plus, by inlining, all the equations are evaluated at compile-time as everything + // should be a constant. + + typedef struct { + const uint8_t format; + const uint16_t linestride; + const uint8_t filter; + const uint8_t wrapx; + const uint8_t wrapy; + const uint32_t RAMG_offset; + const uint16_t width; + const uint16_t height; + } bitmap_info_t; + + FORCEDINLINE uint32_t BITMAP_SOURCE (const bitmap_info_t& info) {return BITMAP_SOURCE (ftdi_memory_map::RAM_G + info.RAMG_offset);}; + FORCEDINLINE uint32_t BITMAP_LAYOUT (const bitmap_info_t& info) {return BITMAP_LAYOUT (info.format, info.linestride, info.height);}; + FORCEDINLINE uint32_t BITMAP_SIZE (const bitmap_info_t& info) {return BITMAP_SIZE (info.filter, info.wrapx, info.wrapy, info.width, info.height);} +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp new file mode 100644 index 000000000000..08d208202048 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp @@ -0,0 +1,29 @@ +/************************* + * command_processor.cpp * + *************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_extended.h" + +#ifdef FTDI_EXTENDED + +CommandProcessor::btn_style_func_t *CommandProcessor::_btn_style_callback = CommandProcessor::default_button_style_func; +bool CommandProcessor::is_tracking = false; + +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h new file mode 100644 index 000000000000..b045ca203abc --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h @@ -0,0 +1,434 @@ +/*********************** + * command_processor.h * + ***********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +typedef struct { + uint32_t bg; + uint32_t grad; + uint32_t fg; + uint32_t rgb; +} btn_colors; + +// Disable TOUCH_UI_FIT_TEXT on a case-by-case basis +namespace FTDI { + constexpr uint16_t OPT_NOFIT = OPT_NOTICKS; +} + +/**************************** Enhanced Command Processor **************************/ + +/* The CommandProcessor class wraps the CommandFifo with several features to make + * defining user interfaces much easier. + * + * - Implements chaining on all methods + * - Automatically adds text to button, toggle, text and keys. + * - Constrains all widgets to fit inside a box for ease of layout. + * - Font size is specified using a chained modifier. + * - Option argument is given the default OPT_3D value. + */ + +class CommandProcessor : public CLCD::CommandFifo { + public: + static constexpr uint8_t STYLE_DISABLED = 0x80; + + private: + static bool default_button_style_func(CommandProcessor &, uint8_t tag, uint8_t & /*style*/, uint16_t &options, bool) { + if (tag != 0 && FTDI::EventLoop::get_pressed_tag() == tag) { + options = FTDI::OPT_FLAT; + } + return false; + } + + typedef bool btn_style_func_t(CommandProcessor &cmd, uint8_t tag, uint8_t &style, uint16_t &options, bool post); + + static btn_style_func_t *_btn_style_callback; + static bool is_tracking; + int8_t _font = 26, _tag = 0; + uint8_t _style = 0; + + protected: + // Returns the cannonical thickness of a widget (i.e. the height of a toggle element) + uint16_t widget_thickness() { + CLCD::FontMetrics fm(_font); + return fm.height * 20.0/16; + } + + FORCEDINLINE void linear_widget_box(int16_t &x, int16_t &y, int16_t &w, int16_t &h, bool tracker = false) { + const uint16_t th = widget_thickness() / 2; + if (w > h) { + x += tracker ? th * 2.5 : th; + y += (h - th) / 2; + w -= tracker ? th * 5.0 : th * 2; + h = th; + } else { + x += (w - th) / 2; + y += tracker ? th * 2.5 : th; + w = th; + h -= tracker ? th * 5.0 : th * 2; + } + } + + FORCEDINLINE uint16_t circular_widget_box(int16_t &x, int16_t &y, int16_t &w, int16_t &h) { + const uint16_t r = min(w,h) / 2; + x += w / 2; + y += h / 2; + w = 1; + h = 1; + return r; + } + + public: + // Helper method for setting all colors at once + inline CommandProcessor& colors(const btn_colors &colors) { + cmd(FTDI::COLOR_RGB(colors.rgb)) + .gradcolor(colors.grad) + .fgcolor(colors.fg) + .bgcolor(colors.bg); + return *this; + } + + inline CommandProcessor& bitmap_size(uint8_t filter, uint8_t wrapx, uint8_t wrapy, uint16_t width, uint16_t height) { + cmd(FTDI::BITMAP_SIZE(filter, wrapx, wrapy, width, height)); + #if FTDI_API_LEVEL >= 810 + if (FTDI::ftdi_chip >= 810) + cmd(FTDI::BITMAP_SIZE_H(width >> 9, height >> 9)); + #endif + return *this; + } + + inline CommandProcessor& bitmap_layout(uint8_t format, uint16_t linestride, uint16_t height) { + cmd(FTDI::BITMAP_LAYOUT(format, linestride, height)); + #if FTDI_API_LEVEL >= 810 + if (FTDI::ftdi_chip >= 810) + cmd(FTDI::BITMAP_LAYOUT_H(linestride >> 10, height >> 9)); + #endif + return *this; + } + + inline CommandProcessor& set_button_style_callback(const btn_style_func_t *func) { + _btn_style_callback = func ? func : default_button_style_func; + return *this; + } + + inline CommandProcessor& tag (uint8_t tag) {_tag = tag; cmd(FTDI::TAG(tag)); return *this;} + + inline CommandProcessor& font (int16_t font) {_font = font; return *this;} + + inline CommandProcessor& enabled (bool enabled=false) { + if (enabled) + _style &= ~STYLE_DISABLED; + else + _style |= STYLE_DISABLED; + return *this; + } + + inline CommandProcessor& style (uint8_t style) { + _style = (_style & STYLE_DISABLED) | style; + return *this; + } + + // Wrap all the CommandFifo routines to allow method chaining + + inline CommandProcessor& cmd (uint32_t cmd32) {CLCD::CommandFifo::cmd(cmd32); return *this;} + inline CommandProcessor& cmd (void* data, uint16_t len) {CLCD::CommandFifo::cmd(data, len); return *this;} + inline CommandProcessor& execute() {CLCD::CommandFifo::execute(); return *this;} + + inline CommandProcessor& fgcolor (uint32_t rgb) {CLCD::CommandFifo::fgcolor(rgb); return *this;} + inline CommandProcessor& bgcolor (uint32_t rgb) {CLCD::CommandFifo::bgcolor(rgb); return *this;} + inline CommandProcessor& gradcolor(uint32_t rgb) {CLCD::CommandFifo::gradcolor(rgb); return *this;} + + inline CommandProcessor& snapshot (uint32_t ptr) {CLCD::CommandFifo::snapshot(ptr); return *this;} + + inline CommandProcessor& loadimage(uint32_t ptr, uint32_t options) + {CLCD::CommandFifo::loadimage(ptr, options); return *this;} + inline CommandProcessor& sketch (int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format) + {CLCD::CommandFifo::sketch(x, y, w, h, ptr, format); return *this;} + inline CommandProcessor& screensaver () {CLCD::CommandFifo::screensaver(); return *this;} + #if FTDI_API_LEVEL >= 810 + inline CommandProcessor& setbase (uint8_t base) {CLCD::CommandFifo::setbase(base); return *this;} + #endif + inline CommandProcessor& loadidentity () {CLCD::CommandFifo::loadidentity(); return *this;} + inline CommandProcessor& scale (int32_t sx, int32_t sy) {CLCD::CommandFifo::scale(sx,sy); return *this;} + inline CommandProcessor& rotate (int32_t a) {CLCD::CommandFifo::rotate(a); return *this;} + inline CommandProcessor& translate(int32_t tx, int32_t ty) {CLCD::CommandFifo::translate(tx,ty); return *this;} + inline CommandProcessor& setmatrix () {CLCD::CommandFifo::setmatrix(); return *this;} + inline CommandProcessor& stop () {CLCD::CommandFifo::stop(); return *this;} + + inline CommandProcessor& memzero (uint32_t ptr, uint32_t size) + {CLCD::CommandFifo::memzero(ptr, size); return *this;} + inline CommandProcessor& memset (uint32_t ptr, uint32_t val, uint32_t size) + {CLCD::CommandFifo::memset(ptr, val, size); return *this;} + inline CommandProcessor& memcpy (uint32_t src, uint32_t dst, uint32_t size) + {CLCD::CommandFifo::memcpy(src, dst, size); return *this;} + inline CommandProcessor& memcrc (uint32_t ptr, uint32_t num, uint32_t result) + {CLCD::CommandFifo::memcrc(ptr, num, result); return *this;} + inline CommandProcessor& memwrite (uint32_t ptr, uint32_t value) + {CLCD::CommandFifo::memwrite(ptr, value); return *this;} + inline CommandProcessor& inflate (uint32_t ptr) + {CLCD::CommandFifo::inflate(ptr); return *this;} + inline CommandProcessor& getptr (uint32_t result) + {CLCD::CommandFifo::getptr(result); return *this;} + inline CommandProcessor& getprops (uint32_t ptr, uint32_t width, uint32_t height) + {CLCD::CommandFifo::getprops(ptr, width, height); return *this;} + + #if FTDI_API_LEVEL >= 810 + inline CommandProcessor& setbitmap (uint32_t ptr, uint16_t fmt, uint16_t w, uint16_t h) + {CLCD::CommandFifo::setbitmap(ptr,fmt,w,h); return *this;} + inline CommandProcessor& snapshot2 (uint32_t fmt, uint32_t ptr, int16_t x, int16_t y, uint16_t w, uint16_t h) + {CLCD::CommandFifo::snapshot2(fmt,ptr,x,y,w,h); return *this;} + inline CommandProcessor& mediafifo (uint32_t p, uint32_t s) {CLCD::CommandFifo::mediafifo(p, s); return *this;} + inline CommandProcessor& playvideo(uint32_t options) {CLCD::CommandFifo::playvideo(options); return *this;} + inline CommandProcessor& romfont(uint8_t font, uint8_t slot) {CLCD::CommandFifo::romfont(font, slot); return *this;} + #endif + + inline CommandProcessor& gradient(int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1) + {CLCD::CommandFifo::gradient(x0,y0,rgb0,x1,y1,rgb1); return *this;} + + inline CommandProcessor& rectangle(int16_t x, int16_t y, int16_t w, int16_t h) { + using namespace FTDI; + CLCD::CommandFifo::cmd(BEGIN(RECTS)); + CLCD::CommandFifo::cmd(VERTEX2F(x * 16, y * 16)); + CLCD::CommandFifo::cmd(VERTEX2F((x + w) * 16, (y + h) * 16)); + return *this; + } + + template + FORCEDINLINE CommandProcessor& toggle(int16_t x, int16_t y, int16_t w, int16_t h, T text, bool state, uint16_t options = FTDI::OPT_3D) { + CLCD::FontMetrics fm(_font); + const int16_t widget_h = fm.height * 20.0 / 16; + //const int16_t outer_bar_r = widget_h / 2; + //const int16_t knob_r = outer_bar_r - 1.5; + // The y coordinate of the toggle is the baseline of the text, + // so we must introduce a fudge factor based on the line height to + // actually center the control. + const int16_t fudge_y = fm.height * 5 / 16; + CLCD::CommandFifo::toggle(x + h / 2, y + (h - widget_h) / 2 + fudge_y, w - h, _font, options, state); + CLCD::CommandFifo::str(text); + return *this; + } + + CommandProcessor& toggle2(int16_t x, int16_t y, int16_t w, int16_t h, progmem_str no, progmem_str yes, bool state, uint16_t options = FTDI::OPT_3D) { + char text[strlen_P((const char *)no) + strlen_P((const char *)yes) + 2]; + strcpy_P(text, (const char *)no); + strcat(text, "\xFF"); + strcat_P(text, (const char *)yes); + return toggle(x, y, w, h, text, state, options); + } + + // Contrained drawing routines. These constrain the widget inside a box for easier layout. + // The FORCEDINLINE ensures that the code is inlined so that all the math is done at compile time. + + FORCEDINLINE CommandProcessor& track_linear(int16_t x, int16_t y, int16_t w, int16_t h, int16_t tag) { + linear_widget_box(x, y, w, h, true); + CLCD::CommandFifo::track(x, y, w, h, tag); + is_tracking = true; + return *this; + } + + FORCEDINLINE CommandProcessor& track_circular(int16_t x, int16_t y, int16_t w, int16_t h, int16_t tag) { + circular_widget_box(x,y, w, h); + CLCD::CommandFifo::track(x, y, w, h, tag); + is_tracking = true; + return *this; + } + + uint8_t track_tag (uint16_t &value) { + if (is_tracking) { + if (FTDI::EventLoop::is_touch_held()) { + return CLCD::get_tracker(value); + } else { + CLCD::CommandFifo::track(0, 0, 0, 0, 0); + CLCD::CommandFifo::execute(); + is_tracking = false; + } + } + return 0; + } + + FORCEDINLINE CommandProcessor& clock(int16_t x, int16_t y, int16_t w, int16_t h, int16_t hr, int16_t m, int16_t s, int16_t ms, uint16_t options = FTDI::OPT_3D) { + const uint16_t r = circular_widget_box(x, y, w, h); + CLCD::CommandFifo::clock(x, y, r, options, hr, m, s, ms); + return *this; + } + + FORCEDINLINE CommandProcessor& gauge(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t major, uint16_t minor, uint16_t val, uint16_t range, uint16_t options = FTDI::OPT_3D) { + const uint16_t r = circular_widget_box(x, y, w, h); + CLCD::CommandFifo::gauge(x, y, r, options, major, minor, val, range); + return *this; + } + + FORCEDINLINE CommandProcessor& dial(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t val, uint16_t options = FTDI::OPT_3D) { + const uint16_t r = circular_widget_box(x, y, w, h); + CLCD::CommandFifo::dial(x, y, r, options, val); + return *this; + } + + FORCEDINLINE CommandProcessor& slider(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t val, uint16_t range, uint16_t options = FTDI::OPT_3D) { + linear_widget_box(x, y, w, h); + CLCD::CommandFifo::slider(x, y, w, h, options, val, range); + return *this; + } + + FORCEDINLINE CommandProcessor& progress(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t val, uint16_t range, uint16_t options = FTDI::OPT_3D) { + linear_widget_box(x, y, w, h); + CLCD::CommandFifo::progress(x, y, w, h, options, val, range); + return *this; + } + + FORCEDINLINE CommandProcessor& scrollbar(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t val, uint16_t size, uint16_t range, uint16_t options = 0) { + linear_widget_box(x, y, w, h); + CLCD::CommandFifo::scrollbar(x, y, w, h, options, val, size, range); + return *this; + } + + void apply_text_alignment(int16_t &x, int16_t &y, int16_t w, int16_t h, uint16_t options) { + using namespace FTDI; + x += ((options & OPT_CENTERX) ? w/2 : ((options & OPT_RIGHTX) ? w : 0)); + y += ((options & OPT_CENTERY) ? h/2 : h); + } + + // Reduce font size until text fits the enclosing box. + template + int8_t apply_fit_text(int16_t w, int16_t h, T text) { + using namespace FTDI; + int8_t font = _font; + #ifdef TOUCH_UI_USE_UTF8 + const bool is_utf8 = has_utf8_chars(text); + #endif + for (;font >= 26;) { + int16_t width, height; + #ifdef TOUCH_UI_USE_UTF8 + if (is_utf8) { + width = get_utf8_text_width(text, font_size_t::from_romfont(font)); + height = font_size_t::from_romfont(font).get_height(); + } else + #endif + { + CLCD::FontMetrics fm(font); + width = fm.get_text_width(text); + height = fm.height; + } + if (width < w && height < h) break; + font--; + } + return font; + } + + CommandProcessor& number(int16_t x, int16_t y, int16_t w, int16_t h, int32_t n, uint16_t options = FTDI::OPT_CENTER) { + using namespace FTDI; + apply_text_alignment(x, y, w, h, options); + CLCD::CommandFifo::number(x, y, _font, options, n); + return *this; + } + + template + uint16_t text_width(T text) { + using namespace FTDI; + #ifdef TOUCH_UI_USE_UTF8 + if (has_utf8_chars(text)) + return get_utf8_text_width(text, font_size_t::from_romfont(_font)); + #endif + CLCD::FontMetrics fm(_font); + return fm.get_text_width(text); + } + + template + CommandProcessor& text(int16_t x, int16_t y, int16_t w, int16_t h, T text, uint16_t options = FTDI::OPT_CENTER) { + using namespace FTDI; + apply_text_alignment(x, y, w, h, options); + #ifdef TOUCH_UI_FIT_TEXT + const int8_t font = (options & OPT_NOFIT) ? _font : apply_fit_text(w, h, text); + #else + const int8_t font = _font; + #endif + #ifdef TOUCH_UI_USE_UTF8 + if (has_utf8_chars(text)) + draw_utf8_text(*this, x, y, text, font_size_t::from_romfont(font), options); + else + #endif + { + CLCD::CommandFifo::text(x, y, font, options); + CLCD::CommandFifo::str(text); + } + return *this; + } + + FORCEDINLINE CommandProcessor& icon(int16_t x, int16_t y, int16_t w, int16_t h, const FTDI::bitmap_info_t& info, const float scale = 1) { + using namespace FTDI; + cmd(BEGIN(BITMAPS)); + if (scale != 1) { + cmd(BITMAP_TRANSFORM_A(uint32_t(float(256)/scale))); + cmd(BITMAP_TRANSFORM_E(uint32_t(float(256)/scale))); + } + cmd(BITMAP_SIZE(info.filter, info.wrapx, info.wrapy, info.width*scale, info.height*scale)); + cmd(VERTEX2F((x + w/2 - info.width*scale/2)*16, (y + h/2 - info.height*scale/2)*16)); + if (scale != 1) { + cmd(BITMAP_TRANSFORM_A(256)); + cmd(BITMAP_TRANSFORM_E(256)); + } + return *this; + } + + template + CommandProcessor& button(int16_t x, int16_t y, int16_t w, int16_t h, T text, uint16_t options = FTDI::OPT_3D) { + using namespace FTDI; + bool styleModified = false; + if (_btn_style_callback) styleModified = _btn_style_callback(*this, _tag, _style, options, false); + #ifdef TOUCH_UI_FIT_TEXT + const int8_t font = (options & OPT_NOFIT) ? _font : apply_fit_text(w, h, text); + #else + const int8_t font = _font; + #endif + CLCD::CommandFifo::button(x, y, w, h, font, options); + #ifdef TOUCH_UI_USE_UTF8 + if (has_utf8_chars(text)) { + CLCD::CommandFifo::str(F("")); + apply_text_alignment(x, y, w, h, OPT_CENTER); + if (!(options & FTDI::OPT_FLAT)) { + // Reproduce the black "shadow" the FTDI adds to the button label + CLCD::CommandFifo::cmd(SAVE_CONTEXT()); + CLCD::CommandFifo::cmd(COLOR_RGB(0x00000)); + draw_utf8_text(*this, x-1, y-1, text, font_size_t::from_romfont(font), OPT_CENTER); + CLCD::CommandFifo::cmd(RESTORE_CONTEXT()); + } + // Draw the button label + draw_utf8_text(*this, x, y, text, font_size_t::from_romfont(font), OPT_CENTER); + } + else + #endif + CLCD::CommandFifo::str(text); + if (_btn_style_callback && styleModified) _btn_style_callback(*this, _tag, _style, options, true); + return *this; + } + + template + CommandProcessor& keys(int16_t x, int16_t y, int16_t w, int16_t h, T keys, uint16_t options = FTDI::OPT_3D) { + CLCD::CommandFifo::keys(x, y, w, h, _font, options); + CLCD::CommandFifo::str(keys); + return *this; + } + + FORCEDINLINE CommandProcessor& spinner(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t style = 0, uint16_t scale = 0) { + circular_widget_box(x, y, w, h); + CLCD::CommandFifo::spinner(x, y, style, scale); + return *this; + } +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp new file mode 100644 index 000000000000..9a55c55ae62a --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp @@ -0,0 +1,175 @@ +/**************** + * dl_cache.cpp * + ****************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_extended.h" + +#ifdef FTDI_EXTENDED + +/* The Display List Cache mechanism stores the display list corresponding + * to a menu into RAM_G so that on subsequent calls drawing the menu does + * not require as much SPI traffic. + * + * Layout of Cache memory: + * + * The cache memory begins with a table at + * DL_CACHE_START: each table entry contains + * an address and size for a cached DL slot. + * + * Immediately following the table is the + * DL_FREE_ADDR, which points to free cache + * space; following this is occupied DL space, + * and after that free space that is yet to + * be used. + * + * location data sizeof + * + * DL_CACHE_START slot0_addr 4 + * slot0_size 4 + * slot1_addr 4 + * slot1_size 4 + * ... + * slotN_addr 4 + * slotN_size 4 + * DL_FREE_ADDR dl_free_ptr 4 + * cached data + * ... + * dl_free_ptr empty space + * ... + */ + +#define DL_CACHE_START MAP::RAM_G_SIZE - 0xFFFF +#define DL_FREE_ADDR DL_CACHE_START + DL_CACHE_SLOTS * 8 + +using namespace FTDI; + +// The init function ensures all cache locations are marked as empty + +void DLCache::init() { + CLCD::mem_write_32(DL_FREE_ADDR, DL_FREE_ADDR + 4); + for(uint8_t slot = 0; slot < DL_CACHE_SLOTS; slot++) { + save_slot(slot, 0, 0); + } +} + +bool DLCache::has_data() { + return dl_size != 0; +} + +bool DLCache::wait_until_idle() { + const unsigned long startTime = millis(); + do { + if ((millis() - startTime) > 250) { + SERIAL_ECHO_MSG("Timeout on DL_Cache::Wait_Until_Idle()"); + CLCD::CommandFifo::reset(); + return false; + } + #ifdef __MARLIN_FIRMWARE__ + ExtUI::yield(); + #endif + } while (CLCD::CommandFifo::is_processing()); + return true; +} + +/* This caches the current display list in RAMG so + * that it can be appended later. The memory is + * dynamically allocated following DL_FREE_ADDR. + * + * If num_bytes is provided, then that many bytes + * will be reserved so that the cache may be re-written + * later with potentially a bigger DL. + */ + +bool DLCache::store(uint32_t num_bytes /* = 0*/) { + CLCD::CommandFifo cmd; + + // Execute any commands already in the FIFO + cmd.execute(); + if (!wait_until_idle()) + return false; + + // Figure out how long the display list is + uint32_t new_dl_size = CLCD::mem_read_32(REG::CMD_DL) & 0x1FFF; + uint32_t free_space = 0; + uint32_t dl_alloc = 0; + + if (dl_addr == 0) { + // If we are allocating new space... + dl_addr = CLCD::mem_read_32(DL_FREE_ADDR); + free_space = MAP::RAM_G_SIZE - dl_addr; + dl_alloc = num_bytes ?: new_dl_size; + dl_size = new_dl_size; + } else { + // Otherwise, we can only store as much space + // as was previously allocated. + free_space = num_bytes ?: dl_size; + dl_alloc = 0; + dl_size = new_dl_size; + } + + if (dl_size > free_space) { + // Not enough memory to cache the display list. + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR ("Not enough space in GRAM to cache display list, free space: ", free_space); + SERIAL_ECHOLNPAIR(" Required: ", dl_size); + #endif + return false; + } else { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR ("Saving DL to RAMG cache, bytes: ", dl_size); + SERIAL_ECHOLNPAIR(" Free space: ", free_space); + #endif + cmd.memcpy(dl_addr, MAP::RAM_DL, dl_size); + cmd.execute(); + save_slot(dl_slot, dl_addr, dl_size); + if (dl_alloc > 0) { + // If we allocated space dynamically, then adjust dl_free_addr. + CLCD::mem_write_32(DL_FREE_ADDR, dl_addr + dl_alloc); + } + return true; + } +} + +void DLCache::save_slot(uint8_t dl_slot, uint32_t dl_addr, uint32_t dl_size) { + CLCD::mem_write_32(DL_CACHE_START + dl_slot * 8 + 0, dl_addr); + CLCD::mem_write_32(DL_CACHE_START + dl_slot * 8 + 4, dl_size); +} + +void DLCache::load_slot() { + dl_addr = CLCD::mem_read_32(DL_CACHE_START + dl_slot * 8 + 0); + dl_size = CLCD::mem_read_32(DL_CACHE_START + dl_slot * 8 + 4); +} + +void DLCache::append() { + CLCD::CommandFifo cmd; + cmd.append(dl_addr, dl_size); + #if ENABLED(TOUCH_UI_DEBUG) + cmd.execute(); + wait_until_idle(); + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR ("Appending to DL from RAMG cache, bytes: ", dl_size); + SERIAL_ECHOLNPAIR(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL)); + #endif +} + +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h new file mode 100644 index 000000000000..f025b6a18d27 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h @@ -0,0 +1,69 @@ +/************** + * dl_cache.h * + **************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/******************* DISPLAY LIST CACHE MANAGEMENT ************************/ +/* The Display List Cache mechanism stores the display list corresponding + * to a menu into RAM_G so that on subsequent calls drawing the menu does + * not require as much SPI traffic. Dynamic content, such as indicators, + * should not be cached. + * + * The DLCache can be used like so: + * + * void some_function() { + * DLCache dlcache(UNIQUE_ID); + * + * if (dlcache.hasData()) { + * dlcache.append(); + * } else { + * // Add stuff to the DL + * dlcache.store(); + * } + */ +class DLCache { + private: + typedef FTDI::ftdi_registers REG; + typedef FTDI::ftdi_memory_map MAP; + + uint8_t dl_slot; + uint32_t dl_addr; + uint16_t dl_size; + + void load_slot(); + static void save_slot(uint8_t dl_slot, uint32_t dl_addr, uint32_t dl_size); + + bool wait_until_idle(); + + public: + static void init(); + + DLCache(uint8_t slot) { + dl_slot = slot; + load_slot(); + } + + bool has_data(); + bool store(uint32_t num_bytes = 0); + void append(); +}; + +#define DL_CACHE_SLOTS 250 diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp new file mode 100644 index 000000000000..f0f693bfd887 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp @@ -0,0 +1,232 @@ +/****************** + * event_loop.cpp * + ******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_extended.h" + +#ifdef FTDI_EXTENDED +using namespace FTDI; + +enum { + UNPRESSED = 0x00 +}; + +tiny_timer_t touch_timer; +UIData::flags_t UIData::flags; +uint8_t pressed_tag = UNPRESSED; + +uint8_t UIData::get_persistent_data_mask() { + // A bit mask for flags that should be stored to the EEPROM. + // Others are considered temporarily values that need not be + // saved. + constexpr flags_t persistent_flags = { + bits: { + touch_start_sound: true, + touch_end_sound: true, + touch_repeat_sound: true, + show_animations: true + } + }; + return persistent_flags.value; +} + +void UIData::reset_persistent_data() { + // Default values for persistent data + constexpr flags_t default_flags = { + bits: { + touch_start_sound: true, + touch_end_sound: true, + touch_repeat_sound: true, + show_animations: true, + touch_debouncing: false, + ignore_unpress: false + } + }; + flags.value = default_flags.value; +} + +uint8_t UIData::get_persistent_data() { + return flags.value & get_persistent_data_mask(); +} + +void UIData::set_persistent_data(uint8_t value) { + flags.value = value & get_persistent_data_mask(); +} + + +void UIData::enable_touch_sounds(bool enabled) { + UIData::flags.bits.touch_start_sound = enabled; + UIData::flags.bits.touch_end_sound = enabled; + UIData::flags.bits.touch_repeat_sound = enabled; +} + +bool UIData::touch_sounds_enabled() { + return UIData::flags.bits.touch_start_sound || UIData::flags.bits.touch_end_sound || UIData::flags.bits.touch_repeat_sound; +} + +void UIData::enable_animations(bool enabled) { + UIData::flags.bits.show_animations = enabled; +} + +bool UIData::animations_enabled() { + return UIData::flags.bits.show_animations; +} + +namespace FTDI { + uint8_t EventLoop::get_pressed_tag() { + return pressed_tag; + } + + bool EventLoop::is_touch_held() { + return pressed_tag != 0; + } + + /** + * process_events(): Process events from the touch panel. + * + * This function consists of a state machine that accomplishes the following: + * + * - Reads the tag register from the touch panel + * - Dispatches onTouchStart and onTouchEnd events to the active screen. + * - Handles auto-repetition by sending onTouchHeld to the active screen periodically. + * - Plays touch feedback "click" sounds when appropriate. + * - Performs debouncing to supress spurious touch events. + * + */ + void EventLoop::process_events() { + // If the LCD is processing commands, don't check + // for tags since they may be changing and could + // cause spurious events. + if (!touch_timer.elapsed(TOUCH_UPDATE_INTERVAL) || CLCD::CommandFifo::is_processing()) { + return; + } + + const uint8_t tag = CLCD::get_tag(); + + switch (pressed_tag) { + case UNPRESSED: + if (tag != 0) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("Touch start: ", tag); + #endif + + pressed_tag = tag; + current_screen.onRefresh(); + + // When the user taps on a button, activate the onTouchStart handler + const uint8_t lastScreen = current_screen.getScreen(); + + if (current_screen.onTouchStart(tag)) { + touch_timer.start(); + if (UIData::flags.bits.touch_start_sound) sound.play(press_sound); + } + + if (lastScreen != current_screen.getScreen()) { + // In the case in which a touch event triggered a new screen to be + // drawn, we don't issue a touchEnd since it would be sent to the + // wrong screen. + UIData::flags.bits.ignore_unpress = true; + } else { + UIData::flags.bits.ignore_unpress = false; + } + } else { + touch_timer.start(); + } + break; + default: // PRESSED + if (!UIData::flags.bits.touch_debouncing) { + if (tag == pressed_tag) { + // The user is holding down a button. + if (touch_timer.elapsed(1000 / TOUCH_REPEATS_PER_SECOND)) { + if (current_screen.onTouchHeld(tag)) { + current_screen.onRefresh(); + if (UIData::flags.bits.touch_repeat_sound) sound.play(repeat_sound); + } + touch_timer.start(); + } + } + else if (tag == 0) { + touch_timer.start(); + UIData::flags.bits.touch_debouncing = true; + } + } + + else { + // Debouncing... + + if (tag == pressed_tag) { + // If while debouncing, we detect a press, then cancel debouncing. + UIData::flags.bits.touch_debouncing = false; + } + + else if (touch_timer.elapsed(DEBOUNCE_PERIOD)) { + UIData::flags.bits.touch_debouncing = false; + + if (UIData::flags.bits.ignore_unpress) { + UIData::flags.bits.ignore_unpress = false; + pressed_tag = UNPRESSED; + break; + } + + if (UIData::flags.bits.touch_end_sound) sound.play(unpress_sound); + + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("Touch end: ", tag); + #endif + + const uint8_t saved_pressed_tag = pressed_tag; + pressed_tag = UNPRESSED; + current_screen.onTouchEnd(saved_pressed_tag); + current_screen.onRefresh(); + } + } + break; + } // switch (pressed_tag) + + } // processEvents() + + void EventLoop::setup() { + CLCD::init(); + DLCache::init(); + UIData::reset_persistent_data(); + current_screen.start(); + } + + void EventLoop::loop() { + sound.onIdle(); + + /** + * Guard against re-entry of UI methods, which can + * crash. Re-entry can happen because some functions + * (e.g. planner.synchronize) call idle(). + */ + if (!UIData::flags.bits.prevent_reentry) { + UIData::flags.bits.prevent_reentry = true; + current_screen.onIdle(); + process_events(); + UIData::flags.bits.prevent_reentry = false; + } + } +} // namespace FTDI + +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h new file mode 100644 index 000000000000..7eeea9c8154a --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h @@ -0,0 +1,74 @@ +/**************** + * event_loop.h * + ****************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define STATUS_UPDATE_INTERVAL 1000 +#define TOUCH_UPDATE_INTERVAL 50 +#define TOUCH_REPEATS_PER_SECOND 4 +#define DEBOUNCE_PERIOD 150 + +class UIData { + private: + typedef union { + struct { + uint8_t touch_start_sound : 1; + uint8_t touch_end_sound : 1; + uint8_t touch_repeat_sound : 1; + uint8_t show_animations : 1; + uint8_t touch_debouncing : 1; + uint8_t ignore_unpress : 1; + uint8_t prevent_reentry : 1; + } bits; + uint8_t value; + } flags_t; + + public: + static flags_t flags; + + static uint8_t get_persistent_data_mask(); + static uint8_t get_persistent_data(); + static void set_persistent_data(uint8_t value); + static void reset_persistent_data(); + + static void enable_touch_sounds(bool enabled); + static bool touch_sounds_enabled(); + static void enable_animations(bool enabled); + static bool animations_enabled(); +}; + +namespace FTDI { + class EventLoop { + private: + static constexpr FTDI::effect_t press_sound = FTDI::CHACK; + static constexpr FTDI::effect_t repeat_sound = FTDI::CHACK; + static constexpr FTDI::effect_t unpress_sound = FTDI::POP; + static void process_events(); + + public: + static void setup(); + static void loop(); + + static uint8_t get_pressed_tag(); + static bool is_touch_held(); + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h new file mode 100644 index 000000000000..329bea46f19a --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h @@ -0,0 +1,50 @@ +/******************* + * ftdi_extended.h * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2019 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 201( - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "../compat.h" +#include "../basic/ftdi_basic.h" + +#ifndef __MARLIN_FIRMWARE__ + #define FTDI_EXTENDED +#endif + +#ifdef FTDI_EXTENDED + #include "unicode/font_size_t.h" + #include "unicode/unicode.h" + #include "unicode/standard_char_set.h" + #include "unicode/western_char_set.h" + #include "unicode/font_bitmaps.h" + #include "rgb_t.h" + #include "bitmap_info.h" + #include "tiny_timer.h" + #include "grid_layout.h" + #include "dl_cache.h" + #include "event_loop.h" + #include "command_processor.h" + #include "screen_types.h" + #include "sound_player.h" + #include "sound_list.h" + #include "polygon.h" + #include "text_box.h" +#endif diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h new file mode 100644 index 000000000000..ec8154b22f69 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h @@ -0,0 +1,98 @@ +/***************** + * grid_layout.h * + *****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/* The grid layout macros allow buttons to be arranged on a grid so + * that their locations become independent of the display size. The + * layout model is similar to that of HTML TABLEs. + * + * These macros are meant to be evaluated into constants at compile + * time, so resolution independence can be as efficient as using + * hard-coded coordinates. + */ + +// Margin defines the margin (in pixels) on each side of a button in +// the layout + +#ifdef TOUCH_UI_800x480 + #define MARGIN_L 5 + #define MARGIN_R 5 + #define MARGIN_T 5 + #define MARGIN_B 5 + #define MARGIN_DEFAULT 5 +#else + #define MARGIN_L 3 + #define MARGIN_R 3 + #define MARGIN_T 3 + #define MARGIN_B 3 + #define MARGIN_DEFAULT 3 +#endif + +// EDGE_R adds some black space on the right edge of the display +// This shifts some of the screens left to visually center them. + +#define EDGE_R 0 + +// GRID_X and GRID_Y computes the positions of the divisions on +// the layout grid. +#define GRID_X(x) ((x)*(FTDI::display_width-EDGE_R)/GRID_COLS) +#define GRID_Y(y) ((y)*FTDI::display_height/GRID_ROWS) + +// BTN_X, BTN_Y, BTN_W and BTN_X returns the top-left and width +// and height of a button, taking into account the button margins. + +#define BTN_X(x) (GRID_X((x)-1) + MARGIN_L) +#define BTN_Y(y) (GRID_Y((y)-1) + MARGIN_T) +#define BTN_W(w) (GRID_X(w) - MARGIN_L - MARGIN_R) +#define BTN_H(h) (GRID_Y(h) - MARGIN_T - MARGIN_B) + +// Abbreviations for common phrases, to allow a button to be +// defined in one line of source. +#define BTN_POS(x,y) BTN_X(x), BTN_Y(y) +#define BTN_SIZE(w,h) BTN_W(w), BTN_H(h) + +// Draw a reference grid for ease of spacing out widgets. +#define DRAW_LAYOUT_GRID \ + { \ + cmd.cmd(LINE_WIDTH(4)); \ + for(int i = 1; i <= GRID_COLS; i++) { \ + cmd.cmd(BEGIN(LINES)); \ + cmd.cmd(VERTEX2F(GRID_X(i) *16, 0 *16)); \ + cmd.cmd(VERTEX2F(GRID_X(i) *16, FTDI::display_height *16)); \ + } \ + for(int i = 1; i < GRID_ROWS; i++) { \ + cmd.cmd(BEGIN(LINES)); \ + cmd.cmd(VERTEX2F(0 *16, GRID_Y(i) *16)); \ + cmd.cmd(VERTEX2F(FTDI::display_width *16, GRID_Y(i) *16)); \ + } \ + cmd.cmd(LINE_WIDTH(16)); \ + } + +namespace FTDI { + #ifdef TOUCH_UI_PORTRAIT + constexpr uint16_t display_width = Vsize; + constexpr uint16_t display_height = Hsize; + #else + constexpr uint16_t display_width = Hsize; + constexpr uint16_t display_height = Vsize; + #endif +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h new file mode 100644 index 000000000000..4560996da76d --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h @@ -0,0 +1,96 @@ +/************* + * polygon.h * + *************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/** + * The Polygon class helps drawing filled or stroked polygons on the FTDI EVE: + * + * CommandProcessor cmd; + * cmd.cmd(COLOR_RGB(0x00FF00)); + * + * Polygon p(cmd); + * p.begin_fill(); + * p.begin_loop(); + * p(10,10); + * p(20,10); + * p(20,20); + * p(10,20); + * p.end_loop(); + * p.begin_loop(); + * ... // Additional closed paths + * p.end_loop(); + * ... + * p.end_fill(); + * + * Based on the example from "Applicaton Note AN_334, FT801 Polygon Application": + * + * https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/AN_334-FT801_Polygon_Application.pdf + */ + +namespace FTDI { + class Polygon { + private: + FTDI::begin_t path_initiator = FTDI::LINE_STRIP; + + public: + CommandProcessor &cmd; + + Polygon(CommandProcessor &c) : cmd(c) {} + + void begin_fill() { + using namespace FTDI; + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(TAG_MASK(0)); + cmd.cmd(CLEAR(0,1,0)); + cmd.cmd(COLOR_MASK(0,0,0,0)); + cmd.cmd(STENCIL_OP(STENCIL_OP_KEEP, STENCIL_OP_INVERT)); + cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_ALWAYS, 255, 255)); + // Drawing the edge strip along scan lines + // seems to yield the best performance + #ifdef TOUCH_UI_PORTRAIT + path_initiator = EDGE_STRIP_B; + #else + path_initiator = EDGE_STRIP_R; + #endif + } + + // Specify a clipping rectangle to paint fewer pixels and reduce rendering time, otherwise all pixels will be painted. + void end_fill(const int16_t x1 = 0, const int16_t y1 = 0, const int16_t x2 = display_width * 16, const int16_t y2 = display_height * 16) { + using namespace FTDI; + cmd.cmd(RESTORE_CONTEXT()); + + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_NOTEQUAL, 0, 255)); + cmd.cmd(BEGIN(RECTS)); + cmd.cmd(VERTEX2F(x1, y1)); + cmd.cmd(VERTEX2F(x2, y2)); + cmd.cmd(RESTORE_CONTEXT()); + } + + void begin_stroke() {path_initiator = FTDI::LINE_STRIP;} + void begin_loop() {cmd.cmd(FTDI::BEGIN(path_initiator));} + void end_stroke() {} + void end_loop() {} + + void operator()(const uint16_t x, const uint16_t y) {cmd.cmd(FTDI::VERTEX2F(x, y));} + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h new file mode 100644 index 000000000000..fde505287340 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h @@ -0,0 +1,84 @@ +/*********** + * rgb_t.h * + ***********/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/** + * Implementation of hsl_to_rgb as constexpr functions based on: + * + * https://www.rapidtables.com/convert/color/hsl-to-rgb.html + */ + +constexpr float _hsl_fmod(float x, float y) { + return x - int(x/y)*y; +} + +constexpr float _hsl_c(float, float S, float L) { + return (1.0f - fabs(2*L-1.0f)) * S; +} + +constexpr float _hsl_x(float H, float S, float L) { + return _hsl_c(H,S,L) * (1.0f - fabs(_hsl_fmod(H/60, 2) - 1)); +} + +constexpr float _hsl_m(float H, float S, float L) { + return L - _hsl_c(H,S,L)/2; +} + +constexpr float _hsl_rgb(float H, float S, float L, float r, float g, float b) { + return ((uint32_t((r + _hsl_m(H,S,L))*255+0.5) << 16) | + (uint32_t((g + _hsl_m(H,S,L))*255+0.5) << 8) | + (uint32_t((b + _hsl_m(H,S,L))*255+0.5) << 0)); +} + +constexpr uint32_t hsl_to_rgb(float H, float S, float L) { + return (H < 60) ? _hsl_rgb(H,S,L,_hsl_c(H,S,L), _hsl_x(H,S,L), 0) : + (H < 120) ? _hsl_rgb(H,S,L,_hsl_x(H,S,L), _hsl_c(H,S,L), 0) : + (H < 180) ? _hsl_rgb(H,S,L, 0, _hsl_c(H,S,L), _hsl_x(H,S,L)) : + (H < 240) ? _hsl_rgb(H,S,L, 0, _hsl_x(H,S,L), _hsl_c(H,S,L)) : + (H < 300) ? _hsl_rgb(H,S,L,_hsl_x(H,S,L), 0, _hsl_c(H,S,L)) : + _hsl_rgb(H,S,L,_hsl_c(H,S,L), 0, _hsl_x(H,S,L)); +} + +/** + * Structure for RGB colors + */ +struct rgb_t { + union { + struct { + uint8_t b,g,r,a; + }; + uint32_t packed; + }; + + rgb_t() : packed(0) {} + rgb_t(uint32_t rgb) : packed(rgb) {} + rgb_t(uint8_t r, uint8_t g, uint8_t b) : b(b), g(g), r(r), a(0) {} + operator uint32_t() const {return packed;}; + + static void lerp(float t, const rgb_t a, const rgb_t b, rgb_t &c) { + c.r = a.r + t * (b.r - a.r); + c.g = a.g + t * (b.g - a.g); + c.b = a.b + t * (b.b - a.b); + } + + uint8_t luminance() const {return 0.299*r + 0.587*g + 0.114*b;} +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp new file mode 100644 index 000000000000..ec1c0d1cbb4d --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp @@ -0,0 +1,106 @@ +/****************** + * screen_types.h * + ******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_extended.h" + +#ifdef FTDI_EXTENDED + +/********************** VIRTUAL DISPATCH DATA TYPE ******************************/ + +uint8_t ScreenRef::lookupScreen(onRedraw_func_t onRedraw_ptr) { + for(uint8_t type = 0; type < functionTableSize; type++) { + if (GET_METHOD(type, onRedraw) == onRedraw_ptr) { + return type; + } + } + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR("Screen not found: ", (uintptr_t) onRedraw_ptr); + #endif + return 0xFF; +} + +void ScreenRef::setScreen(onRedraw_func_t onRedraw_ptr) { + uint8_t type = lookupScreen(onRedraw_ptr); + if (type != 0xFF) { + setType(type); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("New screen: ", type); + #endif + } +} + +void ScreenRef::initializeAll() { + for(uint8_t type = 0; type < functionTableSize; type++) { + GET_METHOD(type, onStartup)(); + } +} + +/********************** SCREEN STACK ******************************/ + +void ScreenStack::start() { + initializeAll(); + onEntry(); +} + +void ScreenStack::push(onRedraw_func_t onRedraw_ptr) { + stack[3] = stack[2]; + stack[2] = stack[1]; + stack[1] = stack[0]; + stack[0] = lookupScreen(onRedraw_ptr); +} + +void ScreenStack::push() { + stack[3] = stack[2]; + stack[2] = stack[1]; + stack[1] = stack[0]; + stack[0] = getType(); +} + +void ScreenStack::pop() { + setType(stack[0]); + forget(); +} + +void ScreenStack::forget() { + stack[0] = stack[1]; + stack[1] = stack[2]; + stack[2] = stack[3]; + stack[3] = 0; +} + +void ScreenStack::goTo(onRedraw_func_t s) { + push(); + onExit(); + setScreen(s); + onEntry(); +} + +void ScreenStack::goBack() { + onExit(); + pop(); + onEntry(); +} + +ScreenStack current_screen; + +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h new file mode 100644 index 000000000000..f1ec4fc47664 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h @@ -0,0 +1,229 @@ +/******************** + * screen_types.cpp * + ********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +typedef enum { + BACKGROUND = 1, + FOREGROUND = 2, + BOTH = 3 +} draw_mode_t; + + /********************** VIRTUAL DISPATCH DATA TYPE ******************************/ + +// True virtual classes are extremely expensive on the Arduino +// as the compiler stores the virtual function tables in RAM. +// We invent a data type called ScreenRef that gives us +// polymorphism by mapping an ID to virtual methods on various +// classes. This works by keeping a table in PROGMEM of pointers +// to static methods. + +#define DECL_SCREEN(className) { \ + className::onStartup, \ + className::onEntry, \ + className::onExit, \ + className::onIdle, \ + className::onRefresh, \ + className::onRedraw, \ + className::onTouchStart, \ + className::onTouchHeld, \ + className::onTouchEnd \ +} + +#define GET_METHOD(type, method) reinterpret_cast(pgm_read_ptr_far(&functionTable[type].method##_ptr)) +#define SCREEN_TABLE PROGMEM const ScreenRef::table_t ScreenRef::functionTable[] = +#define SCREEN_TABLE_POST const uint8_t ScreenRef::functionTableSize = sizeof(ScreenRef::functionTable)/sizeof(ScreenRef::functionTable[0]); + +class ScreenRef { + protected: + typedef void onStartup_func_t(); + typedef void onEntry_func_t(); + typedef void onExit_func_t(); + typedef void onIdle_func_t(); + typedef void onRefresh_func_t(); + typedef void onRedraw_func_t(draw_mode_t); + typedef bool onTouchStart_func_t(uint8_t); + typedef bool onTouchHeld_func_t(uint8_t); + typedef bool onTouchEnd_func_t(uint8_t); + + private: + typedef struct { + onStartup_func_t *onStartup_ptr; + onEntry_func_t *onEntry_ptr; + onExit_func_t *onExit_ptr; + onIdle_func_t *onIdle_ptr; + onRefresh_func_t *onRefresh_ptr; + onRedraw_func_t *onRedraw_ptr; + onTouchStart_func_t *onTouchStart_ptr; + onTouchHeld_func_t *onTouchHeld_ptr; + onTouchEnd_func_t *onTouchEnd_ptr; + } table_t; + + uint8_t type = 0; + static PROGMEM const table_t functionTable[]; + static const uint8_t functionTableSize; + + public: + uint8_t getType() {return type;} + + void setType(uint8_t t) { + type = t; + } + + uint8_t lookupScreen(onRedraw_func_t onRedraw_ptr); + + void setScreen(onRedraw_func_t onRedraw_ptr); + + void onStartup() {GET_METHOD(type, onStartup)();} + void onEntry() {GET_METHOD(type, onEntry)();} + void onExit() {GET_METHOD(type, onExit)();} + void onIdle() {GET_METHOD(type, onIdle)();} + void onRefresh() {GET_METHOD(type, onRefresh)();} + void onRedraw(draw_mode_t dm) {GET_METHOD(type, onRedraw)(dm);} + bool onTouchStart(uint8_t tag) {return GET_METHOD(type, onTouchStart)(tag);} + bool onTouchHeld(uint8_t tag) {return GET_METHOD(type, onTouchHeld)(tag);} + bool onTouchEnd(uint8_t tag) {return GET_METHOD(type, onTouchEnd)(tag);} + + void initializeAll(); +}; + +/********************** SCREEN STACK ******************************/ + +// To conserve dynamic memory, the screen stack is hard-coded to +// have four values, allowing a menu of up to four levels. + +class ScreenStack : public ScreenRef { + private: + uint8_t stack[4]; + + public: + void start(); + void push(onRedraw_func_t); + void push(); + void pop(); + void forget(); + void goTo(onRedraw_func_t); + void goBack(); + + uint8_t peek() {return stack[0];} + uint8_t getScreen() {return getType();} +}; + +extern ScreenStack current_screen; + +/********************** BASE SCREEN CLASS ******************************/ + +/* UIScreen is the base class for all user interface screens. + */ +class UIScreen { + public: + static void onStartup() {} + static void onEntry() {current_screen.onRefresh();} + static void onExit() {} + static void onIdle() {} + static bool onTouchStart(uint8_t) {return true;} + static bool onTouchHeld(uint8_t) {return false;} + static bool onTouchEnd(uint8_t) {return true;} +}; + +#define PUSH_SCREEN(screen) current_screen.push(screen::onRedraw); +#define GOTO_SCREEN(screen) current_screen.goTo(screen::onRedraw); +#define GOTO_PREVIOUS() current_screen.goBack(); +#define AT_SCREEN(screen) (current_screen.getType() == current_screen.lookupScreen(screen::onRedraw)) +#define IS_PARENT_SCREEN(screen) (current_screen.peek() == current_screen.lookupScreen(screen::onRedraw)) + +/************************** CACHED VS UNCHACHED SCREENS ***************************/ + +class UncachedScreen { + public: + static void onRefresh() { + using namespace FTDI; + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART); + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); + #endif + + current_screen.onRedraw(BOTH); + + cmd.cmd(DL::DL_DISPLAY); + cmd.cmd(CMD_SWAP); + cmd.execute(); + } +}; + +template +class CachedScreen { + protected: + static bool storeBackground() { + DLCache dlcache(DL_SLOT); + if (!dlcache.store(DL_SIZE)) { + SERIAL_ECHO_MSG("CachedScreen::storeBackground() failed: not enough DL cache space"); + return false; + } + return true; + } + + static void repaintBackground() { + using namespace FTDI; + DLCache dlcache(DL_SLOT); + CommandProcessor cmd; + + cmd.cmd(CMD_DLSTART); + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); + #endif + current_screen.onRedraw(BACKGROUND); + + dlcache.store(DL_SIZE); + } + + public: + static void onRefresh() { + #if ENABLED(TOUCH_UI_DEBUG) + const uint32_t start_time = millis(); + #endif + using namespace FTDI; + DLCache dlcache(DL_SLOT); + CommandProcessor cmd; + + cmd.cmd(CMD_DLSTART); + + if (dlcache.has_data()) { + dlcache.append(); + } else { + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); + #endif + current_screen.onRedraw(BACKGROUND); + dlcache.store(DL_SIZE); + } + + current_screen.onRedraw(FOREGROUND); + + cmd.cmd(DL::DL_DISPLAY); + cmd.cmd(CMD_SWAP); + cmd.execute(); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHOLNPAIR("Time to draw screen (ms): ", millis() - start_time); + #endif + } +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h new file mode 100644 index 000000000000..a53ed95159fa --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h @@ -0,0 +1,38 @@ +/**************** + * sound_list.h * + ****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +class SoundList { + private: + static PROGMEM const struct list_t { + const char *const PROGMEM name; + const FTDI::SoundPlayer::sound_t* data; + } list[]; + public: + static const uint8_t n; + static inline const char* name(uint8_t val) { + return (const char* ) pgm_read_ptr_near(&list[val].name); + } + static inline FTDI::SoundPlayer::sound_t* data(uint8_t val) { + return (FTDI::SoundPlayer::sound_t*) pgm_read_ptr_near(&list[val].data); + } +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp new file mode 100644 index 000000000000..a6d84dde5fab --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp @@ -0,0 +1,111 @@ +/******************** + * sound_player.cpp * + ********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_extended.h" + +#ifdef FTDI_EXTENDED + +namespace FTDI { + SoundPlayer sound; // Global sound player object + + void SoundPlayer::set_volume(uint8_t vol) { + CLCD::mem_write_8(REG::VOL_SOUND, vol); + } + + uint8_t SoundPlayer::get_volume() { + return CLCD::mem_read_8(REG::VOL_SOUND); + } + + void SoundPlayer::play(effect_t effect, note_t note) { + + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR ("Playing note ", int(note)); + SERIAL_ECHOLNPAIR(", instrument ", int(effect)); + #endif + + // Play the note + CLCD::mem_write_16(REG::SOUND, (note == REST) ? 0 : (((note ? note : NOTE_C4) << 8) | effect)); + CLCD::mem_write_8(REG::PLAY, 1); + } + + note_t SoundPlayer::frequency_to_midi_note(const uint16_t frequency_hz) { + const float f0 = 440; + return note_t(NOTE_A4 + (log(frequency_hz)-log(f0))*12/log(2) + 0.5); + } + + // Plays a tone of a given frequency and duration. Since the FTDI FT810 only + // supports MIDI notes, we round down to the nearest note. + + void SoundPlayer::play_tone(const uint16_t frequency_hz, const uint16_t duration_ms) { + play(ORGAN, frequency_to_midi_note(frequency_hz)); + + // Schedule silence to squelch the note after the duration expires. + sequence = silence; + wait = duration_ms; + timer.start(); + } + + void SoundPlayer::play(const sound_t* seq, play_mode_t mode) { + sequence = seq; + wait = 250; // Adding this delay causes the note to not be clipped, not sure why. + timer.start(); + + if (mode == PLAY_ASYNCHRONOUS) return; + + // If playing synchronously, then play all the notes here + + while (has_more_notes()) { + onIdle(); + #ifdef EXTENSIBLE_UI + ExtUI::yield(); + #endif + } + } + + bool SoundPlayer::is_sound_playing() { + return CLCD::mem_read_8( REG::PLAY ) & 0x1; + } + + void SoundPlayer::onIdle() { + if (!sequence) return; + + const bool ready_for_next_note = (wait == 0) ? !is_sound_playing() : timer.elapsed(wait); + + if (ready_for_next_note) { + const effect_t fx = effect_t(pgm_read_byte(&sequence->effect)); + const note_t nt = note_t(pgm_read_byte(&sequence->note)); + const uint32_t ms = uint32_t(pgm_read_byte(&sequence->sixteenths)) * 1000 / 16; + + if (ms == 0 && fx == SILENCE && nt == END_SONG) { + sequence = 0; + play(SILENCE, REST); + } else { + wait = ms; + timer.start(); + play(fx, nt); + sequence++; + } + } + } +} // namespace FTDI + +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h new file mode 100644 index 000000000000..e177ec57dfb9 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h @@ -0,0 +1,70 @@ +/****************** + * sound_player.h * + ******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +namespace FTDI { + typedef enum { + PLAY_ASYNCHRONOUS, + PLAY_SYNCHRONOUS + } play_mode_t; + + class SoundPlayer { + typedef FTDI::ftdi_registers REG; + typedef FTDI::ftdi_memory_map MAP; + + public: + struct sound_t { + effect_t effect; // The sound effect number + note_t note; // The MIDI note value + uint16_t sixteenths; // Duration of note, in sixteeths of a second, or zero to play to completion + }; + + const uint8_t WAIT = 0; + + private: + const sound_t *sequence; + tiny_timer_t timer; + tiny_time_t wait; + + note_t frequency_to_midi_note(const uint16_t frequency); + + public: + static void set_volume(uint8_t volume); + static uint8_t get_volume(); + + static void play(effect_t effect, note_t note = NOTE_C4); + static bool is_sound_playing(); + + void play(const sound_t* seq, play_mode_t mode = PLAY_SYNCHRONOUS); + void play_tone(const uint16_t frequency_hz, const uint16_t duration_ms); + bool has_more_notes() {return sequence != 0;}; + + void onIdle(); + }; + + extern SoundPlayer sound; + + const PROGMEM SoundPlayer::sound_t silence[] = { + {SILENCE, END_SONG, 0} + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp new file mode 100644 index 000000000000..75a445a926b0 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp @@ -0,0 +1,129 @@ +/**************** + * text_box.cpp * + ****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_extended.h" + +#ifdef FTDI_EXTENDED + +namespace FTDI { + /** + * Given a str, end will be set to the position at which a line needs to + * be broken so that the display width is less than w. The line will also + * be broken after a '\n'. Returns the display width of the line. + */ + static uint16_t find_line_break(const FontMetrics &fm, uint16_t w, const char *str, const char *&end) { + w -= fm.get_char_width(' '); + const char *p = str; + end = str; + uint16_t lw = 0, result = 0; + for(;;) { + utf8_char_t c = get_utf8_char_and_inc(p); + if (c == ' ' || c == '\n' || c == '\0') { + if (lw < w || end == str) { + end = (c == '\0') ? p-1 : p; + result = lw; + } + if (c == '\0' || c == '\n') break; + } + lw += fm.get_char_width(c); + } + if (end == str) { + end = p-1; + result = lw; + } + return result; + } + + /** + * This function returns a measurements of the word-wrapped text box. + */ + static void measure_text_box(const FontMetrics &fm, const char *str, uint16_t &width, uint16_t &height) { + const char *line_start = (const char*)str; + const char *line_end; + const uint16_t wrap_width = width; + width = height = 0; + for(;;) { + uint16_t line_width = find_line_break(fm, wrap_width, line_start, line_end); + if (line_end == line_start) break; + width = max(width, line_width); + height += fm.get_height(); + line_start = line_end; + } + } + + /** + * This function draws text inside a bounding box, doing word wrapping and using the largest font that will fit. + */ + void draw_text_box(CommandProcessor& cmd, int x, int y, int w, int h, const char *str, uint16_t options, uint8_t font) { + uint16_t box_width, box_height; + + FontMetrics fm(font); + + // Shrink the font until we find a font that fits + for(;;) { + box_width = w; + measure_text_box(fm, str, box_width, box_height); + if (box_width <= (uint16_t)w && box_height <= (uint16_t)h) break; + fm.load(--font); + if (font == 26) break; + } + + const uint16_t dx = (options & OPT_RIGHTX) ? w : (options & OPT_CENTERX) ? w/2 : 0; + const uint16_t dy = (options & OPT_CENTERY) ? (h - box_height)/2 : 0; + + const char *line_start = str; + const char *line_end; + for(;;) { + find_line_break(fm, w, line_start, line_end); + if (line_end == line_start) break; + + const size_t line_len = line_end - line_start; + if (line_len) { + char line[line_len + 1]; + strncpy(line, line_start, line_len); + line[line_len] = 0; + if (line[line_len - 1] == '\n' || line[line_len - 1] == ' ') + line[line_len - 1] = 0; + + #ifdef TOUCH_UI_USE_UTF8 + if (has_utf8_chars(line)) { + draw_utf8_text(cmd, x + dx, y + dy, line, fm.fs, options & ~OPT_CENTERY); + } else + #endif + { + cmd.CLCD::CommandFifo::text(x + dx, y + dy, font, options & ~OPT_CENTERY); + cmd.CLCD::CommandFifo::str(line); + } + } + y += fm.get_height(); + + line_start = line_end; + } + } + + void draw_text_box(CommandProcessor& cmd, int x, int y, int w, int h, progmem_str pstr, uint16_t options, uint8_t font) { + char str[strlen_P((const char*)pstr) + 1]; + strcpy_P(str, (const char*)pstr); + draw_text_box(cmd, x, y, w, h, (const char*) str, options, font); + } +} // namespace FTDI + +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h new file mode 100644 index 000000000000..a0f99c6b08f3 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h @@ -0,0 +1,30 @@ +/************** + * text_box.h * + **************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/** + * This function draws text inside a bounding box, doing word wrapping and using the largest font that will fit. + */ +namespace FTDI { + void draw_text_box(class CommandProcessor& cmd, int x, int y, int w, int h, progmem_str str, uint16_t options = 0, uint8_t font = 31); + void draw_text_box(class CommandProcessor& cmd, int x, int y, int w, int h, const char *str, uint16_t options = 0, uint8_t font = 31); +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp new file mode 100644 index 000000000000..c7b35e92dfef --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp @@ -0,0 +1,51 @@ +/****************** + * tiny_timer.cpp * + ******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "ftdi_extended.h" + +#ifdef FTDI_EXTENDED + +bool tiny_timer_t::elapsed(tiny_time_t duration) { + uint8_t now = tiny_time_t::tiny_time( + #ifdef __MARLIN_FIRMWARE__ + ExtUI::safe_millis() + #else + millis() + #endif + ); + uint8_t elapsed = now - _start; + if (elapsed >= duration._duration) { + return true; + } else { + return false; + } +} + +void tiny_timer_t::start() { + _start = tiny_time_t::tiny_time( + #ifdef __MARLIN_FIRMWARE__ + ExtUI::safe_millis() + #else + millis() + #endif + ); +} +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h new file mode 100644 index 000000000000..9db912752966 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h @@ -0,0 +1,56 @@ +/**************** + * tiny_timer.h * + ****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/* Helpful Reference: + * + * https://arduino.stackexchange.com/questions/12587/how-can-i-handle-the-millis-rollover + */ + +/* tiny_interval_t downsamples a 32-bit millis() value + into a 8-bit value which can record periods of + a few seconds with a rougly 1/16th of second + resolution. This allows us to measure small + intervals without needing to use four-byte counters. + */ +class tiny_time_t { + private: + friend class tiny_timer_t; + uint8_t _duration; + + static uint8_t tiny_time(uint32_t ms) {return ceil(float(ms) / 64);}; + + public: + tiny_time_t() : _duration(0) {} + tiny_time_t(uint32_t ms) : _duration(tiny_time(ms)) {} + tiny_time_t & operator= (uint32_t ms) {_duration = tiny_time(ms); return *this;} + bool operator == (uint32_t ms) {return _duration == tiny_time(ms);} +}; + +class tiny_timer_t { + private: + uint8_t _start; + + public: + void start(); + bool elapsed(tiny_time_t interval); +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/README.txt b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/README.txt new file mode 100644 index 000000000000..818bf08cea9c --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/README.txt @@ -0,0 +1,40 @@ + +FTDI EVE Unicode Rendering +-------------------------- + +The FTDI EVE chips have several fonts in ROM, but these fonts only contain a +subset of ASCII characters. Notably, this excludes diacritics and accents +used in most Western languages. + +While the FTDI EVE has the capability for user-defined fonts, such fonts only +support 127 character positions, making them as limiting as the built-in fonts. + +As a further complication, high resolution TFT displays require high resolution +fonts. It is not feasible to put a complete international font into the limited +flash memory of most microprocessors. + +To work around these limitations, this library uses a custom font renderer with +the following characteristics: + + 1) Rather than providing bitmaps for different font sizes, it uses a single + bitmap for the largest font size (romfont 31) and emulates other sizes by + scaling the bitmaps using BITMAP_TRANSFORM. + + 2) Rather than loading an entire font, it combines symbols from romfont 31 + with a limited number of symbols from a custom font. For accented letters, + the rendering code combine basic letter shapes from romfont 31 with + bitmaps containing only the accent themselves. + + 3) The custom bitmap is RLE compressed into PROGMEM. For accents, which have + a fairly small number of non-white pixels, the savings are significant. + +These characteristics enable an alphabet for Western languages to be +synthesized from only a few dozen custom symbols and modest PROGMEM use (~10k) + +The text layout is done by the code in "unicode.cpp" with the help of one of +more character renderers (e.g. "western_char_set.cpp"). Each character render +is responsible for loading the necessary bitmap data into RAMG and drawing +characters as requested. + +To add symbols for other languages, it will only be necessary to make a bitmap +and implement a corresponding character renderer. diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp new file mode 100644 index 000000000000..87baeb6d2023 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp @@ -0,0 +1,55 @@ +/******************* + * font_bitmap.cpp * + *******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#ifdef FTDI_EXTENDED + +namespace FTDI { + + void write_rle_data(uint16_t addr, const uint8_t *data, size_t n) { + for (; n >= 2; n -= 2) { + uint8_t count = pgm_read_byte(data++); + uint8_t value = pgm_read_byte(data++); + while (count--) CLCD::mem_write_8(addr++, value); + } + } + + void set_font_bitmap(CommandProcessor& cmd, CLCD::FontMetrics &fm, uint8_t handle) { + cmd.cmd(BITMAP_HANDLE(handle)); + cmd.cmd(BITMAP_SOURCE(fm.ptr)); + cmd.bitmap_layout(fm.format, fm.stride, fm.height); + cmd.bitmap_size(BILINEAR, BORDER, BORDER, fm.width, fm.height); + } + + void ext_vertex2ii(CommandProcessor &cmd, int x, int y, uint8_t handle, uint8_t cell) { + if (x < 0 || y < 0 || x > 511 || y > 511) { + cmd.cmd(BITMAP_HANDLE(handle)); + cmd.cmd(CELL(cell)); + cmd.cmd(VERTEX2F(x * 16, y * 16)); + } else { + cmd.cmd(VERTEX2II(x, y, handle, cell)); + } + } + +} // namespace FTDI + +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h new file mode 100644 index 000000000000..85ece6b774ab --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h @@ -0,0 +1,30 @@ +/****************** + * font_bitmaps.h * + ******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +class CommandProcessor; + +namespace FTDI { + void write_rle_data(uint16_t addr, const uint8_t *data, size_t n); + void set_font_bitmap(CommandProcessor& cmd, CLCD::FontMetrics &fm, uint8_t handle); + void ext_vertex2ii(CommandProcessor &cmd, int x, int y, uint8_t handle, uint8_t cell); +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm new file mode 100644 index 000000000000..39cb67034f36 Binary files /dev/null and b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm differ diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png new file mode 100644 index 000000000000..ef681923db23 Binary files /dev/null and b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png differ diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg new file mode 100644 index 000000000000..f803126c2b7e --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + ̀ ́ ̂ ̃ ̈ ̊ ̧ıßØøÆæÐðÞþ«»¡¿¢£¤¥¹²³ºª©®±×÷¼½¾µ¦§¬ + + + + + + + + diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp new file mode 100644 index 000000000000..c449f11537c4 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp @@ -0,0 +1,46 @@ +/******************* + * font_size_t.cpp * + *******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) + +namespace FTDI { + // Returns the height of a standard FTDI romfont + uint8_t font_size_t::get_romfont_height(uint8_t font) { + static const uint8_t tbl[] PROGMEM = { + 8, 8, 16, 16, 13, 17, 20, 22, 29, 38, 16, 20, 25, 28, 36, 49, 63, 83, 108 + }; + return pgm_read_byte(&tbl[font - 16]); + } + + // Sets the scaling coefficient to match a romfont size + font_size_t font_size_t::from_romfont(uint8_t font) { + return font_size_t(uint32_t(std_height) * 256 / get_romfont_height(font)); + } + + // Returns the height of the font + uint8_t font_size_t::get_height() const { + return scale(std_height); + } +} + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h new file mode 100644 index 000000000000..9cf6c181f5af --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h @@ -0,0 +1,55 @@ +/***************** + * font_size_t.h * + *****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +class CommandProcessor; + +namespace FTDI { + + /* The unicode rendering of different font sizes happens by scaling a + * large-sized font bitmap using the FTDI bitmap transformation matrix. + * This keeps us from having to have load bitmaps for all font sizes. + * + * The font_size_t class helps manage this scaling factor. + */ + class font_size_t { + private: + // Standard height for font bitmaps + static constexpr uint8_t std_height = 49; + + // 8.8 fixed point scaling coefficient + uint16_t coefficient; + + font_size_t(uint16_t v) : coefficient(v) {} + public: + font_size_t() : coefficient(256) {} + + static uint8_t get_romfont_height(uint8_t font); + + static font_size_t from_romfont(uint8_t size); + + template T scale(T val) const {return (int32_t(val) * 256 / coefficient);} + + uint8_t get_height() const; + uint16_t get_coefficient() const {return coefficient;} + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp new file mode 100644 index 000000000000..fb049aee3b45 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp @@ -0,0 +1,106 @@ +/************************* + * standard_char_set.cpp * + *************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) + + constexpr static uint8_t std_font = 31; + + /* Lookup table of the char widths for standard ROMFONT 31 */ + + uint8_t FTDI::StandardCharSet::std_char_width(char c) { + static const uint8_t tbl[] PROGMEM = { + 10, 11, 15, 26, 25, 31, 26, 10, 15, 14, 18, 24, 9, 18, 11, 17, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 10, 10, 21, 23, 22, 20, 37, 27, 27, 26, + 28, 23, 22, 28, 29, 12, 23, 26, 22, 35, 29, 28, 26, 29, 27, 26, 26, 28, + 27, 36, 27, 26, 25, 12, 18, 12, 18, 21, 13, 23, 24, 22, 24, 22, 15, 24, + 24, 10, 11, 22, 10, 36, 24, 24, 24, 24, 15, 22, 14, 24, 21, 32, 21, 21, + 22, 15, 10, 15, 29, 10 + }; + return pgm_read_byte(&tbl[c - ' ']); + } + + /** + * Load bitmap data into RAMG. This function is called once at the start + * of the program. + * + * Parameters: + * + * addr - Address in RAMG where the font data is written + */ + + void FTDI::StandardCharSet::load_data(uint32_t) { + } + + /** + * Populates the bitmap handles for the custom into the display list. + * This function is called once at the start of each display list. + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + */ + + void FTDI::StandardCharSet::load_bitmaps(CommandProcessor& cmd) { + CLCD::FontMetrics std_fm(std_font); + set_font_bitmap(cmd, std_fm, std_font); + } + + /** + * Renders a character at location x and y. The x position is incremented + * by the width of the character. + * + * Parameters: + * + * cmd - If non-NULL the symbol is drawn to the screen. + * If NULL, only increment position for text measurement. + * + * x, y - The location at which to draw the character. On output, + * incremented to the location of the next character. + * + * fs - A scaling object used to scale the font. The display will + * already be configured to scale bitmaps, but positions + * must be scaled using fs.scale() + * + * c - The unicode code point to draw. If the renderer does not + * support the character, it should draw nothing. + */ + + bool FTDI::StandardCharSet::render_glyph(CommandProcessor* cmd, int &x, int &y, font_size_t fs, utf8_char_t c) { + uint8_t which = (c >= ' ' && c < 128) ? c : '?'; + uint8_t width = std_char_width(which); + + if (c == '\t') { + // Special handling for the tab character + which = ' '; + width = std_char_width(' '); + } + + // Draw the character + if (cmd) ext_vertex2ii(*cmd, x, y, std_font, which); + + // Increment X to the next character position + x += fs.scale(width); + return true; + } + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h new file mode 100644 index 000000000000..17ccfe6e3018 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h @@ -0,0 +1,30 @@ +/*********************** + * standard_char_set.h * + ***********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +namespace FTDI { + class StandardCharSet { + public: + static uint8_t std_char_width(char); + static void load_data(uint32_t addr); + static void load_bitmaps(CommandProcessor&); + static bool render_glyph(CommandProcessor*, int &x, int &y, font_size_t, utf8_char_t); + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp new file mode 100644 index 000000000000..d717f7f154e1 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -0,0 +1,219 @@ +/*************** + * unicode.cpp * + ***************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) + + using namespace FTDI; + + /** + * Return true if a string has UTF8 characters + * + * Parameters: + * + * c - Pointer to a string. + * + * Returns: True if the strings has UTF8 characters + */ + + bool FTDI::has_utf8_chars(const char *str) { + for (;;) { + const char c = *str++; + if (!c) break; + if ((c & 0xC0) == 0x80) return true; + } + return false; + } + + bool FTDI::has_utf8_chars(progmem_str _str) { + const char *str = (const char *) _str; + for (;;) { + const char c = pgm_read_byte(str++); + if (!c) break; + if ((c & 0xC0) == 0x80) return true; + } + return false; + } + + /** + * Return a character in a UTF8 string and increment the + * pointer to the next character + * + * Parameters: + * + * c - Pointer to a UTF8 encoded string. + * + * Returns: The packed bytes of a UTF8 encoding of a single + * character (this is not the unicode codepoint) + */ + + utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) { + utf8_char_t val = *(uint8_t*)c++; + while ((*c & 0xC0) == 0x80) + val = (val << 8) | *(uint8_t*)c++; + return val; + } + + /** + * Helper function to draw and/or measure a UTF8 string + * + * Parameters: + * + * cmd - If non-NULL the symbol is drawn to the screen. + * If NULL, only increment position for text measurement. + * + * x, y - The location at which to draw the string. + * + * str - The UTF8 string to draw or measure. + * + * fs - A scaling object used to specify the font size. + */ + + static uint16_t render_utf8_text(CommandProcessor* cmd, int x, int y, const char *str, font_size_t fs) { + const int start_x = x; + while (*str) { + const utf8_char_t c = get_utf8_char_and_inc(str); + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + WesternCharSet::render_glyph(cmd, x, y, fs, c) || + #endif + StandardCharSet::render_glyph(cmd, x, y, fs, c); + } + return x - start_x; + } + + /** + * Load the font bitmap data into RAMG. Called once at program start. + * + * Parameters: + * + * addr - Address in RAMG where the font data is written + */ + + void FTDI::load_utf8_data(uint16_t addr) { + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + WesternCharSet::load_data(addr); + #endif + StandardCharSet::load_data(addr); + } + + /** + * Populate the bitmap handles for the custom fonts into the display list. + * Called once at the start of each display list. + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + */ + + void FTDI::load_utf8_bitmaps(CommandProcessor &cmd) { + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + WesternCharSet::load_bitmaps(cmd); + #endif + StandardCharSet::load_bitmaps(cmd); + } + + /** + * Measure a UTF8 text character + * + * Parameters: + * + * c - The unicode code point to measure. + * + * fs - A scaling object used to specify the font size. + * + * Returns: A width in pixels + */ + + uint16_t FTDI::get_utf8_char_width(utf8_char_t c, font_size_t fs) { + int x = 0, y = 0; + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + WesternCharSet::render_glyph(NULL, x, y, fs, c) || + #endif + StandardCharSet::render_glyph(NULL, x, y, fs, c); + return x; + } + + /** + * Measure a UTF8 text string + * + * Parameters: + * + * str - The UTF8 string to measure. + * + * fs - A scaling object used to specify the font size. + * + * Returns: A width in pixels + */ + + uint16_t FTDI::get_utf8_text_width(const char *str, font_size_t fs) { + return render_utf8_text(NULL, 0, 0, str, fs); + } + + uint16_t FTDI::get_utf8_text_width(progmem_str pstr, font_size_t fs) { + char str[strlen_P((const char*)pstr) + 1]; + strcpy_P(str, (const char*)pstr); + return get_utf8_text_width(str, fs); + } + + /** + * Draw a UTF8 text string + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + * + * x, y - The location at which to draw the string. + * + * str - The UTF8 string to draw. + * + * fs - A scaling object used to specify the font size. + * + * options - Text alignment options (i.e. OPT_CENTERX, OPT_CENTERY, OPT_CENTER or OPT_RIGHTX) + * + */ + + void FTDI::draw_utf8_text(CommandProcessor& cmd, int x, int y, const char *str, font_size_t fs, uint16_t options) { + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(BITMAP_TRANSFORM_A(fs.get_coefficient())); + cmd.cmd(BITMAP_TRANSFORM_E(fs.get_coefficient())); + cmd.cmd(BEGIN(BITMAPS)); + + // Apply alignment options + if (options & OPT_CENTERX) + x -= get_utf8_text_width(str, fs) / 2; + else if (options & OPT_RIGHTX) + x -= get_utf8_text_width(str, fs); + if (options & OPT_CENTERY) + y -= fs.get_height()/2; + + // Render the text + render_utf8_text(&cmd, x, y, str, fs); + cmd.cmd(RESTORE_CONTEXT()); + } + + void FTDI::draw_utf8_text(CommandProcessor& cmd, int x, int y, progmem_str pstr, font_size_t fs, uint16_t options) { + char str[strlen_P((const char*)pstr) + 1]; + strcpy_P(str, (const char*)pstr); + draw_utf8_text(cmd, x, y, (const char*) str, fs, options); + } + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h new file mode 100644 index 000000000000..fedb89d172e9 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h @@ -0,0 +1,111 @@ +/************* + * unicode.h * + *************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +class CommandProcessor; + +namespace FTDI { + #ifdef TOUCH_UI_USE_UTF8 + typedef uint16_t utf8_char_t; + + /** + * Converts a 32-bit codepoint into UTF-8. This compile-time function + * will be useful until the u8'a' character literal becomes more common. + */ + constexpr uint32_t utf8(const uint32_t c) { + return (c < 0x7F ) ? c : + (c < 0x7FF) ? (0x0000C080 | ((c & 0b011111000000) << 2) | (c & 0b111111)) : + (c < 0xFFFF) ? (0x00E08080 | ((c & 0b001111000000000000) << 4) | ((c & 0b111111000000) << 2) | (c & 0b111111)) : + (0xF0808080 | ((c & 0b000111000000000000000000) << 6) | ((c & 0b111111000000000000) << 4) | ((c & 0b111111000000) << 2) | (c & 0b111111)); + } + + /* Returns true if the string has UTF8 string characters */ + + bool has_utf8_chars(progmem_str str); + bool has_utf8_chars(const char *str); + + /* Returns the next character in a UTF8 string and increments the + * pointer to the next character */ + + utf8_char_t get_utf8_char_and_inc(const char *&c); + + /* Returns the next character in a UTF8 string, without incrementing */ + + inline utf8_char_t get_utf8_char(const char *c) {return get_utf8_char_and_inc(c);} + + void load_utf8_data(uint16_t addr); + #else + typedef char utf8_char_t; + + inline utf8_char_t get_utf8_char_and_inc(const char *&c) {return *c++;} + inline utf8_char_t get_utf8_char(const char *c) {return *c;} + + inline void load_utf8_data(uint16_t) {} + #endif + + void load_utf8_bitmaps(CommandProcessor& cmd); + + uint16_t get_utf8_char_width(utf8_char_t, font_size_t); + uint16_t get_utf8_text_width(progmem_str, font_size_t); + uint16_t get_utf8_text_width(const char *, font_size_t); + + void draw_utf8_text(CommandProcessor&, int x, int y, progmem_str, font_size_t, uint16_t options = 0); + void draw_utf8_text(CommandProcessor&, int x, int y, const char *, font_size_t, uint16_t options = 0); + + // Similar to CLCD::FontMetrics, but can be used with UTF8 encoded strings. + + struct FontMetrics { + #ifdef TOUCH_UI_USE_UTF8 + font_size_t fs; + #else + CLCD::FontMetrics fm; + #endif + + inline void load(uint8_t rom_font_size) { + #ifdef TOUCH_UI_USE_UTF8 + fs = font_size_t::from_romfont(rom_font_size); + #else + fm.load(rom_font_size); + #endif + } + + inline uint16_t get_char_width(utf8_char_t c) const { + #ifdef TOUCH_UI_USE_UTF8 + return get_utf8_char_width(c, fs); + #else + return fm.char_widths[(uint8_t)c]; + #endif + } + + inline uint8_t get_height() const { + #ifdef TOUCH_UI_USE_UTF8 + return fs.get_height(); + #else + return fm.height; + #endif + } + + inline FontMetrics(uint8_t rom_font_size) { + load(rom_font_size); + } + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp new file mode 100644 index 000000000000..688b68ae0c51 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp @@ -0,0 +1,449 @@ +/************************ + * western_char_set.cpp * + ************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if defined(FTDI_EXTENDED) && BOTH(TOUCH_UI_USE_UTF8, TOUCH_UI_UTF8_WESTERN_CHARSET) + + #include "western_char_set_bitmap_31.h" + + #define NUM_ELEMENTS(a) (sizeof(a)/sizeof(a[0])) + + using namespace FTDI; + + constexpr static uint8_t std_font = 31; + constexpr static uint8_t alt_font = 1; + + static uint32_t bitmap_addr; + + /* Glyphs in the WesternCharSet bitmap */ + + enum { + GRAVE, + ACUTE, + CIRCUMFLEX, + TILDE, + DIAERESIS, + DOT_ABOVE, + CEDILLA, + NO_DOT_I, +#if ENABLED(TOUCH_UI_UTF8_GERMANIC) + SHARP_S, +#endif +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + LRG_O_STROKE, + SML_O_STROKE, + LRG_AE, + SML_AE, + LRG_ETH, + SML_ETH, + LRG_THORN, + SML_THORN, +#endif +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + LEFT_DBL_QUOTE, + RIGHT_DBL_QUOTE, + INV_EXCLAMATION, + INV_QUESTION, +#endif +#if ENABLED(TOUCH_UI_UTF8_CURRENCY) + CENT_SIGN, + POUND_SIGN, + CURRENCY_SIGN, + YEN_SIGN, +#endif +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + SUPERSCRIPT_ONE, + SUPERSCRIPT_TWO, + SUPERSCRIPT_THREE, +#endif +#if ENABLED(TOUCH_UI_UTF8_ORDINALS) + MASCULINE_ORDINAL, + FEMININE_ORDINAL, +#endif +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + COPYRIGHT_SIGN, + REGISTERED_SIGN, +#endif +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + PLUS_MINUS_SIGN, + MULTIPLICATION_SIGN, + DIVISION_SIGN, +#endif +#if ENABLED(TOUCH_UI_UTF8_FRACTIONS) + FRACTION_QUARTER, + FRACTION_HALF, + FRACTION_THREE_FOURTHS, +#endif +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + MICRON_SIGN, + PILCROW_SIGN, + BROKEN_BAR, + SECTION_SIGN, + NOT_SIGN +#endif + }; + + /* Centerline of characters that can take accents */ + + constexpr int8_t mid_a = 12; + constexpr int8_t mid_e = 12; + constexpr int8_t mid_i = 5; + constexpr int8_t mid_o = 12; + constexpr int8_t mid_u = 12; + constexpr int8_t mid_y = 11; + constexpr int8_t mid_n = 12; + constexpr int8_t mid_c = 12; + constexpr int8_t mid_A = 13; + constexpr int8_t mid_E = 13; + constexpr int8_t mid_I = 6; + constexpr int8_t mid_O = 14; + constexpr int8_t mid_U = 14; + constexpr int8_t mid_Y = 13; + constexpr int8_t mid_N = 15; + constexpr int8_t mid_C = 13; + + /* Centerline of accent glyphs */ + + constexpr int8_t mid_accent = 16; + + /* When reusing the DOT_ABOVE accent glyph for the degree sign, we need to trim the leading space */ + constexpr uint8_t deg_sign_leading = 9; + + /* Look-up table for constructing characters (must be ordered by unicode) + * + * Characters are either complete symbols from the Western Char Set bitmap, + * or they are constructed using a standard letter from the romfont and + * drawing an accent from the Western Char Set bitmap over it. + */ + + #define UTF8(A) uint16_t(utf8(U##A)) + + PROGMEM constexpr struct { + uint16_t unicode; + uint8_t std_char; // Glyph from standard ROMFONT (zero if none) + uint8_t alt_char; // Glyph from Western Char Set bitmap + uint8_t alt_data; // For accented characters, the centerline; else char width + } char_recipe[] = { + {0, 0, NO_DOT_I, 10 }, +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + {UTF8('¡'), 0 , INV_EXCLAMATION, 13 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_CURRENCY) + {UTF8('¢'), 0 , CENT_SIGN, 23 }, + {UTF8('£'), 0 , POUND_SIGN, 24 }, + {UTF8('¤'), 0 , CURRENCY_SIGN, 26 }, + {UTF8('¥'), 0 , YEN_SIGN, 26 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + {UTF8('¦'), 0 , BROKEN_BAR, 11 }, + {UTF8('§'), 0 , SECTION_SIGN, 21 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + {UTF8('©'), 0 , COPYRIGHT_SIGN, 38 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_ORDINALS) + {UTF8('ª'), 0 , FEMININE_ORDINAL, 19 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + {UTF8('«'), 0 , LEFT_DBL_QUOTE, 23 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + {UTF8('¬'), 0 , NOT_SIGN, 32 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + {UTF8('®'), 0 , REGISTERED_SIGN, 38 }, +#endif + {UTF8('°'), 0 , DOT_ABOVE, 24 }, +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + {UTF8('±'), 0 , NOT_SIGN, 32 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + {UTF8('²'), 0 , SUPERSCRIPT_TWO, 16 }, + {UTF8('³'), 0 , SUPERSCRIPT_THREE, 16 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + {UTF8('µ'), 0 , MICRON_SIGN, 28 }, + {UTF8('¶'), 0 , PILCROW_SIGN, 24 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + {UTF8('¹'), 0 , SUPERSCRIPT_ONE, 16 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_ORDINALS) + {UTF8('º'), 0 , MASCULINE_ORDINAL, 19 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + {UTF8('»'), 0 , RIGHT_DBL_QUOTE, 24 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_FRACTIONS) + {UTF8('¼'), 0 , FRACTION_QUARTER, 40 }, + {UTF8('½'), 0 , FRACTION_HALF, 40 }, + {UTF8('¾'), 0 , FRACTION_THREE_FOURTHS, 40 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + {UTF8('¿'), 0 , INV_QUESTION, 21 }, +#endif + {UTF8('À'), 'A', GRAVE, mid_A}, + {UTF8('Á'), 'A', ACUTE, mid_A}, + {UTF8('Â'), 'A', CIRCUMFLEX, mid_A}, + {UTF8('Ã'), 'A', TILDE, mid_A}, + {UTF8('Ä'), 'A', DIAERESIS, mid_A}, + {UTF8('Å'), 'A', DOT_ABOVE, mid_A}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('Æ'), 0 , LRG_AE, 40}, +#endif + {UTF8('Ç'), 'C', CEDILLA, mid_C}, + {UTF8('È'), 'E', GRAVE, mid_E}, + {UTF8('É'), 'E', ACUTE, mid_E}, + {UTF8('Ê'), 'E', CIRCUMFLEX, mid_E}, + {UTF8('Ë'), 'E', DIAERESIS, mid_E}, + {UTF8('Ì'), 'I', GRAVE, mid_I}, + {UTF8('Í'), 'I', ACUTE, mid_I}, + {UTF8('Î'), 'I', CIRCUMFLEX, mid_I}, + {UTF8('Ï'), 'I', DIAERESIS, mid_I}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('Ð'), 0, LRG_ETH, 31 }, +#endif + {UTF8('Ñ'), 'N', TILDE, mid_N}, + {UTF8('Ò'), 'O', GRAVE, mid_O}, + {UTF8('Ó'), 'O', ACUTE, mid_O}, + {UTF8('Ô'), 'O', CIRCUMFLEX, mid_O}, + {UTF8('Õ'), 'O', TILDE, mid_O}, + {UTF8('Ö'), 'O', DIAERESIS, mid_O}, +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + {UTF8('×'), 0 , MULTIPLICATION_SIGN, 32 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('Ø'), 0 , LRG_O_STROKE, 32 }, +#endif + {UTF8('Ù'), 'U', GRAVE, mid_U}, + {UTF8('Ú'), 'U', ACUTE, mid_U}, + {UTF8('Û'), 'U', CIRCUMFLEX, mid_U}, + {UTF8('Ü'), 'U', DIAERESIS, mid_U}, + {UTF8('Ý'), 'Y', ACUTE, mid_Y}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('Þ'), 0 , LRG_THORN, 25 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_GERMANIC) + {UTF8('ß'), 0 , SHARP_S, 26 }, +#endif + {UTF8('à'), 'a', GRAVE, mid_a}, + {UTF8('á'), 'a', ACUTE, mid_a}, + {UTF8('â'), 'a', CIRCUMFLEX, mid_a}, + {UTF8('ã'), 'a', TILDE, mid_a}, + {UTF8('ä'), 'a', DIAERESIS, mid_a}, + {UTF8('å'), 'a', DOT_ABOVE, mid_a}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('æ'), 0 , SML_AE, 40 }, +#endif + {UTF8('ç'), 'c', CEDILLA, mid_c}, + {UTF8('è'), 'e', GRAVE, mid_e}, + {UTF8('é'), 'e', ACUTE, mid_e}, + {UTF8('ê'), 'e', CIRCUMFLEX, mid_e}, + {UTF8('ë'), 'e', DIAERESIS, mid_e}, + {UTF8('ì'), 'i', GRAVE, mid_i}, + {UTF8('í'), 'i', ACUTE, mid_i}, + {UTF8('î'), 'i', CIRCUMFLEX, mid_i}, + {UTF8('ï'), 'i', DIAERESIS, mid_i}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('ð'), 0, SML_ETH, 24 }, +#endif + {UTF8('ñ'), 'n', TILDE, mid_n}, + {UTF8('ò'), 'o', GRAVE, mid_o}, + {UTF8('ó'), 'o', ACUTE, mid_o}, + {UTF8('ô'), 'o', CIRCUMFLEX, mid_o}, + {UTF8('õ'), 'o', TILDE, mid_o}, + {UTF8('ö'), 'o', DIAERESIS, mid_o}, +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + {UTF8('÷'), 0 , DIVISION_SIGN, 32 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('ø'), 0 , SML_O_STROKE, 25 }, +#endif + {UTF8('ù'), 'u', GRAVE, mid_u}, + {UTF8('ú'), 'u', ACUTE, mid_u}, + {UTF8('û'), 'u', CIRCUMFLEX, mid_u}, + {UTF8('ü'), 'u', DIAERESIS, mid_u}, + {UTF8('ý'), 'y', ACUTE, mid_y}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('þ'), 0 , SML_THORN, 25 }, +#endif + {UTF8('ÿ'), 'y', DIAERESIS, mid_y} + }; + + static_assert(UTF8('¡') == 0xC2A1, "Incorrect encoding for character"); + + /* Compile-time check that the table is in sorted order */ + + constexpr bool is_sorted(size_t n) { + return n < 2 ? true : char_recipe[n-2].unicode < char_recipe[n-1].unicode && is_sorted(n-1); + } + + static_assert(is_sorted(NUM_ELEMENTS(char_recipe)), "The table must be sorted by unicode value"); + + /* Performs a binary search to find a unicode character in the table */ + + static int8_t find_char_data(FTDI::utf8_char_t c) { + int8_t min = 0, max = NUM_ELEMENTS(char_recipe), index; + for (;;) { + index = (min + max)/2; + const uint16_t char_at = pgm_read_word(&char_recipe[index].unicode); + if (char_at == c) break; + if (min == max) return -1; + if (c > char_at) + min = index + 1; + else + max = index; + } + return index; + } + + static void get_char_data(uint8_t index, uint8_t &std_char, uint8_t &alt_char, uint8_t &alt_data) { + std_char = pgm_read_byte(&char_recipe[index].std_char); + alt_char = pgm_read_byte(&char_recipe[index].alt_char); + alt_data = pgm_read_byte(&char_recipe[index].alt_data); + } + + /** + * Load bitmap data into RAMG. This function is called once at the start + * of the program. + * + * Parameters: + * + * addr - Address in RAMG where the font data is written + */ + + void FTDI::WesternCharSet::load_data(uint32_t addr) { + // Load the alternative font metrics + CLCD::FontMetrics alt_fm; + alt_fm.ptr = addr + 148; + alt_fm.format = L4; + alt_fm.stride = 19; + alt_fm.width = 38; + alt_fm.height = 49; + for (uint8_t i = 0; i < 127; i++) + alt_fm.char_widths[i] = 0; + + // For special characters, copy the character widths from the char tables + for (uint8_t i = 0; i < NUM_ELEMENTS(char_recipe); i++) { + uint8_t std_char, alt_char, alt_data; + get_char_data(i, std_char, alt_char, alt_data); + if (std_char == 0) + alt_fm.char_widths[alt_char] = alt_data; + } + CLCD::mem_write_bulk(addr, &alt_fm, 148); + + // Decode the RLE data and load it into RAMG as a bitmap + write_rle_data(addr + 148, font, sizeof(font)); + + bitmap_addr = addr; + } + + /** + * Populates the bitmap handles for the custom into the display list. + * This function is called once at the start of each display list. + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + */ + + void FTDI::WesternCharSet::load_bitmaps(CommandProcessor& cmd) { + CLCD::FontMetrics alt_fm; + alt_fm.ptr = bitmap_addr + 148; + alt_fm.format = L4; + alt_fm.stride = 19; + alt_fm.width = 38; + alt_fm.height = 49; + set_font_bitmap(cmd, alt_fm, alt_font); + } + + /** + * Renders a character at location x and y. The x position is incremented + * by the width of the character. + * + * Parameters: + * + * cmd - If non-NULL the symbol is drawn to the screen. + * If NULL, only increment position for text measurement. + * + * x, y - The location at which to draw the character. On output, + * incremented to the location of the next character. + * + * fs - A scaling object used to scale the font. The display will + * already be configured to scale bitmaps, but positions + * must be scaled using fs.scale() + * + * c - The unicode code point to draw. If the renderer does not + * support the character, it should return false. + + * Returns: Whether the character was supported. + */ + + bool FTDI::WesternCharSet::render_glyph(CommandProcessor* cmd, int &x, int &y, font_size_t fs, utf8_char_t c) { + + // A supported character? + if (c < UTF8('¡') || c > UTF8('ÿ')) return false; + + int8_t index = find_char_data(c); + if (index == -1) return false; + + // Determine character characteristics + uint8_t std_char, alt_char, alt_data; + get_char_data(index, std_char, alt_char, alt_data); + + bool base_special; + uint8_t base_width; + uint8_t base_char; + uint8_t accent_char; + int8_t accent_dx, accent_dy; + + if (std_char == 0) { + // Special character, non-accented + base_width = alt_data; + base_special = true; + base_char = alt_char; + accent_char = 0; + if (c == UTF8('°')) + x -= fs.scale(deg_sign_leading); + } else { + // Regular character with accent: + accent_dx = alt_data - mid_accent; + accent_dy = isupper(std_char) ? -7 : 0; + accent_char = alt_char; + base_width = StandardCharSet::std_char_width(std_char); + base_special = std_char == 'i'; + base_char = base_special ? NO_DOT_I : std_char; + } + + // If cmd != NULL, draw the glyph to the screen + if (cmd) { + ext_vertex2ii(*cmd, x, y, base_special ? alt_font : std_font, base_char); + if (accent_char) + ext_vertex2ii(*cmd, x + fs.scale(accent_dx), y + fs.scale(accent_dy), alt_font, accent_char); + } + + // Increment X to the next character position + x += fs.scale(base_width); + return true; + } + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 && TOUCH_UI_UTF8_WESTERN_CHARSET diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h new file mode 100644 index 000000000000..704de9508878 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h @@ -0,0 +1,29 @@ +/********************** + * western_char_set.h * + **********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +namespace FTDI { + class WesternCharSet { + public: + static void load_data(uint32_t addr); + static void load_bitmaps(CommandProcessor&); + static bool render_glyph(CommandProcessor*, int &x, int &y, font_size_t, utf8_char_t); + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h new file mode 100644 index 000000000000..64a14121d975 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h @@ -0,0 +1,1315 @@ +/******************************** + * western_european_bitmap_31.h * + ********************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/* This is a dump of "font_bitmaps/western_european_bitmap_31.png" + * using the tool "bitmap2cpp.py". The tool converts the image into + * 16-level grayscale and packs two pixels per byte. The resulting + * bytes are then RLE compressed to yield (count, byte) pairs. + */ + +const unsigned char font[] PROGMEM = { + + /* 0 GRAVE */ + 0x76, 0x00, 0x01, 0x08, 0x01, 0xee, 0x01, 0xe5, 0x11, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xd0, + 0x10, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xf9, 0x11, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf2, + 0x11, 0x00, 0x01, 0x5f, 0x01, 0xfd, 0x11, 0x00, 0x01, 0x06, 0x01, 0x99, + 0x01, 0x40, 0xff, 0x00, 0xff, 0x00, 0xa4, 0x00, + + /* 1 ACUTE */ + 0x7b, 0x00, 0x01, 0x9e, 0x01, 0xee, 0x01, 0x50, 0x0f, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf8, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xd1, 0x10, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x01, 0x20, 0x0f, 0x00, + 0x01, 0x01, 0x01, 0xef, 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xaa, + 0x01, 0x40, 0xff, 0x00, 0xff, 0x00, 0xa5, 0x00, + + /* 2 CIRCUMFLEX */ + 0x79, 0x00, 0x01, 0xcf, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x07, 0x02, 0xff, + 0x01, 0x60, 0x0f, 0x00, 0x01, 0x2f, 0x02, 0xff, 0x01, 0xf2, 0x0f, 0x00, + 0x01, 0xcf, 0x01, 0xf6, 0x01, 0x6f, 0x01, 0xfb, 0x0e, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xa0, 0x01, 0x0a, 0x01, 0xff, 0x01, 0x60, 0x0d, 0x00, + 0x01, 0x1f, 0x01, 0xfd, 0x01, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xf1, + 0x0d, 0x00, 0x01, 0xbf, 0x01, 0xf3, 0x02, 0x00, 0x01, 0x3f, 0x01, 0xfb, + 0x0c, 0x00, 0x01, 0x02, 0x01, 0x99, 0x01, 0x50, 0x02, 0x00, 0x01, 0x05, + 0x01, 0x99, 0x01, 0x20, 0xff, 0x00, 0xff, 0x00, 0xa2, 0x00, + + /* 3 TILDE */ + 0x7c, 0x00, 0x01, 0x11, 0x0d, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xc3, + 0x02, 0x00, 0x01, 0xff, 0x01, 0x80, 0x0c, 0x00, 0x01, 0xaf, 0x02, 0xff, + 0x01, 0x50, 0x01, 0x01, 0x01, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xd9, 0x01, 0xff, 0x01, 0xf7, 0x01, 0x07, 0x01, 0xff, + 0x01, 0x40, 0x0b, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0x20, 0x01, 0x3e, + 0x02, 0xff, 0x01, 0xfd, 0x0c, 0x00, 0x01, 0x09, 0x01, 0xfe, 0x01, 0x00, + 0x01, 0x02, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xf4, 0x0c, 0x00, 0x01, 0x07, + 0x01, 0xa8, 0x02, 0x00, 0x01, 0x06, 0x01, 0x98, 0x01, 0x20, 0xff, 0x00, + 0xff, 0x00, 0xb6, 0x00, + + /* 4 DIAERESIS */ + 0x8a, 0x00, 0x02, 0x44, 0x02, 0x00, 0x02, 0x44, 0x0d, 0x00, 0x02, 0xff, + 0x01, 0x10, 0x01, 0x01, 0x02, 0xff, 0x0d, 0x00, 0x02, 0xff, 0x01, 0x10, + 0x01, 0x01, 0x02, 0xff, 0x0d, 0x00, 0x02, 0xff, 0x01, 0x10, 0x01, 0x01, + 0x02, 0xff, 0x0d, 0x00, 0x02, 0xcc, 0x01, 0x10, 0x01, 0x01, 0x02, 0xcc, + 0xff, 0x00, 0xff, 0x00, 0xc9, 0x00, + + /* 5 DOT_ABOVE / DEGREE_SIGN */ + 0x2d, 0x00, 0x01, 0x13, 0x01, 0x30, 0x10, 0x00, 0x01, 0x2b, 0x02, 0xff, + 0x01, 0xa1, 0x0e, 0x00, 0x01, 0x02, 0x01, 0xef, 0x02, 0xff, 0x01, 0xfd, + 0x01, 0x10, 0x0d, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x94, 0x01, 0x5a, + 0x01, 0xff, 0x01, 0xb0, 0x0d, 0x00, 0x01, 0x4f, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x9f, 0x01, 0xf2, 0x0d, 0x00, 0x01, 0x8f, 0x01, 0xf0, 0x02, 0x00, + 0x01, 0x2f, 0x01, 0xf6, 0x0d, 0x00, 0x01, 0x8f, 0x01, 0xe0, 0x02, 0x00, + 0x01, 0x0f, 0x01, 0xf7, 0x0d, 0x00, 0x01, 0x7f, 0x01, 0xf2, 0x02, 0x00, + 0x01, 0x4f, 0x01, 0xf5, 0x0d, 0x00, 0x01, 0x2f, 0x01, 0xfc, 0x01, 0x10, + 0x01, 0x02, 0x01, 0xdf, 0x01, 0xf0, 0x0d, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xfb, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x60, 0x0e, 0x00, 0x01, 0x9f, + 0x02, 0xff, 0x01, 0xf8, 0x0f, 0x00, 0x01, 0x03, 0x01, 0x9c, 0x01, 0xc9, + 0x01, 0x30, 0xff, 0x00, 0xff, 0x00, 0xa4, 0x00, + + /* 6 CEDILLA */ + 0xff, 0x00, 0xff, 0x00, 0xee, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0x20, + 0x11, 0x00, 0x01, 0xcf, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x3f, 0x01, 0xf6, + 0x11, 0x00, 0x01, 0x0f, 0x01, 0xfb, 0x11, 0x00, 0x01, 0x3f, 0x01, 0xfd, + 0x0e, 0x00, 0x01, 0x07, 0x01, 0xd9, 0x01, 0x89, 0x01, 0xff, 0x01, 0xfb, + 0x0e, 0x00, 0x01, 0x07, 0x03, 0xff, 0x01, 0xf3, 0x0e, 0x00, 0x01, 0x04, + 0x01, 0xbd, 0x01, 0xee, 0x01, 0xd9, 0x01, 0x20, 0x2f, 0x00, + + /* 7 NO_DOT_I */ + 0xff, 0x00, 0x32, 0x00, 0x01, 0x01, 0x01, 0x99, 0x01, 0x96, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0xcd, 0x00, + +#if ENABLED(TOUCH_UI_UTF8_GERMANIC) + /* 8 SHARP_S */ + 0x8a, 0x00, 0x01, 0x35, 0x01, 0x66, 0x01, 0x52, 0x0e, 0x00, 0x01, 0x03, + 0x01, 0xaf, 0x03, 0xff, 0x01, 0xe7, 0x0d, 0x00, 0x01, 0x7f, 0x05, 0xff, + 0x01, 0xc1, 0x0b, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xfc, 0x01, 0xaa, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfc, 0x0b, 0x00, 0x01, 0x2f, 0x01, 0xff, + 0x01, 0xf9, 0x01, 0x10, 0x01, 0x00, 0x01, 0x02, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x70, 0x0a, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x80, 0x03, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xe0, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf3, 0x09, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xfb, 0x04, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf7, + 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x03, + 0x01, 0x9e, 0x01, 0xff, 0x01, 0xf8, 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0x01, 0x01, 0xaf, 0x02, 0xff, 0x01, 0xd7, + 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x1d, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x50, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x70, 0x0b, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xfa, 0x0c, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xf4, 0x0c, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x01, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf4, 0x0c, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xf9, 0x0c, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, + 0x01, 0x02, 0x02, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x1d, 0x02, 0xff, + 0x01, 0xd3, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, + 0x01, 0x01, 0x01, 0xcf, 0x02, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x03, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xfb, + 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x2b, + 0x02, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, + 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf6, 0x08, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfd, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x10, 0x07, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x08, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfd, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x02, 0x01, 0x84, + 0x03, 0x00, 0x01, 0x2d, 0x01, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x01, 0x02, 0x01, 0xff, 0x01, 0xec, 0x01, 0xa9, + 0x01, 0xac, 0x02, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x01, 0x02, 0x05, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x08, 0x00, + 0x01, 0x03, 0x01, 0xee, 0x01, 0xe7, 0x01, 0x01, 0x01, 0xbf, 0x03, 0xff, + 0x01, 0xfe, 0x01, 0x80, 0x0e, 0x00, 0x01, 0x35, 0x01, 0x78, 0x01, 0x76, + 0x01, 0x30, 0xb4, 0x00, +#endif + +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + /* 9 LRG_O_STROKE */ + 0x93, 0x00, 0x01, 0x40, 0x0a, 0x00, 0x01, 0x47, 0x01, 0x9a, 0x01, 0xba, + 0x01, 0x95, 0x01, 0x10, 0x02, 0x00, 0x01, 0x07, 0x01, 0xf8, 0x08, 0x00, + 0x01, 0x02, 0x01, 0xaf, 0x04, 0xff, 0x01, 0xfc, 0x01, 0x50, 0x01, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0x30, 0x07, 0x00, 0x01, 0x8f, 0x06, 0xff, + 0x01, 0xfc, 0x01, 0x23, 0x01, 0xff, 0x01, 0xf6, 0x07, 0x00, 0x01, 0x1c, + 0x03, 0xff, 0x01, 0xca, 0x01, 0x9b, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xfe, + 0x01, 0xff, 0x01, 0x80, 0x07, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x50, 0x02, 0x00, 0x01, 0x02, 0x01, 0x9f, 0x02, 0xff, 0x01, 0xfa, + 0x07, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x03, + 0x01, 0xef, 0x01, 0xff, 0x01, 0xf3, 0x07, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xf9, 0x06, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xfc, 0x07, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x06, 0x03, 0xff, + 0x01, 0x60, 0x05, 0x00, 0x01, 0x04, 0x02, 0xff, 0x01, 0x30, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfc, 0x05, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xf7, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xa0, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x3f, 0x01, 0xff, + 0x01, 0xf2, 0x05, 0x00, 0x01, 0xcf, 0x01, 0xfc, 0x01, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe0, + 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xd1, 0x01, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xc0, + 0x04, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x20, 0x01, 0x00, 0x01, 0x03, + 0x02, 0xff, 0x05, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xf4, 0x02, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x01, 0x10, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x03, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0x01, 0x02, 0xff, + 0x01, 0x30, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x02, 0x00, + 0x01, 0x01, 0x01, 0xef, 0x01, 0xf8, 0x03, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xb0, 0x02, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, 0x01, 0x03, 0x02, 0xff, + 0x01, 0x10, 0x04, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, + 0x01, 0xbf, 0x01, 0xfd, 0x04, 0x00, 0x01, 0x04, 0x02, 0xff, 0x05, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xe1, 0x04, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfe, 0x05, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, + 0x01, 0x30, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xfa, 0x05, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf6, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf5, + 0x05, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf7, 0x05, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x2e, 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf2, 0x05, 0x00, 0x01, 0x03, 0x02, 0xff, + 0x01, 0xef, 0x01, 0xfa, 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xb0, + 0x06, 0x00, 0x01, 0xcf, 0x02, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x06, + 0x02, 0xff, 0x01, 0x40, 0x06, 0x00, 0x01, 0x2f, 0x02, 0xff, 0x01, 0x20, + 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x0b, + 0x02, 0xff, 0x01, 0xd2, 0x04, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0xe1, + 0x07, 0x00, 0x01, 0x5f, 0x03, 0xff, 0x01, 0x93, 0x02, 0x00, 0x01, 0x05, + 0x01, 0xcf, 0x02, 0xff, 0x01, 0x30, 0x06, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xfb, 0x03, 0xff, 0x01, 0xfd, 0x01, 0xde, 0x03, 0xff, 0x01, 0xe3, + 0x07, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0x80, 0x01, 0x4d, 0x06, 0xff, + 0x01, 0xfa, 0x01, 0x10, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xfb, 0x02, 0x00, + 0x01, 0x5c, 0x04, 0xff, 0x01, 0xe9, 0x01, 0x30, 0x08, 0x00, 0x01, 0x1c, + 0x01, 0xd0, 0x03, 0x00, 0x01, 0x04, 0x01, 0x67, 0x01, 0x86, 0x01, 0x53, + 0x0b, 0x00, 0x01, 0x10, 0xa8, 0x00, + + /* 10 SML_O_STROKE */ + 0xff, 0x00, 0x15, 0x00, 0x01, 0x02, 0x01, 0x20, 0x0c, 0x00, 0x01, 0x02, + 0x01, 0x32, 0x01, 0x10, 0x02, 0x00, 0x01, 0x1d, 0x01, 0xe3, 0x0a, 0x00, + 0x01, 0x01, 0x01, 0x7c, 0x02, 0xff, 0x01, 0xfd, 0x01, 0x82, 0x01, 0x00, + 0x01, 0xcf, 0x01, 0xf7, 0x0a, 0x00, 0x01, 0x6e, 0x05, 0xff, 0x01, 0x89, + 0x01, 0xff, 0x01, 0xa0, 0x09, 0x00, 0x01, 0x08, 0x07, 0xff, 0x01, 0xfc, + 0x0a, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x50, 0x01, 0x00, + 0x01, 0x3a, 0x02, 0xff, 0x01, 0xf1, 0x09, 0x00, 0x01, 0x01, 0x02, 0xff, + 0x01, 0x90, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xf5, 0x09, 0x00, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x01, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf3, + 0x03, 0x00, 0x01, 0x0b, 0x03, 0xff, 0x01, 0x30, 0x08, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xfa, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x80, 0x08, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x80, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xc0, 0x01, 0x3f, 0x01, 0xff, + 0x01, 0xb0, 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x50, 0x02, 0x00, + 0x01, 0x3f, 0x01, 0xfe, 0x01, 0x10, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe0, + 0x08, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x40, 0x01, 0x00, 0x01, 0x02, + 0x01, 0xef, 0x01, 0xf3, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf0, + 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x01, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0x50, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf0, + 0x08, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x30, 0x01, 0x00, 0x01, 0xbf, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x01, 0x08, 0x01, 0xff, 0x01, 0xb0, + 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x60, 0x01, 0x5f, 0x01, 0xfd, 0x03, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xc0, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa3, + 0x01, 0xff, 0x01, 0xe2, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x90, + 0x08, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xfe, 0x01, 0xff, 0x01, 0x40, + 0x03, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x08, 0x00, 0x01, 0x0a, + 0x02, 0xff, 0x01, 0xf6, 0x03, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfe, + 0x09, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0xb0, 0x03, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xf8, 0x0a, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xf7, + 0x02, 0x00, 0x01, 0x05, 0x01, 0xef, 0x01, 0xff, 0x01, 0xd0, 0x09, 0x00, + 0x01, 0x04, 0x03, 0xff, 0x01, 0xfc, 0x01, 0xab, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x20, 0x09, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xaf, + 0x05, 0xff, 0x01, 0xd2, 0x09, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xf5, + 0x01, 0x04, 0x01, 0xbf, 0x03, 0xff, 0x01, 0xd6, 0x0a, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0x70, 0x01, 0x00, 0x01, 0x01, 0x01, 0x46, 0x01, 0x76, + 0x01, 0x52, 0x0c, 0x00, 0x01, 0x28, 0xa9, 0x00, + + /* 11 LRG_AE */ + 0x9e, 0x00, 0x01, 0x14, 0x0b, 0x44, 0x01, 0x41, 0x06, 0x00, 0x01, 0x8f, + 0x0b, 0xff, 0x01, 0xf3, 0x06, 0x00, 0x01, 0xef, 0x0b, 0xff, 0x01, 0xf3, + 0x05, 0x00, 0x01, 0x05, 0x02, 0xff, 0x01, 0xee, 0x09, 0xff, 0x01, 0xf3, + 0x05, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf5, 0x01, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x63, 0x06, 0x33, 0x01, 0x30, 0x05, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xe0, 0x01, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x0c, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x80, 0x01, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x10, + 0x01, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xfa, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x0b, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf3, 0x02, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xd0, + 0x02, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x0a, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfe, 0x03, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x0a, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf9, + 0x03, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xed, 0x06, 0xdd, 0x01, 0x80, + 0x03, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0xdf, + 0x08, 0xff, 0x01, 0xa0, 0x03, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xb0, + 0x03, 0x00, 0x01, 0xdf, 0x08, 0xff, 0x01, 0xa0, 0x03, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x40, 0x03, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xa8, + 0x06, 0x88, 0x01, 0x50, 0x02, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfe, + 0x04, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x09, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf4, 0x04, 0x33, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x09, 0x00, 0x01, 0x7f, 0x08, 0xff, 0x01, 0x40, + 0x09, 0x00, 0x01, 0xef, 0x08, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x05, + 0x09, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf7, + 0x05, 0x33, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x80, 0x05, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x08, 0x00, 0x02, 0xff, 0x01, 0x20, 0x05, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xfb, 0x06, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xa8, 0x06, 0x88, + 0x01, 0x85, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf4, 0x06, 0x00, 0x01, 0xdf, + 0x08, 0xff, 0x01, 0xf9, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xe0, 0x06, 0x00, + 0x01, 0xdf, 0x08, 0xff, 0x01, 0xf9, 0x01, 0x8d, 0x01, 0xdd, 0x01, 0x60, + 0x06, 0x00, 0x01, 0xbd, 0x08, 0xdd, 0x01, 0xd8, 0xbe, 0x00, + + /* 12 SML_AE */ + 0xff, 0x00, 0x22, 0x00, 0x01, 0x01, 0x01, 0x34, 0x01, 0x31, 0x06, 0x00, + 0x01, 0x12, 0x01, 0x42, 0x01, 0x10, 0x05, 0x00, 0x01, 0x02, 0x01, 0x7b, + 0x01, 0xef, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x60, 0x02, 0x00, 0x01, 0x03, + 0x01, 0x9e, 0x02, 0xff, 0x01, 0xfd, 0x01, 0x81, 0x04, 0x00, 0x01, 0xbf, + 0x05, 0xff, 0x01, 0xfe, 0x01, 0x40, 0x01, 0x01, 0x01, 0x9f, 0x05, 0xff, + 0x01, 0x60, 0x03, 0x00, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xee, 0x03, 0xff, + 0x01, 0xf5, 0x01, 0x1d, 0x03, 0xff, 0x01, 0xef, 0x02, 0xff, 0x01, 0xf8, + 0x03, 0x00, 0x01, 0xdf, 0x01, 0xb6, 0x01, 0x30, 0x01, 0x00, 0x01, 0x01, + 0x01, 0x5d, 0x02, 0xff, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xe7, 0x01, 0x20, + 0x01, 0x00, 0x01, 0x29, 0x02, 0xff, 0x01, 0x50, 0x02, 0x00, 0x01, 0x71, + 0x05, 0x00, 0x01, 0xaf, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x10, 0x03, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x0d, 0x02, 0xff, + 0x01, 0xd0, 0x04, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, 0x08, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0xef, 0x01, 0xfd, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfd, 0x06, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x04, 0x00, 0x01, 0x02, 0x01, 0x45, 0x02, 0x66, 0x01, 0x67, + 0x01, 0xff, 0x01, 0xf9, 0x06, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x03, 0x00, + 0x01, 0x4a, 0x06, 0xff, 0x01, 0xfb, 0x03, 0x66, 0x01, 0x67, 0x02, 0x77, + 0x01, 0xaf, 0x01, 0xff, 0x02, 0x00, 0x01, 0x1b, 0x10, 0xff, 0x01, 0x00, + 0x01, 0x01, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xca, 0x01, 0x98, 0x01, 0x88, + 0x01, 0x89, 0x0a, 0xff, 0x01, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x40, 0x03, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfa, 0x08, 0x77, + 0x01, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x04, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x09, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x70, + 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfa, 0x09, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfe, + 0x09, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0x0f, + 0x02, 0xff, 0x01, 0x50, 0x08, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x60, + 0x04, 0x00, 0x01, 0x8f, 0x02, 0xff, 0x01, 0xe1, 0x08, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x10, 0x05, 0x00, 0x01, 0x45, 0x01, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x20, 0x01, 0x00, 0x01, 0x01, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0xa2, 0x02, 0xff, 0x01, 0xe6, 0x01, 0x10, + 0x02, 0x00, 0x01, 0x02, 0x01, 0x8d, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x05, + 0x02, 0xff, 0x01, 0xfd, 0x01, 0xab, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xfc, + 0x01, 0x00, 0x01, 0x3f, 0x02, 0xff, 0x01, 0xfd, 0x01, 0xba, 0x01, 0xbc, + 0x02, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x7f, 0x05, 0xff, 0x01, 0xa0, + 0x01, 0x00, 0x01, 0x02, 0x01, 0xcf, 0x06, 0xff, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x03, 0x01, 0xbf, 0x03, 0xff, 0x01, 0xb4, 0x03, 0x00, 0x01, 0x05, + 0x01, 0xbf, 0x04, 0xff, 0x01, 0xb7, 0x01, 0x10, 0x03, 0x00, 0x01, 0x01, + 0x01, 0x46, 0x01, 0x76, 0x01, 0x41, 0x06, 0x00, 0x01, 0x35, 0x01, 0x67, + 0x01, 0x64, 0x01, 0x20, 0xad, 0x00, + + /* 13 LRG_ETH */ + 0x9a, 0x00, 0x01, 0x34, 0x03, 0x44, 0x01, 0x43, 0x01, 0x21, 0x0d, 0x00, + 0x01, 0xbf, 0x05, 0xff, 0x01, 0xfe, 0x01, 0xb8, 0x01, 0x40, 0x0a, 0x00, + 0x01, 0xbf, 0x07, 0xff, 0x01, 0xfe, 0x01, 0x81, 0x09, 0x00, 0x01, 0xbf, + 0x08, 0xff, 0x01, 0xfe, 0x01, 0x60, 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x61, 0x02, 0x11, 0x01, 0x23, 0x01, 0x58, 0x01, 0xcf, 0x02, 0xff, + 0x01, 0xf9, 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x04, 0x00, + 0x01, 0x02, 0x01, 0x9f, 0x02, 0xff, 0x01, 0x80, 0x07, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x50, 0x05, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xf4, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfd, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x06, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0x50, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb0, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xf0, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x07, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf3, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xf5, 0x04, 0x00, 0x01, 0x23, 0x01, 0x33, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x73, 0x02, 0x33, 0x01, 0x30, 0x04, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xf6, 0x04, 0x00, 0x01, 0xcf, 0x06, 0xff, 0x01, 0xf2, 0x04, 0x00, + 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0xcf, 0x06, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf9, 0x04, 0x00, + 0x01, 0x9b, 0x01, 0xbb, 0x01, 0xef, 0x01, 0xff, 0x01, 0xdb, 0x02, 0xbb, + 0x01, 0xb1, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xf7, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, + 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf6, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf4, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xf1, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xd0, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x06, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x80, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, 0x01, 0x0b, 0x02, 0xff, + 0x01, 0x20, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf9, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x05, 0x00, 0x01, 0x0a, 0x02, 0xff, 0x01, 0xe1, 0x07, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x04, 0x00, 0x01, 0x29, 0x03, 0xff, + 0x01, 0x30, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xa7, 0x01, 0x77, + 0x01, 0x78, 0x01, 0x9a, 0x01, 0xbf, 0x03, 0xff, 0x01, 0xe3, 0x08, 0x00, + 0x01, 0xbf, 0x08, 0xff, 0x01, 0xf9, 0x01, 0x10, 0x08, 0x00, 0x01, 0xbf, + 0x07, 0xff, 0x01, 0xd8, 0x01, 0x10, 0x09, 0x00, 0x01, 0xad, 0x03, 0xdd, + 0x01, 0xdc, 0x01, 0xcb, 0x01, 0xa7, 0x01, 0x41, 0xc7, 0x00, + + /* 14 SML_ETH */ + 0x88, 0x00, 0x01, 0x38, 0x01, 0x88, 0x01, 0x81, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x5a, 0x01, 0x40, 0x0c, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xb0, 0x01, 0x04, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0xa0, 0x0c, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0xfc, 0x02, 0xff, + 0x01, 0xd8, 0x01, 0x20, 0x0c, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xfd, + 0x01, 0x82, 0x0d, 0x00, 0x01, 0x5a, 0x03, 0xff, 0x01, 0xf4, 0x0d, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x87, 0x02, 0xff, 0x01, 0x30, + 0x0c, 0x00, 0x01, 0x6f, 0x01, 0xe9, 0x01, 0x30, 0x01, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0xe2, 0x0c, 0x00, 0x01, 0x03, 0x03, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x23, 0x01, 0x44, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x02, 0x01, 0x9e, + 0x04, 0xff, 0x01, 0xf7, 0x0c, 0x00, 0x01, 0x7f, 0x06, 0xff, 0x01, 0x30, + 0x0a, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0xfe, 0x01, 0xcb, 0x01, 0xdf, + 0x02, 0xff, 0x01, 0xd0, 0x0a, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xfb, + 0x01, 0x30, 0x02, 0x00, 0x01, 0x4e, 0x01, 0xff, 0x01, 0xf5, 0x09, 0x00, + 0x01, 0x02, 0x02, 0xff, 0x01, 0x70, 0x03, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xfd, 0x09, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfa, 0x05, 0x00, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x20, 0x08, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xf1, 0x05, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa0, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0xb0, 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, + 0x01, 0x40, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0x30, 0x05, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xf0, 0x08, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x30, 0x05, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, + 0x01, 0x40, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, 0x01, 0x2f, 0x01, 0xff, + 0x01, 0xd0, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa0, 0x05, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0x90, 0x08, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xf1, 0x05, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x08, 0x00, + 0x01, 0x09, 0x01, 0xff, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xfe, 0x09, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x60, 0x03, 0x00, + 0x01, 0x3e, 0x01, 0xff, 0x01, 0xf6, 0x0a, 0x00, 0x01, 0x7f, 0x01, 0xff, + 0x01, 0xf9, 0x01, 0x20, 0x01, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xb0, + 0x0a, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0xfd, 0x01, 0xbd, 0x02, 0xff, + 0x01, 0xfd, 0x01, 0x10, 0x0b, 0x00, 0x01, 0x7f, 0x05, 0xff, 0x01, 0xb0, + 0x0c, 0x00, 0x01, 0x02, 0x01, 0xae, 0x03, 0xff, 0x01, 0xb4, 0x0f, 0x00, + 0x01, 0x35, 0x01, 0x65, 0x01, 0x40, 0xb6, 0x00, + + /* 15 LRG_THORN */ + 0x9a, 0x00, 0x02, 0x55, 0x11, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x05, 0xff, 0x01, 0xed, 0x01, 0xa7, 0x01, 0x10, 0x0b, 0x00, 0x07, 0xff, + 0x01, 0xfa, 0x01, 0x10, 0x0a, 0x00, 0x08, 0xff, 0x01, 0xe2, 0x0a, 0x00, + 0x02, 0xff, 0x01, 0x65, 0x01, 0x55, 0x01, 0x56, 0x01, 0x7a, 0x02, 0xff, + 0x01, 0xfe, 0x01, 0x10, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, + 0x01, 0x1b, 0x02, 0xff, 0x01, 0x80, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, + 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xf0, 0x09, 0x00, 0x02, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x09, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf6, + 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xf7, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xf7, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, 0x04, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf6, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, + 0x04, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x09, 0x00, 0x02, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xf0, 0x09, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x1b, 0x02, 0xff, 0x01, 0x80, + 0x09, 0x00, 0x02, 0xff, 0x01, 0x65, 0x02, 0x55, 0x01, 0x7a, 0x02, 0xff, + 0x01, 0xfe, 0x01, 0x10, 0x09, 0x00, 0x08, 0xff, 0x01, 0xe2, 0x0a, 0x00, + 0x07, 0xff, 0x01, 0xfa, 0x01, 0x10, 0x0a, 0x00, 0x05, 0xff, 0x01, 0xed, + 0x01, 0xa7, 0x01, 0x10, 0x0b, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xcc, 0x01, 0x10, 0xcc, 0x00, + + /* 16 SML_THORN */ + 0x86, 0x00, 0x01, 0x02, 0x01, 0x99, 0x01, 0x94, 0x10, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x02, 0x00, 0x01, 0x13, 0x01, 0x54, 0x01, 0x20, 0x0b, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x01, 0x00, 0x01, 0x5c, 0x02, 0xff, 0x01, 0xfd, + 0x01, 0x70, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x01, 0x0b, + 0x04, 0xff, 0x01, 0xfd, 0x01, 0x20, 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf7, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xec, 0x01, 0xdf, 0x02, 0xff, + 0x01, 0xe1, 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfd, 0x01, 0xff, + 0x01, 0xc3, 0x02, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xfc, 0x09, 0x00, + 0x01, 0x03, 0x02, 0xff, 0x01, 0xfa, 0x03, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x60, 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0xe0, + 0x04, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x03, + 0x02, 0xff, 0x01, 0x60, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf3, + 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf7, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfc, 0x05, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xfb, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf9, 0x06, 0x00, 0x01, 0xff, 0x01, 0xfd, 0x08, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xef, 0x01, 0xfe, 0x08, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xef, + 0x01, 0xfe, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf9, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xfd, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfc, + 0x05, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfb, 0x08, 0x00, 0x01, 0x03, + 0x02, 0xff, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, 0x08, 0x00, + 0x01, 0x03, 0x02, 0xff, 0x01, 0x60, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf3, 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0xd0, 0x04, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, + 0x01, 0xfa, 0x03, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0x60, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfd, 0x01, 0xff, 0x01, 0xb3, + 0x02, 0x00, 0x01, 0x6e, 0x01, 0xff, 0x01, 0xfc, 0x09, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xec, 0x01, 0xcf, + 0x02, 0xff, 0x01, 0xe2, 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x01, 0x0b, 0x04, 0xff, 0x01, 0xfd, 0x01, 0x20, 0x09, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x01, 0x00, 0x01, 0x6c, 0x02, 0xff, 0x01, 0xfe, + 0x01, 0x70, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x23, 0x01, 0x54, 0x01, 0x20, 0x0b, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf7, 0x10, 0x00, 0x01, 0x01, 0x01, 0x66, 0x01, 0x63, 0x22, 0x00, +#endif // TOUCH_UI_UTF8_SCANDINAVIAN + +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + /* 17 LEFT_DBL_QUOTE */ + 0xff, 0x00, 0x4a, 0x00, 0x01, 0x30, 0x03, 0x00, 0x01, 0x02, 0x0d, 0x00, + 0x01, 0x08, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x01, 0x01, 0xc6, 0x0d, 0x00, + 0x01, 0xaf, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x1d, 0x01, 0xf6, 0x0c, 0x00, + 0x01, 0x1c, 0x01, 0xff, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x50, + 0x01, 0x00, 0x01, 0x3e, 0x01, 0xff, 0x01, 0xe2, 0x0b, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xf4, 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x20, 0x0a, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xfe, 0x01, 0x30, + 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xd1, 0x0b, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0xd2, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfb, + 0x0b, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x10, 0x01, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xd0, 0x02, 0x00, 0x01, 0xff, 0x01, 0xfa, 0x0c, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0x50, + 0x0c, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x1c, + 0x01, 0xff, 0x01, 0xf6, 0x0c, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfb, + 0x02, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x90, 0x0c, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xd1, 0x01, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xfa, + 0x0c, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x20, 0x01, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0xa0, 0x01, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf6, 0x0c, 0x00, + 0x01, 0x02, 0x01, 0xef, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x5f, 0x01, 0xf6, + 0x0d, 0x00, 0x01, 0x1d, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x04, 0x01, 0xe6, + 0x0d, 0x00, 0x01, 0x01, 0x01, 0x60, 0x03, 0x00, 0x01, 0x24, 0xff, 0x00, + + /* 18 RIGHT_DBL_QUOTE */ + 0xff, 0x00, 0x46, 0x00, 0x01, 0x20, 0x03, 0x00, 0x01, 0x20, 0x0d, 0x00, + 0x01, 0x01, 0x01, 0xe3, 0x03, 0x00, 0x01, 0x5d, 0x01, 0x10, 0x0c, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0x50, 0x02, 0x00, 0x01, 0x5f, 0x01, 0xe2, + 0x0c, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf6, 0x02, 0x00, 0x01, 0x5f, + 0x01, 0xfe, 0x01, 0x30, 0x0c, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x80, + 0x01, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xf5, 0x0c, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xfa, 0x01, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x60, 0x0c, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xb0, 0x01, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf9, 0x0c, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xfc, 0x01, 0x10, 0x01, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, + 0x0c, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xd1, 0x01, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x10, 0x0b, 0x00, 0x01, 0x2d, + 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x10, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xff, 0x01, 0x40, + 0x01, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xd2, 0x0b, 0x00, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0xe3, 0x01, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfc, + 0x01, 0x10, 0x0a, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, + 0x01, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xc1, 0x01, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf9, + 0x0b, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0x70, 0x0b, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0x90, + 0x02, 0x00, 0x01, 0x5f, 0x01, 0xf6, 0x0c, 0x00, 0x01, 0x01, 0x01, 0xf8, + 0x03, 0x00, 0x01, 0x5f, 0x01, 0x40, 0x0c, 0x00, 0x01, 0x01, 0x01, 0x50, + 0x03, 0x00, 0x01, 0x43, 0xff, 0x00, 0x04, 0x00, + + /* 19 INV_EXCLAMATION */ + 0xff, 0x00, 0x34, 0x00, 0x01, 0xad, 0x01, 0xdd, 0x01, 0x40, 0x10, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x34, 0x01, 0x44, + 0x01, 0x10, 0x49, 0x00, 0x01, 0x02, 0x01, 0x22, 0x11, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x11, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x11, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x10, 0x10, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x20, + 0x10, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x30, 0x10, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x30, 0x10, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x40, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x34, + 0x01, 0x44, 0x01, 0x10, 0x33, 0x00, + + /* 20 INV_QUESTION */ + 0xff, 0x00, 0x36, 0x00, 0x02, 0xdd, 0x11, 0x00, 0x02, 0xff, 0x11, 0x00, + 0x02, 0xff, 0x11, 0x00, 0x02, 0xff, 0x11, 0x00, 0x02, 0xff, 0x11, 0x00, + 0x02, 0x44, 0x37, 0x00, 0x01, 0xbc, 0x01, 0xcb, 0x11, 0x00, 0x01, 0xef, + 0x01, 0xfe, 0x11, 0x00, 0x01, 0xef, 0x01, 0xfe, 0x11, 0x00, 0x01, 0xef, + 0x01, 0xfe, 0x11, 0x00, 0x01, 0xff, 0x01, 0xfd, 0x10, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xfb, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xd0, 0x0f, 0x00, 0x01, 0x0a, + 0x02, 0xff, 0x01, 0x30, 0x0f, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xf4, + 0x0f, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0x40, 0x0f, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0xf4, 0x0f, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0x40, + 0x0f, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf8, 0x10, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x05, 0x01, 0xd0, 0x0a, 0x00, + 0x01, 0x08, 0x02, 0xff, 0x01, 0x70, 0x02, 0x00, 0x01, 0x05, 0x01, 0xcf, + 0x01, 0xf0, 0x0a, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x98, 0x01, 0x8b, 0x02, 0xff, 0x01, 0xf0, 0x0b, 0x00, 0x01, 0x3f, + 0x06, 0xff, 0x01, 0xc0, 0x0b, 0x00, 0x01, 0x02, 0x01, 0xcf, 0x04, 0xff, + 0x01, 0xc5, 0x0d, 0x00, 0x01, 0x03, 0x01, 0x8b, 0x01, 0xcc, 0x01, 0xb9, + 0x01, 0x62, 0x31, 0x00, +#endif // TOUCH_UI_UTF8_PUNCTUATION + +#if ENABLED(TOUCH_UI_UTF8_CURRENCY) + /* 21 CENT_SIGN */ + 0xb1, 0x00, 0x01, 0x01, 0x01, 0x32, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, + 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, + 0x11, 0x00, 0x01, 0x05, 0x01, 0xfc, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfc, + 0x11, 0x00, 0x01, 0x39, 0x01, 0xfd, 0x01, 0x42, 0x0e, 0x00, 0x01, 0x05, + 0x01, 0xbf, 0x03, 0xff, 0x01, 0xfb, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x03, + 0x01, 0xcf, 0x05, 0xff, 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x4f, 0x02, 0xff, + 0x02, 0xfe, 0x01, 0xce, 0x01, 0xff, 0x01, 0xf6, 0x0a, 0x00, 0x01, 0x02, + 0x02, 0xff, 0x01, 0xe6, 0x01, 0x05, 0x01, 0xfc, 0x01, 0x00, 0x01, 0x38, + 0x01, 0xe6, 0x0a, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, + 0x01, 0x05, 0x01, 0xfc, 0x02, 0x00, 0x01, 0x02, 0x0a, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0xe1, 0x01, 0x00, 0x01, 0x05, 0x01, 0xfc, 0x0d, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x60, 0x01, 0x00, 0x01, 0x05, 0x01, 0xfc, + 0x0d, 0x00, 0x02, 0xff, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfc, 0x0c, 0x00, + 0x01, 0x04, 0x01, 0xff, 0x01, 0xfb, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfc, + 0x0c, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x05, + 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x05, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, + 0x02, 0x00, 0x01, 0x05, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf7, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x0c, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xfc, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfb, + 0x0d, 0x00, 0x02, 0xff, 0x01, 0x10, 0x01, 0x00, 0x01, 0x05, 0x01, 0xfb, + 0x0d, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x80, 0x01, 0x00, 0x01, 0x05, + 0x01, 0xfb, 0x0d, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, + 0x01, 0x05, 0x01, 0xfb, 0x0d, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x30, 0x01, 0x05, 0x01, 0xfb, 0x02, 0x00, 0x01, 0x33, 0x0a, 0x00, + 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf9, 0x01, 0x35, 0x01, 0xfb, + 0x01, 0x02, 0x01, 0x6c, 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x2d, 0x06, 0xff, + 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x01, 0x01, 0x9f, 0x05, 0xff, 0x01, 0xf5, + 0x0c, 0x00, 0x01, 0x02, 0x01, 0x8d, 0x03, 0xff, 0x01, 0xc7, 0x01, 0x20, + 0x0e, 0x00, 0x01, 0x06, 0x01, 0xfc, 0x01, 0x20, 0x10, 0x00, 0x01, 0x05, + 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, + 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, + 0x01, 0xfb, 0x57, 0x00, + + /* 22 POUND_SIGN */ + 0x9e, 0x00, 0x01, 0x6b, 0x01, 0xdf, 0x01, 0xfd, 0x01, 0xc9, 0x01, 0x40, + 0x0d, 0x00, 0x01, 0x6e, 0x05, 0xff, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x07, + 0x06, 0xff, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x85, 0x01, 0x34, 0x01, 0x7b, 0x01, 0xff, 0x01, 0x30, 0x0b, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xc1, 0x03, 0x00, 0x01, 0x18, 0x01, 0x30, + 0x0a, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x30, 0x0f, 0x00, 0x01, 0x04, + 0x01, 0xff, 0x01, 0xfd, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xfa, + 0x10, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf8, 0x10, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x0e, 0x00, 0x01, 0x0a, + 0x07, 0xff, 0x01, 0xf4, 0x0a, 0x00, 0x01, 0x0a, 0x07, 0xff, 0x01, 0xf4, + 0x0a, 0x00, 0x01, 0x08, 0x01, 0xdd, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfe, + 0x03, 0xdd, 0x01, 0xd4, 0x0c, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf6, 0x0e, 0x00, 0x01, 0x4b, 0x01, 0xbb, 0x01, 0xbe, + 0x01, 0xff, 0x01, 0xfd, 0x05, 0xbb, 0x01, 0x70, 0x08, 0x00, 0x01, 0x6f, + 0x09, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x6f, 0x09, 0xff, 0x01, 0xa0, + 0x08, 0x00, 0x01, 0x4a, 0x09, 0xaa, 0x01, 0x60, 0xc5, 0x00, + + /* 23 CURRENCY_SIGN */ + 0xff, 0x00, 0x0d, 0x00, 0x01, 0x30, 0x07, 0x00, 0x01, 0x01, 0x01, 0x40, + 0x08, 0x00, 0x01, 0x0b, 0x01, 0xf5, 0x07, 0x00, 0x01, 0x1d, 0x01, 0xf4, + 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x01, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0x30, 0x07, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xf4, 0x01, 0x00, 0x01, 0x6b, 0x01, 0xdd, 0x01, 0xc8, 0x01, 0x20, + 0x01, 0x1d, 0x01, 0xff, 0x01, 0xfa, 0x08, 0x00, 0x01, 0x05, 0x02, 0xff, + 0x01, 0x8e, 0x03, 0xff, 0x01, 0xfa, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xa0, + 0x09, 0x00, 0x01, 0x5f, 0x07, 0xff, 0x01, 0xfa, 0x0a, 0x00, 0x01, 0x05, + 0x02, 0xff, 0x01, 0xe9, 0x01, 0x55, 0x01, 0x7c, 0x02, 0xff, 0x01, 0xa0, + 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfb, 0x01, 0x10, 0x02, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0xa0, 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0xc0, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf2, 0x0a, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0xdf, 0x01, 0xf7, + 0x0a, 0x00, 0x01, 0x4f, 0x01, 0xfd, 0x05, 0x00, 0x01, 0x8f, 0x01, 0xfa, + 0x0a, 0x00, 0x01, 0x6f, 0x01, 0xfc, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xfc, + 0x0a, 0x00, 0x01, 0x5f, 0x01, 0xfc, 0x05, 0x00, 0x01, 0x7f, 0x01, 0xfb, + 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x10, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0xf8, 0x0a, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0x80, 0x03, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf3, 0x0a, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf5, 0x03, 0x00, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, + 0x01, 0x01, 0x02, 0xff, 0x01, 0x92, 0x01, 0x00, 0x01, 0x16, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x60, 0x0a, 0x00, 0x01, 0x1d, 0x03, 0xff, 0x01, 0xfe, + 0x03, 0xff, 0x01, 0xf4, 0x09, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x05, 0xff, + 0x01, 0xfe, 0x02, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x1d, 0x01, 0xff, + 0x01, 0xfa, 0x01, 0x06, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x81, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf4, 0x08, 0x00, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0xa0, 0x01, 0x00, 0x01, 0x01, 0x01, 0x44, 0x01, 0x20, 0x01, 0x00, + 0x01, 0x05, 0x02, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0x4f, 0x01, 0xfa, + 0x07, 0x00, 0x01, 0x4f, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x05, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x05, 0x01, 0x80, 0xeb, 0x00, + + /* 24 YEN_SIGN */ + 0x98, 0x00, 0x01, 0x01, 0x01, 0x88, 0x01, 0x85, 0x07, 0x00, 0x01, 0x38, + 0x01, 0x88, 0x01, 0x40, 0x07, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x07, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, + 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf2, 0x05, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfa, + 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x60, 0x09, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0xef, 0x01, 0xfd, 0x0a, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf5, 0x0a, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x01, 0x01, 0xef, + 0x01, 0xfd, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0x50, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf3, 0x0c, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf7, 0x01, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xa0, 0x0a, 0x00, + 0x01, 0x2a, 0x02, 0xaa, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0xca, 0x01, 0xaa, 0x01, 0xa5, 0x08, 0x00, 0x01, 0x4f, + 0x04, 0xff, 0x01, 0x83, 0x04, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x3c, + 0x02, 0xcc, 0x01, 0xce, 0x01, 0xff, 0x01, 0xfd, 0x01, 0xff, 0x01, 0xfc, + 0x02, 0xcc, 0x01, 0xc6, 0x0b, 0x00, 0x01, 0x03, 0x03, 0xff, 0x01, 0x70, + 0x0f, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xfe, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xf5, 0x0c, 0x00, 0x01, 0x01, 0x03, 0x11, 0x01, 0x1e, + 0x01, 0xff, 0x01, 0xf3, 0x03, 0x11, 0x01, 0x10, 0x08, 0x00, 0x01, 0x4f, + 0x09, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x4f, 0x09, 0xff, 0x01, 0xf8, + 0x08, 0x00, 0x01, 0x27, 0x03, 0x77, 0x01, 0x7e, 0x01, 0xff, 0x01, 0xf8, + 0x03, 0x77, 0x01, 0x73, 0x0c, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x08, + 0x01, 0x99, 0x01, 0x91, 0xc9, 0x00, +#endif // TOUCH_UI_UTF8_CURRENCY + +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + /* 25 SUPERSCRIPT_ONE */ + 0x99, 0x00, 0x01, 0x01, 0x01, 0x36, 0x01, 0x9b, 0x01, 0xbb, 0x01, 0x20, + 0x0e, 0x00, 0x01, 0x3f, 0x03, 0xff, 0x01, 0x20, 0x0e, 0x00, 0x01, 0x3f, + 0x01, 0xfe, 0x01, 0xbe, 0x01, 0xff, 0x01, 0x20, 0x0e, 0x00, 0x01, 0x14, + 0x01, 0x10, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x0f, 0x00, 0x01, 0x11, 0x01, 0x1c, 0x01, 0xff, + 0x01, 0x31, 0x01, 0x11, 0x0d, 0x00, 0x01, 0x0d, 0x05, 0xff, 0x01, 0x40, + 0x0c, 0x00, 0x01, 0x0d, 0x05, 0xff, 0x01, 0x40, 0x0c, 0x00, 0x01, 0x01, + 0x05, 0x22, 0xff, 0x00, 0xc2, 0x00, + + /* 26 SUPERSCRIPT_TWO */ + 0x88, 0x00, 0x01, 0x01, 0x10, 0x00, 0x01, 0x16, 0x01, 0xae, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x92, 0x0e, 0x00, 0x05, 0xff, 0x01, 0x60, 0x0d, 0x00, + 0x01, 0xfe, 0x01, 0x84, 0x01, 0x22, 0x01, 0x5c, 0x01, 0xff, 0x01, 0xf3, + 0x0d, 0x00, 0x01, 0x50, 0x03, 0x00, 0x01, 0xcf, 0x01, 0xfa, 0x11, 0x00, + 0x01, 0x5f, 0x01, 0xfc, 0x11, 0x00, 0x01, 0x5f, 0x01, 0xfb, 0x11, 0x00, + 0x01, 0xcf, 0x01, 0xf4, 0x10, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x6f, 0x01, 0xfe, 0x01, 0x10, 0x0f, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xe2, 0x10, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x30, + 0x0f, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xe3, 0x10, 0x00, 0x01, 0x6f, + 0x01, 0xfe, 0x01, 0x20, 0x0f, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xd1, + 0x10, 0x00, 0x01, 0xaf, 0x01, 0xfd, 0x01, 0x43, 0x03, 0x33, 0x0c, 0x00, + 0x01, 0x01, 0x06, 0xff, 0x0c, 0x00, 0x01, 0x01, 0x06, 0xff, 0x0d, 0x00, + 0x06, 0x22, 0xff, 0x00, 0xc2, 0x00, + + /* 27 SUPERSCRIPT_THREE */ + 0x88, 0x00, 0x01, 0x01, 0x01, 0x10, 0x0f, 0x00, 0x01, 0x39, 0x01, 0xce, + 0x02, 0xff, 0x01, 0xb5, 0x0e, 0x00, 0x01, 0x7f, 0x04, 0xff, 0x01, 0xb0, + 0x0d, 0x00, 0x01, 0x6b, 0x01, 0x73, 0x01, 0x22, 0x01, 0x38, 0x01, 0xff, + 0x01, 0xf9, 0x11, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x11, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x11, 0x00, 0x01, 0x4f, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x27, + 0x01, 0xff, 0x01, 0xf3, 0x0e, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xfa, + 0x01, 0x20, 0x0e, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x40, + 0x0e, 0x00, 0x01, 0x01, 0x01, 0x23, 0x01, 0x49, 0x01, 0xff, 0x01, 0xf6, + 0x11, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x10, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0x60, + 0x10, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0x40, 0x0c, 0x00, 0x01, 0xa4, + 0x02, 0x00, 0x01, 0x05, 0x01, 0xdf, 0x01, 0xfd, 0x0d, 0x00, 0x02, 0xff, + 0x01, 0xde, 0x02, 0xff, 0x01, 0xe3, 0x0d, 0x00, 0x01, 0xae, 0x03, 0xff, + 0x01, 0xe9, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x24, 0x01, 0x55, 0x01, 0x52, + 0xff, 0x00, 0xc4, 0x00, +#endif // TOUCH_UI_UTF8_SUPERSCRIPTS + +#if ENABLED(TOUCH_UI_UTF8_ORDINALS) + /* 28 MASCULINE_ORDINAL */ + 0x89, 0x00, 0x01, 0x01, 0x01, 0x10, 0x0f, 0x00, 0x01, 0x01, 0x01, 0x8d, + 0x02, 0xff, 0x01, 0xb4, 0x0e, 0x00, 0x01, 0x4f, 0x04, 0xff, 0x01, 0xa0, + 0x0c, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x63, 0x01, 0x48, + 0x01, 0xff, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xa0, + 0x02, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0x6f, + 0x01, 0xfe, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xd0, 0x0b, 0x00, + 0x01, 0xbf, 0x01, 0xf7, 0x04, 0x00, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf3, 0x04, 0x00, 0x01, 0xcf, 0x01, 0xf6, 0x0b, 0x00, + 0x01, 0xff, 0x01, 0xf1, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xf7, 0x0b, 0x00, + 0x01, 0xff, 0x01, 0xf1, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xf7, 0x0b, 0x00, + 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xbf, 0x01, 0xf6, 0x0b, 0x00, + 0x01, 0xcf, 0x01, 0xf6, 0x04, 0x00, 0x01, 0xef, 0x01, 0xf4, 0x0b, 0x00, + 0x01, 0x8f, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf0, + 0x0b, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0x1d, + 0x01, 0xff, 0x01, 0x90, 0x0b, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf8, + 0x01, 0x10, 0x01, 0x04, 0x01, 0xdf, 0x01, 0xfe, 0x01, 0x10, 0x0c, 0x00, + 0x01, 0xaf, 0x04, 0xff, 0x01, 0xe3, 0x0d, 0x00, 0x01, 0x05, 0x01, 0xdf, + 0x02, 0xff, 0x01, 0xfa, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x02, 0x01, 0x56, + 0x01, 0x64, 0x21, 0x00, 0x01, 0x16, 0x06, 0x66, 0x01, 0x40, 0x0b, 0x00, + 0x01, 0x3f, 0x06, 0xff, 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x3f, 0x06, 0xff, + 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x01, 0x06, 0x11, 0xff, 0x00, 0x75, 0x00, + + /* 29 FEMININE_ORDINAL */ + 0x89, 0x00, 0x01, 0x12, 0x01, 0x10, 0x0f, 0x00, 0x01, 0x49, 0x01, 0xdf, + 0x02, 0xff, 0x01, 0xb4, 0x0d, 0x00, 0x01, 0x07, 0x05, 0xff, 0x01, 0xa0, + 0x0c, 0x00, 0x01, 0x07, 0x01, 0xfc, 0x01, 0x74, 0x01, 0x33, 0x01, 0x59, + 0x01, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0x03, 0x01, 0x20, 0x03, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0x10, 0x10, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0x50, 0x0e, 0x00, 0x01, 0x01, 0x01, 0x11, 0x01, 0x16, 0x01, 0xff, + 0x01, 0x80, 0x0c, 0x00, 0x01, 0x05, 0x01, 0xae, 0x04, 0xff, 0x01, 0x90, + 0x0b, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x05, 0xff, 0x01, 0xa0, 0x0b, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xe9, 0x01, 0x65, 0x01, 0x44, 0x01, 0x48, + 0x01, 0xff, 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x5f, 0x01, 0xfd, 0x01, 0x10, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x9f, + 0x01, 0xf6, 0x03, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xa0, 0x0b, 0x00, + 0x01, 0xaf, 0x01, 0xf5, 0x03, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xa0, + 0x0b, 0x00, 0x01, 0x9f, 0x01, 0xfa, 0x03, 0x00, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa2, 0x01, 0x00, + 0x01, 0x3b, 0x02, 0xff, 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x0a, 0x04, 0xff, + 0x01, 0xe7, 0x01, 0xff, 0x01, 0xa0, 0x0c, 0x00, 0x01, 0x8f, 0x02, 0xff, + 0x01, 0xf9, 0x01, 0x15, 0x01, 0xff, 0x01, 0xa0, 0x0d, 0x00, 0x01, 0x46, + 0x01, 0x64, 0x02, 0x00, 0x01, 0x11, 0x1f, 0x00, 0x01, 0x16, 0x06, 0x66, + 0x01, 0x40, 0x0b, 0x00, 0x01, 0x3f, 0x06, 0xff, 0x01, 0xb0, 0x0b, 0x00, + 0x01, 0x3f, 0x06, 0xff, 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x01, 0x06, 0x11, + 0xff, 0x00, 0x75, 0x00, +#endif // TOUCH_UI_UTF8_ORDINALS + +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + /* 30 COPYRIGHT_SIGN */ + 0xa0, 0x00, 0x01, 0x01, 0x01, 0x45, 0x01, 0x76, 0x01, 0x43, 0x0e, 0x00, + 0x01, 0x28, 0x01, 0xdf, 0x03, 0xff, 0x01, 0xe9, 0x01, 0x40, 0x0b, 0x00, + 0x01, 0x19, 0x02, 0xff, 0x01, 0xdb, 0x01, 0xab, 0x01, 0xce, 0x01, 0xff, + 0x01, 0xfb, 0x01, 0x30, 0x09, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xfb, + 0x01, 0x50, 0x03, 0x00, 0x01, 0x38, 0x01, 0xff, 0x01, 0xf7, 0x09, 0x00, + 0x01, 0x6f, 0x01, 0xfc, 0x01, 0x30, 0x05, 0x00, 0x01, 0x19, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x5f, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x3f, 0x01, 0xf8, 0x03, 0x00, + 0x01, 0x46, 0x01, 0x88, 0x01, 0x65, 0x01, 0x10, 0x01, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0x80, 0x06, 0x00, 0x01, 0xef, 0x01, 0xa0, 0x01, 0x00, + 0x01, 0x01, 0x01, 0x9f, 0x03, 0xff, 0x01, 0xfc, 0x01, 0x60, 0x01, 0x00, + 0x01, 0x4f, 0x01, 0xf4, 0x05, 0x00, 0x01, 0x08, 0x01, 0xfd, 0x02, 0x00, + 0x01, 0x4e, 0x02, 0xff, 0x01, 0xed, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, + 0x01, 0x00, 0x01, 0x08, 0x01, 0xfd, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xf4, + 0x01, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x61, 0x01, 0x00, + 0x01, 0x01, 0x01, 0x4a, 0x01, 0xa0, 0x02, 0x00, 0x01, 0xef, 0x01, 0x60, + 0x04, 0x00, 0x01, 0x6f, 0x01, 0xc0, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xc1, 0x07, 0x00, 0x01, 0x7f, 0x01, 0xb0, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0x60, 0x01, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x10, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xf0, 0x04, 0x00, 0x01, 0xff, 0x01, 0x20, 0x01, 0x00, + 0x01, 0xdf, 0x01, 0xf9, 0x08, 0x00, 0x01, 0x0d, 0x01, 0xf4, 0x03, 0x00, + 0x01, 0x01, 0x01, 0xfe, 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf4, + 0x08, 0x00, 0x01, 0x0a, 0x01, 0xf6, 0x03, 0x00, 0x01, 0x03, 0x01, 0xfd, + 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0x08, + 0x01, 0xf8, 0x03, 0x00, 0x01, 0x04, 0x01, 0xfc, 0x01, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x07, 0x01, 0xf9, 0x03, 0x00, + 0x01, 0x03, 0x01, 0xfd, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0x08, 0x01, 0xf8, 0x03, 0x00, 0x01, 0x01, 0x01, 0xfe, + 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf3, 0x08, 0x00, 0x01, 0x09, + 0x01, 0xf7, 0x04, 0x00, 0x01, 0xff, 0x01, 0x10, 0x01, 0x00, 0x01, 0xdf, + 0x01, 0xf8, 0x08, 0x00, 0x01, 0x0c, 0x01, 0xf5, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0x60, 0x01, 0x00, 0x01, 0x8f, 0x01, 0xfe, 0x01, 0x10, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xf1, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xb0, 0x01, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xb0, 0x07, 0x00, 0x01, 0x6f, 0x01, 0xc0, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xf4, 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x50, 0x02, 0x00, 0x01, 0x29, 0x01, 0xa0, 0x02, 0x00, + 0x01, 0xef, 0x01, 0x60, 0x04, 0x00, 0x01, 0x08, 0x01, 0xfd, 0x02, 0x00, + 0x01, 0x6f, 0x02, 0xff, 0x01, 0xdb, 0x01, 0xce, 0x01, 0xff, 0x01, 0xb0, + 0x01, 0x00, 0x01, 0x07, 0x01, 0xfd, 0x05, 0x00, 0x01, 0x01, 0x01, 0xef, + 0x01, 0x90, 0x01, 0x00, 0x01, 0x02, 0x01, 0xbf, 0x03, 0xff, 0x01, 0xfe, + 0x01, 0x70, 0x01, 0x00, 0x01, 0x4f, 0x01, 0xf4, 0x06, 0x00, 0x01, 0x4f, + 0x01, 0xf7, 0x02, 0x00, 0x01, 0x01, 0x01, 0x58, 0x01, 0x9a, 0x01, 0x86, + 0x01, 0x30, 0x01, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0x80, 0x06, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0x90, 0x07, 0x00, 0x01, 0x4f, 0x01, 0xfb, + 0x08, 0x00, 0x01, 0x6f, 0x01, 0xfc, 0x01, 0x30, 0x05, 0x00, 0x01, 0x18, + 0x01, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xfa, + 0x01, 0x40, 0x03, 0x00, 0x01, 0x27, 0x01, 0xef, 0x01, 0xf8, 0x0a, 0x00, + 0x01, 0x19, 0x02, 0xff, 0x01, 0xca, 0x01, 0x9a, 0x01, 0xbe, 0x01, 0xff, + 0x01, 0xfc, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x29, 0x01, 0xdf, 0x03, 0xff, + 0x01, 0xfa, 0x01, 0x40, 0x0d, 0x00, 0x01, 0x02, 0x01, 0x46, 0x01, 0x76, + 0x01, 0x53, 0xc5, 0x00, + + /* 31 REGISTERED_SIGN */ + 0xa0, 0x00, 0x01, 0x02, 0x01, 0x46, 0x01, 0x76, 0x01, 0x53, 0x0e, 0x00, + 0x01, 0x28, 0x01, 0xdf, 0x03, 0xff, 0x01, 0xea, 0x01, 0x40, 0x0b, 0x00, + 0x01, 0x19, 0x02, 0xff, 0x01, 0xcb, 0x01, 0x9a, 0x01, 0xce, 0x01, 0xff, + 0x01, 0xfc, 0x01, 0x30, 0x09, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xfa, + 0x01, 0x40, 0x03, 0x00, 0x01, 0x38, 0x01, 0xff, 0x01, 0xf8, 0x09, 0x00, + 0x01, 0x6f, 0x01, 0xfc, 0x01, 0x30, 0x05, 0x00, 0x01, 0x18, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0x90, 0x07, 0x00, + 0x01, 0x4f, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x3f, 0x01, 0xf7, 0x01, 0x00, + 0x01, 0x13, 0x02, 0x33, 0x01, 0x32, 0x03, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0x80, 0x06, 0x00, 0x01, 0xef, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x7f, + 0x03, 0xff, 0x01, 0xfd, 0x01, 0x81, 0x02, 0x00, 0x01, 0x4f, 0x01, 0xf5, + 0x05, 0x00, 0x01, 0x08, 0x01, 0xfd, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xff, + 0x01, 0xdd, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x30, 0x01, 0x00, + 0x01, 0x08, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xf4, 0x02, 0x00, + 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x3c, 0x01, 0xff, 0x01, 0xd0, + 0x02, 0x00, 0x01, 0xef, 0x01, 0x60, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xc0, + 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf3, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xb0, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0x60, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x03, 0x00, 0x01, 0xff, + 0x01, 0xf4, 0x02, 0x00, 0x01, 0x1f, 0x01, 0xf0, 0x04, 0x00, 0x01, 0xff, + 0x01, 0x10, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x03, 0x00, 0x01, 0xff, + 0x01, 0xf2, 0x02, 0x00, 0x01, 0x0c, 0x01, 0xf5, 0x03, 0x00, 0x01, 0x01, + 0x01, 0xfe, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xe0, 0x02, 0x00, 0x01, 0x0a, 0x01, 0xf6, 0x03, 0x00, + 0x01, 0x03, 0x01, 0xfd, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xfd, 0x01, 0x88, + 0x01, 0x9a, 0x01, 0xef, 0x01, 0xfe, 0x01, 0x30, 0x02, 0x00, 0x01, 0x08, + 0x01, 0xf8, 0x03, 0x00, 0x01, 0x04, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x7f, + 0x03, 0xff, 0x01, 0xfe, 0x01, 0x91, 0x03, 0x00, 0x01, 0x07, 0x01, 0xf9, + 0x03, 0x00, 0x01, 0x03, 0x01, 0xfd, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xfc, + 0x01, 0x78, 0x01, 0xdf, 0x01, 0xfd, 0x01, 0x20, 0x03, 0x00, 0x01, 0x08, + 0x01, 0xf8, 0x03, 0x00, 0x01, 0x01, 0x01, 0xfe, 0x03, 0x00, 0x01, 0x7f, + 0x01, 0xfa, 0x01, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, + 0x01, 0x09, 0x01, 0xf6, 0x04, 0x00, 0x01, 0xff, 0x01, 0x10, 0x02, 0x00, + 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xf8, 0x03, 0x00, + 0x01, 0x0c, 0x01, 0xf5, 0x04, 0x00, 0x01, 0xbf, 0x01, 0x60, 0x02, 0x00, + 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x30, + 0x02, 0x00, 0x01, 0x1f, 0x01, 0xf1, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xc0, + 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xd0, 0x02, 0x00, 0x01, 0x6f, 0x01, 0xb0, 0x04, 0x00, 0x01, 0x1f, + 0x01, 0xf4, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x01, + 0x01, 0xef, 0x01, 0xf7, 0x02, 0x00, 0x01, 0xef, 0x01, 0x60, 0x04, 0x00, + 0x01, 0x08, 0x01, 0xfd, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x03, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0x20, 0x01, 0x08, 0x01, 0xfe, 0x06, 0x00, + 0x01, 0xef, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x5a, 0x01, 0xa6, 0x03, 0x00, + 0x01, 0x09, 0x01, 0xaa, 0x01, 0x60, 0x01, 0x4f, 0x01, 0xf4, 0x06, 0x00, + 0x01, 0x3f, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0x80, + 0x06, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0x90, 0x07, 0x00, 0x01, 0x4f, + 0x01, 0xfb, 0x08, 0x00, 0x01, 0x6f, 0x01, 0xfc, 0x01, 0x30, 0x05, 0x00, + 0x01, 0x19, 0x01, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x04, 0x01, 0xef, + 0x01, 0xfa, 0x01, 0x40, 0x03, 0x00, 0x01, 0x38, 0x01, 0xef, 0x01, 0xf8, + 0x0a, 0x00, 0x01, 0x19, 0x02, 0xff, 0x01, 0xcb, 0x01, 0x9a, 0x01, 0xce, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x28, 0x01, 0xdf, + 0x03, 0xff, 0x01, 0xea, 0x01, 0x40, 0x0d, 0x00, 0x01, 0x02, 0x01, 0x45, + 0x01, 0x76, 0x01, 0x43, 0xc5, 0x00, +#endif // TOUCH_UI_UTF8_COPYRIGHT + +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + /* 32 PLUS_MINUS_SIGN */ + 0xeb, 0x00, 0x01, 0x02, 0x01, 0x77, 0x01, 0x70, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x0b, 0x00, 0x01, 0x6a, 0x04, 0xaa, 0x01, 0xac, + 0x01, 0xff, 0x01, 0xfa, 0x05, 0xaa, 0x01, 0x20, 0x05, 0x00, 0x01, 0x9f, + 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, + 0x05, 0x00, 0x01, 0x7c, 0x04, 0xcc, 0x01, 0xcd, 0x01, 0xff, 0x01, 0xfc, + 0x05, 0xcc, 0x01, 0x30, 0x0a, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x03, 0x01, 0x99, 0x01, 0x90, 0x44, 0x00, 0x01, 0x9f, + 0x0c, 0xff, 0x01, 0x30, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, + 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x47, + 0x0c, 0x77, 0x01, 0x10, 0xc1, 0x00, + + /* 33 MULTIPLICATION_SIGN */ + 0xff, 0x00, 0x0e, 0x00, 0x01, 0x09, 0x01, 0xb0, 0x07, 0x00, 0x01, 0x03, + 0x01, 0xe4, 0x08, 0x00, 0x01, 0x9f, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x3e, + 0x01, 0xff, 0x01, 0x40, 0x06, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb0, 0x05, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x3e, + 0x01, 0xff, 0x01, 0xfb, 0x08, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb0, 0x03, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, + 0x09, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, 0x03, 0x00, 0x01, 0x3e, + 0x01, 0xff, 0x01, 0xfb, 0x0a, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb0, 0x01, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, + 0x0b, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x3e, + 0x01, 0xff, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb3, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x0d, 0x00, 0x01, 0x3e, + 0x03, 0xff, 0x01, 0xfb, 0x0e, 0x00, 0x01, 0x03, 0x01, 0xef, 0x02, 0xff, + 0x01, 0xb0, 0x0f, 0x00, 0x01, 0x5f, 0x02, 0xff, 0x01, 0x10, 0x0e, 0x00, + 0x01, 0x03, 0x01, 0xef, 0x02, 0xff, 0x01, 0xb0, 0x0e, 0x00, 0x01, 0x3e, + 0x03, 0xff, 0x01, 0xfb, 0x0d, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb3, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, + 0x0b, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x01, 0x00, + 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x0a, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xfb, 0x03, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, + 0x09, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, + 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, + 0x07, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x05, 0x00, + 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x07, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, + 0x01, 0x09, 0x01, 0xb0, 0x07, 0x00, 0x01, 0x02, 0x01, 0xe4, 0xe9, 0x00, + + /* 34 DIVISION_SIGN */ + 0xff, 0x00, 0x25, 0x00, 0x01, 0x17, 0x01, 0x77, 0x01, 0x76, 0x10, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, + 0x01, 0xfc, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x17, 0x01, 0x77, + 0x01, 0x76, 0x31, 0x00, 0x01, 0x24, 0x0c, 0x44, 0x01, 0x10, 0x05, 0x00, + 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, + 0x01, 0x40, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, + 0x01, 0x12, 0x0c, 0x22, 0x31, 0x00, 0x01, 0x18, 0x01, 0x88, 0x01, 0x87, + 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, + 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x16, + 0x01, 0x66, 0x01, 0x65, 0xff, 0x00, 0x01, 0x00, +#endif // TOUCH_UI_UTF8_MATHEMATICS + +#if ENABLED(TOUCH_UI_UTF8_FRACTIONS) + /* 35 FRACTION_QUARTER */ + 0x92, 0x00, 0x01, 0x01, 0x01, 0x44, 0x01, 0x40, 0x04, 0x00, 0x01, 0x04, + 0x01, 0x79, 0x01, 0xce, 0x01, 0xee, 0x01, 0x20, 0x07, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x3f, 0x03, 0xff, 0x01, 0x20, + 0x07, 0x00, 0x01, 0x3f, 0x01, 0xfe, 0x01, 0x10, 0x04, 0x00, 0x01, 0x3f, + 0x01, 0xdb, 0x01, 0x8d, 0x01, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0xdf, + 0x01, 0xf5, 0x05, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x20, 0x06, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x20, 0x07, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, + 0x01, 0xaf, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x05, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xe1, 0x08, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, + 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x7f, + 0x01, 0xfc, 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf2, 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x4f, 0x01, 0xfe, + 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0xdf, + 0x01, 0xf5, 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xb0, 0x04, 0x00, 0x01, 0x37, 0x01, 0x77, + 0x02, 0x00, 0x01, 0x04, 0x01, 0x55, 0x01, 0x5d, 0x01, 0xff, 0x01, 0x75, + 0x01, 0x55, 0x01, 0x10, 0x01, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x20, + 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x02, 0x00, 0x01, 0x0d, + 0x05, 0xff, 0x01, 0x40, 0x01, 0x00, 0x01, 0xaf, 0x01, 0xf8, 0x04, 0x00, + 0x01, 0x0c, 0x02, 0xff, 0x02, 0x00, 0x01, 0x0c, 0x05, 0xee, 0x01, 0x40, + 0x01, 0x04, 0x01, 0xff, 0x01, 0xe0, 0x04, 0x00, 0x01, 0x8f, 0x01, 0xbe, + 0x01, 0xff, 0x09, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, 0x03, 0x00, + 0x01, 0x04, 0x01, 0xfe, 0x01, 0x1e, 0x01, 0xff, 0x09, 0x00, 0x01, 0x7f, + 0x01, 0xfc, 0x04, 0x00, 0x01, 0x1e, 0x01, 0xf4, 0x01, 0x0e, 0x01, 0xff, + 0x08, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0x80, 0x01, 0x0e, 0x01, 0xff, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x80, 0x03, 0x00, 0x01, 0x08, 0x01, 0xfc, 0x01, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x04, 0x00, 0x01, 0x4f, + 0x01, 0xe1, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x08, 0x00, 0x01, 0xdf, + 0x01, 0xf5, 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0x40, 0x01, 0x00, + 0x01, 0x0e, 0x01, 0xff, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xb0, + 0x03, 0x00, 0x01, 0x0b, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x07, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x3f, + 0x01, 0xf8, 0x02, 0x88, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x88, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x4f, 0x06, 0xff, 0x05, 0x00, + 0x01, 0x04, 0x01, 0xff, 0x01, 0xe0, 0x04, 0x00, 0x01, 0x2a, 0x03, 0xaa, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xaa, 0x05, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0x50, 0x08, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x06, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x05, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf2, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x05, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x05, 0x01, 0x66, + 0xbf, 0x00, + + /* 36 FRACTION_HALF */ + 0x92, 0x00, 0x01, 0x01, 0x01, 0x44, 0x01, 0x40, 0x04, 0x00, 0x01, 0x04, + 0x01, 0x7a, 0x01, 0xce, 0x01, 0xee, 0x01, 0x20, 0x07, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0x80, 0x04, 0x00, 0x01, 0x3f, 0x03, 0xff, 0x01, 0x20, + 0x07, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x3f, 0x01, 0xda, + 0x01, 0x7d, 0x01, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0xdf, 0x01, 0xf5, + 0x07, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x06, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, 0x01, 0xaf, 0x01, 0xf8, 0x08, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x04, 0x01, 0xff, + 0x01, 0xe0, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x20, 0x05, 0x00, 0x01, 0x7f, 0x01, 0xfc, 0x09, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf2, + 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x04, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0xdf, 0x01, 0xf5, 0x0a, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xb0, + 0x01, 0x00, 0x01, 0x04, 0x01, 0x8a, 0x01, 0xcc, 0x01, 0xa7, 0x01, 0x10, + 0x02, 0x00, 0x01, 0x04, 0x01, 0x55, 0x01, 0x5d, 0x01, 0xff, 0x01, 0x75, + 0x01, 0x55, 0x01, 0x10, 0x01, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x20, + 0x01, 0x06, 0x04, 0xff, 0x01, 0xf7, 0x02, 0x00, 0x01, 0x0d, 0x05, 0xff, + 0x01, 0x40, 0x01, 0x00, 0x01, 0xbf, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xa7, 0x01, 0x68, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x70, + 0x01, 0x00, 0x01, 0x0b, 0x05, 0xdd, 0x01, 0x40, 0x01, 0x04, 0x01, 0xff, + 0x01, 0xe0, 0x01, 0x00, 0x01, 0x05, 0x01, 0x60, 0x02, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, + 0x06, 0x00, 0x01, 0xef, 0x01, 0xf4, 0x08, 0x00, 0x01, 0x7f, 0x01, 0xfb, + 0x07, 0x00, 0x01, 0xcf, 0x01, 0xf3, 0x07, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf2, 0x06, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xe0, 0x07, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x80, 0x06, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0x50, 0x07, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x07, 0x00, 0x01, 0xaf, + 0x01, 0xfa, 0x08, 0x00, 0x01, 0xdf, 0x01, 0xf5, 0x06, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xb0, + 0x06, 0x00, 0x01, 0x8f, 0x01, 0xfd, 0x01, 0x10, 0x07, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xc1, + 0x08, 0x00, 0x01, 0xbf, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xaf, 0x01, 0xfb, + 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, + 0x04, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xf9, 0x09, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x05, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfe, 0x03, 0xee, + 0x01, 0xe6, 0x04, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf2, 0x05, 0x00, + 0x01, 0x0a, 0x05, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xee, + 0x01, 0x70, 0x05, 0x00, 0x01, 0x04, 0x05, 0x66, 0x01, 0x62, 0xbe, 0x00, + + /* 37 FRACTION_THREE_FOURTHS */ + 0x87, 0x00, 0x01, 0x02, 0x01, 0x34, 0x01, 0x42, 0x08, 0x00, 0x01, 0x01, + 0x01, 0x55, 0x01, 0x50, 0x04, 0x00, 0x01, 0x4c, 0x03, 0xff, 0x01, 0xe9, + 0x01, 0x10, 0x06, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0x80, 0x04, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xfe, 0x02, 0xff, 0x01, 0xe2, 0x06, 0x00, + 0x01, 0x4f, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x47, 0x01, 0x30, 0x01, 0x00, + 0x01, 0x05, 0x01, 0xef, 0x01, 0xfb, 0x06, 0x00, 0x01, 0xdf, 0x01, 0xf5, + 0x09, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x05, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xb0, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x05, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x20, 0x09, 0x00, 0x01, 0x6f, 0x01, 0xfb, 0x05, 0x00, + 0x01, 0xbf, 0x01, 0xf8, 0x07, 0x00, 0x01, 0x03, 0x01, 0x44, 0x01, 0x5a, + 0x01, 0xff, 0x01, 0xd1, 0x04, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xe0, + 0x07, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xe7, 0x05, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0x0b, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x70, 0x04, 0x00, 0x01, 0x7f, 0x01, 0xfb, 0x0a, 0x00, + 0x01, 0x16, 0x01, 0xdf, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf2, 0x0b, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0x20, 0x02, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x80, 0x0b, 0x00, 0x01, 0x0a, 0x01, 0xff, + 0x01, 0x60, 0x02, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x0c, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xf5, 0x0c, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x30, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xb0, 0x04, 0x00, 0x01, 0x47, 0x01, 0x77, 0x02, 0x00, 0x01, 0xd7, + 0x01, 0x42, 0x01, 0x01, 0x01, 0x38, 0x01, 0xef, 0x01, 0xfc, 0x02, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x02, 0x00, 0x05, 0xff, 0x01, 0xc1, 0x02, 0x00, 0x01, 0xbf, 0x01, 0xf8, + 0x04, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x02, 0x00, 0x01, 0x7b, 0x01, 0xef, + 0x02, 0xff, 0x01, 0xb6, 0x02, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xe0, + 0x04, 0x00, 0x01, 0x9f, 0x01, 0xbe, 0x01, 0xff, 0x04, 0x00, 0x01, 0x22, + 0x01, 0x10, 0x03, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, 0x03, 0x00, + 0x01, 0x04, 0x01, 0xfe, 0x01, 0x1e, 0x01, 0xff, 0x09, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x04, 0x00, 0x01, 0x1e, 0x01, 0xf3, 0x01, 0x0e, 0x01, 0xff, + 0x08, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xcf, + 0x01, 0x70, 0x01, 0x0e, 0x01, 0xff, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x80, 0x03, 0x00, 0x01, 0x08, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x08, 0x00, 0x01, 0x5f, 0x01, 0xfe, 0x04, 0x00, 0x01, 0x4f, + 0x01, 0xe1, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x08, 0x00, 0x01, 0xdf, + 0x01, 0xf4, 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0x40, 0x01, 0x00, + 0x01, 0x0e, 0x01, 0xff, 0x07, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xb0, + 0x03, 0x00, 0x01, 0x0b, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x07, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x3f, + 0x01, 0xf9, 0x02, 0x99, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x99, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x4f, 0x06, 0xff, 0x05, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xd0, 0x04, 0x00, 0x01, 0x29, 0x03, 0x99, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x99, 0x05, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0x40, 0x08, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x06, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x05, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf2, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x05, 0x00, + 0x01, 0x0a, 0x01, 0xee, 0x01, 0x70, 0x09, 0x00, 0x01, 0x04, 0x01, 0x55, + 0xbf, 0x00, +#endif // TOUCH_UI_UTF8_FRACTIONS + +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + /* 38 MICRON_SIGN */ + 0xff, 0x00, 0x1f, 0x00, 0x01, 0x02, 0x01, 0x44, 0x01, 0x40, 0x05, 0x00, + 0x01, 0x14, 0x01, 0x44, 0x01, 0x10, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf4, 0x05, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf6, 0x05, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xfa, 0x05, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, + 0x01, 0x07, 0x02, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x02, 0xff, + 0x01, 0xd2, 0x03, 0x00, 0x01, 0x6f, 0x02, 0xff, 0x01, 0xa0, 0x08, 0x00, + 0x01, 0x07, 0x03, 0xff, 0x01, 0xa6, 0x01, 0x55, 0x01, 0x8d, 0x03, 0xff, + 0x01, 0xf9, 0x01, 0xa4, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, + 0x05, 0xff, 0x01, 0x5d, 0x02, 0xff, 0x01, 0xf4, 0x07, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xf3, 0x01, 0x5f, 0x03, 0xff, 0x01, 0xf5, 0x01, 0x06, + 0x02, 0xff, 0x01, 0xf4, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, + 0x01, 0x01, 0x01, 0x7c, 0x01, 0xdd, 0x01, 0xc7, 0x01, 0x10, 0x01, 0x00, + 0x01, 0x6c, 0x01, 0xdb, 0x01, 0x50, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xee, 0x01, 0xe3, 0x35, 0x00, + + /* 39 PILCROW_SIGN */ + 0x9c, 0x00, 0x01, 0x16, 0x01, 0x9b, 0x04, 0xcc, 0x01, 0xca, 0x0b, 0x00, + 0x01, 0x19, 0x06, 0xff, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xef, + 0x03, 0xff, 0x01, 0xfb, 0x01, 0xaa, 0x01, 0xaf, 0x01, 0xfd, 0x0a, 0x00, + 0x01, 0x2e, 0x04, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, + 0x0a, 0x00, 0x01, 0xbf, 0x04, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, + 0x01, 0xfd, 0x09, 0x00, 0x01, 0x03, 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x08, 0x05, 0xff, 0x01, 0xf2, + 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x0b, 0x05, 0xff, + 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x0c, + 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x09, 0x00, + 0x01, 0x0b, 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, + 0x09, 0x00, 0x01, 0x0a, 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, + 0x01, 0xfd, 0x09, 0x00, 0x01, 0x06, 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0xef, 0x04, 0xff, 0x01, 0xf2, + 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0x6f, 0x04, 0xff, + 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0x08, + 0x04, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x0b, 0x00, + 0x01, 0x5e, 0x03, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, + 0x0c, 0x00, 0x01, 0x6b, 0x02, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, + 0x01, 0xfd, 0x0d, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0x34, 0x01, 0x40, 0x01, 0x00, + 0x01, 0x04, 0x01, 0x43, 0x7a, 0x00, + + /* 40 BROKEN_BAR */ + 0xad, 0x00, 0x01, 0x07, 0x01, 0x99, 0x01, 0x60, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x08, 0x01, 0xbb, 0x01, 0x70, 0x6f, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x04, + 0x01, 0x55, 0x01, 0x30, 0x47, 0x00, + + /* 41 SECTION_SIGN */ + 0x89, 0x00, 0x01, 0x35, 0x01, 0x64, 0x01, 0x31, 0x0e, 0x00, 0x01, 0x01, + 0x01, 0x9e, 0x03, 0xff, 0x01, 0xd9, 0x01, 0x30, 0x0c, 0x00, 0x01, 0x2e, + 0x05, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfb, + 0x01, 0x98, 0x01, 0xae, 0x01, 0xff, 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x10, 0x02, 0x00, 0x01, 0x39, 0x01, 0xa0, + 0x0b, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf3, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x20, 0x10, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xe4, 0x10, 0x00, 0x01, 0x1d, 0x02, 0xff, + 0x01, 0xa1, 0x0f, 0x00, 0x01, 0x4e, 0x03, 0xff, 0x01, 0x70, 0x0d, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf9, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x30, 0x0c, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x60, 0x01, 0x07, + 0x02, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0xbf, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x19, 0x02, 0xff, 0x01, 0xc0, 0x0b, 0x00, 0x01, 0xff, 0x01, 0xf3, + 0x03, 0x00, 0x01, 0x4e, 0x01, 0xff, 0x01, 0xfb, 0x0a, 0x00, 0x01, 0x01, + 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x40, 0x09, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x90, 0x0a, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x20, 0x03, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xb0, 0x0a, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf5, 0x03, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xa0, 0x0a, 0x00, 0x01, 0x0a, 0x02, 0xff, 0x01, 0x91, 0x02, 0x00, + 0x01, 0x0c, 0x01, 0xff, 0x01, 0x70, 0x0b, 0x00, 0x01, 0x8f, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x60, 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x10, + 0x0b, 0x00, 0x01, 0x03, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x46, + 0x01, 0xff, 0x01, 0xf5, 0x0d, 0x00, 0x01, 0x07, 0x04, 0xff, 0x01, 0x50, + 0x0e, 0x00, 0x01, 0x2a, 0x02, 0xff, 0x01, 0xf5, 0x10, 0x00, 0x01, 0x4e, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x0f, 0x00, 0x01, 0x01, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0xc0, 0x10, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0xf3, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x01, 0x04, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf3, 0x0b, 0x00, 0x01, 0x08, 0x01, 0xe8, 0x01, 0x20, + 0x01, 0x00, 0x01, 0x01, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xe0, 0x0b, 0x00, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xfe, 0x01, 0xcb, 0x01, 0xdf, 0x02, 0xff, + 0x01, 0x40, 0x0b, 0x00, 0x01, 0x08, 0x05, 0xff, 0x01, 0xf5, 0x0d, 0x00, + 0x01, 0x49, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xe8, 0x01, 0x20, 0x0f, 0x00, + 0x01, 0x12, 0x01, 0x21, 0x7f, 0x00, + + /* 42 NOT_SIGN */ + 0xff, 0x00, 0x7f, 0x00, 0x01, 0x12, 0x0c, 0x22, 0x06, 0x00, 0x01, 0x9f, + 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, + 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x24, + 0x0a, 0x44, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, + 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, + 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x17, 0x01, 0x77, 0x01, 0x10, + 0xff, 0x00, 0x34, 0x00 +#endif // TOUCH_UI_UTF8_SYMBOLS +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py new file mode 100644 index 000000000000..c295dfc5b8d4 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py @@ -0,0 +1,108 @@ +#!/usr/bin/python + +# Written By Marcio Teixeira 2019 - Aleph Objects, Inc. +# +# 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. +# +# To view a copy of the GNU General Public License, go to the following +# location: . + +from __future__ import print_function +from PIL import Image +import argparse +import textwrap + +def pack_rle(data): + """Use run-length encoding to pack the bytes""" + rle = [] + value = data[0] + count = 0 + for i in data: + if i != value or count == 255: + rle.append(count) + rle.append(value) + value = i + count = 1 + else: + count += 1 + rle.append(count) + rle.append(value) + return rle + +class WriteSource: + def __init__(self, lines_in_blocks): + self.blocks = [] + self.values = [] + self.block_size = lines_in_blocks + self.rows = 0 + + def add_pixel(self, value): + self.values.append(value) + + def convert_to_4bpp(self, data, chunk_size = 0): + # Invert the image + data = map(lambda i: 255 - i, data) + # Quanitize 8-bit values into 4-bits + data = map(lambda i: i >> 4, data) + # Make sure there is an even number of elements + if (len(data) & 1) == 1: + result.append(0) + # Combine each two adjacent values into one + i = iter(data) + data = map(lambda a, b: a << 4 | b, i ,i) + # Pack the data + data = pack_rle(data) + # Convert values into hex strings + return map(lambda a: "0x" + format(a, '02x'), data) + + def end_row(self, y): + # Pad each row into even number of values + if len(self.values) & 1: + self.values.append(0) + + self.rows += 1 + if self.block_size and (self.rows % self.block_size) == 0: + self.blocks.append(self.values) + self.values = [] + + def write(self): + if len(self.values): + self.blocks.append(self.values) + + block_strs = []; + for b in self.blocks: + data = self.convert_to_4bpp(b) + data = ', '.join(data) + data = textwrap.fill(data, 75, initial_indent = ' ', subsequent_indent = ' ') + block_strs.append(data) + + print("const unsigned char font[] PROGMEM = {") + for i, b in enumerate(block_strs): + if i: + print(',') + print('\n /* {} */'.format(i)) + print(b, end='') + print("\n};") + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Converts a grayscale bitmap into a 16-level RLE packed C array for use as font data') + parser.add_argument("input") + parser.add_argument('--char_height', help='Adds a separator every so many lines', type=int) + args = parser.parse_args() + + writer = WriteSource(args.char_height) + + img = Image.open(args.input).convert('L') + for y in range(img.height): + for x in range(img.width): + writer.add_pixel(img.getpixel((x,y))) + writer.end_row(y) + writer.write() diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h new file mode 100644 index 000000000000..da6a2bc32593 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h @@ -0,0 +1,105 @@ +/*********************** + * circular_progress.h * + ***********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/* This function draws a circular progress "ring" */ + +void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, float percent, char *text, uint32_t bgcolor, uint32_t fgcolor) { + using namespace FTDI; + + const float rim = 0.3; + const float a = percent/100.0*2.0*PI; + const float a1 = min(PI/2, a); + const float a2 = min(PI/2, a-a1); + const float a3 = min(PI/2, a-a1-a2); + const float a4 = min(PI/2, a-a1-a2-a3); + + const int ro = min(w,h) * 8; + const int rr = ro * rim; + const int cx = x * 16 + w * 8; + const int cy = y * 16 + h * 8; + + // Load a rim shape into stencil buffer + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(TAG_MASK(0)); + cmd.cmd(CLEAR(0,1,0)); + cmd.cmd(COLOR_MASK(0,0,0,0)); + cmd.cmd(STENCIL_OP(STENCIL_OP_KEEP, STENCIL_OP_INVERT)); + cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_ALWAYS, 255, 255)); + cmd.cmd(BEGIN(POINTS)); + cmd.cmd(POINT_SIZE(ro)); + cmd.cmd(VERTEX2F(cx, cy)); + cmd.cmd(POINT_SIZE(ro - rr)); + cmd.cmd(VERTEX2F(cx, cy)); + cmd.cmd(RESTORE_CONTEXT()); + + // Mask further drawing by stencil buffer + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(STENCIL_FUNC(STENCIL_FUNC_NOTEQUAL, 0, 255)); + + // Fill the background + cmd.cmd(COLOR_RGB(bgcolor)); + cmd.cmd(BEGIN(POINTS)); + cmd.cmd(POINT_SIZE(ro)); + cmd.cmd(VERTEX2F(cx, cy)); + cmd.cmd(COLOR_RGB(fgcolor)); + + // Paint upper-right quadrant + cmd.cmd(BEGIN(EDGE_STRIP_A)); + cmd.cmd(VERTEX2F(cx, cy)); + cmd.cmd(VERTEX2F(cx + ro*sin(a1) + 16,cy - ro*cos(a1) + 8)); + + // Paint lower-right quadrant + if (a > PI/2) { + cmd.cmd(BEGIN(EDGE_STRIP_R)); + cmd.cmd(VERTEX2F(cx, cy)); + cmd.cmd(VERTEX2F(cx + ro*cos(a2),cy + ro*sin(a2) + 16)); + } + + // Paint lower-left quadrant + if (a > PI) { + cmd.cmd(BEGIN(EDGE_STRIP_B)); + cmd.cmd(VERTEX2F(cx, cy)); + cmd.cmd(VERTEX2F(cx - ro*sin(a3) - 8,cy + ro*cos(a3))); + } + + // Paint upper-left quadrant + if (a > 1.5*PI) { + cmd.cmd(BEGIN(EDGE_STRIP_L)); + cmd.cmd(VERTEX2F(cx, cy)); + cmd.cmd(VERTEX2F(cx - ro*cos(a4),cy - ro*sin(a4))); + } + cmd.cmd(RESTORE_CONTEXT()); + + // Draw the text + + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(COLOR_RGB(fgcolor)); + cmd.text(x,y,w,h,text, OPT_CENTERX | OPT_CENTERY); + cmd.cmd(RESTORE_CONTEXT()); +} + +void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, float percent, uint32_t bgcolor, uint32_t fgcolor) { + char str[5]; + sprintf(str,"%d\%%",int(percent)); + draw_circular_progress(cmd, x, y, w, h, percent, str, bgcolor, fgcolor); +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h new file mode 100644 index 000000000000..9f531146e130 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h @@ -0,0 +1,396 @@ +/************* + * poly_ui.h * + *************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/** + * The PolyReader class iterates over an array of (x,y) pairs. + * For supporting polygons with holes an end-of-loop marker may + * be embedded into the data stream: + * + * const PROGMEM uint16_t data[] = { + * x, y, x, y, ..., eol, + * ... + * x, y, x, y, ..., eol + * } + * + * The PolyReader object can be used to iterate over the points. + * + * PolyReader r(data, N_ELEMENTS(data)); + * + * for(r.start();r.has_more(); r.next()) { + * uint16_t x = r.x; + * uint16_t y = r.y; + * + * // Do something with the point + * ... + * + * // Do something else if this point + * // closes a loop. + * if (r.end_of_loop()) { + * ... + * } + * } + * + */ + +class PolyReader { + public: + typedef uint16_t type_t; + + private: + static constexpr type_t eol = 0xFFFF; + + const type_t *p, *top, *end; + type_t start_x, start_y; + + void close_loop() { + x = start_x; + y = start_y; + start_x = eol; + start_y = eol; + } + + public: + type_t x, y; + + // Begin reading a polygon data structure + PolyReader(const uint16_t data[], const size_t n_elements) : top(data), end(data + n_elements) { + start(); + } + + void start() { + p = top; + start_x = eol; + next(); + } + + // Reads the next point in the polygon data structure + void next() { + if (!p) return; + + if (p == end) { + if (start_x != eol) + close_loop(); + else + p = NULL; + } else { + x = pgm_read_word_far(p++); + if (x == eol) + close_loop(); + else { + y = pgm_read_word_far(p++); + if (start_x == eol) { + start_x = x; + start_y = y; + } + } + } + } + + bool has_more() {return p != NULL;} + bool end_of_loop() {return start_x == eol;} +}; + +/** + * The TransformedPolyReader class works like the PolyReader, + * but the (x,y) input is assumed to be normalized onto a + * unit square and then mapped to the full 16-bits, i.e. + * (0.0,1.0) => (0x0000,0xFFFE). This class will scale the + * data to fit the entire display, a bounding box, or apply + * some arbitrary affine transform. + * + * This class is suitable for reading data from "svg2cpp.py" + */ +class TransformedPolyReader : public PolyReader { + private: + /** + * Fixed point type for fast transformations, supports + * values from 0 to 1024, with 1/32 precision. + */ + static constexpr uint8_t fract_bits = 5; + typedef int16_t fix_t; + fix_t makefix(float f) {return f * (1 << fract_bits);} + + // First two rows of 3x3 transformation matrix + fix_t a, b, c; + fix_t d, e, f; + + void transform() { + /** + * Values from PolyReader vary from 0 to FFFE. + * As an approximation to dividing by FFFE, + * we perform a bit shift right by 16. + */ + const int32_t px = PolyReader::x; + const int32_t py = PolyReader::y; + const int32_t round = 1 << (fract_bits-1); + x = (((((a * px) + (b * py)) >> 16) + c) + round) >> fract_bits; + y = (((((d * px) + (e * py)) >> 16) + f) + round) >> fract_bits; + } + + void set_transform( + fix_t A, fix_t B, fix_t C, + fix_t D, fix_t E, fix_t F + ) { + a = A; b = B; c = C; + d = D; e = E; f = F; + } + + public: + typedef int16_t type_t; + + type_t x, y; + + TransformedPolyReader(const uint16_t data[], const size_t n) : PolyReader(data, n) { + scale_to_fit(); + transform(); + } + + // Set an arbitrary affine transform + void set_transform( + float A, float B, float C, + float D, float E, float F + ) { + set_transform( + makefix(A), makefix(B), makefix(C), + makefix(D), makefix(E), makefix(F) + ); + } + + // Scale the data to fit a specified bounding box + void scale_to_fit(type_t x_min, type_t y_min, type_t x_max, type_t y_max) { + fix_t sx = makefix(x_max - x_min); + fix_t sy = makefix(y_max - y_min); + fix_t tx = makefix(x_min); + fix_t ty = makefix(y_min); + set_transform( + sx, 0, tx, + 0, sy, ty + ); + } + + // Scale to fit the entire display (default) + void scale_to_fit() { + scale_to_fit(0, 0, FTDI::display_width, FTDI::display_height); + } + + void next() { + PolyReader::next(); + transform(); + } +}; + +/** + * The DeduplicatedPolyReader wraps around another PolyReader + * class to remove repeated points from the data. This could + * happen when scaling down using TransformedPolyReader, for + * example. + */ +template +class DeduplicatedPolyReader : public POLY_READER { + private: + typename POLY_READER::type_t last_x, last_y; + + static constexpr typename POLY_READER::type_t eol = 0xFFFF; + + public: + DeduplicatedPolyReader(const uint16_t data[], const size_t n) : POLY_READER(data, n) { + last_x = POLY_READER::x; + last_y = POLY_READER::y; + } + + void next() { + do { + if (!POLY_READER::has_more()) return; + POLY_READER::next(); + } while (POLY_READER::x == last_x && POLY_READER::y == last_y && !POLY_READER::end_of_loop()); + if (POLY_READER::end_of_loop()) { + last_x = last_y = eol; + } else { + last_x = POLY_READER::x; + last_y = POLY_READER::y; + } + } +}; + +/** + * The helper class allows you to build an interface based on arbitrary + * shapes. + */ +template> +class GenericPolyUI { + private: + CommandProcessor &cmd; + + // Attributes used to paint buttons + + uint32_t btn_fill_color = 0x000000; + uint32_t btn_shadow_color = 0xF3E0E0; + uint8_t btn_shadow_depth = 5; + uint32_t btn_stroke_color = 0x000000; + uint8_t btn_stroke_width = 28; + + draw_mode_t mode; + + public: + typedef POLY_READER poly_reader_t; + + GenericPolyUI(CommandProcessor &c, draw_mode_t what = BOTH) : cmd(c), mode(what) {} + + // Fills a polygon with the current COLOR_RGB + void fill(poly_reader_t r, bool clip = true) { + using namespace FTDI; + int16_t x, y, w, h; + + if (clip) { + // Clipping reduces the number of pixels that are + // filled, allowing more complex shapes to be drawn + // in the alloted time. + bounds(r, x, y, w, h); + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(SCISSOR_XY(x, y)); + cmd.cmd(SCISSOR_SIZE(w, h)); + } + + Polygon p(cmd); + p.begin_fill(); + p.begin_loop(); + for(r.start();r.has_more();r.next()) { + p(r.x * 16, r.y * 16); + if (r.end_of_loop()) { + p.end_loop(); + p.begin_loop(); + } + } + p.end_loop(); + p.end_fill(); + if (clip) + cmd.cmd(RESTORE_CONTEXT()); + } + + void shadow(poly_reader_t r, uint8_t offset) { + #if FTDI_API_LEVEL >= 810 + using namespace FTDI; + cmd.cmd(VERTEX_TRANSLATE_X(offset * 16)); + cmd.cmd(VERTEX_TRANSLATE_Y(offset * 16)); + fill(r, false); + cmd.cmd(VERTEX_TRANSLATE_X(0)); + cmd.cmd(VERTEX_TRANSLATE_Y(0)); + #endif + } + + // Strokes a polygon with the current COLOR_RGB + void stroke(poly_reader_t r) { + using namespace FTDI; + Polygon p(cmd); + p.begin_stroke(); + p.begin_loop(); + for(r.start();r.has_more(); r.next()) { + p(r.x * 16, r.y * 16); + if (r.end_of_loop()) { + p.end_loop(); + p.begin_loop(); + } + } + p.end_loop(); + p.end_stroke(); + } + + // Compute the bounds of a polygon + void bounds(poly_reader_t r, int16_t &x, int16_t &y, int16_t &w, int16_t &h) { + int16_t x_min = INT16_MAX; + int16_t y_min = INT16_MAX; + int16_t x_max = INT16_MIN; + int16_t y_max = INT16_MIN; + for(r.start(); r.has_more(); r.next()) { + x_min = min(x_min, int16_t(r.x)); + x_max = max(x_max, int16_t(r.x)); + y_min = min(y_min, int16_t(r.y)); + y_max = max(y_max, int16_t(r.y)); + } + x = x_min; + y = y_min; + w = x_max - x_min; + h = y_max - y_min; + } + + /** + * Draw shaped buttons. Buttons are drawn out of a polygon which is + * filled and stroked on top of a drop shadow. The button will + * become "pushed" when touched. + */ + + void button_fill(const uint32_t color) { + btn_fill_color = color; + } + + void button_stroke(const uint32_t color, const uint8_t width) { + btn_stroke_color = color; + btn_stroke_width = width; + } + + void button_shadow(const uint32_t color, const uint8_t depth) { + btn_shadow_color = color; + btn_shadow_depth = depth; + } + + void button(const uint8_t tag, poly_reader_t r) { + using namespace FTDI; + // Draw the shadow + #if FTDI_API_LEVEL >= 810 + if (mode & BACKGROUND) { + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(TAG(tag)); + cmd.cmd(VERTEX_TRANSLATE_X(btn_shadow_depth * 16)); + cmd.cmd(VERTEX_TRANSLATE_Y(btn_shadow_depth * 16)); + cmd.cmd(COLOR_RGB(btn_shadow_color)); + fill(r, false); + cmd.cmd(RESTORE_CONTEXT()); + } + #endif + + if (mode & FOREGROUND) { + cmd.cmd(SAVE_CONTEXT()); + #if FTDI_API_LEVEL >= 810 + if (EventLoop::get_pressed_tag() == tag) { + // "Push" the button + cmd.cmd(VERTEX_TRANSLATE_X(btn_shadow_depth * 16)); + cmd.cmd(VERTEX_TRANSLATE_Y(btn_shadow_depth * 16)); + } + #endif + // Draw the fill and stroke + cmd.cmd(TAG(tag)); + cmd.cmd(COLOR_RGB(btn_fill_color)); + fill(r, false); + cmd.cmd(COLOR_RGB(btn_stroke_color)); + cmd.cmd(LINE_WIDTH(btn_stroke_width)); + stroke(r); + cmd.cmd(RESTORE_CONTEXT()); + } + } + + void color(const uint32_t color) { + cmd.cmd(FTDI::COLOR_RGB(color)); + } +}; + +typedef GenericPolyUI<> PolyUI; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py new file mode 100644 index 000000000000..2778f94d9850 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py @@ -0,0 +1,280 @@ +#!/usr/bin/python + +# Written By Marcio Teixeira 2018 - Aleph Objects, Inc. +# +# 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. +# +# To view a copy of the GNU General Public License, go to the following +# location: . + +from __future__ import print_function +import argparse, re, sys + +usage = ''' +This program extracts line segments from a SVG file and writes +them as coordinates in a C array. The x and y values will be +scaled from 0x0000 to 0xFFFE. 0xFFFF is used as path separator. + +This program can only interpret straight segments, not curves. +It also cannot handle SVG transform attributes. To convert an +SVG file into the proper format, use the following procedure: + + - Load SVG file into Inkscape + - Convert all Objects to Paths (Path -> Object to Path) + - Convert all Strokes to Paths (Path -> Stroke to Path) + - Combine all paths into one (Path -> Combine) [1] + - Convert all curves into short line segments + (Extensions -> Modify Paths -> Flatten Beziers...) + - Save as new SVG + - Convert into a header file using this utility + - To give paths individual names, break apart paths and + use the XML Editor to set the "id" attributes. + +[1] Combining paths is necessary to remove transforms. You +could also use inkscape-applytransforms Inkscape extension. + +''' + +header = ''' +/**************************************************************************** + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/** + * This file was auto-generated using "svg2cpp.py" + * + * The encoding consists of x,y pairs with the min and max scaled to + * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the + * start of a new closed path. + */ + +#pragma once +''' + +class ComputeBoundingBox: + def reset(self): + self.x_min = float(" inf") + self.y_min = float(" inf") + self.x_max = float("-inf") + self.y_max = float("-inf") + self.n_points = 0 + self.n_paths = 0 + + def command(self, type, x, y): + self.x_min = min(self.x_min, x) + self.x_max = max(self.x_max, x) + self.y_min = min(self.y_min, y) + self.y_max = max(self.y_max, y) + + if type == "M": + self.n_paths += 1 + self.n_points += 1 + + def scale(self, x, y): + x -= self.x_min + y -= self.y_min + x /= self.x_max - self.x_min + y /= self.y_max - self.y_min + #y = 1 - y # Flip upside down + return (x, y) + + def path_finished(self, id): + pass + + def write(self): + print("constexpr float x_min = %f;" % self.x_min) + print("constexpr float x_max = %f;" % self.x_max) + print("constexpr float y_min = %f;" % self.y_min) + print("constexpr float y_max = %f;" % self.y_max) + print() + + def from_svg_view_box(self, svg): + s = re.search(']+>', svg); + if s: + m = re.search('viewBox="([0-9-.]+) ([0-9-.]+) ([0-9-.]+) ([0-9-.]+)"', svg) + if m: + self.x_min = float(m.group(1)) + self.y_min = float(m.group(2)) + self.x_max = float(m.group(3)) + self.y_max = float(m.group(4)) + return True + return False + +# op +class WriteDataStructure: + def __init__(self, bounding_box): + self.bounds = bounding_box + + def reset(self, ): + self.hex_words = [] + + def push(self, value): + self.hex_words.append("0x%04X" % (0xFFFF & int(value))) + + def command(self, type, x, y): + if type == "M": + self.push(0xFFFF) + x, y = self.bounds.scale(x,y) + self.push(x * 0xFFFE) + self.push(y * 0xFFFE) + + def path_finished(self, id): + if self.hex_words and self.hex_words[0] == "0xFFFF": + self.hex_words.pop(0) + print("const PROGMEM uint16_t", id + "[] = {" + ", ".join (self.hex_words) + "};") + self.hex_words = [] + +class Parser: + def __init__(self, op): + self.op = op + self.reset() + + def reset(self): + self.last_x = 0 + self.last_y = 0 + self.initial_x = 0 + self.initial_y = 0 + + def process_svg_path_L_or_M(self, cmd, x, y): + self.op.command(cmd, x, y) + self.last_x = x + self.last_y = y + if cmd == "M": + self.initial_x = x + self.initial_y = y + + def process_svg_path_data_cmd(self, id, cmd, a, b): + """Converts the various types of moves into L or M commands + and dispatches to process_svg_path_L_or_M for futher processing.""" + if cmd == "Z" or cmd == "z": + self.process_svg_path_L_or_M("L", self.initial_x, self.initial_y) + elif cmd == "H": + self.process_svg_path_L_or_M("L", a, self.last_y) + elif cmd == "V": + self.process_svg_path_L_or_M("L", self.last_x, a) + elif cmd == "h": + self.process_svg_path_L_or_M("L", self.last_x + a, self.last_y) + elif cmd == "v": + self.process_svg_path_L_or_M("L", self.last_x, self.last_y + a) + elif cmd == "L": + self.process_svg_path_L_or_M("L", a, b) + elif cmd == "l": + self.process_svg_path_L_or_M("L", self.last_x + a, self.last_y + b) + elif cmd == "M": + self.process_svg_path_L_or_M("M", a, b) + elif cmd == "m": + self.process_svg_path_L_or_M("M", self.last_x + a, self.last_y + b) + else: + print("Unsupported path data command:", cmd, "in path", id, "\n", file=sys.stderr) + quit() + + def eat_token(self, regex): + """Looks for a token at the start of self.d. + If found, the token is removed.""" + self.m = re.match(regex,self.d) + if self.m: + self.d = self.d[self.m.end():] + return self.m + + def process_svg_path_data(self, id, d): + """Breaks up the "d" attribute into individual commands + and calls "process_svg_path_data_cmd" for each""" + + self.d = d + while (self.d): + if self.eat_token('\s+'): + pass # Just eat the spaces + + elif self.eat_token('([LMHVZlmhvz])'): + cmd = self.m.group(1) + # The following commands take no arguments + if cmd == "Z" or cmd == "z": + self.process_svg_path_data_cmd(id, cmd, 0, 0) + + elif self.eat_token('([CScsQqTtAa])'): + print("Unsupported path data command:", self.m.group(1), "in path", id, "\n", file=sys.stderr) + quit() + + elif self.eat_token('([ ,]*[-0-9e.]+)+'): + # Process list of coordinates following command + coords = re.split('[ ,]+', self.m.group(0)) + # The following commands take two arguments + if cmd == "L" or cmd == "l": + while coords: + self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0))) + elif cmd == "M": + while coords: + self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0))) + # If a MOVETO has multiple points, the subsequent ones are assumed to be LINETO + cmd = "L" + elif cmd == "m": + while coords: + self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0))) + # If a MOVETO has multiple points, the subsequent ones are assumed to be LINETO + cmd = "l" + # Assume all other commands are single argument + else: + while coords: + self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), 0) + else: + print("Syntax error:", d, "in path", id, "\n", file=sys.stderr) + quit() + + def process_svg_paths(self, svg): + self.op.reset() + for path in re.findall(']+>', svg): + id = "" + m = re.search(' id="(.*)"', path) + if m: + id = m.group(1) + + m = re.search(' transform="(.*)"', path) + if m: + print("Found transform in path", id, "! Cannot process file!", file=sys.stderr) + quit() + + m = re.search(' d="(.*)"', path) + if m: + self.process_svg_path_data(id, m.group(1)) + self.op.path_finished(id) + self.reset() + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("filename") + args = parser.parse_args() + + f = open(args.filename, "r") + data = f.read() + + print(header) + + b = ComputeBoundingBox() + if not b.from_svg_view_box(data): + # Can't find the view box, so use the bounding box of the elements themselves. + p = Parser(b) + p.process_svg_paths(data) + b.write() + + w = WriteDataStructure(b) + p = Parser(w) + p.process_svg_paths(data) diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h new file mode 100644 index 000000000000..5a7d3c960bba --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h @@ -0,0 +1,27 @@ +/****************** + * ftdi_eve_lib.h * + ******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2019 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "compat.h" +#include "basic/ftdi_basic.h" +#include "extended/ftdi_extended.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.cpp new file mode 100644 index 000000000000..5d33fc850ff1 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.cpp @@ -0,0 +1,27 @@ +/**************** + * language.cpp * + ****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + + +#include "../../../../../Marlin.h" + +#include "language.h" + +uint8_t lang = 0; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.h new file mode 100644 index 000000000000..54f843993312 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language.h @@ -0,0 +1,23 @@ +/************** + * language.h * + **************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ +#pragma once + +#include "language_en.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language_en.h new file mode 100644 index 000000000000..e59e1d9468cc --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/language/language_en.h @@ -0,0 +1,164 @@ +/***************** + * language_en.h * + *****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "language.h" + +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + #define COPYRIGHT_SIGN u8"©" +#else + #define COPYRIGHT_SIGN u8"(c)" +#endif + +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + #define SUPERSCRIPT_TWO u8"²" +#else + #define SUPERSCRIPT_TWO u8"^2" +#endif + +#if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + #define DEGREE_SIGN u8"°" +#else + #define DEGREE_SIGN u8" " +#endif + +namespace Language_en { + PROGMEM Language_Str MSG_BUTTON_OKAY = u8"Okay"; + PROGMEM Language_Str MSG_BUTTON_MENU = u8"Menu"; + PROGMEM Language_Str MSG_BUTTON_MEDIA = u8"Media"; + PROGMEM Language_Str MSG_BUTTON_OPEN = u8"Open"; + PROGMEM Language_Str MSG_CLEAN_NOZZLE = u8"Clean Nozzle"; + PROGMEM Language_Str MSG_VMAX_X = u8"Vmax X"; + PROGMEM Language_Str MSG_VMAX_Y = u8"Vmax Y"; + PROGMEM Language_Str MSG_VMAX_Z = u8"Vmax Z"; + PROGMEM Language_Str MSG_ACCEL_PRINTING = u8"Printing"; + PROGMEM Language_Str MSG_ACCEL_TRAVEL = u8"Travel"; + PROGMEM Language_Str MSG_ACCEL_RETRACT = u8"Retraction"; + PROGMEM Language_Str MSG_AMAX_X = u8"Amax X"; + PROGMEM Language_Str MSG_AMAX_Y = u8"Amax Y"; + PROGMEM Language_Str MSG_AMAX_Z = u8"Amax Z"; + PROGMEM Language_Str MSG_AXIS_X = u8"X"; + PROGMEM Language_Str MSG_AXIS_Y = u8"Y"; + PROGMEM Language_Str MSG_AXIS_Z = u8"Z"; + PROGMEM Language_Str MSG_AXIS_E = u8"E"; + PROGMEM Language_Str MSG_AXIS_E1 = u8"E1"; + PROGMEM Language_Str MSG_AXIS_E2 = u8"E2"; + PROGMEM Language_Str MSG_AXIS_E3 = u8"E3"; + PROGMEM Language_Str MSG_AXIS_E4 = u8"E4"; + PROGMEM Language_Str MSG_AXIS_ALL = u8"All"; + PROGMEM Language_Str MSG_HOME = u8"Home"; + PROGMEM Language_Str MSG_PRINT_STARTING = u8"Print starting"; + PROGMEM Language_Str MSG_PRINT_FINISHED = u8"Print finished"; + PROGMEM Language_Str MSG_PRINT_ERROR = u8"Print error"; + PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_1 = u8"Color Touch Panel"; + PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_2 = u8"Portions " COPYRIGHT_SIGN " 2019 Aleph Objects, Inc.\n" + "Portions " COPYRIGHT_SIGN " 2019 Cocoa Press"; + PROGMEM Language_Str MSG_FIRMWARE_FOR_TOOLHEAD = u8"Firmware for toolhead:\n%s\n\n"; + PROGMEM Language_Str MSG_RUNOUT_1 = u8"Runout 1"; + PROGMEM Language_Str MSG_RUNOUT_2 = u8"Runout 2"; + PROGMEM Language_Str MSG_DISPLAY_MENU = u8"Display"; + PROGMEM Language_Str MSG_INTERFACE_SETTINGS = u8"Interface Settings"; + PROGMEM Language_Str MSG_MEASURE_AUTOMATICALLY = u8"Measure automatically"; + PROGMEM Language_Str MSG_H_OFFSET = u8"H Offset"; + PROGMEM Language_Str MSG_V_OFFSET = u8"V Offset"; + PROGMEM Language_Str MSG_TOUCH_SCREEN = u8"Touch Screen"; + PROGMEM Language_Str MSG_CALIBRATE = u8"Calibrate"; + PROGMEM Language_Str MSG_UNITS_MILLIAMP = u8"mA"; + PROGMEM Language_Str MSG_UNITS_MM = u8"mm"; + PROGMEM Language_Str MSG_UNITS_MM_S = u8"mm/s"; + PROGMEM Language_Str MSG_UNITS_MM_S2 = u8"mm/s" SUPERSCRIPT_TWO; + PROGMEM Language_Str MSG_UNITS_STEP_MM = u8"st/mm"; + PROGMEM Language_Str MSG_UNITS_PERCENT = u8"%"; + PROGMEM Language_Str MSG_UNITS_C = DEGREE_SIGN u8"C"; + PROGMEM Language_Str MSG_MATERIAL_PLA = u8"PLA"; + PROGMEM Language_Str MSG_MATERIAL_ABS = u8"ABS"; + PROGMEM Language_Str MSG_MATERIAL_HIGH_TEMP = u8"High"; + PROGMEM Language_Str MSG_IDLE = u8"idle"; + PROGMEM Language_Str MSG_SET_MAXIMUM = u8"Set Maximum"; + PROGMEM Language_Str MSG_PRINT_SPEED = u8"Print Speed"; + PROGMEM Language_Str MSG_LINEAR_ADVANCE = u8"Linear Advance"; + PROGMEM Language_Str MSG_LINEAR_ADVANCE_K = u8"K"; + PROGMEM Language_Str MSG_LINEAR_ADVANCE_K1 = u8"K E1"; + PROGMEM Language_Str MSG_LINEAR_ADVANCE_K2 = u8"K E2"; + PROGMEM Language_Str MSG_LINEAR_ADVANCE_K3 = u8"K E3"; + PROGMEM Language_Str MSG_LINEAR_ADVANCE_K4 = u8"K E4"; + PROGMEM Language_Str MSG_NUDGE_NOZZLE = u8"Nudge Nozzle"; + PROGMEM Language_Str MSG_ADJUST_BOTH_NOZZLES = u8"Adjust Both Nozzles"; + PROGMEM Language_Str MSG_SHOW_OFFSETS = u8"Show Offsets"; + PROGMEM Language_Str MSG_INCREMENT = u8"Increment"; + PROGMEM Language_Str MSG_ERASE_FLASH_WARNING = u8"Are you sure? SPI flash will be erased."; + PROGMEM Language_Str MSG_ERASING = u8"Erasing..."; + PROGMEM Language_Str MSG_ERASED = u8"SPI flash erased"; + PROGMEM Language_Str MSG_CALIBRATION_WARNING = u8"For best results, unload the filament and clean the hotend prior to starting calibration. Continue?"; + PROGMEM Language_Str MSG_START_PRINT_CONFIRMATION = u8"Start printing %s?"; + PROGMEM Language_Str MSG_ABORT_WARNING = u8"Are you sure you want to cancel the print?"; + PROGMEM Language_Str MSG_EXTRUDER_SELECTION = u8"Extruder Selection"; + PROGMEM Language_Str MSG_CURRENT_TEMPERATURE = u8"Current Temp"; + PROGMEM Language_Str MSG_REMOVAL_TEMPERATURE = u8"Removal Temp"; + PROGMEM Language_Str MSG_CAUTION = u8"Caution:"; + PROGMEM Language_Str MSG_HOT = u8"Hot!"; + PROGMEM Language_Str MSG_UNLOAD_FILAMENT = u8"Unload/Retract"; + PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extruder"; + PROGMEM Language_Str MSG_MOMENTARY = u8"Momentary"; + PROGMEM Language_Str MSG_CONTINUOUS = u8"Continuous"; + PROGMEM Language_Str MSG_PLEASE_WAIT = u8"Please wait..."; + PROGMEM Language_Str MSG_PRINT_MENU = u8"Print Menu"; + PROGMEM Language_Str MSG_FINE_MOTION = u8"Fine motion"; + PROGMEM Language_Str MSG_ENABLE_MEDIA = u8"Enable Media"; + PROGMEM Language_Str MSG_INSERT_MEDIA = u8"Insert Media..."; + PROGMEM Language_Str MSG_LCD_BRIGHTNESS = u8"LCD brightness"; + PROGMEM Language_Str MSG_SOUND_VOLUME = u8"Sound volume"; + PROGMEM Language_Str MSG_SCREEN_LOCK = u8"Screen lock"; + PROGMEM Language_Str MSG_BOOT_SCREEN = u8"Boot screen"; + PROGMEM Language_Str MSG_INTERFACE_SOUNDS = u8"Interface Sounds"; + PROGMEM Language_Str MSG_CLICK_SOUNDS = u8"Click sounds"; + PROGMEM Language_Str MSG_EEPROM_RESTORED = u8"Settings restored from backup"; + PROGMEM Language_Str MSG_EEPROM_RESET = u8"Settings restored to default"; + PROGMEM Language_Str MSG_EEPROM_SAVED = u8"Settings saved!"; + PROGMEM Language_Str MSG_EEPROM_SAVE_PROMPT = u8"Do you wish to save these settings as defaults?"; + PROGMEM Language_Str MSG_EEPROM_RESET_WARNING = u8"Are you sure? Customizations will be lost."; + + PROGMEM Language_Str MSG_PASSCODE_REJECTED = u8"Wrong passcode!"; + PROGMEM Language_Str MSG_PASSCODE_ACCEPTED = u8"Passcode accepted!"; + PROGMEM Language_Str MSG_PASSCODE_SELECT = u8"Select Passcode:"; + PROGMEM Language_Str MSG_PASSCODE_REQUEST = u8"Enter Passcode:"; + + PROGMEM Language_Str MSG_TOUCH_CALIBRATION_START = u8"Release to begin screen calibration"; + PROGMEM Language_Str MSG_TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate"; + + #ifdef TOUCH_UI_LULZBOT_BIO + PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home"; + PROGMEM Language_Str MSG_RAISE_PLUNGER = u8"Raise Plunger"; + PROGMEM Language_Str MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; + PROGMEM Language_Str MSG_AUTOLEVEL_X_AXIS = u8"Auto-level X Axis"; + PROGMEM Language_Str MSG_BED_TEMPERATURE = u8"Bed Temperature"; + PROGMEM Language_Str MSG_HOME_XYZ_WARNING = u8"About to move to home position. Ensure the top and the bed of the printer are clear.\n\nContinue?"; + PROGMEM Language_Str MSG_HOME_E_WARNING = u8"About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?"; + #endif + + #ifdef TOUCH_UI_COCOA_PRESS + PROGMEM Language_Str MSG_ZONE_1 = u8"Zone 1:"; + PROGMEM Language_Str MSG_ZONE_2 = u8"Zone 2:"; + PROGMEM Language_Str MSG_ZONE_3 = u8"Zone 3:"; + PROGMEM Language_Str MSG_PREHEAT_FINISHED = u8"Preheat finished"; + #endif +}; // namespace Language_en diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp new file mode 100644 index 000000000000..cd5cda4a7163 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp @@ -0,0 +1,135 @@ +/********************* + * marlin_events.cpp * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "compat.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens/screens.h" + +namespace ExtUI { + using namespace Theme; + using namespace FTDI; + + void onStartup() { + EventLoop::setup(); + } + + void onIdle() { + EventLoop::loop(); + } + + void onPrinterKilled(PGM_P const error, PGM_P const component) { + char str[strlen_P(error) + strlen_P(component) + 3]; + sprintf_P(str, PSTR(S_FMT ": " S_FMT), error, component); + KillScreen::show(str); + } + + void onMediaInserted() { + if (AT_SCREEN(StatusScreen)) + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MEDIA_INSERTED)); + sound.play(media_inserted, PLAY_ASYNCHRONOUS); + } + + void onMediaRemoved() { + if (AT_SCREEN(StatusScreen)) + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MEDIA_REMOVED)); + sound.play(media_removed, PLAY_ASYNCHRONOUS); + if (AT_SCREEN(FilesScreen)) { + GOTO_SCREEN(StatusScreen) + } + } + + void onMediaError() { + sound.play(sad_trombone, PLAY_ASYNCHRONOUS); + AlertDialogBox::showError(F("Unable to read media.")); + } + + void onStatusChanged(const char* lcd_msg) { + StatusScreen::setStatusMessage(lcd_msg); + } + + void onStatusChanged(progmem_str lcd_msg) { + StatusScreen::setStatusMessage(lcd_msg); + } + + void onPrintTimerStarted() { + InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_STARTED); + } + + void onPrintTimerStopped() { + InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED); + } + + void onPrintTimerPaused() { + } + + void onFilamentRunout(const extruder_t extruder) { + char lcd_msg[30]; + sprintf_P(lcd_msg, PSTR("Extruder %d Filament Error"), extruder + 1); + StatusScreen::setStatusMessage(lcd_msg); + InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED); + } + + void onFactoryReset() { + InterfaceSettingsScreen::defaultSettings(); + } + + void onStoreSettings(char *buff) { + InterfaceSettingsScreen::saveSettings(buff); + } + + void onLoadSettings(const char *buff) { + InterfaceSettingsScreen::loadSettings(buff); + } + + void onConfigurationStoreWritten(bool success) { + #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE + if (success && InterfaceSettingsScreen::backupEEPROM()) { + SERIAL_ECHOLNPGM("Made backup of EEPROM to SPI Flash"); + } + #else + UNUSED(success); + #endif + } + + void onConfigurationStoreRead(bool) { + } + + void onPlayTone(const uint16_t frequency, const uint16_t duration) { + sound.play_tone(frequency, duration); + } + + void onUserConfirmRequired(const char * const msg) { + if (msg) + ConfirmUserRequestAlertBox::show(msg); + else + ConfirmUserRequestAlertBox::hide(); + } + + #if HAS_LEVELING && HAS_MESH + void onMeshUpdate(const int8_t, const int8_t, const float) { + } + #endif +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h new file mode 100644 index 000000000000..c2818570f1ba --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h @@ -0,0 +1,142 @@ +/****************** + * pin_mappings.h * + ******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/* This file defines mappings from the ULTRA_LCD pins functions to new + * functions for the FTDI display. These mappings allows any board that + * support ULTRA_LCD via EXP1 and EXP2 connectors to use FTDI modules + * without adding new pin definitions to the board. + */ + +#ifdef CR10_TFT_PINMAP + #ifndef __MARLIN_FIRMWARE__ + #error This pin mapping requires Marlin. + #endif + + #define CLCD_USE_SOFT_SPI + #define CLCD_SOFT_SPI_SCLK LCD_PINS_D4 // PORTA1 Pin 6 + #define CLCD_SOFT_SPI_MOSI LCD_PINS_ENABLE // PORTC1 Pin 8 + #define CLCD_SPI_CS LCD_PINS_RS // PORTA3 Pin 7 + #define CLCD_SOFT_SPI_MISO 16 // PORTC0 BTN_ENC Pin 2 + #define CLCD_MOD_RESET 11 // PORTD3 BTN_EN1 Pin 3 + #define CLCD_AUX_0 10 // PORTD2 BTN_EN2 Pin 5 + #define CLCD_AUX_1 BEEPER_PIN // PORTA4 Pin 1 +#endif + +/** + * The AlephObjects pinout for re-purposing the UltraLCD + * connector EXP1 for software SPI (rev B, obsolete) + */ + +#ifdef AO_EXP1_DEPRECATED_PINMAP + #ifndef __MARLIN_FIRMWARE__ + #error This pin mapping requires Marlin. + #endif + + #define CLCD_MOD_RESET LCD_PINS_D4 + #define CLCD_SPI_CS LCD_PINS_D5 + + #define CLCD_AUX_0 LCD_PINS_ENABLE + #define CLCD_AUX_1 BTN_ENC + #define CLCD_AUX_2 BEEPER_PIN + + #define CLCD_USE_SOFT_SPI + #define CLCD_SOFT_SPI_SCLK LCD_PINS_D7 + #define CLCD_SOFT_SPI_MOSI LCD_PINS_D6 + #define CLCD_SOFT_SPI_MISO LCD_PINS_RS +#endif + +/** + * AO_EXP1_PINMAP + * + * The AlephObjects mapping for re-purposing the UltraLCD + * connector EXP1 for software SPI for display (rev C): + * + * EXP2: FTDI: SD -or- USB [1]: ULTRA_LCD: + * 1 MISO MISO MISO --> BEEPER + * 2 SCLK SCLK SCLK --> BTN_ENC + * 3 PD_N - - --> LCDE + * 4 - CS_N CS_N --> LCDRS + * 5 CS_N - - --> LCD4 + * 6 MOSI MOSI MOSI --> LCD5 + * 7 - SD_DET INT --> LCD6 + * 8 RESET - RESET --> LCD4 + * 9 GND GND GND --> GND + * 10 5V 5V 5V --> 5V + * + * [1] At the moment, Marlin does not support SD or USB + * functionality over software SPI. + */ + +#ifdef AO_EXP1_PINMAP + #ifndef __MARLIN_FIRMWARE__ + #error This pin mapping requires Marlin. + #endif + + #define CLCD_MOD_RESET LCD_PINS_ENABLE + #define CLCD_SPI_CS LCD_PINS_D4 + + #define CLCD_USE_SOFT_SPI + #define CLCD_SOFT_SPI_SCLK BTN_ENC + #define CLCD_SOFT_SPI_MOSI LCD_PINS_D5 + #define CLCD_SOFT_SPI_MISO BEEPER_PIN +#endif + +/** + * AO_EXP2_PINMAP + * + * The AlephObjects mapping for re-purposing the UltraLCD + * connector EXP2 for hardware SPI for display and SD card + * or USB (rev C): + * + * EXP2: FTDI: SD -or- USB: ULTRA_LCD: + * 1 MISO MISO MISO --> MISO + * 2 SCLK SCLK SCLK --> SCLK + * 3 PD_N - - --> BTN_EN2 + * 4 - CS_N CS_N --> SD_CSEL + * 5 CS_N - - --> BTN_EN1 + * 6 MOSI MOSI MOSI --> MOSI + * 7 - SD_DET INT --> SD_DET + * 8 RESET - RESET --> RESET + * 9 GND GND GND --> GND + * 10 5V 5V 5V --> KILL [3] + * + * [1] This configuration is not compatible with the + * EinsyRetro 1.1a because there is a level shifter + * on MISO enabled by SD/USB chip select. + * + * [2] This configuration allows daisy-chaining of the + * display and SD/USB on EXP2. + * + * [3] Archim Rambo provides 5V on this pin. On any other + * board, divert this wire from the ribbon cable and + * connect it to 5V at an endstop. + */ + +#ifdef AO_EXP2_PINMAP + #ifndef __MARLIN_FIRMWARE__ + #error This pin mapping requires Marlin. + #endif + + #define CLCD_SPI_CS BTN_EN1 + #define CLCD_MOD_RESET BTN_EN2 +#endif diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp new file mode 100644 index 000000000000..afd4402fc109 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp @@ -0,0 +1,94 @@ +/******************** + * about_screen.cpp * + ********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +#define GRID_COLS 4 +#define GRID_ROWS 9 + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void AboutScreen::onEntry() { + BaseScreen::onEntry(); + sound.play(chimes, PLAY_ASYNCHRONOUS); +} + +void AboutScreen::onRedraw(draw_mode_t) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + + draw_text_box(cmd, BTN_POS(1,2), BTN_SIZE(4,1), + #ifdef CUSTOM_MACHINE_NAME + F(CUSTOM_MACHINE_NAME) + #else + GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1) + #endif + , OPT_CENTER, font_xlarge + ); + + #ifdef TOOLHEAD_NAME + char about_str[ + strlen_P(GET_TEXT(FIRMWARE_FOR_TOOLHEAD)) + + strlen_P(TOOLHEAD_NAME) + + strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) + 1 + ]; + + sprintf_P(about_str, GET_TEXT(MSG_FIRMWARE_FOR_TOOLHEAD), TOOLHEAD_NAME); + strcat_P (about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)); + #endif + + cmd.tag(2); + draw_text_box(cmd, BTN_POS(1,3), BTN_SIZE(4,3), + #ifdef TOOLHEAD_NAME + about_str + #else + GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_2) + #endif + , OPT_CENTER, font_medium + ); + + cmd.tag(0); + draw_text_box(cmd, BTN_POS(1,6), BTN_SIZE(4,2), progmem_str(getFirmwareName_str()), OPT_CENTER, font_medium); + + cmd.font(font_medium).colors(action_btn).tag(1).button(BTN_POS(2,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_OKAY)); +} + +bool AboutScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; +#if ENABLED(TOUCH_UI_DEVELOPER_MENU) + case 2: GOTO_SCREEN(DeveloperMenu); return true; +#endif + default: return false; + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp new file mode 100644 index 000000000000..b2fc2790a0c2 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -0,0 +1,205 @@ +/***************************** + * advance_settings_menu.cpp * + *****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)); + } + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(Theme::font_medium) + #ifdef TOUCH_UI_PORTRAIT + #define GRID_ROWS 10 + #define GRID_COLS 2 + .enabled( + #if HAS_BED_PROBE + 1 + #endif + ) + .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) + .enabled( + #if HAS_CASE_LIGHT + 1 + #endif + ) + .tag(16).button( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT)) + .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) + .enabled( + #if HAS_TRINAMIC + 1 + #endif + ) + .tag(13).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) + .enabled( + #if HAS_TRINAMIC + 1 + #endif + ) + .tag(14).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) + .enabled( + #if HOTENDS > 1 + 1 + #endif + ) + .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) + .enabled( + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + 1 + #endif + ) + .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT)) + .tag(12).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) + .tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) + .tag(9) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) + .tag(10).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) + .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) + .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) + #if DISABLED(CLASSIC_JERK) + .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) + #else + .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) + #endif + .enabled( + #if ENABLED(BACKLASH_GCODE) + 1 + #endif + ) + .tag(8).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) + .colors(action_btn) + .tag(1) .button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + #undef GRID_COLS + #undef GRID_ROWS + #else + #define GRID_ROWS 6 + #define GRID_COLS 3 + .enabled( + #if HAS_BED_PROBE + 1 + #endif + ) + .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) + .enabled( + #if HAS_CASE_LIGHT + 1 + #endif + ) + .tag(16).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT)) + .enabled(1) + .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) + .enabled( + #if HAS_TRINAMIC + 1 + #endif + ) + .tag(13).button( BTN_POS(3,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) + .enabled( + #if HAS_TRINAMIC + 1 + #endif + ) + .tag(14).button( BTN_POS(3,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) + .enabled( + #if ENABLED(BACKLASH_GCODE) + 1 + #endif + ) + .tag(8).button( BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) + .enabled( + #if HOTENDS > 1 + 1 + #endif + ) + .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) + .tag(12).button( BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) + .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) + .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) + #if DISABLED(CLASSIC_JERK) + .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) + #else + .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) + #endif + .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT)) + .tag(15).button( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) + .tag(9) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) + .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) + .colors(action_btn) + .tag(1) .button( BTN_POS(3,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK)); + #endif + } +} + +bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + #if HAS_BED_PROBE + case 2: GOTO_SCREEN(ZOffsetScreen); break; + #endif + case 3: GOTO_SCREEN(StepsScreen); break; + #if HOTENDS > 1 + case 4: GOTO_SCREEN(NozzleOffsetScreen); break; + #endif + case 5: GOTO_SCREEN(MaxVelocityScreen); break; + case 6: GOTO_SCREEN(DefaultAccelerationScreen); break; + case 7: + #if DISABLED(CLASSIC_JERK) + GOTO_SCREEN(JunctionDeviationScreen); + #else + GOTO_SCREEN(JerkScreen); + #endif + break; + #if ENABLED(BACKLASH_GCODE) + case 8: GOTO_SCREEN(BacklashCompensationScreen); break; + #endif + case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break; + case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break; + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + case 11: GOTO_SCREEN(FilamentMenu); break; + #endif + case 12: GOTO_SCREEN(EndstopStatesScreen); break; + #if HAS_TRINAMIC + case 13: GOTO_SCREEN(StepperCurrentScreen); break; + case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break; + #endif + case 15: GOTO_SCREEN(DisplayTuningScreen); break; + #if HAS_CASE_LIGHT + case 16: GOTO_SCREEN(CaseLightScreen); break; + #endif + default: return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp new file mode 100644 index 000000000000..17750c02ec02 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp @@ -0,0 +1,70 @@ +/************************ + * alert_dialog_box.cpp * + ************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace Theme; + +void AlertDialogBox::onEntry() { + BaseScreen::onEntry(); + sound.play(screen_data.AlertDialogBox.isError ? sad_trombone : twinkle, PLAY_ASYNCHRONOUS); +} + +void AlertDialogBox::onRedraw(draw_mode_t what) { + if (what & FOREGROUND) { + drawOkayButton(); + } +} + +template +void AlertDialogBox::show(const T message) { + drawMessage(message); + storeBackground(); + screen_data.AlertDialogBox.isError = false; + GOTO_SCREEN(AlertDialogBox); +} + +template +void AlertDialogBox::showError(const T message) { + drawMessage(message); + storeBackground(); + screen_data.AlertDialogBox.isError = true; + GOTO_SCREEN(AlertDialogBox); +} + +void AlertDialogBox::hide() { + if (AT_SCREEN(AlertDialogBox)) + GOTO_PREVIOUS(); +} + +template void AlertDialogBox::show(const char *); +template void AlertDialogBox::show(const progmem_str); +template void AlertDialogBox::showError(const char *); +template void AlertDialogBox::showError(const progmem_str); + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp new file mode 100644 index 000000000000..0d6b97d46aba --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp @@ -0,0 +1,76 @@ +/************************************ + * backlash_compensation_screen.cpp * + ************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, BACKLASH_GCODE) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void BacklashCompensationScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(2).units( GET_TEXT_F(MSG_UNITS_MM)); + w.heading( GET_TEXT_F(MSG_BACKLASH)); + w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), getAxisBacklash_mm(X)); + w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), getAxisBacklash_mm(Y)); + w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), getAxisBacklash_mm(Z)); + #if ENABLED(CALIBRATION_GCODE) + w.button(12, GET_TEXT_F(MSG_MEASURE_AUTOMATICALLY)); + #endif + #ifdef BACKLASH_SMOOTHING_MM + w.color(other).adjuster(8, GET_TEXT_F(MSG_BACKLASH_SMOOTHING), getBacklashSmoothing_mm()); + #endif + w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT)) + .adjuster(10, GET_TEXT_F(MSG_BACKLASH_CORRECTION), getBacklashCorrection_percent()); + w.precision(2).increments(); +} + +bool BacklashCompensationScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(AxisBacklash_mm, X); break; + case 3: UI_INCREMENT(AxisBacklash_mm, X); break; + case 4: UI_DECREMENT(AxisBacklash_mm, Y); break; + case 5: UI_INCREMENT(AxisBacklash_mm, Y); break; + case 6: UI_DECREMENT(AxisBacklash_mm, Z); break; + case 7: UI_INCREMENT(AxisBacklash_mm, Z); break; + #ifdef BACKLASH_SMOOTHING_MM + case 8: UI_DECREMENT(BacklashSmoothing_mm); break; + case 9: UI_INCREMENT(BacklashSmoothing_mm); break; + #endif + case 10: UI_DECREMENT_BY(BacklashCorrection_percent, increment*100); break; + case 11: UI_INCREMENT_BY(BacklashCorrection_percent, increment*100); break; + #if ENABLED(CALIBRATION_GCODE) + case 12: GOTO_SCREEN(ConfirmAutoCalibrationDialogBox); return true; + #endif + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp new file mode 100644 index 000000000000..97e399a4030b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp @@ -0,0 +1,384 @@ +/************************************** + * base_numeric_adjustment_screen.cpp * + **************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace Theme; + +#ifdef TOUCH_UI_PORTRAIT + #define GRID_COLS 13 + #define GRID_ROWS 10 + #define LAYOUT_FONT font_small +#else + #define GRID_COLS 18 + #define GRID_ROWS 7 + #define LAYOUT_FONT font_medium +#endif + +BaseNumericAdjustmentScreen::widgets_t::widgets_t(draw_mode_t what) : _what(what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .colors(normal_btn) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + } + + cmd.font(font_medium); + _button(cmd, 1, + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1,10), BTN_SIZE(13,1), + #else + BTN_POS(15,7), BTN_SIZE(4,1), + #endif + GET_TEXT_F(MSG_BACK), true, true + ); + + _line = 1; + _units = F(""); +} + +/** + * Speed optimization for changing button style. + */ +void BaseNumericAdjustmentScreen::widgets_t::_button_style(CommandProcessor &cmd, BaseNumericAdjustmentScreen::widgets_t::style_t style) { + if (_style != style) { + const btn_colors *old_colors = &normal_btn; + const btn_colors *new_colors = &normal_btn; + + switch(_style) { + case BTN_ACTION: old_colors = &action_btn; break; + case BTN_TOGGLE: old_colors = &ui_toggle; break; + case BTN_DISABLED: old_colors = &disabled_btn; break; + default: break; + } + switch(style) { + case BTN_ACTION: new_colors = &action_btn; break; + case BTN_TOGGLE: new_colors = &ui_toggle; break; + case BTN_DISABLED: new_colors = &disabled_btn; break; + default: break; + } + + const bool rgb_changed = (old_colors->rgb != new_colors->rgb) || + (_style == TEXT_LABEL && style != TEXT_LABEL) || + (_style != TEXT_LABEL && style == TEXT_LABEL); + const bool grad_changed = old_colors->grad != new_colors->grad; + const bool fg_changed = (old_colors->fg != new_colors->fg) || (_style == TEXT_AREA); + const bool bg_changed = old_colors->bg != new_colors->bg; + + if (rgb_changed) cmd.cmd(COLOR_RGB(style == TEXT_LABEL ? bg_text_enabled : new_colors->rgb)); + if (grad_changed) cmd.gradcolor(new_colors->grad); + if (fg_changed) cmd.fgcolor(new_colors->fg); + if (bg_changed) cmd.bgcolor(new_colors->bg); + + _style = style; + } +} + +/** + * Speed optimization for drawing buttons. Draw all unpressed buttons in the + * background layer and draw only the pressed button in the foreground layer. + */ +void BaseNumericAdjustmentScreen::widgets_t::_button(CommandProcessor &cmd, uint8_t tag, int16_t x, int16_t y, int16_t w, int16_t h, progmem_str text, bool enabled, bool highlight) { + if (_what & BACKGROUND) enabled = true; + if ((_what & BACKGROUND) || buttonIsPressed(tag) || highlight || !enabled) { + _button_style(cmd, (!enabled) ? BTN_DISABLED : (highlight ? BTN_ACTION : BTN_NORMAL)); + cmd.tag(enabled ? tag : 0).button(x, y, w, h, text); + } +} + +BaseNumericAdjustmentScreen::widgets_t &BaseNumericAdjustmentScreen::widgets_t::precision(uint8_t decimals, precision_default_t initial) { + _decimals = decimals; + if (screen_data.BaseNumericAdjustmentScreen.increment == 0) { + screen_data.BaseNumericAdjustmentScreen.increment = 243 + (initial - DEFAULT_LOWEST) - _decimals; + } + return *this; +} + +void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) { + if (_what & BACKGROUND) { + CommandProcessor cmd; + _button_style(cmd, TEXT_LABEL); + cmd.font(font_medium) + .tag(0) + .text( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1, _line), BTN_SIZE(12,1), + #else + BTN_POS(5, _line), BTN_SIZE(8,1), + #endif + label + ); + } + + _line++; +} + +#ifdef TOUCH_UI_PORTRAIT + #ifdef TOUCH_UI_800x480 + #undef EDGE_R + #define EDGE_R 20 + #else + #undef EDGE_R + #define EDGE_R 10 + #endif +#endif + +void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(CommandProcessor &cmd, uint8_t, const uint8_t tag) { + const char *label = PSTR("?"); + uint8_t pos; + uint8_t & increment = screen_data.BaseNumericAdjustmentScreen.increment; + + if (increment == 0) { + increment = tag; // Set the default value to be the first. + } + + switch (tag) { + case 240: label = PSTR( ".001"); pos = _decimals - 3; break; + case 241: label = PSTR( ".01" ); pos = _decimals - 2; break; + case 242: label = PSTR( "0.1" ); pos = _decimals - 1; break; + case 243: label = PSTR( "1" ); pos = _decimals + 0; break; + case 244: label = PSTR( "10" ); pos = _decimals + 1; break; + default: label = PSTR("100" ); pos = _decimals + 2; break; + } + + const bool highlight = (_what & FOREGROUND) && (increment == tag); + + switch (pos) { + #ifdef TOUCH_UI_PORTRAIT + case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; + case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; + case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; + #else + case 0: _button(cmd, tag, BTN_POS(15,2), BTN_SIZE(4,1), progmem_str(label), true, highlight); break; + case 1: _button(cmd, tag, BTN_POS(15,3), BTN_SIZE(4,1), progmem_str(label), true, highlight); break; + case 2: _button(cmd, tag, BTN_POS(15,4), BTN_SIZE(4,1), progmem_str(label), true, highlight); break; + #endif + } +} + +void BaseNumericAdjustmentScreen::widgets_t::increments() { + CommandProcessor cmd; + + cmd.font(LAYOUT_FONT); + + if (_what & BACKGROUND) { + _button_style(cmd, TEXT_LABEL); + cmd.tag(0).text( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1, _line), BTN_SIZE(4,1), + #else + BTN_POS(15, 1), BTN_SIZE(4,1), + #endif + GET_TEXT_F(MSG_INCREMENT) + ); + } + + _draw_increment_btn(cmd, _line+1, 245 - _decimals); + _draw_increment_btn(cmd, _line+1, 244 - _decimals); + _draw_increment_btn(cmd, _line+1, 243 - _decimals); + + #ifdef TOUCH_UI_PORTRAIT + _line++; + #endif +} + +void BaseNumericAdjustmentScreen::widgets_t::adjuster_sram_val(uint8_t tag, progmem_str label, const char *value, bool is_enabled) { + CommandProcessor cmd; + + if (_what & BACKGROUND) { + _button_style(cmd, TEXT_LABEL); + cmd.tag(0) + .font(font_small) + .text( BTN_POS(1,_line), BTN_SIZE(4,1), label); + _button_style(cmd, TEXT_AREA); + cmd.fgcolor(_color).button( BTN_POS(5,_line), BTN_SIZE(5,1), F(""), OPT_FLAT); + } + + cmd.font(font_medium); + _button(cmd, tag, BTN_POS(10,_line), BTN_SIZE(2,1), F("-"), is_enabled); + _button(cmd, tag + 1, BTN_POS(12,_line), BTN_SIZE(2,1), F("+"), is_enabled); + + if ((_what & FOREGROUND) && is_enabled) { + _button_style(cmd, BTN_NORMAL); + cmd.tag(0) + .font(font_small) + .text(BTN_POS(5,_line), BTN_SIZE(5,1), value); + } + + _line++; +} + +void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, progmem_str label, const char *value, bool is_enabled) { + if (_what & BACKGROUND) { + adjuster_sram_val(tag, label, nullptr); + } + + if (_what & FOREGROUND) { + char b[strlen_P(value)+1]; + strcpy_P(b,value); + adjuster_sram_val(tag, label, b, is_enabled); + } +} + +void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, progmem_str label, float value, bool is_enabled) { + if (_what & BACKGROUND) { + adjuster_sram_val(tag, label, nullptr); + } + + if (_what & FOREGROUND) { + char b[32]; + dtostrf(value, 5, _decimals, b); + strcat_P(b, PSTR(" ")); + strcat_P(b, (const char*) _units); + adjuster_sram_val(tag, label, b, is_enabled); + } +} + +void BaseNumericAdjustmentScreen::widgets_t::button(uint8_t tag, progmem_str label, bool is_enabled) { + CommandProcessor cmd; + cmd.font(LAYOUT_FONT); + _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(9,1), label, is_enabled); + + _line++; +} + +void BaseNumericAdjustmentScreen::widgets_t::text_field(uint8_t tag, progmem_str label, const char *value, bool is_enabled) { + CommandProcessor cmd; + + if (_what & BACKGROUND) { + _button_style(cmd, TEXT_LABEL); + cmd.enabled(1) + .tag(0) + .font(font_small) + .text( BTN_POS(1,_line), BTN_SIZE(4,1), label); + _button_style(cmd, TEXT_AREA); + cmd.fgcolor(_color) + .tag(tag) + .button( BTN_POS(5,_line), BTN_SIZE(9,1), F(""), OPT_FLAT); + } + + if (_what & FOREGROUND) { + cmd.font(font_small).text( BTN_POS(5,_line), BTN_SIZE(9,1), is_enabled ? value : "-"); + } + + _line++; +} + +void BaseNumericAdjustmentScreen::widgets_t::two_buttons(uint8_t tag1, progmem_str label1, uint8_t tag2, progmem_str label2, bool is_enabled) { + CommandProcessor cmd; + cmd.font(LAYOUT_FONT); + _button(cmd, tag1, BTN_POS(5,_line), BTN_SIZE(4.5,1), label1, is_enabled); + _button(cmd, tag2, BTN_POS(9.5,_line), BTN_SIZE(4.5,1), label2, is_enabled); + + _line++; +} + +void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str label, bool value, bool is_enabled) { + CommandProcessor cmd; + + if (_what & BACKGROUND) { + _button_style(cmd, TEXT_LABEL); + cmd.font(font_small) + .text( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1, _line), BTN_SIZE( 8,1), + #else + BTN_POS(1, _line), BTN_SIZE(10,1), + #endif + label + ); + } + + if (_what & FOREGROUND) { + _button_style(cmd, BTN_TOGGLE); + cmd.tag(is_enabled ? tag : 0) + .enabled(is_enabled) + .font(font_small) + .toggle2( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS( 9,_line), BTN_SIZE(5,1), + #else + BTN_POS(10,_line), BTN_SIZE(4,1), + #endif + GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), value + ); + } + + _line++; +} + +void BaseNumericAdjustmentScreen::widgets_t::home_buttons(uint8_t tag) { + CommandProcessor cmd; + + if (_what & BACKGROUND) { + _button_style(cmd, TEXT_LABEL); + cmd.font(font_small) + .text(BTN_POS(1, _line), BTN_SIZE(4,1), GET_TEXT_F(MSG_HOME)); + } + + cmd.font(LAYOUT_FONT); + _button(cmd, tag+0, BTN_POS(5,_line), BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_X)); + _button(cmd, tag+1, BTN_POS(7,_line), BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_Y)); + _button(cmd, tag+2, BTN_POS(9,_line), BTN_SIZE(2,1), GET_TEXT_F(MSG_AXIS_Z)); + _button(cmd, tag+3, BTN_POS(11,_line), BTN_SIZE(3,1), GET_TEXT_F(MSG_AXIS_ALL)); + + _line++; +} + +void BaseNumericAdjustmentScreen::onEntry() { + screen_data.BaseNumericAdjustmentScreen.increment = 0; // This will force the increment to be picked while drawing. + BaseScreen::onEntry(); + CommandProcessor cmd; + cmd.set_button_style_callback(nullptr); +} + +bool BaseNumericAdjustmentScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; + case 240 ... 245: screen_data.BaseNumericAdjustmentScreen.increment = tag; break; + default: return current_screen.onTouchHeld(tag); + } + return true; +} + +float BaseNumericAdjustmentScreen::getIncrement() { + switch (screen_data.BaseNumericAdjustmentScreen.increment) { + case 240: return 0.001; + case 241: return 0.01; + case 242: return 0.1; + case 243: return 1.0; + case 244: return 10.0; + case 245: return 100.0; + default: return 0.0; + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp new file mode 100644 index 000000000000..77cadabcd778 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/base_screen.cpp @@ -0,0 +1,90 @@ +/******************* + * base_screen.cpp * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void BaseScreen::onEntry() { + CommandProcessor cmd; + cmd.set_button_style_callback(buttonStyleCallback); + reset_menu_timeout(); + UIScreen::onEntry(); +} + +bool BaseScreen::buttonIsPressed(uint8_t tag) { + return tag != 0 && EventLoop::get_pressed_tag() == tag; +} + +bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t &style, uint16_t &options, bool post) { + if (post) { + cmd.colors(normal_btn); + return false; + } + + #ifdef LCD_TIMEOUT_TO_STATUS + if (EventLoop::get_pressed_tag() != 0) { + reset_menu_timeout(); + } + #endif + + if (buttonIsPressed(tag)) { + options = OPT_FLAT; + } + + if (style & cmd.STYLE_DISABLED) { + cmd.tag(0); + style &= ~cmd.STYLE_DISABLED; + cmd.colors(disabled_btn); + return true; // Call me again to reset the colors + } + return false; +} + +void BaseScreen::onIdle() { + #ifdef LCD_TIMEOUT_TO_STATUS + if ((millis() - last_interaction) > LCD_TIMEOUT_TO_STATUS) { + reset_menu_timeout(); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("Returning to status due to menu timeout"); + #endif + GOTO_SCREEN(StatusScreen); + } + #endif +} + +void BaseScreen::reset_menu_timeout() { + #ifdef LCD_TIMEOUT_TO_STATUS + last_interaction = millis(); + #endif +} + +#ifdef LCD_TIMEOUT_TO_STATUS + uint32_t BaseScreen::last_interaction; +#endif + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp new file mode 100644 index 000000000000..c2cbf70ae293 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp @@ -0,0 +1,137 @@ +/***************************** + * bio_advanced_settings.cpp * + *****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)); + } + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(Theme::font_medium) + #define GRID_ROWS 9 + #define GRID_COLS 2 + + .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) + .enabled( + #if HAS_TRINAMIC + 1 + #endif + ) + .tag(3) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) + .enabled( + #if HAS_TRINAMIC + 1 + #endif + ) + .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) + .tag(5) .button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) + .enabled( + #if HOTENDS > 1 + 1 + #endif + ) + .tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) + + + .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) + .tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) + .tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) + #if DISABLED(CLASSIC_JERK) + .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) + #else + .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) + #endif + .enabled( + #if ENABLED(BACKLASH_GCODE) + 1 + #endif + ) + .tag(11) .button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) + .enabled( + #if ENABLED(LIN_ADVANCE) + 1 + #endif + ) + .tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) + .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) + .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) + .colors(action_btn) + .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + #undef GRID_COLS + #undef GRID_ROWS + } +} + +bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { + using namespace ExtUI; + + switch (tag) { + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + case 2: GOTO_SCREEN(DisplayTuningScreen); break; + #if HAS_TRINAMIC + case 3: GOTO_SCREEN(StepperCurrentScreen); break; + case 4: GOTO_SCREEN(StepperBumpSensitivityScreen); break; + #endif + case 5: GOTO_SCREEN(EndstopStatesScreen); break; + #if HOTENDS > 1 + case 6: GOTO_SCREEN(NozzleOffsetScreen); break; + #endif + + case 7: GOTO_SCREEN(StepsScreen); break; + case 8: GOTO_SCREEN(MaxVelocityScreen); break; + case 9: GOTO_SCREEN(DefaultAccelerationScreen); break; + case 10: + #if DISABLED(CLASSIC_JERK) + GOTO_SCREEN(JunctionDeviationScreen); + #else + GOTO_SCREEN(JerkScreen); + #endif + break; + #if ENABLED(BACKLASH_GCODE) + case 11: GOTO_SCREEN(BacklashCompensationScreen); break; + #endif + #if ENABLED(LIN_ADVANCE) + case 12: GOTO_SCREEN(LinearAdvanceScreen); break; + #endif + case 13: GOTO_SCREEN(InterfaceSettingsScreen); break; + case 14: GOTO_SCREEN(RestoreFailsafeDialogBox); break; + + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp new file mode 100644 index 000000000000..a3254bae9ae4 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp @@ -0,0 +1,54 @@ +/**************************** + * bio_confirm_home_xyz.cpp * + ****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +using namespace FTDI; + +void BioConfirmHomeE::onRedraw(draw_mode_t) { + drawMessage(GET_TEXT_F(MSG_HOME_E_WARNING)); + drawYesNoButtons(1); +} + +bool BioConfirmHomeE::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + SpinnerDialogBox::enqueueAndWait_P(F( + "G28 E\n" + AXIS_LEVELING_COMMANDS "\n" + PARK_AND_RELEASE_COMMANDS + )); + current_screen.forget(); + break; + case 2: + GOTO_SCREEN(StatusScreen); + break; + default: + return DialogBoxBaseClass::onTouchEnd(tag); + } + return true; +} +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp new file mode 100644 index 000000000000..883a446b3ea9 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp @@ -0,0 +1,53 @@ +/**************************** + * bio_confirm_home_xyz.cpp * + ****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +using namespace FTDI; + +void BioConfirmHomeXYZ::onRedraw(draw_mode_t) { + drawMessage(GET_TEXT_F(MSG_HOME_XYZ_WARNING)); + drawYesNoButtons(1); +} + +bool BioConfirmHomeXYZ::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + SpinnerDialogBox::enqueueAndWait_P(F( + "G28\n" + PARK_AND_RELEASE_COMMANDS + )); + current_screen.forget(); + break; + case 2: + GOTO_SCREEN(StatusScreen); + break; + default: + return DialogBoxBaseClass::onTouchEnd(tag); + } + return true; +} +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp new file mode 100644 index 000000000000..40ed8479ee64 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp @@ -0,0 +1,86 @@ +/********************* + * bio_main_menu.cpp * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void MainMenu::onRedraw(draw_mode_t what) { + #define GRID_ROWS 10 + #define GRID_COLS 2 + + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0); + } + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.cmd(COLOR_RGB(bg_text_enabled)) + .font(font_large).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_MAIN)) + .colors(normal_btn) + .font(font_medium) + .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) + .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER)) + .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) + .tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS)) + .tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE)) + .tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) + .tag(8).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .tag(9).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU)) + .colors(action_btn) + .tag(1).button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + } + + #undef GRID_COLS + #undef GRID_ROWS +} + +bool MainMenu::onTouchEnd(uint8_t tag) { + using namespace ExtUI; + + const bool e_homed = isAxisPositionKnown(E0); + + switch (tag) { + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + case 2: GOTO_SCREEN(BioConfirmHomeXYZ); break; + case 3: SpinnerDialogBox::enqueueAndWait_P(e_homed ? F("G0 E0 F120") : F("G112")); break; + case 4: StatusScreen::unlockMotors(); break; + case 5: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break; + case 6: GOTO_SCREEN(TemperatureScreen); break; + case 7: GOTO_SCREEN(InterfaceSettingsScreen); break; + case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; + case 9: GOTO_SCREEN(AboutScreen); break; + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h new file mode 100644 index 000000000000..1c7c02093d0f --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h @@ -0,0 +1,59 @@ + +/**************************************************************************** + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/** + * This file was auto-generated using "svg2cpp.py" + * + * The encoding consists of x,y pairs with the min and max scaled to + * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the + * start of a new closed path. + */ + +#pragma once + +constexpr float x_min = 0.000000; +constexpr float x_max = 480.000000; +constexpr float y_min = 0.000000; +constexpr float y_max = 272.000000; + +const PROGMEM uint16_t z_neg[] = {0x7950, 0x51EA, 0x824E, 0x51EA, 0x824E, 0x71E2, 0x86CD, 0x71E2, 0x7DCF, 0x81DF, 0x74D1, 0x71E2, 0x7950, 0x71E2, 0x7950, 0x51EA}; +const PROGMEM uint16_t z_pos[] = {0x7950, 0x41EE, 0x824E, 0x41EE, 0x824E, 0x21F5, 0x86CD, 0x21F5, 0x7DCF, 0x11F9, 0x74D0, 0x21F5, 0x7950, 0x21F5, 0x7950, 0x41EE}; +const PROGMEM uint16_t y_neg[] = {0x3479, 0x56CF, 0x3EC6, 0x56CF, 0x3747, 0x7281, 0x3C6D, 0x7281, 0x2E61, 0x8059, 0x27D4, 0x7281, 0x2CFA, 0x7281, 0x3479, 0x56CF}; +const PROGMEM uint16_t y_pos[] = {0x3BF9, 0x3B1D, 0x4645, 0x3B1D, 0x4DC4, 0x1F6B, 0x52EB, 0x1F6B, 0x4C5E, 0x1192, 0x3E52, 0x1F6B, 0x4378, 0x1F6B, 0x3BF9, 0x3B1D}; +const PROGMEM uint16_t x_neg[] = {0x350E, 0x4209, 0x314E, 0x4FE2, 0x1CB5, 0x4FE2, 0x1AD6, 0x56CF, 0x1449, 0x48F6, 0x2255, 0x3B1D, 0x2075, 0x4209, 0x350E, 0x4209}; +const PROGMEM uint16_t x_pos[] = {0x498C, 0x4209, 0x45CC, 0x4FE2, 0x5A65, 0x4FE2, 0x5885, 0x56CF, 0x6691, 0x48F6, 0x6004, 0x3B1D, 0x5E25, 0x4209, 0x498C, 0x4209}; +const PROGMEM uint16_t syringe_fluid[] = {0xB4E9, 0x78BE, 0xBB12, 0x7C44, 0xBDE3, 0x7C44, 0xC426, 0x78BE, 0xC426, 0x250D, 0xB4E9, 0x250D, 0xB4E9, 0x78BE}; +const PROGMEM uint16_t syringe[] = {0xB8AD, 0x6BB1, 0xB8AD, 0x6E0C, 0xBE02, 0x6E0C, 0xBE02, 0x6BB1, 0xFFFF, 0xB8AD, 0x6248, 0xB8AD, 0x64A2, 0xBE02, 0x64A2, 0xBE02, 0x6248, 0xFFFF, 0xB8AD, 0x58DF, 0xB8AD, 0x5B39, 0xBE02, 0x5B39, 0xBE02, 0x58DF, 0xFFFF, 0xB8AD, 0x4F75, 0xB8AD, 0x51D0, 0xBE02, 0x51D0, 0xBE02, 0x4F75, 0xFFFF, 0xB8AD, 0x460C, 0xB8AD, 0x4866, 0xBE02, 0x4866, 0xBE02, 0x460C, 0xFFFF, 0xB8AD, 0x3CA3, 0xB8AD, 0x3EFD, 0xBE02, 0x3EFD, 0xBE02, 0x3CA3, 0xFFFF, 0xB8AD, 0x3339, 0xB8AD, 0x3594, 0xBE02, 0x3594, 0xBE02, 0x3339, 0xFFFF, 0xB396, 0x110A, 0xB396, 0x1818, 0xB995, 0x1818, 0xB995, 0x22AD, 0xB396, 0x22AD, 0xB396, 0x7ADA, 0xB995, 0x7E61, 0xB995, 0x88F5, 0xBB95, 0x88F5, 0xBB95, 0xA8B4, 0xBD94, 0xAC3B, 0xBD94, 0x88F5, 0xBF94, 0x88F5, 0xBF94, 0x7E61, 0xC593, 0x7ADA, 0xC593, 0x22AD, 0xBF94, 0x22AD, 0xBF94, 0x1818, 0xC593, 0x1818, 0xC593, 0x110A, 0xFFFF, 0xBB95, 0x1818, 0xBD94, 0x1818, 0xBD94, 0x22AD, 0xBB95, 0x22AD, 0xBB95, 0x1818, 0xFFFF, 0xB596, 0x2634, 0xC393, 0x2634, 0xC393, 0x7753, 0xBD94, 0x7ADA, 0xBB95, 0x7ADA, 0xB596, 0x7753, 0xB596, 0x2634}; +const PROGMEM uint16_t syringe_outline[] = {0xB396, 0x110A, 0xB396, 0x1818, 0xB995, 0x1818, 0xB995, 0x22AD, 0xB396, 0x22AD, 0xB396, 0x7ADA, 0xB995, 0x7E61, 0xB995, 0x88F5, 0xBB95, 0x88F5, 0xBB95, 0xA8B4, 0xBD94, 0xAC3B, 0xBD94, 0x88F5, 0xBF94, 0x88F5, 0xBF94, 0x7E61, 0xC593, 0x7ADA, 0xC593, 0x22AD, 0xBF94, 0x22AD, 0xBF94, 0x1818, 0xC593, 0x1818, 0xC593, 0x110A, 0xB396, 0x110A}; +const PROGMEM uint16_t padlock[] = {0x3FE3, 0x2A04, 0x3D34, 0x2AF9, 0x3AFF, 0x2D93, 0x397D, 0x316D, 0x38E8, 0x3626, 0x38E8, 0x3A14, 0x39B3, 0x3C8F, 0x3B50, 0x3C8F, 0x3C1C, 0x3A14, 0x3C1C, 0x363C, 0x3C6B, 0x33A9, 0x3D3A, 0x3193, 0x3E6C, 0x302D, 0x3FE3, 0x2FAA, 0x415A, 0x302D, 0x428C, 0x3192, 0x435B, 0x33A8, 0x43AB, 0x363C, 0x43AB, 0x4492, 0x38C3, 0x4492, 0x3741, 0x45AC, 0x36A1, 0x4856, 0x36A1, 0x5C41, 0x3741, 0x5EEC, 0x38C3, 0x6005, 0x4703, 0x6005, 0x4886, 0x5EEC, 0x4925, 0x5C41, 0x4925, 0x4856, 0x4886, 0x45AC, 0x4703, 0x4492, 0x46DE, 0x362B, 0x4649, 0x316D, 0x44C7, 0x2D92, 0x4292, 0x2AF9}; +const PROGMEM uint16_t home_z[] = {0x80BB, 0x2B43, 0x712C, 0x46B9, 0x750F, 0x46B9, 0x750F, 0x622F, 0x7CD7, 0x622F, 0x7CD7, 0x5474, 0x849F, 0x5474, 0x849F, 0x622F, 0x8C67, 0x622F, 0x8C67, 0x46B9, 0x904B, 0x46B9, 0x8A48, 0x3C1D, 0x8A48, 0x2ECD, 0x8664, 0x2ECD, 0x8664, 0x3540}; +const PROGMEM uint16_t usb_btn[] = {0x0558, 0xC0D6, 0x3BDB, 0xC0D6, 0x3BDB, 0xF431, 0x0558, 0xF431, 0x0558, 0xC0D6}; +const PROGMEM uint16_t menu_btn[] = {0x416B, 0xC0D6, 0x77EE, 0xC0D6, 0x77EE, 0xF431, 0x416B, 0xF431, 0x416B, 0xC0D6}; +const PROGMEM uint16_t e_pos[] = {0xE04E, 0x5E7B, 0xE94C, 0x5E7B, 0xE94C, 0x7E74, 0xEDCB, 0x7E74, 0xE4CD, 0x8E70, 0xDBCF, 0x7E74, 0xE04E, 0x7E74, 0xE04E, 0x5E7B}; +const PROGMEM uint16_t e_neg[] = {0xE04E, 0x4E7F, 0xE94C, 0x4E7F, 0xE94C, 0x2E87, 0xEDCB, 0x2E87, 0xE4CD, 0x1E8A, 0xDBCF, 0x2E87, 0xE04E, 0x2E87, 0xE04E, 0x4E7F}; +const PROGMEM uint16_t home_e[] = {0xD705, 0x3885, 0xC775, 0x53FB, 0xCB59, 0x53FB, 0xCB59, 0x6F71, 0xD321, 0x6F71, 0xD321, 0x61B6, 0xDAE9, 0x61B6, 0xDAE9, 0x6F71, 0xE2B1, 0x6F71, 0xE2B1, 0x53FB, 0xE695, 0x53FB, 0xE092, 0x495F, 0xE092, 0x3C0E, 0xDCAE, 0x3C0E, 0xDCAE, 0x4281}; +const PROGMEM uint16_t fine_label[] = {0x0D92, 0x9444, 0x5211, 0x9444, 0x5211, 0xA9EA, 0x0D92, 0xA9EA}; +const PROGMEM uint16_t fine_toggle[] = {0x56E7, 0x9444, 0x8007, 0x9444, 0x8007, 0xA9EA, 0x56E7, 0xA9EA}; +const PROGMEM uint16_t h1_temp[] = {0x9C2B, 0xDD3B, 0xBBDE, 0xDD3B, 0xBBDE, 0xFA57, 0x9C2B, 0xFA57}; +const PROGMEM uint16_t h1_label[] = {0x9C2B, 0xBE8F, 0xBBDC, 0xBE8F, 0xBBDC, 0xDBAA, 0x9C2B, 0xDBAA}; +const PROGMEM uint16_t h0_temp[] = {0x7BD0, 0xDD3B, 0x9B83, 0xDD3B, 0x9B83, 0xFA57, 0x7BD0, 0xFA57}; +const PROGMEM uint16_t h0_label[] = {0x7BD0, 0xBE8F, 0x9B83, 0xBE8F, 0x9B83, 0xDBAA, 0x7BD0, 0xDBAA}; +const PROGMEM uint16_t h2_temp[] = {0xBC86, 0xDD3B, 0xDC39, 0xDD3B, 0xDC39, 0xFA57, 0xBC86, 0xFA57}; +const PROGMEM uint16_t h2_label[] = {0xBC86, 0xBE8F, 0xDC37, 0xBE8F, 0xDC37, 0xDBAA, 0xBC86, 0xDBAA}; +const PROGMEM uint16_t h3_temp[] = {0xDCE2, 0xDD0D, 0xFC95, 0xDD0D, 0xFC95, 0xFA28, 0xDCE2, 0xFA28}; +const PROGMEM uint16_t h3_label[] = {0xDCE2, 0xBE60, 0xFC92, 0xBE60, 0xFC92, 0xDB7C, 0xDCE2, 0xDB7C}; +const PROGMEM uint16_t actual_temp[] = {0xCDF6, 0xD037, 0xF7CA, 0xD037, 0xF7CA, 0xF424, 0xCDF6, 0xF424}; +const PROGMEM uint16_t bed_icon[] = {0xCDF6, 0xA5CC, 0xF7CA, 0xA5CC, 0xF7CA, 0xC9B9, 0xCDF6, 0xC9B9}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h new file mode 100644 index 000000000000..32f52f8e4660 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h @@ -0,0 +1,52 @@ + +/**************************************************************************** + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/** + * This file was auto-generated using "svg2cpp.py" + * + * The encoding consists of x,y pairs with the min and max scaled to + * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the + * start of a new closed path. + */ + +#pragma once + +constexpr float x_min = 0.000000; +constexpr float x_max = 272.000000; +constexpr float y_min = 0.000000; +constexpr float y_max = 480.000000; + +const PROGMEM uint16_t z_neg[] = {0xC9B1, 0x96B3, 0xD990, 0x96B3, 0xD990, 0xA8D0, 0xE17F, 0xA8D0, 0xD1A0, 0xB1DF, 0xC1C2, 0xA8D0, 0xC9B1, 0xA8D0, 0xC9B1, 0x96B3}; +const PROGMEM uint16_t z_pos[] = {0xC9B1, 0x8DA4, 0xD990, 0x8DA4, 0xD990, 0x7B86, 0xE17F, 0x7B86, 0xD1A0, 0x7277, 0xC1C2, 0x7B86, 0xC9B1, 0x7B86, 0xC9B1, 0x8DA4}; +const PROGMEM uint16_t y_neg[] = {0x5037, 0x9979, 0x6264, 0x9979, 0x5529, 0xA92A, 0x5E3F, 0xA92A, 0x4575, 0xB103, 0x39E6, 0xA92A, 0x42FC, 0xA92A, 0x5037, 0x9979}; +const PROGMEM uint16_t y_pos[] = {0x5D72, 0x89C7, 0x6F9F, 0x89C7, 0x7CDA, 0x7A15, 0x85F0, 0x7A15, 0x7A61, 0x723D, 0x6197, 0x7A15, 0x6AAD, 0x7A15, 0x5D72, 0x89C7}; +const PROGMEM uint16_t x_neg[] = {0x513D, 0x8DB3, 0x4AA0, 0x958C, 0x2647, 0x958C, 0x22F8, 0x9979, 0x1769, 0x91A0, 0x3033, 0x89C7, 0x2CE4, 0x8DB3, 0x513D, 0x8DB3}; +const PROGMEM uint16_t x_pos[] = {0x7566, 0x8DB3, 0x6EC9, 0x958C, 0x9322, 0x958C, 0x8FD4, 0x9979, 0xA89E, 0x91A0, 0x9D0E, 0x89C7, 0x99C0, 0x8DB3, 0x7566, 0x8DB3}; +const PROGMEM uint16_t syringe_fluid[] = {0x7D1D, 0x4A0F, 0x87FC, 0x4C0E, 0x8CF4, 0x4C0E, 0x9801, 0x4A0F, 0x9801, 0x1AA2, 0x7D1D, 0x1AA2, 0x7D1D, 0x4A0F}; +const PROGMEM uint16_t syringe[] = {0x83C2, 0x42AA, 0x83C2, 0x43FF, 0x8D2C, 0x43FF, 0x8D2C, 0x42AA, 0xFFFF, 0x83C2, 0x3D54, 0x83C2, 0x3EAA, 0x8D2C, 0x3EAA, 0x8D2C, 0x3D54, 0xFFFF, 0x83C2, 0x37FF, 0x83C2, 0x3954, 0x8D2C, 0x3954, 0x8D2C, 0x37FF, 0xFFFF, 0x83C2, 0x32AA, 0x83C2, 0x33FF, 0x8D2C, 0x33FF, 0x8D2C, 0x32AA, 0xFFFF, 0x83C2, 0x2D54, 0x83C2, 0x2EAA, 0x8D2C, 0x2EAA, 0x8D2C, 0x2D54, 0xFFFF, 0x83C2, 0x27FF, 0x83C2, 0x2955, 0x8D2C, 0x2955, 0x8D2C, 0x27FF, 0xFFFF, 0x83C2, 0x22AA, 0x83C2, 0x23FF, 0x8D2C, 0x23FF, 0x8D2C, 0x22AA, 0xFFFF, 0x7AC7, 0x0F4B, 0x7AC7, 0x134A, 0x855B, 0x134A, 0x855B, 0x1949, 0x7AC7, 0x1949, 0x7AC7, 0x4B40, 0x855B, 0x4D40, 0x855B, 0x533F, 0x88E2, 0x533F, 0x88E2, 0x653C, 0x8C69, 0x673C, 0x8C69, 0x533F, 0x8FF0, 0x533F, 0x8FF0, 0x4D40, 0x9A85, 0x4B40, 0x9A85, 0x1949, 0x8FF0, 0x1949, 0x8FF0, 0x134A, 0x9A85, 0x134A, 0x9A85, 0x0F4B, 0xFFFF, 0x88E2, 0x134A, 0x8C69, 0x134A, 0x8C69, 0x1949, 0x88E2, 0x1949, 0x88E2, 0x134A, 0xFFFF, 0x7E4D, 0x1B49, 0x96FE, 0x1B49, 0x96FE, 0x4941, 0x8C69, 0x4B40, 0x88E2, 0x4B40, 0x7E4D, 0x4941, 0x7E4D, 0x1B49}; +const PROGMEM uint16_t syringe_outline[] = {0x7AC7, 0x0F4B, 0x7AC7, 0x134A, 0x855B, 0x134A, 0x855B, 0x1949, 0x7AC7, 0x1949, 0x7AC7, 0x4B40, 0x855B, 0x4D40, 0x855B, 0x533F, 0x88E2, 0x533F, 0x88E2, 0x653C, 0x8C69, 0x673C, 0x8C69, 0x533F, 0x8FF0, 0x533F, 0x8FF0, 0x4D40, 0x9A85, 0x4B40, 0x9A85, 0x1949, 0x8FF0, 0x1949, 0x8FF0, 0x134A, 0x9A85, 0x134A, 0x9A85, 0x0F4B, 0x7AC7, 0x0F4B}; +const PROGMEM uint16_t padlock[] = {0x645A, 0x8017, 0x5F9E, 0x80A1, 0x5BBA, 0x821B, 0x5911, 0x844A, 0x580A, 0x86F7, 0x580A, 0x8931, 0x5970, 0x8A98, 0x5C49, 0x8A98, 0x5DB0, 0x8931, 0x5DB0, 0x8703, 0x5E3C, 0x858E, 0x5FAA, 0x845F, 0x61C5, 0x8394, 0x645A, 0x834A, 0x66F0, 0x8394, 0x690C, 0x845F, 0x6A7A, 0x858D, 0x6B07, 0x8703, 0x6B07, 0x8F23, 0x57C8, 0x8F23, 0x551E, 0x8FC3, 0x5404, 0x9145, 0x5404, 0x9C8F, 0x551E, 0x9E11, 0x57C8, 0x9EB1, 0x70EE, 0x9EB1, 0x7398, 0x9E11, 0x74B2, 0x9C8F, 0x74B2, 0x9145, 0x7398, 0x8FC3, 0x70EE, 0x8F23, 0x70AC, 0x86FA, 0x6FA5, 0x844A, 0x6CFD, 0x821B, 0x6917, 0x80A1}; +const PROGMEM uint16_t home_z[] = {0xD6C9, 0x80CC, 0xBB53, 0x905B, 0xC231, 0x905B, 0xC231, 0x9FEB, 0xCFEC, 0x9FEB, 0xCFEC, 0x9823, 0xDDA7, 0x9823, 0xDDA7, 0x9FEB, 0xEB62, 0x9FEB, 0xEB62, 0x905B, 0xF240, 0x905B, 0xE7A3, 0x8A58, 0xE7A3, 0x82CD, 0xE0C6, 0x82CD, 0xE0C6, 0x8674}; +const PROGMEM uint16_t home_e[] = {0xB94F, 0x25AA, 0x9DD8, 0x353A, 0xA4B6, 0x353A, 0xA4B6, 0x44C9, 0xB271, 0x44C9, 0xB271, 0x3D02, 0xC02C, 0x3D02, 0xC02C, 0x44C9, 0xCDE7, 0x44C9, 0xCDE7, 0x353A, 0xD4C5, 0x353A, 0xCA28, 0x2F36, 0xCA28, 0x27AB, 0xC34B, 0x27AB, 0xC34B, 0x2B53}; +const PROGMEM uint16_t bed_icon[] = {0x1764, 0x2C4C, 0x6135, 0x2C4C, 0x6135, 0x40A8, 0x1764, 0x40A8}; +const PROGMEM uint16_t actual_temp[] = {0x1764, 0x466F, 0x6135, 0x466F, 0x6135, 0x5ACB, 0x1764, 0x5ACB}; +const PROGMEM uint16_t target_temp[] = {0x1764, 0x1228, 0x6135, 0x1228, 0x6135, 0x2684, 0x1764, 0x2684}; +const PROGMEM uint16_t fine_label[] = {0x1AA7, 0xC6D2, 0x9387, 0xC6D2, 0x9387, 0xD316, 0x1AA7, 0xD316}; +const PROGMEM uint16_t fine_toggle[] = {0x9C10, 0xC6D2, 0xE4A3, 0xC6D2, 0xE4A3, 0xD316, 0x9C10, 0xD316}; +const PROGMEM uint16_t usb_btn[] = {0x0B68, 0xE880, 0x7B1A, 0xE880, 0x7B1A, 0xF94B, 0x0B68, 0xF94B, 0x0B68, 0xE880}; +const PROGMEM uint16_t menu_btn[] = {0x84E3, 0xE880, 0xF495, 0xE880, 0xF495, 0xF94B, 0x84E3, 0xF94B, 0x84E3, 0xE880}; +const PROGMEM uint16_t e_pos[] = {0xC9B1, 0x3B2D, 0xD990, 0x3B2D, 0xD990, 0x4D4B, 0xE17F, 0x4D4B, 0xD1A0, 0x565A, 0xC1C2, 0x4D4B, 0xC9B1, 0x4D4B, 0xC9B1, 0x3B2D}; +const PROGMEM uint16_t e_neg[] = {0xC9B1, 0x321E, 0xD990, 0x321E, 0xD990, 0x2000, 0xE17F, 0x2000, 0xD1A0, 0x16F1, 0xC1C2, 0x2000, 0xC9B1, 0x2000, 0xC9B1, 0x321E}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp new file mode 100644 index 000000000000..40130650867e --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp @@ -0,0 +1,157 @@ +/******************************* + * bio_printing_dialog_box.cpp * + *******************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +#include "../ftdi_eve_lib/extras/circular_progress.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define GRID_COLS 2 +#define GRID_ROWS 9 + +void BioPrintingDialogBox::draw_status_message(draw_mode_t what, const char* message) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + draw_text_box(cmd, BTN_POS(1,2), BTN_SIZE(2,2), message, OPT_CENTER, font_large); + } +} + +void BioPrintingDialogBox::draw_progress(draw_mode_t what) { + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.font(font_large) + .text(BTN_POS(1,1), BTN_SIZE(2,2), isPrinting() ? F("Printing...") : F("Finished.")) + .tag(1) + .font(font_xlarge); + + draw_circular_progress(cmd, BTN_POS(1,4), BTN_SIZE(2,3), getProgress_percent(), theme_dark, theme_darkest); + } +} + +void BioPrintingDialogBox::draw_time_remaining(draw_mode_t what) { + if (what & FOREGROUND) { + const uint32_t elapsed = getProgress_seconds_elapsed(); + const uint8_t hrs = elapsed/3600; + const uint8_t min = (elapsed/60)%60; + + char time_str[10]; + sprintf_P(time_str, PSTR("%02dh %02dm"), hrs, min); + + CommandProcessor cmd; + cmd.font(font_large) + .text(BTN_POS(1,7), BTN_SIZE(2,2), time_str); + } +} + +void BioPrintingDialogBox::draw_interaction_buttons(draw_mode_t what) { + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(font_medium) + .colors(isPrinting() ? action_btn : normal_btn) + .tag(2).button(BTN_POS(1,9), BTN_SIZE(1,1), F("Menu")) + #if ENABLED(SDSUPPORT) + .enabled(isPrinting() ? isPrintingFromMedia() : 1) + #else + .enabled(isPrinting() ? 0 : 1) + #endif + .tag(3) + .colors(isPrinting() ? normal_btn : action_btn) + .button( BTN_POS(2,9), BTN_SIZE(1,1), isPrinting() ? F("Cancel") : F("Back")); + } +} + +void BioPrintingDialogBox::onRedraw(draw_mode_t what) { + if (what & FOREGROUND) { + draw_progress(FOREGROUND); + draw_time_remaining(FOREGROUND); + draw_interaction_buttons(FOREGROUND); + } +} + +bool BioPrintingDialogBox::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_SCREEN(FeedratePercentScreen); break; + case 2: GOTO_SCREEN(TuneMenu); break; + case 3: + if (isPrinting()) { + GOTO_SCREEN(ConfirmAbortPrintDialogBox); + } else { + GOTO_SCREEN(StatusScreen); + } + break; + default: return false; + } + return true; +} + +void BioPrintingDialogBox::setStatusMessage(progmem_str message) { + char buff[strlen_P((const char*)message)+1]; + strcpy_P(buff, (const char*) message); + setStatusMessage(buff); +} + +void BioPrintingDialogBox::setStatusMessage(const char* message) { + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)); + + draw_status_message(BACKGROUND, message); + draw_progress(BACKGROUND); + draw_time_remaining(BACKGROUND); + draw_interaction_buttons(BACKGROUND); + storeBackground(); + + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("New status message: ", message); + #endif + + if (AT_SCREEN(BioPrintingDialogBox)) { + current_screen.onRefresh(); + } +} + +void BioPrintingDialogBox::onIdle() { + reset_menu_timeout(); + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + onRefresh(); + refresh_timer.start(); + } + BaseScreen::onIdle(); +} + +void BioPrintingDialogBox::show() { + GOTO_SCREEN(BioPrintingDialogBox); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp new file mode 100644 index 000000000000..ec7f2bcffb47 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp @@ -0,0 +1,467 @@ +/************************* + * bio_status_screen.cpp * + *************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS) + +#include "screens.h" + +#include "../ftdi_eve_lib/extras/poly_ui.h" + +#ifdef TOUCH_UI_PORTRAIT + #include "bio_printer_ui_portrait.h" +#else + #include "bio_printer_ui_landscape.h" +#endif + +#define GRID_COLS 2 +#define GRID_ROWS 9 + +#define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) + +const uint8_t shadow_depth = 5; +const float max_speed = 1.00; +const float min_speed = 0.02; +const float emax_speed = 2.00; +const float emin_speed = 0.70; + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +float StatusScreen::increment; +bool StatusScreen::jog_xy; +bool StatusScreen::fine_motion; + +void StatusScreen::unlockMotors() { + injectCommands_P(PSTR("M84 XY")); + jog_xy = false; +} + +void StatusScreen::draw_temperature(draw_mode_t what) { + CommandProcessor cmd; + PolyUI ui(cmd, what); + + int16_t x, y, h, v; + + cmd.tag(15); + + if (what & BACKGROUND) { + cmd.cmd(COLOR_RGB(bg_color)); + + #if ENABLED(TOUCH_UI_LULZBOT_BIO) + // The LulzBot Bio shows the temperature for + // the bed. + + #ifdef TOUCH_UI_PORTRAIT + // Draw touch surfaces + ui.bounds(POLY(target_temp), x, y, h, v); + cmd.rectangle(x, y, h, v); + ui.bounds(POLY(actual_temp), x, y, h, v); + cmd.rectangle(x, y, h, v); + #else + ui.bounds(POLY(bed_temp), x, y, h, v); + cmd.rectangle(x, y, h, v); + #endif + ui.bounds(POLY(bed_icon), x, y, h, v); + cmd.rectangle(x, y, h, v); + + // Draw bed icon + cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info)) + .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info)) + .cmd(BITMAP_SIZE (Bed_Heat_Icon_Info)) + .cmd(COLOR_RGB(shadow_rgb)) + .icon (x + 2, y + 2, h, v, Bed_Heat_Icon_Info, icon_scale * 2) + .cmd(COLOR_RGB(bg_text_enabled)) + .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2); + #elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT) + // The CocoaPress shows the temperature for two + // heating zones, but has no bed temperature + + cmd.cmd(COLOR_RGB(bg_text_enabled)); + cmd.font(font_medium); + + ui.bounds(POLY(h0_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_1)); + + ui.bounds(POLY(h1_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_2)); + + ui.bounds(POLY(h2_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_3)); + + ui.bounds(POLY(h3_label), x, y, h, v); + cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER)); + #else + UNUSED(x); + UNUSED(y); + UNUSED(h); + UNUSED(v); + #endif + + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); // Restore font bitmap handles + #endif + } + + if (what & FOREGROUND) { + char str[15]; + cmd.cmd(COLOR_RGB(bg_text_enabled)); + #if ENABLED(TOUCH_UI_LULZBOT_BIO) + cmd.font(font_medium); + + #ifdef TOUCH_UI_PORTRAIT + if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) + format_temp(str, getTargetTemp_celsius(BED)); + else + strcpy_P(str, GET_TEXT(MSG_BED)); + + ui.bounds(POLY(target_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + + format_temp(str, getActualTemp_celsius(BED)); + ui.bounds(POLY(actual_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + #else + if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) + format_temp_and_temp(str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED)); + else + format_temp_and_idle(str, getActualTemp_celsius(BED)); + + ui.bounds(POLY(bed_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + #endif + + #elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT) + // The CocoaPress shows the temperature for two + // heating zones, but has no bed temperature + + cmd.font(font_large); + + if (!isHeaterIdle(E0) && getTargetTemp_celsius(E0) > 0) + format_temp_and_temp(str, getActualTemp_celsius(E0), getTargetTemp_celsius(E0)); + else + format_temp_and_idle(str, getActualTemp_celsius(E0)); + + ui.bounds(POLY(h0_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + + if (!isHeaterIdle(E1) && getTargetTemp_celsius(E1) > 0) + format_temp_and_temp(str, getActualTemp_celsius(E1), getTargetTemp_celsius(E1)); + else + format_temp_and_idle(str, getActualTemp_celsius(E1)); + + ui.bounds(POLY(h1_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + + if (!isHeaterIdle(E2) && getTargetTemp_celsius(E2) > 0) + format_temp_and_temp(str, getActualTemp_celsius(E2), getTargetTemp_celsius(E2)); + else + format_temp_and_idle(str, getActualTemp_celsius(E2)); + + ui.bounds(POLY(h2_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + + if (!isHeaterIdle(CHAMBER) && getTargetTemp_celsius(CHAMBER) > 0) + format_temp_and_temp(str, getActualTemp_celsius(CHAMBER), getTargetTemp_celsius(CHAMBER)); + else + format_temp_and_idle(str, getActualTemp_celsius(CHAMBER)); + + ui.bounds(POLY(h3_temp), x, y, h, v); + cmd.text(x, y, h, v, str); + #else + UNUSED(str); + #endif + } +} + +void StatusScreen::draw_syringe(draw_mode_t what) { + int16_t x, y, h, v; + #ifdef E_MAX_POS + const float fill_level = 1.0 - min(1.0, max(0.0, getAxisPosition_mm(E0) / E_MAX_POS)); + #else + const float fill_level = 0.75; + #endif + const bool e_homed = (true + #if ENABLED(TOUCH_UI_LULZBOT_BIO) + && isAxisPositionKnown(E0) + #endif + ); + + CommandProcessor cmd; + PolyUI ui(cmd, what); + + if (what & BACKGROUND) { + // Paint the shadow for the syringe + ui.color(shadow_rgb); + ui.shadow(POLY(syringe_outline), shadow_depth); + } + + if (what & FOREGROUND && e_homed) { + // Paint the syringe icon + ui.color(syringe_rgb); + ui.fill(POLY(syringe_outline)); + + ui.color(fill_rgb); + ui.bounds(POLY(syringe_fluid), x, y, h, v); + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(SCISSOR_XY(x,y + v * (1.0 - fill_level))); + cmd.cmd(SCISSOR_SIZE(h, v * fill_level)); + ui.fill(POLY(syringe_fluid), false); + cmd.cmd(RESTORE_CONTEXT()); + + ui.color(stroke_rgb); + ui.fill(POLY(syringe)); + } +} + +void StatusScreen::draw_arrows(draw_mode_t what) { + const bool e_homed = (true + #if ENABLED(TOUCH_UI_LULZBOT_BIO) + && isAxisPositionKnown(E0) + #endif + ); + const bool z_homed = isAxisPositionKnown(Z); + + CommandProcessor cmd; + PolyUI ui(cmd, what); + + ui.button_fill (fill_rgb); + ui.button_stroke(stroke_rgb, 28); + ui.button_shadow(shadow_rgb, shadow_depth); + + if ((what & BACKGROUND) || jog_xy) { + ui.button(1, POLY(x_neg)); + ui.button(2, POLY(x_pos)); + ui.button(3, POLY(y_neg)); + ui.button(4, POLY(y_pos)); + } + + if ((what & BACKGROUND) || z_homed) { + ui.button(5, POLY(z_neg)); + ui.button(6, POLY(z_pos)); + } + + if ((what & BACKGROUND) || e_homed) { + #if DISABLED(TOUCH_UI_COCOA_PRESS) + ui.button(7, POLY(e_neg)); + #endif + ui.button(8, POLY(e_pos)); + } +} + +void StatusScreen::draw_fine_motion(draw_mode_t what) { + int16_t x, y, h, v; + CommandProcessor cmd; + PolyUI ui(cmd, what); + + cmd.font( + #ifdef TOUCH_UI_PORTRAIT + font_medium + #else + font_small + #endif + ) + .tag(16); + + if (what & BACKGROUND) { + ui.bounds(POLY(fine_label), x, y, h, v); + cmd.cmd(COLOR_RGB(bg_text_enabled)) + .text(x, y, h, v, GET_TEXT_F(MSG_FINE_MOTION)); + } + + if (what & FOREGROUND) { + ui.bounds(POLY(fine_toggle), x, y, h, v); + cmd.colors(ui_toggle) + .toggle2(x, y, h, v, GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), fine_motion); + } +} + +void StatusScreen::draw_overlay_icons(draw_mode_t what) { + const bool e_homed = (true + #if ENABLED(TOUCH_UI_LULZBOT_BIO) + && isAxisPositionKnown(E0) + #endif + ); + const bool z_homed = isAxisPositionKnown(Z); + + CommandProcessor cmd; + PolyUI ui(cmd, what); + + if (what & FOREGROUND) { + ui.button_fill (fill_rgb); + ui.button_stroke(stroke_rgb, 28); + ui.button_shadow(shadow_rgb, shadow_depth); + + if (!jog_xy) ui.button(12, POLY(padlock)); + if (!e_homed) ui.button(13, POLY(home_e)); + if (!z_homed) ui.button(14, POLY(home_z)); + } +} + +void StatusScreen::draw_buttons(draw_mode_t what) { + int16_t x, y, h, v; + + const bool has_media = isMediaInserted() && !isPrintingFromMedia(); + + CommandProcessor cmd; + PolyUI ui(cmd, what); + + ui.bounds(POLY(usb_btn), x, y, h, v); + cmd.font(font_medium) + .colors(normal_btn) + .enabled(has_media) + .colors(has_media ? action_btn : normal_btn) + .tag(9).button(x, y, h, v, + isPrintingFromMedia() ? + GET_TEXT_F(MSG_PRINTING) : + GET_TEXT_F(MSG_BUTTON_MEDIA) + ); + + ui.bounds(POLY(menu_btn), x, y, h, v); + cmd.colors(!has_media ? action_btn : normal_btn).tag(10).button(x, y, h, v, GET_TEXT_F(MSG_BUTTON_MENU)); +} + +void StatusScreen::loadBitmaps() { + // Load the bitmaps for the status screen + constexpr uint32_t base = ftdi_memory_map::RAM_G; + CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); + + // Load fonts for internationalization + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_data(base + UTF8_FONT_OFFSET); + #endif +} + +void StatusScreen::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0); + } + + draw_syringe(what); + draw_temperature(what); + draw_arrows(what); + draw_overlay_icons(what); + draw_buttons(what); + draw_fine_motion(what); +} + +bool StatusScreen::onTouchStart(uint8_t) { + increment = 0; + return true; +} + +bool StatusScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + case 2: + case 3: + case 4: + case 12: + if (!jog_xy) { + jog_xy = true; + injectCommands_P(PSTR("M17")); + } + jog({ 0, 0, 0 }); + break; + case 5: + case 6: + jog({ 0, 0, 0 }); + break; + case 9: GOTO_SCREEN(FilesScreen); break; + case 10: GOTO_SCREEN(MainMenu); break; + #if ENABLED(TOUCH_UI_LULZBOT_BIO) + case 13: GOTO_SCREEN(BioConfirmHomeE); break; + #endif + case 14: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break; + case 15: GOTO_SCREEN(TemperatureScreen); break; + case 16: fine_motion = !fine_motion; break; + default: return false; + } + // If a passcode is enabled, the LockScreen will prevent the + // user from proceeding. + LockScreen::check_passcode(); + return true; +} + +bool StatusScreen::onTouchHeld(uint8_t tag) { + if (tag >= 1 && tag <= 4 && !jog_xy) return false; + const float s = min_speed + (fine_motion ? 0 : (max_speed - min_speed) * sq(increment)); + switch (tag) { + case 1: jog({-s, 0, 0}); break; + case 2: jog({ s, 0, 0}); break; + case 4: jog({ 0, -s, 0}); break; // NOTE: Y directions inverted because bed rather than needle moves + case 3: jog({ 0, s, 0}); break; + case 5: jog({ 0, 0, -s}); break; + case 6: jog({ 0, 0, s}); break; + case 7: case 8: + { + if (ExtUI::isMoving()) return false; + const feedRate_t feedrate = emin_speed + (fine_motion ? 0 : (emax_speed - emin_speed) * sq(increment)); + const float increment = 0.25 * feedrate * (tag == 7 ? -1 : 1); + MoveAxisScreen::setManualFeedrate(E0, feedrate); + UI_INCREMENT(AxisPosition_mm, E0); + current_screen.onRefresh(); + break; + } + default: + return false; + } + increment = min(1.0f, increment + 0.1f); + return false; +} + +void StatusScreen::setStatusMessage(progmem_str pstr) { + #ifdef TOUCH_UI_LULZBOT_BIO + BioPrintingDialogBox::setStatusMessage(pstr); + #else + UNUSED(pstr); + #endif +} + +void StatusScreen::setStatusMessage(const char * const str) { + #ifdef TOUCH_UI_LULZBOT_BIO + BioPrintingDialogBox::setStatusMessage(str); + #else + UNUSED(str); + #endif +} + +void StatusScreen::onIdle() { + reset_menu_timeout(); + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + if (!EventLoop::is_touch_held()) + onRefresh(); + #ifdef TOUCH_UI_LULZBOT_BIO + if (isPrintingFromMedia()) + BioPrintingDialogBox::show(); + #endif + refresh_timer.start(); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp new file mode 100644 index 000000000000..27312c733fd7 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp @@ -0,0 +1,83 @@ +/********************* + * bio_tune_menu.cpp * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void TuneMenu::onRedraw(draw_mode_t what) { + #define GRID_ROWS 8 + #define GRID_COLS 2 + + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0) + .font(font_large) + .text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_MENU)); + } + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(font_medium) + .enabled( isPrinting()).tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_SPEED)) + .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE)) + .enabled( + #if ENABLED(BABYSTEPPING) + true + #endif + ) + .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_NUDGE_NOZZLE)) + .enabled(!isPrinting()).tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) + .enabled(!isPrinting()).tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER)) + .enabled(!isPrinting()).tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) + .colors(action_btn) .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + } + #undef GRID_COLS + #undef GRID_ROWS +} + +bool TuneMenu::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + case 2: GOTO_SCREEN(FeedratePercentScreen); break; + case 3: GOTO_SCREEN(TemperatureScreen); break; + case 4: GOTO_SCREEN(NudgeNozzleScreen); break; + case 5: GOTO_SCREEN(BioConfirmHomeXYZ); break; + case 6: SpinnerDialogBox::enqueueAndWait_P(F("G0 E0 F120")); break; + case 7: StatusScreen::unlockMotors(); break; + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp new file mode 100644 index 000000000000..996c12cf23fd --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp @@ -0,0 +1,127 @@ +/******************* + * boot_screen.cpp * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +#include "../ftdi_eve_lib/extras/poly_ui.h" +#include "../archim2-flash/flash_storage.h" + +#ifdef SHOW_CUSTOM_BOOTSCREEN + #ifdef TOUCH_UI_PORTRAIT + #include "../theme/_bootscreen_portrait.h" + #else + #include "../theme/_bootscreen_landscape.h" + #endif +#else + #ifdef TOUCH_UI_PORTRAIT + #include "../theme/marlin_bootscreen_portrait.h" + #else + #include "../theme/marlin_bootscreen_landscape.h" + #endif +#endif + +using namespace FTDI; +using namespace Theme; + +void BootScreen::onRedraw(draw_mode_t) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(0x000000)); + cmd.cmd(CLEAR(true,true,true)); + + CLCD::turn_on_backlight(); + SoundPlayer::set_volume(255); +} + +void BootScreen::onIdle() { + if (CLCD::is_touching()) { + // If the user is touching the screen at startup, then + // assume the user wants to re-calibrate the screen. + // This gives the user the ability to recover a + // miscalibration that has been stored to EEPROM. + + // Also reset display parameters to defaults, just + // in case the display is borked. + InterfaceSettingsScreen::failSafeSettings(); + + StatusScreen::loadBitmaps(); + GOTO_SCREEN(TouchCalibrationScreen); + current_screen.forget(); + PUSH_SCREEN(StatusScreen); + StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG)); + } else { + if (!UIFlashStorage::is_valid()) { + StatusScreen::loadBitmaps(); + SpinnerDialogBox::show(GET_TEXT_F(MSG_PLEASE_WAIT)); + UIFlashStorage::format_flash(); + SpinnerDialogBox::hide(); + } + + if (UIData::animations_enabled()) { + // If there is a startup video in the flash SPI, play + // that, otherwise show a static splash screen. + if (!MediaPlayerScreen::playBootMedia()) + showSplashScreen(); + } + + StatusScreen::loadBitmaps(); + + #ifdef TOUCH_UI_LULZBOT_BIO + GOTO_SCREEN(BioConfirmHomeXYZ); + current_screen.forget(); + PUSH_SCREEN(StatusScreen); + PUSH_SCREEN(BioConfirmHomeE); + #elif NUM_LANGUAGES > 1 + StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG)); + GOTO_SCREEN(LanguageMenu); + #else + StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG)); + GOTO_SCREEN(StatusScreen); + #endif + } +} + +void BootScreen::showSplashScreen() { + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART); + cmd.cmd(CLEAR_COLOR_RGB(LOGO_BACKGROUND)); + cmd.cmd(CLEAR(true,true,true)); + + #define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) + #define LOGO_PAINT_PATH(rgb, path) cmd.cmd(COLOR_RGB(rgb)); ui.fill(POLY(path)); + + PolyUI ui(cmd); + + LOGO_PAINT_PATHS + + cmd.cmd(DL::DL_DISPLAY); + cmd.cmd(CMD_SWAP); + cmd.execute(); + + ExtUI::delay_ms(2500); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp new file mode 100644 index 000000000000..b82149c85959 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp @@ -0,0 +1,62 @@ +/************************* + * case_light_screen.cpp * + *************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, CASE_LIGHT_ENABLE) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void CaseLightScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.heading( GET_TEXT_F(MSG_CASE_LIGHT)); + w.toggle( 2, GET_TEXT_F(MSG_LEDS), getCaseLightState()); + #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT)) + .adjuster(10, GET_TEXT_F(MSG_CASE_LIGHT_BRIGHTNESS), getCaseLightBrightness_percent()); + w.precision(0).increments(); + #endif +} + +bool CaseLightScreen::onTouchHeld(uint8_t tag) { + using namespace ExtUI; + #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + const float increment = getIncrement(); + #endif + switch (tag) { + case 2: setCaseLightState(!getCaseLightState()); break; + #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + case 10: UI_DECREMENT(CaseLightBrightness_percent); break; + case 11: UI_INCREMENT(CaseLightBrightness_percent); break; + #endif + default: + return false; + } + + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp new file mode 100644 index 000000000000..2d1e0d66272f --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp @@ -0,0 +1,353 @@ +/****************************** + * change_filament_screen.cpp * + ******************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace ExtUI; +using namespace FTDI; +using namespace Theme; + +#define COOL_TEMP 40 +#define LOW_TEMP 180 +#define MED_TEMP 200 +#define HIGH_TEMP 220 + +/****************** COLOR SCALE ***********************/ + +uint32_t getWarmColor(uint16_t temp, uint16_t cool, uint16_t low, uint16_t med, uint16_t high) { + rgb_t R0, R1, mix; + + float t; + if (temp < cool) { + R0 = cool_rgb; + R1 = low_rgb; + t = 0; + } + else if (temp < low) { + R0 = cool_rgb; + R1 = low_rgb; + t = (float(temp)-cool)/(low-cool); + } + else if (temp < med) { + R0 = low_rgb; + R1 = med_rgb; + t = (float(temp)-low)/(med-low); + } + else if (temp < high) { + R0 = med_rgb; + R1 = high_rgb; + t = (float(temp)-med)/(high-med); + } + else if (temp >= high) { + R0 = med_rgb; + R1 = high_rgb; + t = 1; + } + rgb_t::lerp(t, R0, R1, mix); + return mix; +} + +void ChangeFilamentScreen::drawTempGradient(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { + CommandProcessor cmd; + cmd.cmd(SCISSOR_XY (x, y)) + .cmd(SCISSOR_SIZE (w, h/2)) + .gradient (x, y, high_rgb, x, y+h/2, med_rgb) + .cmd(SCISSOR_XY (x, y+h/2)) + .cmd(SCISSOR_SIZE (w, h/2)) + .gradient (x, y+h/2, med_rgb, x, y+h, low_rgb) + .cmd(SCISSOR_XY ()) + .cmd(SCISSOR_SIZE ()); +} + +void ChangeFilamentScreen::onEntry() { + screen_data.ChangeFilamentScreen.e_tag = ExtUI::getActiveTool() + 10; + screen_data.ChangeFilamentScreen.t_tag = 0; + screen_data.ChangeFilamentScreen.repeat_tag = 0; + screen_data.ChangeFilamentScreen.saved_extruder = getActiveTool(); + #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 + screen_data.ChangeFilamentScreen.need_purge = true; + #endif +} + +void ChangeFilamentScreen::onExit() { + setActiveTool(screen_data.ChangeFilamentScreen.saved_extruder, true); +} + +void ChangeFilamentScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + #ifdef TOUCH_UI_PORTRAIT + #define GRID_COLS 2 + #define GRID_ROWS 11 + #else + #define GRID_COLS 4 + #define GRID_ROWS 6 + #endif + + if (what & BACKGROUND) { + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0) + #ifdef TOUCH_UI_PORTRAIT + .font(font_large) + #else + .font(font_medium) + #endif + .text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_EXTRUDER_SELECTION)) + #ifdef TOUCH_UI_PORTRAIT + .text(BTN_POS(1,7), BTN_SIZE(1,1), F("")) + #else + .text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_CURRENT_TEMPERATURE)) + .font(font_small) + #endif + .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_REMOVAL_TEMPERATURE)); + drawTempGradient(BTN_POS(1,4), BTN_SIZE(1,3)); + } + + if (what & FOREGROUND) { + const extruder_t e = getExtruder(); + + char e_str[15]; + if (isHeaterIdle(e)) + format_temp_and_idle(e_str, getActualTemp_celsius(e)); + else + format_temp_and_temp(e_str, getActualTemp_celsius(e), getTargetTemp_celsius(e)); + + const rgb_t tcol = getWarmColor(getActualTemp_celsius(e), COOL_TEMP, LOW_TEMP, MED_TEMP, HIGH_TEMP); + cmd.cmd(COLOR_RGB(tcol)) + .tag(15) + #ifdef TOUCH_UI_PORTRAIT + .rectangle(BTN_POS(2,7), BTN_SIZE(1,1)) + #else + .rectangle(BTN_POS(3,2), BTN_SIZE(2,1)) + #endif + .cmd(COLOR_RGB(tcol.luminance() > 128 ? 0x000000 : 0xFFFFFF)) + .font(font_medium) + #ifdef TOUCH_UI_PORTRAIT + .text(BTN_POS(2,7), BTN_SIZE(1,1), e_str) + #else + .text(BTN_POS(3,2), BTN_SIZE(2,1), e_str) + #endif + .colors(normal_btn); + + const bool t_ok = getActualTemp_celsius(e) > getSoftenTemp() - 10; + + if (screen_data.ChangeFilamentScreen.t_tag && !t_ok) { + cmd.text(BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_HEATING)); + } else if (getActualTemp_celsius(e) > 100) { + cmd.cmd(COLOR_RGB(0xFF0000)) + .text(BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_CAUTION)) + .colors(normal_btn) + .text(BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_HOT)); + } + + #define TOG_STYLE(A) colors(A ? action_btn : normal_btn) + + const bool tog2 = screen_data.ChangeFilamentScreen.t_tag == 2; + const bool tog3 = screen_data.ChangeFilamentScreen.t_tag == 3; + const bool tog4 = screen_data.ChangeFilamentScreen.t_tag == 4; + const bool tog10 = screen_data.ChangeFilamentScreen.e_tag == 10; + #if HOTENDS > 1 + const bool tog11 = screen_data.ChangeFilamentScreen.e_tag == 11; + #endif + + #ifdef TOUCH_UI_PORTRAIT + cmd.font(font_large) + #else + cmd.font(font_medium) + #endif + .TOG_STYLE(tog10) + .tag(10) .button (BTN_POS(1,2), BTN_SIZE(1,1), F("1")) + #if HOTENDS < 2 + .enabled(false) + #else + .TOG_STYLE(tog11) + #endif + .tag(11) .button (BTN_POS(2,2), BTN_SIZE(1,1), F("2")); + + if (!t_ok) reset_menu_timeout(); + + const bool tog7 = screen_data.ChangeFilamentScreen.repeat_tag == 7; + const bool tog8 = screen_data.ChangeFilamentScreen.repeat_tag == 8; + + + cmd.font( + #ifdef TOUCH_UI_PORTRAIT + font_large + #else + font_small + #endif + ); + + { + char str[30]; + + format_temp_and_material(str, LOW_TEMP, GET_TEXT(MSG_MATERIAL_PLA)); + cmd.tag(2) .TOG_STYLE(tog2) .button (BTN_POS(2,6), BTN_SIZE(1,1), str); + + format_temp_and_material(str, MED_TEMP, GET_TEXT(MSG_MATERIAL_ABS)); + cmd.tag(3) .TOG_STYLE(tog3) .button (BTN_POS(2,5), BTN_SIZE(1,1), str); + + format_temp_and_material(str, HIGH_TEMP, GET_TEXT(MSG_MATERIAL_HIGH_TEMP)); + cmd.tag(4) .TOG_STYLE(tog4) .button (BTN_POS(2,4), BTN_SIZE(1,1), str); + } + cmd.colors(normal_btn) + + // Add tags to color gradient + .cmd(COLOR_MASK(0,0,0,0)) + .tag(2) .rectangle(BTN_POS(1,6), BTN_SIZE(1,1)) + .tag(3) .rectangle(BTN_POS(1,5), BTN_SIZE(1,1)) + .tag(4) .rectangle(BTN_POS(1,4), BTN_SIZE(1,1)) + .cmd(COLOR_MASK(1,1,1,1)) + + .cmd(COLOR_RGB(t_ok ? bg_text_enabled : bg_text_disabled)) + #ifdef TOUCH_UI_PORTRAIT + .font(font_large) + .tag(0) .text (BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) + .text (BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) + .tag(5) .enabled(t_ok).button (BTN_POS(1,9), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) + .tag(6) .enabled(t_ok).button (BTN_POS(2,9), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) + .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(1,10), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) + .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(2,10), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) + .tag(1).colors(action_btn) .button (BTN_POS(1,11), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + #else + .font(font_small) + .tag(0) .text (BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_UNLOAD_FILAMENT)) + .text (BTN_POS(4,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_LOAD_FILAMENT)) + .tag(5) .enabled(t_ok).button (BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) + .tag(6) .enabled(t_ok).button (BTN_POS(4,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOMENTARY)) + .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) + .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(4,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_CONTINUOUS)) + .font(font_medium) + .tag(1).colors(action_btn) .button (BTN_POS(3,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + #endif + } + #undef GRID_COLS + #undef GRID_ROWS +} + +uint8_t ChangeFilamentScreen::getSoftenTemp() { + switch (screen_data.ChangeFilamentScreen.t_tag) { + case 2: return LOW_TEMP; + case 3: return MED_TEMP; + case 4: return HIGH_TEMP; + default: return EXTRUDE_MINTEMP; + } +} + +ExtUI::extruder_t ChangeFilamentScreen::getExtruder() { + switch (screen_data.ChangeFilamentScreen.e_tag) { + case 13: return ExtUI::E3; + case 12: return ExtUI::E2; + case 11: return ExtUI::E1; + default: return ExtUI::E0; + } +} + +void ChangeFilamentScreen::doPurge() { + #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 + constexpr float purge_distance_mm = FILAMENT_UNLOAD_PURGE_LENGTH; + if (screen_data.ChangeFilamentScreen.need_purge) { + screen_data.ChangeFilamentScreen.need_purge = false; + MoveAxisScreen::setManualFeedrate(getExtruder(), purge_distance_mm); + ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(getExtruder()) + purge_distance_mm, getExtruder()); + } + #endif +} + +bool ChangeFilamentScreen::onTouchStart(uint8_t tag) { + // Make the Momentary and Continuous buttons slightly more responsive + switch (tag) { + case 5: case 6: case 7: case 8: + #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 + if (tag == 5 || tag == 7) doPurge(); + #endif + return ChangeFilamentScreen::onTouchHeld(tag); + default: + return false; + } +} + +bool ChangeFilamentScreen::onTouchEnd(uint8_t tag) { + using namespace ExtUI; + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + case 2: + case 3: + case 4: + // Change temperature + screen_data.ChangeFilamentScreen.t_tag = tag; + setTargetTemp_celsius(getSoftenTemp(), getExtruder()); + break; + case 7: + screen_data.ChangeFilamentScreen.repeat_tag = (screen_data.ChangeFilamentScreen.repeat_tag == 7) ? 0 : 7; + break; + case 8: + screen_data.ChangeFilamentScreen.repeat_tag = (screen_data.ChangeFilamentScreen.repeat_tag == 8) ? 0 : 8; + break; + case 10: + case 11: + // Change extruder + screen_data.ChangeFilamentScreen.e_tag = tag; + screen_data.ChangeFilamentScreen.t_tag = 0; + screen_data.ChangeFilamentScreen.repeat_tag = 0; + #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 + screen_data.ChangeFilamentScreen.need_purge = true; + #endif + setActiveTool(getExtruder(), true); + break; + case 15: GOTO_SCREEN(TemperatureScreen); break; + } + return true; +} + +bool ChangeFilamentScreen::onTouchHeld(uint8_t tag) { + if (ExtUI::isMoving()) return false; // Don't allow moves to accumulate + constexpr float increment = 1; + #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis); + #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis); + switch (tag) { + case 5: case 7: UI_DECREMENT_AXIS(getExtruder()); break; + case 6: case 8: UI_INCREMENT_AXIS(getExtruder()); break; + default: return false; + } + #undef UI_DECREMENT_AXIS + #undef UI_INCREMENT_AXIS + return false; +} + +void ChangeFilamentScreen::onIdle() { + reset_menu_timeout(); + if (screen_data.ChangeFilamentScreen.repeat_tag) onTouchHeld(screen_data.ChangeFilamentScreen.repeat_tag); + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + onRefresh(); + refresh_timer.start(); + } + BaseScreen::onIdle(); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp new file mode 100644 index 000000000000..933894259e73 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp @@ -0,0 +1,47 @@ +/************************************** + * confirm_abort_print_dialog_box.cpp * + **************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace ExtUI; + +void ConfirmAbortPrintDialogBox::onRedraw(draw_mode_t) { + drawMessage(GET_TEXT_F(MSG_ABORT_WARNING)); + drawYesNoButtons(); +} + +bool ConfirmAbortPrintDialogBox::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + GOTO_PREVIOUS(); + stopPrint(); + return true; + default: + return DialogBoxBaseClass::onTouchEnd(tag); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp new file mode 100644 index 000000000000..deae90fe9307 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp @@ -0,0 +1,48 @@ +/******************************************* + * confirm_auto_calibration_dialog_box.cpp * + *******************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, CALIBRATION_GCODE) + +#include "screens.h" + +using namespace ExtUI; +using namespace Theme; + +void ConfirmAutoCalibrationDialogBox::onRedraw(draw_mode_t) { + drawMessage(GET_TEXT_F(MSG_CALIBRATION_WARNING)); + drawYesNoButtons(); +} + +bool ConfirmAutoCalibrationDialogBox::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + GOTO_SCREEN(StatusScreen); + injectCommands_P(PSTR(CALIBRATION_COMMANDS)); + return true; + default: + return DialogBoxBaseClass::onTouchEnd(tag); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp new file mode 100644 index 000000000000..1e16546003bb --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp @@ -0,0 +1,54 @@ +/************************************** + * confirm_erase_flash_dialog_box.cpp * + **************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) + +#include "screens.h" + +#include "../archim2-flash/flash_storage.h" + +using namespace FTDI; + +void ConfirmEraseFlashDialogBox::onRedraw(draw_mode_t) { + drawMessage(GET_TEXT_F(MSG_ERASE_FLASH_WARNING)); + drawYesNoButtons(); +} + +bool ConfirmEraseFlashDialogBox::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + SpinnerDialogBox::show(GET_TEXT_F(MSG_ERASING)); + UIFlashStorage::format_flash(); + SpinnerDialogBox::hide(); + AlertDialogBox::show(GET_TEXT_F(MSG_ERASED)); + // Remove ConfirmEraseFlashDialogBox from the stack + // so the alert box doesn't return to me. + current_screen.forget(); + return true; + default: + return DialogBoxBaseClass::onTouchEnd(tag); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp new file mode 100644 index 000000000000..5c691cb9a1d0 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp @@ -0,0 +1,70 @@ +/************************************** + * confirm_start_print_dialog_box.cpp * + **************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void ConfirmStartPrintDialogBox::onEntry() { + BaseScreen::onEntry(); + sound.play(twinkle, PLAY_ASYNCHRONOUS); +} + +void ConfirmStartPrintDialogBox::onRedraw(draw_mode_t) { + const char *filename = getLongFilename(); + char buffer[strlen_P(GET_TEXT(MSG_START_PRINT_CONFIRMATION)) + strlen(filename) + 1]; + sprintf_P(buffer, GET_TEXT(MSG_START_PRINT_CONFIRMATION), filename); + drawMessage((const char *)buffer); + drawYesNoButtons(1); +} + +bool ConfirmStartPrintDialogBox::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + printFile(getShortFilename()); + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PRINT_STARTING)); + GOTO_SCREEN(StatusScreen); + return true; + case 2: GOTO_PREVIOUS(); return true; + default: return false; + } +} + +const char *ConfirmStartPrintDialogBox::getFilename(bool longName) { + FileList files; + files.seek(screen_data.ConfirmStartPrintDialogBox.file_index, true); + return longName ? files.longFilename() : files.shortFilename(); +} + +void ConfirmStartPrintDialogBox::show(uint8_t file_index) { + screen_data.ConfirmStartPrintDialogBox.file_index = file_index; + GOTO_SCREEN(ConfirmStartPrintDialogBox); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp new file mode 100644 index 000000000000..cc132064ecae --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp @@ -0,0 +1,58 @@ +/************************************** + * confirm_user_request_alert_box.cpp * + **************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; + +void ConfirmUserRequestAlertBox::onRedraw(draw_mode_t mode) { + AlertDialogBox::onRedraw(mode); // Required for the GOTO_SCREEN function to work +} + +bool ConfirmUserRequestAlertBox::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + ExtUI::setUserConfirmed(); + GOTO_PREVIOUS(); + return true; + case 2: GOTO_PREVIOUS(); return true; + default: return false; + } +} + +void ConfirmUserRequestAlertBox::show(const char* msg) { + drawMessage(msg); + storeBackground(); + screen_data.AlertDialogBox.isError = false; + GOTO_SCREEN(ConfirmUserRequestAlertBox); +} + +void ConfirmUserRequestAlertBox::hide() { + if (AT_SCREEN(ConfirmUserRequestAlertBox)) + GOTO_PREVIOUS(); +} +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp new file mode 100644 index 000000000000..21be095f963e --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp @@ -0,0 +1,63 @@ +/*********************************** + * default_acceleration_screen.cpp * + ***********************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void DefaultAccelerationScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(0); + w.units(GET_TEXT_F(MSG_UNITS_MM_S2)); + w.heading( GET_TEXT_F(MSG_ACCELERATION)); + w.color(other); + w.adjuster( 2, GET_TEXT_F(MSG_ACCEL_PRINTING), getPrintingAcceleration_mm_s2() ); + w.adjuster( 4, GET_TEXT_F(MSG_ACCEL_TRAVEL), getTravelAcceleration_mm_s2() ); + w.adjuster( 6, GET_TEXT_F(MSG_ACCEL_RETRACT), getRetractAcceleration_mm_s2() ); + w.increments(); + w.button( 8, GET_TEXT_F(MSG_SET_MAXIMUM)); +} + +bool DefaultAccelerationScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(PrintingAcceleration_mm_s2); break; + case 3: UI_INCREMENT(PrintingAcceleration_mm_s2); break; + case 4: UI_DECREMENT(TravelAcceleration_mm_s2); break; + case 5: UI_INCREMENT(TravelAcceleration_mm_s2); break; + case 6: UI_DECREMENT(RetractAcceleration_mm_s2); break; + case 7: UI_INCREMENT(RetractAcceleration_mm_s2); break; + case 8: GOTO_SCREEN(MaxAccelerationScreen); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp new file mode 100644 index 000000000000..b3b674ebd311 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp @@ -0,0 +1,150 @@ +/********************** + * developer_menu.cpp * + **********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) + +#include "screens.h" + +#include "../archim2-flash/flash_storage.h" + +using namespace FTDI; +using namespace Theme; + +void DeveloperMenu::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .font(font_medium) + .tag(0); + + #ifdef SPI_FLASH_SS + constexpr bool has_flash = true; + #else + constexpr bool has_flash = false; + #endif + + #if ENABLED(SDSUPPORT) + constexpr bool has_media = true; + #else + constexpr bool has_media = false; + #endif + + cmd.cmd(COLOR_RGB(bg_text_enabled)); + #ifdef TOUCH_UI_PORTRAIT + #define GRID_ROWS 10 + #define GRID_COLS 1 + cmd.font(font_large) .text ( BTN_POS(1,1), BTN_SIZE(1,1), F("Developer Menu")) + .colors(normal_btn) + .tag(2).font(font_medium) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) + .tag(3) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("Stress Test")) + .tag(4) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("Show Touch Registers")) + .tag(5) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("Play Song")) + .tag(6).enabled(has_media).button( BTN_POS(1,6), BTN_SIZE(1,1), F("Play Video from Media")) + .tag(7).enabled(has_flash).button( BTN_POS(1,7), BTN_SIZE(1,1), F("Play Video from SPI Flash")) + .tag(8).enabled(has_flash).button( BTN_POS(1,8), BTN_SIZE(1,1), F("Load Video to SPI Flash")) + .tag(9).enabled(has_flash).button( BTN_POS(1,9), BTN_SIZE(1,1), F("Erase SPI Flash")) + + .tag(1).colors(action_btn) + .button( BTN_POS(1,10), BTN_SIZE(1,1), F("Back")); + #else + #define GRID_ROWS 6 + #define GRID_COLS 2 + cmd.font(font_medium) .text ( BTN_POS(1,1), BTN_SIZE(2,1), F("Developer Menu")) + .colors(normal_btn) + .tag(2).font(font_small) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) + .tag(3) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("Show Touch Registers")) + .tag(9) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("Show Pin States")) + .tag(4) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("Play Song")) + .tag(5).enabled(has_media).button( BTN_POS(2,2), BTN_SIZE(1,1), F("Play Video from Media")) + .tag(6).enabled(has_flash).button( BTN_POS(2,3), BTN_SIZE(1,1), F("Play Video from SPI Flash")) + .tag(7).enabled(has_flash).button( BTN_POS(2,4), BTN_SIZE(1,1), F("Load Video to SPI Flash")) + .tag(8).enabled(has_flash).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Erase SPI Flash")) + .tag(1).colors(action_btn) + .button( BTN_POS(1,6), BTN_SIZE(2,1), F("Back")); + #endif + } +} + +bool DeveloperMenu::onTouchEnd(uint8_t tag) { + using namespace Theme; + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + case 2: GOTO_SCREEN(WidgetsScreen); break; + case 3: + PUSH_SCREEN(StressTestScreen); + AlertDialogBox::show(F("Please do not run this test unattended as it may cause your printer to malfunction.")); + current_screen.forget(); + break; + case 4: GOTO_SCREEN(TouchRegistersScreen); break; + case 5: sound.play(js_bach_joy, PLAY_ASYNCHRONOUS); break; + #if ENABLED(SDSUPPORT) + case 6: + if (!MediaPlayerScreen::playCardMedia()) + AlertDialogBox::showError(F("Cannot open STARTUP.AVI")); + break; + #endif + #ifdef SPI_FLASH_SS + case 7: + if (!MediaPlayerScreen::playBootMedia()) + AlertDialogBox::showError(F("No boot media available")); + break; + case 8: + { + SpinnerDialogBox::show(F("Saving...")); + UIFlashStorage::error_t res = UIFlashStorage::write_media_file(F("STARTUP.AVI")); + SpinnerDialogBox::hide(); + reset_menu_timeout(); + switch (res) { + case UIFlashStorage::SUCCESS: + AlertDialogBox::show(F("File copied!")); + break; + + case UIFlashStorage::READ_ERROR: + AlertDialogBox::showError(F("Failed to read file")); + break; + + case UIFlashStorage::VERIFY_ERROR: + AlertDialogBox::showError(F("Failed to verify file")); + break; + + case UIFlashStorage::FILE_NOT_FOUND: + AlertDialogBox::showError(F("Cannot open STARTUP.AVI")); + break; + + case UIFlashStorage::WOULD_OVERWRITE: + AlertDialogBox::showError(F("Cannot overwrite existing media.")); + break; + } + break; + } + case 9: GOTO_SCREEN(ConfirmEraseFlashDialogBox); break; + #endif + case 10: GOTO_SCREEN(EndstopStatesScreen); break; + default: return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp new file mode 100644 index 000000000000..7f3a27e9e8fd --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp @@ -0,0 +1,87 @@ +/***************************** + * dialog_box_base_class.cpp * + *****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +#define GRID_COLS 2 +#define GRID_ROWS 8 + +template +void DialogBoxBaseClass::drawMessage(const T message, int16_t font) { + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(2,3), message, OPT_CENTER, font ? font : font_large); + cmd.colors(normal_btn); +} + +template void DialogBoxBaseClass::drawMessage(const char *, int16_t font); +template void DialogBoxBaseClass::drawMessage(progmem_str, int16_t font); + +void DialogBoxBaseClass::drawYesNoButtons(uint8_t default_btn) { + CommandProcessor cmd; + cmd.font(font_medium) + .colors(default_btn == 1 ? action_btn : normal_btn).tag(1).button( BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_YES)) + .colors(default_btn == 2 ? action_btn : normal_btn).tag(2).button( BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXT_F(MSG_NO)); +} + +void DialogBoxBaseClass::drawOkayButton() { + CommandProcessor cmd; + cmd.font(font_medium) + .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_OKAY)); +} + +void DialogBoxBaseClass::drawButton(const progmem_str label) { + CommandProcessor cmd; + cmd.font(font_medium) + .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), label); +} + +void DialogBoxBaseClass::drawSpinner() { + CommandProcessor cmd; + cmd.cmd(COLOR_RGB(bg_text_enabled)) + .spinner(BTN_POS(1,4), BTN_SIZE(2,3)).execute(); +} + +bool DialogBoxBaseClass::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; + case 2: GOTO_PREVIOUS(); return true; + default: return false; + } +} + +void DialogBoxBaseClass::onIdle() { + reset_menu_timeout(); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp new file mode 100644 index 000000000000..b449634b1a1a --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp @@ -0,0 +1,61 @@ +/***************************** + * display_tuning_screen.cpp * + *****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void DisplayTuningScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST); + w.units(F("")); + w.heading(GET_TEXT_F(MSG_DISPLAY_MENU)); + w.color(other); + w.adjuster( 2, GET_TEXT_F(MSG_H_OFFSET), CLCD::mem_read_16(CLCD::REG::HOFFSET) ); + w.adjuster( 4, GET_TEXT_F(MSG_V_OFFSET), CLCD::mem_read_16(CLCD::REG::VOFFSET) ); + w.increments(); + w.heading( GET_TEXT_F(MSG_TOUCH_SCREEN)); + w.button(6, GET_TEXT_F(MSG_CALIBRATE)); +} + +bool DisplayTuningScreen::onTouchHeld(uint8_t tag) { + #define REG_INCREMENT(a,i) CLCD::mem_write_16(CLCD::REG::a, CLCD::mem_read_16(CLCD::REG::a) + i) + const float increment = getIncrement(); + switch (tag) { + case 2: REG_INCREMENT(HOFFSET, -increment); break; + case 3: REG_INCREMENT(HOFFSET, increment); break; + case 4: REG_INCREMENT(VOFFSET, -increment); break; + case 5: REG_INCREMENT(VOFFSET, increment); break; + case 6: GOTO_SCREEN(TouchCalibrationScreen); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp new file mode 100644 index 000000000000..9901bbf45b0e --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -0,0 +1,152 @@ +/**************************** + * endstop_state_screen.cpp * + ****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void EndstopStatesScreen::onEntry() { + BaseScreen::onEntry(); +} + +void EndstopStatesScreen::onExit() { + BaseScreen::onExit(); +} + +void EndstopStatesScreen::onRedraw(draw_mode_t) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(COLOR_RGB(bg_text_enabled)) + .cmd(CLEAR(true,true,true)) + .tag(0); + + #define GRID_ROWS 7 + #define GRID_COLS 6 + + #define PIN_BTN(X,Y,PIN,LABEL) button(BTN_POS(X,Y), BTN_SIZE(2,1), LABEL) + #define PIN_ENABLED(X,Y,LABEL,PIN,INV) cmd.enabled(1).colors(READ(PIN##_PIN) != INV ? action_btn : normal_btn).PIN_BTN(X,Y,PIN,LABEL); + #define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); + + cmd.font( + #ifdef TOUCH_UI_PORTRAIT + font_large + #else + font_medium + #endif + ) + .text(BTN_POS(1,1), BTN_SIZE(6,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) + .font(font_tiny); + #if PIN_EXISTS(X_MAX) + PIN_ENABLED (1, 2, PSTR(MSG_X_MAX), X_MAX, X_MAX_ENDSTOP_INVERTING) + #else + PIN_DISABLED(1, 2, PSTR(MSG_X_MAX), X_MAX) + #endif + #if PIN_EXISTS(Y_MAX) + PIN_ENABLED (3, 2, PSTR(MSG_Y_MAX), Y_MAX, Y_MAX_ENDSTOP_INVERTING) + #else + PIN_DISABLED(3, 2, PSTR(MSG_Y_MAX), Y_MAX) + #endif + #if PIN_EXISTS(Z_MAX) + PIN_ENABLED (5, 2, PSTR(MSG_Z_MAX), Z_MAX, Z_MAX_ENDSTOP_INVERTING) + #else + PIN_DISABLED(5, 2, PSTR(MSG_Z_MAX), Z_MAX) + #endif + #if PIN_EXISTS(X_MIN) + PIN_ENABLED (1, 3, PSTR(MSG_X_MIN), X_MIN, X_MIN_ENDSTOP_INVERTING) + #else + PIN_DISABLED(1, 3, PSTR(MSG_X_MIN), X_MIN) + #endif + #if PIN_EXISTS(Y_MIN) + PIN_ENABLED (3, 3, PSTR(MSG_Y_MIN), Y_MIN, Y_MIN_ENDSTOP_INVERTING) + #else + PIN_DISABLED(3, 3, PSTR(MSG_Y_MIN), Y_MIN) + #endif + #if PIN_EXISTS(Z_MIN) + PIN_ENABLED (5, 3, PSTR(MSG_Z_MIN), Z_MIN, Z_MIN_ENDSTOP_INVERTING) + #else + PIN_DISABLED(5, 3, PSTR(MSG_Z_MIN), Z_MIN) + #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) + PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT_INVERTING) + #else + PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT) + #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) + PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT_INVERTING) + #else + PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) + #endif + #if PIN_EXISTS(Z_MIN_PROBE) + PIN_ENABLED (5, 4, PSTR(MSG_Z_PROBE), Z_MIN_PROBE, Z_MIN_PROBE_ENDSTOP_INVERTING) + #else + PIN_DISABLED(5, 4, PSTR(MSG_Z_PROBE), Z_MIN_PROBE) + #endif + + #if HAS_SOFTWARE_ENDSTOPS + #undef EDGE_R + #define EDGE_R 30 + cmd.cmd(COLOR_RGB(bg_text_enabled)) + .font(font_small) + .text (BTN_POS(1,5), BTN_SIZE(3,1), GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS), OPT_RIGHTX | OPT_CENTERY) + .colors(ui_toggle) + .tag(2).toggle2(BTN_POS(4,5), BTN_SIZE(3,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), getSoftEndstopState()); + #undef EDGE_R + #define EDGE_R 0 + #endif + + cmd.font(font_medium) + .colors(action_btn) + .tag(1).button( BTN_POS(1,7), BTN_SIZE(6,1), GET_TEXT_F(MSG_BACK)); + #undef GRID_COLS + #undef GRID_ROWS +} + +bool EndstopStatesScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + #if HAS_SOFTWARE_ENDSTOPS + case 2: setSoftEndstopState(!getSoftEndstopState()); + #endif + default: + return false; + } + return true; +} + +void EndstopStatesScreen::onIdle() { + constexpr uint32_t DIAGNOSTICS_UPDATE_INTERVAL = 100; + + if (refresh_timer.elapsed(DIAGNOSTICS_UPDATE_INTERVAL)) { + onRefresh(); + refresh_timer.start(); + reset_menu_timeout(); + } + BaseScreen::onIdle(); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp new file mode 100644 index 000000000000..bd8e648e1125 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp @@ -0,0 +1,52 @@ +/******************************* + * feedrate_percent_screen.cpp * + *******************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; + +void FeedratePercentScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT)); + + w.heading(GET_TEXT_F(MSG_PRINT_SPEED)); + w.adjuster(4, GET_TEXT_F(MSG_SPEED), getFeedrate_percent()); + w.increments(); +} + +bool FeedratePercentScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 4: UI_DECREMENT(Feedrate_percent); break; + case 5: UI_INCREMENT(Feedrate_percent); break; + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp new file mode 100644 index 000000000000..3972a14ef98a --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp @@ -0,0 +1,102 @@ +/********************* + * filament_menu.cpp * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void FilamentMenu::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0); + } + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.font(font_large) + #ifdef TOUCH_UI_PORTRAIT + #define GRID_ROWS 9 + #define GRID_COLS 2 + .text ( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENT)) + .font(font_medium).colors(normal_btn) + .enabled( + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + 1 + #endif + ) + .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_RUNOUT_SENSOR)) + .enabled( + #if ENABLED(LIN_ADVANCE) + 1 + #endif + ) + .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) + .colors(action_btn) + .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + #undef GRID_COLS + #undef GRID_ROWS + #else + #define GRID_ROWS 6 + #define GRID_COLS 3 + .text ( BTN_POS(1,1), BTN_SIZE(3,1), GET_TEXT_F(MSG_FILAMENT)) + .font(font_medium).colors(normal_btn) + .enabled( + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + 1 + #endif + ) + .tag(2).button( BTN_POS(1,2), BTN_SIZE(3,1), GET_TEXT_F(MSG_RUNOUT_SENSOR)) + .enabled( + #if ENABLED(LIN_ADVANCE) + 1 + #endif + ) + .tag(3).button( BTN_POS(1,3), BTN_SIZE(3,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) + .colors(action_btn) + .tag(1) .button( BTN_POS(1,6), BTN_SIZE(3,1), GET_TEXT_F(MSG_BACK)); + #endif + } +} + +bool FilamentMenu::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + case 2: GOTO_SCREEN(FilamentRunoutScreen); break; + #endif + #if ENABLED(LIN_ADVANCE) + case 3: GOTO_SCREEN(LinearAdvanceScreen); break; + #endif + default: return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp new file mode 100644 index 000000000000..9830123abbad --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp @@ -0,0 +1,66 @@ +/****************************** + * filament_runout_screen.cpp * + ******************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, FILAMENT_RUNOUT_SENSOR) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void FilamentRunoutScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.heading( GET_TEXT_F(MSG_FILAMENT)); + w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled()); + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + extern const char NUL_STR[]; + w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM)); + w.units(GET_TEXT_F(MSG_UNITS_MM)); + w.precision(0); + w.color(e_axis); + w.adjuster( 10, progmem_str(NUL_STR), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled()); + w.increments(); + #endif +} + +bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) { + using namespace ExtUI; + const float increment = getIncrement(); + switch (tag) { + case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break; + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + case 10: UI_DECREMENT(FilamentRunoutDistance_mm); break; + case 11: UI_INCREMENT(FilamentRunoutDistance_mm); break; + #endif + default: + return false; + } + + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp new file mode 100644 index 000000000000..d32ec4d07f3b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp @@ -0,0 +1,264 @@ +/******************** + * files_screen.cpp * + ********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void FilesScreen::onEntry() { + screen_data.FilesScreen.cur_page = 0; + screen_data.FilesScreen.selected_tag = 0xFF; + #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) + CLCD::mem_write_32(CLCD::REG::MACRO_0,DL::NOP); + #endif + gotoPage(0); + BaseScreen::onEntry(); +} + +const char *FilesScreen::getSelectedFilename(bool longName) { + FileList files; + files.seek(getSelectedFileIndex(), true); + return longName ? files.longFilename() : files.shortFilename(); +} + +void FilesScreen::drawSelectedFile() { + FileList files; + files.seek(getSelectedFileIndex(), true); + screen_data.FilesScreen.flags.is_dir = files.isDir(); + drawFileButton( + files.filename(), + screen_data.FilesScreen.selected_tag, + screen_data.FilesScreen.flags.is_dir, + true + ); +} + +uint16_t FilesScreen::getSelectedFileIndex() { + return getFileForTag(screen_data.FilesScreen.selected_tag); +} + +uint16_t FilesScreen::getFileForTag(uint8_t tag) { + return screen_data.FilesScreen.cur_page * files_per_page + tag - 2; +} + +#ifdef TOUCH_UI_PORTRAIT + #define GRID_COLS 6 + #define GRID_ROWS (files_per_page + header_h + footer_h) +#else + #define GRID_COLS 6 + #define GRID_ROWS (files_per_page + header_h + footer_h) +#endif + +void FilesScreen::drawFileButton(const char* filename, uint8_t tag, bool is_dir, bool is_highlighted) { + const uint8_t line = getLineForTag(tag)+1; + CommandProcessor cmd; + cmd.tag(tag); + cmd.cmd(COLOR_RGB(is_highlighted ? fg_action : bg_color)); + cmd.font(font_medium) + .rectangle( 0, BTN_Y(header_h+line), display_width, BTN_H(1)); + cmd.cmd(COLOR_RGB(is_highlighted ? normal_btn.rgb : bg_text_enabled)); + #if ENABLED(SCROLL_LONG_FILENAMES) + if (is_highlighted) { + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(MACRO(0)); + } + #endif + cmd.text (BTN_POS(1,header_h+line), BTN_SIZE(6,1), filename, OPT_CENTERY + #if ENABLED(SCROLL_LONG_FILENAMES) + | OPT_NOFIT + #endif + ); + if (is_dir) { + cmd.text(BTN_POS(1,header_h+line), BTN_SIZE(6,1), F("> "), OPT_CENTERY | OPT_RIGHTX); + } + #if ENABLED(SCROLL_LONG_FILENAMES) + if (is_highlighted) { + cmd.cmd(RESTORE_CONTEXT()); + } + #endif +} + +void FilesScreen::drawFileList() { + FileList files; + screen_data.FilesScreen.num_page = max(1,(ceil)(float(files.count()) / files_per_page)); + screen_data.FilesScreen.cur_page = min(screen_data.FilesScreen.cur_page, screen_data.FilesScreen.num_page-1); + screen_data.FilesScreen.flags.is_root = files.isAtRootDir(); + + #undef MARGIN_T + #undef MARGIN_B + #define MARGIN_T 0 + #define MARGIN_B 0 + uint16_t fileIndex = screen_data.FilesScreen.cur_page * files_per_page; + for(uint8_t i = 0; i < files_per_page; i++, fileIndex++) { + if (files.seek(fileIndex)) { + drawFileButton(files.filename(), getTagForLine(i), files.isDir(), false); + } else { + break; + } + } +} + +void FilesScreen::drawHeader() { + const bool prev_enabled = screen_data.FilesScreen.cur_page > 0; + const bool next_enabled = screen_data.FilesScreen.cur_page < (screen_data.FilesScreen.num_page - 1); + + #undef MARGIN_T + #undef MARGIN_B + #define MARGIN_T 0 + #define MARGIN_B 2 + + char str[16]; + sprintf_P(str, PSTR("Page %d of %d"), + screen_data.FilesScreen.cur_page + 1, screen_data.FilesScreen.num_page); + + + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(font_small) + .tag(0).button( BTN_POS(2,1), BTN_SIZE(4,header_h), str, OPT_CENTER | OPT_FLAT) + .font(font_medium) + .colors(action_btn) + .tag(241).enabled(prev_enabled).button( BTN_POS(1,1), BTN_SIZE(1,header_h), F("<")) + .tag(242).enabled(next_enabled).button( BTN_POS(6,1), BTN_SIZE(1,header_h), F(">")); +} + +void FilesScreen::drawFooter() { + #undef MARGIN_T + #undef MARGIN_B + #ifdef TOUCH_UI_PORTRAIT + #define MARGIN_T 15 + #define MARGIN_B 5 + #else + #define MARGIN_T 5 + #define MARGIN_B 5 + #endif + const bool has_selection = screen_data.FilesScreen.selected_tag != 0xFF; + const uint8_t back_tag = screen_data.FilesScreen.flags.is_root ? 240 : 245; + const uint8_t y = GRID_ROWS - footer_h + 1; + const uint8_t h = footer_h; + + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(font_medium) + .colors(has_selection ? normal_btn : action_btn) + .tag(back_tag).button( BTN_POS(4,y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BACK)) + .enabled(has_selection) + .colors(has_selection ? action_btn : normal_btn); + if (screen_data.FilesScreen.flags.is_dir) { + cmd.tag(244).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_OPEN)); + } else { + cmd.tag(243).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_PRINT)); + } +} + +void FilesScreen::onRedraw(draw_mode_t what) { + if (what & FOREGROUND) { + drawHeader(); + drawSelectedFile(); + drawFooter(); + } +} + +void FilesScreen::gotoPage(uint8_t page) { + screen_data.FilesScreen.selected_tag = 0xFF; + screen_data.FilesScreen.cur_page = page; + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .colors(normal_btn); + drawFileList(); + storeBackground(); +} + +bool FilesScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 240: GOTO_PREVIOUS(); return true; + case 241: + if (screen_data.FilesScreen.cur_page > 0) { + gotoPage(screen_data.FilesScreen.cur_page-1); + } + break; + case 242: + if (screen_data.FilesScreen.cur_page < (screen_data.FilesScreen.num_page-1)) { + gotoPage(screen_data.FilesScreen.cur_page+1); + } + break; + case 243: + ConfirmStartPrintDialogBox::show(getSelectedFileIndex()); + return true; + case 244: + { + FileList files; + files.changeDir(getSelectedShortFilename()); + gotoPage(0); + } + break; + case 245: + { + FileList files; + files.upDir(); + gotoPage(0); + } + break; + default: + if (tag < 240) { + screen_data.FilesScreen.selected_tag = tag; + #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) + if (FTDI::ftdi_chip >= 810) { + const char *longFilename = getSelectedLongFilename(); + if (longFilename[0]) { + CommandProcessor cmd; + uint16_t text_width = cmd.font(font_medium).text_width(longFilename); + screen_data.FilesScreen.scroll_pos = 0; + if (text_width > display_width) + screen_data.FilesScreen.scroll_max = text_width - display_width + MARGIN_L + MARGIN_R; + else + screen_data.FilesScreen.scroll_max = 0; + } + } + #endif + } + break; + } + return true; +} + +void FilesScreen::onIdle() { + #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) + if (FTDI::ftdi_chip >= 810) { + CLCD::mem_write_32(CLCD::REG::MACRO_0, + VERTEX_TRANSLATE_X(-int32_t(screen_data.FilesScreen.scroll_pos))); + if (screen_data.FilesScreen.scroll_pos < screen_data.FilesScreen.scroll_max * 16) + screen_data.FilesScreen.scroll_pos++; + } + #endif +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp new file mode 100644 index 000000000000..61875c52f1f3 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp @@ -0,0 +1,285 @@ +/********************************* + * interface_settings_screen.cpp * + *********************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +#include "../archim2-flash/flash_storage.h" + +#include "../../../../../module/configuration_store.h" + +#if ENABLED(LULZBOT_PRINTCOUNTER) + #include "../../../../../module/printcounter.h" +#endif + +bool restoreEEPROM(); + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +constexpr bool PERSISTENT_STORE_SUCCESS = false; // persistentStore uses true for error + +void InterfaceSettingsScreen::onStartup() { +} + +void InterfaceSettingsScreen::onEntry() { + screen_data.InterfaceSettingsScreen.brightness = CLCD::get_brightness(); + screen_data.InterfaceSettingsScreen.volume = SoundPlayer::get_volume(); + BaseScreen::onEntry(); +} + +void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + + #define GRID_COLS 4 + #ifdef TOUCH_UI_PORTRAIT + #define GRID_ROWS 7 + #else + #define GRID_ROWS 6 + #endif + + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0) + .font(font_medium) + .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) + #undef EDGE_R + #define EDGE_R 30 + .font(font_small) + .tag(0) + .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_LCD_BRIGHTNESS), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_SOUND_VOLUME), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_SCREEN_LOCK), OPT_RIGHTX | OPT_CENTERY); + cmd.text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BOOT_SCREEN), OPT_RIGHTX | OPT_CENTERY); + #undef EDGE_R + } + + if (what & FOREGROUND) { + #ifdef TOUCH_UI_PORTRAIT + constexpr uint8_t w = 2; + #else + constexpr uint8_t w = 1; + #endif + + cmd.font(font_medium) + #define EDGE_R 30 + .colors(ui_slider) + .tag(2).slider(BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.brightness, 128) + .tag(3).slider(BTN_POS(3,3), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.volume, 0xFF) + .colors(ui_toggle) + .tag(4).toggle2(BTN_POS(3,4), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), LockScreen::is_enabled()) + .tag(5).toggle2(BTN_POS(3,5), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), UIData::animations_enabled()) + #undef EDGE_R + #define EDGE_R 0 + #ifdef TOUCH_UI_PORTRAIT + .colors(normal_btn) + .tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE_SOUNDS)) + .colors(action_btn) + .tag(1).button (BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXT_F(MSG_BACK)); + #else + .tag(6).button (BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SOUNDS)) + .colors(action_btn) + .tag(1).button (BTN_POS(3,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + #endif + } +} + +bool InterfaceSettingsScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; + case 4: + if (!LockScreen::is_enabled()) + LockScreen::enable(); + else + LockScreen::disable(); + break; + case 5: UIData::enable_animations(!UIData::animations_enabled());; break; + case 6: GOTO_SCREEN(InterfaceSoundsScreen); return true; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +bool InterfaceSettingsScreen::onTouchStart(uint8_t tag) { + #undef EDGE_R + #define EDGE_R 30 + CommandProcessor cmd; + switch (tag) { + case 2: cmd.track_linear(BTN_POS(3,3), BTN_SIZE(2,1), 2).execute(); break; + case 3: cmd.track_linear(BTN_POS(3,4), BTN_SIZE(2,1), 3).execute(); break; + default: break; + } + #undef EDGE_R + #define EDGE_R 0 + #undef GRID_COLS + #undef GRID_ROWS + return true; +} + +void InterfaceSettingsScreen::onIdle() { + if (refresh_timer.elapsed(TOUCH_UPDATE_INTERVAL)) { + refresh_timer.start(); + + uint16_t value; + CommandProcessor cmd; + switch (cmd.track_tag(value)) { + case 2: + screen_data.InterfaceSettingsScreen.brightness = float(value) * 128 / 0xFFFF; + CLCD::set_brightness(screen_data.InterfaceSettingsScreen.brightness); + SaveSettingsDialogBox::settingsChanged(); + break; + case 3: + screen_data.InterfaceSettingsScreen.volume = value >> 8; + SoundPlayer::set_volume(screen_data.InterfaceSettingsScreen.volume); + SaveSettingsDialogBox::settingsChanged(); + break; + default: + return; + } + onRefresh(); + } + BaseScreen::onIdle(); +} + +void InterfaceSettingsScreen::failSafeSettings() { + // Reset settings that may make the printer interface + // unusable. + CLCD::mem_write_32(CLCD::REG::ROTATE, 0); + CLCD::default_touch_transform(); + CLCD::default_display_orientation(); + CLCD::set_brightness(255); + UIData::reset_persistent_data(); + CLCD::mem_write_16(CLCD::REG::HOFFSET, FTDI::Hoffset); + CLCD::mem_write_16(CLCD::REG::VOFFSET, FTDI::Voffset); +} + +void InterfaceSettingsScreen::defaultSettings() { + LockScreen::passcode = 0; + SoundPlayer::set_volume(255); + CLCD::set_brightness(255); + UIData::reset_persistent_data(); + InterfaceSoundsScreen::defaultSettings(); + CLCD::mem_write_16(CLCD::REG::HOFFSET, FTDI::Hoffset); + CLCD::mem_write_16(CLCD::REG::VOFFSET, FTDI::Voffset); +} + +void InterfaceSettingsScreen::saveSettings(char *buff) { + static_assert( + ExtUI::eeprom_data_size >= sizeof(persistent_data_t), + "Insufficient space in EEPROM for UI parameters" + ); + + SERIAL_ECHOLNPGM("Writing setting to EEPROM"); + + persistent_data_t eeprom; + + eeprom.passcode = LockScreen::passcode; + eeprom.sound_volume = SoundPlayer::get_volume(); + eeprom.display_brightness = CLCD::get_brightness(); + eeprom.bit_flags = UIData::get_persistent_data(); + eeprom.touch_transform_a = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_A); + eeprom.touch_transform_b = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_B); + eeprom.touch_transform_c = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_C); + eeprom.touch_transform_d = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_D); + eeprom.touch_transform_e = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_E); + eeprom.touch_transform_f = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_F); + eeprom.display_h_offset_adj = CLCD::mem_read_16(CLCD::REG::HOFFSET) - FTDI::Hoffset; + eeprom.display_v_offset_adj = CLCD::mem_read_16(CLCD::REG::VOFFSET) - FTDI::Voffset; + for(uint8_t i = 0; i < InterfaceSoundsScreen::NUM_EVENTS; i++) + eeprom.event_sounds[i] = InterfaceSoundsScreen::event_sounds[i]; + + memcpy(buff, &eeprom, sizeof(eeprom)); +} + +void InterfaceSettingsScreen::loadSettings(const char *buff) { + static_assert( + ExtUI::eeprom_data_size >= sizeof(persistent_data_t), + "Insufficient space in EEPROM for UI parameters" + ); + + persistent_data_t eeprom; + memcpy(&eeprom, buff, sizeof(eeprom)); + + SERIAL_ECHOLNPGM("Loading setting from EEPROM"); + + LockScreen::passcode = eeprom.passcode; + SoundPlayer::set_volume(eeprom.sound_volume); + UIData::set_persistent_data(eeprom.bit_flags); + CLCD::set_brightness(eeprom.display_brightness); + CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_A, eeprom.touch_transform_a); + CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_B, eeprom.touch_transform_b); + CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_C, eeprom.touch_transform_c); + CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_D, eeprom.touch_transform_d); + CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_E, eeprom.touch_transform_e); + CLCD::mem_write_32(CLCD::REG::TOUCH_TRANSFORM_F, eeprom.touch_transform_f); + CLCD::mem_write_16(CLCD::REG::HOFFSET, eeprom.display_h_offset_adj + FTDI::Hoffset); + CLCD::mem_write_16(CLCD::REG::VOFFSET, eeprom.display_v_offset_adj + FTDI::Voffset); + for(uint8_t i = 0; i < InterfaceSoundsScreen::NUM_EVENTS; i++) + InterfaceSoundsScreen::event_sounds[i] = eeprom.event_sounds[i]; + + #if ENABLED(TOUCH_UI_DEVELOPER_MENU) + StressTestScreen::startupCheck(); + #endif +} + +#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE + #include "../../../../../HAL/shared/persistent_store_api.h" + + bool restoreEEPROM() { + uint8_t data[ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE]; + + bool success = UIFlashStorage::read_config_data(data, ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE); + + if (success) + success = persistentStore.write_data(0, data, ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE) == PERSISTENT_STORE_SUCCESS; + + if (success) + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_EEPROM_RESTORED)); + else + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_EEPROM_RESET)); + + return success; + } + + bool InterfaceSettingsScreen::backupEEPROM() { + uint8_t data[ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE]; + + if (persistentStore.read_data(0, data, ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE) != PERSISTENT_STORE_SUCCESS) + return false; + + UIFlashStorage::write_config_data(data, ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE); + + return true; + } +#endif + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp new file mode 100644 index 000000000000..57f520e8abd1 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp @@ -0,0 +1,160 @@ +/******************************* + * interface_sounds_screen.cpp * + *******************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +uint8_t InterfaceSoundsScreen::event_sounds[]; + +const char* InterfaceSoundsScreen::getSoundSelection(event_t event) { + return SoundList::name(event_sounds[event]); +} + +void InterfaceSoundsScreen::toggleSoundSelection(event_t event) { + event_sounds[event] = (event_sounds[event]+1) % SoundList::n; + playEventSound(event); +} + +void InterfaceSoundsScreen::setSoundSelection(event_t event, const SoundPlayer::sound_t* sound) { + for(uint8_t i = 0; i < SoundList::n; i++) + if (SoundList::data(i) == sound) + event_sounds[event] = i; +} + +void InterfaceSoundsScreen::playEventSound(event_t event, play_mode_t mode) { + sound.play(SoundList::data(event_sounds[event]), mode); +} + +void InterfaceSoundsScreen::defaultSettings() { + setSoundSelection(PRINTING_STARTED, twinkle); + setSoundSelection(PRINTING_FINISHED, fanfare); + setSoundSelection(PRINTING_FAILED, sad_trombone); +} + +void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0) + + #define GRID_COLS 4 + #define GRID_ROWS 9 + + .font(font_medium) + .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INTERFACE_SOUNDS)) + #undef EDGE_R + #define EDGE_R 30 + .font(font_small) + .tag(0).text (BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_SOUND_VOLUME), OPT_RIGHTX | OPT_CENTERY) + .text (BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_CLICK_SOUNDS), OPT_RIGHTX | OPT_CENTERY) + .text (BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_STARTING), OPT_RIGHTX | OPT_CENTERY) + .text (BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_FINISHED), OPT_RIGHTX | OPT_CENTERY) + .text (BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_ERROR), OPT_RIGHTX | OPT_CENTERY); + #undef EDGE_R + } + + if (what & FOREGROUND) { + #ifdef TOUCH_UI_PORTRAIT + constexpr uint8_t w = 2; + #else + constexpr uint8_t w = 1; + #endif + + cmd.font(font_medium) + .colors(ui_slider) + #define EDGE_R 30 + .tag(2).slider (BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.volume, 0xFF) + .colors(ui_toggle) + .tag(3).toggle2 (BTN_POS(3,3), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), UIData::touch_sounds_enabled()) + #undef EDGE_R + .colors(normal_btn) + #define EDGE_R 0 + .tag(4).button (BTN_POS(3,5), BTN_SIZE(2,1), getSoundSelection(PRINTING_STARTED)) + .tag(5).button (BTN_POS(3,6), BTN_SIZE(2,1), getSoundSelection(PRINTING_FINISHED)) + .tag(6).button (BTN_POS(3,7), BTN_SIZE(2,1), getSoundSelection(PRINTING_FAILED)) + .colors(action_btn) + .tag(1).button (BTN_POS(1,9), BTN_SIZE(4,1), GET_TEXT_F(MSG_BACK)); + } +} + +void InterfaceSoundsScreen::onEntry() { + screen_data.InterfaceSettingsScreen.volume = SoundPlayer::get_volume(); + BaseScreen::onEntry(); +} + +bool InterfaceSoundsScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; + case 3: UIData::enable_touch_sounds(!UIData::touch_sounds_enabled()); break; + case 4: toggleSoundSelection(PRINTING_STARTED); break; + case 5: toggleSoundSelection(PRINTING_FINISHED); break; + case 6: toggleSoundSelection(PRINTING_FAILED); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +bool InterfaceSoundsScreen::onTouchStart(uint8_t tag) { + CommandProcessor cmd; + #undef EDGE_R + #define EDGE_R 30 + switch (tag) { + case 2: cmd.track_linear(BTN_POS(3,2), BTN_SIZE(2,1), 2).execute(); break; + default: break; + } + return true; +} + +void InterfaceSoundsScreen::onIdle() { + if (refresh_timer.elapsed(TOUCH_UPDATE_INTERVAL)) { + refresh_timer.start(); + + uint16_t value; + CommandProcessor cmd; + switch (cmd.track_tag(value)) { + case 2: + screen_data.InterfaceSettingsScreen.volume = value >> 8; + SoundPlayer::set_volume(screen_data.InterfaceSettingsScreen.volume); + SaveSettingsDialogBox::settingsChanged(); + break; + default: + return; + } + onRefresh(); + } + BaseScreen::onIdle(); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp new file mode 100644 index 000000000000..c208014cc75b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp @@ -0,0 +1,65 @@ +/******************* + * jerk_screen.cpp * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, CLASSIC_JERK) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void JerkScreen::onRedraw(draw_mode_t what) { + + widgets_t w(what); + w.precision(1); + w.units(GET_TEXT_F(MSG_UNITS_MM_S)); + w.heading(GET_TEXT_F(MSG_JERK)); + w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisMaxJerk_mm_s(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisMaxJerk_mm_s(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisMaxJerk_mm_s(Z) ); + w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisMaxJerk_mm_s(E0) ); + w.increments(); +} + +bool JerkScreen::onTouchHeld(uint8_t tag) { + using namespace ExtUI; + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(AxisMaxJerk_mm_s, X); break; + case 3: UI_INCREMENT(AxisMaxJerk_mm_s, X); break; + case 4: UI_DECREMENT(AxisMaxJerk_mm_s, Y); break; + case 5: UI_INCREMENT(AxisMaxJerk_mm_s, Y); break; + case 6: UI_DECREMENT(AxisMaxJerk_mm_s, Z); break; + case 7: UI_INCREMENT(AxisMaxJerk_mm_s, Z); break; + case 8: UI_DECREMENT(AxisMaxJerk_mm_s, E0); break; + case 9: UI_INCREMENT(AxisMaxJerk_mm_s, E0); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE && CLASSIC_JERK diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp new file mode 100644 index 000000000000..034ac15c42e7 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp @@ -0,0 +1,54 @@ +/******************* + * boot_screen.cpp * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(CLASSIC_JERK) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void JunctionDeviationScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(2); + w.units(GET_TEXT_F(MSG_UNITS_MM)); + w.heading(GET_TEXT_F(MSG_JUNCTION_DEVIATION)); + w.color(other) .adjuster( 2, F(""), getJunctionDeviation_mm() ); + w.increments(); +} + +bool JunctionDeviationScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(JunctionDeviation_mm); break; + case 3: UI_INCREMENT(JunctionDeviation_mm); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE && !CLASSIC_JERK diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp new file mode 100644 index 000000000000..9c27ae6af5f0 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp @@ -0,0 +1,62 @@ +/******************* + * kill_screen.cpp * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; + +// The kill screen is an oddball that happens after Marlin has killed the events +// loop. So we only have a show() method rather than onRedraw(). The KillScreen +// should not be used as a model for other UI screens as it is an exception. + +void KillScreen::show(const char *message) { + CommandProcessor cmd; + + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0); + + #define GRID_COLS 4 + #define GRID_ROWS 8 + + cmd.font(Theme::font_large) + .cmd(COLOR_RGB(Theme::bg_text_enabled)) + .text(BTN_POS(1,2), BTN_SIZE(4,1), message) + .text(BTN_POS(1,3), BTN_SIZE(4,1), GET_TEXT_F(MSG_HALTED)) + .text(BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_PLEASE_RESET)); + + #undef GRID_COLS + #undef GRID_ROWS + + cmd.cmd(DL::DL_DISPLAY) + .cmd(CMD_SWAP) + .execute(); + + InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, PLAY_SYNCHRONOUS); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp new file mode 100644 index 000000000000..8906a14cf0f4 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/language_menu.cpp @@ -0,0 +1,66 @@ +/********************* + * language_menu.cpp * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../language/language.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && NUM_LANGUAGES > 1 + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void LanguageMenu::onRedraw(draw_mode_t) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)) + .colors(normal_btn) + .font(Theme::font_medium); + + #define GRID_ROWS 8 + #define GRID_COLS 1 + + cmd.tag(1).button(BTN_POS(1,1), BTN_SIZE(1,1), GET_LANGUAGE_NAME(1)); + cmd.tag(2).button(BTN_POS(1,2), BTN_SIZE(1,1), GET_LANGUAGE_NAME(2)); + #if NUM_LANGUAGES > 2 + cmd.tag(3).button(BTN_POS(1,3), BTN_SIZE(1,1), GET_LANGUAGE_NAME(3)); + #if NUM_LANGUAGES > 3 + cmd.tag(4).button(BTN_POS(1,4), BTN_SIZE(1,1), GET_LANGUAGE_NAME(4)); + #if NUM_LANGUAGES > 5 + cmd.tag(5).button(BTN_POS(1,5), BTN_SIZE(1,1), GET_LANGUAGE_NAME(5)); + #endif + #endif + #endif +} + +bool LanguageMenu::onTouchEnd(uint8_t tag) { + + if (tag > 0 && tag <= NUM_LANGUAGES) { + lang = tag - 1; + GOTO_SCREEN(StatusScreen); + return true; + } + return false; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp new file mode 100644 index 000000000000..0e35b4547581 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp @@ -0,0 +1,77 @@ +/***************************** + * linear_advance_screen.cpp * + *****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, LIN_ADVANCE) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void LinearAdvanceScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(2, DEFAULT_LOWEST).color(e_axis); + w.heading( GET_TEXT_F(MSG_LINEAR_ADVANCE)); + #if EXTRUDERS == 1 + w.adjuster( 2, GET_TEXT_F(MSG_LINEAR_ADVANCE_K), getLinearAdvance_mm_mm_s(E0) ); + #else + w.adjuster( 2, GET_TEXT_F(MSG_LINEAR_ADVANCE_K1), getLinearAdvance_mm_mm_s(E0) ); + w.adjuster( 4, GET_TEXT_F(MSG_LINEAR_ADVANCE_K2), getLinearAdvance_mm_mm_s(E1) ); + #if EXTRUDERS > 2 + w.adjuster( 6, GET_TEXT_F(MSG_LINEAR_ADVANCE_K3), getLinearAdvance_mm_mm_s(E2) ); + #if EXTRUDERS > 3 + w.adjuster( 8, GET_TEXT_F(MSG_LINEAR_ADVANCE_K4), getLinearAdvance_mm_mm_s(E3) ); + #endif + #endif + #endif + w.increments(); +} + +bool LinearAdvanceScreen::onTouchHeld(uint8_t tag) { + using namespace ExtUI; + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(LinearAdvance_mm_mm_s, E0); break; + case 3: UI_INCREMENT(LinearAdvance_mm_mm_s, E0); break; + #if EXTRUDERS > 1 + case 4: UI_DECREMENT(LinearAdvance_mm_mm_s, E1); break; + case 5: UI_INCREMENT(LinearAdvance_mm_mm_s, E1); break; + #if EXTRUDERS > 2 + case 6: UI_DECREMENT(LinearAdvance_mm_mm_s, E2); break; + case 7: UI_INCREMENT(LinearAdvance_mm_mm_s, E2); break; + #if EXTRUDERS > 3 + case 8: UI_DECREMENT(LinearAdvance_mm_mm_s, E3); break; + case 9: UI_INCREMENT(LinearAdvance_mm_mm_s, E3); break; + #endif + #endif + #endif + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp new file mode 100644 index 000000000000..f012a2218b55 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp @@ -0,0 +1,214 @@ +/******************* + * lock_screen.cpp * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace Theme; + +uint16_t LockScreen::passcode = 0; + +void LockScreen::onEntry() { + const uint8_t siz = sizeof(screen_data.LockScreen.passcode); + memset(screen_data.LockScreen.passcode, '_', siz-1); + screen_data.LockScreen.passcode[siz-1] = '\0'; + BaseScreen::onEntry(); +} + +void LockScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + } + + if (what & FOREGROUND) { + #ifdef TOUCH_UI_PORTRAIT + #define GRID_COLS 1 + #define GRID_ROWS 10 + #else + #define GRID_COLS 1 + #define GRID_ROWS 7 + #endif + + #undef MARGIN_T + #undef MARGIN_B + #define MARGIN_T 3 + #define MARGIN_B 3 + + progmem_str message; + switch (message_style()) { + case 'w': + message = GET_TEXT_F(MSG_PASSCODE_REJECTED); + break; + case 'g': + message = GET_TEXT_F(MSG_PASSCODE_ACCEPTED); + break; + default: + if (passcode == 0) { + message = GET_TEXT_F(MSG_PASSCODE_SELECT); + } else { + message = GET_TEXT_F(MSG_PASSCODE_REQUEST); + } + } + message_style() = '\0'; // Terminate the string. + + #ifdef TOUCH_UI_PORTRAIT + constexpr uint8_t l = 6; + #else + constexpr uint8_t l = 3; + #endif + + const uint8_t pressed = EventLoop::get_pressed_tag(); + + cmd.font(font_large) + #ifdef TOUCH_UI_PORTRAIT + .text(BTN_POS(1,2), BTN_SIZE(1,1), message) + .font(font_xlarge) + .text(BTN_POS(1,4), BTN_SIZE(1,1), screen_data.LockScreen.passcode) + #else + .text(BTN_POS(1,1), BTN_SIZE(1,1), message) + .font(font_xlarge) + .text(BTN_POS(1,2), BTN_SIZE(1,1), screen_data.LockScreen.passcode) + #endif + .font(font_large) + .colors(normal_btn) + #ifdef TOUCH_UI_PASSCODE + .keys(BTN_POS(1,l+1), BTN_SIZE(1,1), F("123"), pressed) + .keys(BTN_POS(1,l+2), BTN_SIZE(1,1), F("456"), pressed) + .keys(BTN_POS(1,l+3), BTN_SIZE(1,1), F("789"), pressed) + .keys(BTN_POS(1,l+4), BTN_SIZE(1,1), F("0.<"), pressed); + #else + .keys(BTN_POS(1,l+1), BTN_SIZE(1,1), F("1234567890"), pressed) + .keys(BTN_POS(1,l+2), BTN_SIZE(1,1), F("qwertyuiop"), pressed) + .keys(BTN_POS(1,l+3), BTN_SIZE(1,1), F("asdfghjkl "), pressed) + .keys(BTN_POS(1,l+4), BTN_SIZE(1,1), F("zxcvbnm!?<"), pressed); + #endif + + #undef MARGIN_T + #undef MARGIN_B + #define MARGIN_T MARGIN_DEFAULT + #define MARGIN_B MARGIN_DEFAULT + + #undef GRID_COLS + #undef GRID_ROWS + } +} + +char &LockScreen::message_style() { + // We use the last byte of the passcode string as a flag to indicate, + // which message to show. + constexpr uint8_t last_char = sizeof(screen_data.LockScreen.passcode)-1; + return screen_data.LockScreen.passcode[last_char]; +} + +void LockScreen::onPasscodeEntered() { + if (passcode == 0) { + // We are defining a passcode + message_style() = 0; + onRefresh(); + sound.play(twinkle, PLAY_SYNCHRONOUS); + passcode = compute_checksum(); + GOTO_PREVIOUS(); + } else { + // We are verifying a passcode + if (passcode == compute_checksum()) { + message_style() = 'g'; + onRefresh(); + sound.play(twinkle, PLAY_SYNCHRONOUS); + GOTO_PREVIOUS(); + } else { + message_style() = 'w'; + onRefresh(); + sound.play(sad_trombone, PLAY_SYNCHRONOUS); + current_screen.forget(); // Discard the screen the user was trying to go to. + GOTO_PREVIOUS(); + } + } +} + +bool LockScreen::onTouchEnd(uint8_t tag) { + char *c = strchr(screen_data.LockScreen.passcode,'_'); + if (c) { + if (tag == '<') { + if (c != screen_data.LockScreen.passcode) { + // Backspace deletes previous entered characters. + *--c = '_'; + } + } else { + // Append character to passcode + *c++ = tag; + if (*c == '\0') { + // If at last character, then process the code. + onPasscodeEntered(); + } + } + } + return true; +} + +uint16_t LockScreen::compute_checksum() { + uint16_t checksum = 0; + const char* c = screen_data.LockScreen.passcode; + while (*c) { + checksum = (checksum << 2) ^ *c++; + } + if (checksum == 0) checksum = 0xFFFF; // Prevent a zero checksum + return checksum; +} + +// This function should be called *after* calling GOTO_SCREEN +// to move to new screen. If a passcode is enabled, it will +// immediately jump to the keypad screen, pushing the previous +// screen onto the stack. If the code is entered correctly, +// the stack will be popped, allowing the user to proceed to +// the new screen. Otherwise it will be popped twice, taking +// the user back to where they were before. +void LockScreen::check_passcode() { + if (passcode == 0) return; + message_style() = 0; + GOTO_SCREEN(LockScreen); +} + +bool LockScreen::is_enabled() { + return passcode != 0; +} + +void LockScreen::disable() { + passcode = 0; +} + +void LockScreen::enable() { + message_style() = 0; + passcode = 0; + GOTO_SCREEN(LockScreen); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp new file mode 100644 index 000000000000..58a545937c50 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp @@ -0,0 +1,148 @@ +/***************** + * main_menu.cpp * + *****************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void MainMenu::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)); + } + + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(Theme::font_medium) + #ifdef TOUCH_UI_PORTRAIT + #define GRID_ROWS 8 + #define GRID_COLS 2 + .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME)) + .enabled( + #if ENABLED(NOZZLE_CLEAN_FEATURE) + 1 + #endif + ) + .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE)) + .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS)) + .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS)) + .tag(6).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE)) + .enabled( + #if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS) + 1 + #endif + ) + .tag(7).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENTCHANGE)) + .tag(8).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .enabled( + #ifdef PRINTCOUNTER + 1 + #endif + ) + .tag(9).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_STATS_MENU)) + .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU)) + .colors(action_btn) + .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + #undef GRID_COLS + #undef GRID_ROWS + #else + #define GRID_ROWS 5 + #define GRID_COLS 2 + .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME)) + #if ENABLED(TOUCH_UI_COCOA_PRESS) + .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_PREHEAT_1)) + #else + .enabled( + #if ENABLED(NOZZLE_CLEAN_FEATURE) + 1 + #endif + ) + .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE)) + #endif + .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS)) + .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS)) + .tag(6).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TEMPERATURE)) + #if ENABLED(TOUCH_UI_COCOA_PRESS) + .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT)) + #else + .enabled( + #if DISABLED(TOUCH_UI_LULZBOT_BIO) + 1 + #endif + ) + .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENTCHANGE)) + #endif + .tag(8).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .enabled( + #ifdef PRINTCOUNTER + 1 + #endif + ) + .tag(9).button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_STATS_MENU)) + .tag(10).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_MENU)) + .colors(action_btn) + .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK)); + #undef GRID_COLS + #undef GRID_ROWS + #endif + } +} + +bool MainMenu::onTouchEnd(uint8_t tag) { + using namespace ExtUI; + + switch (tag) { + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; + #if ENABLED(TOUCH_UI_COCOA_PRESS) + case 3: GOTO_SCREEN(PreheatTimerScreen); break; + #elif ENABLED(NOZZLE_CLEAN_FEATURE) + case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break; + #endif + case 4: GOTO_SCREEN(MoveAxisScreen); break; + case 5: injectCommands_P(PSTR("M84")); break; + case 6: GOTO_SCREEN(TemperatureScreen); break; + #if ENABLED(TOUCH_UI_COCOA_PRESS) + case 7: GOTO_SCREEN(CaseLightScreen); break; + #else + case 7: GOTO_SCREEN(ChangeFilamentScreen); break; + #endif + case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; +#if ENABLED(PRINTCOUNTER) + case 9: GOTO_SCREEN(StatisticsScreen); break; +#endif + case 10: GOTO_SCREEN(AboutScreen); break; + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp new file mode 100644 index 000000000000..8f7af4b81eda --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp @@ -0,0 +1,86 @@ +/******************************* + * max_acceleration_screen.cpp * + *******************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void MaxAccelerationScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(0); + w.units(GET_TEXT_F(MSG_UNITS_MM_S2)); + w.heading(GET_TEXT_F(MSG_ACCELERATION)); + w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AMAX_X), getAxisMaxAcceleration_mm_s2(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AMAX_Y), getAxisMaxAcceleration_mm_s2(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AMAX_Z), getAxisMaxAcceleration_mm_s2(Z) ); + #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) + w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AMAX_E), getAxisMaxAcceleration_mm_s2(E0) ); + #elif EXTRUDERS > 1 + w.heading(GET_TEXT_F(MSG_AMAX_E)); + w.color(e_axis).adjuster( 8, F(LCD_STR_E0), getAxisMaxAcceleration_mm_s2(E0) ); + w.color(e_axis).adjuster(10, F(LCD_STR_E1), getAxisMaxAcceleration_mm_s2(E1) ); + #if EXTRUDERS > 2 + w.color(e_axis).adjuster(12, F(LCD_STR_E2), getAxisMaxAcceleration_mm_s2(E2) ); + #endif + #if EXTRUDERS > 3 + w.color(e_axis).adjuster(14, F(LCD_STR_E3), getAxisMaxAcceleration_mm_s2(E3) ); + #endif + #endif + w.increments(); +} + +bool MaxAccelerationScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(AxisMaxAcceleration_mm_s2, X ); break; + case 3: UI_INCREMENT(AxisMaxAcceleration_mm_s2, X ); break; + case 4: UI_DECREMENT(AxisMaxAcceleration_mm_s2, Y ); break; + case 5: UI_INCREMENT(AxisMaxAcceleration_mm_s2, Y ); break; + case 6: UI_DECREMENT(AxisMaxAcceleration_mm_s2, Z ); break; + case 7: UI_INCREMENT(AxisMaxAcceleration_mm_s2, Z ); break; + case 8: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E0); break; + case 9: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E0); break; + #if EXTRUDERS > 1 && ENABLED(DISTINCT_E_FACTORS) + case 10: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E1); break; + case 11: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E1); break; + #endif + #if EXTRUDERS > 2 && ENABLED(DISTINCT_E_FACTORS) + case 12: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E2); break; + case 13: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E2); break; + #endif + #if EXTRUDERS > 3 && ENABLED(DISTINCT_E_FACTORS) + case 14: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E3); break; + case 15: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E3); break; + #endif + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp new file mode 100644 index 000000000000..864f6b735d1f --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp @@ -0,0 +1,88 @@ +/*************************** + * max_velocity_screen.cpp * + ***************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void MaxVelocityScreen::onRedraw(draw_mode_t what) { + using namespace ExtUI; + widgets_t w(what); + w.precision(0); + w.units(GET_TEXT_F(MSG_UNITS_MM_S)); + w.heading( GET_TEXT_F(MSG_VELOCITY)); + w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_VMAX_X), getAxisMaxFeedrate_mm_s(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_VMAX_Y), getAxisMaxFeedrate_mm_s(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_VMAX_Z), getAxisMaxFeedrate_mm_s(Z) ); + #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) + w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_VMAX_E), getAxisMaxFeedrate_mm_s(E0) ); + #elif EXTRUDERS > 1 + w.heading(GET_TEXT_F(MSG_VMAX_E)); + w.color(e_axis) .adjuster( 8, F(LCD_STR_E0), getAxisMaxFeedrate_mm_s(E0) ); + w.color(e_axis) .adjuster( 10, F(LCD_STR_E1), getAxisMaxFeedrate_mm_s(E1) ); + #if EXTRUDERS > 2 + w.color(e_axis).adjuster( 12, F(LCD_STR_E2), getAxisMaxFeedrate_mm_s(E2) ); + #endif + #if EXTRUDERS > 3 + w.color(e_axis).adjuster( 14, F(LCD_STR_E3), getAxisMaxFeedrate_mm_s(E3) ); + #endif + #endif + w.increments(); +} + +bool MaxVelocityScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(AxisMaxFeedrate_mm_s, X); break; + case 3: UI_INCREMENT(AxisMaxFeedrate_mm_s, X); break; + case 4: UI_DECREMENT(AxisMaxFeedrate_mm_s, Y); break; + case 5: UI_INCREMENT(AxisMaxFeedrate_mm_s, Y); break; + case 6: UI_DECREMENT(AxisMaxFeedrate_mm_s, Z); break; + case 7: UI_INCREMENT(AxisMaxFeedrate_mm_s, Z); break; + case 8: UI_DECREMENT(AxisMaxFeedrate_mm_s, E0); break; + case 9: UI_INCREMENT(AxisMaxFeedrate_mm_s, E0); break; + #if EXTRUDERS > 1 && ENABLED(DISTINCT_E_FACTORS) + case 10: UI_DECREMENT(AxisMaxFeedrate_mm_s, E1); break; + case 11: UI_INCREMENT(AxisMaxFeedrate_mm_s, E1); break; + #endif + #if EXTRUDERS > 2 && ENABLED(DISTINCT_E_FACTORS) + case 12: UI_DECREMENT(AxisMaxFeedrate_mm_s, E2); break; + case 13: UI_INCREMENT(AxisMaxFeedrate_mm_s, E2); break; + #endif + #if EXTRUDERS > 3 && ENABLED(DISTINCT_E_FACTORS) + case 14: UI_DECREMENT(AxisMaxFeedrate_mm_s, E3); break; + case 15: UI_INCREMENT(AxisMaxFeedrate_mm_s, E3); break; + #endif + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp new file mode 100644 index 000000000000..95a4e6b44ade --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp @@ -0,0 +1,168 @@ +/*************************** + * media_player_screen.cpp * + ***************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +/** + * The MediaPlayerScreen allows an AVI to be played. + * + * It requires a special AVI file. The following video + * and audio codecs must be used: + * + * -vcodec mjpeg -pix_fmt yuvj420p + * -acodec adpcm_ima_wav + * + * To generate a 2 second static screen from a png file: + * + * ffmpeg -i startup.png -vcodec mjpeg -pix_fmt yuvj420p -r 1 video.avi + * sox -n -r 44100 -b 8 -c 2 -L silence.wav trim 0.0 2.000 + * ffmpeg -i silence.wav -acodec adpcm_ima_wav silence.avi + * ffmpeg -i video.avi -i silence.wav -c copy -map 0:v:0 -map 1:a:0 startup.avi + */ + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +#include "../archim2-flash/flash_storage.h" +#include "../archim2-flash/media_file_reader.h" + +using namespace FTDI; + +void MediaPlayerScreen::onEntry() { + BaseScreen::onEntry(); + CLCD::turn_on_backlight(); + SoundPlayer::set_volume(255); +} + +void MediaPlayerScreen::onRedraw(draw_mode_t) { +} + +bool MediaPlayerScreen::playCardMedia() { + #if ENABLED(SDSUPPORT) + char fname[15]; + strcpy_P(fname, PSTR("STARTUP.AVI")); + + MediaFileReader reader; + if (!reader.open(fname)) + return false; + + SERIAL_ECHO_MSG("Starting to play STARTUP.AVI"); + playStream(&reader, MediaFileReader::read); + reader.close(); + #endif + return true; +} + +// Attempt to play media from the onboard SPI flash chip +bool MediaPlayerScreen::playBootMedia() { + UIFlashStorage::BootMediaReader reader; + if (!reader.isAvailable()) return false; + + SERIAL_ECHO_MSG("Starting to play boot video"); + playStream(&reader, UIFlashStorage::BootMediaReader::read); + return true; +} + +void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream) { + #if FTDI_API_LEVEL >= 810 + if (FTDI::ftdi_chip >= 810) { + // Set up the media FIFO on the end of RAMG, as the top of RAMG + // will be used as the framebuffer. + + uint8_t buf[512]; + const uint32_t block_size = 512; + const uint32_t fifo_size = block_size * 2; + const uint32_t fifo_start = CLCD::MAP::RAM_G + CLCD::MAP::RAM_G_SIZE - fifo_size; + + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(0x000000)) + .cmd(CLEAR(true,true,true)) + .cmd(DL::DL_DISPLAY) + .cmd(CMD_SWAP) + .execute() + .cmd(CMD_DLSTART) + .mediafifo(fifo_start, fifo_size) + .playvideo(OPT_FULLSCREEN | OPT_MEDIAFIFO | OPT_NOTEAR | OPT_SOUND) + .cmd(DL::DL_DISPLAY) + .cmd(CMD_SWAP) + .execute(); + + uint32_t writePtr = 0; + int16_t nBytes; + + uint32_t t = millis(); + uint8_t timeouts; + + spiInit(SPI_HALF_SPEED); // Boost SPI speed for video playback + + do { + // Write block n + nBytes = (*data_stream)(obj, buf, block_size); + if (nBytes == -1) break; + + if (millis() - t > 10) { + ExtUI::yield(); + t = millis(); + } + + CLCD::mem_write_bulk (fifo_start + writePtr, buf, nBytes); + + // Wait for FTDI810 to finish playing block n-1 + timeouts = 20; + do { + if (millis() - t > 10) { + ExtUI::yield(); + t = millis(); + timeouts--; + if (timeouts == 0) { + SERIAL_ECHO_MSG("Timeout playing video"); + cmd.reset(); + goto exit; + } + } + } while (CLCD::mem_read_32(CLCD::REG::MEDIAFIFO_READ) != writePtr); + + // Start playing block n + writePtr = (writePtr + nBytes) % fifo_size; + CLCD::mem_write_32(CLCD::REG::MEDIAFIFO_WRITE, writePtr); + } while (nBytes == block_size); + + SERIAL_ECHO_MSG("Done playing video"); + + exit: + spiInit(SPI_SPEED); // Restore default speed + + // Since playing media overwrites RAMG, we need to reinitialize + // everything that is stored in RAMG. + cmd.cmd(CMD_DLSTART).execute(); + DLCache::init(); + StatusScreen::loadBitmaps(); + } + #else + UNUSED(obj); + UNUSED(data_stream); + #endif // FTDI_API_LEVEL >= 810 +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp new file mode 100644 index 000000000000..8513c79f8457 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp @@ -0,0 +1,133 @@ +/************************ + * move_axis_screen.cpp * + ************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace ExtUI; + +void MoveAxisScreen::onEntry() { + // Since Marlin keeps only one absolute position for all the extruders, + // we have to keep track of the relative motion of individual extruders + // ourselves. The relative distances are reset to zero whenever this + // screen is entered. + + for (uint8_t i = 0; i < ExtUI::extruderCount; i++) { + screen_data.MoveAxisScreen.e_rel[i] = 0; + } + BaseNumericAdjustmentScreen::onEntry(); +} + +void MoveAxisScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(1); + w.units(GET_TEXT_F(MSG_UNITS_MM)); + w.heading( GET_TEXT_F(MSG_MOVE_AXIS)); + w.home_buttons(20); + w.color(Theme::x_axis).adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisPosition_mm(X), canMove(X)); + w.color(Theme::y_axis).adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisPosition_mm(Y), canMove(Y)); + w.color(Theme::z_axis).adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisPosition_mm(Z), canMove(Z)); + + w.color(Theme::e_axis); + #if EXTRUDERS == 1 + w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); + #elif EXTRUDERS > 1 + w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); + w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxisScreen.e_rel[1], canMove(E1)); + #if EXTRUDERS > 2 + w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), screen_data.MoveAxisScreen.e_rel[2], canMove(E2)); + #endif + #if EXTRUDERS > 3 + w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), screen_data.MoveAxisScreen.e_rel[3], canMove(E3)); + #endif + #endif + w.increments(); +} + +bool MoveAxisScreen::onTouchHeld(uint8_t tag) { + #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis); + #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis); + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT_AXIS(X); break; + case 3: UI_INCREMENT_AXIS(X); break; + case 4: UI_DECREMENT_AXIS(Y); break; + case 5: UI_INCREMENT_AXIS(Y); break; + case 6: UI_DECREMENT_AXIS(Z); break; + case 7: UI_INCREMENT_AXIS(Z); break; + // For extruders, also update relative distances. + case 8: UI_DECREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] -= increment; break; + case 9: UI_INCREMENT_AXIS(E0); screen_data.MoveAxisScreen.e_rel[0] += increment; break; + #if EXTRUDERS > 1 + case 10: UI_DECREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] -= increment; break; + case 11: UI_INCREMENT_AXIS(E1); screen_data.MoveAxisScreen.e_rel[1] += increment; break; + #endif + #if EXTRUDERS > 2 + case 12: UI_DECREMENT_AXIS(E2); screen_data.MoveAxisScreen.e_rel[2] -= increment; break; + case 13: UI_INCREMENT_AXIS(E2); screen_data.MoveAxisScreen.e_rel[2] += increment; break; + #endif + #if EXTRUDERS > 3 + case 14: UI_DECREMENT_AXIS(E3); screen_data.MoveAxisScreen.e_rel[3] -= increment; break; + case 15: UI_INCREMENT_AXIS(E3); screen_data.MoveAxisScreen.e_rel[3] += increment; break; + #endif + case 20: SpinnerDialogBox::enqueueAndWait_P(F("G28 X")); break; + case 21: SpinnerDialogBox::enqueueAndWait_P(F("G28 Y")); break; + case 22: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break; + case 23: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; + default: + return false; + } + #undef UI_DECREMENT_AXIS + #undef UI_INCREMENT_AXIS + return true; +} + +float MoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) { + // Compute feedrate so that the tool lags the adjuster when it is + // being held down, this allows enough margin for the planner to + // connect segments and even out the motion. + constexpr xyze_feedrate_t max_manual_feedrate = MANUAL_FEEDRATE; + return min(max_manual_feedrate[axis] / 60.0f, abs(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f)); +} + +void MoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) { + ExtUI::setFeedrate_mm_s(getManualFeedrate(X_AXIS + (axis - ExtUI::X), increment_mm)); +} + +void MoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { + ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm)); +} + +void MoveAxisScreen::onIdle() { + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + onRefresh(); + refresh_timer.start(); + } + BaseScreen::onIdle(); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp new file mode 100644 index 000000000000..ae224e9c1135 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp @@ -0,0 +1,73 @@ +/***************************** + * nozzle_offsets_screen.cpp * + *****************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && HOTENDS > 1 + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; + +void NozzleOffsetScreen::onEntry() { + // Since we don't allow the user to edit the offsets for E0, + // make sure they are all zero. + normalizeNozzleOffset(X); + normalizeNozzleOffset(Y); + normalizeNozzleOffset(Z); +} + +void NozzleOffsetScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(2).units(GET_TEXT_F(MSG_UNITS_MM)); + + w.heading( GET_TEXT_F(MSG_OFFSETS_MENU)); + w.color(Theme::x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), ExtUI::getNozzleOffset_mm(X, E1)); + w.color(Theme::y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), ExtUI::getNozzleOffset_mm(Y, E1)); + w.color(Theme::z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), ExtUI::getNozzleOffset_mm(Z, E1)); + #if ENABLED(CALIBRATION_GCODE) + w.button(8, GET_TEXT_F(MSG_MEASURE_AUTOMATICALLY), !isPrinting()); + #endif + w.increments(); +} + +bool NozzleOffsetScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(NozzleOffset_mm, X, E1); break; + case 3: UI_INCREMENT(NozzleOffset_mm, X, E1); break; + case 4: UI_DECREMENT(NozzleOffset_mm, Y, E1); break; + case 5: UI_INCREMENT(NozzleOffset_mm, Y, E1); break; + case 6: UI_DECREMENT(NozzleOffset_mm, Z, E1); break; + case 7: UI_INCREMENT(NozzleOffset_mm, Z, E1); break; + #if ENABLED(CALIBRATION_GCODE) + case 8: GOTO_SCREEN(ConfirmAutoCalibrationDialogBox); return true; + #endif + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp new file mode 100644 index 000000000000..6964a468a9db --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp @@ -0,0 +1,124 @@ +/******************** + * nudge_nozzle.cpp * + ********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, BABYSTEPPING) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void NudgeNozzleScreen::onEntry() { + screen_data.NudgeNozzleScreen.show_offsets = false; + #if EXTRUDERS > 1 + screen_data.NudgeNozzleScreen.link_nozzles = true; + #endif + screen_data.NudgeNozzleScreen.rel.reset(); + + BaseNumericAdjustmentScreen::onEntry(); +} + +void NudgeNozzleScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM)); + + w.heading( GET_TEXT_F(MSG_NUDGE_NOZZLE)); + #if ENABLED(BABYSTEP_XY) + w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), screen_data.NudgeNozzleScreen.rel.x / getAxisSteps_per_mm(X)); + w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), screen_data.NudgeNozzleScreen.rel.y / getAxisSteps_per_mm(Y)); + #endif + w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z)); + w.increments(); + #if EXTRUDERS > 1 + w.toggle (8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles); + #endif + + #if EXTRUDERS > 1 || HAS_BED_PROBE + w.toggle (9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets); + + if (screen_data.NudgeNozzleScreen.show_offsets) { + char str[19]; + + w.draw_mode(BOTH); + w.color(other); + + #if HAS_BED_PROBE + dtostrf(getZOffset_mm(), 4, 2, str); + strcat(str, " "); + strcat_P(str, GET_TEXT(MSG_UNITS_MM)); + w.text_field (0, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), str); + #endif + + #if EXTRUDERS > 1 + format_position(str, getNozzleOffset_mm(X, E1), getNozzleOffset_mm(Y, E1), getNozzleOffset_mm(Z, E1)); + w.text_field (0, GET_TEXT_F(MSG_OFFSETS_MENU), str); + #endif + } + #endif +} + +bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) { + const float inc = getIncrement(); + #if EXTRUDERS > 1 + const bool link = screen_data.NudgeNozzleScreen.link_nozzles; + #else + constexpr bool link = true; + #endif + int16_t steps; + switch (tag) { + case 2: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps(-steps, X, link); screen_data.NudgeNozzleScreen.rel.x -= steps; break; + case 3: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps( steps, X, link); screen_data.NudgeNozzleScreen.rel.x += steps; break; + case 4: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps(-steps, Y, link); screen_data.NudgeNozzleScreen.rel.y -= steps; break; + case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break; + case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break; + case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break; + #if EXTRUDERS > 1 + case 8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break; + #endif + case 9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break; + default: + return false; + } + #if EXTRUDERS > 1 || HAS_BED_PROBE + SaveSettingsDialogBox::settingsChanged(); + #endif + return true; +} + +bool NudgeNozzleScreen::onTouchEnd(uint8_t tag) { + if (tag == 1) { + SaveSettingsDialogBox::promptToSaveSettings(); + return true; + } else { + return BaseNumericAdjustmentScreen::onTouchEnd(tag); + } +} + +void NudgeNozzleScreen::onIdle() { + reset_menu_timeout(); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp new file mode 100644 index 000000000000..0a24c3008204 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp @@ -0,0 +1,115 @@ +/**************************** + * preheat_timer_screen.cpp * + ****************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_COCOA_PRESS) + +#include "screens.h" +#include "screen_data.h" + +#include "../ftdi_eve_lib/extras/circular_progress.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define GRID_COLS 2 +#define GRID_ROWS 5 + +void PreheatTimerScreen::draw_message(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + draw_text_box(cmd, BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_HEATING), OPT_CENTER, font_large); + } +} + +uint16_t PreheatTimerScreen::secondsRemaining() { + const uint32_t elapsed_sec = (millis() - screen_data.PreheatTimerScreen.start_ms) / 1000; + return (COCOA_PRESS_PREHEAT_SECONDS > elapsed_sec) ? COCOA_PRESS_PREHEAT_SECONDS - elapsed_sec : 0; +} + +void PreheatTimerScreen::draw_time_remaining(draw_mode_t what) { + if (what & FOREGROUND) { + const uint16_t elapsed_sec = secondsRemaining(); + const uint8_t min = elapsed_sec / 60, + sec = elapsed_sec % 60; + + char str[10]; + sprintf_P(str, PSTR("%02d:%02d"), min, sec); + + CommandProcessor cmd; + cmd.font(font_xlarge); + draw_circular_progress(cmd, BTN_POS(1,1), BTN_SIZE(1,5), float(secondsRemaining()) * 100 / COCOA_PRESS_PREHEAT_SECONDS, str, theme_dark, theme_darkest); + } +} + +void PreheatTimerScreen::draw_interaction_buttons(draw_mode_t what) { + if (what & FOREGROUND) { + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(font_medium) + .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Cancel")); + } +} + +void PreheatTimerScreen::onEntry() { + screen_data.PreheatTimerScreen.start_ms = millis(); + #ifdef COCOA_PRESS_PREHEAT_SCRIPT + injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_SCRIPT)); + #endif +} + +void PreheatTimerScreen::onRedraw(draw_mode_t what) { + draw_message(what); + draw_time_remaining(what); + draw_interaction_buttons(what); +} + +bool PreheatTimerScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; + default: break; + } + return false; +} + +void PreheatTimerScreen::onIdle() { + if (secondsRemaining() == 0) { + AlertDialogBox::show(GET_TEXT_F(MSG_PREHEAT_FINISHED)); + // Remove SaveSettingsDialogBox from the stack + // so the alert box doesn't return to me. + current_screen.forget(); + } + + reset_menu_timeout(); + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + onRefresh(); + refresh_timer.start(); + } + BaseScreen::onIdle(); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp new file mode 100644 index 000000000000..a5fe95490f74 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp @@ -0,0 +1,51 @@ +/*********************************** + * restore_failsafe_dialog_box.cpp * + ***********************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace ExtUI; + +void RestoreFailsafeDialogBox::onRedraw(draw_mode_t) { + drawMessage(GET_TEXT_F(MSG_EEPROM_RESET_WARNING)); + drawYesNoButtons(); +} + +bool RestoreFailsafeDialogBox::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + ExtUI::injectCommands_P(PSTR("M502")); + AlertDialogBox::show(GET_TEXT_F(MSG_EEPROM_RESET)); + // Remove RestoreFailsafeDialogBox from the stack + // so the alert box doesn't return to it. + current_screen.forget(); + SaveSettingsDialogBox::settingsChanged(); + return true; + default: + return DialogBoxBaseClass::onTouchEnd(tag); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp new file mode 100644 index 000000000000..5ffe20cce1e9 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp @@ -0,0 +1,65 @@ +/******************************** + * save_settings_dialog_box.cpp * + ********************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace ExtUI; + +bool SaveSettingsDialogBox::needs_save = false; + +void SaveSettingsDialogBox::onRedraw(draw_mode_t) { + drawMessage(GET_TEXT_F(MSG_EEPROM_SAVE_PROMPT)); + drawYesNoButtons(); +} + +bool SaveSettingsDialogBox::onTouchEnd(uint8_t tag) { + needs_save = false; + switch (tag) { + case 1: + injectCommands_P(PSTR("M500")); + AlertDialogBox::show(GET_TEXT_F(MSG_EEPROM_SAVED)); + // Remove SaveSettingsDialogBox from the stack + // so the alert box doesn't return to me. + current_screen.forget(); + return true; + default: + return DialogBoxBaseClass::onTouchEnd(tag); + } +} + +void SaveSettingsDialogBox::promptToSaveSettings() { + if (needs_save) { + // Remove current screen from the stack + // so SaveSettingsDialogBox doesn't return here. + GOTO_SCREEN(SaveSettingsDialogBox); + current_screen.forget(); + } else { + // No save needed. + GOTO_PREVIOUS(); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screen_data.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screen_data.h new file mode 100644 index 000000000000..6e2cb97a984a --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screen_data.h @@ -0,0 +1,86 @@ +/***************** + * screen_data.h * + *****************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "../ftdi_eve_lib/ftdi_eve_lib.h" + +// To save RAM, store state information related to a particular screen +// in a union. The values should be initialized in the onEntry method. + +struct base_numeric_adjustment_t {uint8_t increment;}; + +union screen_data_t { + struct base_numeric_adjustment_t BaseNumericAdjustmentScreen; + struct {uint8_t volume; uint8_t brightness;} InterfaceSettingsScreen; + struct {char passcode[5];} LockScreen; + struct {bool isError;} AlertDialogBox; + struct {bool auto_hide;} SpinnerDialogBox; + struct {uint8_t file_index;} ConfirmStartPrintDialogBox; + struct { + uint8_t e_tag, t_tag, repeat_tag; + ExtUI::extruder_t saved_extruder; + #if FILAMENT_UNLOAD_PURGE_LENGTH > 0 + bool need_purge; + #endif + } ChangeFilamentScreen; + struct { + struct { + uint8_t is_dir : 1; + uint8_t is_root : 1; + } flags; + uint8_t selected_tag; + uint8_t num_page; + uint8_t cur_page; + #if ENABLED(SCROLL_LONG_FILENAMES) && (FTDI_API_LEVEL >= 810) + uint16_t scroll_pos; + uint16_t scroll_max; + #endif + } FilesScreen; + struct { + struct base_numeric_adjustment_t placeholder; + float e_rel[ExtUI::extruderCount]; + } MoveAxisScreen; +#if ENABLED(TOUCH_UI_DEVELOPER_MENU) + struct { + uint32_t next_watchdog_trigger; + const char* message; + } StressTestScreen; +#endif +#if ENABLED(TOUCH_UI_COCOA_PRESS) + struct { + uint32_t start_ms; + } PreheatTimerScreen; +#endif +#if ENABLED(BABYSTEPPING) + struct { + struct base_numeric_adjustment_t placeholder; + xyz_int_t rel; + #if EXTRUDERS > 1 + bool link_nozzles; + #endif + bool show_offsets; + } NudgeNozzleScreen; +#endif +}; + +extern screen_data_t screen_data; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.cpp new file mode 100644 index 000000000000..bc9280005400 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.cpp @@ -0,0 +1,123 @@ +/*************** + * screens.cpp * + ***************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) +#include "screens.h" +#include "screen_data.h" + +tiny_timer_t refresh_timer; +screen_data_t screen_data; + +SCREEN_TABLE { + DECL_SCREEN(BootScreen), + #if NUM_LANGUAGES > 1 + DECL_SCREEN(LanguageMenu), + #endif + DECL_SCREEN(TouchCalibrationScreen), + DECL_SCREEN(StatusScreen), + DECL_SCREEN(MainMenu), + DECL_SCREEN(TuneMenu), + DECL_SCREEN(AdvancedSettingsMenu), + DECL_SCREEN(AlertDialogBox), + DECL_SCREEN(ConfirmUserRequestAlertBox), + DECL_SCREEN(RestoreFailsafeDialogBox), + DECL_SCREEN(SaveSettingsDialogBox), + DECL_SCREEN(ConfirmStartPrintDialogBox), + DECL_SCREEN(ConfirmAbortPrintDialogBox), +#if ENABLED(CALIBRATION_GCODE) + DECL_SCREEN(ConfirmAutoCalibrationDialogBox), +#endif + DECL_SCREEN(SpinnerDialogBox), + DECL_SCREEN(AboutScreen), +#if ENABLED(PRINTCOUNTER) + DECL_SCREEN(StatisticsScreen), +#endif +#if ENABLED(BABYSTEPPING) + DECL_SCREEN(NudgeNozzleScreen), +#endif + DECL_SCREEN(MoveAxisScreen), + DECL_SCREEN(StepsScreen), +#if HAS_TRINAMIC + DECL_SCREEN(StepperCurrentScreen), + DECL_SCREEN(StepperBumpSensitivityScreen), +#endif +#if HAS_BED_PROBE + DECL_SCREEN(ZOffsetScreen), +#endif +#if HOTENDS > 1 + DECL_SCREEN(NozzleOffsetScreen), +#endif +#if ENABLED(BACKLASH_GCODE) + DECL_SCREEN(BacklashCompensationScreen), +#endif + DECL_SCREEN(FeedratePercentScreen), + DECL_SCREEN(MaxVelocityScreen), + DECL_SCREEN(MaxAccelerationScreen), + DECL_SCREEN(DefaultAccelerationScreen), +#if DISABLED(CLASSIC_JERK) + DECL_SCREEN(JunctionDeviationScreen), +#else + DECL_SCREEN(JerkScreen), +#endif +#if HAS_CASE_LIGHT + DECL_SCREEN(CaseLightScreen), +#endif +#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + DECL_SCREEN(FilamentMenu), +#endif +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + DECL_SCREEN(FilamentRunoutScreen), +#endif +#if ENABLED(LIN_ADVANCE) + DECL_SCREEN(LinearAdvanceScreen), +#endif + DECL_SCREEN(TemperatureScreen), + DECL_SCREEN(ChangeFilamentScreen), + DECL_SCREEN(InterfaceSettingsScreen), + DECL_SCREEN(InterfaceSoundsScreen), + DECL_SCREEN(LockScreen), + DECL_SCREEN(FilesScreen), + DECL_SCREEN(EndstopStatesScreen), +#if ENABLED(TOUCH_UI_LULZBOT_BIO) + DECL_SCREEN(BioPrintingDialogBox), + DECL_SCREEN(BioConfirmHomeXYZ), + DECL_SCREEN(BioConfirmHomeE), +#endif +#if ENABLED(TOUCH_UI_COCOA_PRESS) + DECL_SCREEN(PreheatTimerScreen), +#endif +#if ENABLED(TOUCH_UI_DEVELOPER_MENU) + DECL_SCREEN(DeveloperMenu), + DECL_SCREEN(ConfirmEraseFlashDialogBox), + DECL_SCREEN(WidgetsScreen), + DECL_SCREEN(TouchRegistersScreen), + DECL_SCREEN(StressTestScreen), +#endif + DECL_SCREEN(MediaPlayerScreen), + DECL_SCREEN(DisplayTuningScreen) +}; + +SCREEN_TABLE_POST + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.h new file mode 100644 index 000000000000..4e6d8d3e2dd6 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/screens.h @@ -0,0 +1,783 @@ +/************* + * screens.h * + *************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "../ftdi_eve_lib/ftdi_eve_lib.h" +#include "../language/language.h" +#include "../theme/theme.h" +#include "string_format.h" + +extern tiny_timer_t refresh_timer; + +/********************************* DL CACHE SLOTS ******************************/ + +// In order to reduce SPI traffic, we cache display lists (DL) in RAMG. This +// is done using the CLCD::DLCache class, which takes a unique ID for each +// cache location. These IDs are defined here: + +enum { + STATUS_SCREEN_CACHE, + MENU_SCREEN_CACHE, + TUNE_SCREEN_CACHE, + ADJUST_OFFSETS_SCREEN_CACHE, + ALERT_BOX_CACHE, + SPINNER_CACHE, + ADVANCED_SETTINGS_SCREEN_CACHE, + MOVE_AXIS_SCREEN_CACHE, + TEMPERATURE_SCREEN_CACHE, + STEPS_SCREEN_CACHE, + STEPPER_CURRENT_SCREEN_CACHE, + STEPPER_BUMP_SENSITIVITY_SCREEN_CACHE, + ZOFFSET_SCREEN_CACHE, + NOZZLE_OFFSET_SCREEN_CACHE, + BACKLASH_COMPENSATION_SCREEN_CACHE, + MAX_FEEDRATE_SCREEN_CACHE, + MAX_VELOCITY_SCREEN_CACHE, + MAX_ACCELERATION_SCREEN_CACHE, + DEFAULT_ACCELERATION_SCREEN_CACHE, +#if DISABLED(CLASSIC_JERK) + JUNC_DEV_SCREEN_CACHE, +#else + JERK_SCREEN_CACHE, +#endif +#if HAS_CASE_LIGHT + CASE_LIGHT_SCREEN_CACHE, +#endif +#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + FILAMENT_MENU_CACHE, +#endif +#if ENABLED(LIN_ADVANCE) + LINEAR_ADVANCE_SCREEN_CACHE, +#endif +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + FILAMENT_RUNOUT_SCREEN_CACHE, +#endif +#if ENABLED(TOUCH_UI_LULZBOT_BIO) + PRINTING_SCREEN_CACHE, +#endif +#if ENABLED(TOUCH_UI_COCOA_PRESS) + PREHEAT_TIMER_SCREEN_CACHE, +#endif + CHANGE_FILAMENT_SCREEN_CACHE, + INTERFACE_SETTINGS_SCREEN_CACHE, + INTERFACE_SOUNDS_SCREEN_CACHE, + LOCK_SCREEN_CACHE, + FILES_SCREEN_CACHE, + DISPLAY_TIMINGS_SCREEN_CACHE +}; + +// To save MCU RAM, the status message is "baked" in to the status screen +// cache, so we reserve a large chunk of memory for the DL cache + +#define STATUS_SCREEN_DL_SIZE 2048 +#define ALERT_BOX_DL_SIZE 3072 +#define SPINNER_DL_SIZE 3072 +#define FILE_SCREEN_DL_SIZE 3072 +#define PRINTING_SCREEN_DL_SIZE 2048 + +/************************* MENU SCREEN DECLARATIONS *************************/ + +class BaseScreen : public UIScreen { + protected: + #ifdef LCD_TIMEOUT_TO_STATUS + static uint32_t last_interaction; + #endif + + static bool buttonIsPressed(uint8_t tag); + + public: + static bool buttonStyleCallback(CommandProcessor &, uint8_t, uint8_t &, uint16_t &, bool); + + static void reset_menu_timeout(); + + static void onEntry(); + static void onIdle(); +}; + +class BootScreen : public BaseScreen, public UncachedScreen { + private: + static void showSplashScreen(); + public: + static void onRedraw(draw_mode_t); + static void onIdle(); +}; + +class AboutScreen : public BaseScreen, public UncachedScreen { + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; + +#if ENABLED(PRINTCOUNTER) + class StatisticsScreen : public BaseScreen, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; +#endif + +class KillScreen { + // The KillScreen is behaves differently than the + // others, so we do not bother extending UIScreen. + public: + static void show(const char*); +}; + +class DialogBoxBaseClass : public BaseScreen { + protected: + template static void drawMessage(const T, int16_t font = 0); + static void drawYesNoButtons(uint8_t default_btn = 0); + static void drawOkayButton(); + static void drawSpinner(); + static void drawButton(const progmem_str); + + static void onRedraw(draw_mode_t) {}; + public: + static bool onTouchEnd(uint8_t tag); + static void onIdle(); +}; + +class AlertDialogBox : public DialogBoxBaseClass, public CachedScreen { + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + template static void show(T); + template static void showError(T); + static void hide(); +}; + +class RestoreFailsafeDialogBox : public DialogBoxBaseClass, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; + +class SaveSettingsDialogBox : public DialogBoxBaseClass, public UncachedScreen { + private: + static bool needs_save; + + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + + static void promptToSaveSettings(); + static void settingsChanged() {needs_save = true;} +}; + +class ConfirmStartPrintDialogBox : public DialogBoxBaseClass, public UncachedScreen { + private: + inline static const char *getShortFilename() {return getFilename(false);} + inline static const char *getLongFilename() {return getFilename(true);} + + static const char *getFilename(bool longName); + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t); + + static void show(uint8_t file_index); +}; + +class ConfirmAbortPrintDialogBox : public DialogBoxBaseClass, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; + +#if ENABLED(CALIBRATION_GCODE) +class ConfirmAutoCalibrationDialogBox : public DialogBoxBaseClass, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; +#endif + +class ConfirmUserRequestAlertBox : public AlertDialogBox { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t); + static void hide(); + static void show(const char*); +}; + +class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static void onIdle(); + + static void show(const progmem_str); + static void hide(); + static void enqueueAndWait_P(const progmem_str commands); + static void enqueueAndWait_P(const progmem_str message, const progmem_str commands); +}; + +#if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS) +class StatusScreen : public BaseScreen, public CachedScreen { + private: + static void draw_axis_position(draw_mode_t); + static void draw_temperature(draw_mode_t); + static void draw_progress(draw_mode_t); + static void draw_interaction_buttons(draw_mode_t); + static void draw_status_message(draw_mode_t, const char * const); + + public: + static void loadBitmaps(); + static void setStatusMessage(const char *); + static void setStatusMessage(progmem_str); + static void onRedraw(draw_mode_t); + static void onStartup(); + static void onEntry(); + static void onIdle(); + static bool onTouchEnd(uint8_t tag); +}; +#else + class StatusScreen : public BaseScreen, public CachedScreen { + private: + static float increment; + static bool jog_xy; + static bool fine_motion; + + static void draw_temperature(draw_mode_t what); + static void draw_syringe(draw_mode_t what); + static void draw_arrows(draw_mode_t what); + static void draw_overlay_icons(draw_mode_t what); + static void draw_fine_motion(draw_mode_t what); + static void draw_buttons(draw_mode_t what); + public: + static void loadBitmaps(); + static void unlockMotors(); + + static void setStatusMessage(const char *); + static void setStatusMessage(progmem_str); + + static void onRedraw(draw_mode_t); + + static bool onTouchStart(uint8_t tag); + static bool onTouchHeld(uint8_t tag); + static bool onTouchEnd(uint8_t tag); + static void onIdle(); + + }; +#endif + +#if ENABLED(TOUCH_UI_LULZBOT_BIO) + class BioPrintingDialogBox : public BaseScreen, public CachedScreen { + private: + static void draw_status_message(draw_mode_t, const char * const); + static void draw_progress(draw_mode_t); + static void draw_time_remaining(draw_mode_t); + static void draw_interaction_buttons(draw_mode_t); + public: + static void onRedraw(draw_mode_t); + + static void show(); + + static void setStatusMessage(const char *); + static void setStatusMessage(progmem_str); + + static void onIdle(); + static bool onTouchEnd(uint8_t tag); + }; + + class BioConfirmHomeXYZ : public DialogBoxBaseClass, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; + + class BioConfirmHomeE : public DialogBoxBaseClass, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; +#endif + +#if ENABLED(TOUCH_UI_COCOA_PRESS) + class PreheatTimerScreen : public BaseScreen, public CachedScreen { + private: + static uint16_t secondsRemaining(); + + static void draw_message(draw_mode_t); + static void draw_time_remaining(draw_mode_t); + static void draw_interaction_buttons(draw_mode_t); + public: + static void onRedraw(draw_mode_t); + + static void onEntry(); + static void onIdle(); + static bool onTouchEnd(uint8_t tag); + }; +#endif + +class MainMenu : public BaseScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; + +class TuneMenu : public BaseScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; + +class TouchCalibrationScreen : public BaseScreen, public UncachedScreen { + public: + static void onRefresh(); + static void onEntry(); + static void onRedraw(draw_mode_t); + static void onIdle(); +}; + +class TouchRegistersScreen : public BaseScreen, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; + +class AdvancedSettingsMenu : public BaseScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; + +class ChangeFilamentScreen : public BaseScreen, public CachedScreen { + private: + static uint8_t getSoftenTemp(); + static ExtUI::extruder_t getExtruder(); + static void drawTempGradient(uint16_t x, uint16_t y, uint16_t w, uint16_t h); + static uint32_t getTempColor(uint32_t temp); + static void doPurge(); + public: + static void onEntry(); + static void onExit(); + static void onRedraw(draw_mode_t); + static bool onTouchStart(uint8_t tag); + static bool onTouchEnd(uint8_t tag); + static bool onTouchHeld(uint8_t tag); + static void onIdle(); +}; + +class BaseNumericAdjustmentScreen : public BaseScreen { + public: + enum precision_default_t { + DEFAULT_LOWEST, + DEFAULT_MIDRANGE, + DEFAULT_HIGHEST + }; + + protected: + class widgets_t { + private: + draw_mode_t _what; + uint8_t _line; + uint32_t _color; + uint8_t _decimals; + progmem_str _units; + enum style_t { + BTN_NORMAL, + BTN_ACTION, + BTN_TOGGLE, + BTN_DISABLED, + TEXT_AREA, + TEXT_LABEL + } _style; + + protected: + void _draw_increment_btn(CommandProcessor &, uint8_t line, const uint8_t tag); + void _button(CommandProcessor &, uint8_t tag, int16_t x, int16_t y, int16_t w, int16_t h, progmem_str, bool enabled = true, bool highlight = false); + void _button_style(CommandProcessor &cmd, style_t style); + public: + widgets_t(draw_mode_t); + + widgets_t &color(uint32_t color) {_color = color; return *this;} + widgets_t &units(progmem_str units) {_units = units; return *this;} + widgets_t &draw_mode(draw_mode_t what) {_what = what; return *this;} + widgets_t &precision(uint8_t decimals, precision_default_t = DEFAULT_HIGHEST); + + void heading (progmem_str label); + void adjuster_sram_val (uint8_t tag, progmem_str label, const char *value, bool is_enabled = true); + void adjuster (uint8_t tag, progmem_str label, const char *value, bool is_enabled = true); + void adjuster (uint8_t tag, progmem_str label, float value=0, bool is_enabled = true); + void button (uint8_t tag, progmem_str label, bool is_enabled = true); + void text_field (uint8_t tag, progmem_str label, const char *value, bool is_enabled = true); + void two_buttons (uint8_t tag1, progmem_str label1, + uint8_t tag2, progmem_str label2, bool is_enabled = true); + void toggle (uint8_t tag, progmem_str label, bool value, bool is_enabled = true); + void home_buttons (uint8_t tag); + void increments (); + }; + + static float getIncrement(); + + public: + static void onEntry(); + static bool onTouchEnd(uint8_t tag); +}; + +class MoveAxisScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + private: + static float getManualFeedrate(uint8_t axis, float increment_mm); + public: + static void setManualFeedrate(ExtUI::axis_t, float increment_mm); + static void setManualFeedrate(ExtUI::extruder_t, float increment_mm); + + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + static void onIdle(); +}; + +class StepsScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; + +#if HAS_TRINAMIC + class StepperCurrentScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; + + class StepperBumpSensitivityScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#endif + +#if HAS_BED_PROBE + class ZOffsetScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#endif + +#if HOTENDS > 1 + class NozzleOffsetScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#endif + +#if ENABLED(BABYSTEPPING) + class NudgeNozzleScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + static bool onTouchHeld(uint8_t tag); + static void onIdle(); + }; +#endif + +#if ENABLED(BACKLASH_GCODE) + class BacklashCompensationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#endif + +class FeedratePercentScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; + +class MaxVelocityScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; + +class MaxAccelerationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; + +class DefaultAccelerationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; + +#if DISABLED(CLASSIC_JERK) + class JunctionDeviationScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#else + class JerkScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#endif + +#if HAS_CASE_LIGHT + class CaseLightScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#endif + +#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + class FilamentMenu : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; +#endif + +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + class FilamentRunoutScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#endif + +#if ENABLED(LIN_ADVANCE) + class LinearAdvanceScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + }; +#endif + +class TemperatureScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; + +class InterfaceSoundsScreen : public BaseScreen, public CachedScreen { + public: + enum event_t { + PRINTING_STARTED = 0, + PRINTING_FINISHED = 1, + PRINTING_FAILED = 2, + + NUM_EVENTS + }; + + private: + friend class InterfaceSettingsScreen; + + static uint8_t event_sounds[NUM_EVENTS]; + + static const char* getSoundSelection(event_t); + static void toggleSoundSelection(event_t); + static void setSoundSelection(event_t, const FTDI::SoundPlayer::sound_t*); + + public: + static void playEventSound(event_t, FTDI::play_mode_t = FTDI::PLAY_ASYNCHRONOUS); + + static void defaultSettings(); + + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchStart(uint8_t tag); + static bool onTouchEnd(uint8_t tag); + static void onIdle(); +}; + +class InterfaceSettingsScreen : public BaseScreen, public CachedScreen { + private: + struct persistent_data_t { + uint32_t touch_transform_a; + uint32_t touch_transform_b; + uint32_t touch_transform_c; + uint32_t touch_transform_d; + uint32_t touch_transform_e; + uint32_t touch_transform_f; + uint16_t passcode; + uint8_t display_brightness; + int8_t display_h_offset_adj; + int8_t display_v_offset_adj; + uint8_t sound_volume; + uint8_t bit_flags; + uint8_t event_sounds[InterfaceSoundsScreen::NUM_EVENTS]; + }; + + public: + #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE + static bool backupEEPROM(); + #endif + + static void saveSettings(char *); + static void loadSettings(const char *); + static void defaultSettings(); + static void failSafeSettings(); + + static void onStartup(); + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchStart(uint8_t tag); + static bool onTouchEnd(uint8_t tag); + static void onIdle(); +}; + +class LockScreen : public BaseScreen, public CachedScreen { + private: + friend InterfaceSettingsScreen; + + static uint16_t passcode; + + static char & message_style(); + static uint16_t compute_checksum(); + static void onPasscodeEntered(); + public: + static bool is_enabled(); + static void check_passcode(); + static void enable(); + static void disable(); + + static void set_hash(uint16_t pass) {passcode = pass;}; + static uint16_t get_hash() {return passcode;}; + + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; + +class FilesScreen : public BaseScreen, public CachedScreen { + private: + #ifdef TOUCH_UI_PORTRAIT + static constexpr uint8_t header_h = 2; + static constexpr uint8_t footer_h = 2; + static constexpr uint8_t files_per_page = 11; + #else + static constexpr uint8_t header_h = 1; + static constexpr uint8_t footer_h = 1; + static constexpr uint8_t files_per_page = 6; + #endif + + static uint8_t getTagForLine(uint8_t line) {return line + 2;} + static uint8_t getLineForTag(uint8_t tag) {return tag - 2;} + static uint16_t getFileForTag(uint8_t tag); + static uint16_t getSelectedFileIndex(); + + inline static const char *getSelectedShortFilename() {return getSelectedFilename(false);} + inline static const char *getSelectedLongFilename() {return getSelectedFilename(true);} + static const char *getSelectedFilename(bool longName); + + static void drawFileButton(const char* filename, uint8_t tag, bool is_dir, bool is_highlighted); + static void drawFileList(); + static void drawHeader(); + static void drawFooter(); + static void drawSelectedFile(); + + static void gotoPage(uint8_t); + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + static void onIdle(); +}; + +class EndstopStatesScreen : public BaseScreen, public UncachedScreen { + public: + static void onEntry(); + static void onExit(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + static void onIdle(); +}; + +class DisplayTuningScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; + +#if ENABLED(TOUCH_UI_DEVELOPER_MENU) + class DeveloperMenu : public BaseScreen, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; + + class ConfirmEraseFlashDialogBox : public DialogBoxBaseClass, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; + + class WidgetsScreen : public BaseScreen, public UncachedScreen { + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchStart(uint8_t tag); + static void onIdle(); + }; + + class StressTestScreen : public BaseScreen, public UncachedScreen { + private: + static void drawDots(uint16_t x, uint16_t y, uint16_t h, uint16_t v); + static bool watchDogTestNow(); + static void recursiveLockup(); + static void iterativeLockup(); + static void runTestOnBootup(bool enable); + + public: + static void startupCheck(); + + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + static void onIdle(); + }; +#endif + +class MediaPlayerScreen : public BaseScreen, public UncachedScreen { + private: + typedef int16_t media_streamer_func_t(void *obj, void *buff, size_t bytes); + + public: + static bool playCardMedia(); + static bool playBootMedia(); + + static void onEntry(); + static void onRedraw(draw_mode_t); + + static void playStream(void *obj, media_streamer_func_t*); +}; + +#if NUM_LANGUAGES > 1 + class LanguageMenu : public BaseScreen, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; +#endif diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp new file mode 100644 index 000000000000..05df0f3995bb --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp @@ -0,0 +1,68 @@ +/************************** + * spinner_dialog_box.cpp * + **************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" +#include "screen_data.h" + +using namespace FTDI; +using namespace ExtUI; + +void SpinnerDialogBox::onRedraw(draw_mode_t) { +} + +void SpinnerDialogBox::show(const progmem_str message) { + drawMessage(message); + drawSpinner(); + storeBackground(); + screen_data.SpinnerDialogBox.auto_hide = false; +} + +void SpinnerDialogBox::hide() { + CommandProcessor cmd; + cmd.stop().execute(); +} + +void SpinnerDialogBox::enqueueAndWait_P(const progmem_str commands) { + enqueueAndWait_P(GET_TEXT_F(MSG_PLEASE_WAIT), commands); +} + +void SpinnerDialogBox::enqueueAndWait_P(const progmem_str message, const progmem_str commands) { + show(message); + GOTO_SCREEN(SpinnerDialogBox); + ExtUI::injectCommands_P((const char*)commands); + screen_data.SpinnerDialogBox.auto_hide = true; +} + +void SpinnerDialogBox::onIdle() { + reset_menu_timeout(); + if (screen_data.SpinnerDialogBox.auto_hide && !commandsInQueue()) { + screen_data.SpinnerDialogBox.auto_hide = false; + hide(); + GOTO_PREVIOUS(); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp new file mode 100644 index 000000000000..e28e5d9b81f6 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp @@ -0,0 +1,78 @@ +/************************* + * statistics_screen.cpp * + *************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, PRINTCOUNTER) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define GRID_COLS 4 +#define GRID_ROWS 7 + +void StatisticsScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + char buffer[21]; + + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0) + + .font(Theme::font_medium) + .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INFO_STATS_MENU)) + .font(Theme::font_small) + .tag(0) + .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_COUNT), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_COMPLETED_PRINTS), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_TIME), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_LONGEST), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_FILAMENT), OPT_RIGHTX | OPT_CENTERY); + // Don't chain the following, it causes strange issues with evaluation ordering! + cmd.text(BTN_POS(3,2), BTN_SIZE(2,1), getTotalPrints_str(buffer)); + cmd.text(BTN_POS(3,3), BTN_SIZE(2,1), getFinishedPrints_str(buffer)); + cmd.text(BTN_POS(3,4), BTN_SIZE(2,1), getTotalPrintTime_str(buffer)); + cmd.text(BTN_POS(3,5), BTN_SIZE(2,1), getLongestPrint_str(buffer)); + cmd.text(BTN_POS(3,6), BTN_SIZE(2,1), getFilamentUsed_str(buffer)); + } + + if (what & FOREGROUND) { + cmd.font(Theme::font_medium) + .colors(action_btn) + .tag(1).button(BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXT_F(MSG_BACK)); + } +} + +bool StatisticsScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; + default: return false; + } +} + +#endif // TOUCH_UI_FTDI_EVE && PRINTCOUNTER diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp new file mode 100644 index 000000000000..bc2cce2ff666 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/status_screen.cpp @@ -0,0 +1,413 @@ +/********************* + * status_screen.cpp * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS) + +#include "screens.h" +#include "screen_data.h" + +#include "../archim2-flash/flash_storage.h" + +using namespace FTDI; +using namespace Theme; + +#ifdef TOUCH_UI_PORTRAIT + #define GRID_ROWS 8 +#else + #define GRID_ROWS 8 +#endif + +void StatusScreen::draw_axis_position(draw_mode_t what) { + CommandProcessor cmd; + + #define GRID_COLS 3 + + if (what & BACKGROUND) { + cmd.tag(6) + #ifdef TOUCH_UI_PORTRAIT + .fgcolor(Theme::axis_label) + .font(Theme::font_large) + .button( BTN_POS(1,5), BTN_SIZE(2,1), F(""), OPT_FLAT) + .button( BTN_POS(1,6), BTN_SIZE(2,1), F(""), OPT_FLAT) + .button( BTN_POS(1,7), BTN_SIZE(2,1), F(""), OPT_FLAT) + + .font(Theme::font_small) + .text ( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_X)) + .text ( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Y)) + .text ( BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Z)) + + .font(Theme::font_medium) + .fgcolor(Theme::x_axis) .button( BTN_POS(2,5), BTN_SIZE(2,1), F(""), OPT_FLAT) + .fgcolor(Theme::y_axis) .button( BTN_POS(2,6), BTN_SIZE(2,1), F(""), OPT_FLAT) + .fgcolor(Theme::z_axis) .button( BTN_POS(2,7), BTN_SIZE(2,1), F(""), OPT_FLAT); + #else + .fgcolor(Theme::axis_label) + .font(Theme::font_large) + .button( BTN_POS(1,5), BTN_SIZE(1,2), F(""), OPT_FLAT) + .button( BTN_POS(2,5), BTN_SIZE(1,2), F(""), OPT_FLAT) + .button( BTN_POS(3,5), BTN_SIZE(1,2), F(""), OPT_FLAT) + + .font(Theme::font_small) + .text ( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_X)) + .text ( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Y)) + .text ( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_AXIS_Z)) + .font(Theme::font_medium) + + .fgcolor(Theme::x_axis) .button( BTN_POS(1,6), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(Theme::y_axis) .button( BTN_POS(2,6), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(Theme::z_axis) .button( BTN_POS(3,6), BTN_SIZE(1,1), F(""), OPT_FLAT); + #endif + } + + if (what & FOREGROUND) { + using namespace ExtUI; + char x_str[15]; + char y_str[15]; + char z_str[15]; + + if (isAxisPositionKnown(X)) + format_position(x_str, getAxisPosition_mm(X)); + else + strcpy_P(x_str, PSTR("?")); + + if (isAxisPositionKnown(Y)) + format_position(y_str, getAxisPosition_mm(Y)); + else + strcpy_P(y_str, PSTR("?")); + + if (isAxisPositionKnown(Z)) + format_position(z_str, getAxisPosition_mm(Z)); + else + strcpy_P(z_str, PSTR("?")); + + cmd.tag(6).font(Theme::font_medium) + #ifdef TOUCH_UI_PORTRAIT + .text ( BTN_POS(2,5), BTN_SIZE(2,1), x_str) + .text ( BTN_POS(2,6), BTN_SIZE(2,1), y_str) + .text ( BTN_POS(2,7), BTN_SIZE(2,1), z_str); + #else + .text ( BTN_POS(1,6), BTN_SIZE(1,1), x_str) + .text ( BTN_POS(2,6), BTN_SIZE(1,1), y_str) + .text ( BTN_POS(3,6), BTN_SIZE(1,1), z_str); + #endif + } + + #undef GRID_COLS +} + +#ifdef TOUCH_UI_PORTRAIT + #define GRID_COLS 8 +#else + #define GRID_COLS 12 +#endif + +void StatusScreen::draw_temperature(draw_mode_t what) { + using namespace Theme; + + CommandProcessor cmd; + + if (what & BACKGROUND) { + cmd.font(Theme::font_small) + #ifdef TOUCH_UI_PORTRAIT + .tag(5) + .fgcolor(temp) .button( BTN_POS(1,1), BTN_SIZE(4,2), F(""), OPT_FLAT) + .button( BTN_POS(1,1), BTN_SIZE(8,1), F(""), OPT_FLAT) + .fgcolor(fan_speed) .button( BTN_POS(5,2), BTN_SIZE(4,1), F(""), OPT_FLAT) + .tag(0) + .fgcolor(progress) .button( BTN_POS(1,3), BTN_SIZE(4,1), F(""), OPT_FLAT) + .button( BTN_POS(5,3), BTN_SIZE(4,1), F(""), OPT_FLAT); + #else + .tag(5) + .fgcolor(temp) .button( BTN_POS(1,1), BTN_SIZE(4,2), F(""), OPT_FLAT) + .button( BTN_POS(1,1), BTN_SIZE(8,1), F(""), OPT_FLAT) + .fgcolor(fan_speed) .button( BTN_POS(5,2), BTN_SIZE(4,1), F(""), OPT_FLAT) + .tag(0) + .fgcolor(progress) .button( BTN_POS(9,1), BTN_SIZE(4,1), F(""), OPT_FLAT) + .button( BTN_POS(9,2), BTN_SIZE(4,1), F(""), OPT_FLAT); + #endif + + // Draw Extruder Bitmap on Extruder Temperature Button + + cmd.tag(5) + .cmd(BITMAP_SOURCE(Extruder_Icon_Info)) + .cmd(BITMAP_LAYOUT(Extruder_Icon_Info)) + .cmd(BITMAP_SIZE (Extruder_Icon_Info)) + .icon (BTN_POS(1,1), BTN_SIZE(1,1), Extruder_Icon_Info, icon_scale) + .icon (BTN_POS(5,1), BTN_SIZE(1,1), Extruder_Icon_Info, icon_scale); + + // Draw Bed Heat Bitmap on Bed Heat Button + cmd.cmd(BITMAP_SOURCE(Bed_Heat_Icon_Info)) + .cmd(BITMAP_LAYOUT(Bed_Heat_Icon_Info)) + .cmd(BITMAP_SIZE (Bed_Heat_Icon_Info)) + .icon (BTN_POS(1,2), BTN_SIZE(1,1), Bed_Heat_Icon_Info, icon_scale); + + // Draw Fan Percent Bitmap on Bed Heat Button + + cmd.cmd(BITMAP_SOURCE(Fan_Icon_Info)) + .cmd(BITMAP_LAYOUT(Fan_Icon_Info)) + .cmd(BITMAP_SIZE (Fan_Icon_Info)) + .icon (BTN_POS(5,2), BTN_SIZE(1,1), Fan_Icon_Info, icon_scale); + + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); // Restore font bitmap handles + #endif + } + + if (what & FOREGROUND) { + using namespace ExtUI; + char e0_str[20]; + char e1_str[20]; + char bed_str[20]; + char fan_str[20]; + + sprintf_P( + fan_str, + PSTR("%-3d %%"), + int8_t(getActualFan_percent(FAN0)) + ); + + if (isHeaterIdle(BED)) + format_temp_and_idle(bed_str, getActualTemp_celsius(BED)); + else + format_temp_and_temp(bed_str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED)); + + if (isHeaterIdle(H0)) + format_temp_and_idle(e0_str, getActualTemp_celsius(H0)); + else + format_temp_and_temp(e0_str, getActualTemp_celsius(H0), getTargetTemp_celsius(H0)); + + + #if EXTRUDERS == 2 + if (isHeaterIdle(H1)) + format_temp_and_idle(e1_str, getActualTemp_celsius(H1)); + else + format_temp_and_temp(e1_str, getActualTemp_celsius(H1), getTargetTemp_celsius(H1)); + #else + strcpy_P( + e1_str, + PSTR("-") + ); + #endif + + cmd.tag(5) + .font(font_medium) + .text(BTN_POS(2,1), BTN_SIZE(3,1), e0_str) + .text(BTN_POS(6,1), BTN_SIZE(3,1), e1_str) + .text(BTN_POS(2,2), BTN_SIZE(3,1), bed_str) + .text(BTN_POS(6,2), BTN_SIZE(3,1), fan_str); + } +} + +void StatusScreen::draw_progress(draw_mode_t what) { + using namespace ExtUI; + using namespace Theme; + + CommandProcessor cmd; + + if (what & BACKGROUND) { + cmd.tag(0).font(font_medium) + #ifdef TOUCH_UI_PORTRAIT + .fgcolor(progress) .button(BTN_POS(1,3), BTN_SIZE(4,1), F(""), OPT_FLAT) + .button(BTN_POS(5,3), BTN_SIZE(4,1), F(""), OPT_FLAT); + #else + .fgcolor(progress) .button(BTN_POS(9,1), BTN_SIZE(4,1), F(""), OPT_FLAT) + .button(BTN_POS(9,2), BTN_SIZE(4,1), F(""), OPT_FLAT); + #endif + } + + if (what & FOREGROUND) { + const uint32_t elapsed = getProgress_seconds_elapsed(); + const uint8_t hrs = elapsed/3600; + const uint8_t min = (elapsed/60)%60; + + char time_str[10]; + char progress_str[10]; + + sprintf_P(time_str, PSTR(" %02d : %02d"), hrs, min); + sprintf_P(progress_str, PSTR("%-3d %%"), getProgress_percent() ); + + cmd.font(font_medium) + #ifdef TOUCH_UI_PORTRAIT + .tag(0).text(BTN_POS(1,3), BTN_SIZE(4,1), time_str) + .text(BTN_POS(5,3), BTN_SIZE(4,1), progress_str); + #else + .tag(0).text(BTN_POS(9,1), BTN_SIZE(4,1), time_str) + .text(BTN_POS(9,2), BTN_SIZE(4,1), progress_str); + #endif + } +} + +#undef GRID_COLS + + +void StatusScreen::draw_interaction_buttons(draw_mode_t what) { + #define GRID_COLS 4 + if (what & FOREGROUND) { + using namespace ExtUI; + + const bool has_media = isMediaInserted() && !isPrintingFromMedia(); + + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(Theme::font_medium) + .enabled(has_media) + .colors(has_media ? action_btn : normal_btn) + .tag(3).button( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1,8), BTN_SIZE(2,1), + #else + BTN_POS(1,7), BTN_SIZE(2,2), + #endif + isPrintingFromMedia() ? GET_TEXT_F(MSG_PRINTING) : GET_TEXT_F(MSG_BUTTON_MEDIA) + ).colors(!has_media ? action_btn : normal_btn) + #ifdef TOUCH_UI_PORTRAIT + .tag(4).button( BTN_POS(3,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_MENU)); + #else + .tag(4).button( BTN_POS(3,7), BTN_SIZE(2,2), GET_TEXT_F(MSG_BUTTON_MENU)); + #endif + } + #undef GRID_COLS +} + +void StatusScreen::draw_status_message(draw_mode_t what, const char* message) { + #define GRID_COLS 1 + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.fgcolor(Theme::status_msg) + .tag(0) + #ifdef TOUCH_UI_PORTRAIT + .button( BTN_POS(1,4), BTN_SIZE(1,1), F(""), OPT_FLAT); + #else + .button( BTN_POS(1,3), BTN_SIZE(1,2), F(""), OPT_FLAT); + #endif + + draw_text_box(cmd, + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1,4), BTN_SIZE(1,1), + #else + BTN_POS(1,3), BTN_SIZE(1,2), + #endif + message, OPT_CENTER, font_large); + } + #undef GRID_COLS +} + +void StatusScreen::setStatusMessage(progmem_str message) { + char buff[strlen_P((const char * const)message)+1]; + strcpy_P(buff, (const char * const) message); + setStatusMessage((const char *) buff); +} + +void StatusScreen::setStatusMessage(const char* message) { + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)); + + draw_temperature(BACKGROUND); + draw_progress(BACKGROUND); + draw_axis_position(BACKGROUND); + draw_status_message(BACKGROUND, message); + draw_interaction_buttons(BACKGROUND); + + storeBackground(); + + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR("New status message: ", message); + #endif + + if (AT_SCREEN(StatusScreen)) { + current_screen.onRefresh(); + } +} + +void StatusScreen::loadBitmaps() { + // Load the bitmaps for the status screen + using namespace Theme; + constexpr uint32_t base = ftdi_memory_map::RAM_G; + CLCD::mem_write_pgm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon)); + CLCD::mem_write_pgm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon)); + CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); + CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); + + // Load fonts for internationalization + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_data(base + UTF8_FONT_OFFSET); + #endif +} + +void StatusScreen::onStartup() { + UIFlashStorage::initialize(); +} + +void StatusScreen::onRedraw(draw_mode_t what) { + if (what & FOREGROUND) { + draw_temperature(FOREGROUND); + draw_progress(FOREGROUND); + draw_axis_position(FOREGROUND); + draw_interaction_buttons(FOREGROUND); + } +} + +void StatusScreen::onEntry() { + onRefresh(); +} + +void StatusScreen::onIdle() { + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + onRefresh(); + refresh_timer.start(); + } + BaseScreen::onIdle(); +} + +bool StatusScreen::onTouchEnd(uint8_t tag) { + using namespace ExtUI; + + switch (tag) { + case 3: GOTO_SCREEN(FilesScreen); break; + case 4: + if (isPrinting()) { + GOTO_SCREEN(TuneMenu); + } else { + GOTO_SCREEN(MainMenu); + } + break; + case 5: GOTO_SCREEN(TemperatureScreen); break; + case 6: + if (!isPrinting()) { + GOTO_SCREEN(MoveAxisScreen); + } + break; + default: + return true; + } + // If a passcode is enabled, the LockScreen will prevent the + // user from proceeding. + LockScreen::check_passcode(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp new file mode 100644 index 000000000000..9aa28aff39d8 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp @@ -0,0 +1,77 @@ +/************************************** + * stepper_bump_sensiivity_screen.cpp * + **************************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_TRINAMIC + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void StepperBumpSensitivityScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST); + w.heading( GET_TEXT_F(MSG_TMC_HOMING_THRS)); + w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getTMCBumpSensitivity(X), + #if X_SENSORLESS + true + #else + false + #endif + ); + w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getTMCBumpSensitivity(Y), + #if Y_SENSORLESS + true + #else + false + #endif + ); + w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getTMCBumpSensitivity(Z), + #if Z_SENSORLESS + true + #else + false + #endif + ); + w.increments(); +} + +bool StepperBumpSensitivityScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(TMCBumpSensitivity, X ); break; + case 3: UI_INCREMENT(TMCBumpSensitivity, X ); break; + case 4: UI_DECREMENT(TMCBumpSensitivity, Y ); break; + case 5: UI_INCREMENT(TMCBumpSensitivity, Y ); break; + case 6: UI_DECREMENT(TMCBumpSensitivity, Z ); break; + case 7: UI_INCREMENT(TMCBumpSensitivity, Z ); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE && HAS_TRINAMIC diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp new file mode 100644 index 000000000000..acc94684e096 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp @@ -0,0 +1,86 @@ +/****************************** + * stepper_current_screen.cpp * + ******************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_TRINAMIC + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void StepperCurrentScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(0); + w.units(GET_TEXT_F(MSG_UNITS_MILLIAMP)); + w.heading( GET_TEXT_F(MSG_TMC_CURRENT)); + w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisCurrent_mA(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisCurrent_mA(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisCurrent_mA(Z) ); + #if EXTRUDERS == 1 + w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisCurrent_mA(E0) ); + #elif EXTRUDERS > 1 + w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), getAxisCurrent_mA(E0) ); + w.color(e_axis).adjuster(10, GET_TEXT_F(MSG_AXIS_E2), getAxisCurrent_mA(E1) ); + #if EXTRUDERS > 2 + w.color(e_axis).adjuster(12, GET_TEXT_F(MSG_AXIS_E3), getAxisCurrent_mA(E2) ); + #endif + #if EXTRUDERS > 3 + w.color(e_axis).adjuster(14, GET_TEXT_F(MSG_AXIS_E4), getAxisCurrent_mA(E3) ); + #endif + #endif + w.increments(); +} + +bool StepperCurrentScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(AxisCurrent_mA, X ); break; + case 3: UI_INCREMENT(AxisCurrent_mA, X ); break; + case 4: UI_DECREMENT(AxisCurrent_mA, Y ); break; + case 5: UI_INCREMENT(AxisCurrent_mA, Y ); break; + case 6: UI_DECREMENT(AxisCurrent_mA, Z ); break; + case 7: UI_INCREMENT(AxisCurrent_mA, Z ); break; + case 8: UI_DECREMENT(AxisCurrent_mA, E0); break; + case 9: UI_INCREMENT(AxisCurrent_mA, E0); break; + #if EXTRUDERS > 1 + case 10: UI_DECREMENT(AxisCurrent_mA, E1); break; + case 11: UI_INCREMENT(AxisCurrent_mA, E1); break; + #endif + #if EXTRUDERS > 2 + case 12: UI_DECREMENT(AxisCurrent_mA, E2); break; + case 13: UI_INCREMENT(AxisCurrent_mA, E2); break; + #endif + #if EXTRUDERS > 3 + case 14: UI_DECREMENT(AxisCurrent_mA, E3); break; + case 15: UI_INCREMENT(AxisCurrent_mA, E3); break; + #endif + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp new file mode 100644 index 000000000000..f47707f96547 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp @@ -0,0 +1,86 @@ +/******************** + * steps_screen.cpp * + ********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void StepsScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(0); + w.units(GET_TEXT_F(MSG_UNITS_STEP_MM)); + w.heading( GET_TEXT_F(MSG_STEPS_PER_MM)); + w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getAxisSteps_per_mm(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getAxisSteps_per_mm(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getAxisSteps_per_mm(Z) ); + #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) + w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E), getAxisSteps_per_mm(E0) ); + #elif EXTRUDERS > 1 + w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), getAxisSteps_per_mm(E0) ); + w.color(e_axis) .adjuster(10, GET_TEXT_F(MSG_AXIS_E2), getAxisSteps_per_mm(E1) ); + #if EXTRUDERS > 2 + w.color(e_axis) .adjuster(12, GET_TEXT_F(MSG_AXIS_E3), getAxisSteps_per_mm(E2) ); + #endif + #if EXTRUDERS > 3 + w.color(e_axis) .adjuster(14, GET_TEXT_F(MSG_AXIS_E4), getAxisSteps_per_mm(E3) ); + #endif + #endif + w.increments(); +} + +bool StepsScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 2: UI_DECREMENT(AxisSteps_per_mm, X); break; + case 3: UI_INCREMENT(AxisSteps_per_mm, X); break; + case 4: UI_DECREMENT(AxisSteps_per_mm, Y); break; + case 5: UI_INCREMENT(AxisSteps_per_mm, Y); break; + case 6: UI_DECREMENT(AxisSteps_per_mm, Z); break; + case 7: UI_INCREMENT(AxisSteps_per_mm, Z); break; + case 8: UI_DECREMENT(AxisSteps_per_mm, E0); break; + case 9: UI_INCREMENT(AxisSteps_per_mm, E0); break; + #if EXTRUDERS > 1 + case 10: UI_DECREMENT(AxisSteps_per_mm, E1); break; + case 11: UI_INCREMENT(AxisSteps_per_mm, E1); break; + #endif + #if EXTRUDERS > 2 + case 12: UI_DECREMENT(AxisSteps_per_mm, E2); break; + case 13: UI_INCREMENT(AxisSteps_per_mm, E2); break; + #endif + #if EXTRUDERS > 3 + case 14: UI_DECREMENT(AxisSteps_per_mm, E3); break; + case 15: UI_INCREMENT(AxisSteps_per_mm, E3); break; + #endif + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp new file mode 100644 index 000000000000..b5e9263efa53 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp @@ -0,0 +1,152 @@ +/************************** + * stress_test_screen.cpp * + **************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) + +#include "screens.h" +#include "screen_data.h" + +#define STRESS_TEST_CHANGE_INTERVAL 6000 + +#define GRID_COLS 4 +#define GRID_ROWS 9 + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void StressTestScreen::drawDots(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { + CommandProcessor cmd; + for(uint8_t i = 0; i < 100; i++) { + cmd.cmd(BEGIN(POINTS)) + .cmd(POINT_SIZE(20*16)) + .cmd(COLOR_RGB(random(0xFFFFFF))) + .cmd(VERTEX2F((x + random(w)) * 16,(y + random(h)) * 16)); + } +} + +bool StressTestScreen::watchDogTestNow() { + return screen_data.StressTestScreen.next_watchdog_trigger && + ELAPSED(millis(), screen_data.StressTestScreen.next_watchdog_trigger); +} + +void StressTestScreen::onRedraw(draw_mode_t) { + using namespace ExtUI; + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .font(font_medium) + .text(BTN_POS(1,1), BTN_SIZE(4,1), progmem_str(screen_data.StressTestScreen.message)); + + drawDots(BTN_POS(1,3), BTN_SIZE(4,4)); + + cmd.font(font_medium).enabled(!watchDogTestNow()).colors(action_btn).tag(1).button(BTN_POS(2,8), BTN_SIZE(2,1), F("Exit")); +} + +bool StressTestScreen::onTouchEnd(uint8_t tag) { + CommandProcessor cmd; + switch (tag) { + case 1: + runTestOnBootup(false); + GOTO_SCREEN(StatusScreen); + break; + default: + return false; + } + return true; +} + +void StressTestScreen::runTestOnBootup(bool enable) { + // Use a magic value in passcode to indicate + // whether or not we need to re-run the test + // at startup. + LockScreen::set_hash(enable ? 0xDEAD : 0); + injectCommands_P(PSTR("M500")); +} + +void StressTestScreen::startupCheck() { + if (LockScreen::get_hash() == 0xDEAD) { + GOTO_SCREEN(StressTestScreen); + } +} + +void StressTestScreen::onEntry() { + screen_data.StressTestScreen.next_watchdog_trigger = millis() + 10000 + random(40000); + screen_data.StressTestScreen.message = PSTR("Test 1: Stress testing..."); + + // Turn off heaters. + setTargetTemp_celsius(0, E0); + setTargetTemp_celsius(0, E1); + setTargetTemp_celsius(0, BED); + + runTestOnBootup(true); +} + +void StressTestScreen::recursiveLockup() { + screen_data.StressTestScreen.message = PSTR("Test 2: Printer will restart."); + current_screen.onRefresh(); + recursiveLockup(); +} + +void StressTestScreen::iterativeLockup() { + screen_data.StressTestScreen.message = PSTR("Test 3: Printer will restart."); + for(;;) current_screen.onRefresh(); +} + +void StressTestScreen::onIdle() { + current_screen.onRefresh(); + reset_menu_timeout(); + + if (!commandsInQueue()) { + if (!isPositionKnown()) { + extern const char G28_STR[]; + injectCommands_P(G28_STR); + } else { + injectCommands_P(PSTR( + "G0 X100 Y100 Z100 F6000\n" + "T0\nG4 S1" + #if EXTRUDERS > 1 + "\nT1\nG4 S1" + #endif + "\nG0 X150 Y150 Z150" + )); + } + } + + if (refresh_timer.elapsed(STRESS_TEST_CHANGE_INTERVAL)) { + setTargetFan_percent(random(100),FAN0); + } + + if (watchDogTestNow()) { + if (random(2) % 2) + iterativeLockup(); + else + recursiveLockup(); + } + + BaseScreen::onIdle(); +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.cpp new file mode 100644 index 000000000000..ca4fdad3ce61 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.cpp @@ -0,0 +1,83 @@ +/********************* + * string_format.cpp * + *********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +#define ROUND(val) uint16_t((val)+0.5) + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wno-format" + +/** + * Formats a temperature string (e.g. "100°C") + */ +void format_temp(char *str, float t1) { + sprintf_P(str, PSTR("%3d" S_FMT), ROUND(t1), GET_TEXT(MSG_UNITS_C)); +} + +/** + * Formats a temperature string for an idle heater (e.g. "100 °C / idle") + */ +void format_temp_and_idle(char *str, float t1) { + sprintf_P(str, PSTR("%3d" S_FMT " / " S_FMT), ROUND(t1), GET_TEXT(MSG_UNITS_C), GET_TEXT(MSG_IDLE)); +} + +/** + * Formats a temperature string for an active heater (e.g. "100 / 200°C") + */ +void format_temp_and_temp(char *str, float t1, float t2) { + sprintf_P(str, PSTR("%3d / %3d" S_FMT), ROUND(t1), ROUND(t2), GET_TEXT(MSG_UNITS_C)); +} + +/** + * Formats a temperature string for a material (e.g. "100°C (PLA)") + */ +void format_temp_and_material(char *str, float t1, const char *material) { + sprintf_P(str, PSTR("%3d" S_FMT " (" S_FMT ")"), ROUND(t1), GET_TEXT(MSG_UNITS_C), material); +} + +/** + * Formats a position value (e.g. "10 mm") + */ +void format_position(char *str, float p) { + dtostrf(p, 5, 1, str); + strcat_P(str, PSTR(" ")); + strcat_P(str, GET_TEXT(MSG_UNITS_MM)); +} + +/** + * Formats a position vector (e.g. "10; 20; 30 mm") + */ +void format_position(char *str, float x, float y, float z) { + char num1[7], num2[7], num3[7]; + dtostrf(x, 4, 2, num1); + dtostrf(y, 4, 2, num2); + dtostrf(z, 4, 2, num3); + sprintf_P(str, PSTR("%s; %s; %s " S_FMT), num1, num2, num3, GET_TEXT(MSG_UNITS_MM)); +} + +#pragma GCC diagnostic pop + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.h new file mode 100644 index 000000000000..d6e26fb5cbcd --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/string_format.h @@ -0,0 +1,29 @@ +/******************* + * string_format.h * + *******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +void format_temp(char *str, float t1); +void format_temp_and_idle(char *str, float t1); +void format_temp_and_temp(char *str, float t1, float t2); +void format_temp_and_material(char *str, float t1, const char *material); +void format_position(char *str, float p); +void format_position(char *str, float x, float y, float z); diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp new file mode 100644 index 000000000000..f969f4797959 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp @@ -0,0 +1,116 @@ +/******************* + * boot_screen.cpp * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void TemperatureScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + #if TOUCH_UI_LCD_TEMP_SCALING == 10 + w.precision(1) + #else + w.precision(0) + #endif + .color(temp).units(GET_TEXT_F(MSG_UNITS_C)); + w.heading(GET_TEXT_F(MSG_TEMPERATURE)); + w.button(30, GET_TEXT_F(MSG_COOLDOWN)); + #ifndef NO_TOOLHEAD_HEATER_GCODE + #if HOTENDS == 1 + w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0)); + #else + w.adjuster( 2, F(LCD_STR_E0), getTargetTemp_celsius(E0)); + w.adjuster( 4, F(LCD_STR_E1), getTargetTemp_celsius(E1)); + #if HOTENDS > 2 + w.adjuster( 6, F(LCD_STR_E2), getTargetTemp_celsius(E2)); + #endif + #if HOTENDS > 3 + w.adjuster( 8, F(LCD_STR_E3), getTargetTemp_celsius(E3)); + #endif + #endif + #endif + #if HAS_HEATED_BED + w.adjuster( 20, GET_TEXT_F(MSG_BED), getTargetTemp_celsius(BED)); + #endif + #if HAS_HEATED_CHAMBER + w.adjuster( 22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER)); + #endif + #if FAN_COUNT > 0 + w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT)); + w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0)); + #endif + w.increments(); +} + +bool TemperatureScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 20: UI_DECREMENT(TargetTemp_celsius, BED); break; + case 21: UI_INCREMENT(TargetTemp_celsius, BED); break; + case 22: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break; + case 23: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break; + #ifndef NO_TOOLHEAD_HEATER_GCODE + case 2: UI_DECREMENT(TargetTemp_celsius, E0); break; + case 3: UI_INCREMENT(TargetTemp_celsius, E0); break; + #endif + #if HOTENDS > 1 + case 4: UI_DECREMENT(TargetTemp_celsius, E1); break; + case 5: UI_INCREMENT(TargetTemp_celsius, E1); break; + #endif + #if HOTENDS > 2 + case 6: UI_DECREMENT(TargetTemp_celsius, E2); break; + case 7: UI_INCREMENT(TargetTemp_celsius, E2); break; + #endif + #if HOTENDS > 3 + case 8: UI_DECREMENT(TargetTemp_celsius, E3); break; + case 9: UI_INCREMENT(TargetTemp_celsius, E3); break; + #endif + #if FAN_COUNT > 0 + case 10: UI_DECREMENT(TargetFan_percent, FAN0); break; + case 11: UI_INCREMENT(TargetFan_percent, FAN0); break; + #endif + case 30: + #define _HOTEND_OFF(N) setTargetTemp_celsius(0,E##N); + REPEAT(HOTENDS, _HOTEND_OFF); + #if HAS_HEATED_BED + setTargetTemp_celsius(0,BED); + #endif + #if HAS_HEATED_CHAMBER + setTargetTemp_celsius(0,CHAMBER); + #endif + #if FAN_COUNT > 0 + setTargetFan_percent(0,FAN0); + #endif + break; + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp new file mode 100644 index 000000000000..b6c5ecae3d85 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp @@ -0,0 +1,89 @@ +/******************************** + * touch_calibration_screen.cpp * + ********************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +#define GRID_COLS 4 +#define GRID_ROWS 16 + +void TouchCalibrationScreen::onEntry() { + CommandProcessor cmd; + + BaseScreen::onEntry(); + + if (CLCD::is_touching()) { + // Ask the user to release the touch before starting, + // as otherwise the first calibration point could + // be misinterpreted. + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)); + draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(4,16), GET_TEXT_F(MSG_TOUCH_CALIBRATION_START), OPT_CENTER, font_large); + cmd.cmd(DL::DL_DISPLAY) + .cmd(CMD_SWAP) + .execute(); + + while (CLCD::is_touching()) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("Waiting for touch release"); + #endif + } + } + + // Force a refresh + cmd.cmd(CMD_DLSTART); + onRedraw(FOREGROUND); + cmd.cmd(DL::DL_DISPLAY); + cmd.execute(); +} + +void TouchCalibrationScreen::onRefresh() { + // Don't do the regular refresh, as this would + // cause the calibration be restarted on every + // touch. +} + +void TouchCalibrationScreen::onRedraw(draw_mode_t) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)); + + draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(4,16), GET_TEXT_F(MSG_TOUCH_CALIBRATION_PROMPT), OPT_CENTER, font_large); + cmd.cmd(CMD_CALIBRATE); +} + +void TouchCalibrationScreen::onIdle() { + if (!CLCD::is_touching() && !CommandProcessor::is_processing()) { + GOTO_PREVIOUS(); + } +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp new file mode 100644 index 000000000000..4d7477b300ad --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp @@ -0,0 +1,86 @@ +/****************************** + * touch_registers_screen.cpp * + ******************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void TouchRegistersScreen::onRedraw(draw_mode_t) { + const uint32_t T_Transform_A = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_A); + const uint32_t T_Transform_B = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_B); + const uint32_t T_Transform_C = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_C); + const uint32_t T_Transform_D = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_D); + const uint32_t T_Transform_E = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_E); + const uint32_t T_Transform_F = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_F); + char b[20]; + + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0); + + #define GRID_ROWS 7 + #define GRID_COLS 2 + cmd.tag(0) + .font(font_xsmall) + .fgcolor(transformA) .button( BTN_POS(1,1), BTN_SIZE(1,1), F("TOUCH_XFORM_A")) + .fgcolor(transformB) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("TOUCH_XFORM_B")) + .fgcolor(transformC) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("TOUCH_XFORM_C")) + .fgcolor(transformD) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("TOUCH_XFORM_D")) + .fgcolor(transformE) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("TOUCH_XFORM_E")) + .fgcolor(transformF) .button( BTN_POS(1,6), BTN_SIZE(1,1), F("TOUCH_XFORM_F")) + + .fgcolor(transformVal).button( BTN_POS(2,1), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button( BTN_POS(2,2), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button( BTN_POS(2,3), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button( BTN_POS(2,4), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button( BTN_POS(2,5), BTN_SIZE(1,1), F(""), OPT_FLAT) + .fgcolor(transformVal).button( BTN_POS(2,6), BTN_SIZE(1,1), F(""), OPT_FLAT); + + sprintf_P(b, PSTR("0x%08lX"), T_Transform_A); cmd.text( BTN_POS(2,1), BTN_SIZE(1,1), b); + sprintf_P(b, PSTR("0x%08lX"), T_Transform_B); cmd.text( BTN_POS(2,2), BTN_SIZE(1,1), b); + sprintf_P(b, PSTR("0x%08lX"), T_Transform_C); cmd.text( BTN_POS(2,3), BTN_SIZE(1,1), b); + sprintf_P(b, PSTR("0x%08lX"), T_Transform_D); cmd.text( BTN_POS(2,4), BTN_SIZE(1,1), b); + sprintf_P(b, PSTR("0x%08lX"), T_Transform_E); cmd.text( BTN_POS(2,5), BTN_SIZE(1,1), b); + sprintf_P(b, PSTR("0x%08lX"), T_Transform_F); cmd.text( BTN_POS(2,6), BTN_SIZE(1,1), b); + + cmd.colors(action_btn).font(font_medium) + .tag(1).button( BTN_POS(2,7), BTN_SIZE(1,1), F("Back")); + #undef GRID_COLS + #undef GRID_ROWS + } + + bool TouchRegistersScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + default: + return false; + } + return true; + } + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp new file mode 100644 index 000000000000..8b4f0942fb4a --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp @@ -0,0 +1,164 @@ +/******************* + * tune_menu.cpp * + *******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO) + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void TuneMenu::onRedraw(draw_mode_t what) { + if (what & BACKGROUND) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)); + } + + #ifdef TOUCH_UI_PORTRAIT + #define GRID_ROWS 8 + #define GRID_COLS 2 + #else + #define GRID_ROWS 4 + #define GRID_COLS 2 + #endif + + if (what & FOREGROUND) { + using namespace ExtUI; + + CommandProcessor cmd; + cmd.colors(normal_btn) + .font(font_medium) + #ifdef TOUCH_UI_PORTRAIT + .tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE)) + .tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENTCHANGE)) + .enabled( + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + 1 + #endif + ) + .tag(9).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENT)) + #if ENABLED(BABYSTEPPING) + .tag(4).enabled(1) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_NUDGE_NOZZLE)) + #else + .enabled( + #if HAS_BED_PROBE + 1 + #endif + ) + .tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) + #endif + .tag(5).enabled(1) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_SPEED)) + .tag(isPrintingFromMediaPaused() ? 7 : 6) + .enabled( + #if ENABLED(SDSUPPORT) + isPrintingFromMedia() + #endif + ) + .button( BTN_POS(1,6), BTN_SIZE(2,1), isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) + .enabled( + #if ENABLED(SDSUPPORT) + isPrintingFromMedia() + #endif + ) + .tag(8) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_STOP_PRINT)) + .tag(1).colors(action_btn) + .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); + #else // TOUCH_UI_PORTRAIT + .tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_TEMPERATURE)) + .tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENTCHANGE)) + .enabled( + #if ENABLED(BABYSTEPPING) + isPrintingFromMedia() + #endif + ) + #if ENABLED(BABYSTEPPING) + .tag(4) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_NUDGE_NOZZLE)) + #else + .enabled( + #if HAS_BED_PROBE + isPrintingFromMedia() + #endif + ) + .tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) + #endif + .tag(5).enabled(1) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_PRINT_SPEED)) + .tag(isPrintingFromMediaPaused() ? 7 : 6) + .enabled( + #if ENABLED(SDSUPPORT) + isPrintingFromMedia() + #endif + ) + .button( BTN_POS(1,3), BTN_SIZE(1,1), isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT)) + .enabled( + #if ENABLED(SDSUPPORT) + isPrintingFromMedia() + #endif + ) + .tag(8). button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_STOP_PRINT)) + .enabled( + #if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + 1 + #endif + ) + .tag(9).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT)) + .tag(1).colors(action_btn) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK)); + #endif + } + #undef GRID_COLS + #undef GRID_ROWS +} + +bool TuneMenu::onTouchEnd(uint8_t tag) { + using namespace Theme; + using namespace ExtUI; + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + case 2: GOTO_SCREEN(TemperatureScreen); break; + case 3: GOTO_SCREEN(ChangeFilamentScreen); break; + case 4: + #if ENABLED(BABYSTEPPING) + GOTO_SCREEN(NudgeNozzleScreen); + #elif HAS_BED_PROBE + GOTO_SCREEN(ZOffsetScreen); + #endif + break; + case 5: GOTO_SCREEN(FeedratePercentScreen); break; + case 6: sound.play(twinkle, PLAY_ASYNCHRONOUS); ExtUI::pausePrint(); GOTO_SCREEN(StatusScreen); break; + case 7: sound.play(twinkle, PLAY_ASYNCHRONOUS); ExtUI::resumePrint(); GOTO_SCREEN(StatusScreen); break; + case 8: + GOTO_SCREEN(ConfirmAbortPrintDialogBox); + current_screen.forget(); + PUSH_SCREEN(StatusScreen); + break; + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + case 9: GOTO_SCREEN(FilamentMenu); break; + #endif + default: + return false; + } + return true; +} + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp new file mode 100644 index 000000000000..b77cb5143e46 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp @@ -0,0 +1,158 @@ +/************************** + * widget_demo_screen.cpp * + **************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if BOTH(TOUCH_UI_FTDI_EVE, TOUCH_UI_DEVELOPER_MENU) + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +uint16_t slider_val; +bool show_grid; + +void WidgetsScreen::onEntry() { + BaseScreen::onEntry(); + CLCD::turn_on_backlight(); + SoundPlayer::set_volume(255); +} + +void WidgetsScreen::onRedraw(draw_mode_t) { + using namespace ExtUI; + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + + const uint16_t hrs = (slider_val*12/0xFFFFU); + const uint16_t m = (slider_val*12*60/0xFFFFU)%60; + const uint16_t s = (slider_val*12*60*60/0xFFFFU)%60; + + #ifdef TOUCH_UI_PORTRAIT + #define GRID_COLS 3 + #define GRID_ROWS 8 + cmd.font(font_large) + .cmd(COLOR_RGB(bg_text_enabled)) + .text (BTN_POS(1,1), BTN_SIZE(3,1), F("Sample Widgets")) + .tag(0).text (BTN_POS(2,6), BTN_SIZE(1,1), F("Show grid:")) + .colors(ui_toggle) + .tag(2).dial (BTN_POS(1,2), BTN_SIZE(1,2), slider_val) + .tag(0).clock (BTN_POS(1,4), BTN_SIZE(1,2), hrs, m, s, 0) + .gauge (BTN_POS(1,6), BTN_SIZE(1,2), 5, 4, slider_val, 0xFFFFU) + .font(font_medium) + .colors(ui_slider) + .tag(4).slider (BTN_POS(2,3), BTN_SIZE(2,1), slider_val, 0xFFFFU) + .tag(5).progress (BTN_POS(2,4), BTN_SIZE(2,1), slider_val, 0xFFFFU) + .tag(6).scrollbar (BTN_POS(2,5), BTN_SIZE(2,1), slider_val, 1000, 0xFFFFU) + .font(font_small) + .colors(ui_toggle) + .tag(7).toggle (BTN_POS(3,6), BTN_SIZE(1,1), F("no\xFFyes"), show_grid) + .colors(normal_btn) + .font(font_medium) + .tag(1) + .button (BTN_POS(2, 8), BTN_SIZE(1,1), F("1")) + .button (BTN_POS(3, 8), BTN_SIZE(1,1), F("2")) + .colors(action_btn) + .button (BTN_POS(1, 8), BTN_SIZE(1,1), F("Back")); + #else + #define GRID_COLS 4 + #define GRID_ROWS 8 + + cmd.font(font_large) + .text (BTN_POS(1,1), BTN_SIZE(4,1), F("Sample Widgets")) + .tag(0).text (BTN_POS(3,6), BTN_SIZE(1,1), F("Show grid:")) + .colors(ui_toggle) + .tag(2).dial (BTN_POS(1,2), BTN_SIZE(1,3), slider_val) + .tag(3).dial (BTN_POS(1,5), BTN_SIZE(1,3), slider_val) + .tag(0).clock (BTN_POS(2,2), BTN_SIZE(1,3), hrs, m, s, 0) + .gauge (BTN_POS(2,5), BTN_SIZE(1,3), 5, 4, slider_val, 0xFFFFU) + .font(font_medium) + .colors(ui_slider) + .tag(4).slider (BTN_POS(3,3), BTN_SIZE(2,1), slider_val, 0xFFFFU) + .tag(5).progress (BTN_POS(3,4), BTN_SIZE(2,1), slider_val, 0xFFFFU) + .tag(6).scrollbar (BTN_POS(3,5), BTN_SIZE(2,1), slider_val, 1000, 0xFFFFU) + .font(font_small) + .colors(ui_toggle) + .tag(7).toggle (BTN_POS(4,6), BTN_SIZE(1,1), F("no\xFFyes"), show_grid) + .colors(normal_btn) + .font(font_medium) + .tag(1).button (BTN_POS(3, 8), BTN_SIZE(1,1), F("1")) + .button (BTN_POS(4, 8), BTN_SIZE(1,1), F("2")) + .colors(action_btn) + .button (BTN_POS(1, 8), BTN_SIZE(2,1), F("Back")); + #endif + + cmd.cmd(COLOR_RGB(bg_text_enabled)); + if (show_grid) DRAW_LAYOUT_GRID +} + +bool WidgetsScreen::onTouchStart(uint8_t tag) { + CommandProcessor cmd; + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + #ifdef TOUCH_UI_PORTRAIT + case 2: cmd.track_circular (BTN_POS(1,2), BTN_SIZE(1,2), 2).execute(); break; + case 4: cmd.track_linear (BTN_POS(2,3), BTN_SIZE(2,1), 4).execute(); break; + case 5: cmd.track_linear (BTN_POS(2,4), BTN_SIZE(2,1), 5).execute(); break; + case 6: cmd.track_linear (BTN_POS(2,5), BTN_SIZE(2,1), 6).execute(); break; + #else + case 2: cmd.track_circular (BTN_POS(1,2), BTN_SIZE(1,3), 2).execute(); break; + case 3: cmd.track_circular (BTN_POS(1,5), BTN_SIZE(1,3), 3).execute(); break; + case 4: cmd.track_linear (BTN_POS(3,3), BTN_SIZE(2,1), 4).execute(); break; + case 5: cmd.track_linear (BTN_POS(3,4), BTN_SIZE(2,1), 5).execute(); break; + case 6: cmd.track_linear (BTN_POS(3,5), BTN_SIZE(2,1), 6).execute(); break; + #endif + case 7: show_grid = !show_grid; break; + default: + return false; + } + + return true; +} + +void WidgetsScreen::onIdle() { + if (refresh_timer.elapsed(TOUCH_UPDATE_INTERVAL)) { + refresh_timer.start(); + + uint16_t value; + CommandProcessor cmd; + switch (cmd.track_tag(value)) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + slider_val = value; break; + default: + return; + } + onRefresh(); + } + BaseScreen::onIdle(); +} + +#endif // TOUCH_UI_FTDI_EVE && TOUCH_UI_DEVELOPER_MENU diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp new file mode 100644 index 000000000000..65a2ad0e8ec1 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp @@ -0,0 +1,54 @@ +/*********************** + * z_offset_screen.cpp * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) && HAS_BED_PROBE + +#include "screens.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void ZOffsetScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM)); + + w.heading( GET_TEXT_F(MSG_ZPROBE_ZOFFSET)); + w.color(z_axis).adjuster(4, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), getZOffset_mm()); + w.increments(); +} + +bool ZOffsetScreen::onTouchHeld(uint8_t tag) { + const float increment = getIncrement(); + switch (tag) { + case 4: UI_DECREMENT(ZOffset_mm); break; + case 5: UI_INCREMENT(ZOffset_mm); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // TOUCH_UI_FTDI_EVE && HAS_BED_PROBE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/bitmaps.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/bitmaps.h new file mode 100644 index 000000000000..00952cfc5bd9 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/bitmaps.h @@ -0,0 +1,183 @@ +/************* + * bitmaps.h * + *************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +namespace Theme { + using namespace FTDI; + + constexpr PROGMEM bitmap_info_t Extruder_Icon_Info = { + .format = L1, + .linestride = 3, + .filter = BILINEAR, + .wrapx = BORDER, + .wrapy = BORDER, + .RAMG_offset = 8000, + .width = 24, + .height = 23, + }; + + constexpr PROGMEM unsigned char Extruder_Icon[] = { + 0x3F, 0xFF, 0xFC, + 0x7F, 0xFF, 0xFE, + 0xC0, 0x00, 0x03, + 0xC0, 0x00, 0x03, + 0xC0, 0x00, 0x03, + 0xC0, 0x00, 0x03, + 0x7F, 0xFF, 0xFE, + 0x3F, 0xFF, 0xFC, + 0x3F, 0xFF, 0xFC, + 0x7F, 0xFF, 0xFE, + 0xC0, 0x00, 0x03, + 0xC0, 0x00, 0x03, + 0xC0, 0x00, 0x03, + 0xC0, 0x00, 0x03, + 0x7F, 0xFF, 0xFE, + 0x7F, 0xFF, 0xFE, + 0x07, 0xFF, 0xE0, + 0x03, 0xFF, 0xC0, + 0x01, 0x81, 0x80, + 0x00, 0xC3, 0x00, + 0x00, 0x66, 0x00, + 0x00, 0x3C, 0x00, + 0x00, 0x3C, 0x00 + }; + + constexpr PROGMEM bitmap_info_t Bed_Heat_Icon_Info = { + .format = L1, + .linestride = 4, + .filter = BILINEAR, + .wrapx = BORDER, + .wrapy = BORDER, + .RAMG_offset = 8100, + .width = 32, + .height = 23, + }; + + constexpr PROGMEM unsigned char Bed_Heat_Icon[] = { + 0x01, 0x81, 0x81, 0x80, + 0x01, 0x81, 0x81, 0x80, + 0x00, 0xC0, 0xC0, 0xC0, + 0x00, 0xC0, 0xC0, 0xC0, + 0x00, 0x60, 0x60, 0x60, + 0x00, 0x60, 0x60, 0x60, + 0x00, 0xC0, 0xC0, 0xC0, + 0x00, 0xC0, 0xC0, 0xC0, + 0x01, 0x81, 0x81, 0x80, + 0x01, 0x81, 0x81, 0x80, + 0x03, 0x03, 0x03, 0x00, + 0x03, 0x03, 0x03, 0x00, + 0x06, 0x06, 0x06, 0x00, + 0x06, 0x06, 0x06, 0x00, + 0x03, 0x03, 0x03, 0x00, + 0x03, 0x03, 0x03, 0x00, + 0x01, 0x81, 0x81, 0x80, + 0x01, 0x81, 0x81, 0x80, + 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, + 0xC0, 0x00, 0x00, 0x03, + 0xFF, 0xFF, 0xFF, 0xFF + }; + + constexpr PROGMEM bitmap_info_t Fan_Icon_Info = { + .format = L1, + .linestride = 4, + .filter = BILINEAR, + .wrapx = BORDER, + .wrapy = BORDER, + .RAMG_offset = 8300, + .width = 32, + .height = 32, + }; + + constexpr PROGMEM unsigned char Fan_Icon[] = { + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, + 0xF8, 0x00, 0x00, 0x1F, + 0xF0, 0x03, 0xF8, 0x0F, + 0xE0, 0x07, 0xF0, 0x07, + 0xC0, 0x0F, 0xE0, 0x03, + 0xC0, 0x1F, 0xE0, 0x03, + 0xC0, 0x1F, 0xE0, 0x03, + 0xC0, 0x0F, 0xE0, 0x03, + 0xC0, 0x07, 0xE0, 0x03, + 0xC0, 0x03, 0xC0, 0x03, + 0xD0, 0x00, 0x00, 0xC3, + 0xD8, 0x03, 0xC1, 0xE3, + 0xDF, 0xC7, 0xE3, 0xF3, + 0xDF, 0xEF, 0xF7, 0xFB, + 0xDF, 0xEF, 0xF7, 0xFB, + 0xDF, 0xEF, 0xF7, 0xFB, + 0xDF, 0xEF, 0xF7, 0xFB, + 0xCF, 0xC7, 0xE3, 0xFB, + 0xC7, 0x83, 0xC0, 0x1B, + 0xC3, 0x00, 0x00, 0x0B, + 0xC0, 0x03, 0xC0, 0x03, + 0xC0, 0x07, 0xE0, 0x03, + 0xC0, 0x07, 0xF0, 0x03, + 0xC0, 0x07, 0xF8, 0x03, + 0xC0, 0x07, 0xF8, 0x03, + 0xC0, 0x07, 0xF0, 0x03, + 0xE0, 0x0F, 0xE0, 0x07, + 0xF0, 0x1F, 0xC0, 0x0F, + 0xF8, 0x00, 0x00, 0x1F, + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF + }; + + constexpr PROGMEM bitmap_info_t TD_Icon_Info = { + .format = L1, + .linestride = 7, + .filter = BILINEAR, + .wrapx = BORDER, + .wrapy = BORDER, + .RAMG_offset = 9000, + .width = 50, + .height = 20, + }; + + constexpr PROGMEM unsigned char TD_Icon[] = { + 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, // Thumb Drive Widget + 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, + 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00 + }; + + constexpr PROGMEM uint32_t UTF8_FONT_OFFSET = 10000; +}; // namespace Theme diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/colors.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/colors.h new file mode 100644 index 000000000000..95494bbae865 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/colors.h @@ -0,0 +1,149 @@ +/************ + * colors.h * + ************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2019 - Cocoa Press * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +namespace Theme { + #ifdef TOUCH_UI_LULZBOT_BIO + // The Lulzbot Bio uses the color PANTONE 2175C on the case silkscreen. + // This translates to HSL(208°, 100%, 39%) as an accent color on the GUI. + + constexpr int accent_hue = 208; + constexpr float accent_sat = 0.5; + + constexpr uint32_t logo_bg_rgb = 0xffffff; + constexpr uint32_t logo_fill_rgb = 0xffffff; + constexpr uint32_t logo_stroke_rgb = hsl_to_rgb(accent_hue, 1.0, 0.39); + #else + // The Lulzbot logo uses the color PANTONE 382c. + // This translates to HSL(68°, 68%, 52%) as an accent color on the GUI. + + constexpr int accent_hue = 68; + constexpr float accent_sat = 0.68; + + constexpr uint32_t logo_bg_rgb = hsl_to_rgb(accent_hue, 0.77, 0.64); + constexpr uint32_t logo_fill_rgb = hsl_to_rgb(accent_hue, 0.68, 0.52); // Lulzbot Green + constexpr uint32_t logo_stroke_rgb = 0x000000; + #endif + + // Shades of accent color + + #ifdef TOUCH_UI_COCOA_PRESS + constexpr uint32_t accent_color_1 = hsl_to_rgb(12.8,0.597,0.263); // Darkest + constexpr uint32_t accent_color_2 = hsl_to_rgb(12.8,0.597,0.263); + constexpr uint32_t accent_color_3 = hsl_to_rgb( 9.6,0.664,0.443); + constexpr uint32_t accent_color_4 = hsl_to_rgb(16.3,0.873,0.537); + constexpr uint32_t accent_color_5 = hsl_to_rgb(23.0,0.889,0.539); + constexpr uint32_t accent_color_6 = hsl_to_rgb(23.0,0.889,0.539); // Lightest + #else + constexpr uint32_t accent_color_1 = hsl_to_rgb(accent_hue, accent_sat, 0.26); // Darkest + constexpr uint32_t accent_color_2 = hsl_to_rgb(accent_hue, accent_sat, 0.39); + constexpr uint32_t accent_color_3 = hsl_to_rgb(accent_hue, accent_sat, 0.52); + constexpr uint32_t accent_color_4 = hsl_to_rgb(accent_hue, accent_sat, 0.65); + constexpr uint32_t accent_color_5 = hsl_to_rgb(accent_hue, accent_sat, 0.78); + constexpr uint32_t accent_color_6 = hsl_to_rgb(accent_hue, accent_sat, 0.91); // Lightest + #endif + + // Shades of gray + + constexpr float gray_sat = 0.14; + + constexpr uint32_t gray_color_1 = hsl_to_rgb(accent_hue, gray_sat, 0.26); // Darkest + constexpr uint32_t gray_color_2 = hsl_to_rgb(accent_hue, gray_sat, 0.39); + constexpr uint32_t gray_color_3 = hsl_to_rgb(accent_hue, gray_sat, 0.52); + constexpr uint32_t gray_color_4 = hsl_to_rgb(accent_hue, gray_sat, 0.65); + constexpr uint32_t gray_color_5 = hsl_to_rgb(accent_hue, gray_sat, 0.78); + constexpr uint32_t gray_color_6 = hsl_to_rgb(accent_hue, gray_sat, 0.91); // Lightest + + #if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS) + // Lulzbot TAZ Pro + constexpr uint32_t theme_darkest = gray_color_1; + constexpr uint32_t theme_dark = gray_color_2; + + constexpr uint32_t bg_color = theme_darkest; + constexpr uint32_t bg_text_disabled = theme_dark; + constexpr uint32_t bg_text_enabled = 0xFFFFFF; + constexpr uint32_t bg_normal = theme_darkest; + + constexpr uint32_t fg_normal = theme_dark; + constexpr uint32_t fg_action = accent_color_2; + constexpr uint32_t fg_disabled = theme_darkest; + #else + // Lulzbot Bio + constexpr uint32_t theme_darkest = accent_color_1; + constexpr uint32_t theme_dark = accent_color_4; + + constexpr uint32_t bg_color = 0xFFFFFF; + constexpr uint32_t bg_text_disabled = gray_color_1; + constexpr uint32_t bg_text_enabled = accent_color_1; + constexpr uint32_t bg_normal = accent_color_4; + + constexpr uint32_t fg_normal = accent_color_1; + constexpr uint32_t fg_action = accent_color_4; + constexpr uint32_t fg_disabled = gray_color_6; + + constexpr uint32_t shadow_rgb = gray_color_6; + constexpr uint32_t stroke_rgb = accent_color_1; + constexpr uint32_t fill_rgb = accent_color_3; + constexpr uint32_t syringe_rgb = accent_color_5; + #endif + + constexpr uint32_t x_axis = 0xFF0000; + constexpr uint32_t y_axis = 0x00BB00; + constexpr uint32_t z_axis = 0x0000BF; + constexpr uint32_t e_axis = gray_color_2; + constexpr uint32_t feedrate = gray_color_2; + constexpr uint32_t other = gray_color_2; + + // Status screen + constexpr uint32_t progress = gray_color_2; + constexpr uint32_t status_msg = gray_color_2; + constexpr uint32_t fan_speed = 0x377198; + constexpr uint32_t temp = 0x892c78; + constexpr uint32_t axis_label = gray_color_2; + + constexpr uint32_t disabled_icon = gray_color_1; + + // Calibration Registers Screen + constexpr uint32_t transformA = 0x3010D0; + constexpr uint32_t transformB = 0x4010D0; + constexpr uint32_t transformC = 0x5010D0; + constexpr uint32_t transformD = 0x6010D0; + constexpr uint32_t transformE = 0x7010D0; + constexpr uint32_t transformF = 0x8010D0; + constexpr uint32_t transformVal = 0x104010; + + constexpr btn_colors disabled_btn = {.bg = bg_color, .grad = fg_disabled, .fg = fg_disabled, .rgb = fg_disabled }; + constexpr btn_colors normal_btn = {.bg = fg_action, .grad = 0xFFFFFF, .fg = fg_normal, .rgb = 0xFFFFFF }; + constexpr btn_colors action_btn = {.bg = bg_color, .grad = 0xFFFFFF, .fg = fg_action, .rgb = 0xFFFFFF }; + constexpr btn_colors red_btn = {.bg = 0xFF5555, .grad = 0xFFFFFF, .fg = 0xFF0000, .rgb = 0xFFFFFF }; + constexpr btn_colors ui_slider = {.bg = theme_darkest, .grad = 0xFFFFFF, .fg = theme_dark, .rgb = accent_color_3 }; + constexpr btn_colors ui_toggle = {.bg = theme_darkest, .grad = 0xFFFFFF, .fg = theme_dark, .rgb = 0xFFFFFF }; + + // Temperature color scale + + const rgb_t cool_rgb ( 0, 0, 0); + const rgb_t low_rgb (128, 0, 0); + const rgb_t med_rgb (255, 128, 0); + const rgb_t high_rgb (255, 255, 128); +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/fonts.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/fonts.h new file mode 100644 index 000000000000..3e5a985cc3b2 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/fonts.h @@ -0,0 +1,80 @@ +/*********** + * fonts.h * + ***********/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +namespace Theme { + #ifdef TOUCH_UI_800x480 + #ifdef TOUCH_UI_PORTRAIT + constexpr int16_t font_tiny = 26; + constexpr int16_t font_xsmall = 28; + constexpr int16_t font_small = 29; + constexpr int16_t font_medium = 30; + constexpr int16_t font_large = 30; + constexpr int16_t font_xlarge = 31; + #else + constexpr int16_t font_tiny = 27; + constexpr int16_t font_xsmall = 29; + constexpr int16_t font_small = 30; + constexpr int16_t font_medium = 30; + constexpr int16_t font_large = 31; + constexpr int16_t font_xlarge = 31; + #endif + constexpr float icon_scale = 1.0; + #elif defined(TOUCH_UI_480x272) + #ifdef TOUCH_UI_PORTRAIT + constexpr int16_t font_tiny = 26; + constexpr int16_t font_xsmall = 26; + constexpr int16_t font_small = 26; + constexpr int16_t font_medium = 27; + constexpr int16_t font_large = 28; + constexpr int16_t font_xlarge = 29; + constexpr float icon_scale = 0.7; + #else + constexpr int16_t font_tiny = 26; + constexpr int16_t font_xsmall = 26; + constexpr int16_t font_small = 27; + constexpr int16_t font_medium = 28; + constexpr int16_t font_large = 30; + constexpr int16_t font_xlarge = 31; + constexpr float icon_scale = 0.6; + #endif + #elif defined(TOUCH_UI_320x240) + #ifdef TOUCH_UI_PORTRAIT + constexpr int16_t font_tiny = 26; + constexpr int16_t font_xsmall = 26; + constexpr int16_t font_small = 26; + constexpr int16_t font_medium = 27; + constexpr int16_t font_large = 27; + constexpr int16_t font_xlarge = 28; + constexpr float icon_scale = 0.6; + #else + constexpr int16_t font_tiny = 26; + constexpr int16_t font_xsmall = 26; + constexpr int16_t font_small = 26; + constexpr int16_t font_medium = 27; + constexpr int16_t font_large = 29; + constexpr int16_t font_xlarge = 30; + constexpr float icon_scale = 0.5; + #endif + #endif +} diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h new file mode 100644 index 000000000000..5e01f0471c6b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h @@ -0,0 +1,39 @@ + +/**************************************************************************** + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/** + * This file was auto-generated using "svg2cpp.py" + * + * The encoding consists of x,y pairs with the min and max scaled to + * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the + * start of a new closed path. + */ + +#pragma once + +constexpr float x_min = 0.000000; +constexpr float x_max = 480.000000; +constexpr float y_min = 0.000000; +constexpr float y_max = 272.000000; + +const PROGMEM uint16_t logo_fill[] = {0x419D, 0x546F, 0x3D05, 0x5615, 0x3942, 0x5A92, 0x36B7, 0x6136, 0x35C8, 0x6950, 0x35C8, 0x96B0, 0x36B7, 0x9ECA, 0x3942, 0xA56E, 0x3D05, 0xA9EB, 0x419D, 0xAB91, 0xBE60, 0xAB91, 0xC2F8, 0xA9EB, 0xC6BB, 0xA56E, 0xC946, 0x9ECA, 0xCA35, 0x96B0, 0xCA32, 0x546C, 0x419D, 0x546F}; + +const PROGMEM uint16_t logo_stroke[] = {0xADF3, 0x546C, 0x419D, 0x546F, 0x3D05, 0x5615, 0x3942, 0x5A92, 0x36B7, 0x6136, 0x35C8, 0x6950, 0x35C8, 0x96B0, 0x36B7, 0x9ECA, 0x3942, 0xA56E, 0x3D05, 0xA9EB, 0x419D, 0xAB91, 0xBE60, 0xAB91, 0xC2F8, 0xA9EB, 0xC6BB, 0xA56E, 0xC946, 0x9ECA, 0xCA35, 0x96B0, 0xCA32, 0x546C, 0xADF3, 0x546C, 0xFFFF, 0x419D, 0x5913, 0xB08C, 0x5913, 0xC794, 0x8250, 0xC794, 0x96B0, 0xC6DA, 0x9CFF, 0xC4E1, 0xA229, 0xC1F4, 0xA5A5, 0xBE60, 0xA6ED, 0x419D, 0xA6ED, 0x3E09, 0xA5A5, 0x3B1C, 0xA229, 0x3923, 0x9CFF, 0x3869, 0x96B0, 0x3869, 0x6950, 0x3923, 0x6301, 0x3B1C, 0x5DD7, 0x3E09, 0x5A5B, 0x419D, 0x5913, 0xFFFF, 0xAC7A, 0x8620, 0xAC7A, 0x9373, 0xA767, 0x9373, 0xA767, 0x75CB, 0xA1C6, 0x75CB, 0xA1C6, 0x9373, 0xA1C6, 0x9C8E, 0xA767, 0x9C8E, 0xAC7A, 0x9C8E, 0xB21C, 0x9C8E, 0xB21C, 0x9373, 0xB21C, 0x85E7, 0xB350, 0x8093, 0xB65F, 0x7E86, 0xB9D5, 0x8165, 0xBA83, 0x85E7, 0xBA83, 0x9C8E, 0xBEFE, 0x9C8E, 0xC024, 0x99E1, 0xC024, 0x8620, 0xBF7B, 0x7F22, 0xBD8F, 0x79A9, 0xBA7E, 0x7617, 0xB65F, 0x74D0, 0xB24F, 0x7622, 0xAF30, 0x79C6, 0xAD2F, 0x7F43, 0xAC7A, 0x8620, 0xAC7A, 0x8620, 0xAC7A, 0x8620, 0xFFFF, 0x8179, 0x9C8E, 0x7CE9, 0x9C8E, 0x7747, 0x9C8E, 0x7747, 0x92EC, 0x7747, 0x8949, 0x75A2, 0x81A3, 0x71A6, 0x7E73, 0x6DAB, 0x818B, 0x6C05, 0x88FC, 0x6DAF, 0x9019, 0x71C7, 0x92EC, 0x7505, 0x92EC, 0x7505, 0x9C8E, 0x7118, 0x9C8E, 0x6CD3, 0x9B06, 0x696B, 0x96D6, 0x6729, 0x909E, 0x6658, 0x88FC, 0x672D, 0x8133, 0x6980, 0x7AC7, 0x6D13, 0x766C, 0x71A6, 0x74D0, 0x7632, 0x766D, 0x79C2, 0x7AD1, 0x7C14, 0x8153, 0x7CE9, 0x8949, 0x7CE9, 0x92EC, 0x8179, 0x92EC, 0x8179, 0x8620, 0x822E, 0x7F43, 0x842E, 0x79C6, 0x874E, 0x7622, 0x8B5E, 0x74D0, 0x8F7C, 0x7617, 0x928E, 0x79A9, 0x9479, 0x7F22, 0x9523, 0x8620, 0x9523, 0x87DB, 0x8F81, 0x87DB, 0x8F81, 0x85E7, 0x8ED4, 0x8165, 0x8B5E, 0x7E86, 0x884F, 0x8093, 0x871A, 0x85E7, 0x871A, 0x92EC, 0x871A, 0x9C8F, 0x8179, 0x9C8F, 0x8179, 0x9C8E, 0x8179, 0x9C8E, 0xFFFF, 0x6515, 0x79DB, 0x644C, 0x7281, 0x6218, 0x6C86, 0x5EB2, 0x6882, 0x5A56, 0x670A, 0x55D9, 0x68E0, 0x5272, 0x6DD0, 0x4F0B, 0x68E0, 0x4A8E, 0x670A, 0x4638, 0x6882, 0x42D5, 0x6C86, 0x40A2, 0x7281, 0x3FD9, 0x79DB, 0x3FD9, 0x9AC9, 0x40E4, 0x9C8E, 0x456F, 0x9C8E, 0x456F, 0x79B5, 0x46D4, 0x735D, 0x4A8E, 0x70C0, 0x4E3E, 0x735D, 0x4FA1, 0x79B5, 0x4FA1, 0x9C8E, 0x554D, 0x9C8E, 0x554D, 0x79B5, 0x56A7, 0x735D, 0x5A56, 0x70C0, 0x5E0C, 0x735D, 0x5F74, 0x79B5, 0x5F74, 0x9C8E, 0x6515, 0x9C8E, 0x6515, 0x79DB, 0x6515, 0x79DB, 0x6515, 0x79DB, 0xFFFF, 0x9672, 0x8C4C, 0x9714, 0x9379, 0x98F5, 0x98D2, 0x9C0B, 0x9BF4, 0xA04C, 0x9C7B, 0xA04C, 0x9373, 0x9D2B, 0x920C, 0x9C1E, 0x8C4C, 0x9C1E, 0x648E, 0x9672, 0x648E, 0x9672, 0x8C4C, 0x9672, 0x8C4C, 0x9672, 0x8C4C, 0xFFFF, 0xA767, 0x7194, 0xA767, 0x6C02, 0xA692, 0x687A, 0xA496, 0x670A, 0xA291, 0x687A, 0xA1BB, 0x6C02, 0xA1BB, 0x7194, 0xA767, 0x7194, 0xA767, 0x7194, 0xA767, 0x7194}; + +#define LOGO_BACKGROUND logo_bg_rgb +#define LOGO_PAINT_PATHS \ + LOGO_PAINT_PATH(logo_stroke_rgb, logo_stroke) \ + LOGO_PAINT_PATH(logo_fill_rgb, logo_fill) diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h new file mode 100644 index 000000000000..a5af7a14cd9c --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h @@ -0,0 +1,39 @@ + +/**************************************************************************** + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/** + * This file was auto-generated using "svg2cpp.py" + * + * The encoding consists of x,y pairs with the min and max scaled to + * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the + * start of a new closed path. + */ + +#pragma once + +constexpr float x_min = 0.000000; +constexpr float x_max = 272.000000; +constexpr float y_min = 0.000000; +constexpr float y_max = 480.000000; + +const PROGMEM uint16_t logo_fill[] = {0x3C19, 0x70C5, 0x371A, 0x7159, 0x3302, 0x72EA, 0x303D, 0x753C, 0x2F39, 0x7811, 0x2F39, 0x87ED, 0x303D, 0x8AC2, 0x3302, 0x8D14, 0x371A, 0x8EA5, 0x3C19, 0x8F39, 0xC3E4, 0x8F39, 0xC8E3, 0x8EA5, 0xCCFB, 0x8D14, 0xCFC0, 0x8AC2, 0xD0C4, 0x87ED, 0xD0C0, 0x70C4, 0x3C19, 0x70C5}; + +const PROGMEM uint16_t logo_stroke[] = {0x3C19, 0x70C5, 0x371A, 0x7159, 0x3302, 0x72EA, 0x303D, 0x753C, 0x2F39, 0x7811, 0x2F39, 0x87ED, 0x303D, 0x8AC2, 0x3302, 0x8D14, 0x371A, 0x8EA5, 0x3C19, 0x8F39, 0xC3E4, 0x8F39, 0xC8E3, 0x8EA5, 0xCCFB, 0x8D14, 0xCFC0, 0x8AC2, 0xD0C4, 0x87ED, 0xD0C0, 0x70C4, 0x3C19, 0x70C5, 0xFFFF, 0x3C19, 0x7264, 0xB4D6, 0x7264, 0xCDE7, 0x80CE, 0xCDE7, 0x87ED, 0xCD1D, 0x8A21, 0xCAF7, 0x8BEF, 0xC7C8, 0x8D27, 0xC3E4, 0x8D9A, 0x3C19, 0x8D9A, 0x3835, 0x8D27, 0x3506, 0x8BEF, 0x32E0, 0x8A21, 0x3216, 0x87ED, 0x3216, 0x7811, 0x32E0, 0x75DD, 0x3506, 0x740F, 0x3835, 0x72D7, 0x3C19, 0x7264, 0xFFFF, 0xB069, 0x8223, 0xB069, 0x86CB, 0xAAE2, 0x86CB, 0xAAE2, 0x7C6E, 0xA4C2, 0x7C6E, 0xA4C2, 0x86CB, 0xA4C2, 0x89FA, 0xAAE2, 0x89FA, 0xB069, 0x89FA, 0xB689, 0x89FA, 0xB689, 0x86CB, 0xB689, 0x820F, 0xB7D9, 0x8033, 0xBB2E, 0x7F7B, 0xBEF2, 0x807C, 0xBFAE, 0x820F, 0xBFAE, 0x89FA, 0xC48F, 0x89FA, 0xC5CF, 0x890A, 0xC5CF, 0x8223, 0xC517, 0x7FB2, 0xC300, 0x7DC8, 0xBFA9, 0x7C88, 0xBB2E, 0x7C16, 0xB6C1, 0x7C8C, 0xB35B, 0x7DD2, 0xB12D, 0x7FBD, 0xB069, 0x8223, 0xB069, 0x8223, 0xB069, 0x8223, 0xFFFF, 0x819B, 0x89FA, 0x7CA3, 0x89FA, 0x7682, 0x89FA, 0x7682, 0x869C, 0x7682, 0x833E, 0x74B7, 0x8092, 0x7062, 0x7F74, 0x6C0C, 0x8089, 0x6A41, 0x8323, 0x6C10, 0x859F, 0x7085, 0x869C, 0x740C, 0x869C, 0x740C, 0x89FA, 0x6FC7, 0x89FA, 0x6B21, 0x8971, 0x676C, 0x87FA, 0x64F8, 0x85CE, 0x6414, 0x8323, 0x64FC, 0x806A, 0x6784, 0x7E2C, 0x6B67, 0x7CA6, 0x7062, 0x7C16, 0x7555, 0x7CA6, 0x7935, 0x7E2F, 0x7BBC, 0x8076, 0x7CA3, 0x833E, 0x7CA3, 0x869C, 0x819A, 0x869C, 0x819A, 0x8223, 0x825F, 0x7FBD, 0x848D, 0x7DD2, 0x87F3, 0x7C8C, 0x8C60, 0x7C16, 0x90DB, 0x7C88, 0x9432, 0x7DC8, 0x9648, 0x7FB2, 0x9701, 0x8223, 0x9701, 0x82BE, 0x90E0, 0x82BE, 0x90E0, 0x820F, 0x9024, 0x807C, 0x8C60, 0x7F7B, 0x890B, 0x8033, 0x87BB, 0x820F, 0x87BB, 0x869C, 0x87BB, 0x89FA, 0x819B, 0x89FA, 0x819B, 0x89FA, 0x819B, 0x89FA, 0xFFFF, 0x62B5, 0x7DD9, 0x61DA, 0x7B47, 0x5F73, 0x7931, 0x5BC1, 0x77C9, 0x5702, 0x7746, 0x521F, 0x77EA, 0x4E6B, 0x79A4, 0x4AB8, 0x77EA, 0x45D5, 0x7746, 0x411D, 0x77C9, 0x3D6E, 0x7931, 0x3B09, 0x7B47, 0x3A2E, 0x7DD9, 0x3A2E, 0x895C, 0x3B51, 0x89FA, 0x4043, 0x89FA, 0x4043, 0x7DCC, 0x41C6, 0x7B95, 0x45D5, 0x7AAB, 0x49D9, 0x7B95, 0x4B5B, 0x7DCC, 0x4B5B, 0x89FA, 0x5188, 0x89FA, 0x5188, 0x7DCC, 0x52FF, 0x7B95, 0x5702, 0x7AAB, 0x5B0C, 0x7B95, 0x5C94, 0x7DCC, 0x5C94, 0x89FA, 0x62B5, 0x89FA, 0x62B5, 0x7DD9, 0x62B5, 0x7DD9, 0x62B5, 0x7DD9, 0xFFFF, 0x986E, 0x844B, 0x991E, 0x86CD, 0x9B2A, 0x88AC, 0x9E85, 0x89C4, 0xA327, 0x89F3, 0xA327, 0x86CB, 0x9FBF, 0x864E, 0x9E9A, 0x844B, 0x9E9A, 0x7668, 0x986E, 0x7668, 0x986E, 0x844B, 0x986E, 0x844B, 0x986E, 0x844B, 0xFFFF, 0xAAE2, 0x7AF5, 0xAAE2, 0x7902, 0xA9FB, 0x77C7, 0xA7D2, 0x7746, 0xA59F, 0x77C7, 0xA4B6, 0x7902, 0xA4B6, 0x7AF5, 0xAAE2, 0x7AF5, 0xAAE2, 0x7AF5, 0xAAE2, 0x7AF5}; + +#define LOGO_BACKGROUND logo_bg_rgb +#define LOGO_PAINT_PATHS \ + LOGO_PAINT_PATH(logo_stroke_rgb, logo_stroke) \ + LOGO_PAINT_PATH(logo_fill_rgb, logo_fill) diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.cpp new file mode 100644 index 000000000000..e08373390f8d --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.cpp @@ -0,0 +1,410 @@ +/************** + * sounds.cpp * + **************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../compat.h" + +#if ENABLED(TOUCH_UI_FTDI_EVE) + +#include "../ftdi_eve_lib/ftdi_eve_lib.h" + +#include "sounds.h" + +namespace Theme { + using namespace FTDI; + + const PROGMEM SoundPlayer::sound_t chimes[] = { + {CHIMES, NOTE_G3, 5}, + {CHIMES, NOTE_E4, 5}, + {CHIMES, NOTE_C4, 5}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t sad_trombone[] = { + {TRUMPET, NOTE_A3S, 10}, + {TRUMPET, NOTE_A3 , 10}, + {TRUMPET, NOTE_G3S, 10}, + {TRUMPET, NOTE_G3, 20}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t twinkle[] = { + {GLOCKENSPIEL, NOTE_C4, 1}, + {GLOCKENSPIEL, NOTE_E4, 1}, + {GLOCKENSPIEL, NOTE_G4, 16}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t fanfare[] = { + {TRUMPET, NOTE_A3, 4}, + {SILENCE, REST, 1}, + {TRUMPET, NOTE_A3, 2}, + {SILENCE, REST, 1}, + {TRUMPET, NOTE_A3, 2}, + {SILENCE, REST, 1}, + {TRUMPET, NOTE_E4, 10}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t media_inserted[] = { + {MUSIC_BOX, NOTE_C4, 2}, + {MUSIC_BOX, NOTE_E4, 2}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t media_removed[] = { + {MUSIC_BOX, NOTE_E4, 2}, + {MUSIC_BOX, NOTE_C4, 2}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t js_bach_toccata[] = { + {ORGAN, NOTE_A4, 2}, + {ORGAN, NOTE_G4, 2}, + {ORGAN, NOTE_A4, 35}, + {SILENCE, REST, 12}, + {ORGAN, NOTE_G4, 4}, + {ORGAN, NOTE_F4, 4}, + {ORGAN, NOTE_E4, 4}, + {ORGAN, NOTE_D4, 4}, + {ORGAN, NOTE_C4S, 16}, + {ORGAN, NOTE_D4, 32}, + {SILENCE, REST, 42}, + + {ORGAN, NOTE_A3, 2}, + {ORGAN, NOTE_G3, 2}, + {ORGAN, NOTE_A3, 35}, + {SILENCE, REST, 9}, + {ORGAN, NOTE_E3, 8}, + {ORGAN, NOTE_F3, 8}, + {ORGAN, NOTE_C3S, 16}, + {ORGAN, NOTE_D3, 27}, + {SILENCE, REST, 42}, + + {ORGAN, NOTE_A2, 2}, + {ORGAN, NOTE_G2, 2}, + {ORGAN, NOTE_A2, 35}, + {SILENCE, REST, 12}, + {ORGAN, NOTE_G2, 4}, + {ORGAN, NOTE_F2, 4}, + {ORGAN, NOTE_E2, 4}, + {ORGAN, NOTE_D2, 4}, + {ORGAN, NOTE_C2S, 16}, + {ORGAN, NOTE_D2, 32}, + {SILENCE, REST, 52}, + + //{ORGAN, NOTE_D1, 28}, + {ORGAN, NOTE_C3S, 9}, + {ORGAN, NOTE_E3, 9}, + {ORGAN, NOTE_G3, 9}, + {ORGAN, NOTE_A3S, 9}, + {ORGAN, NOTE_C4S, 9}, + {ORGAN, NOTE_E4, 9}, + {ORGAN, NOTE_D4, 20}, + {SILENCE, REST, 30}, + + {ORGAN, NOTE_C4S, 4}, + {ORGAN, NOTE_D4, 2}, + {ORGAN, NOTE_E4, 2}, + + {ORGAN, NOTE_C4S, 2}, + {ORGAN, NOTE_D4, 2}, + {ORGAN, NOTE_E4, 2}, + + {ORGAN, NOTE_C4S, 2}, + {ORGAN, NOTE_D4, 2}, + {ORGAN, NOTE_E4, 2}, + + {ORGAN, NOTE_C4S, 2}, + {ORGAN, NOTE_D4, 4}, + {ORGAN, NOTE_E4, 4}, + {ORGAN, NOTE_F4, 2}, + {ORGAN, NOTE_G4, 2}, + + {ORGAN, NOTE_E4, 2}, + {ORGAN, NOTE_F4, 2}, + {ORGAN, NOTE_G4, 2}, + + {ORGAN, NOTE_E4, 2}, + {ORGAN, NOTE_F4, 2}, + {ORGAN, NOTE_G4, 2}, + + {ORGAN, NOTE_E4, 2}, + {ORGAN, NOTE_F4, 4}, + {ORGAN, NOTE_G4, 4}, + {ORGAN, NOTE_A4, 2}, + {ORGAN, NOTE_A4S, 2}, + + {ORGAN, NOTE_G4, 2}, + {ORGAN, NOTE_A4, 2}, + {ORGAN, NOTE_A4S, 2}, + + {ORGAN, NOTE_G4, 2}, + {ORGAN, NOTE_A4, 2}, + {ORGAN, NOTE_A4S, 2}, + + {ORGAN, NOTE_G4, 2}, + {ORGAN, NOTE_A4, 4}, + {SILENCE, REST, 36}, + + + {ORGAN, NOTE_C5S, 4}, + {ORGAN, NOTE_D5, 2}, + {ORGAN, NOTE_E5, 2}, + + {ORGAN, NOTE_C5S, 2}, + {ORGAN, NOTE_D5, 2}, + {ORGAN, NOTE_E5, 2}, + + {ORGAN, NOTE_C5S, 2}, + {ORGAN, NOTE_D5, 2}, + {ORGAN, NOTE_E5, 2}, + + {ORGAN, NOTE_C5S, 2}, + {ORGAN, NOTE_D5, 4}, + {ORGAN, NOTE_E5, 4}, + {ORGAN, NOTE_F5, 2}, + {ORGAN, NOTE_G5, 2}, + + {ORGAN, NOTE_E5, 2}, + {ORGAN, NOTE_F5, 2}, + {ORGAN, NOTE_G5, 2}, + + {ORGAN, NOTE_E5, 2}, + {ORGAN, NOTE_F5, 2}, + {ORGAN, NOTE_G5, 2}, + + {ORGAN, NOTE_E5, 2}, + {ORGAN, NOTE_F5, 4}, + {ORGAN, NOTE_G5, 4}, + {ORGAN, NOTE_A5, 2}, + {ORGAN, NOTE_A5S, 2}, + + {ORGAN, NOTE_G5, 2}, + {ORGAN, NOTE_A5, 2}, + {ORGAN, NOTE_A5S, 2}, + + {ORGAN, NOTE_G5, 2}, + {ORGAN, NOTE_A5, 2}, + {ORGAN, NOTE_A5S, 2}, + + {ORGAN, NOTE_G5, 2}, + {ORGAN, NOTE_A5, 4}, + {SILENCE, REST, 32}, + + {ORGAN, NOTE_A5, 4}, + {ORGAN, NOTE_G5, 2}, + {ORGAN, NOTE_A5S, 2}, + + {ORGAN, NOTE_E5, 2}, + {ORGAN, NOTE_G5, 2}, + {ORGAN, NOTE_A5S, 2}, + + {ORGAN, NOTE_E5, 2}, + {ORGAN, NOTE_F5, 2}, + {ORGAN, NOTE_A5, 2}, + + {ORGAN, NOTE_D5, 2}, + {ORGAN, NOTE_F5, 2}, + {ORGAN, NOTE_G5, 2}, + + {ORGAN, NOTE_D5, 2}, + {ORGAN, NOTE_E5, 2}, + {ORGAN, NOTE_A5, 2}, + + {ORGAN, NOTE_C5, 2}, + {ORGAN, NOTE_E5, 2}, + {ORGAN, NOTE_A5, 2}, + + {ORGAN, NOTE_C5, 2}, + {ORGAN, NOTE_D5, 2}, + {ORGAN, NOTE_F5, 2}, + + {ORGAN, NOTE_A4S, 2}, + {ORGAN, NOTE_D5, 2}, + {ORGAN, NOTE_E5, 2}, + + {ORGAN, NOTE_A4S, 2}, + {ORGAN, NOTE_C5, 2}, + {ORGAN, NOTE_E5, 2}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t js_bach_joy[] = { + {PIANO, NOTE_G3, 4}, + {PIANO, NOTE_A3, 4}, + {PIANO, NOTE_B3, 4}, + {PIANO, NOTE_D4, 3}, + {SILENCE, REST, 1}, + + {PIANO, NOTE_C4, 3}, + {SILENCE, REST, 1}, + {PIANO, NOTE_C4, 4}, + {PIANO, NOTE_E4, 3}, + {SILENCE, REST, 1}, + {PIANO, NOTE_D4, 2}, + {SILENCE, REST, 2}, + + {PIANO, NOTE_D4, 4}, + {PIANO, NOTE_G4 , 3}, + {SILENCE, REST, 1}, + {PIANO, NOTE_F4S, 4}, + {PIANO, NOTE_G4, 4}, + + {PIANO, NOTE_D4, 2}, + {SILENCE, REST, 2}, + {PIANO, NOTE_B3, 3}, + {SILENCE, REST, 1}, + {PIANO, NOTE_G3, 4}, + {PIANO, NOTE_A3, 2}, + {SILENCE, REST, 2}, + + {PIANO, NOTE_B3, 2}, + {SILENCE, REST, 2}, + {PIANO, NOTE_C4, 4}, + {PIANO, NOTE_D4, 2}, + {SILENCE, REST, 2}, + {PIANO, NOTE_E4, 2}, + {SILENCE, REST, 2}, + + {PIANO, NOTE_D4, 4}, + {PIANO, NOTE_C4, 2}, + {SILENCE, REST, 2}, + {PIANO, NOTE_B3, 2}, + {SILENCE, REST, 2}, + {PIANO, NOTE_A3, 4}, + + {PIANO, NOTE_B3, 2}, + {SILENCE, REST, 2}, + {PIANO, NOTE_G3, 2}, + {SILENCE, REST, 2}, + {PIANO, NOTE_G3, 8}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t big_band[] = { + {XYLOPHONE, NOTE_F4, 3}, + {XYLOPHONE, NOTE_G4, 3}, + {XYLOPHONE, NOTE_F4, 3}, + {XYLOPHONE, NOTE_D4, 3}, + {XYLOPHONE, NOTE_A3S, 3}, + {SILENCE, REST, 3}, + + {TRUMPET, NOTE_F4, 3}, + {TRUMPET, NOTE_G4, 3}, + {TRUMPET, NOTE_F4, 3}, + {TRUMPET, NOTE_D4, 3}, + {TRUMPET, NOTE_A3S, 3}, + {SILENCE, REST, 3}, + + {TUBA, NOTE_A2S, 6}, + {TUBA, NOTE_A2S, 6}, + {TUBA, NOTE_A2S, 4}, + {TUBA, NOTE_A2S, 6}, + {TUBA, NOTE_A2S, 6}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t beats[] = { + {SILENCE, REST, 8}, + {NOTCH, NOTE_C4, 8}, + {KICKDRUM, NOTE_C4, 8}, + {HIHAT, NOTE_C4, 8}, + {COWBELL, NOTE_C4, 8}, + {SILENCE, REST, 8}, + {NOTCH, NOTE_C4, 8}, + {KICKDRUM, NOTE_C4, 8}, + {HIHAT, NOTE_C4, 8}, + {COWBELL, NOTE_C4, 8}, + {SILENCE, REST, 8}, + {NOTCH, NOTE_C4, 8}, + {KICKDRUM, NOTE_C4, 8}, + {HIHAT, NOTE_C4, 8}, + {COWBELL, NOTE_C4, 8}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t beeping[] = { + {BEEPING, NOTE_C4, 64}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t alarm[] = { + {ALARM, NOTE_C4, 64}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t warble[] = { + {WARBLE, NOTE_C4, 64}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t carousel[] = { + {CAROUSEL, NOTE_C4, 64}, + {SILENCE, END_SONG, 0} + }; + + const PROGMEM SoundPlayer::sound_t all_instruments[] = { + {HARP}, + {XYLOPHONE}, + {TUBA}, + {GLOCKENSPIEL}, + {ORGAN}, + {TRUMPET}, + {PIANO}, + {CHIMES}, + {MUSIC_BOX}, + {BELL}, + {CLICK}, + {SWITCH}, + {COWBELL}, + {NOTCH}, + {HIHAT}, + {KICKDRUM}, + {SWITCH}, + {POP}, + {CLACK}, + {CHACK}, + {SILENCE, END_SONG, 0} + }; +}; // namespace Theme + +#define N_ELEMENTS(a) (sizeof(a)/sizeof(a[0])) + +const SoundList::list_t SoundList::list[] = { + {"Silence", FTDI::silence}, + {"Twinkle", Theme::twinkle}, + {"Chimes", Theme::chimes}, + {"Fanfare", Theme::fanfare}, + {"Sad Trombone", Theme::sad_trombone}, + {"Big Band", Theme::big_band}, + {"Beeping", Theme::beeping}, + {"Alarm", Theme::alarm}, + {"Warble", Theme::warble}, + {"Carousel", Theme::carousel}, + {"Beats", Theme::beats}, + {"Bach Joy", Theme::js_bach_joy}, + {"Bach Toccata", Theme::js_bach_toccata} +}; + +const uint8_t SoundList::n = N_ELEMENTS(SoundList::list); + +#endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.h new file mode 100644 index 000000000000..c728d0012f2d --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/sounds.h @@ -0,0 +1,43 @@ +/************ + * sounds.h * + ************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +namespace Theme { + using namespace FTDI; + + extern const PROGMEM SoundPlayer::sound_t chimes[]; + extern const PROGMEM SoundPlayer::sound_t sad_trombone[]; + extern const PROGMEM SoundPlayer::sound_t twinkle[]; + extern const PROGMEM SoundPlayer::sound_t fanfare[]; + extern const PROGMEM SoundPlayer::sound_t media_inserted[]; + extern const PROGMEM SoundPlayer::sound_t media_removed[]; + extern const PROGMEM SoundPlayer::sound_t js_bach_toccata[]; + extern const PROGMEM SoundPlayer::sound_t js_bach_joy[]; + extern const PROGMEM SoundPlayer::sound_t big_band[]; + extern const PROGMEM SoundPlayer::sound_t beats[]; + extern const PROGMEM SoundPlayer::sound_t beeping[]; + extern const PROGMEM SoundPlayer::sound_t alarm[]; + extern const PROGMEM SoundPlayer::sound_t warble[]; + extern const PROGMEM SoundPlayer::sound_t carousel[]; + extern const PROGMEM SoundPlayer::sound_t all_instruments[]; +}; // namespace Theme diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/theme.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/theme.h new file mode 100644 index 000000000000..6a73a07163c7 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/theme.h @@ -0,0 +1,28 @@ +/*********** + * theme.h * + ***********/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "bitmaps.h" +#include "colors.h" +#include "fonts.h" +#include "sounds.h" diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index 947e3d406541..253017493f28 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -60,7 +60,7 @@ #include "../../libs/numtostr.h" #endif -#if DO_SWITCH_EXTRUDER || EITHER(SWITCHING_NOZZLE, PARKING_EXTRUDER) +#if EXTRUDERS > 1 #include "../../module/tool_change.h" #endif @@ -77,7 +77,7 @@ #if HAS_TRINAMIC #include "../../feature/tmc_util.h" - #include "../../module/stepper_indirection.h" + #include "../../module/stepper/indirection.h" #endif #include "ui_api.h" @@ -94,20 +94,26 @@ #include "../../feature/runout.h" #endif +#if ENABLED(CASE_LIGHT_ENABLE) + #include "../../feature/caselight.h" +#endif + #if ENABLED(BABYSTEPPING) #include "../../feature/babystep.h" #endif -inline float clamp(const float value, const float minimum, const float maximum) { - return _MAX(_MIN(value, maximum), minimum); -} - -static struct { - uint8_t printer_killed : 1; - uint8_t manual_motion : 1; -} flags; +#if ENABLED(HOST_PROMPT_SUPPORT) + #include "../../feature/host_actions.h" +#endif namespace ExtUI { + static struct { + uint8_t printer_killed : 1; + #if ENABLED(JOYSTICK) + uint8_t jogging : 1; + #endif + } flags; + #ifdef __SAM3X8E__ /** * Implement a special millis() to allow time measurement @@ -164,8 +170,10 @@ namespace ExtUI { } void enableHeater(const extruder_t extruder) { - #if HEATER_IDLE_HANDLER + #if HOTENDS && HEATER_IDLE_HANDLER thermalManager.reset_heater_idle_timer(extruder - E0); + #else + UNUSED(extruder); #endif } @@ -180,15 +188,59 @@ namespace ExtUI { #if HAS_HEATED_CHAMBER case CHAMBER: return; // Chamber has no idle timer #endif - default: thermalManager.reset_heater_idle_timer(heater - H0); + default: + #if HOTENDS + thermalManager.reset_heater_idle_timer(heater - H0); + #endif + break; } + #else + UNUSED(heater); #endif } + #if ENABLED(JOYSTICK) + /** + * Jogs in the direction given by the vector (dx, dy, dz). + * The values range from -1 to 1 mapping to the maximum + * feedrate for an axis. + * + * The axis will continue to jog until this function is + * called with all zeros. + */ + void jog(const xyz_float_t &dir) { + // The "destination" variable is used as a scratchpad in + // Marlin by GCODE routines, but should remain untouched + // during manual jogging, allowing us to reuse the space + // for our direction vector. + destination = dir; + flags.jogging = !NEAR_ZERO(dir.x) || !NEAR_ZERO(dir.y) || !NEAR_ZERO(dir.z); + } + + // Called by the polling routine in "joystick.cpp" + void _joystick_update(xyz_float_t &norm_jog) { + if (flags.jogging) { + #define OUT_OF_RANGE(VALUE) (VALUE < -1.0f || VALUE > 1.0f) + + if (OUT_OF_RANGE(destination.x) || OUT_OF_RANGE(destination.y) || OUT_OF_RANGE(destination.z)) { + // If destination on any axis is out of range, it + // probably means the UI forgot to stop jogging and + // ran GCODE that wrote a position to destination. + // To prevent a disaster, stop jogging. + flags.jogging = false; + return; + } + norm_jog = destination; + } + } + #endif + bool isHeaterIdle(const extruder_t extruder) { return false - #if HEATER_IDLE_HANDLER + #if HOTENDS && HEATER_IDLE_HANDLER || thermalManager.hotend_idle[extruder - E0].timed_out + #else + ; UNUSED(extruder) #endif ; } @@ -202,43 +254,55 @@ namespace ExtUI { #if HAS_HEATED_CHAMBER case CHAMBER: return false; // Chamber has no idle timer #endif - default: return thermalManager.hotend_idle[heater - H0].timed_out; + default: + #if HOTENDS + return thermalManager.hotend_idle[heater - H0].timed_out; + #else + return false; + #endif } #else + UNUSED(heater); return false; #endif } + #ifdef TOUCH_UI_LCD_TEMP_SCALING + #define GET_TEMP_ADJUSTMENT(A) float(A)/TOUCH_UI_LCD_TEMP_SCALING + #else + #define GET_TEMP_ADJUSTMENT(A) A + #endif + float getActualTemp_celsius(const heater_t heater) { switch (heater) { #if HAS_HEATED_BED - case BED: return thermalManager.degBed(); + case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degBed()); #endif #if HAS_HEATED_CHAMBER - case CHAMBER: return thermalManager.degChamber(); + case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degChamber()); #endif - default: return thermalManager.degHotend(heater - H0); + default: return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(heater - H0)); } } float getActualTemp_celsius(const extruder_t extruder) { - return thermalManager.degHotend(extruder - E0); + return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(extruder - E0)); } float getTargetTemp_celsius(const heater_t heater) { switch (heater) { #if HAS_HEATED_BED - case BED: return thermalManager.degTargetBed(); + case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetBed()); #endif #if HAS_HEATED_CHAMBER - case CHAMBER: return thermalManager.degTargetChamber(); + case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetChamber()); #endif - default: return thermalManager.degTargetHotend(heater - H0); + default: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(heater - H0)); } } float getTargetTemp_celsius(const extruder_t extruder) { - return thermalManager.degTargetHotend(extruder - E0); + return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(extruder - E0)); } float getTargetFan_percent(const fan_t fan) { @@ -260,11 +324,24 @@ namespace ExtUI { } float getAxisPosition_mm(const axis_t axis) { - return flags.manual_motion ? destination[axis] : current_position[axis]; + return + #if ENABLED(JOYSTICK) + flags.jogging ? destination[axis] : + #endif + current_position[axis]; } - float getAxisPosition_mm(const extruder_t) { - return flags.manual_motion ? destination[E_AXIS] : current_position[E_AXIS]; + float getAxisPosition_mm(const extruder_t extruder) { + const extruder_t old_tool = getActiveTool(); + setActiveTool(extruder, true); + const float epos = ( + #if ENABLED(JOYSTICK) + flags.jogging ? destination.e : + #endif + current_position.e + ); + setActiveTool(old_tool, true); + return epos; } void setAxisPosition_mm(const float position, const axis_t axis) { @@ -277,26 +354,26 @@ namespace ExtUI { if (soft_endstops_enabled) switch (axis) { case X_AXIS: #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - min = soft_endstop[X_AXIS].min; + min = soft_endstop.min.x; #endif #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - max = soft_endstop[X_AXIS].max; + max = soft_endstop.max.x; #endif break; case Y_AXIS: #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - min = soft_endstop[Y_AXIS].min; + min = soft_endstop.min.y; #endif #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - max = soft_endstop[Y_AXIS].max; + max = soft_endstop.max.y; #endif break; case Z_AXIS: #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - min = soft_endstop[Z_AXIS].min; + min = soft_endstop.min.z; #endif #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - max = soft_endstop[Z_AXIS].max; + max = soft_endstop.max.z; #endif default: break; } @@ -311,57 +388,21 @@ namespace ExtUI { } #endif - if (!flags.manual_motion) set_destination_from_current(); - destination[axis] = clamp(position, min, max); - flags.manual_motion = true; + current_position[axis] = constrain(position, min, max); + line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m[axis])); } void setAxisPosition_mm(const float position, const extruder_t extruder) { setActiveTool(extruder, true); - if (!flags.manual_motion) set_destination_from_current(); - destination[E_AXIS] = position; - flags.manual_motion = true; - } - - void _processManualMoveToDestination() { - // Lower max_response_lag makes controls more responsive, but makes CPU work harder - constexpr float max_response_lag = 0.1; // seconds - constexpr uint8_t segments_to_buffer = 4; // keep planner filled with this many segments - - if (flags.manual_motion && planner.movesplanned() < segments_to_buffer) { - float saved_destination[XYZ]; - COPY(saved_destination, destination); - // Compute direction vector from current_position towards destination. - destination[X_AXIS] -= current_position[X_AXIS]; - destination[Y_AXIS] -= current_position[Y_AXIS]; - destination[Z_AXIS] -= current_position[Z_AXIS]; - const float inv_length = RSQRT(sq(destination[X_AXIS]) + sq(destination[Y_AXIS]) + sq(destination[Z_AXIS])); - // Find move segment length so that all segments can execute in less time than max_response_lag - const float scale = inv_length * feedrate_mm_s * max_response_lag / segments_to_buffer; - if (scale < 1) { - // Move a small bit towards the destination. - destination[X_AXIS] = scale * destination[X_AXIS] + current_position[X_AXIS]; - destination[Y_AXIS] = scale * destination[Y_AXIS] + current_position[Y_AXIS]; - destination[Z_AXIS] = scale * destination[Z_AXIS] + current_position[Z_AXIS]; - prepare_move_to_destination(); - COPY(destination, saved_destination); - } - else { - // We are close enough to finish off the move. - COPY(destination, saved_destination); - prepare_move_to_destination(); - flags.manual_motion = false; - } - } + current_position.e = position; + line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.e)); } void setActiveTool(const extruder_t extruder, bool no_move) { #if EXTRUDERS > 1 const uint8_t e = extruder - E0; - #if DO_SWITCH_EXTRUDER || EITHER(SWITCHING_NOZZLE, PARKING_EXTRUDER) - if (e != active_extruder) tool_change(e, no_move); - #endif + if (e != active_extruder) tool_change(e, no_move); active_extruder = e; #else UNUSED(extruder); @@ -447,13 +488,13 @@ namespace ExtUI { void setAxisCurrent_mA(const float mA, const axis_t axis) { switch (axis) { #if AXIS_IS_TMC(X) - case X: stepperX.rms_current(clamp(mA, 500, 1500)); break; + case X: stepperX.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(Y) - case Y: stepperY.rms_current(clamp(mA, 500, 1500)); break; + case Y: stepperY.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(Z) - case Z: stepperZ.rms_current(clamp(mA, 500, 1500)); break; + case Z: stepperZ.rms_current(constrain(mA, 500, 1500)); break; #endif default: break; }; @@ -462,22 +503,22 @@ namespace ExtUI { void setAxisCurrent_mA(const float mA, const extruder_t extruder) { switch (extruder) { #if AXIS_IS_TMC(E0) - case E0: stepperE0.rms_current(clamp(mA, 500, 1500)); break; + case E0: stepperE0.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E1) - case E1: stepperE1.rms_current(clamp(mA, 500, 1500)); break; + case E1: stepperE1.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E2) - case E2: stepperE2.rms_current(clamp(mA, 500, 1500)); break; + case E2: stepperE2.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E3) - case E3: stepperE3.rms_current(clamp(mA, 500, 1500)); break; + case E3: stepperE3.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E4) - case E4: stepperE4.rms_current(clamp(mA, 500, 1500)); break; + case E4: stepperE4.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E5) - case E5: stepperE5.rms_current(clamp(mA, 500, 1500)); break; + case E5: stepperE5.rms_current(constrain(mA, 500, 1500)); break; #endif default: break; }; @@ -485,13 +526,13 @@ namespace ExtUI { int getTMCBumpSensitivity(const axis_t axis) { switch (axis) { - #if X_SENSORLESS && AXIS_HAS_STALLGUARD(X) + #if X_SENSORLESS case X: return stepperX.homing_threshold(); #endif - #if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y) + #if Y_SENSORLESS case Y: return stepperY.homing_threshold(); #endif - #if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z) + #if Z_SENSORLESS case Z: return stepperZ.homing_threshold(); #endif default: return 0; @@ -500,14 +541,18 @@ namespace ExtUI { void setTMCBumpSensitivity(const float value, const axis_t axis) { switch (axis) { - #if X_SENSORLESS && AXIS_HAS_STALLGUARD(X) - case X: stepperX.homing_threshold(value); break; - #endif - #if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y) - case Y: stepperY.homing_threshold(value); break; - #endif - #if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z) - case Z: stepperZ.homing_threshold(value); break; + #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS + #if X_SENSORLESS + case X: stepperX.homing_threshold(value); break; + #endif + #if Y_SENSORLESS + case Y: stepperY.homing_threshold(value); break; + #endif + #if Z_SENSORLESS + case Z: stepperZ.homing_threshold(value); break; + #endif + #else + UNUSED(value); #endif default: break; } @@ -532,22 +577,22 @@ namespace ExtUI { planner.settings.axis_steps_per_mm[E_AXIS_N(axis - E0)] = value; } - float getAxisMaxFeedrate_mm_s(const axis_t axis) { + feedRate_t getAxisMaxFeedrate_mm_s(const axis_t axis) { return planner.settings.max_feedrate_mm_s[axis]; } - float getAxisMaxFeedrate_mm_s(const extruder_t extruder) { + feedRate_t getAxisMaxFeedrate_mm_s(const extruder_t extruder) { UNUSED_E(extruder); return planner.settings.max_feedrate_mm_s[E_AXIS_N(axis - E0)]; } - void setAxisMaxFeedrate_mm_s(const float value, const axis_t axis) { - planner.settings.max_feedrate_mm_s[axis] = value; + void setAxisMaxFeedrate_mm_s(const feedRate_t value, const axis_t axis) { + planner.set_max_feedrate(axis, value); } - void setAxisMaxFeedrate_mm_s(const float value, const extruder_t extruder) { + void setAxisMaxFeedrate_mm_s(const feedRate_t value, const extruder_t extruder) { UNUSED_E(extruder); - planner.settings.max_feedrate_mm_s[E_AXIS_N(axis - E0)] = value; + planner.set_max_feedrate(E_AXIS_N(extruder - E0), value); } float getAxisMaxAcceleration_mm_s2(const axis_t axis) { @@ -560,12 +605,12 @@ namespace ExtUI { } void setAxisMaxAcceleration_mm_s2(const float value, const axis_t axis) { - planner.settings.max_acceleration_mm_per_s2[axis] = value; + planner.set_max_acceleration(axis, value); } void setAxisMaxAcceleration_mm_s2(const float value, const extruder_t extruder) { UNUSED_E(extruder); - planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(extruder - E0)] = value; + planner.set_max_acceleration(E_AXIS_N(extruder - E0), value); } #if HAS_FILAMENT_SENSOR @@ -574,7 +619,23 @@ namespace ExtUI { #ifdef FILAMENT_RUNOUT_DISTANCE_MM float getFilamentRunoutDistance_mm() { return runout.runout_distance(); } - void setFilamentRunoutDistance_mm(const float value) { runout.set_runout_distance(clamp(value, 0, 999)); } + void setFilamentRunoutDistance_mm(const float value) { runout.set_runout_distance(constrain(value, 0, 999)); } + #endif + #endif + + #if HAS_CASE_LIGHT + bool getCaseLightState() { return case_light_on; } + void setCaseLightState(const bool value) { + case_light_on = value; + update_case_light(); + } + + #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + float getCaseLightBrightness_percent() { return ui8_to_percent(case_light_brightness); } + void setCaseLightBrightness_percent(const float value) { + case_light_brightness = map(constrain(value, 0, 100), 0, 100, 0, 255); + update_case_light(); + } #endif #endif @@ -585,18 +646,18 @@ namespace ExtUI { void setLinearAdvance_mm_mm_s(const float value, const extruder_t extruder) { if (extruder < EXTRUDERS) - planner.extruder_advance_K[extruder - E0] = clamp(value, 0, 999); + planner.extruder_advance_K[extruder - E0] = constrain(value, 0, 999); } #endif - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) float getJunctionDeviation_mm() { return planner.junction_deviation_mm; } void setJunctionDeviation_mm(const float value) { - planner.junction_deviation_mm = clamp(value, 0.01, 0.3); + planner.junction_deviation_mm = constrain(value, 0.01, 0.3); #if ENABLED(LIN_ADVANCE) planner.recalculate_max_e_jerk(); #endif @@ -609,27 +670,32 @@ namespace ExtUI { } float getAxisMaxJerk_mm_s(const extruder_t) { - return planner.max_jerk[E_AXIS]; + return planner.max_jerk.e; } void setAxisMaxJerk_mm_s(const float value, const axis_t axis) { - planner.max_jerk[axis] = value; + planner.set_max_jerk((AxisEnum)axis, value); } void setAxisMaxJerk_mm_s(const float value, const extruder_t) { - planner.max_jerk[E_AXIS] = value; + planner.set_max_jerk(E_AXIS, value); } #endif - float getFeedrate_mm_s() { return feedrate_mm_s; } - float getMinFeedrate_mm_s() { return planner.settings.min_feedrate_mm_s; } - float getMinTravelFeedrate_mm_s() { return planner.settings.min_travel_feedrate_mm_s; } + feedRate_t getFeedrate_mm_s() { return feedrate_mm_s; } + int16_t getFlowPercentage(const extruder_t extr) { return planner.flow_percentage[extr]; } + feedRate_t getMinFeedrate_mm_s() { return planner.settings.min_feedrate_mm_s; } + feedRate_t getMinTravelFeedrate_mm_s() { return planner.settings.min_travel_feedrate_mm_s; } float getPrintingAcceleration_mm_s2() { return planner.settings.acceleration; } float getRetractAcceleration_mm_s2() { return planner.settings.retract_acceleration; } float getTravelAcceleration_mm_s2() { return planner.settings.travel_acceleration; } - void setFeedrate_mm_s(const float fr) { feedrate_mm_s = fr; } - void setMinFeedrate_mm_s(const float fr) { planner.settings.min_feedrate_mm_s = fr; } - void setMinTravelFeedrate_mm_s(const float fr) { planner.settings.min_travel_feedrate_mm_s = fr; } + void setFeedrate_mm_s(const feedRate_t fr) { feedrate_mm_s = fr; } + void setFlow_percent(const int16_t flow, const extruder_t extr) { + planner.flow_percentage[extr] = flow; + planner.refresh_e_factor(extr); + } + void setMinFeedrate_mm_s(const feedRate_t fr) { planner.settings.min_feedrate_mm_s = fr; } + void setMinTravelFeedrate_mm_s(const feedRate_t fr) { planner.settings.min_travel_feedrate_mm_s = fr; } void setPrintingAcceleration_mm_s2(const float acc) { planner.settings.acceleration = acc; } void setRetractAcceleration_mm_s2(const float acc) { planner.settings.retract_acceleration = acc; } void setTravelAcceleration_mm_s2(const float acc) { planner.settings.travel_acceleration = acc; } @@ -667,10 +733,12 @@ namespace ExtUI { #if EXTRUDERS > 1 && (linked_nozzles || active_extruder == 0) #endif - ) zprobe_zoffset += mm; + ) probe_offset.z += mm; + #else + UNUSED(mm); #endif - #if EXTRUDERS > 1 + #if EXTRUDERS > 1 && HAS_HOTEND_OFFSET /** * When linked_nozzles is false, as an axis is babystepped * adjust the hotend offsets so that the other nozzles are @@ -679,7 +747,7 @@ namespace ExtUI { if (!linked_nozzles) { HOTEND_LOOP() if (e != active_extruder) - hotend_offset[axis][e] += mm; + hotend_offset[e][axis] += mm; normalizeNozzleOffset(X); normalizeNozzleOffset(Y); @@ -687,6 +755,7 @@ namespace ExtUI { } #else UNUSED(linked_nozzles); + UNUSED(mm); #endif } @@ -700,28 +769,37 @@ namespace ExtUI { } #endif - #if HAS_BED_PROBE - float getZOffset_mm() { - return zprobe_zoffset; - } + float getZOffset_mm() { + #if HAS_BED_PROBE + return probe_offset.z; + #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) + return (planner.steps_to_mm[Z_AXIS] * babystep.axis_total[BS_TODO_AXIS(Z_AXIS)]); + #else + return 0.0; + #endif + } - void setZOffset_mm(const float value) { - if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - zprobe_zoffset = value; - } - } - #endif // HAS_BED_PROBE + void setZOffset_mm(const float value) { + #if HAS_BED_PROBE + if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + probe_offset.z = value; + #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) + babystep.add_mm(Z_AXIS, (value - getZOffset_mm())); + #else + UNUSED(value); + #endif + } #if HAS_HOTEND_OFFSET float getNozzleOffset_mm(const axis_t axis, const extruder_t extruder) { if (extruder - E0 >= HOTENDS) return 0; - return hotend_offset[axis][extruder - E0]; + return hotend_offset[extruder - E0][axis]; } void setNozzleOffset_mm(const float value, const axis_t axis, const extruder_t extruder) { if (extruder - E0 >= HOTENDS) return; - hotend_offset[axis][extruder - E0] = value; + hotend_offset[extruder - E0][axis] = value; } /** @@ -730,8 +808,8 @@ namespace ExtUI { * user to edit the offset the first nozzle). */ void normalizeNozzleOffset(const axis_t axis) { - const float offs = hotend_offset[axis][0]; - HOTEND_LOOP() hotend_offset[axis][e] -= offs; + const float offs = hotend_offset[0][axis]; + HOTEND_LOOP() hotend_offset[e][axis] -= offs; } #endif // HAS_HOTEND_OFFSET @@ -739,19 +817,19 @@ namespace ExtUI { #if ENABLED(BACKLASH_GCODE) float getAxisBacklash_mm(const axis_t axis) { return backlash.distance_mm[axis]; } void setAxisBacklash_mm(const float value, const axis_t axis) - { backlash.distance_mm[axis] = clamp(value,0,5); } + { backlash.distance_mm[axis] = constrain(value,0,5); } float getBacklashCorrection_percent() { return ui8_to_percent(backlash.correction); } - void setBacklashCorrection_percent(const float value) { backlash.correction = map(clamp(value, 0, 100), 0, 100, 0, 255); } + void setBacklashCorrection_percent(const float value) { backlash.correction = map(constrain(value, 0, 100), 0, 100, 0, 255); } #ifdef BACKLASH_SMOOTHING_MM float getBacklashSmoothing_mm() { return backlash.smoothing_mm; } - void setBacklashSmoothing_mm(const float value) { backlash.smoothing_mm = clamp(value, 0, 999); } + void setBacklashSmoothing_mm(const float value) { backlash.smoothing_mm = constrain(value, 0, 999); } #endif #endif uint8_t getProgress_percent() { - return ui.get_progress(); + return ui.get_progress_percent(); } uint32_t getProgress_seconds_elapsed() { @@ -764,11 +842,11 @@ namespace ExtUI { void setLevelingActive(const bool state) { set_bed_leveling_enabled(state); } bool getMeshValid() { return leveling_is_valid(); } #if HAS_MESH - bed_mesh_t getMeshArray() { return Z_VALUES_ARR; } - float getMeshPoint(const uint8_t xpos, const uint8_t ypos) { return Z_VALUES(xpos,ypos); } - void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zoff) { - if (WITHIN(xpos, 0, GRID_MAX_POINTS_X) && WITHIN(ypos, 0, GRID_MAX_POINTS_Y)) { - Z_VALUES(xpos, ypos) = zoff; + bed_mesh_t& getMeshArray() { return Z_VALUES_ARR; } + float getMeshPoint(const xy_uint8_t &pos) { return Z_VALUES(pos.x, pos.y); } + void setMeshPoint(const xy_uint8_t &pos, const float zoff) { + if (WITHIN(pos.x, 0, GRID_MAX_POINTS_X) && WITHIN(pos.y, 0, GRID_MAX_POINTS_Y)) { + Z_VALUES(pos.x, pos.y) = zoff; #if ENABLED(ABL_BILINEAR_SUBDIVISION) bed_level_virt_interpolate(); #endif @@ -784,8 +862,8 @@ namespace ExtUI { #if ENABLED(PRINTCOUNTER) char* getTotalPrints_str(char buffer[21]) { strcpy(buffer,i16tostr3left(print_job_timer.getStats().totalPrints)); return buffer; } char* getFinishedPrints_str(char buffer[21]) { strcpy(buffer,i16tostr3left(print_job_timer.getStats().finishedPrints)); return buffer; } - char* getTotalPrintTime_str(char buffer[21]) { duration_t(print_job_timer.getStats().printTime).toString(buffer); return buffer; } - char* getLongestPrint_str(char buffer[21]) { duration_t(print_job_timer.getStats().printTime).toString(buffer); return buffer; } + char* getTotalPrintTime_str(char buffer[21]) { return duration_t(print_job_timer.getStats().printTime).toString(buffer); } + char* getLongestPrint_str(char buffer[21]) { return duration_t(print_job_timer.getStats().longestPrint).toString(buffer); } char* getFilamentUsed_str(char buffer[21]) { printStatistics stats = print_job_timer.getStats(); sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10); @@ -818,28 +896,45 @@ namespace ExtUI { } void setTargetTemp_celsius(float value, const heater_t heater) { - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); - const int16_t e = heater - H0; + #ifdef TOUCH_UI_LCD_TEMP_SCALING + value *= TOUCH_UI_LCD_TEMP_SCALING; + #endif enableHeater(heater); + #if HAS_HEATED_CHAMBER + if (heater == CHAMBER) + thermalManager.setTargetChamber(LROUND(constrain(value, 0, CHAMBER_MAXTEMP - 10))); + else + #endif #if HAS_HEATED_BED if (heater == BED) - thermalManager.setTargetBed(clamp(value, 0, BED_MAXTEMP - 10)); + thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAXTEMP - 10))); else #endif - thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e); + { + #if HOTENDS + static constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP); + const int16_t e = heater - H0; + thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e); + #endif + } } void setTargetTemp_celsius(float value, const extruder_t extruder) { - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); - const int16_t e = extruder - E0; - enableHeater(extruder); - thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e); + #ifdef TOUCH_UI_LCD_TEMP_SCALING + value *= TOUCH_UI_LCD_TEMP_SCALING; + #endif + #if HOTENDS + constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP); + const int16_t e = extruder - E0; + enableHeater(extruder); + thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e); + #endif } void setTargetFan_percent(const float value, const fan_t fan) { #if FAN_COUNT > 0 if (fan < FAN_COUNT) - thermalManager.set_fan_speed(fan - FAN0, map(clamp(value, 0, 100), 0, 100, 0, 255)); + thermalManager.set_fan_speed(fan - FAN0, map(constrain(value, 0, 100), 0, 100, 0, 255)); #else UNUSED(value); UNUSED(fan); @@ -847,16 +942,17 @@ namespace ExtUI { } void setFeedrate_percent(const float value) { - feedrate_percentage = clamp(value, 10, 500); + feedrate_percentage = constrain(value, 10, 500); } - void setUserConfirmed(void) { + void setUserConfirmed() { #if HAS_RESUME_CONTINUE wait_for_user = false; #endif } void printFile(const char *filename) { + UNUSED(filename); IFSD(card.openAndPrintFile(filename), NOOP); } @@ -873,7 +969,7 @@ namespace ExtUI { } bool isMediaInserted() { - return IFSD(IS_SD_INSERTED() && card.isDetected(), false); + return IFSD(IS_SD_INSERTED() && card.isMounted(), false); } void pausePrint() { @@ -888,6 +984,12 @@ namespace ExtUI { ui.abort_print(); } + void onUserConfirmRequired_P(PGM_P const pstr) { + char msg[strlen_P(pstr) + 1]; + strcpy_P(msg, pstr); + onUserConfirmRequired(msg); + } + FileList::FileList() { refresh(); } void FileList::refresh() { num_files = 0xFFFF; } @@ -904,6 +1006,8 @@ namespace ExtUI { card.getfilename_sorted(nr); return card.filename[0] != '\0'; #else + UNUSED(pos); + UNUSED(skip_range_check); return false; #endif } @@ -929,25 +1033,26 @@ namespace ExtUI { } bool FileList::isAtRootDir() { - #if ENABLED(SDSUPPORT) - card.getWorkDirName(); - return card.filename[0] == '/'; - #else - return true; - #endif + return (true + #if ENABLED(SDSUPPORT) + && card.flag.workDirIsRoot + #endif + ); } void FileList::upDir() { #if ENABLED(SDSUPPORT) - card.updir(); + card.cdup(); num_files = 0xFFFF; #endif } void FileList::changeDir(const char * const dirname) { #if ENABLED(SDSUPPORT) - card.chdir(dirname); + card.cd(dirname); num_files = 0xFFFF; + #else + UNUSED(dirname); #endif } @@ -970,27 +1075,27 @@ void MarlinUI::update() { if (sd_status != last_sd_status) { last_sd_status = sd_status; if (sd_status) { - card.initsd(); - if (card.isDetected()) + card.mount(); + if (card.isMounted()) ExtUI::onMediaInserted(); else ExtUI::onMediaError(); } else { - const bool ok = card.isDetected(); + const bool ok = card.isMounted(); card.release(); if (ok) ExtUI::onMediaRemoved(); } } #endif // SDSUPPORT - ExtUI::_processManualMoveToDestination(); ExtUI::onIdle(); } -void MarlinUI::kill_screen(PGM_P const msg) { +void MarlinUI::kill_screen(PGM_P const error, PGM_P const component) { + using namespace ExtUI; if (!flags.printer_killed) { flags.printer_killed = true; - ExtUI::onPrinterKilled(msg); + onPrinterKilled(error, component); } } diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index 6cffefe510f0..ea5eaa8b74a0 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -42,11 +42,10 @@ * location: . * ****************************************************************************/ -#pragma once - #include "../../inc/MarlinConfig.h" namespace ExtUI { + // The ExtUI implementation can store up to this many bytes // in the EEPROM when the methods onStoreSettings and // onLoadSettings are called. @@ -63,11 +62,12 @@ namespace ExtUI { constexpr uint8_t fanCount = FAN_COUNT; #if HAS_MESH - typedef float (&bed_mesh_t)[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; #endif bool isMoving(); bool isAxisPositionKnown(const axis_t); + bool isAxisPositionKnown(const extruder_t); bool isPositionKnown(); // Axis position guaranteed, steppers active since homing bool isMachineHomed(); // Axis position most likely correct, steppers may have deactivated bool canMove(const axis_t); @@ -80,6 +80,11 @@ namespace ExtUI { void enableHeater(const heater_t); void enableHeater(const extruder_t); + #if ENABLED(JOYSTICK) + void jog(const xyz_float_t &dir); + void _joystick_update(xyz_float_t &norm_jog); + #endif + /** * Getters and setters * Should be used by the EXTENSIBLE_UI to query or change Marlin's state. @@ -97,7 +102,7 @@ namespace ExtUI { void setAxisCurrent_mA(const float, const axis_t); void setAxisCurrent_mA(const float, const extruder_t); - int getTMCBumpSensitivity(const axis_t); + int getTMCBumpSensitivity(const axis_t); void setTMCBumpSensitivity(const float, const axis_t); #endif @@ -111,16 +116,17 @@ namespace ExtUI { float getAxisPosition_mm(const extruder_t); float getAxisSteps_per_mm(const axis_t); float getAxisSteps_per_mm(const extruder_t); - float getAxisMaxFeedrate_mm_s(const axis_t); - float getAxisMaxFeedrate_mm_s(const extruder_t); + feedRate_t getAxisMaxFeedrate_mm_s(const axis_t); + feedRate_t getAxisMaxFeedrate_mm_s(const extruder_t); float getAxisMaxAcceleration_mm_s2(const axis_t); float getAxisMaxAcceleration_mm_s2(const extruder_t); - float getMinFeedrate_mm_s(); - float getMinTravelFeedrate_mm_s(); + feedRate_t getMinFeedrate_mm_s(); + feedRate_t getMinTravelFeedrate_mm_s(); float getPrintingAcceleration_mm_s2(); float getRetractAcceleration_mm_s2(); float getTravelAcceleration_mm_s2(); float getFeedrate_percent(); + int16_t getFlowPercentage(const extruder_t); uint8_t getProgress_percent(); uint32_t getProgress_seconds_elapsed(); @@ -129,10 +135,11 @@ namespace ExtUI { void setLevelingActive(const bool); bool getMeshValid(); #if HAS_MESH - bed_mesh_t getMeshArray(); - float getMeshPoint(const uint8_t xpos, const uint8_t ypos); - void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zval); - void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval); + bed_mesh_t& getMeshArray(); + float getMeshPoint(const xy_uint8_t &pos); + void setMeshPoint(const xy_uint8_t &pos, const float zval); + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval); + inline void onMeshUpdate(const xy_int8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); } #endif #endif @@ -155,25 +162,26 @@ namespace ExtUI { void setAxisPosition_mm(const float, const extruder_t); void setAxisSteps_per_mm(const float, const axis_t); void setAxisSteps_per_mm(const float, const extruder_t); - void setAxisMaxFeedrate_mm_s(const float, const axis_t); - void setAxisMaxFeedrate_mm_s(const float, const extruder_t); + void setAxisMaxFeedrate_mm_s(const feedRate_t, const axis_t); + void setAxisMaxFeedrate_mm_s(const feedRate_t, const extruder_t); void setAxisMaxAcceleration_mm_s2(const float, const axis_t); void setAxisMaxAcceleration_mm_s2(const float, const extruder_t); - void setFeedrate_mm_s(const float); - void setMinFeedrate_mm_s(const float); - void setMinTravelFeedrate_mm_s(const float); + void setFeedrate_mm_s(const feedRate_t); + void setMinFeedrate_mm_s(const feedRate_t); + void setMinTravelFeedrate_mm_s(const feedRate_t); void setPrintingAcceleration_mm_s2(const float); void setRetractAcceleration_mm_s2(const float); void setTravelAcceleration_mm_s2(const float); void setFeedrate_percent(const float); - void setUserConfirmed(void); + void setFlow_percent(const int16_t, const extruder_t); + void setUserConfirmed(); #if ENABLED(LIN_ADVANCE) float getLinearAdvance_mm_mm_s(const extruder_t); void setLinearAdvance_mm_mm_s(const float, const extruder_t); #endif - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) float getJunctionDeviation_mm(); void setJunctionDeviation_mm(const float); #else @@ -199,10 +207,8 @@ namespace ExtUI { void normalizeNozzleOffset(const axis_t axis); #endif - #if HAS_BED_PROBE - float getZOffset_mm(); - void setZOffset_mm(const float); - #endif + float getZOffset_mm(); + void setZOffset_mm(const float); #if ENABLED(BACKLASH_GCODE) float getAxisBacklash_mm(const axis_t); @@ -227,6 +233,16 @@ namespace ExtUI { #endif #endif + #if ENABLED(CASE_LIGHT_ENABLE) + bool getCaseLightState(); + void setCaseLightState(const bool); + + #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) + float getCaseLightBrightness_percent(); + void setCaseLightBrightness_percent(const float); + #endif + #endif + /** * Delay and timing routines * Should be used by the EXTENSIBLE_UI to safely pause or measure time @@ -275,7 +291,7 @@ namespace ExtUI { void changeDir(const char * const dirname); void upDir(); bool isAtRootDir(); - uint16_t count(); + uint16_t count(); }; /** @@ -289,12 +305,13 @@ namespace ExtUI { void onMediaError(); void onMediaRemoved(); void onPlayTone(const uint16_t frequency, const uint16_t duration); - void onPrinterKilled(PGM_P const msg); + void onPrinterKilled(PGM_P const error, PGM_P const component); void onPrintTimerStarted(); void onPrintTimerPaused(); void onPrintTimerStopped(); void onFilamentRunout(const extruder_t extruder); void onUserConfirmRequired(const char * const msg); + void onUserConfirmRequired_P(PGM_P const pstr); void onStatusChanged(const char * const msg); void onFactoryReset(); void onStoreSettings(char *); diff --git a/Marlin/src/lcd/extui_dgus_lcd.cpp b/Marlin/src/lcd/extui_dgus_lcd.cpp index b48fb9c82d90..c2daacd70a46 100644 --- a/Marlin/src/lcd/extui_dgus_lcd.cpp +++ b/Marlin/src/lcd/extui_dgus_lcd.cpp @@ -43,8 +43,9 @@ namespace ExtUI { void onIdle() { ScreenHandler.loop(); } - void onPrinterKilled(const char* msg) { - ScreenHandler.sendinfoscreen(PSTR(MSG_HALTED), msg, PSTR(""), PSTR(MSG_PLEASE_RESET), true, true, true, true); + void onPrinterKilled(PGM_P error, PGM_P component) { + extern const char NUL_STR[]; + ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, NUL_STR, GET_TEXT(MSG_PLEASE_RESET), true, true, true, true); ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL); while (!ScreenHandler.loop()); // Wait while anything is left to be sent } @@ -57,9 +58,9 @@ namespace ExtUI { void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} - void onFilamentRunout() {} + void onFilamentRunout(const extruder_t extruder) {} - void onUserConfirmRequired(const char *msg) { + void onUserConfirmRequired(const char * const msg) { if (msg) { ScreenHandler.sendinfoscreen(PSTR("Please confirm."), nullptr, msg, nullptr, true, true, false, true); ScreenHandler.SetupConfirmAction(ExtUI::setUserConfirmed); diff --git a/Marlin/src/lcd/extui_example.cpp b/Marlin/src/lcd/extui_example.cpp index 1bcfea60d0e0..9a00db5f8020 100644 --- a/Marlin/src/lcd/extui_example.cpp +++ b/Marlin/src/lcd/extui_example.cpp @@ -46,7 +46,7 @@ namespace ExtUI { */ } void onIdle() {} - void onPrinterKilled(PGM_P const msg) {} + void onPrinterKilled(PGM_P const error, PGM_P const component) {} void onMediaInserted() {}; void onMediaError() {}; void onMediaRemoved() {}; @@ -54,7 +54,7 @@ namespace ExtUI { void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} - void onFilamentRunout() {} + void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char * const msg) {} void onStatusChanged(const char * const msg) {} void onFactoryReset() {} @@ -88,6 +88,10 @@ namespace ExtUI { // This is called after the entire EEPROM has been read, // whether successful or not. } + + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { + // This is called when any mesh points are updated + } } #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index e9e7dfdd593a..a578c2c1e05a 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -45,9 +45,12 @@ #if ENABLED(MALYAN_LCD) +#define DEBUG_MALYAN_LCD + #include "extensible_ui/ui_api.h" #include "ultralcd.h" +#include "../sd/cardreader.h" #include "../module/temperature.h" #include "../module/stepper.h" #include "../module/motion.h" @@ -55,12 +58,8 @@ #include "../module/printcounter.h" #include "../gcode/queue.h" -#if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" - #include "../sd/SdFatConfig.h" -#else - #define LONG_FILENAME_LENGTH 0 -#endif +#define DEBUG_OUT ENABLED(DEBUG_MALYAN_LCD) +#include "../core/debug_out.h" // On the Malyan M200, this will be Serial1. On a RAMPS board, // it might not be. @@ -112,23 +111,30 @@ void write_to_lcd(const char * const message) { * the command portion begins after the : */ void process_lcd_c_command(const char* command) { + const int target_val = command[1] ? atoi(command + 1) : -1; + if (target_val < 0) { + DEBUG_ECHOLNPAIR("UNKNOWN C COMMAND ", command); + return; + } switch (command[0]) { case 'C': // Cope with both V1 early rev and later LCDs. - case 'S': { - int raw_feedrate = atoi(command + 1); - feedrate_percentage = raw_feedrate * 10; - feedrate_percentage = constrain(feedrate_percentage, 10, 999); - } break; - case 'T': { - thermalManager.setTargetHotend(atoi(command + 1), 0); - } break; - case 'P': { - thermalManager.setTargetBed(atoi(command + 1)); - } break; + case 'S': + feedrate_percentage = target_val * 10; + LIMIT(feedrate_percentage, 10, 999); + break; + + case 'T': + // Sometimes the LCD will send commands to turn off both extruder and bed, though + // this should not happen since the printing screen is up. Better safe than sorry. + if (!print_job_timer.isRunning() || target_val > 0) + ExtUI::setTargetTemp_celsius(target_val, ExtUI::extruder_t::E0); + break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN C COMMAND", command); - return; + #if HAS_HEATED_BED + case 'P': ExtUI::setTargetTemp_celsius(target_val, ExtUI::heater_t::BED); break; + #endif + + default: DEBUG_ECHOLNPAIR("UNKNOWN C COMMAND ", command); } } @@ -141,6 +147,7 @@ void process_lcd_c_command(const char* command) { */ void process_lcd_eb_command(const char* command) { char elapsed_buffer[10]; + static uint8_t iteration = 0; duration_t elapsed; switch (command[0]) { case '0': { @@ -148,28 +155,32 @@ void process_lcd_eb_command(const char* command) { sprintf_P(elapsed_buffer, PSTR("%02u%02u%02u"), uint16_t(elapsed.hour()), uint16_t(elapsed.minute()) % 60, uint16_t(elapsed.second()) % 60); char message_buffer[MAX_CURLY_COMMAND]; + uint8_t done_pct = print_job_timer.isRunning() ? (iteration * 10) : 100; + iteration = (iteration + 1) % 10; // Provide progress animation + #if ENABLED(SDSUPPORT) + if (ExtUI::isPrintingFromMedia() || ExtUI::isPrintingFromMediaPaused()) + done_pct = card.percentDone(); + #endif + sprintf_P(message_buffer, - PSTR("{T0:%03.0f/%03i}{T1:000/000}{TP:%03.0f/%03i}{TQ:%03i}{TT:%s}"), - thermalManager.degHotend(0), - thermalManager.degTargetHotend(0), - #if HAS_HEATED_BED - thermalManager.degBed(), - thermalManager.degTargetBed(), - #else - 0, 0, - #endif - #if ENABLED(SDSUPPORT) - card.percentDone(), - #else - 0, - #endif - elapsed_buffer); + PSTR("{T0:%03i/%03i}{T1:000/000}{TP:%03i/%03i}{TQ:%03i}{TT:%s}"), + int(thermalManager.degHotend(0)), thermalManager.degTargetHotend(0), + #if HAS_HEATED_BED + int(thermalManager.degBed()), thermalManager.degTargetBed(), + #else + 0, 0, + #endif + #if ENABLED(SDSUPPORT) + done_pct, + #else + 0, + #endif + elapsed_buffer + ); write_to_lcd(message_buffer); } break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN E/B COMMAND", command); - return; + default: DEBUG_ECHOLNPAIR("UNKNOWN E/B COMMAND ", command); } } @@ -184,32 +195,18 @@ void process_lcd_eb_command(const char* command) { * X, Y, Z, A (extruder) */ void process_lcd_j_command(const char* command) { - static bool steppers_enabled = false; - char axis = command[0]; - - switch (axis) { - case 'E': - // enable or disable steppers - // switch to relative - queue.enqueue_now_P(PSTR("G91")); - queue.enqueue_now_P(steppers_enabled ? PSTR("M18") : PSTR("M17")); - steppers_enabled = !steppers_enabled; - break; - case 'A': - axis = 'E'; - // fallthru - case 'Y': - case 'Z': - case 'X': { - // G0 - // The M200 class UI seems to send movement in .1mm values. - char cmd[20]; - sprintf_P(cmd, PSTR("G1 %c%03.1f"), axis, atof(command + 1) / 10.0); - queue.enqueue_one_now(cmd); - } break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN J COMMAND", command); - return; + auto move_axis = [command](const auto axis) { + const float dist = atof(command + 1) / 10.0; + ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(axis) + dist, axis); + }; + + switch (command[0]) { + case 'E': break; + case 'A': move_axis(ExtUI::extruder_t::E0); break; + case 'Y': move_axis(ExtUI::axis_t::Y); break; + case 'Z': move_axis(ExtUI::axis_t::Z); break; + case 'X': move_axis(ExtUI::axis_t::X); break; + default: DEBUG_ECHOLNPAIR("UNKNOWN J COMMAND ", command); } } @@ -238,29 +235,20 @@ void process_lcd_j_command(const char* command) { void process_lcd_p_command(const char* command) { switch (command[0]) { + case 'P': + ExtUI::pausePrint(); + write_to_lcd_P(PSTR("{SYS:PAUSED}")); + break; + case 'R': + ExtUI::resumePrint(); + write_to_lcd_P(PSTR("{SYS:RESUMED}")); + break; case 'X': - #if ENABLED(SDSUPPORT) - // cancel print write_to_lcd_P(PSTR("{SYS:CANCELING}")); - last_printing_status = false; - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - queue.clear(); - quickstop_stepper(); - print_job_timer.stop(); - thermalManager.disable_all_heaters(); - thermalManager.zero_fan_speeds(); - wait_for_heatup = false; + ExtUI::stopPrint(); write_to_lcd_P(PSTR("{SYS:STARTED}")); - #endif - break; - case 'H': - // Home all axis - queue.enqueue_now_P(PSTR("G28")); - break; + break; + case 'H': queue.enqueue_now_P(G28_STR); break; // Home all axes default: { #if ENABLED(SDSUPPORT) // Print file 000 - a three digit number indicating which @@ -270,13 +258,13 @@ void process_lcd_p_command(const char* command) { // Find the name of the file to print. // It's needed to echo the PRINTFILE option. // The {S:L} command should've ensured the SD card was mounted. - card.getfilename(atoi(command)); + card.selectFileByIndex(atoi(command)); // There may be a difference in how V1 and V2 LCDs handle subdirectory // prints. Investigate more. This matches the V1 motion controller actions // but the V2 LCD switches to "print" mode on {SYS:DIR} response. if (card.flag.filenameIsDir) { - card.chdir(card.filename); + card.cd(card.filename); write_to_lcd_P(PSTR("{SYS:DIR}")); } else { @@ -309,10 +297,10 @@ void process_lcd_s_command(const char* command) { case 'I': { // temperature information char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{T0:%03.0f/%03i}{T1:000/000}{TP:%03.0f/%03i}"), - thermalManager.degHotend(0), thermalManager.degTargetHotend(0), + sprintf_P(message_buffer, PSTR("{T0:%03i/%03i}{T1:000/000}{TP:%03i/%03i}"), + int(thermalManager.degHotend(0)), thermalManager.degTargetHotend(0), #if HAS_HEATED_BED - thermalManager.degBed(), thermalManager.degTargetBed() + int(thermalManager.degBed()), thermalManager.degTargetBed() #else 0, 0 #endif @@ -322,7 +310,7 @@ void process_lcd_s_command(const char* command) { case 'L': { #if ENABLED(SDSUPPORT) - if (!card.isDetected()) card.initsd(); + if (!card.isMounted()) card.mount(); // A more efficient way to do this would be to // implement a callback in the ls_SerialPrint code, but @@ -333,7 +321,7 @@ void process_lcd_s_command(const char* command) { char message_buffer[MAX_CURLY_COMMAND]; uint16_t file_count = card.get_num_Files(); for (uint16_t i = 0; i < file_count; i++) { - card.getfilename(i); + card.selectFileByIndex(i); sprintf_P(message_buffer, card.flag.filenameIsDir ? PSTR("{DIR:%s}") : PSTR("{FILE:%s}"), card.longest_filename()); write_to_lcd(message_buffer); } @@ -342,9 +330,7 @@ void process_lcd_s_command(const char* command) { #endif } break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN S COMMAND", command); - return; + default: DEBUG_ECHOLNPAIR("UNKNOWN S COMMAND ", command); } } @@ -356,36 +342,48 @@ void process_lcd_s_command(const char* command) { void process_lcd_command(const char* command) { const char *current = command; - current++; // skip the leading {. The trailing one is already gone. byte command_code = *current++; - if (*current != ':') { - SERIAL_ECHOLNPAIR("UNKNOWN COMMAND FORMAT", command); - return; + if (*current == ':') { + + current++; // skip the : + + switch (command_code) { + case 'S': process_lcd_s_command(current); break; + case 'J': process_lcd_j_command(current); break; + case 'P': process_lcd_p_command(current); break; + case 'C': process_lcd_c_command(current); break; + case 'B': + case 'E': process_lcd_eb_command(current); break; + default: DEBUG_ECHOLNPAIR("UNKNOWN COMMAND ", command); + } } + else + DEBUG_ECHOLNPAIR("UNKNOWN COMMAND FORMAT ", command); +} - current++; // skip the : +// Parse LCD commands mixed with G-Code +void parse_lcd_byte(byte b) { + static bool parsing_lcd_cmd = false; + static char inbound_buffer[MAX_CURLY_COMMAND]; - switch (command_code) { - case 'S': - process_lcd_s_command(current); - break; - case 'J': - process_lcd_j_command(current); - break; - case 'P': - process_lcd_p_command(current); - break; - case 'C': - process_lcd_c_command(current); - break; - case 'B': - case 'E': - process_lcd_eb_command(current); - break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN COMMAND", command); - return; + if (!parsing_lcd_cmd) { + if (b == '{' || b == '\n' || b == '\r') { // A line-ending or opening brace + parsing_lcd_cmd = b == '{'; // Brace opens an LCD command + if (inbound_count) { // Looks like a G-code is in the buffer + inbound_buffer[inbound_count] = '\0'; // Reset before processing + inbound_count = 0; + queue.enqueue_one_now(inbound_buffer); // Handle the G-code command + } + } + } + else if (b == '}') { // Closing brace on an LCD command + parsing_lcd_cmd = false; // Unflag and... + inbound_buffer[inbound_count] = '\0'; // reset before processing + inbound_count = 0; + process_lcd_command(inbound_buffer); // Handle the LCD command } + else if (inbound_count < MAX_CURLY_COMMAND - 2) + inbound_buffer[inbound_count++] = b; // Buffer only if space remains } /** @@ -398,8 +396,8 @@ void update_usb_status(const bool forceUpdate) { // This is mildly different than stock, which // appears to use the usb discovery status. // This is more logical. - if (last_usb_connected_status != Serial || forceUpdate) { - last_usb_connected_status = Serial; + if (last_usb_connected_status != SerialUSB || forceUpdate) { + last_usb_connected_status = SerialUSB; write_to_lcd_P(last_usb_connected_status ? PSTR("{R:UC}\r\n") : PSTR("{R:UD}\r\n")); } } @@ -409,8 +407,7 @@ namespace ExtUI { /** * The Malyan LCD actually runs as a separate MCU on Serial 1. * This code's job is to siphon the weird curly-brace commands from - * it and translate into gcode, which then gets injected into - * the command queue where possible. + * it and translate into ExtUI operations where possible. */ inbound_count = 0; LCD_SERIAL.begin(500000); @@ -430,24 +427,14 @@ namespace ExtUI { /** * - from printer on startup: * {SYS:STARTED}{VER:29}{SYS:STARTED}{R:UD} - * The optimize attribute fixes a register Compile - * error for amtel. */ - static char inbound_buffer[MAX_CURLY_COMMAND]; // First report USB status. update_usb_status(false); // now drain commands... while (LCD_SERIAL.available()) { - const byte b = (byte)LCD_SERIAL.read() & 0x7F; - inbound_buffer[inbound_count++] = b; - if (b == '}' || inbound_count == sizeof(inbound_buffer) - 1) { - inbound_buffer[inbound_count - 1] = '\0'; - process_lcd_command(inbound_buffer); - inbound_count = 0; - inbound_buffer[0] = 0; - } + parse_lcd_byte((byte)LCD_SERIAL.read() & 0x7F); } #if ENABLED(SDSUPPORT) @@ -459,40 +446,43 @@ namespace ExtUI { // If there was a print in progress, we need to emit the final // print status as {TQ:100}. Reset last percent done so a new print will // issue a percent of 0. - const uint8_t percent_done = IS_SD_PRINTING() ? card.percentDone() : last_printing_status ? 100 : 0; + const uint8_t percent_done = (ExtUI::isPrinting() || ExtUI::isPrintingFromMediaPaused()) ? ExtUI::getProgress_percent() : last_printing_status ? 100 : 0; if (percent_done != last_percent_done) { char message_buffer[16]; sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done); write_to_lcd(message_buffer); last_percent_done = percent_done; - last_printing_status = IS_SD_PRINTING(); + last_printing_status = ExtUI::isPrinting(); } #endif } // {E:} is for error states. - void onPrinterKilled(PGM_P msg) { + void onPrinterKilled(PGM_P error, PGM_P component) { write_to_lcd_P(PSTR("{E:")); - write_to_lcd_P(msg); + write_to_lcd_P(error); + write_to_lcd_P(PSTR(" ")); + write_to_lcd_P(component); write_to_lcd_P("}"); } + void onPrintTimerStarted() { write_to_lcd_P(PSTR("{SYS:BUILD}")); } + void onPrintTimerPaused() {} + void onPrintTimerStopped() { write_to_lcd_P(PSTR("{TQ:100}")); } + // Not needed for Malyan LCD - void onStatusChanged(const char * const msg) { UNUSED(msg); } + void onStatusChanged(const char * const) {} void onMediaInserted() {}; void onMediaError() {}; void onMediaRemoved() {}; - void onPlayTone(const uint16_t frequency, const uint16_t duration) { UNUSED(frequency); UNUSED(duration); } - void onPrintTimerStarted() {} - void onPrintTimerPaused() {} - void onPrintTimerStopped() {} - void onFilamentRunout() {} - void onUserConfirmRequired(const char * const msg) { UNUSED(msg); } + void onPlayTone(const uint16_t, const uint16_t) {} + void onFilamentRunout(const extruder_t extruder) {} + void onUserConfirmRequired(const char * const) {} void onFactoryReset() {} - void onStoreSettings(char *buff) { UNUSED(buff); } - void onLoadSettings(const char *buff) { UNUSED(buff); } - void onConfigurationStoreWritten(bool success) { UNUSED(success); } - void onConfigurationStoreRead(bool success) { UNUSED(success); } + void onStoreSettings(char*) {} + void onLoadSettings(const char*) {} + void onConfigurationStoreWritten(bool) {} + void onConfigurationStoreRead(bool) {} } #endif // MALYAN_LCD diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index 4e714d080456..fdccd082c33b 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -9,7 +9,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(ULTRA_LCD) +#if HAS_SPI_LCD #include "ultralcd.h" #include "../Marlin.h" #endif diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 28921aef2513..8839e36a2bd1 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -8,13 +8,13 @@ */ #pragma once -#include "../HAL/shared/Marduino.h" -#include "../core/macros.h" - #include #include // wchar_t #include // uint32_t +#include "../HAL/shared/Marduino.h" +#include "../core/macros.h" + // read a byte from ROM or RAM typedef uint8_t (*read_byte_cb_t)(uint8_t * str); diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 388e80341c98..aa96ed531b48 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -32,226 +32,201 @@ #define DISPLAY_CHARSET_ISO10646_1 #define NOT_EXTENDED_ISO10646_1_5X7 -#define WELCOME_MSG MACHINE_NAME _UxGT(" parada.") -#define MSG_SD_INSERTED _UxGT("Tarcheta mesa") -#define MSG_SD_REMOVED _UxGT("Tarcheta sacada") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu prencipal") -#define MSG_AUTOSTART _UxGT("Inicio automatico") -#define MSG_DISABLE_STEPPERS _UxGT("Amortar motors") -#define MSG_AUTO_HOME _UxGT("Levar a l'orichen") -#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_LEVEL_BED_HOMING _UxGT("Orichen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Encetar (pretar)") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Vinient punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelacion feita!") -#define MSG_SET_HOME_OFFSETS _UxGT("Achustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicau") -#define MSG_SET_ORIGIN _UxGT("Establir orichen") -#define MSG_PREHEAT_1 _UxGT("Precalentar " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tot") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Base") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Conf") -#define MSG_PREHEAT_2 _UxGT("Precalentar " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tot") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Base") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Conf") -#define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Enchegar Fuent") -#define MSG_SWITCH_PS_OFF _UxGT("Amortar Fuent") -#define MSG_EXTRUDE _UxGT("Extruir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover Eixes") -#define MSG_BED_LEVELING _UxGT("Nivelar base") -#define MSG_LEVEL_BED _UxGT("Nivelar base") -#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("Extrusor") -#define MSG_MOVE_0025MM _UxGT("Mover 0.025mm") -#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("Velocidat") -#define MSG_BED_Z _UxGT("Base Z") -#define MSG_NOZZLE _UxGT("Boquilla") -#define MSG_BED _UxGT("Base") -#define MSG_FAN_SPEED _UxGT("Ixoriador") -#define MSG_FLOW _UxGT("Fluxo") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Temperatura Auto.") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vel. viache min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Acel. max") -#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_ESTEPS _UxGT("E trangos/mm") -#define MSG_E1STEPS _UxGT("E1 trangos/mm") -#define MSG_E2STEPS _UxGT("E2 trangos/mm") -#define MSG_E3STEPS _UxGT("E3 trangos/mm") -#define MSG_E4STEPS _UxGT("E4 trangos/mm") -#define MSG_E5STEPS _UxGT("E5 trangos/mm") -#define MSG_E6STEPS _UxGT("E6 trangos/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimiento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Alzar memoria") -#define MSG_LOAD_EEPROM _UxGT("Cargar memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurar memoria") -#define MSG_REFRESH _UxGT("Tornar a cargar") -#define MSG_WATCH _UxGT("Informacion") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Achustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impresion") -#define MSG_RESUME_PRINT _UxGT("Contin. impresion") -#define MSG_STOP_PRINT _UxGT("Detener Impresion") -#define MSG_CARD_MENU _UxGT("Menu de SD") -#define MSG_NO_CARD _UxGT("No i hai tarcheta") -#define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Aguardand ordines") -#define MSG_PRINT_ABORTED _UxGT("Impres. cancelada") -#define MSG_NO_MOVE _UxGT("Sin movimiento") -#define MSG_KILLED _UxGT("Aturada d'emerch.") -#define MSG_STOPPED _UxGT("Aturada.") -#define MSG_CONTROL_RETRACT _UxGT("Retraer mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Retraer mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraer F") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Devantar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet F") -#define MSG_AUTORETRACT _UxGT("Retraccion auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambear filamento") -#define MSG_INIT_SDCARD _UxGT("Encetan. tarcheta") -#define MSG_CHANGE_SDCARD _UxGT("Cambiar tarcheta") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z fuera") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Auto-Test") -#define MSG_BLTOUCH_RESET _UxGT("Reset 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("Desfase Z") -#define MSG_BABYSTEP_X _UxGT("Micropaso X") -#define MSG_BABYSTEP_Y _UxGT("Micropaso Y") -#define MSG_BABYSTEP_Z _UxGT("Micropaso Z") -#define MSG_ENDSTOP_ABORT _UxGT("Cancelado - Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Error: en calentar") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Error: temperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("Error de temperatura") -#define MSG_ERR_MAXTEMP _UxGT("Error: Temp Maxima") -#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_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_BED_HEATING _UxGT("Calentando base...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibracion 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") +namespace Language_an { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_INFO_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_PRINTER_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_STATS_MENU _UxGT("Estadisticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. Controlador") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusors") -#define MSG_INFO_BAUDRATE _UxGT("Baudios") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz") + constexpr uint8_t CHARSIZE = 1; + PROGMEM Language_Str LANGUAGE = _UxGT("Aragonese"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo de impresion") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Tiempo total d'imp.") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impresion mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total d'extrusion") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impresions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Mas larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrusion") -#endif + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" parada."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Tarcheta mesa"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Tarcheta sacada"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu prencipal"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inicio automatico"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Amortar motors"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Levar a l'orichen"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Orichen X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Orichen Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Orichen Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Orichen XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Encetar (pretar)"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Vinient punto"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Nivelacion feita!"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Achustar desfases"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfase aplicau"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Establir orichen"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Precalentar ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Precalentar ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Boquilla"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Precal. ") PREHEAT_1_LABEL _UxGT(" Boquilla ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Tot"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Base"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Conf"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Precalentar ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Precalentar ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Precal. ") PREHEAT_2_LABEL _UxGT(" Boquilla"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Precal. ") PREHEAT_2_LABEL _UxGT(" Boquilla ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Tot"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Base"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Conf"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Enfriar"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Enchegar Fuent"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Amortar Fuent"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extruir"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retraer"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover Eixes"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelar base"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar base"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidat"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Base Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Boquilla"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Boquilla ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Base"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ixoriador"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ixoriador ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxo"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxo ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temperatura Auto."); + PROGMEM Language_Str MSG_SELECT = _UxGT("Trigar"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Trigar *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Aceleracion"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vel. viache min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Acel. max") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Acel. max") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Acel. max") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Acel. max") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Acel. max *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Acel. retrac."); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Acel. Viaje"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Trangos/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" trangos/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" trangos/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" trangos/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E trangos/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* trangos/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Movimiento"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Alzar memoria"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar memoria"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaurar memoria"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Tornar a cargar"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Informacion"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Achustar"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impresion"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Contin. impresion"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Detener Impresion"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Menu de SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("No i hai tarcheta"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Reposo..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Aguardand ordines"); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impres. cancelada"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sin movimiento"); + PROGMEM Language_Str MSG_KILLED = _UxGT("Aturada d'emerch."); + PROGMEM Language_Str MSG_STOPPED = _UxGT("Aturada."); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retraer mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Retraer mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraer F"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Devantar mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("DesRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Swap DesRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("DesRet F"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retraccion auto."); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambear filamento"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambear filamento *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Encetan. tarcheta"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambiar tarcheta"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z fuera"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Desfase Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Micropaso X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Error: en calentar"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Error: temperatura"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Error de temperatura"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Error: Temp Max"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Error: Temp Min"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY first"); + PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESORA ATURADA"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Per favor reinic."); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Calentando..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Calentando base..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibracion Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); -#define MSG_INFO_MIN_TEMP _UxGT("Temperatura menima") -#define MSG_INFO_MAX_TEMP _UxGT("Temperatura maxima") -#define MSG_INFO_PSU _UxGT("Fuente de aliment") + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Inf. Impresora"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Inf. Impresora"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadisticas Imp."); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Inf. Controlador"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistors"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusors"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudios"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocolo"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz"); -#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_OPTION_RESUME _UxGT("Resumir imp.") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Conteo de impresion"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tiempo total d'imp."); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Impresion mas larga"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total d'extrusion"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Impresions"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Mas larga"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrusion"); + #endif -// -// Filament Change screens show up to 3 lines on a 4-line display -// ...or up to 2 lines on a 3-line display -// -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguardand iniciar") + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temperatura menima"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temperatura maxima"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Fuente de aliment"); -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Meta o filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y prete lo boton") + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Fuerza d'o driver"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Escri. DAC EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Resumir imp."); -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("d'o filamento") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("cambear") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pa continar...") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("d'o fil. cambear") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Meta o filamento") -#endif // LCD_HEIGHT < 4 + // + // Filament Change screens show up to 3 lines on a 4-line display + // ...or up to 2 lines on a 3-line display + // -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Aguardando a") -#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_RESUME_1 _UxGT("Aguardando impre.") -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("pa continar") + #if LCD_HEIGHT >= 4 + // Up to 3 lines allowed + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Aguardand iniciar", "d'o filamento", "cambear")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Meta o filamento", "y prete lo boton", "pa continar...")); + #else // LCD_HEIGHT < 4 + // Up to 2 lines allowed + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("Aguardand iniciar", "d'o fil. cambear")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_2_LINE("Meta o filamento", "y prete lo boton")); + #endif // LCD_HEIGHT < 4 + + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Aguardando a", "expulsar filament")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Aguardando a", "cargar filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Aguardando impre.", "pa continar")); +} diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index eaf8e279bb84..f13735f700f6 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -28,119 +28,126 @@ * See also http://marlinfw.org/docs/development/lcd_language.html * */ + #define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" Готов.") -#define MSG_SD_INSERTED _UxGT("Картата е поставена") -#define MSG_SD_REMOVED _UxGT("Картата е извадена") -#define MSG_MAIN _UxGT("Меню") -#define MSG_AUTOSTART _UxGT("Автостарт") -#define MSG_DISABLE_STEPPERS _UxGT("Изкл. двигатели") -#define MSG_AUTO_HOME _UxGT("Паркиране") -#define MSG_SET_HOME_OFFSETS _UxGT("Задай Начало") -#define MSG_SET_ORIGIN _UxGT("Изходна точка") -#define MSG_PREHEAT_1 _UxGT("Подгряване " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N _UxGT("Подгряване " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_ALL _UxGT("Подгр. " PREHEAT_1_LABEL " Всички") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Подгр. " PREHEAT_1_LABEL " Легло") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Настройки " PREHEAT_1_LABEL) -#define MSG_PREHEAT_2 _UxGT("Подгряване " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Подгряване " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_ALL _UxGT("Подгр. " PREHEAT_2_LABEL " Всички") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Подгр. " PREHEAT_2_LABEL " Легло") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Настройки " PREHEAT_2_LABEL) -#define MSG_COOLDOWN _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_LEVEL_BED _UxGT("Нивелиране") -#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_0025MM _UxGT("Премести с 0.025mm") -#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("Bed Z") -#define MSG_NOZZLE LCD_STR_THERMOMETER _UxGT(" Дюза") -#define MSG_BED LCD_STR_THERMOMETER _UxGT(" Легло") -#define MSG_FAN_SPEED _UxGT("Вентилатор") -#define MSG_FLOW _UxGT("Поток") -#define MSG_CONTROL _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_LCD_ON _UxGT("Вкл.") -#define MSG_LCD_OFF _UxGT("Изкл.") -#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_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_E6STEPS _UxGT("E6 стъпки/mm") -#define MSG_TEMPERATURE _UxGT("Температура") -#define MSG_MOTION _UxGT("Движение") -#define MSG_FILAMENT _UxGT("Нишка") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Диам. нишка") -#define MSG_CONTRAST _UxGT("LCD контраст") -#define MSG_STORE_EEPROM _UxGT("Запази в EPROM") -#define MSG_LOAD_EEPROM _UxGT("Зареди от EPROM") -#define MSG_RESTORE_FAILSAFE _UxGT("Фабрични настройки") -#define MSG_REFRESH LCD_STR_REFRESH _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("Меню карта") -#define MSG_NO_CARD _UxGT("Няма карта") -#define MSG_DWELL _UxGT("Почивка...") -#define MSG_USERWAIT _UxGT("Изчакване") -#define MSG_PRINT_ABORTED _UxGT("Печатът е прекъснат") -#define MSG_NO_MOVE _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_ZHOP _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("Автоoткат") -#define MSG_FILAMENTCHANGE _UxGT("Смяна нишка") -#define MSG_INIT_SDCARD _UxGT("Иниц. SD-Карта") -#define MSG_CHANGE_SDCARD _UxGT("Смяна SD-Карта") -#define MSG_ZPROBE_OUT _UxGT("Z-сондата е извадена") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Отстояние") -#define MSG_BABYSTEP_X _UxGT("Министъпка X") -#define MSG_BABYSTEP_Y _UxGT("Министъпка Y") -#define MSG_BABYSTEP_Z _UxGT("Министъпка Z") -#define MSG_ENDSTOP_ABORT _UxGT("Стоп Кр.Изключватели") -#define MSG_DELTA_CALIBRATE _UxGT("Делта Калибровка") -#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("Калибровка Център") +namespace Language_bg { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Bulgarian"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Готов."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Картата е поставена"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Картата е извадена"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Меню"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Изкл. двигатели"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Паркиране"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Задай Начало"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Изходна точка"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Подгряване ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Подгряване ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Подгряване ") PREHEAT_1_LABEL _UxGT(" Дюза"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Подгряване ") PREHEAT_1_LABEL _UxGT(" Дюза ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Подгр. ") PREHEAT_1_LABEL _UxGT(" Всички"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Подгр. ") PREHEAT_1_LABEL _UxGT(" Легло"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Настройки ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Подгряване ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Подгряване ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Подгряване ") PREHEAT_2_LABEL _UxGT(" Дюза"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Подгряване ") PREHEAT_2_LABEL _UxGT(" Дюза ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Подгр. ") PREHEAT_2_LABEL _UxGT(" Всички"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Подгр. ") PREHEAT_2_LABEL _UxGT(" Легло"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Настройки ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охлаждане"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Вкл. захранване"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Изкл. захранване"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Екструзия"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Откат"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Движение по ос"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Нивелиране"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Нивелиране"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Движение по X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Движение по Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Движение по Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Екструдер"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Екструдер *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Премести с %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Премести с 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Премести с 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Премести с 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Скорост"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); + PROGMEM Language_Str MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" Дюза"); + PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Дюза ~"); + PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Легло"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Вентилатор"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Вентилатор ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Поток"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Поток ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Управление"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Минимум"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Максимум"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Фактор"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Авто-темп."); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Вкл."); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Изкл."); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-откат"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-travel"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Стъпки/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("стъпки/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("стъпки/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("стъпки/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E стъпки/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* стъпки/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Движение"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Нишка"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Диам. нишка"); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Диам. нишка *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD контраст"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Запази в EPROM"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Зареди от EPROM"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Фабрични настройки"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Обнови"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Преглед"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Действия"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Настройка"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Пауза"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Възобнови печата"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Спри печата"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Меню карта"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Няма карта"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Почивка..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Изчакване"); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Печатът е прекъснат"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Няма движение"); + PROGMEM Language_Str MSG_KILLED = _UxGT("УБИТО."); + PROGMEM Language_Str MSG_STOPPED = _UxGT("СПРЯНО."); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Откат mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Смяна Откат mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Откат V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Скок mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Възврат mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Смяна Възврат mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Възврат V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Автоoткат"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Смяна нишка"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Смяна нишка *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Иниц. SD-Карта"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Смяна SD-Карта"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z-сондата е извадена"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z Отстояние"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Министъпка X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Министъпка Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Министъпка Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Стоп Кр.Изключватели"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Делта Калибровка"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калибровка X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Калибровка Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Калибровка Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калибровка Център"); + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Неправилен принтер"); +} diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 7bbde2fc588f..102473d757f3 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -28,235 +28,209 @@ * See also http://marlinfw.org/docs/development/lcd_language.html * */ +namespace Language_ca { + using namespace Language_en; // Inherit undefined strings from English -#define CHARSIZE 2 + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Catalan"); -#define WELCOME_MSG MACHINE_NAME _UxGT(" preparada.") -#define MSG_SD_INSERTED _UxGT("Targeta detectada.") -#define MSG_SD_REMOVED _UxGT("Targeta extreta.") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") -#define MSG_MAIN _UxGT("Menú principal") -#define MSG_AUTOSTART _UxGT("Inici automatic") -#define MSG_DISABLE_STEPPERS _UxGT("Desactiva motors") -#define MSG_DEBUG_MENU _UxGT("Menu de depuracio") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barra progres") -#define MSG_AUTO_HOME _UxGT("Ves a l'origen") -#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_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") -#define MSG_LEVEL_BED_DONE _UxGT("Anivellament fet!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ajusta decalatge") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Decalatge aplicat") -#define MSG_SET_ORIGIN _UxGT("Estableix origen") -#define MSG_PREHEAT_1 _UxGT("Preescalfa " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tot") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Llit") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Conf.") -#define MSG_PREHEAT_2 _UxGT("Preescalfa " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tot") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Llit") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Conf.") -#define MSG_COOLDOWN _UxGT("Refreda") -#define MSG_SWITCH_PS_ON _UxGT("Switch power on") -#define MSG_SWITCH_PS_OFF _UxGT("Switch power off") -#define MSG_EXTRUDE _UxGT("Extrudeix") -#define MSG_RETRACT _UxGT("Retreu") -#define MSG_MOVE_AXIS _UxGT("Mou eixos") -#define MSG_BED_LEVELING _UxGT("Anivella llit") -#define MSG_LEVEL_BED _UxGT("Anivella llit") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" preparada."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Targeta detectada."); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Targeta extreta."); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inici automatic"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Desactiva motors"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu de depuracio"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barra progres"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Ves a l'origen"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X a origen"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y a origen"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z a origen"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Origen XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Premeu per iniciar"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Següent punt"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Anivellament fet!"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ajusta decalatge"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Decalatge aplicat"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Estableix origen"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preescalfa ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preescalfa ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Tot"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Llit"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Conf."); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Preescalfa ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Preescalfa ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Tot"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Llit"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Conf."); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Refreda"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Switch power on"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Switch power off"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudeix"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retreu"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mou eixos"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Anivella llit"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Anivella llit"); -#define MSG_MOVING _UxGT("Movent..") -#define MSG_FREE_XY _UxGT("XY lliures") -#define MSG_MOVE_X _UxGT("Mou X") -#define MSG_MOVE_Y _UxGT("Mou Y") -#define MSG_MOVE_Z _UxGT("Mou Z") -#define MSG_MOVE_E _UxGT("Extrusor") -#define MSG_MOVE_0025MM _UxGT("Mou 0.025mm") -#define MSG_MOVE_01MM _UxGT("Mou 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mou 1mm") -#define MSG_MOVE_10MM _UxGT("Mou 10mm") -#define MSG_SPEED _UxGT("Velocitat") -#define MSG_BED_Z _UxGT("Llit Z") -#define MSG_NOZZLE _UxGT("Nozzle") -#define MSG_BED _UxGT("Llit") -#define MSG_FAN_SPEED _UxGT("Vel. Ventilador") -#define MSG_FLOW _UxGT("Flux") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VViatge min") -#define MSG_AMAX _UxGT("Accel. max ") -#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_ESTEPS _UxGT("Epassos/mm") -#define MSG_E1STEPS _UxGT("E1passos/mm") -#define MSG_E2STEPS _UxGT("E2passos/mm") -#define MSG_E3STEPS _UxGT("E3passos/mm") -#define MSG_E4STEPS _UxGT("E4passos/mm") -#define MSG_E5STEPS _UxGT("E5passos/mm") -#define MSG_E6STEPS _UxGT("E6passos/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Moviment") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") -#define MSG_CONTRAST _UxGT("Contrast de LCD") -#define MSG_STORE_EEPROM _UxGT("Desa memoria") -#define MSG_LOAD_EEPROM _UxGT("Carrega memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaura valors") -#define MSG_REFRESH _UxGT("Actualitza") -#define MSG_WATCH _UxGT("Pantalla Info.") -#define MSG_PREPARE _UxGT("Prepara") -#define MSG_TUNE _UxGT("Ajusta") -#define MSG_PAUSE_PRINT _UxGT("Pausa impressio") -#define MSG_RESUME_PRINT _UxGT("Repren impressio") -#define MSG_STOP_PRINT _UxGT("Atura impressio.") -#define MSG_CARD_MENU _UxGT("Imprimeix de SD") -#define MSG_NO_CARD _UxGT("No hi ha targeta") -#define MSG_DWELL _UxGT("En repos...") -#define MSG_USERWAIT _UxGT("Esperant usuari..") -#define MSG_PRINT_ABORTED _UxGT("Imp. cancelada") -#define MSG_NO_MOVE _UxGT("Sense moviment.") -#define MSG_KILLED _UxGT("MATAT.") -#define MSG_STOPPED _UxGT("ATURADA.") -#define MSG_CONTROL_RETRACT _UxGT("Retreu mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Retreure mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retreu V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Aixeca mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet +mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap DesRet +mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet V") -#define MSG_AUTORETRACT _UxGT("Auto retraccio") -#define MSG_FILAMENTCHANGE _UxGT("Canvia filament") -#define MSG_INIT_SDCARD _UxGT("Inicialitza SD") -#define MSG_CHANGE_SDCARD _UxGT("Canvia SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z fora") -#define MSG_BLTOUCH_RESET _UxGT("Reinicia BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("primer") -#define MSG_ZPROBE_ZOFFSET _UxGT("Decalatge Z") -#define MSG_BABYSTEP_X _UxGT("Micropas X") -#define MSG_BABYSTEP_Y _UxGT("Micropas Y") -#define MSG_BABYSTEP_Z _UxGT("Micropas Z") -#define MSG_ENDSTOP_ABORT _UxGT("Cancel. Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Error al escalfar") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP REDUNDANT") -#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP MAXIMA") -#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_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_DELTA_CALIBRATE _UxGT("Calibratge 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 el centre") + PROGMEM Language_Str MSG_MOVING = _UxGT("Movent.."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("XY lliures"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mou X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mou Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mou Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mou %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mou 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mou 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mou 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Velocitat"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Llit Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozzle"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozzle ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Llit"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. Ventilador"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventilador ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Flux"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flux ~"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VViatge min"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Accel. max ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Accel. max ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Accel. max ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Accel. max ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Accel. max *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Accel. retracc"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Accel. Viatge"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Passos/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("passos/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("passos/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("passos/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Epassos/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*passos/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Moviment"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. Fil."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. Fil. *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contrast de LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Desa memoria"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carrega memoria"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaura valors"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Actualitza"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Pantalla Info."); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepara"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Ajusta"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausa impressio"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Repren impressio"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Atura impressio."); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Imprimeix de SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("No hi ha targeta"); + PROGMEM Language_Str MSG_DWELL = _UxGT("En repos..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Esperant usuari.."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Imp. cancelada"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sense moviment."); + PROGMEM Language_Str MSG_KILLED = _UxGT("MATAT."); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ATURADA."); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retreu mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Retreure mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retreu V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Aixeca mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("DesRet +mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Swap DesRet +mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("DesRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Auto retraccio"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Canvia filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Canvia filament *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Inicialitza SD"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Canvia SD"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z fora"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reinicia BLTouch"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s primer"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Decalatge Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Micropas X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Micropas Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Micropas Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Cancel. Endstop"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Error al escalfar"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP REDUNDANT"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: TEMP MAXIMA"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: TEMP MINIMA"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY primer"); + PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESSORA PARADA"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Reinicieu"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Escalfant..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Escalfant llit..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibratge Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibra X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibra Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibra Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibra el centre"); -#define MSG_INFO_MENU _UxGT("Quant a la impr.") -#define MSG_INFO_PRINTER_MENU _UxGT("Info Impressora") -#define MSG_INFO_STATS_MENU _UxGT("Estadistiques") -#define MSG_INFO_BOARD_MENU _UxGT("Info placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusors") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocol") -#define MSG_CASE_LIGHT _UxGT("Llum") + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Quant a la impr."); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info Impressora"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadistiques"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info placa"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistors"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusors"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocol"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Llum"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Total impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Acabades") - #define MSG_INFO_PRINT_TIME _UxGT("Temps imprimint") - #define MSG_INFO_PRINT_LONGEST _UxGT("Treball mes llarg") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total extrudit") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Acabades") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Mes llarg") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrudit") -#endif + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total impressions"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Acabades"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Temps imprimint"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Treball mes llarg"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total extrudit"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Impressions"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Acabades"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Mes llarg"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrudit"); + #endif -#define MSG_INFO_MIN_TEMP _UxGT("Temp. mínima") -#define MSG_INFO_MAX_TEMP _UxGT("Temp. màxima") -#define MSG_INFO_PSU _UxGT("Font alimentacio") + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp. mínima"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp. màxima"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Font alimentacio"); -#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_OPTION_RESUME _UxGT("Repren impressió") + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Força motor"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Write"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Repren impressió"); -// -// 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("Esperant per") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar el canvi") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filament") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperant per") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("treure filament") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Poseu filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i premeu el boto") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("per continuar...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Premeu boto per") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("escalfar nozzle.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Escalfant nozzle") - #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_RESUME_1 _UxGT("Esperant per") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("reprendre") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Espereu...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Expulsant...") - #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_RESUME_1 _UxGT("Reprenent...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impressora incorrecta"); + + // + // 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 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Esperant per", "iniciar el canvi", "de filament")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Esperant per", "treure filament")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Poseu filament", "i premeu el boto", "per continuar...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Premeu boto per", "escalfar nozzle.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Escalfant nozzle", "Espereu...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Esperant carrega", "de filament")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Esperant per", "reprendre")); + #else // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Espereu...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Expulsant...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Insereix i prem")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Escalfant...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Carregant...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Reprenent...")); + #endif // LCD_HEIGHT < 4 +} diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index e5b73acff7be..e2f2fd8db50e 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -35,520 +35,495 @@ */ #define DISPLAY_CHARSET_ISO10646_CZ -#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("áÁčČďĎéÉěĚíÍňŇóÓřŘšŠťŤúÚůŮýÝžŽ³") -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" připraven.") -#define MSG_YES _UxGT("ANO") -#define MSG_NO _UxGT("NE") -#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_ADVANCED_SETTINGS _UxGT("Další nastavení") -#define MSG_CONFIGURATION _UxGT("Konfigurace") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Uvolnit motory") -#define MSG_DEBUG_MENU _UxGT("Nabídka ladění") -#if LCD_WIDTH >= 20 - #define MSG_PROGRESS_BAR_TEST _UxGT("Test ukaz. průběhu") -#else - #define MSG_PROGRESS_BAR_TEST _UxGT("Test uk. průběhu") -#endif -#define MSG_AUTO_HOME _UxGT("Domovská pozice") -#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_AUTO_Z_ALIGN _UxGT("Auto srovnání 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") -#define MSG_LEVEL_BED_DONE _UxGT("Měření hotovo!") -#define MSG_Z_FADE_HEIGHT _UxGT("Výška srovnávání") -#define MSG_SET_HOME_OFFSETS _UxGT("Nastavit ofsety") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Ofsety nastaveny") -#define MSG_SET_ORIGIN _UxGT("Nastavit počátek") -#define MSG_PREHEAT_1 _UxGT("Zahřát " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" vše") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podlož") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast") -#define MSG_PREHEAT_2 _UxGT("Zahřát " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" vše") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" podlož") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" nast") -#define MSG_PREHEAT_CUSTOM _UxGT("Zahřát vlastní") -#define MSG_COOLDOWN _UxGT("Zchladit") -#define MSG_LASER_MENU _UxGT("Ovládání laseru") -#define MSG_LASER_OFF _UxGT("Vypnout laser") -#define MSG_LASER_ON _UxGT("Zapnout laser") -#define MSG_LASER_POWER _UxGT("Výkon laseru") -#define MSG_SPINDLE_REVERSE _UxGT("Vřeteno opačně") -#define MSG_SWITCH_PS_ON _UxGT("Zapnout napájení") -#define MSG_SWITCH_PS_OFF _UxGT("Vypnout napájení") -#define MSG_EXTRUDE _UxGT("Vytlačit (extr.)") -#define MSG_RETRACT _UxGT("Zatlačit (retr.)") -#define MSG_MOVE_AXIS _UxGT("Posunout osy") -#define MSG_BED_LEVELING _UxGT("Vyrovnat podložku") -#define MSG_LEVEL_BED _UxGT("Vyrovnat podložku") -#define MSG_LEVEL_CORNERS _UxGT("Vyrovnat rohy") -#define MSG_NEXT_CORNER _UxGT("Další roh") -#define MSG_EDITING_STOPPED _UxGT("Konec úprav sítě") +namespace Language_cz { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_MESH_X _UxGT("Index X") -#define MSG_MESH_Y _UxGT("Index Y") -#define MSG_MESH_EDIT_Z _UxGT("Hodnota Z") -#define MSG_USER_MENU _UxGT("Vlastní příkazy") -#define MSG_UBL_DOING_G29 _UxGT("Provádím G29") -#define MSG_UBL_UNHOMED _UxGT("Přejeďte domů") -#define MSG_UBL_TOOLS _UxGT("UBL nástroje") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_IDEX_MENU _UxGT("Režim IDEX") -#define MSG_OFFSETS_MENU _UxGT("Ofsety nástrojů") -#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Park") -#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplikace") -#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Zrcadlení") -#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Plná kontrola") -#define MSG_X_OFFSET _UxGT("2. tryska X") -#define MSG_Y_OFFSET _UxGT("2. tryska Y") -#define MSG_Z_OFFSET _UxGT("2. tryska Z") -#define MSG_UBL_MANUAL_MESH _UxGT("Manuální síť bodů") -#define MSG_UBL_BC_INSERT _UxGT("Vložte kartu, změřte") -#define MSG_UBL_BC_INSERT2 _UxGT("Změřte") -#define MSG_UBL_BC_REMOVE _UxGT("Odstraňte a změřte") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Přesun na další") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovat UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovat UBL") -#define MSG_UBL_SET_TEMP_BED _UxGT("Teplota podložky") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Teplota hotendu") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#define MSG_UBL_MESH_EDIT _UxGT("Úprava sítě bodů") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upravit vlastní síť") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladit síť bodů") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Konec úprav sítě") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastní síť") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvořit síť") -#define MSG_UBL_BUILD_MESH_M1 _UxGT("Síť bodů " PREHEAT_1_LABEL) -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Síť bodů " PREHEAT_2_LABEL) -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Studená síť bodů") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upravit výšku sítě") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Výška") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Zkontrolovat síť") -#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Kontrola sítě " PREHEAT_1_LABEL) -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Kontrola sítě " PREHEAT_2_LABEL) -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast. sítě") -#define MSG_UBL_CONTINUE_MESH _UxGT("Pokračovat v síťi") -#define MSG_UBL_MESH_LEVELING _UxGT("Síťové rovnání") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-bodové rovnání") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Mřížkové rovnání") -#define MSG_UBL_MESH_LEVEL _UxGT("Srovnat podložku") -#define MSG_UBL_SIDE_POINTS _UxGT("Postranní body") -#define MSG_UBL_MAP_TYPE _UxGT("Typ sítě bodu") -#define MSG_UBL_OUTPUT_MAP _UxGT("Exportovat síť") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Exportovat do PC") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Exportovat do CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Záloha do PC") -#define MSG_UBL_INFO_UBL _UxGT("Info o UBL do PC") -#define MSG_EDIT_MESH _UxGT("Upravit síť bodů") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Hustota mřížky") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Ruční hustota") -#define MSG_UBL_SMART_FILLIN _UxGT("Chytrá hustota") -#define MSG_UBL_FILLIN_MESH _UxGT("Zaplnit mřížku") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Zrušit všechno") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Zrušit poslední") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Upravit všechny") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Upravit poslední") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Uložiště sítí") -#define MSG_UBL_STORAGE_SLOT _UxGT("Paměťový slot") -#define MSG_UBL_LOAD_MESH _UxGT("Načíst síť bodů") -#define MSG_UBL_SAVE_MESH _UxGT("Uložit síť bodů") -#define MSG_MESH_LOADED _UxGT("Síť %i načtena") -#define MSG_MESH_SAVED _UxGT("Síť %i uložena") -#define MSG_NO_STORAGE _UxGT("Nedostatek místa") -#define MSG_UBL_SAVE_ERROR _UxGT("Ch.: Uložit UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Ch.: Obnovit UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Konec Z-Offsetu") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Postupně") + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Czech"); -#define MSG_LED_CONTROL _UxGT("Nastavení LED") -#define MSG_LEDS _UxGT("Světla") -#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_CUSTOM_LEDS _UxGT("Vlastní světla") -#define MSG_INTENSITY_R _UxGT("Červená intenzita") -#define MSG_INTENSITY_G _UxGT("Zelená intezita") -#define MSG_INTENSITY_B _UxGT("Modrá intenzita") -#define MSG_INTENSITY_W _UxGT("Bílá intenzita") -#define MSG_LED_BRIGHTNESS _UxGT("Jas") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" připraven."); + PROGMEM Language_Str MSG_YES = _UxGT("ANO"); + PROGMEM Language_Str MSG_NO = _UxGT("NE"); + PROGMEM Language_Str MSG_BACK = _UxGT("Zpět"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Karta vložena"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Karta vyjmuta"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstopy"); // max 8 znaku + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstopy"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Hlavní nabídka"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Další nastavení"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfigurace"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Uvolnit motory"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Nabídka ladění"); + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test ukaz. průběhu"); + #else + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test uk. průběhu"); + #endif + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Domovská pozice"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Domů osa X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Domů osa Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Domů osa Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto srovnání Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Měření podložky"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknutím spusťte"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Další bod"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Měření hotovo!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Výška srovnávání"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Nastavit ofsety"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastaveny"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Nastavit počátek"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Zahřát ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Zahřát ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" end"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" end ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" vše"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" podlož"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Zahřát ") PREHEAT_1_LABEL _UxGT(" nast"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Zahřát ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Zahřát ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" end"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" end ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" vše"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" podlož"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Zahřát ") PREHEAT_2_LABEL _UxGT(" nast"); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Zahřát vlastní"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Zchladit"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Ovládání laseru"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Vypnout laser"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Zapnout laser"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Výkon laseru"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Vřeteno opačně"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Zapnout napájení"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Vypnout napájení"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Vytlačit (extr.)"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Zatlačit (retr.)"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Posunout osy"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Vyrovnat podložku"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Vyrovnat podložku"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Vyrovnat rohy"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Další roh"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Upravit síť bodů"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Konec úprav sítě"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Hodnota Z"); -#define MSG_MOVING _UxGT("Posouvání...") -#define MSG_FREE_XY _UxGT("Uvolnit XY") -#define MSG_MOVE_X _UxGT("Posunout X") -#define MSG_MOVE_Y _UxGT("Posunout Y") -#define MSG_MOVE_Z _UxGT("Posunout Z") -#define MSG_MOVE_E _UxGT("Extrudér") -#define MSG_HOTEND_TOO_COLD _UxGT("Hotend je studený") -#define MSG_MOVE_0025MM _UxGT("Posunout o 0,025mm") -#define MSG_MOVE_01MM _UxGT("Posunout o 0,1mm") -#define MSG_MOVE_1MM _UxGT("Posunout o 1mm") -#define MSG_MOVE_10MM _UxGT("Posunout o 10mm") -#define MSG_SPEED _UxGT("Rychlost") -#define MSG_BED_Z _UxGT("Výška podl.") -#define MSG_NOZZLE _UxGT("Tryska") -#define MSG_BED _UxGT("Podložka") -#define MSG_CHAMBER _UxGT("Komora") -#define MSG_FAN_SPEED _UxGT("Rychlost vent.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Rychlost ex. vent.") -#define MSG_FLOW _UxGT("Průtok") -#define MSG_CONTROL _UxGT("Ovládaní") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fakt") -#define MSG_AUTOTEMP _UxGT("Autoteplota") -#define MSG_LCD_ON _UxGT("Zap") -#define MSG_LCD_OFF _UxGT("Vyp") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_JUNCTION_DEVIATION _UxGT("Odchylka spoje") -#define MSG_VELOCITY _UxGT("Rychlost") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Akcelerace") -#define MSG_AMAX _UxGT("Amax ") -#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_ESTEPS _UxGT("Ekroků/mm") -#define MSG_E1STEPS _UxGT("E1kroků/mm") -#define MSG_E2STEPS _UxGT("E2kroků/mm") -#define MSG_E3STEPS _UxGT("E3kroků/mm") -#define MSG_E4STEPS _UxGT("E4kroků/mm") -#define MSG_E5STEPS _UxGT("E5kroků/mm") -#define MSG_E6STEPS _UxGT("E6kroků/mm") -#define MSG_TEMPERATURE _UxGT("Teplota") -#define MSG_MOTION _UxGT("Pohyb") -#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í") -#define MSG_LOAD_EEPROM _UxGT("Načíst nastavení") -#define MSG_RESTORE_FAILSAFE _UxGT("Obnovit výchozí") -#define MSG_INIT_EEPROM _UxGT("Inic. EEPROM") -#define MSG_SD_UPDATE _UxGT("Aktualizace z SD") -#define MSG_RESET_PRINTER _UxGT("Reset tiskárny") -#define MSG_REFRESH _UxGT("Obnovit") -#define MSG_WATCH _UxGT("Info obrazovka") -#define MSG_PREPARE _UxGT("Připrava tisku") -#define MSG_TUNE _UxGT("Doladění tisku") -#define MSG_START_PRINT _UxGT("Spustit tisk") -#define MSG_BUTTON_PRINT _UxGT("Tisk") -#define MSG_BUTTON_CANCEL _UxGT("Zrušit") -#define MSG_PAUSE_PRINT _UxGT("Pozastavit tisk") -#define MSG_RESUME_PRINT _UxGT("Obnovit tisk") -#define MSG_STOP_PRINT _UxGT("Zastavit tisk") -#define MSG_OUTAGE_RECOVERY _UxGT("Obnova výpadku") -#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_PRINT_ABORTED _UxGT("Tisk zrušen") -#define MSG_NO_MOVE _UxGT("Žádný pohyb.") -#define MSG_KILLED _UxGT("PŘERUSENO. ") -#define MSG_STOPPED _UxGT("ZASTAVENO. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Výměna Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraktovat V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Zvednuti Z mm") -#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_FILAMENT_SWAP_LENGTH _UxGT("Délka retrakce") -#define MSG_TOOL_CHANGE _UxGT("Výměna nástroje") -#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Zdvih Z") -#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Rychlost primár.") -#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Rychlost retrak.") -#define MSG_NOZZLE_STANDBY _UxGT("Tryska standby") -#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") + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Vlastní příkazy"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Režim IDEX"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Ofsety nástrojů"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikace"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Zrcadlení"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Plná kontrola"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. tryska X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. tryska Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. tryska Z"); -#define MSG_INIT_SDCARD _UxGT("Načíst SD kartu") -#define MSG_CHANGE_SDCARD _UxGT("Vyměnit SD kartu") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") -#define MSG_SKEW_FACTOR _UxGT("Faktor zkosení") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch self-test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch reset") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch vysunout") -#define MSG_BLTOUCH_SW_MODE _UxGT("SW výsun BLTouch") -#define MSG_BLTOUCH_5V_MODE _UxGT("BLTouch 5V režim") -#define MSG_BLTOUCH_OD_MODE _UxGT("BLTouch OD režim") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch zasunout") -#define MSG_MANUAL_DEPLOY _UxGT("Vysunout Z-sondu") -#define MSG_MANUAL_STOW _UxGT("Zasunout Z-sondu") -#define MSG_HOME _UxGT("Domů") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("první") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z ofset") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_BABYSTEP_TOTAL _UxGT("Celkem") -#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Í ÚNIK") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("TEPL. ÚNIK 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_MAXTEMP_CHAMBER _UxGT("Err: MAXTEMP KOMORA") -#define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err: MINTEMP KOMORA") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#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í...") -#if LCD_WIDTH >= 20 - #define MSG_BED_HEATING _UxGT("Zahřívání podložky") -#else - #define MSG_BED_HEATING _UxGT("Zahřívání podl.") -#endif -#if LCD_WIDTH >= 20 - #define MSG_BED_COOLING _UxGT("Chlazení podložky") -#else - #define MSG_BED_COOLING _UxGT("Chlazení podl.") -#endif -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrace") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovat X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovat Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrovat Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrovat Střed") -#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") -#define MSG_INFO_MENU _UxGT("O tiskárně") -#define MSG_INFO_PRINTER_MENU _UxGT("Info o tiskárně") -#define MSG_3POINT_LEVELING _UxGT("3-bodové rovnání") -#define MSG_LINEAR_LEVELING _UxGT("Lineárni rovnání") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineární rovnání") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Mřížkové rovnání") -#define MSG_INFO_STATS_MENU _UxGT("Statistika") -#define MSG_INFO_BOARD_MENU _UxGT("Info o desce") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistory") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudéry") -#define MSG_INFO_BAUDRATE _UxGT("Rychlost") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvětlení") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Jas světla") + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Provádím G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL nástroje"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Manuální síť bodů"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Vložte kartu, změřte"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Změřte"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Odstraňte a změřte"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Přesun na další"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Aktivovat UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Deaktivovat UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Teplota podložky"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Teplota podložky"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Teplota hotendu"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Teplota hotendu"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Úprava sítě bodů"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Upravit vlastní síť"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Doladit síť bodů"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Konec úprav sítě"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Vlastní síť"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Vytvořit síť"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Síť bodů ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Síť bodů ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Studená síť bodů"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Upravit výšku sítě"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Výška"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Zkontrolovat síť"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Kontrola sítě ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Kontrola sítě ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Kontrola vlast. sítě"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Pokračovat v síťi"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Síťové rovnání"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-bodové rovnání"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Mřížkové rovnání"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Srovnat podložku"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Postranní body"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Typ sítě bodu"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Exportovat síť"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Exportovat do PC"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Exportovat do CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Záloha do PC"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Info o UBL do PC"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Hustota mřížky"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ruční hustota"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Chytrá hustota"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Zaplnit mřížku"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Zrušit všechno"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Zrušit poslední"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Upravit všechny"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Upravit poslední"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Uložiště sítí"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Paměťový slot"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Načíst síť bodů"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Uložit síť bodů"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Síť %i načtena"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Síť %i uložena"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Nedostatek místa"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Ch.: Uložit UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Ch.: Obnovit UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Konec Z-Offsetu"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Postupně"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. Studená síť bodů"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Chytrá hustota"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Zkontrolovat síť"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Upravit všechny"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Zkontrolovat síť"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Upravit všechny"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Uložit síť bodů"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Počet tisků") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Dokončeno") - #define MSG_INFO_PRINT_TIME _UxGT("Celkový čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelší tisk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Celkem vytlačeno") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Tisky") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Hotovo") - #define MSG_INFO_PRINT_TIME _UxGT("Čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Nejdelší") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Vytlačeno") -#endif + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Nastavení LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Světla"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Světla Předvolby"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Červená"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Oranžová"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Žlutá"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Zelená"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Modrá"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Fialová"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Bílá"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Výchozí"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Vlastní světla"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Červená intenzita"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Zelená intezita"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Modrá intenzita"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Bílá intenzita"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Jas"); -#define MSG_INFO_MIN_TEMP _UxGT("Teplota min") -#define MSG_INFO_MAX_TEMP _UxGT("Teplota max") -#define MSG_INFO_PSU _UxGT("Nap. zdroj") -#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_OPTION_RESUME _UxGT("Obnovit tisk") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_RUNOUT_SENSOR _UxGT("Senzor filamentu") -#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ý") + PROGMEM Language_Str MSG_MOVING = _UxGT("Posouvání..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Uvolnit XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Posunout X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Posunout Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Posunout Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudér"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudér *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Posunout o %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Posunout o 0,1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Posunout o 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Posunout o 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Rychlost"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Výška podl."); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Tryska"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Tryska ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Podložka"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Komora"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Rychlost vent."); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rychlost vent. ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Rychlost ex. vent."); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rychlost ex. vent. ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Průtok"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Průtok ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Ovládaní"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autoteplota"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Zap"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Vyp"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Vybrat"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vybrat *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Zrychl"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Odchylka spoje"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Rychlost"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Akcelerace"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retrakt"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-přejezd"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Kroků/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("kroků/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("kroků/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("kroků/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Ekroků/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*kroků/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Teplota"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Pohyb"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E na mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Prum."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Prum. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Vysunout mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Zavést mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K pro posun"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K pro posun *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Uložit nastavení"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Načíst nastavení"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Obnovit výchozí"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inic. EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aktualizace z SD"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reset tiskárny"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Obnovit"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Info obrazovka"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Připrava tisku"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Doladění tisku"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Spustit tisk"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Tisk"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Zrušit"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pozastavit tisk"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Obnovit tisk"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Zastavit tisk"); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Obnova výpadku"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Tisknout z SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Žádná SD karta"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Uspáno..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Čekání na uživ..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Tisk pozastaven"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Tisknu..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Tisk zrušen"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Žádný pohyb."); + PROGMEM Language_Str MSG_KILLED = _UxGT("PŘERUSENO. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ZASTAVENO. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retrakt mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Výměna Re.mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraktovat V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Zvednuti Z mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Délka retrakce"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Výměna nástroje"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Zdvih Z"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Rychlost primár."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Rychlost retrak."); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Tryska standby"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Vyměnit filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Vyměnit filament *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Zavést filament"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Zavést filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Vysunout filament"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Vysunout filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Vysunout vše"); -#define MSG_MMU2_FILAMENT_CHANGE_HEADER _UxGT("VÝMĚNA FILAMENTU") -#define MSG_MMU2_CHOOSE_FILAMENT_HEADER _UxGT("VYBERTE FILAMENT") -#define MSG_MMU2_MENU _UxGT("MMU") -#define MSG_MMU2_WRONG_FIRMWARE _UxGT("Aktual. MMU firmware!") -#define MSG_MMU2_NOT_RESPONDING _UxGT("MMU potř. pozornost.") -#define MSG_MMU2_RESUME _UxGT("Obnovit tisk") -#define MSG_MMU2_RESUMING _UxGT("Obnovování...") -#define MSG_MMU2_LOAD_FILAMENT _UxGT("Zavést filament") -#define MSG_MMU2_LOAD_ALL _UxGT("Zavést všechny") -#define MSG_MMU2_LOAD_TO_NOZZLE _UxGT("Zavést do trysky") -#define MSG_MMU2_EJECT_FILAMENT _UxGT("Vysunout filament") -#define MSG_MMU2_EJECT_FILAMENT0 _UxGT("Vysun. filament 1") -#define MSG_MMU2_EJECT_FILAMENT1 _UxGT("Vysun. filament 2") -#define MSG_MMU2_EJECT_FILAMENT2 _UxGT("Vysun. filament 3") -#define MSG_MMU2_EJECT_FILAMENT3 _UxGT("Vysun. filament 4") -#define MSG_MMU2_EJECT_FILAMENT4 _UxGT("Vysun. filament 5") -#define MSG_MMU2_UNLOAD_FILAMENT _UxGT("Vytáhnout filament") -#define MSG_MMU2_LOADING_FILAMENT _UxGT("Zavádění fil. %i...") -#define MSG_MMU2_EJECTING_FILAMENT _UxGT("Vytahování fil. ...") -#define MSG_MMU2_UNLOADING_FILAMENT _UxGT("Vysouvání fil....") -#define MSG_MMU2_ALL _UxGT("Všechny") -#define MSG_MMU2_FILAMENT0 _UxGT("Filament 1") -#define MSG_MMU2_FILAMENT1 _UxGT("Filament 2") -#define MSG_MMU2_FILAMENT2 _UxGT("Filament 3") -#define MSG_MMU2_FILAMENT3 _UxGT("Filament 4") -#define MSG_MMU2_FILAMENT4 _UxGT("Filament 5") -#define MSG_MMU2_RESET _UxGT("Resetovat MMU") -#define MSG_MMU2_RESETTING _UxGT("Resetování MMU...") -#define MSG_MMU2_EJECT_RECOVER _UxGT("Vytáhněte, klikněte") + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Načíst SD kartu"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Vyměnit SD kartu"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z mimo podl"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Faktor zkosení"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch self-test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("BLTouch reset"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch vysunout"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("SW výsun BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("BLTouch 5V režim"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("BLTouch OD režim"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("BLTouch zasunout"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Vysunout Z-sondu"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Zasunout Z-sondu"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Domů %s%s%s první"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z ofset"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Celkem"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop abort"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Chyba zahřívání"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Chyba zahř.podl."); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("REDUND. TEPLOTA"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TEPLOTNÍ ÚNIK"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("TEPL. ÚNIK PODL."); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("VYSOKÁ TEPLOTA"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("NÍZKA TEPLOTA"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("VYS. TEPL. PODL."); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("NÍZ. TEPL. PODL."); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err: MAXTEMP KOMORA"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err: MINTEMP KOMORA"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Domů XY první"); + PROGMEM Language_Str MSG_HALTED = _UxGT("TISK. ZASTAVENA"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Proveďte reset"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Zahřívání..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Chlazení..."); + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Zahřívání podložky"); + #else + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Zahřívání podl."); + #endif + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Chlazení podložky"); + #else + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Chlazení podl."); + #endif + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrace"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibrovat X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibrovat Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibrovat Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrovat Střed"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta nastavení"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Autokalibrace"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Nast.výšku delty"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Nast. Z-ofset"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag rameno"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Výška"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Poloměr"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("O tiskárně"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info o tiskárně"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-bodové rovnání"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Lineárni rovnání"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilineární rovnání"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mřížkové rovnání"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statistika"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info o desce"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistory"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrudéry"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Rychlost"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Osvětlení"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas světla"); -#define MSG_MIX _UxGT("Mix") -#define MSG_MIX_COMPONENT _UxGT("Komponenta") -#define MSG_MIXER _UxGT("Mixér") -#define MSG_GRADIENT _UxGT("Přechod") -#define MSG_FULL_GRADIENT _UxGT("Celý přechod") -#define MSG_TOGGLE_MIX _UxGT("Přepnout mix") -#define MSG_CYCLE_MIX _UxGT("Střídat mix") -#define MSG_GRADIENT_MIX _UxGT("Přechod mix") -#define MSG_REVERSE_GRADIENT _UxGT("Opačný přechod") -#if LCD_WIDTH >= 20 - #define MSG_ACTIVE_VTOOL _UxGT("Aktivní V-nástroj") - #define MSG_START_VTOOL _UxGT("Spustit V-nástroj") - #define MSG_END_VTOOL _UxGT("Ukončit V-nástroj") - #define MSG_GRADIENT_ALIAS _UxGT("Alias V-nástroje") - #define MSG_RESET_VTOOLS _UxGT("Resetovat V-nástroj") - #define MSG_COMMIT_VTOOL _UxGT("Uložit V-nástroj mix") - #define MSG_VTOOLS_RESET _UxGT("V-nástroj resetovat") -#else - #define MSG_ACTIVE_VTOOL _UxGT("Aktivní V-nástr.") - #define MSG_START_VTOOL _UxGT("Spustit V-nástr.") - #define MSG_END_VTOOL _UxGT("Ukončit V-nástr.") - #define MSG_GRADIENT_ALIAS _UxGT("Alias V-nástr.") - #define MSG_RESET_VTOOLS _UxGT("Reset. V-nástr.") - #define MSG_COMMIT_VTOOL _UxGT("Uložit V-nás. mix") - #define MSG_VTOOLS_RESET _UxGT("V-nástr. reset.") -#endif -#define MSG_START_Z _UxGT("Počáteční Z") -#define MSG_END_Z _UxGT(" Koncové Z") -#define MSG_BRICKOUT _UxGT("Brickout") -#define MSG_INVADERS _UxGT("Invaders") -#define MSG_SNAKE _UxGT("Sn4k3") -#define MSG_MAZE _UxGT("Bludiště") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Počet tisků"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Dokončeno"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Celkový čas"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Nejdelší tisk"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Celkem vytlačeno"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Tisky"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Hotovo"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Čas"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Nejdelší"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Vytlačeno"); + #endif -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Stikněte tlačítko") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("pro obnovení tisku") - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Parkování...") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na zahájení") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("výměny filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stiskněte") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tlačítko...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klikněte pro") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("nahřátí trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("na nahřátí tr.") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čekejte prosím") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunuti") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #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_CONT_PURGE_1 _UxGT("Klikněte pro") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("ukončení") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_3 _UxGT("vytlačování") - #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") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Stikněte tlač.") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("pro obnovení") - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Parkování...") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekejte...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte, klikněte") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klikněte pro") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("nahřátí") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nahřívání...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysouvá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_CONT_PURGE_1 _UxGT("Klikněte pro") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("ukončení") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračování...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Teplota min"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Nap. zdroj"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Buzení motorů"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Motor %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Motor %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Motor %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Motor %"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Uložit do EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("VÝMĚNA FILAMENTU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("TISK POZASTAVEN"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ZAVEDENÍ FILAMENTU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("VYSUNUTÍ FILAMENTU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("MOŽNOSTI OBNOVENÍ:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Vytlačit víc"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Obnovit tisk"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Tryska: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Senzor filamentu"); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Parkování selhalo"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Kalibrace selhala"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Moc studený"); -#define MSG_TMC_DRIVERS _UxGT("TMC budiče") -#define MSG_TMC_CURRENT _UxGT("Proud budičů") -#define MSG_TMC_HYBRID_THRS _UxGT("Hybridní práh") -#define MSG_TMC_HOMING_THRS _UxGT("Domů bez senzorů") -#define MSG_TMC_STEPPING_MODE _UxGT("Režim kroků") -#define MSG_TMC_STEALTH_ENABLED _UxGT("StealthChop povolen") -#define MSG_SERVICE_RESET _UxGT("Reset") -#define MSG_SERVICE_IN _UxGT(" za:") -#define MSG_BACKLASH _UxGT("Vůle") -#define MSG_BACKLASH_CORRECTION _UxGT("Korekce") -#define MSG_BACKLASH_SMOOTHING _UxGT("Vyhlazení") + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("VYBERTE FILAMENT"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Aktual. MMU firmware!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU potř. pozornost."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Obnovit tisk"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Obnovování..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Zavést filament"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Zavést všechny"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Zavést do trysky"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Vysunout filament"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Vysun. filament ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Vytáhnout filament"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Zavádění fil. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Vytahování fil. ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Vysouvání fil...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Všechny"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Resetovat MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Resetování MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Vytáhněte, klikněte"); + + PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Komponenta ~"); + PROGMEM Language_Str MSG_MIXER = _UxGT("Mixér"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Přechod"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Celý přechod"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Přepnout mix"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Střídat mix"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Přechod mix"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Opačný přechod"); + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktivní V-nástroj"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Spustit V-nástroj"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Ukončit V-nástroj"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-nástroje"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Resetovat V-nástroj"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Uložit V-nástroj mix"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-nástroj resetovat"); + #else + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktivní V-nástr."); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Spustit V-nástr."); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Ukončit V-nástr."); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-nástr."); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reset. V-nástr."); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Uložit V-nás. mix"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-nástr. reset."); + #endif + PROGMEM Language_Str MSG_START_Z = _UxGT("Počáteční Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Koncové Z:"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Bludiště"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Nesprávná tiskárna"); + + #if LCD_HEIGHT >= 4 + // Up to 3 lines allowed + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Stikněte tlačítko", "pro obnovení tisku")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkování...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Čekejte prosím", "na zahájení", "výměny filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Vložte filament", "a stiskněte", "tlačítko...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Klikněte pro", "nahřátí trysky")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Čekejte prosím", "na nahřátí tr.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Čekejte prosím", "na vysunuti", "filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Čekejte prosím", "na zavedení", "filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Vyčkejte na", "vytlačení")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Klikněte pro", "ukončení", "vytlačování")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Čekejte prosím", "na pokračování", "tisku")); + #else // LCD_HEIGHT < 4 + // Up to 2 lines allowed + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Stikněte tlač.", "pro obnovení")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkování...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Čekejte...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Vložte, klikněte")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Klikněte pro", "nahřátí")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Nahřívání...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Vysouvání...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Zavádění...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Vytlačování...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Klikněte pro", "ukončení")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Pokračování...")); + #endif // LCD_HEIGHT < 4 + + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC budiče"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Proud budičů"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybridní práh"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Domů bez senzorů"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Režim kroků"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop povolen"); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" za:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Vůle"); + PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; + PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; + PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Korekce"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Vyhlazení"); +} diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 2c3f14152dec..9cb79ddbea62 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -30,222 +30,174 @@ */ #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" er klar") -#define MSG_SD_INSERTED _UxGT("Kort isat") -#define MSG_SD_REMOVED _UxGT("Kort fjernet") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Slå alle steppere fra") -#define MSG_AUTO_HOME _UxGT("Auto 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_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") -#define MSG_LEVEL_BED_DONE _UxGT("Bed level er færdig!") -#define MSG_SET_HOME_OFFSETS _UxGT("Sæt forsk. af home") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Forsk. er nu aktiv") -#define MSG_SET_ORIGIN _UxGT("Sæt origin") -#define MSG_PREHEAT_1 _UxGT("Forvarm " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N _UxGT("Forvarm " PREHEAT_1_LABEL " ") -#define MSG_PREHEAT_1_ALL _UxGT("Forvarm " PREHEAT_1_LABEL " Alle") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Forvarm " PREHEAT_1_LABEL " Bed") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Forvarm " PREHEAT_1_LABEL " conf") -#define MSG_PREHEAT_2 _UxGT("Forvarm " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Forvarm " PREHEAT_2_LABEL " ") -#define MSG_PREHEAT_2_ALL _UxGT("Forvarm " PREHEAT_2_LABEL " Alle") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Forvarm " PREHEAT_2_LABEL " Bed") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Forvarm " PREHEAT_2_LABEL " conf") -#define MSG_COOLDOWN _UxGT("Afkøl") -#define MSG_SWITCH_PS_ON _UxGT("Slå strøm til") -#define MSG_SWITCH_PS_OFF _UxGT("Slå strøm fra") -#define MSG_EXTRUDE _UxGT("Extruder") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("Flyt akser") -#define MSG_BED_LEVELING _UxGT("Juster bed") -#define MSG_LEVEL_BED _UxGT("Juster bed") -#define MSG_MOVE_X _UxGT("Flyt X") -#define MSG_MOVE_Y _UxGT("Flyt Y") -#define MSG_MOVE_Z _UxGT("Flyt Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_0025MM _UxGT("Flyt 0.025mm") -#define MSG_MOVE_01MM _UxGT("Flyt 0.1mm") -#define MSG_MOVE_1MM _UxGT("Flyt 1mm") -#define MSG_MOVE_10MM _UxGT("Flyt 10mm") -#define MSG_SPEED _UxGT("Hastighed") -#define MSG_BED_Z _UxGT("Plade Z") -#define MSG_NOZZLE _UxGT("Dyse") +namespace Language_da { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_BED _UxGT("Plade") -#define MSG_FAN_SPEED _UxGT("Blæser hastighed") -#define MSG_FLOW _UxGT("Flow") -#define MSG_CONTROL _UxGT("Kontrol") -#define MSG_MIN _UxGT(" \002 Min") -#define MSG_MAX _UxGT(" \002 Max") -#define MSG_FACTOR _UxGT(" \002 Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("Til") -#define MSG_LCD_OFF _UxGT("Fra") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_AMAX _UxGT("Amax ") -#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_ESTEPS _UxGT("Esteps/mm") -#define MSG_E1STEPS _UxGT("E1steps/mm") -#define MSG_E2STEPS _UxGT("E2steps/mm") -#define MSG_E3STEPS _UxGT("E3steps/mm") -#define MSG_E4STEPS _UxGT("E4steps/mm") -#define MSG_E5STEPS _UxGT("E5steps/mm") -#define MSG_E6STEPS _UxGT("E6steps/mm") -#define MSG_TEMPERATURE _UxGT("Temperatur") -#define MSG_MOTION _UxGT("Bevægelse") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E i mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD kontrast") -#define MSG_STORE_EEPROM _UxGT("Gem i EEPROM") -#define MSG_LOAD_EEPROM _UxGT("Hent fra EEPROM") -#define MSG_RESTORE_FAILSAFE _UxGT("Gendan failsafe") -#define MSG_REFRESH _UxGT("Genopfrisk") -#define MSG_WATCH _UxGT("Info skærm") -#define MSG_PREPARE _UxGT("Forbered") -#define MSG_TUNE _UxGT("Tune") -#define MSG_PAUSE_PRINT _UxGT("Pause printet") -#define MSG_RESUME_PRINT _UxGT("Forsæt printet") -#define MSG_STOP_PRINT _UxGT("Stop printet") -#define MSG_CARD_MENU _UxGT("Print fra SD") -#define MSG_NO_CARD _UxGT("Intet SD kort") -#define MSG_DWELL _UxGT("Dvale...") -#define MSG_USERWAIT _UxGT("Venter på bruger...") -#define MSG_PRINT_ABORTED _UxGT("Print annulleret") -#define MSG_NO_MOVE _UxGT("Ingen bevægelse.") -#define MSG_KILLED _UxGT("DRÆBT. ") -#define MSG_STOPPED _UxGT("STOPPET. ") -#define MSG_CONTROL_RETRACT _UxGT("Tilbagetræk mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Skift Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Tilbagetræk V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Skift UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Skift filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD card") -#define MSG_CHANGE_SDCARD _UxGT("Skift SD kort") -#define MSG_ZPROBE_OUT _UxGT("Probe udenfor plade") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Selv-Test") -#define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("først") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") -#define MSG_HEATING_FAILED_LCD _UxGT("Opvarmning fejlet") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Fejl: reserve temp") -#define MSG_THERMAL_RUNAWAY _UxGT("Temp løber løbsk") -#define MSG_ERR_MAXTEMP _UxGT("Fejl: Maks temp") -#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_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_DELTA_CALIBRATE _UxGT("Delta Kalibrering") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibrer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibrerings Center") + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Danish"); -#define MSG_INFO_MENU _UxGT("Om Printer") -#define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#define MSG_INFO_BOARD_MENU _UxGT("Kort 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") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" er klar"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Kort isat"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Kort fjernet"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Slå alle steppere fra"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto Home"); // G28 + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klik når du er klar"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Næste punkt"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Bed level er færdig!"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Sæt forsk. af home"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Forsk. er nu aktiv"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Sæt origin"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Forvarm ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Forvarm ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" end") + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" end ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" Alle"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" Bed"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Forvarm ") PREHEAT_1_LABEL _UxGT(" conf"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Forvarm ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Forvarm ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" end") + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" end ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" Alle"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" Bed"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Forvarm ") PREHEAT_2_LABEL _UxGT(" conf"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Afkøl"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Slå strøm til"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Slå strøm fra"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extruder"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Flyt akser"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Juster bed"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Juster bed"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Flyt X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Flyt Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Flyt Z"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Flyt %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Flyt 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Flyt 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Flyt 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Hastighed"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Plade Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Dyse"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Dyse ~"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Ant. Prints") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Færdige") - #define MSG_INFO_PRINT_TIME _UxGT("Total print tid") - #define MSG_INFO_PRINT_LONGEST _UxGT("Længste print") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total Extruderet") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Prints") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Færdige") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Længste") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruderet") -#endif + PROGMEM Language_Str MSG_BED = _UxGT("Plade"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Blæser hastighed"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Blæser hastighed ="); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrol"); + PROGMEM Language_Str MSG_MIN = _UxGT(" \002 Min"); + PROGMEM Language_Str MSG_MAX = _UxGT(" \002 Max"); + PROGMEM Language_Str MSG_FACTOR = _UxGT(" \002 Fact"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Til"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Fra"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Vælg"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vælg *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retract"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-rejse"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatur"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Bevægelse"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E i mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrast"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gem i EEPROM"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Hent fra EEPROM"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Gendan failsafe"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Genopfrisk"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Info skærm"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Forbered"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pause printet"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Forsæt printet"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stop printet"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Print fra SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Intet SD kort"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Dvale..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Venter på bruger..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print annulleret"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Ingen bevægelse."); + PROGMEM Language_Str MSG_KILLED = _UxGT("DRÆBT. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPET. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Tilbagetræk mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Skift Re.mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Tilbagetræk V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Skift UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Skift filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Skift filament *"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Skift SD kort"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Probe udenfor plade"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Selv-Test"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s først"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Opvarmning fejlet"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Fejl: reserve temp"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Temp løber løbsk"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Fejl: Maks temp"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Fejl: Min temp"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Fejl: Maks Plade temp"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Fejl: Min Plade temp"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY først"); + PROGMEM Language_Str MSG_HALTED = _UxGT("PRINTER STOPPET"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Reset Venligst"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // Kun et bogstav + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // Kun et bogstav + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // Kun et bogstav + PROGMEM Language_Str MSG_HEATING = _UxGT("Opvarmer..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Opvarmer plade..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrering"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibrer X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibrer Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibrer Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrerings Center"); -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Strømfors.") + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Om Printer"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Kort Info"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors"); -#define MSG_DRIVE_STRENGTH _UxGT("Driv Styrke") -#define MSG_DAC_PERCENT _UxGT("Driv %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Skriv") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Ant. Prints"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Færdige"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total print tid"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Længste print"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total Extruderet"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Prints"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Færdige"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Længste"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruderet"); + #endif -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Forsæt print") + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Strømfors."); -#if LCD_HEIGHT >= 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Vent på start") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("af filament") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("skift") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vent på") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament udskyd.") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Indsæt filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("og tryk på knap") - #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_RESUME_1 _UxGT("Vent på at print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("fortsætter") -#else // LCD_HEIGHT < 4 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Vent venligst...") - #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_RESUME_1 _UxGT("Fortsætter...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Driv Styrke"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driv %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driv %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driv %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driv %"); + + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Skriv"); + + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Forsæt print"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Forkert printer"); + + #if LCD_HEIGHT >= 4 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Vent på start", "af filament", "skift")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Vent på", "filament udskyd.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Indsæt filament", "og tryk på knap", "for at fortsætte...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Vent på", "filament indtag")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Vent på at print", "fortsætter")); + #else // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Vent venligst...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Udskyder...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Indsæt og klik")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Indtager...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Fortsætter...")); + #endif // LCD_HEIGHT < 4 +} diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index a1ada61c785a..e2c604c83a58 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -29,526 +29,539 @@ * */ -#define CHARSIZE 2 +namespace Language_de { + using namespace Language_en; // Inherit undefined strings from English -#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("ÄäÖöÜüß²³") + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Deutsche"); -#define WELCOME_MSG MACHINE_NAME _UxGT(" bereit") -#define MSG_YES _UxGT("JA") -#define MSG_NO _UxGT("NEIN") -#define MSG_BACK _UxGT("Zurück") -#define MSG_SD_INSERTED _UxGT("SD-Karte erkannt") -#define MSG_SD_REMOVED _UxGT("SD-Karte entfernt") -#define MSG_SD_RELEASED _UxGT("SD-Karte freigeg.") -#define MSG_LCD_ENDSTOPS _UxGT("Endstopp") // Max length 8 characters -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft-Endstopp") -#define MSG_MAIN _UxGT("Hauptmenü") -#define MSG_ADVANCED_SETTINGS _UxGT("Erw. Einstellungen") -#define MSG_CONFIGURATION _UxGT("Konfiguration") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Motoren deaktivieren") // M84 -#define MSG_DEBUG_MENU _UxGT("Debug-Menü") -#define MSG_PROGRESS_BAR_TEST _UxGT("Statusbalken-Test") -#define MSG_AUTO_HOME _UxGT("Home XYZ") // 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_AUTO_Z_ALIGN _UxGT("Z-Achsen ausgleichen") -#define MSG_LEVEL_BED_HOMING _UxGT("Home XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klick zum Starten") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Nächste Koordinate") -#define MSG_LEVEL_BED_DONE _UxGT("Nivellieren fertig!") -#define MSG_Z_FADE_HEIGHT _UxGT("Ausblendhöhe") -#define MSG_SET_HOME_OFFSETS _UxGT("Setze Homeversatz") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Homeversatz aktiv") -#define MSG_SET_ORIGIN _UxGT("Setze Nullpunkte") //"G92 X0 Y0 Z0" commented out in ultralcd.cpp -#define MSG_PREHEAT_1 _UxGT("Vorwärmen " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N _UxGT("Vorwärmen " PREHEAT_1_LABEL " ") -#define MSG_PREHEAT_1_ALL _UxGT("Vorw. " PREHEAT_1_LABEL " Alles") -#define MSG_PREHEAT_1_END _UxGT("Vorw. " PREHEAT_1_LABEL " Extr.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Vorw. " PREHEAT_1_LABEL " Bett") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Vorw. " PREHEAT_1_LABEL " Einst.") -#define MSG_PREHEAT_2 _UxGT("Vorwärmen " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Vorwärmen " PREHEAT_2_LABEL " ") -#define MSG_PREHEAT_2_ALL _UxGT("Vorw. " PREHEAT_2_LABEL " Alles") -#define MSG_PREHEAT_2_END _UxGT("Vorw. " PREHEAT_2_LABEL " Extr.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Vorw. " PREHEAT_2_LABEL " Bett") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Vorw. " PREHEAT_2_LABEL " Einst.") -#define MSG_PREHEAT_CUSTOM _UxGT("benutzerdef. Heizen") -#define MSG_COOLDOWN _UxGT("Abkühlen") -#define MSG_LASER_MENU _UxGT("Laser") -#define MSG_LASER_OFF _UxGT("Laser aus") -#define MSG_LASER_ON _UxGT("Laser an") -#define MSG_LASER_POWER _UxGT("Laserleistung") -#define MSG_SPINDLE_MENU _UxGT("Spindel-Steuerung") -#define MSG_SPINDLE_OFF _UxGT("Spindel Aus") -#define MSG_SPINDLE_ON _UxGT("Spindel An") -#define MSG_SPINDLE_POWER _UxGT("Spindelleistung") -#define MSG_SPINDLE_REVERSE _UxGT("Spindelrichtung") -#define MSG_SWITCH_PS_ON _UxGT("Netzteil ein") -#define MSG_SWITCH_PS_OFF _UxGT("Netzteil aus") -#define MSG_EXTRUDE _UxGT("Extrudieren") -#define MSG_RETRACT _UxGT("Einzug") -#define MSG_MOVE_AXIS _UxGT("Achse Bewegen") -#define MSG_BED_LEVELING _UxGT("Bett-Nivellierung") -#define MSG_LEVEL_BED _UxGT("Bett nivellieren") -#define MSG_LEVEL_CORNERS _UxGT("Ecken nivellieren") -#define MSG_NEXT_CORNER _UxGT("Nächste Ecke") -#define MSG_EDITING_STOPPED _UxGT("Netzbearb. angeh.") -#define MSG_MESH_X _UxGT("Index X") -#define MSG_MESH_Y _UxGT("Index Y") -#define MSG_MESH_EDIT_Z _UxGT("Z-Wert") -#define MSG_USER_MENU _UxGT("Benutzer-Menü") -#define MSG_UBL_DOING_G29 _UxGT("G29 ausführen") -#define MSG_UBL_UNHOMED _UxGT("Home XYZ zuerst") -#define MSG_UBL_TOOLS _UxGT("UBL-Werkzeuge") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_LCD_PROBING_MESH _UxGT("Messpunkt") -#define MSG_LCD_TILTING_MESH _UxGT("Berührungspunkt") -#define MSG_IDEX_MENU _UxGT("IDEX-Modus") -#define MSG_OFFSETS_MENU _UxGT("Werkzeugversätze") -#define MSG_IDEX_MODE_AUTOPARK _UxGT("Autom. Parken") -#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplizieren") -#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Spiegelkopie") -#define MSG_IDEX_MODE_FULL_CTRL _UxGT("vollstä. Kontrolle") -#define MSG_X_OFFSET _UxGT("2. Düse X") -#define MSG_Y_OFFSET _UxGT("2. Düse Y") -#define MSG_Z_OFFSET _UxGT("2. Düse Z") -#define MSG_UBL_MANUAL_MESH _UxGT("Netz manuell erst.") -#define MSG_UBL_BC_INSERT _UxGT("Unterlegen & messen") -#define MSG_UBL_BC_INSERT2 _UxGT("Messen") -#define MSG_UBL_BC_REMOVE _UxGT("Entfernen & messen") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Nächster Punkt...") -#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktivieren") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL deaktivieren") -#define MSG_UBL_SET_TEMP_BED _UxGT("Betttemperatur") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Hotend-Temp.") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#define MSG_UBL_MESH_EDIT _UxGT("Netz bearbeiten") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Eigenes Netz bearb.") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Feineinstellung...") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Bearbeitung beendet") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Eigenes Netz erst.") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Netz erstellen") -#define MSG_UBL_BUILD_MESH_M1 _UxGT("Netz erstellen " PREHEAT_1_LABEL) -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Netz erstellen " PREHEAT_2_LABEL) -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Netz erstellen kalt") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Netzhöhe einst.") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Höhe") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Netz validieren") -#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Netz validieren " PREHEAT_1_LABEL) -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Netz validieren " PREHEAT_2_LABEL) -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Eig. Netz validieren") -#define MSG_UBL_CONTINUE_MESH _UxGT("Netzerst. forts.") -#define MSG_UBL_MESH_LEVELING _UxGT("Netz-Nivellierung") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Punkt-Nivell.") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Gitternetz-Nivell.") -#define MSG_UBL_MESH_LEVEL _UxGT("Netz nivellieren") -#define MSG_UBL_SIDE_POINTS _UxGT("Eckpunkte") -#define MSG_UBL_MAP_TYPE _UxGT("Kartentyp") -#define MSG_UBL_OUTPUT_MAP _UxGT("Karte ausgeben") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Ausgabe für Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Ausgabe für CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Externe Sicherung") -#define MSG_UBL_INFO_UBL _UxGT("UBL-Info ausgeben") -#define MSG_EDIT_MESH _UxGT("Netz bearbeiten") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Menge an Füllung") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Manuelles Füllen") -#define MSG_UBL_SMART_FILLIN _UxGT("Cleveres Füllen") -#define MSG_UBL_FILLIN_MESH _UxGT("Netz Füllen") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Alles annullieren") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Nächstlieg. ann.") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Feineinst. Alles") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Feineinst. Nächstl.") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Netz-Speicherplatz") -#define MSG_UBL_STORAGE_SLOT _UxGT("Speicherort") -#define MSG_UBL_LOAD_MESH _UxGT("Bettnetz laden") -#define MSG_UBL_SAVE_MESH _UxGT("Bettnetz 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") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" bereit"); -#define MSG_LED_CONTROL _UxGT("Licht-Steuerung") -#define MSG_LEDS _UxGT("Licht") -#define MSG_LED_PRESETS _UxGT("Licht-Einstellung") -#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") + PROGMEM Language_Str MSG_YES = _UxGT("JA"); + PROGMEM Language_Str MSG_NO = _UxGT("NEIN"); + PROGMEM Language_Str MSG_BACK = _UxGT("Zurück"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Abbruch..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Medium erkannt"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Medium entfernt"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Medium freigegeben"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Warten auf Medium"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Medium Lesefehler"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB Gerät entfernt"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB Start fehlge."); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstopp"); // Max length 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Software-Endstopp"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Hauptmenü"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Erw. Einstellungen"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguration"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motoren deaktivieren"); // M84 :: Max length 19 characters + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug-Menü"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Statusbalken-Test"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Z-Achsen ausgleichen"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klick zum Starten"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Nächste Koordinate"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Nivellieren fertig!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Ausblendhöhe"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Setze Homeversatz"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Setze Nullpunkte"); //"G92 X0 Y0 Z0" commented out in ultralcd.cpp + PROGMEM Language_Str MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" Vorwärmen") " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = PREHEAT_1_LABEL _UxGT(" Extr. Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = PREHEAT_1_LABEL _UxGT(" Extr. Vorwärm. ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = PREHEAT_1_LABEL _UxGT(" Alles Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = PREHEAT_1_LABEL _UxGT(" Bett Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = PREHEAT_1_LABEL _UxGT(" Einstellungen"); + PROGMEM Language_Str MSG_PREHEAT_2 = PREHEAT_2_LABEL _UxGT(" Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_2_H = PREHEAT_2_LABEL _UxGT(" Vorwärmen") " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = PREHEAT_2_LABEL _UxGT(" Extr. Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = PREHEAT_2_LABEL _UxGT(" Extr. Vorwärm. ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = PREHEAT_2_LABEL _UxGT(" Alles Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = PREHEAT_2_LABEL _UxGT(" Bett Vorwärmen"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = PREHEAT_2_LABEL _UxGT(" Einstellungen"); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("benutzerdef. Heizen"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Abkühlen"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Laser"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser aus"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser an"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laserleistung"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindel-Steuerung"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindel aus"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindel an"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindelleistung"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindelrichtung"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Netzteil ein"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Netzteil aus"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudieren"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Einzug"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Achsen bewegen"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Bett-Nivellierung"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Bett nivellieren"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Ecken nivellieren"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Nächste Ecke"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Netz Editor"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Netz bearbeiten"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Netzbearb. angeh."); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Messpunkt"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z-Wert"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Benutzer-Menü"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Berührungspunkt"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Sondentest"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Punkt"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Abweichung"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX-Modus"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Werkzeugversätze"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Autom. parken"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplizieren"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Spiegelkopie"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("vollstä. Kontrolle"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. Düse X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. Düse Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. Düse Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 ausführen"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL-Werkzeuge"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Netz manuell erst."); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Unterlegen & messen"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Messen"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Entfernen & messen"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Nächster Punkt..."); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("UBL aktivieren"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL deaktivieren"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Betttemperatur"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Betttemperatur"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Hotend-Temp."); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend-Temp."); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Netz bearbeiten"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Eigenes Netz bearb."); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Feineinstellung..."); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Bearbeitung beendet"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Eigenes Netz erst."); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Netz erstellen"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = PREHEAT_1_LABEL _UxGT(" Netz erstellen"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = PREHEAT_2_LABEL _UxGT(" Netz erstellen"); + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Netz erstellen kalt"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Netzhöhe einst."); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Höhe"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Netz validieren"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = PREHEAT_1_LABEL _UxGT(" Netz validieren"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = PREHEAT_2_LABEL _UxGT(" Netz validieren"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Eig. Netz validieren"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Heating Nozzle"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 heizt Bett"); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Feste Länge Prime"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Priming fertig"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 abgebrochen"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("G26 verlassen"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Netzerst. forts."); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Netz-Nivellierung"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-Punkt-Nivell."); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Gitternetz-Nivell."); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Netz nivellieren"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Eckpunkte"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Kartentyp"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Karte ausgeben"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Ausgabe für Host"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Ausgabe für CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Externe Sicherung"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("UBL-Info ausgeben"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Menge an Füllung"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Manuelles Füllen"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Cleveres Füllen"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Netz Füllen"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Alles annullieren"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Nächstlieg. ann."); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Feineinst. Alles"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Feineinst. Nächstl."); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Netz-Speicherplatz"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Speicherort"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Bettnetz laden"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Bettnetz speichern"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Netz %i geladen"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Netz %i gespeichert"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Kein Speicher"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Err:UBL speichern"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Err:UBL wiederherst."); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Versatz: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Versatz angehalten"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Schrittweises UBL"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Netz erstellen kalt"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Cleveres Füllen"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Netz validieren"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Feineinst. Alles"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Netz validieren"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Feineinst. Alles"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Bettnetz speichern"); -#define MSG_MOVING _UxGT("In Bewegung...") -#define MSG_FREE_XY _UxGT("Abstand XY") -#define MSG_MOVE_X _UxGT("Bewege X") -#define MSG_MOVE_Y _UxGT("Bewege Y") -#define MSG_MOVE_Z _UxGT("Bewege Z") -#define MSG_MOVE_E _UxGT("Bewege Extruder") -#define MSG_HOTEND_TOO_COLD _UxGT("Hotend zu kalt") -#define MSG_MOVE_0025MM _UxGT(" 0,025 mm") -#define MSG_MOVE_01MM _UxGT(" 0,1 mm") -#define MSG_MOVE_1MM _UxGT(" 1,0 mm") -#define MSG_MOVE_10MM _UxGT("10,0 mm") -#define MSG_SPEED _UxGT("Geschw.") -#define MSG_BED_Z _UxGT("Bett Z") -#define MSG_NOZZLE _UxGT("Düse") -#define MSG_BED _UxGT("Bett") -#define MSG_CHAMBER _UxGT("Gehäuse") -#define MSG_FAN_SPEED _UxGT("Lüfter") -#define MSG_EXTRA_FAN_SPEED _UxGT("Geschw. Extralüfter") -#define MSG_FLOW _UxGT("Flussrate") -#define MSG_CONTROL _UxGT("Einstellungen") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Faktor") -#define MSG_AUTOTEMP _UxGT("Auto Temperatur") -#define MSG_LCD_ON _UxGT("Ein") -#define MSG_LCD_OFF _UxGT("Aus") -#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("Auswählen") -#define MSG_ACC _UxGT("Beschleunigung") -#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_VE_JERK _UxGT("V E Jerk") -#define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") -#define MSG_VELOCITY _UxGT("Geschwindigkeit") -#define MSG_VMAX _UxGT("V max ") // space intentional -#define MSG_VMIN _UxGT("V min ") -#define MSG_VTRAV_MIN _UxGT("V min Leerfahrt") -#define MSG_ACCELERATION _UxGT("Beschleunigung") -#define MSG_AMAX _UxGT("A max ") // space intentional -#define MSG_A_RETRACT _UxGT("A Einzug") -#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_ESTEPS _UxGT("E Steps/mm") -#define MSG_E1STEPS _UxGT("E1 Steps/mm") -#define MSG_E2STEPS _UxGT("E2 Steps/mm") -#define MSG_E3STEPS _UxGT("E3 Steps/mm") -#define MSG_E4STEPS _UxGT("E4 Steps/mm") -#define MSG_E5STEPS _UxGT("E5 Steps/mm") -#define MSG_E6STEPS _UxGT("E6 Steps/mm") -#define MSG_TEMPERATURE _UxGT("Temperatur") -#define MSG_MOTION _UxGT("Bewegung") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") -#define MSG_FILAMENT_DIAM _UxGT("Filamentdurchmesser") -#define MSG_FILAMENT_UNLOAD _UxGT("Entladen mm") -#define MSG_FILAMENT_LOAD _UxGT("Laden mm") -#define MSG_ADVANCE_K _UxGT("Vorschubfaktor") -#define MSG_CONTRAST _UxGT("LCD-Kontrast") -#define MSG_STORE_EEPROM _UxGT("Konfig. speichern") -#define MSG_LOAD_EEPROM _UxGT("Konfig. laden") -#define MSG_RESTORE_FAILSAFE _UxGT("Standardwerte laden") -#define MSG_INIT_EEPROM _UxGT("Werkseinstellungen") -#define MSG_SD_UPDATE _UxGT("SD-Firmware-Update") -#define MSG_RESET_PRINTER _UxGT("Drucker neustarten") -#define MSG_REFRESH _UxGT("Aktualisieren") -#define MSG_WATCH _UxGT("Info") -#define MSG_PREPARE _UxGT("Vorbereitung") -#define MSG_TUNE _UxGT("Justierung") -#define MSG_START_PRINT _UxGT("Starte Druck") -#define MSG_BUTTON_NEXT _UxGT("Weiter") -#define MSG_BUTTON_INIT _UxGT("Init") -#define MSG_BUTTON_STOP _UxGT("Stop") -#define MSG_BUTTON_PRINT _UxGT("Drucken") -#define MSG_BUTTON_RESET _UxGT("Zurücksetzen") -#define MSG_BUTTON_CANCEL _UxGT("Abbrechen") -#define MSG_BUTTON_DONE _UxGT("Fertig") -#define MSG_PAUSE_PRINT _UxGT("SD-Druck pausieren") -#define MSG_RESUME_PRINT _UxGT("SD-Druck fortsetzen") -#define MSG_STOP_PRINT _UxGT("SD-Druck abbrechen") -#define MSG_OUTAGE_RECOVERY _UxGT("Wiederh. n. Stroma.") -#define MSG_CARD_MENU _UxGT("Druck v. SD-Karte") -#define MSG_NO_CARD _UxGT("Keine SD-Karte") -#define MSG_DWELL _UxGT("Warten...") -#define MSG_USERWAIT _UxGT("Klick zum Fortsetzen") -#define MSG_PRINT_PAUSED _UxGT("Druck pausiert...") -#define MSG_PRINTING _UxGT("Druckt...") -#define MSG_PRINT_ABORTED _UxGT("Druck abgebrochen") -#define MSG_NO_MOVE _UxGT("Motoren angeschaltet") -#define MSG_KILLED _UxGT("ABGEBROCHEN") -#define MSG_STOPPED _UxGT("ANGEHALTEN") -#define MSG_CONTROL_RETRACT _UxGT("Einzug mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Wechs. Einzug mm") -#define MSG_CONTROL_RETRACTF _UxGT("Einzug V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Z-Sprung mm") -#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. Einzug") -#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Einzugslänge") -#define MSG_TOOL_CHANGE _UxGT("Werkzeugwechsel") -#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Z anheben") -#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Prime-Geschwin.") -#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Einzug-Geschwin.") -#define MSG_NOZZLE_STANDBY _UxGT("Düsen-Standby") -#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 initial.") // Manually initialize the SD-card via user interface -#define MSG_CHANGE_SDCARD _UxGT("SD-Karte getauscht") // SD-card changed by user. For machines with no autocarddetect. Both send "M21" -#define MSG_RELEASE_SDCARD _UxGT("SD-Karte freigeben") // if Marlin gets confused - M22 -#define MSG_ZPROBE_OUT _UxGT("Z-Sonde außerhalb") -#define MSG_SKEW_FACTOR _UxGT("Korrekturfaktor") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Selbsttest") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch zurücks.") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch ausfahren") -#define MSG_BLTOUCH_SW_MODE _UxGT("BLTouch SW-Modus") -#define MSG_BLTOUCH_5V_MODE _UxGT("BLTouch 5V-Modus") -#define MSG_BLTOUCH_OD_MODE _UxGT("BLTouch OD-Modus") -#define MSG_BLTOUCH_MODE_STORE _UxGT("BLTouch Mode Store") -#define MSG_BLTOUCH_MODE_STORE_5V _UxGT("BLTouch auf 5V") -#define MSG_BLTOUCH_MODE_STORE_OD _UxGT("BLTouch auf OD") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch einfahren") -#define MSG_BLTOUCH_MODE_ECHO _UxGT("BLTouch Modus: ") -#define MSG_BLTOUCH_MODE_CHANGE _UxGT("ACHTUNG: Falsche Einstellung - kann zu Beschädigung führen! Fortfahren?") -#define MSG_TOUCHMI_PROBE _UxGT("TouchMI") -#define MSG_TOUCHMI_INIT _UxGT("TouchMI initial.") -#define MSG_TOUCHMI_ZTEST _UxGT("Test Z-Versatz") -#define MSG_TOUCHMI_SAVE _UxGT("Speichern") -#define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("TouchMI ausfahren") -#define MSG_MANUAL_DEPLOY _UxGT("Z-Sonde ausfahren") -#define MSG_MANUAL_STOW _UxGT("Z-Sonde einfahren") -#define MSG_HOME _UxGT("Vorher") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("homen") -#define MSG_ZPROBE_ZOFFSET _UxGT("Sondenversatz Z") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_BABYSTEP_TOTAL _UxGT("Total") -#define MSG_ENDSTOP_ABORT _UxGT("Endstopp Abbr.") -#define MSG_HEATING_FAILED_LCD _UxGT("HEIZEN ERFOLGLOS") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Bett heizen fehlge.") -#define MSG_HEATING_FAILED_LCD_CHAMBER _UxGT("Geh. heizen fehlge.") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEMP-ABWEI.") -#define MSG_THERMAL_RUNAWAY LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("BETT") MSG_THERMAL_RUNAWAY -#define MSG_THERMAL_RUNAWAY_CHAMBER _UxGT("GEH.") 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_MAXTEMP_CHAMBER _UxGT("Err:Gehäuse max Temp") -#define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err:Gehäuse min Temp") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("DRUCKER STOPP") -#define MSG_PLEASE_RESET _UxGT("Bitte neustarten") -#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_COOLING _UxGT("Extr. kühlt...") -#define MSG_BED_HEATING _UxGT("Bett heizt...") -#define MSG_BED_COOLING _UxGT("Bett kühlt...") -#define MSG_CHAMBER_HEATING _UxGT("Gehäuse heizt...") -#define MSG_CHAMBER_COOLING _UxGT("Gehäuse kühlt...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta kalibrieren") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriere X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriere Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibriere Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibriere Mitte") -#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_Z_OFFSET_CALIBRATE _UxGT("Sondenversatz Z") -#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") -#define MSG_LINEAR_LEVELING _UxGT("Lineare Nivellierung") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineare Nivell.") -#define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Netz-Nivellierung") -#define MSG_INFO_STATS_MENU _UxGT("Drucker-Statistik") -#define MSG_INFO_BOARD_MENU _UxGT("Board-Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistoren") -#define MSG_INFO_EXTRUDERS _UxGT("Extruder") -#define MSG_INFO_BAUDRATE _UxGT("Baudrate") -#define MSG_INFO_PROTOCOL _UxGT("Protokoll") -#define MSG_CASE_LIGHT _UxGT("Beleuchtung") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Helligkeit") + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Licht-Steuerung"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Licht"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Licht-Einstellung"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Rot"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Orange"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Gelb"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Grün"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Blau"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violett"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Weiß"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Standard"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Benutzerdefiniert"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensität Rot"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensität Grün"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensität Blau"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensität Weiß"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Helligkeit"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Gesamte Drucke") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Komplette Drucke") - #define MSG_INFO_PRINT_TIME _UxGT("Gesamte Druckzeit") - #define MSG_INFO_PRINT_LONGEST _UxGT("Längste Druckzeit") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Gesamt Extrudiert") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Drucke") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Komplette") - #define MSG_INFO_PRINT_TIME _UxGT("Gesamte") - #define MSG_INFO_PRINT_LONGEST _UxGT("Längste") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrud.") -#endif + PROGMEM Language_Str MSG_MOVING = _UxGT("In Bewegung..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Abstand XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Bewege X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Bewege Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Bewege Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Bewege Extruder"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Bewege Extruder *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend zu kalt"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT(" %s mm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT(" 0,1 mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT(" 1,0 mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("10,0 mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Geschw."); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Bett Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Düse"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Düse ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Bett"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Gehäuse"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Lüfter"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Lüfter ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Geschw. Extralüfter"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Geschw. Extralüfter ~"); + PROGMEM Language_Str MSG_FLOW = _UxGT("Flussrate"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flussrate ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Einstellungen"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Faktor"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto Temperatur"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("an"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("aus"); + PROGMEM Language_Str MSG_PID_P = _UxGT("PID P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Auswählen"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Auswählen *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Beschleunigung"); + PROGMEM Language_Str MSG_JERK = _UxGT("Jerk"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V ") LCD_STR_A _UxGT(" Jerk"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V ") LCD_STR_B _UxGT(" Jerk"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V ") LCD_STR_C _UxGT(" Jerk"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("V E Jerk"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Geschwindigkeit"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("V max ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("V max ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("V max ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("V max ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("V max *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("V min "); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("V min Leerfahrt"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Beschleunigung"); + PROGMEM Language_Str MSG_AMAX = _UxGT("A max "); // space intentional + PROGMEM Language_Str MSG_AMAX_A = _UxGT("A max ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("A max ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("A max ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("A max ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("A max *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A Einzug"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A Leerfahrt"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Steps/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" Steps/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" Steps/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" Steps/mm"); + PROGMEM Language_Str MSG_E_STEPS = LCD_STR_E _UxGT(" Steps/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* Steps/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatur"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Bewegung"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Filamentdurchmesser"); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Filamentdurchmesser *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Entladen mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Laden mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Vorschubfaktor"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Vorschubfaktor *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD-Kontrast"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Konfig. speichern"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Konfig. laden"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Standardwerte laden"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Werkseinstellungen"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("FW Update vom Medium"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Drucker neustarten"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aktualisieren"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Info"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Vorbereitung"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Justierung"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Starte Druck"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Weiter"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Bestätigen"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Drucken"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reseten"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Abbrechen"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Fertig"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("SD-Druck pausieren"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("SD-Druck fortsetzen"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("SD-Druck abbrechen"); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Wiederh. n. Stroma."); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Druck vom Medium"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Kein Medium"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Warten..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Klick zum Fortsetzen"); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Druck pausiert..."); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Druckt..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Druck abgebrochen"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Motoren angeschaltet"); + PROGMEM Language_Str MSG_KILLED = _UxGT("ABGEBROCHEN"); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ANGEHALTEN"); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Einzug mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Wechs. Einzug mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("V Einzug"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Z-Sprung mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Wechs. UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Autom. Einzug"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Einzugslänge"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Entladelänge"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Werkzeugwechsel"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z anheben"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Prime-Geschwin."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Einzug-Geschwin."); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Düsen-Standby"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Filament wechseln"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Filament wechseln *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Filament laden"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Filament laden *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Filament entladen"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Filament entladen *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Alles entladen"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Medium initial."); // Manually initialize the SD-card via user interface + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Medium getauscht"); // SD-card changed by user. For machines with no autocarddetect. Both send "M21" + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Medium freigeben"); // if Marlin gets confused - M22 + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z-Sonde außerhalb"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Korrekturfaktor"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Selbsttest"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("BLTouch zurücks."); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch ausfahren"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("BLTouch SW-Modus"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("BLTouch 5V-Modus"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("BLTouch OD-Modus"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("BLTouch Mode Store"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("BLTouch auf 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("BLTouch auf OD"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("BLTouch einfahren"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("BLTouch Modus: "); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("ACHTUNG: Falsche Einstellung - kann zu Beschädigung führen! Fortfahren?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("TouchMI initial."); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test Z-Versatz"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Speichern"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI ausfahren"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Z-Sonde ausfahren"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Z-Sonde einfahren"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Vorher %s%s%s homen"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Sondenversatz Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Abbr. mit Endstopp"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("HEIZEN ERFOLGLOS"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Bett heizen fehlge."); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Geh. heizen fehlge."); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("REDUND. TEMP-ABWEI."); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("BETT") " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("GEH.") " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = " " LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN"); + PROGMEM Language_Str MSG_ERR_MINTEMP = " " LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err:Gehäuse max Temp"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err:Gehäuse min Temp"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Vorher XY homen"); + PROGMEM Language_Str MSG_HALTED = _UxGT("DRUCKER GESTOPPT"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Bitte neustarten"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("t"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("heizt..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("kühlt..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Bett heizt..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Bett kühlt..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Gehäuse heizt..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Gehäuse kühlt..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta kalibrieren"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibriere X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibriere Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibriere Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibriere Mitte"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta Einst. anzeig."); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Autom. Kalibrierung"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Höhe setzen"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Sondenversatz Z"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Höhe"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Radius"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Über den Drucker"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Drucker-Info"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Punkt-Nivellierung"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Lineare Nivellierung"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilineare Nivell."); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Netz-Nivellierung"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Drucker-Statistik"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Board-Info"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistoren"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruder"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudrate"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokoll"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Beleuchtung"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Helligkeit"); -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Netzteil") -#define MSG_DRIVE_STRENGTH _UxGT("Motorleistung") -#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_OPTION_HEADER _UxGT("FORTS. OPTIONEN:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Mehr entladen") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Druck weiter") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Düse: ") -#define MSG_RUNOUT_SENSOR _UxGT("Runout-Sensor") -#define MSG_RUNOUT_DISTANCE_MM _UxGT("Runout-Weg mm") -#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") + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Falscher Drucker"); -#define MSG_MMU2_FILAMENT_CHANGE_HEADER _UxGT("FILAMENT WECHSEL") -#define MSG_MMU2_CHOOSE_FILAMENT_HEADER _UxGT("FILAMENT WÄHLEN") -#define MSG_MMU2_MENU _UxGT("MMU") -#define MSG_MMU2_WRONG_FIRMWARE _UxGT("Update MMU Firmware!") -#define MSG_MMU2_NOT_RESPONDING _UxGT("MMU handeln erfor.") -#define MSG_MMU2_RESUME _UxGT("Druck fortsetzen") -#define MSG_MMU2_RESUMING _UxGT("Fortfahren...") -#define MSG_MMU2_LOAD_FILAMENT MSG_FILAMENTLOAD -#define MSG_MMU2_LOAD_ALL _UxGT("Lade alle") -#define MSG_MMU2_LOAD_TO_NOZZLE _UxGT("Düse laden") -#define MSG_MMU2_EJECT_FILAMENT _UxGT("Filament auswerfen") -#define MSG_MMU2_EJECT_FILAMENT0 _UxGT("Filament 1 auswerfen") -#define MSG_MMU2_EJECT_FILAMENT1 _UxGT("Filament 2 auswerfen") -#define MSG_MMU2_EJECT_FILAMENT2 _UxGT("Filament 3 auswerfen") -#define MSG_MMU2_EJECT_FILAMENT3 _UxGT("Filament 4 auswerfen") -#define MSG_MMU2_EJECT_FILAMENT4 _UxGT("Filament 5 auswerfen") -#define MSG_MMU2_UNLOAD_FILAMENT MSG_FILAMENTUNLOAD -#define MSG_MMU2_LOADING_FILAMENT _UxGT("Lade Fila. %i...") -#define MSG_MMU2_EJECTING_FILAMENT _UxGT("Fila. auswerfen...") -#define MSG_MMU2_UNLOADING_FILAMENT _UxGT("Fila. entladen...") -#define MSG_MMU2_ALL _UxGT("Alle") -#define MSG_MMU2_FILAMENT0 _UxGT("Filament 1") -#define MSG_MMU2_FILAMENT1 _UxGT("Filament 2") -#define MSG_MMU2_FILAMENT2 _UxGT("Filament 3") -#define MSG_MMU2_FILAMENT3 _UxGT("Filament 4") -#define MSG_MMU2_FILAMENT4 _UxGT("Filament 5") -#define MSG_MMU2_RESET _UxGT("setze MMU zurück") -#define MSG_MMU2_RESETTING _UxGT("MMU zurücksetzen...") -#define MSG_MMU2_EJECT_RECOVER _UxGT("Entfernen, klicken") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Gesamte Drucke"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette Drucke"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Gesamte Druckzeit"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Längste Druckzeit"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Gesamt Extrudiert"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Drucke"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Gesamte"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Längste"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrud."); + #endif -#define MSG_MIX _UxGT("Mix") -#define MSG_MIX_COMPONENT _UxGT("Komponente") -#define MSG_MIXER _UxGT("Mixer") -#define MSG_GRADIENT _UxGT("Gradient") // equal Farbverlauf -#define MSG_FULL_GRADIENT _UxGT("Volle Gradient") -#define MSG_TOGGLE_MIX _UxGT("Mix umschalten") -#define MSG_CYCLE_MIX _UxGT("Zyklus Mix") -#define MSG_GRADIENT_MIX _UxGT("Gradient Mix") -#define MSG_REVERSE_GRADIENT _UxGT("Umgekehrte Gradient") -#define MSG_ACTIVE_VTOOL _UxGT("Aktives V-Tool") -#define MSG_START_VTOOL _UxGT("V-Tool Start") -#define MSG_END_VTOOL _UxGT("V-Tool Ende") -#define MSG_GRADIENT_ALIAS _UxGT("V-Tool Alias") -#define MSG_RESET_VTOOLS _UxGT("V-Tools Reseten") -#define MSG_COMMIT_VTOOL _UxGT("V-Tool Mix sichern") -#define MSG_VTOOLS_RESET _UxGT("V-Tools ist resetet") -#define MSG_START_Z _UxGT("Z Start") -#define MSG_END_Z _UxGT("Z Ende") -#define MSG_BRICKOUT _UxGT("Brickout") -#define MSG_INVADERS _UxGT("Invaders") -#define MSG_SNAKE _UxGT("Sn4k3") -#define MSG_MAZE _UxGT("Maze") + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Netzteil"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Motorleistung"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Treiber %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Treiber %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Treiber %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Treiber %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC Verbindungsfehler"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Werte speichern"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT WECHSEL"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("DRUCK PAUSIERT"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("FILAMENT LADEN"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("FILAMENT ENTLADEN"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("FORTS. OPTIONEN:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Mehr entladen"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Druck weiter"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Düse: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Runout-Sensor"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout-Weg mm"); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Homing gescheitert"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Probing gescheitert"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: zu kalt"); -// -// Die Filament-Change-Bildschirme können bis zu 3 Zeilen auf einem 4-Zeilen-Display anzeigen -// ...oder 2 Zeilen auf einem 3-Zeilen-Display. -#if LCD_HEIGHT >= 4 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Knopf drücken um") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("Druck fortzusetzen") - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Druck ist") - #define MSG_PAUSE_PRINT_INIT_2 _UxGT("pausiert...") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Warte auf den") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("Start des") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("Filamentwechsels...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Filament einlegen") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("und Knopf drücken") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("um fortzusetzen") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Knopf drücken um") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Düse aufzuheizen") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Düse heizt auf") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("bitte warten...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("Herausnahme") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("des Filaments...") - #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("Entladen des") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("Filaments...") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Klicke um") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("die Fila-Entladung") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_3 _UxGT("zu beenden") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Warte auf") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("Fortsetzen des") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("Drucks...") -#else // LCD_HEIGHT < 4 - #define MSG_ADVANCED_PAUSE_WAITING_1 MSG_USERWAIT - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Pausiert...") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Bitte warten...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laden und Klick") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klick zum Heizen") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heizen...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Entladen...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Laden...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Entladen...") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Klick zum beenden") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("der Fila-Entladung") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Fortsetzen...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("FILAMENT WÄHLEN"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Update MMU Firmware!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU handeln erfor."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Druck fortsetzen"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Fortfahren..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Filament laden"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Lade alle"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Düse laden"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Filament auswerfen"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Filament ~ auswerfen"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Filament entladen "); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Lade Fila. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Fila. auswerfen..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Fila. entladen..."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Alle"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("setze MMU zurück"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("MMU zurücksetzen..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Entfernen, klicken"); -#define MSG_TMC_DRIVERS _UxGT("TMC Treiber") // Max length 18 characters -#define MSG_TMC_CURRENT _UxGT("Treiber Strom") -#define MSG_TMC_HYBRID_THRS _UxGT("Hybrid threshold") -#define MSG_TMC_HOMING_THRS _UxGT("Sensorloses Homing") -#define MSG_TMC_STEPPING_MODE _UxGT("Schrittmodus") -#define MSG_TMC_STEALTH_ENABLED _UxGT("StealthChop einsch.") -#define MSG_SERVICE_RESET _UxGT("Reset") -#define MSG_SERVICE_IN _UxGT(" im:") -#define MSG_BACKLASH _UxGT("Spiel") -#define MSG_BACKLASH_CORRECTION _UxGT("Korrektur") -#define MSG_BACKLASH_SMOOTHING _UxGT("Glätten") + PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Komponente ~"); + PROGMEM Language_Str MSG_MIXER = _UxGT("Mixer"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); // equal Farbverlauf + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Volle Gradient"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Mix umschalten"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Zyklus Mix"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradient Mix"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Umgekehrte Gradient"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktives V-Tool"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("V-Tool Start"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("V-Tool Ende"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("V-Tool Alias"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("V-Tools Reseten"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("V-Tool Mix sichern"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-Tools ist resetet"); + PROGMEM Language_Str MSG_START_Z = _UxGT("Z Start:"); + PROGMEM Language_Str MSG_END_Z = _UxGT("Z Ende:"); + PROGMEM Language_Str MSG_GAMES = _UxGT("Spiele"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); + + // + // Die Filament-Change-Bildschirme können bis zu 3 Zeilen auf einem 4-Zeilen-Display anzeigen + // ...oder 2 Zeilen auf einem 3-Zeilen-Display. + #if LCD_HEIGHT >= 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Knopf drücken um", "Druck fortzusetzen")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_2_LINE("Druck ist", "pausiert...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Warte auf den", "Start des", "Filamentwechsels...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Filament einlegen", "und Knopf drücken", "um fortzusetzen")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Knopf drücken um", "Düse aufzuheizen")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Düse heizt auf", "bitte warten...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Warte auf", "Herausnahme", "des Filaments...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Warte auf", "Laden des", "Filaments...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Warte auf", "Entladen des", "Filaments...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Klicke um", "die Fila-Entladung", "zu beenden")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Warte auf", "Fortsetzen des", "Drucks...")); + #else // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Klick zum Fortsetzen")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Pausiert...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Bitte warten...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Laden und Klick")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Klick zum Heizen")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Heizen...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Entladen...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Laden...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Entladen...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Klick zum beenden", "der Fila-Entladung")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Fortsetzen...")); + #endif // LCD_HEIGHT < 4 + + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC Treiber"); // Max length 18 characters + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Treiber Strom"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybrid threshold"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Sensorloses Homing"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Schrittmodus"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop einsch."); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" im:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Spiel"); + PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; + PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; + PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Korrektur"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Glätten"); +} diff --git a/Marlin/src/lcd/language/language_el-gr.h b/Marlin/src/lcd/language/language_el-gr.h deleted file mode 100644 index 5f8f5d5f998a..000000000000 --- a/Marlin/src/lcd/language/language_el-gr.h +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -/** - * Greek (Greece) - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#define DISPLAY_CHARSET_ISO10646_GREEK -#define CHARSIZE 2 - -#define WELCOME_MSG MACHINE_NAME _UxGT(" έτοιμο.") -#define MSG_SD_INSERTED _UxGT("Εισαγωγή κάρτας") -#define MSG_SD_REMOVED _UxGT("Αφαίρεση κάρτας") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Βασική Οθόνη") -#define MSG_AUTOSTART _UxGT("Αυτόματη εκκίνηση") -#define MSG_DISABLE_STEPPERS _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_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_SET_HOME_OFFSETS _UxGT("Ορισμός βασικών μετατοπίσεων") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Εφαρμόστηκαν οι μετατοπίσεις") -#define MSG_SET_ORIGIN _UxGT("Ορισμός προέλευσης") -#define MSG_PREHEAT_1 _UxGT("Προθέρμανση " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL 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("Προθέρμανση " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" όλα") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#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_EXTRUDE _UxGT("Εξώθηση") -#define MSG_RETRACT _UxGT("Ανάσυρση") -#define MSG_MOVE_AXIS _UxGT("Μετακίνηση άξονα") -#define MSG_BED_LEVELING _UxGT("Επιπεδοποίηση κλίνης") -#define MSG_LEVEL_BED _UxGT("Επιπεδοποίηση κλίνης") -#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_0025MM _UxGT("Μετακίνηση 0,025 μμ") -#define MSG_MOVE_01MM _UxGT("Μετακίνηση 0,1 μμ") -#define MSG_MOVE_1MM _UxGT("Μετακίνηση 1 μμ") -#define MSG_MOVE_10MM _UxGT("Μετακίνηση 10 μμ") -#define MSG_SPEED _UxGT("Ταχύτητα") -#define MSG_BED_Z _UxGT("Κλίνη Z") -#define MSG_NOZZLE _UxGT("Ακροφύσιο") -#define MSG_BED _UxGT("Κλίνη") -#define MSG_FAN_SPEED _UxGT("Ταχύτητα ανεμιστήρα") -#define MSG_FLOW _UxGT("Ροή") -#define MSG_CONTROL _UxGT("Έλεγχος") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Αυτομ. ρύθμιση θερμοκρασίας") -#define MSG_LCD_ON _UxGT("Ενεργοποιημένο") -#define MSG_LCD_OFF _UxGT("Απενεργοποιημένο") -#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_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_VMAX _UxGT("Vμεγ ") -#define MSG_VMIN _UxGT("Vελαχ") -#define MSG_VTRAV_MIN _UxGT("Vελάχ. μετατόπιση") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Aμεγ ") -#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_ESTEPS _UxGT("Bήματα Ε ανά μμ") -#define MSG_E1STEPS _UxGT("Bήματα Ε1 ανά μμ") -#define MSG_E2STEPS _UxGT("Bήματα Ε2 ανά μμ") -#define MSG_E3STEPS _UxGT("Bήματα Ε3 ανά μμ") -#define MSG_E4STEPS _UxGT("Bήματα Ε4 ανά μμ") -#define MSG_E5STEPS _UxGT("Bήματα Ε5 ανά μμ") -#define MSG_TEMPERATURE _UxGT("Θερμοκρασία") -#define MSG_MOTION _UxGT("Κίνηση") -#define MSG_FILAMENT _UxGT("Νήμα") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Ε σε μμ3") -#define MSG_FILAMENT_DIAM _UxGT("Διάμετρος νήματος") -#define MSG_CONTRAST _UxGT("Κοντράστ LCD") -#define MSG_STORE_EEPROM _UxGT("Αποθήκευση") -#define MSG_LOAD_EEPROM _UxGT("Φόρτωση") -#define MSG_RESTORE_FAILSAFE _UxGT("Επαναφορά ασφαλούς αντιγράφου") -#define MSG_REFRESH _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_DWELL _UxGT("Αναστολή λειτουργίας…") -#define MSG_USERWAIT _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_CONTROL_RETRACTF _UxGT("Ανάσυρση V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Μεταπήδηση μμ") -#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_AUTORETRACT _UxGT("Αυτόματη ανάσυρση") -#define MSG_FILAMENTCHANGE _UxGT("Αλλαγή νήματος") -#define MSG_INIT_SDCARD _UxGT("Προετοιμασία κάρτας SD") -#define MSG_CHANGE_SDCARD _UxGT("Αλλαγή κάρτας SD") -#define MSG_ZPROBE_OUT _UxGT("Διερεύνηση Z εκτός κλίνης") -#define MSG_YX_UNHOMED _UxGT("Επαναφορά Χ/Υ πριν από Ζ") -#define MSG_XYZ_UNHOMED _UxGT("Επαναφορά ΧΥΖ πρώτα") -#define MSG_ZPROBE_ZOFFSET _UxGT("Μετατόπιση Ζ") -#define MSG_BABYSTEP_X _UxGT("Μικρό βήμα Χ") -#define MSG_BABYSTEP_Y _UxGT("Μικρό βήμα Υ") -#define MSG_BABYSTEP_Z _UxGT("Μικρό βήμα Ζ") -#define MSG_ENDSTOP_ABORT _UxGT("Ματαίωση endstop ") -#define MSG_HEATING_FAILED_LCD _UxGT("Ανεπιτυχής θέρμανση") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Λάθος: ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ") -#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_HEATING _UxGT("Θερμαίνεται…") -#define MSG_BED_HEATING _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("Βαθμονόμηση κέντρου") diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 7a846c614eb1..8f95cf63e0bf 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -30,159 +30,163 @@ */ #define DISPLAY_CHARSET_ISO10646_GREEK -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" έτοιμο.") -#define MSG_SD_INSERTED _UxGT("Εισαγωγή κάρτας") -#define MSG_SD_REMOVED _UxGT("Αφαίρεση κάρτας") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Βασική Οθόνη") -#define MSG_AUTOSTART _UxGT("Αυτόματη εκκίνηση") -#define MSG_DISABLE_STEPPERS _UxGT("Απενεργοποίηση Μοτέρ") -#define MSG_AUTO_HOME _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο") //SHORTEN -#define MSG_AUTO_HOME_X _UxGT("Αρχικό σημείο X") -#define MSG_AUTO_HOME_Y _UxGT("Αρχικό σημείο Y") -#define MSG_AUTO_HOME_Z _UxGT("Αρχικό σημείο Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Επαναφορά Επ. Εκτύπωσης") //SHORTEN -#define MSG_LEVEL_BED_WAITING _UxGT("Επιπεδοποίηση επ. Εκτύπωσης περιμενει") //SHORTEN -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Επόμενο σημείο") -#define MSG_LEVEL_BED_DONE _UxGT("Ολοκλήρωση επιπεδοποίησης!") //SHORTEN -#define MSG_SET_HOME_OFFSETS _UxGT("Ορισμός βασικών μετατοπίσεων") //SHORTEN -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Εφαρμόστηκαν οι μετατοπίσεις") //SHORTEN -#define MSG_SET_ORIGIN _UxGT("Ορισμός προέλευσης") -#define MSG_PREHEAT_1 _UxGT("Προθέρμανση " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" όλα") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" bed") //SHORTEN -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" επιβεβαίωση") //SHORTEN -#define MSG_PREHEAT_2 _UxGT("Προθέρμανση " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" όλα") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" bed") //SHORTEN -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" επιβεβαίωση") //SHORTEN -#define MSG_COOLDOWN _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("Επιπεδοποίηση Επ. Εκτύπωσης") //SHORTEN -#define MSG_LEVEL_BED _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης") //SHORTEN -#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_0025MM _UxGT("Μετακίνηση 0,025 μμ") -#define MSG_MOVE_01MM _UxGT("Μετακίνηση 0,1 μμ") -#define MSG_MOVE_1MM _UxGT("Μετακίνηση 1 μμ") -#define MSG_MOVE_10MM _UxGT("Μετακίνηση 10 μμ") -#define MSG_SPEED _UxGT("Ταχύτητα") -#define MSG_BED_Z _UxGT("Επ. Εκτύπωσης Z") -#define MSG_NOZZLE _UxGT("Ακροφύσιο") -#define MSG_BED _UxGT("Κλίνη") -#define MSG_FAN_SPEED _UxGT("Ταχύτητα ανεμιστήρα") -#define MSG_FLOW _UxGT("Ροή") -#define MSG_CONTROL _UxGT("Έλεγχος") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Αυτομ ρύθμιση θερ/σίας") //SHORTEN -#define MSG_LCD_ON _UxGT("Ενεργοποιημένο") -#define MSG_LCD_OFF _UxGT("Απενεργοποιημένο") -#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_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_VMAX _UxGT("V Μέγιστο") -#define MSG_VMIN _UxGT("V Ελάχιστο") -#define MSG_VTRAV_MIN _UxGT("Vελάχ. μετατόπιση") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Aμεγ ") -#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_ESTEPS _UxGT("Bήματα Ε ανά μμ") -#define MSG_E1STEPS _UxGT("Bήματα Ε1 ανά μμ") -#define MSG_E2STEPS _UxGT("Bήματα Ε2 ανά μμ") -#define MSG_E3STEPS _UxGT("Bήματα Ε3 ανά μμ") -#define MSG_E4STEPS _UxGT("Bήματα Ε4 ανά μμ") -#define MSG_E5STEPS _UxGT("Bήματα Ε5 ανά μμ") -#define MSG_TEMPERATURE _UxGT("Θερμοκρασία") -#define MSG_MOTION _UxGT("Κίνηση") -#define MSG_FILAMENT _UxGT("Νήμα") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Ε σε μμ3") -#define MSG_FILAMENT_DIAM _UxGT("Διάμετρος νήματος") -#define MSG_CONTRAST _UxGT("Κοντράστ LCD") -#define MSG_STORE_EEPROM _UxGT("Αποθήκευση") -#define MSG_LOAD_EEPROM _UxGT("Φόρτωση") -#define MSG_RESTORE_FAILSAFE _UxGT("Επαναφορά ασφαλούς αντιγράφου") //SHORTEN -#define MSG_REFRESH _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_DWELL _UxGT("Αναστολή λειτουργίας") -#define MSG_USERWAIT _UxGT("Αναμονή για χρήστη") -#define MSG_PRINT_ABORTED _UxGT("Διακόπτεται η εκτύπωση") //SHORTEN -#define MSG_NO_MOVE _UxGT("Καμία κίνηση.") -#define MSG_KILLED _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. ") -#define MSG_STOPPED _UxGT("ΔΙΑΚΟΠΗ. ") -#define MSG_CONTROL_RETRACT _UxGT("Ανάσυρση μμ") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Εναλλαγή ανάσυρσης μμ") //SHORTEN -#define MSG_CONTROL_RETRACTF _UxGT("Ανάσυρση V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Μεταπήδηση μμ") -#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_AUTORETRACT _UxGT("Αυτόματη ανάσυρση") -#define MSG_FILAMENTCHANGE _UxGT("Αλλαγή νήματος") -#define MSG_INIT_SDCARD _UxGT("Προετοιμασία κάρτας SD") //SHORTEN -#define MSG_CHANGE_SDCARD _UxGT("Αλλαγή κάρτας SD") -#define MSG_ZPROBE_OUT _UxGT("Διερεύνηση Z εκτός Επ.Εκτύπωσης") //SHORTEN -#define MSG_YX_UNHOMED _UxGT("Επαναφορά Χ/Υ πριν από Ζ") //SHORTEN -#define MSG_XYZ_UNHOMED _UxGT("Επαναφορά ΧΥΖ πρώτα") -#define MSG_ZPROBE_ZOFFSET _UxGT("Μετατόπιση Ζ") -#define MSG_BABYSTEP_X _UxGT("Μικρό βήμα Χ") -#define MSG_BABYSTEP_Y _UxGT("Μικρό βήμα Υ") -#define MSG_BABYSTEP_Z _UxGT("Μικρό βήμα Ζ") -#define MSG_ENDSTOP_ABORT _UxGT("Ακύρωση endstop ") -#define MSG_HEATING_FAILED_LCD _UxGT("Ανεπιτυχής θέρμανση") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ") -#define MSG_THERMAL_RUNAWAY _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΚΡΑΣΙΑΣ") -#define MSG_ERR_MAXTEMP _UxGT("ΠΕΡΙΤΗ ΘΕΡΜΟΚΡΑΣΙΑ") -#define MSG_ERR_MINTEMP _UxGT("ΜΗ ΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑΣ") //SHORTEN -#define MSG_ERR_MAXTEMP_BED _UxGT("ΜΕΓΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ") //SHORTEN -#define MSG_ERR_MINTEMP_BED _UxGT("ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ") //SHORTEN -#define MSG_HALTED _UxGT("H εκτύπωση διακόπηκε") -#define MSG_HEATING _UxGT("Θερμαίνεται…") -#define MSG_BED_HEATING _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("Βαθμονόμηση κέντρου") +namespace Language_el { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Greek"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" έτοιμο."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Εισαγωγή κάρτας"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Αφαίρεση κάρτας"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Βασική Οθόνη"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Αυτόματη εκκίνηση"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Απενεργοποίηση Μοτέρ"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο"); //SHORTEN + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Αρχικό σημείο X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Αρχικό σημείο Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Αρχικό σημείο Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Επαναφορά Επ. Εκτύπωσης"); //SHORTEN + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Επιπεδοποίηση επ. Εκτύπωσης περιμενει"); //SHORTEN + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Επόμενο σημείο"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Ολοκλήρωση επιπεδοποίησης!"); //SHORTEN + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ορισμός βασικών μετατοπίσεων"); //SHORTEN + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Εφαρμόστηκαν οι μετατοπίσεις"); //SHORTEN + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Ορισμός προέλευσης"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" όλα"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" bed"); //SHORTEN + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" επιβεβαίωση"); //SHORTEN + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H0 = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" όλα"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" bed"); //SHORTEN + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" επιβεβαίωση"); //SHORTEN + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Μειωση θερμοκρασιας"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ενεργοποίηση"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Απενεργοποίηση"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Εξώθηση"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Ανάσυρση"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Μετακίνηση άξονα"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης"); //SHORTEN + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Επιπεδοποίηση Επ. Εκτύπωσης"); //SHORTEN + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Μετακίνηση X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Μετακίνηση Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Μετακίνηση Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Εξωθητήρας"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Εξωθητήρας *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Μετακίνηση %s μμ"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Μετακίνηση 0,1 μμ"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Μετακίνηση 1 μμ"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Μετακίνηση 10 μμ"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Ταχύτητα"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Επ. Εκτύπωσης Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Ακροφύσιο"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Κλίνη"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ταχύτητα ανεμιστήρα"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ταχύτητα ανεμιστήρα ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Ροή"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Ροή ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Έλεγχος"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Αυτομ ρύθμιση θερ/σίας"); //SHORTEN + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Ενεργοποιημένο"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Απενεργοποιημένο"); + PROGMEM Language_Str MSG_ACC = _UxGT("Επιτάχυνση"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("Vαντίδραση ") LCD_STR_A; + PROGMEM Language_Str MSG_VB_JERK = _UxGT("Vαντίδραση ") LCD_STR_B; + PROGMEM Language_Str MSG_VC_JERK = _UxGT("Vαντίδραση ") LCD_STR_C; + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Vαντίδραση E"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("V Μέγιστο") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("V Μέγιστο") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("V Μέγιστο") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("V Μέγιστο") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("V Μέγιστο *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("V Ελάχιστο"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vελάχ. μετατόπιση"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Aμεγ ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Aμεγ ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Aμεγ ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Aμεγ ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Aμεγ *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Α-ανάσυρση"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Α-μετατόπιση"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Bήματα ανά μμ"); + PROGMEM Language_Str MSG_A_STEPS = _UxGT("Bήματα ") LCD_STR_A _UxGT(" ανά μμ"); + PROGMEM Language_Str MSG_B_STEPS = _UxGT("Bήματα ") LCD_STR_B _UxGT(" ανά μμ"); + PROGMEM Language_Str MSG_C_STEPS = _UxGT("Bήματα ") LCD_STR_C _UxGT(" ανά μμ"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Bήματα Ε ανά μμ"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("Bήματα * ανά μμ"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Κίνηση"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Νήμα"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ε σε μμ³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Διάμετρος νήματος"); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Διάμετρος νήματος *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Κοντράστ LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Αποθήκευση"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Φόρτωση"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Επαναφορά ασφαλούς αντιγράφου"); //SHORTEN + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ανανέωση"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Οθόνη πληροφόρησης"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Προετοιμασία"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Συντονισμός"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Παύση εκτύπωσης"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Συνέχιση εκτύπωσης"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Διακοπή εκτύπωσης"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Εκτύπωση από SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Δεν βρέθηκε SD"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Αναστολή λειτουργίας"); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Αναμονή για χρήστη"); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Διακόπτεται η εκτύπωση"); //SHORTEN + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Καμία κίνηση."); + PROGMEM Language_Str MSG_KILLED = _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ΔΙΑΚΟΠΗ. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Ανάσυρση μμ"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Εναλλαγή ανάσυρσης μμ"); //SHORTEN + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Ανάσυρση V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Μεταπήδηση μμ"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Αυτόματη ανάσυρση"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Αλλαγή νήματος"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Αλλαγή νήματος *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Προετοιμασία κάρτας SD"); //SHORTEN + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Αλλαγή κάρτας SD"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Διερεύνηση Z εκτός Επ.Εκτύπωσης"); //SHORTEN + PROGMEM Language_Str MSG_YX_UNHOMED = _UxGT("Επαναφορά Χ/Υ πριν από Ζ"); //SHORTEN + PROGMEM Language_Str MSG_XYZ_UNHOMED = _UxGT("Επαναφορά ΧΥΖ πρώτα"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Μετατόπιση Ζ"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Μικρό βήμα Χ"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Μικρό βήμα Υ"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Μικρό βήμα Ζ"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Ακύρωση endstop "); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Ανεπιτυχής θέρμανση"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΚΡΑΣΙΑΣ"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("ΠΕΡΙΤΗ ΘΕΡΜΟΚΡΑΣΙΑ"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("ΜΗ ΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑΣ"); //SHORTEN + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("ΜΕΓΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ"); //SHORTEN + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΚΡΑΣΙΑΣ ΕΠ. ΕΚΤΥΠΩΣΗΣ"); //SHORTEN + PROGMEM Language_Str MSG_HALTED = _UxGT("H εκτύπωση διακόπηκε"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Θερμαίνεται…"); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Θέρμανση ΕΠ. Εκτύπωσης"); //SHORTEN + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Βαθμονόμηση Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Βαθμονόμηση X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Βαθμονόμηση Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Βαθμονόμηση Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Βαθμονόμηση κέντρου"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Εσφαλμένος εκτυπωτής"); +} diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h new file mode 100644 index 000000000000..dc05e356f7f1 --- /dev/null +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -0,0 +1,201 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Greek (Greece) + * + * LCD Menu Messages + * See also http://marlinfw.org/docs/development/lcd_language.html + * + */ + +#define DISPLAY_CHARSET_ISO10646_GREEK + +namespace Language_el_gr { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Greek (Greece)"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" έτοιμο."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Εισαγωγή κάρτας"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Αφαίρεση κάρτας"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("Βασική Οθόνη"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Αυτόματη εκκίνηση"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Απενεργοποίηση βηματιστή"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Αυτομ. επαναφορά στο αρχικό σημείο"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Αρχικό σημείο X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Αρχικό σημείο Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Αρχικό σημείο Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Επαναφορά στο αρχικό σημείο ΧΥΖ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Κάντε κλικ για να ξεκινήσετε"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Επόμενο σημείο"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Ολοκλήρωση επιπεδοποίησης!"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ορισμός βασικών μετατοπίσεων"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Εφαρμόστηκαν οι μετατοπίσεις"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Ορισμός προέλευσης"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" όλα"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" κλίνη"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL _UxGT(" επιβεβαίωση"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" όλα"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" κλίνη"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Προθέρμανση ") PREHEAT_2_LABEL _UxGT(" επιβεβαίωση"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Μειωση θερμοκρασιας"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ενεργοποίηση"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Απενεργοποίηση"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Εξώθηση"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Ανάσυρση"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Μετακίνηση άξονα"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Επιπεδοποίηση κλίνης"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Επιπεδοποίηση κλίνης"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Μετακίνηση X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Μετακίνηση Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Μετακίνηση Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Εξωθητήρας"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Εξωθητήρας *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Μετακίνηση %s μμ"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Μετακίνηση 0,1 μμ"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Μετακίνηση 1 μμ"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Μετακίνηση 10 μμ"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Ταχύτητα"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Κλίνη Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Ακροφύσιο"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Κλίνη"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ταχύτητα ανεμιστήρα"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ταχύτητα ανεμιστήρα ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Ροή"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Ροή ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Έλεγχος"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Αυτομ. ρύθμιση θερμοκρασίας"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Ενεργοποιημένο"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Απενεργοποιημένο"); + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Επιτάχυνση"); + PROGMEM Language_Str MSG_JERK = _UxGT("Vαντίδραση"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("Vαντίδραση ") LCD_STR_A; + PROGMEM Language_Str MSG_VB_JERK = _UxGT("Vαντίδραση ") LCD_STR_B; + PROGMEM Language_Str MSG_VC_JERK = _UxGT("Vαντίδραση ") LCD_STR_C; + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Vαντίδραση E"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vμεγ ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vμεγ ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vμεγ ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vμεγ ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vμεγ *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Vελαχ"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vελάχ. μετατόπιση"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Aμεγ ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Aμεγ ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Aμεγ ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Aμεγ ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Aμεγ *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Α-ανάσυρση"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Α-μετατόπιση"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Bήματα ανά μμ"); + PROGMEM Language_Str MSG_A_STEPS = _UxGT("Bήματα ") LCD_STR_A _UxGT(" ανά μμ"); + PROGMEM Language_Str MSG_B_STEPS = _UxGT("Bήματα ") LCD_STR_B _UxGT(" ανά μμ"); + PROGMEM Language_Str MSG_C_STEPS = _UxGT("Bήματα ") LCD_STR_C _UxGT(" ανά μμ"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Bήματα Ε ανά μμ"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("Bήματα * ανά μμ"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Κίνηση"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Νήμα"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ε σε μμ³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Διάμετρος νήματος"); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Διάμετρος νήματος *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Κοντράστ LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Αποθήκευση"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Φόρτωση"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Επαναφορά ασφαλούς αντιγράφου"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ανανέωση"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Οθόνη πληροφόρησης"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Προετοιμασία"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Συντονισμός"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Παύση εκτύπωσης"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Συνέχιση εκτύπωσης"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Διακοπή εκτύπωσης"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Εκτύπωση από SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Δεν βρέθηκε SD"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Αναστολή λειτουργίας…"); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Αναμονή για χρήστη…"); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Διακόπτεται η εκτύπωση"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Καμία κίνηση."); + PROGMEM Language_Str MSG_KILLED = _UxGT("ΤΕΡΜΑΤΙΣΜΟΣ. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ΔΙΑΚΟΠΗ. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Ανάσυρση μμ"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Εναλλαγή ανάσυρσης μμ"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Ανάσυρση V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Μεταπήδηση μμ"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Αυτόματη ανάσυρση"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Αλλαγή νήματος"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Αλλαγή νήματος *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Προετοιμασία κάρτας SD"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Αλλαγή κάρτας SD"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Διερεύνηση Z εκτός κλίνης"); + PROGMEM Language_Str MSG_YX_UNHOMED = _UxGT("Επαναφορά Χ/Υ πριν από Ζ"); + PROGMEM Language_Str MSG_XYZ_UNHOMED = _UxGT("Επαναφορά ΧΥΖ πρώτα"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Μετατόπιση Ζ"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Μικρό βήμα Χ"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Μικρό βήμα Υ"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Μικρό βήμα Ζ"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Ματαίωση endstop "); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Ανεπιτυχής θέρμανση"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Λάθος: ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΤΗΤΑΣ"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ ΚΛΙΝΗΣ"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Θερμαίνεται…"); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Θέρμανση κλίνης…"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Βαθμονόμηση Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Βαθμονόμηση X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Βαθμονόμηση Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Βαθμονόμηση Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Βαθμονόμηση κέντρου"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Εσφαλμένος εκτυπωτής"); +} diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index c2a629923d92..0ce4100d2fa8 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -35,1484 +35,564 @@ #endif #undef en -#ifndef THIS_LANGUAGES_SPECIAL_SYMBOLS - #define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("³") -#endif +namespace Language_en { + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("English"); -#ifdef NOT_EXTENDED_ISO10646_1_5X7 - #define MSG_CUBED _UxGT("^3") -#else - #define MSG_CUBED _UxGT("³") -#endif + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Ready."); + PROGMEM Language_Str MSG_YES = _UxGT("YES"); + PROGMEM Language_Str MSG_NO = _UxGT("NO"); + PROGMEM Language_Str MSG_BACK = _UxGT("Back"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Aborting..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media Inserted"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media Removed"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Media Released"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Waiting for media"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Media read error"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB device removed"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB start failed"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstops"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Main"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Advanced Settings"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuration"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Disable Steppers"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug Menu"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Progress Bar Test"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto Home"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-Align"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Homing XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Click to Begin"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Next Point"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Leveling Done!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Fade Height"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Set Home Offsets"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Set Origin"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preheat ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preheat ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" All"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Bed"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Conf"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Preheat ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Preheat ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" End"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" End ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" All"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Bed"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Conf"); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Preheat Custom"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Cooldown"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Laser Control"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Off"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser On"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laser Power"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindle Control"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Spindle Off"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Spindle On"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Power"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindle Reverse"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Switch Power On"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Switch Power Off"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrude"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retract"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Move Axis"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Bed Leveling"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Level Bed"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Level Corners"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Next Corner"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Mesh Editor"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Edit Mesh"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Mesh Editing Stopped"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Probing Point"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z Value"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Custom Commands"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Probe Test"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Point"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Deviation"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX Mode"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Tool Offsets"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplication"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Mirrored Copy"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Control"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2nd Nozzle X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2nd Nozzle Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2nd Nozzle Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Doing G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL Tools"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Tilting Point"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Manually Build Mesh"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Place Shim & Measure"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Measure"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Remove & Measure Bed"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Moving to next"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Activate UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Deactivate UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Bed Temp"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Hotend Temp"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Mesh Edit"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Edit Custom Mesh"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Fine Tuning Mesh"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Done Editing Mesh"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Build Custom Mesh"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Build Mesh"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Build Mesh (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Build Mesh (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Build Cold Mesh"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Adjust Mesh Height"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Height Amount"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Validate Mesh"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Validate Mesh (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Validate Mesh (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Validate Custom Mesh"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Heating Bed"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Heating Nozzle"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Manual priming..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Fixed Length Prime"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Done Priming"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Canceled"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Leaving G26"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continue Bed Mesh"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Mesh Leveling"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-Point Leveling"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Grid Mesh Leveling"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Level Mesh"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Side Points"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Map Type"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Output Mesh Map"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Output for Host"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Output for CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Off Printer Backup"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Output UBL Info"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Fill-in Amount"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Manual Fill-in"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Smart Fill-in"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Fill-in Mesh"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidate All"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidate Closest"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Fine Tune All"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Fine Tune Closest"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Storage"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Memory Slot"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Load Bed Mesh"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Save Bed Mesh"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Mesh %i Loaded"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Mesh %i Saved"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("No Storage"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Err: UBL Save"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Err: UBL Restore"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Offset Stopped"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Step-By-Step UBL"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. Build Cold Mesh"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Smart Fill-in"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Validate Mesh"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Fine Tune All"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Validate Mesh"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Fine Tune All"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Save Bed Mesh"); -#ifndef CHARSIZE - #define CHARSIZE 1 -#endif + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED Control"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Lights"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Light Presets"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Red"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Orange"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Yellow"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Green"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Blue"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violet"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("White"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Default"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Custom Lights"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Red Intensity"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Green Intensity"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Blue Intensity"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("White Intensity"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Brightness"); -#ifndef WELCOME_MSG - #define WELCOME_MSG MACHINE_NAME _UxGT(" Ready.") -#endif -#ifndef MSG_YES - #define MSG_YES _UxGT("YES") -#endif -#ifndef MSG_NO - #define MSG_NO _UxGT("NO") -#endif -#ifndef MSG_BACK - #define MSG_BACK _UxGT("Back") -#endif -#ifndef MSG_SD_INSERTED - #define MSG_SD_INSERTED _UxGT("Card inserted") -#endif -#ifndef MSG_SD_REMOVED - #define MSG_SD_REMOVED _UxGT("Card removed") -#endif -#ifndef MSG_SD_RELEASED - #define MSG_SD_RELEASED _UxGT("Card released") -#endif -#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 -#ifndef MSG_ADVANCED_SETTINGS - #define MSG_ADVANCED_SETTINGS _UxGT("Advanced Settings") -#endif -#ifndef MSG_CONFIGURATION - #define MSG_CONFIGURATION _UxGT("Configuration") -#endif -#ifndef MSG_AUTOSTART - #define MSG_AUTOSTART _UxGT("Autostart") -#endif -#ifndef MSG_DISABLE_STEPPERS - #define MSG_DISABLE_STEPPERS _UxGT("Disable steppers") -#endif -#ifndef MSG_DEBUG_MENU - #define MSG_DEBUG_MENU _UxGT("Debug Menu") -#endif -#ifndef MSG_PROGRESS_BAR_TEST - #define MSG_PROGRESS_BAR_TEST _UxGT("Progress Bar Test") -#endif -#ifndef MSG_AUTO_HOME - #define MSG_AUTO_HOME _UxGT("Auto home") -#endif -#ifndef MSG_AUTO_HOME_X - #define MSG_AUTO_HOME_X _UxGT("Home X") -#endif -#ifndef MSG_AUTO_HOME_Y - #define MSG_AUTO_HOME_Y _UxGT("Home Y") -#endif -#ifndef MSG_AUTO_HOME_Z - #define MSG_AUTO_HOME_Z _UxGT("Home Z") -#endif -#ifndef MSG_AUTO_Z_ALIGN - #define MSG_AUTO_Z_ALIGN _UxGT("Auto Z-Align") -#endif -#ifndef MSG_LEVEL_BED_HOMING - #define MSG_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#endif -#ifndef MSG_LEVEL_BED_WAITING - #define MSG_LEVEL_BED_WAITING _UxGT("Click to Begin") -#endif -#ifndef MSG_LEVEL_BED_NEXT_POINT - #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Next Point") -#endif -#ifndef MSG_LEVEL_BED_DONE - #define MSG_LEVEL_BED_DONE _UxGT("Leveling Done!") -#endif -#ifndef MSG_Z_FADE_HEIGHT - #define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") -#endif -#ifndef MSG_SET_HOME_OFFSETS - #define MSG_SET_HOME_OFFSETS _UxGT("Set home offsets") -#endif -#ifndef MSG_HOME_OFFSETS_APPLIED - #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") -#endif -#ifndef MSG_SET_ORIGIN - #define MSG_SET_ORIGIN _UxGT("Set origin") -#endif -#ifndef MSG_PREHEAT_1 - #define MSG_PREHEAT_1 _UxGT("Preheat " PREHEAT_1_LABEL) -#endif -#ifndef MSG_PREHEAT_1_N - #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#endif -#ifndef MSG_PREHEAT_1_ALL - #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" All") -#endif -#ifndef MSG_PREHEAT_1_END - #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" End") -#endif -#ifndef MSG_PREHEAT_1_BEDONLY - #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Bed") -#endif -#ifndef MSG_PREHEAT_1_SETTINGS - #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") -#endif -#ifndef MSG_PREHEAT_2 - #define MSG_PREHEAT_2 _UxGT("Preheat " PREHEAT_2_LABEL) -#endif -#ifndef MSG_PREHEAT_2_N - #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#endif -#ifndef MSG_PREHEAT_2_ALL - #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" All") -#endif -#ifndef MSG_PREHEAT_2_END - #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" End") -#endif -#ifndef MSG_PREHEAT_2_BEDONLY - #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#endif -#ifndef MSG_PREHEAT_2_SETTINGS - #define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" conf") -#endif -#ifndef MSG_PREHEAT_CUSTOM - #define MSG_PREHEAT_CUSTOM _UxGT("Preheat Custom") -#endif -#ifndef MSG_COOLDOWN - #define MSG_COOLDOWN _UxGT("Cooldown") -#endif -#ifndef MSG_LASER_MENU - #define MSG_LASER_MENU _UxGT("Laser Control") -#endif -#ifndef MSG_LASER_OFF - #define MSG_LASER_OFF _UxGT("Laser Off") -#endif -#ifndef MSG_LASER_ON - #define MSG_LASER_ON _UxGT("Laser On") -#endif -#ifndef MSG_LASER_POWER - #define MSG_LASER_POWER _UxGT("Laser power") -#endif -#ifndef MSG_SPINDLE_MENU - #define MSG_SPINDLE_MENU _UxGT("Spindle Control") -#endif -#ifndef MSG_SPINDLE_OFF - #define MSG_SPINDLE_OFF _UxGT("Spindle Off") -#endif -#ifndef MSG_SPINDLE_ON - #define MSG_SPINDLE_ON _UxGT("Spindle On") -#endif -#ifndef MSG_SPINDLE_POWER - #define MSG_SPINDLE_POWER _UxGT("Spindle power") -#endif -#ifndef MSG_SPINDLE_REVERSE - #define MSG_SPINDLE_REVERSE _UxGT("Spindle Reverse") -#endif -#ifndef MSG_SWITCH_PS_ON - #define MSG_SWITCH_PS_ON _UxGT("Switch power on") -#endif -#ifndef MSG_SWITCH_PS_OFF - #define MSG_SWITCH_PS_OFF _UxGT("Switch power off") -#endif -#ifndef MSG_EXTRUDE - #define MSG_EXTRUDE _UxGT("Extrude") -#endif -#ifndef MSG_RETRACT - #define MSG_RETRACT _UxGT("Retract") -#endif -#ifndef MSG_MOVE_AXIS - #define MSG_MOVE_AXIS _UxGT("Move axis") -#endif -#ifndef MSG_BED_LEVELING - #define MSG_BED_LEVELING _UxGT("Bed Leveling") -#endif -#ifndef MSG_LEVEL_BED - #define MSG_LEVEL_BED _UxGT("Level bed") -#endif -#ifndef MSG_LEVEL_CORNERS - #define MSG_LEVEL_CORNERS _UxGT("Level corners") -#endif -#ifndef MSG_NEXT_CORNER - #define MSG_NEXT_CORNER _UxGT("Next corner") -#endif -#ifndef MSG_EDITING_STOPPED - #define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped") -#endif -#ifndef MSG_MESH_X - #define MSG_MESH_X _UxGT("Index X") -#endif -#ifndef MSG_MESH_Y - #define MSG_MESH_Y _UxGT("Index Y") -#endif -#ifndef MSG_MESH_EDIT_Z - #define MSG_MESH_EDIT_Z _UxGT("Z Value") -#endif -#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 -#ifndef MSG_UBL_UNHOMED - #define MSG_UBL_UNHOMED _UxGT("Home XYZ first") -#endif -#ifndef MSG_UBL_TOOLS - #define MSG_UBL_TOOLS _UxGT("UBL Tools") -#endif -#ifndef MSG_UBL_LEVEL_BED - #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#endif -#ifndef MSG_LCD_PROBING_MESH - #define MSG_LCD_PROBING_MESH _UxGT("Probing point") -#endif -#ifndef MSG_LCD_TILTING_MESH - #define MSG_LCD_TILTING_MESH _UxGT("Tilting point") -#endif -#ifndef MSG_IDEX_MENU - #define MSG_IDEX_MENU _UxGT("IDEX Mode") -#endif -#ifndef MSG_OFFSETS_MENU - #define MSG_OFFSETS_MENU _UxGT("Tool Offsets") -#endif -#ifndef MSG_IDEX_MODE_AUTOPARK - #define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Park") -#endif -#ifndef MSG_IDEX_MODE_DUPLICATE - #define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplication") -#endif -#ifndef MSG_IDEX_MODE_MIRRORED_COPY - #define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Mirrored copy") -#endif -#ifndef MSG_IDEX_MODE_FULL_CTRL - #define MSG_IDEX_MODE_FULL_CTRL _UxGT("Full control") -#endif -#ifndef MSG_X_OFFSET - #define MSG_X_OFFSET _UxGT("2nd nozzle X") -#endif -#ifndef MSG_Y_OFFSET - #define MSG_Y_OFFSET _UxGT("2nd nozzle Y") -#endif -#ifndef MSG_Z_OFFSET - #define MSG_Z_OFFSET _UxGT("2nd nozzle Z") -#endif -#ifndef MSG_UBL_MANUAL_MESH - #define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh") -#endif -#ifndef MSG_UBL_BC_INSERT - #define MSG_UBL_BC_INSERT _UxGT("Place shim & measure") -#endif -#ifndef MSG_UBL_BC_INSERT2 - #define MSG_UBL_BC_INSERT2 _UxGT("Measure") -#endif -#ifndef MSG_UBL_BC_REMOVE - #define MSG_UBL_BC_REMOVE _UxGT("Remove & measure bed") -#endif -#ifndef MSG_UBL_MOVING_TO_NEXT - #define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next") -#endif -#ifndef MSG_UBL_ACTIVATE_MESH - #define MSG_UBL_ACTIVATE_MESH _UxGT("Activate UBL") -#endif -#ifndef MSG_UBL_DEACTIVATE_MESH - #define MSG_UBL_DEACTIVATE_MESH _UxGT("Deactivate UBL") -#endif -#ifndef MSG_UBL_SET_TEMP_BED - #define MSG_UBL_SET_TEMP_BED _UxGT("Bed Temp") -#endif -#ifndef MSG_UBL_BED_TEMP_CUSTOM - #define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#endif -#ifndef MSG_UBL_SET_TEMP_HOTEND - #define MSG_UBL_SET_TEMP_HOTEND _UxGT("Hotend Temp") -#endif -#ifndef MSG_UBL_HOTEND_TEMP_CUSTOM - #define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#endif -#ifndef MSG_UBL_MESH_EDIT - #define MSG_UBL_MESH_EDIT _UxGT("Mesh Edit") -#endif -#ifndef MSG_UBL_EDIT_CUSTOM_MESH - #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh") -#endif -#ifndef MSG_UBL_FINE_TUNE_MESH - #define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh") -#endif -#ifndef MSG_UBL_DONE_EDITING_MESH - #define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh") -#endif -#ifndef MSG_UBL_BUILD_CUSTOM_MESH - #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh") -#endif -#ifndef MSG_UBL_BUILD_MESH_MENU - #define MSG_UBL_BUILD_MESH_MENU _UxGT("Build Mesh") -#endif -#ifndef MSG_UBL_BUILD_MESH_M1 - #define MSG_UBL_BUILD_MESH_M1 _UxGT("Build Mesh (" PREHEAT_1_LABEL ")") -#endif -#ifndef MSG_UBL_BUILD_MESH_M2 - #define MSG_UBL_BUILD_MESH_M2 _UxGT("Build Mesh (" PREHEAT_2_LABEL ")") -#endif -#ifndef MSG_UBL_BUILD_COLD_MESH - #define MSG_UBL_BUILD_COLD_MESH _UxGT("Build Cold Mesh") -#endif -#ifndef MSG_UBL_MESH_HEIGHT_ADJUST - #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Adjust Mesh Height") -#endif -#ifndef MSG_UBL_MESH_HEIGHT_AMOUNT - #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") -#endif -#ifndef MSG_UBL_VALIDATE_MESH_MENU - #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validate Mesh") -#endif -#ifndef MSG_UBL_VALIDATE_MESH_M1 - #define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Validate Mesh (" PREHEAT_1_LABEL ")") -#endif -#ifndef MSG_UBL_VALIDATE_MESH_M2 - #define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Validate Mesh (" PREHEAT_2_LABEL ")") -#endif -#ifndef MSG_UBL_VALIDATE_CUSTOM_MESH - #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") -#endif -#ifndef MSG_UBL_CONTINUE_MESH - #define MSG_UBL_CONTINUE_MESH _UxGT("Continue Bed Mesh") -#endif -#ifndef MSG_UBL_MESH_LEVELING - #define MSG_UBL_MESH_LEVELING _UxGT("Mesh Leveling") -#endif -#ifndef MSG_UBL_3POINT_MESH_LEVELING - #define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Point Leveling") -#endif -#ifndef MSG_UBL_GRID_MESH_LEVELING - #define MSG_UBL_GRID_MESH_LEVELING _UxGT("Grid Mesh Leveling") -#endif -#ifndef MSG_UBL_MESH_LEVEL - #define MSG_UBL_MESH_LEVEL _UxGT("Level Mesh") -#endif -#ifndef MSG_UBL_SIDE_POINTS - #define MSG_UBL_SIDE_POINTS _UxGT("Side Points") -#endif -#ifndef MSG_UBL_MAP_TYPE - #define MSG_UBL_MAP_TYPE _UxGT("Map Type") -#endif -#ifndef MSG_UBL_OUTPUT_MAP - #define MSG_UBL_OUTPUT_MAP _UxGT("Output Mesh Map") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_HOST - #define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Output for Host") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_CSV - #define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Output for CSV") -#endif -#ifndef MSG_UBL_OUTPUT_MAP_BACKUP - #define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") -#endif -#ifndef MSG_UBL_INFO_UBL - #define MSG_UBL_INFO_UBL _UxGT("Output UBL Info") -#endif -#ifndef MSG_EDIT_MESH - #define MSG_EDIT_MESH _UxGT("Edit Mesh") -#endif -#ifndef MSG_UBL_FILLIN_AMOUNT - #define MSG_UBL_FILLIN_AMOUNT _UxGT("Fill-in Amount") -#endif -#ifndef MSG_UBL_MANUAL_FILLIN - #define MSG_UBL_MANUAL_FILLIN _UxGT("Manual Fill-in") -#endif -#ifndef MSG_UBL_SMART_FILLIN - #define MSG_UBL_SMART_FILLIN _UxGT("Smart Fill-in") -#endif -#ifndef MSG_UBL_FILLIN_MESH - #define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Mesh") -#endif -#ifndef MSG_UBL_INVALIDATE_ALL - #define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidate All") -#endif -#ifndef MSG_UBL_INVALIDATE_CLOSEST - #define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidate Closest") -#endif -#ifndef MSG_UBL_FINE_TUNE_ALL - #define MSG_UBL_FINE_TUNE_ALL _UxGT("Fine Tune All") -#endif -#ifndef MSG_UBL_FINE_TUNE_CLOSEST - #define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Fine Tune Closest") -#endif -#ifndef MSG_UBL_STORAGE_MESH_MENU - #define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Storage") -#endif -#ifndef MSG_UBL_STORAGE_SLOT - #define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -#endif -#ifndef MSG_UBL_LOAD_MESH - #define MSG_UBL_LOAD_MESH _UxGT("Load Bed Mesh") -#endif -#ifndef MSG_UBL_SAVE_MESH - #define MSG_UBL_SAVE_MESH _UxGT("Save Bed Mesh") -#endif -#ifndef MSG_MESH_LOADED - #define MSG_MESH_LOADED _UxGT("Mesh %i loaded") -#endif -#ifndef MSG_MESH_SAVED - #define MSG_MESH_SAVED _UxGT("Mesh %i saved") -#endif -#ifndef MSG_NO_STORAGE - #define MSG_NO_STORAGE _UxGT("No storage") -#endif -#ifndef MSG_UBL_SAVE_ERROR - #define MSG_UBL_SAVE_ERROR _UxGT("Err: UBL Save") -#endif -#ifndef MSG_UBL_RESTORE_ERROR - #define MSG_UBL_RESTORE_ERROR _UxGT("Err: UBL Restore") -#endif -#ifndef MSG_UBL_Z_OFFSET_STOPPED - #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") -#endif -#ifndef MSG_UBL_STEP_BY_STEP_MENU - #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") -#endif + PROGMEM Language_Str MSG_MOVING = _UxGT("Moving..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Free XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Move X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Move Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Move Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend too cold"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Move %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Move 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Move 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Move 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Speed"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozzle"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozzle ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Bed"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Enclosure"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan Speed"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan Speed ="); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Stored Fan ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra Fan Speed"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra Fan Speed ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Flow"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flow ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("On"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Off"); + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Select"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Select *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); + PROGMEM Language_Str MSG_JERK = _UxGT("Jerk"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-Jerk"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-Jerk"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-Jerk"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-Jerk"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocity"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VTrav Min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Acceleration"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-Retract"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-Travel"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Steps/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("steps/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("steps/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("steps/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Esteps/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*steps/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperature"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Motion"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Unload mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Load mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Advance K"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advance K *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD Contrast"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Store Settings"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Load Settings"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restore failsafe"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialize EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Media Update"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reset Printer"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Refresh"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Info Screen"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepare"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Tune"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Start Print"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Next"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Init"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Print"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Cancel"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Done"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Back"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Proceed"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pause Print"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Resume Print"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stop Print"); + PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Printing Object"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancel Object"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Cancel Object ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Outage Recovery"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Print from Media"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("No Media"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Sleep..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Click to Resume..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Print Paused"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Printing..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print Aborted"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("No Move."); + PROGMEM Language_Str MSG_KILLED = _UxGT("KILLED. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPED. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retract mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Re.mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retract V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Swap Length"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Purge Length"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Tool Change"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z Raise"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Prime Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Retract Speed"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Nozzle Standby"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Change Filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Change Filament *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Load Filament"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Load Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Unload Filament"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Unload Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Unload All"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Init. Media"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Change Media"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Release Media"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z Probe Past Bed"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Skew Factor"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reset"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Stow"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Deploy"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: SW-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: 5V-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: OD-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Mode-Store"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Set BLTouch to 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Set BLTouch to OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Report Drain"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("DANGER: Bad settings can cause damage! Proceed anyway?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Init TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z Offset Test"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Save"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s First"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Probe Z Offset"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop Abort"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Bed Heating Failed"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Chamber Heating Fail"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: REDUNDANT TEMP"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("BED THERMAL RUNAWAY"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("CHAMBER T. RUNAWAY"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: MAXTEMP"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: MINTEMP"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: MAXTEMP BED"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: MINTEMP BED"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err: MAXTEMP CHAMBER"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err: MINTEMP CHAMBER"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY First"); + PROGMEM Language_Str MSG_HALTED = _UxGT("PRINTER HALTED"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Please Reset"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Heating..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Cooling..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Bed Heating..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Bed Cooling..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Chamber Heating..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Chamber Cooling..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Calibration"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrate X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrate Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrate Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrate Center"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta Settings"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibration"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Set Delta Height"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Probe Z-offset"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Height"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Radius"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("About Printer"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Printer Info"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Point Leveling"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Linear Leveling"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilinear Leveling"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mesh Leveling"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Printer Stats"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Board Info"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruders"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocol"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Runaway Watch: OFF"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Runaway Watch: ON"); -#ifndef MSG_LED_CONTROL - #define MSG_LED_CONTROL _UxGT("LED Control") -#endif -#ifndef MSG_LEDS - #define MSG_LEDS _UxGT("Lights") -#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") -#endif -#ifndef MSG_SET_LEDS_ORANGE - #define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#endif -#ifndef MSG_SET_LEDS_YELLOW - #define MSG_SET_LEDS_YELLOW _UxGT("Yellow") -#endif -#ifndef MSG_SET_LEDS_GREEN - #define MSG_SET_LEDS_GREEN _UxGT("Green") -#endif -#ifndef MSG_SET_LEDS_BLUE - #define MSG_SET_LEDS_BLUE _UxGT("Blue") -#endif -#ifndef MSG_SET_LEDS_INDIGO - #define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#endif -#ifndef MSG_SET_LEDS_VIOLET - #define MSG_SET_LEDS_VIOLET _UxGT("Violet") -#endif -#ifndef MSG_SET_LEDS_WHITE - #define MSG_SET_LEDS_WHITE _UxGT("White") -#endif -#ifndef MSG_SET_LEDS_DEFAULT - #define MSG_SET_LEDS_DEFAULT _UxGT("Default") -#endif -#ifndef MSG_CUSTOM_LEDS - #define MSG_CUSTOM_LEDS _UxGT("Custom Lights") -#endif -#ifndef MSG_INTENSITY_R - #define MSG_INTENSITY_R _UxGT("Red Intensity") -#endif -#ifndef MSG_INTENSITY_G - #define MSG_INTENSITY_G _UxGT("Green Intensity") -#endif -#ifndef MSG_INTENSITY_B - #define MSG_INTENSITY_B _UxGT("Blue Intensity") -#endif -#ifndef MSG_INTENSITY_W - #define MSG_INTENSITY_W _UxGT("White Intensity") -#endif -#ifndef MSG_LED_BRIGHTNESS - #define MSG_LED_BRIGHTNESS _UxGT("Brightness") -#endif + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Case Light"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Light Brightness"); + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); -#ifndef MSG_MOVING - #define MSG_MOVING _UxGT("Moving...") -#endif -#ifndef MSG_FREE_XY - #define MSG_FREE_XY _UxGT("Free XY") -#endif -#ifndef MSG_MOVE_X - #define MSG_MOVE_X _UxGT("Move X") -#endif -#ifndef MSG_MOVE_Y - #define MSG_MOVE_Y _UxGT("Move Y") -#endif -#ifndef MSG_MOVE_Z - #define MSG_MOVE_Z _UxGT("Move Z") -#endif -#ifndef MSG_MOVE_E - #define MSG_MOVE_E _UxGT("Extruder") -#endif -#ifndef MSG_HOTEND_TOO_COLD - #define MSG_HOTEND_TOO_COLD _UxGT("Hotend too cold") -#endif -#ifndef MSG_MOVE_0025MM - #define MSG_MOVE_0025MM _UxGT("Move 0.025mm") -#endif -#ifndef MSG_MOVE_01MM - #define MSG_MOVE_01MM _UxGT("Move 0.1mm") -#endif -#ifndef MSG_MOVE_1MM - #define MSG_MOVE_1MM _UxGT("Move 1mm") -#endif -#ifndef MSG_MOVE_10MM - #define MSG_MOVE_10MM _UxGT("Move 10mm") -#endif -#ifndef MSG_SPEED - #define MSG_SPEED _UxGT("Speed") -#endif -#ifndef MSG_BED_Z - #define MSG_BED_Z _UxGT("Bed Z") -#endif -#ifndef MSG_NOZZLE - #define MSG_NOZZLE _UxGT("Nozzle") -#endif -#ifndef MSG_BED - #define MSG_BED _UxGT("Bed") -#endif -#ifndef MSG_CHAMBER - #define MSG_CHAMBER _UxGT("Enclosure") -#endif -#ifndef MSG_FAN_SPEED - #define MSG_FAN_SPEED _UxGT("Fan speed") -#endif -#ifndef MSG_EXTRA_FAN_SPEED - #define MSG_EXTRA_FAN_SPEED _UxGT("Extra fan speed") -#endif -#ifndef MSG_FLOW - #define MSG_FLOW _UxGT("Flow") -#endif -#ifndef MSG_CONTROL - #define MSG_CONTROL _UxGT("Control") -#endif -#ifndef MSG_MIN - #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#endif -#ifndef MSG_MAX - #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#endif -#ifndef MSG_FACTOR - #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#endif -#ifndef MSG_AUTOTEMP - #define MSG_AUTOTEMP _UxGT("Autotemp") -#endif -#ifndef MSG_LCD_ON - #define MSG_LCD_ON _UxGT("On") -#endif -#ifndef MSG_LCD_OFF - #define MSG_LCD_OFF _UxGT("Off") -#endif -#ifndef MSG_PID_P - #define MSG_PID_P _UxGT("PID-P") -#endif -#ifndef MSG_PID_I - #define MSG_PID_I _UxGT("PID-I") -#endif -#ifndef MSG_PID_D - #define MSG_PID_D _UxGT("PID-D") -#endif -#ifndef MSG_PID_C - #define MSG_PID_C _UxGT("PID-C") -#endif -#ifndef MSG_SELECT - #define MSG_SELECT _UxGT("Select") -#endif -#ifndef MSG_ACC - #define MSG_ACC _UxGT("Accel") -#endif -#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 -#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 -#ifndef MSG_VMAX - #define MSG_VMAX _UxGT("Vmax ") -#endif -#ifndef MSG_VMIN - #define MSG_VMIN _UxGT("Vmin") -#endif -#ifndef MSG_VTRAV_MIN - #define MSG_VTRAV_MIN _UxGT("VTrav min") -#endif -#ifndef MSG_ACCELERATION - #define MSG_ACCELERATION _UxGT("Acceleration") -#endif -#ifndef MSG_AMAX - #define MSG_AMAX _UxGT("Amax ") -#endif -#ifndef MSG_A_RETRACT - #define MSG_A_RETRACT _UxGT("A-retract") -#endif -#ifndef MSG_A_TRAVEL - #define MSG_A_TRAVEL _UxGT("A-travel") -#endif -#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") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Print Count"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completed"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total Print time"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Longest Job Time"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded Total"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Prints"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completed"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Longest"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded"); #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 -#endif -#ifndef MSG_ESTEPS - #define MSG_ESTEPS _UxGT("Esteps/mm") -#endif -#ifndef MSG_E1STEPS - #define MSG_E1STEPS _UxGT("E1steps/mm") -#endif -#ifndef MSG_E2STEPS - #define MSG_E2STEPS _UxGT("E2steps/mm") -#endif -#ifndef MSG_E3STEPS - #define MSG_E3STEPS _UxGT("E3steps/mm") -#endif -#ifndef MSG_E4STEPS - #define MSG_E4STEPS _UxGT("E4steps/mm") -#endif -#ifndef MSG_E5STEPS - #define MSG_E5STEPS _UxGT("E5steps/mm") -#endif -#ifndef MSG_E6STEPS - #define MSG_E6STEPS _UxGT("E6steps/mm") -#endif -#ifndef MSG_TEMPERATURE - #define MSG_TEMPERATURE _UxGT("Temperature") -#endif -#ifndef MSG_MOTION - #define MSG_MOTION _UxGT("Motion") -#endif -#ifndef MSG_FILAMENT - #define MSG_FILAMENT _UxGT("Filament") -#endif -#ifndef MSG_VOLUMETRIC_ENABLED - #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm") MSG_CUBED -#endif -#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 -#ifndef MSG_CONTRAST - #define MSG_CONTRAST _UxGT("LCD contrast") -#endif -#ifndef MSG_STORE_EEPROM - #define MSG_STORE_EEPROM _UxGT("Store settings") -#endif -#ifndef MSG_LOAD_EEPROM - #define MSG_LOAD_EEPROM _UxGT("Load settings") -#endif -#ifndef MSG_RESTORE_FAILSAFE - #define MSG_RESTORE_FAILSAFE _UxGT("Restore failsafe") -#endif -#ifndef MSG_INIT_EEPROM - #define MSG_INIT_EEPROM _UxGT("Initialize EEPROM") -#endif -#ifndef MSG_SD_UPDATE - #define MSG_SD_UPDATE _UxGT("SD Update") -#endif -#ifndef MSG_RESET_PRINTER - #define MSG_RESET_PRINTER _UxGT("Reset Printer") -#endif -#ifndef MSG_REFRESH - #define MSG_REFRESH _UxGT("Refresh") -#endif -#ifndef MSG_WATCH - #define MSG_WATCH _UxGT("Info screen") -#endif -#ifndef MSG_PREPARE - #define MSG_PREPARE _UxGT("Prepare") -#endif -#ifndef MSG_TUNE - #define MSG_TUNE _UxGT("Tune") -#endif -#ifndef MSG_START_PRINT - #define MSG_START_PRINT _UxGT("Start print") -#endif -#ifndef MSG_BUTTON_NEXT - #define MSG_BUTTON_NEXT _UxGT("Next") -#endif -#ifndef MSG_BUTTON_INIT - #define MSG_BUTTON_INIT _UxGT("Init") -#endif -#ifndef MSG_BUTTON_STOP - #define MSG_BUTTON_STOP _UxGT("Stop") -#endif -#ifndef MSG_BUTTON_PRINT - #define MSG_BUTTON_PRINT _UxGT("Print") -#endif -#ifndef MSG_BUTTON_RESET - #define MSG_BUTTON_RESET _UxGT("Reset") -#endif -#ifndef MSG_BUTTON_CANCEL - #define MSG_BUTTON_CANCEL _UxGT("Cancel") -#endif -#ifndef MSG_BUTTON_DONE - #define MSG_BUTTON_DONE _UxGT("Done") -#endif -#ifndef MSG_PAUSE_PRINT - #define MSG_PAUSE_PRINT _UxGT("Pause print") -#endif -#ifndef MSG_RESUME_PRINT - #define MSG_RESUME_PRINT _UxGT("Resume print") -#endif -#ifndef MSG_STOP_PRINT - #define MSG_STOP_PRINT _UxGT("Stop print") -#endif -#ifndef MSG_OUTAGE_RECOVERY - #define MSG_OUTAGE_RECOVERY _UxGT("Outage Recovery") -#endif -#ifndef MSG_CARD_MENU - #define MSG_CARD_MENU _UxGT("Print from SD") -#endif -#ifndef MSG_NO_CARD - #define MSG_NO_CARD _UxGT("No SD card") -#endif -#ifndef MSG_DWELL - #define MSG_DWELL _UxGT("Sleep...") -#endif -#ifndef MSG_USERWAIT - #define MSG_USERWAIT _UxGT("Click to resume...") -#endif -#ifndef MSG_PRINT_PAUSED - #define MSG_PRINT_PAUSED _UxGT("Print paused") -#endif -#ifndef MSG_PRINTING - #define MSG_PRINTING _UxGT("Printing...") -#endif -#ifndef MSG_PRINT_ABORTED - #define MSG_PRINT_ABORTED _UxGT("Print aborted") -#endif -#ifndef MSG_NO_MOVE - #define MSG_NO_MOVE _UxGT("No move.") -#endif -#ifndef MSG_KILLED - #define MSG_KILLED _UxGT("KILLED. ") -#endif -#ifndef MSG_STOPPED - #define MSG_STOPPED _UxGT("STOPPED. ") -#endif -#ifndef MSG_CONTROL_RETRACT - #define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#endif -#ifndef MSG_CONTROL_RETRACT_SWAP - #define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") -#endif -#ifndef MSG_CONTROL_RETRACTF - #define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#endif -#ifndef MSG_CONTROL_RETRACT_ZHOP - #define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER - #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER_SWAP - #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVERF - #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#endif -#ifndef MSG_CONTROL_RETRACT_RECOVER_SWAPF - #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#endif -#ifndef MSG_AUTORETRACT - #define MSG_AUTORETRACT _UxGT("AutoRetr.") -#endif -#ifndef MSG_FILAMENT_SWAP_LENGTH - #define MSG_FILAMENT_SWAP_LENGTH _UxGT("Retract Distance") -#endif -#ifndef MSG_TOOL_CHANGE - #define MSG_TOOL_CHANGE _UxGT("Tool Change") -#endif -#ifndef MSG_TOOL_CHANGE_ZLIFT - #define MSG_TOOL_CHANGE_ZLIFT _UxGT("Z Raise") -#endif -#ifndef MSG_SINGLENOZZLE_PRIME_SPD - #define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Prime Speed") -#endif -#ifndef MSG_SINGLENOZZLE_RETRACT_SPD - #define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Retract Speed") -#endif -#ifndef MSG_NOZZLE_STANDBY - #define MSG_NOZZLE_STANDBY _UxGT("Nozzle Standby") -#endif -#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 -#ifndef MSG_CHANGE_SDCARD - #define MSG_CHANGE_SDCARD _UxGT("Change SD card") -#endif -#ifndef MSG_RELEASE_SDCARD - #define MSG_RELEASE_SDCARD _UxGT("Release SD card") -#endif -#ifndef MSG_ZPROBE_OUT - #define MSG_ZPROBE_OUT _UxGT("Z Probe past bed") -#endif -#ifndef MSG_SKEW_FACTOR - #define MSG_SKEW_FACTOR _UxGT("Skew Factor") -#endif -#ifndef MSG_BLTOUCH - #define MSG_BLTOUCH _UxGT("BLTouch") -#endif -#ifndef MSG_BLTOUCH_SELFTEST - #define MSG_BLTOUCH_SELFTEST _UxGT("Cmd: Self-Test") -#endif -#ifndef MSG_BLTOUCH_RESET - #define MSG_BLTOUCH_RESET _UxGT("Cmd: Reset") -#endif -#ifndef MSG_BLTOUCH_STOW - #define MSG_BLTOUCH_STOW _UxGT("Cmd: Stow") -#endif -#ifndef MSG_BLTOUCH_DEPLOY - #define MSG_BLTOUCH_DEPLOY _UxGT("Cmd: Deploy") -#endif -#ifndef MSG_BLTOUCH_SW_MODE - #define MSG_BLTOUCH_SW_MODE _UxGT("Cmd: SW-Mode") -#endif -#ifndef MSG_BLTOUCH_5V_MODE - #define MSG_BLTOUCH_5V_MODE _UxGT("Cmd: 5V-Mode") -#endif -#ifndef MSG_BLTOUCH_OD_MODE - #define MSG_BLTOUCH_OD_MODE _UxGT("Cmd: OD-Mode") -#endif -#ifndef MSG_BLTOUCH_MODE_STORE - #define MSG_BLTOUCH_MODE_STORE _UxGT("Cmd: Mode-Store") -#endif -#ifndef MSG_BLTOUCH_MODE_STORE_5V - #define MSG_BLTOUCH_MODE_STORE_5V _UxGT("Set BLTouch to 5V") -#endif -#ifndef MSG_BLTOUCH_MODE_STORE_OD - #define MSG_BLTOUCH_MODE_STORE_OD _UxGT("Set BLTouch to OD") -#endif -#ifndef MSG_BLTOUCH_MODE_ECHO - #define MSG_BLTOUCH_MODE_ECHO _UxGT("Report Drain") -#endif -#ifndef MSG_BLTOUCH_MODE_CHANGE - #define MSG_BLTOUCH_MODE_CHANGE _UxGT("DANGER: Bad settings can cause damage! Proceed anyway?") -#endif -#ifndef MSG_TOUCHMI_PROBE - #define MSG_TOUCHMI_PROBE _UxGT("TouchMI") -#endif -#ifndef MSG_TOUCHMI_INIT - #define MSG_TOUCHMI_INIT _UxGT("Init TouchMI") -#endif -#ifndef MSG_TOUCHMI_ZTEST - #define MSG_TOUCHMI_ZTEST _UxGT("Z offset Test") -#endif -#ifndef MSG_TOUCHMI_SAVE - #define MSG_TOUCHMI_SAVE _UxGT("Save") -#endif -#ifndef MSG_MANUAL_DEPLOY_TOUCHMI - #define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("Deploy TouchMI") -#endif -#ifndef MSG_MANUAL_DEPLOY - #define MSG_MANUAL_DEPLOY _UxGT("Deploy Z-Probe") -#endif -#ifndef MSG_MANUAL_STOW - #define MSG_MANUAL_STOW _UxGT("Stow Z-Probe") -#endif -#ifndef MSG_HOME - #define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#endif -#ifndef MSG_FIRST - #define MSG_FIRST _UxGT("first") -#endif -#ifndef MSG_ZPROBE_ZOFFSET - #define MSG_ZPROBE_ZOFFSET _UxGT("Probe Z Offset") -#endif -#ifndef MSG_BABYSTEP_X - #define MSG_BABYSTEP_X _UxGT("Babystep X") -#endif -#ifndef MSG_BABYSTEP_Y - #define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#endif -#ifndef MSG_BABYSTEP_Z - #define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#endif -#ifndef MSG_BABYSTEP_TOTAL - #define MSG_BABYSTEP_TOTAL _UxGT("Total") -#endif -#ifndef MSG_ENDSTOP_ABORT - #define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") -#endif -#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_HEATING_FAILED_LCD_CHAMBER - #define MSG_HEATING_FAILED_LCD_CHAMBER _UxGT("Chamber heating fail") -#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_THERMAL_RUNAWAY_CHAMBER - #define MSG_THERMAL_RUNAWAY_CHAMBER _UxGT("CHAMBER T. RUNAWAY") -#endif -#ifndef MSG_ERR_MAXTEMP - #define MSG_ERR_MAXTEMP _UxGT("Err: MAXTEMP") -#endif -#ifndef MSG_ERR_MINTEMP - #define MSG_ERR_MINTEMP _UxGT("Err: MINTEMP") -#endif -#ifndef MSG_ERR_MAXTEMP_BED - #define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") -#endif -#ifndef MSG_ERR_MINTEMP_BED - #define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") -#endif -#ifndef MSG_ERR_MAXTEMP_CHAMBER - #define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Err: MAXTEMP CHAMBER") -#endif -#ifndef MSG_ERR_MINTEMP_CHAMBER - #define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err: MINTEMP CHAMBER") -#endif -#ifndef MSG_ERR_Z_HOMING - #define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#endif -#ifndef MSG_HALTED - #define MSG_HALTED _UxGT("PRINTER HALTED") -#endif -#ifndef MSG_PLEASE_RESET - #define MSG_PLEASE_RESET _UxGT("Please reset") -#endif -#ifndef MSG_SHORT_DAY - #define MSG_SHORT_DAY _UxGT("d") // One character only -#endif -#ifndef MSG_SHORT_HOUR - #define MSG_SHORT_HOUR _UxGT("h") // One character only -#endif -#ifndef MSG_SHORT_MINUTE - #define MSG_SHORT_MINUTE _UxGT("m") // One character only -#endif -#ifndef MSG_HEATING - #define MSG_HEATING _UxGT("Heating...") -#endif -#ifndef MSG_COOLING - #define MSG_COOLING _UxGT("Cooling...") -#endif -#ifndef MSG_BED_HEATING - #define MSG_BED_HEATING _UxGT("Bed heating...") -#endif -#ifndef MSG_BED_COOLING - #define MSG_BED_COOLING _UxGT("Bed cooling...") -#endif -#ifndef MSG_CHAMBER_HEATING - #define MSG_CHAMBER_HEATING _UxGT("Chamber heating...") -#endif -#ifndef MSG_CHAMBER_COOLING - #define MSG_CHAMBER_COOLING _UxGT("Chamber cooling...") -#endif -#ifndef MSG_DELTA_CALIBRATE - #define MSG_DELTA_CALIBRATE _UxGT("Delta Calibration") -#endif -#ifndef MSG_DELTA_CALIBRATE_X - #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrate X") -#endif -#ifndef MSG_DELTA_CALIBRATE_Y - #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrate Y") -#endif -#ifndef MSG_DELTA_CALIBRATE_Z - #define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrate Z") -#endif -#ifndef MSG_DELTA_CALIBRATE_CENTER - #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrate Center") -#endif -#ifndef MSG_DELTA_SETTINGS - #define MSG_DELTA_SETTINGS _UxGT("Delta Settings") -#endif -#ifndef MSG_DELTA_AUTO_CALIBRATE - #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Calibration") -#endif -#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 -#ifndef MSG_DELTA_HEIGHT - #define MSG_DELTA_HEIGHT _UxGT("Height") -#endif -#ifndef MSG_DELTA_RADIUS - #define MSG_DELTA_RADIUS _UxGT("Radius") -#endif -#ifndef MSG_INFO_MENU - #define MSG_INFO_MENU _UxGT("About Printer") -#endif -#ifndef MSG_INFO_PRINTER_MENU - #define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#endif -#ifndef MSG_3POINT_LEVELING - #define MSG_3POINT_LEVELING _UxGT("3-Point Leveling") -#endif -#ifndef MSG_LINEAR_LEVELING - #define MSG_LINEAR_LEVELING _UxGT("Linear Leveling") -#endif -#ifndef MSG_BILINEAR_LEVELING - #define MSG_BILINEAR_LEVELING _UxGT("Bilinear Leveling") -#endif -#ifndef MSG_UBL_LEVELING - #define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#endif -#ifndef MSG_MESH_LEVELING - #define MSG_MESH_LEVELING _UxGT("Mesh Leveling") -#endif -#ifndef MSG_INFO_STATS_MENU - #define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#endif -#ifndef MSG_INFO_BOARD_MENU - #define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#endif -#ifndef MSG_INFO_THERMISTOR_MENU - #define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#endif -#ifndef MSG_INFO_EXTRUDERS - #define MSG_INFO_EXTRUDERS _UxGT("Extruders") -#endif -#ifndef MSG_INFO_BAUDRATE - #define MSG_INFO_BAUDRATE _UxGT("Baud") -#endif -#ifndef MSG_INFO_PROTOCOL - #define MSG_INFO_PROTOCOL _UxGT("Protocol") -#endif -#ifndef MSG_CASE_LIGHT - #define MSG_CASE_LIGHT _UxGT("Case light") -#endif -#ifndef MSG_CASE_LIGHT_BRIGHTNESS - #define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Light Brightness") -#endif -#if LCD_WIDTH >= 20 - #ifndef MSG_INFO_PRINT_COUNT - #define MSG_INFO_PRINT_COUNT _UxGT("Print Count") - #endif - #ifndef MSG_INFO_COMPLETED_PRINTS - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") - #endif - #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME _UxGT("Total print time") - #endif - #ifndef MSG_INFO_PRINT_LONGEST - #define MSG_INFO_PRINT_LONGEST _UxGT("Longest job time") - #endif - #ifndef MSG_INFO_PRINT_FILAMENT - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded total") - #endif -#else - #ifndef MSG_INFO_PRINT_COUNT - #define MSG_INFO_PRINT_COUNT _UxGT("Prints") - #endif - #ifndef MSG_INFO_COMPLETED_PRINTS - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") - #endif - #ifndef MSG_INFO_PRINT_TIME - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #endif - #ifndef MSG_INFO_PRINT_LONGEST - #define MSG_INFO_PRINT_LONGEST _UxGT("Longest") - #endif - #ifndef MSG_INFO_PRINT_FILAMENT - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded") - #endif -#endif -#ifndef MSG_INFO_MIN_TEMP - #define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#endif -#ifndef MSG_INFO_MAX_TEMP - #define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#endif -#ifndef MSG_INFO_PSU - #define MSG_INFO_PSU _UxGT("PSU") -#endif -#ifndef MSG_DRIVE_STRENGTH - #define MSG_DRIVE_STRENGTH _UxGT("Drive Strength") -#endif -#ifndef MSG_DAC_PERCENT - #define MSG_DAC_PERCENT _UxGT("Driver %") -#endif -#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") -#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") -#endif -#ifndef MSG_FILAMENT_CHANGE_OPTION_RESUME - #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continue") -#endif -#ifndef MSG_FILAMENT_CHANGE_NOZZLE - #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") -#endif -#ifndef MSG_RUNOUT_SENSOR - #define MSG_RUNOUT_SENSOR _UxGT("Runout Sensor") -#endif -#ifndef MSG_RUNOUT_DISTANCE_MM - #define MSG_RUNOUT_DISTANCE_MM _UxGT("Runout Dist mm") -#endif -#ifndef MSG_ERR_HOMING_FAILED - #define MSG_ERR_HOMING_FAILED _UxGT("Homing failed") -#endif -#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 -#ifndef MSG_MMU2_FILAMENT_CHANGE_HEADER - #define MSG_MMU2_FILAMENT_CHANGE_HEADER _UxGT("FILAMENT CHANGE") -#endif -#ifndef MSG_MMU2_CHOOSE_FILAMENT_HEADER - #define MSG_MMU2_CHOOSE_FILAMENT_HEADER _UxGT("CHOOSE FILAMENT") -#endif -#ifndef MSG_MMU2_MENU - #define MSG_MMU2_MENU _UxGT("MMU") -#endif -#ifndef MSG_MMU2_WRONG_FIRMWARE - #define MSG_MMU2_WRONG_FIRMWARE _UxGT("Update MMU firmware!") -#endif -#ifndef MSG_MMU2_NOT_RESPONDING - #define MSG_MMU2_NOT_RESPONDING _UxGT("MMU needs attention.") -#endif -#ifndef MSG_MMU2_RESUME - #define MSG_MMU2_RESUME _UxGT("Resume print") -#endif -#ifndef MSG_MMU2_RESUMING - #define MSG_MMU2_RESUMING _UxGT("Resuming...") -#endif -#ifndef MSG_MMU2_LOAD_FILAMENT - #define MSG_MMU2_LOAD_FILAMENT _UxGT("Load filament") -#endif -#ifndef MSG_MMU2_LOAD_ALL - #define MSG_MMU2_LOAD_ALL _UxGT("Load all") -#endif -#ifndef MSG_MMU2_LOAD_TO_NOZZLE - #define MSG_MMU2_LOAD_TO_NOZZLE _UxGT("Load to nozzle") -#endif -#ifndef MSG_MMU2_EJECT_FILAMENT - #define MSG_MMU2_EJECT_FILAMENT _UxGT("Eject filament") -#endif -#ifndef MSG_MMU2_EJECT_FILAMENT0 - #define MSG_MMU2_EJECT_FILAMENT0 _UxGT("Eject filament 1") -#endif -#ifndef MSG_MMU2_EJECT_FILAMENT1 - #define MSG_MMU2_EJECT_FILAMENT1 _UxGT("Eject filament 2") -#endif -#ifndef MSG_MMU2_EJECT_FILAMENT2 - #define MSG_MMU2_EJECT_FILAMENT2 _UxGT("Eject filament 3") -#endif -#ifndef MSG_MMU2_EJECT_FILAMENT3 - #define MSG_MMU2_EJECT_FILAMENT3 _UxGT("Eject filament 4") -#endif -#ifndef MSG_MMU2_EJECT_FILAMENT4 - #define MSG_MMU2_EJECT_FILAMENT4 _UxGT("Eject filament 5") -#endif -#ifndef MSG_MMU2_UNLOAD_FILAMENT - #define MSG_MMU2_UNLOAD_FILAMENT _UxGT("Unload filament") -#endif -#ifndef MSG_MMU2_LOADING_FILAMENT - #define MSG_MMU2_LOADING_FILAMENT _UxGT("Loading fil. %i...") -#endif -#ifndef MSG_MMU2_EJECTING_FILAMENT - #define MSG_MMU2_EJECTING_FILAMENT _UxGT("Ejecting fil. ...") -#endif -#ifndef MSG_MMU2_UNLOADING_FILAMENT - #define MSG_MMU2_UNLOADING_FILAMENT _UxGT("Unloading fil....") -#endif -#ifndef MSG_MMU2_ALL - #define MSG_MMU2_ALL _UxGT("All") -#endif -#ifndef MSG_MMU2_FILAMENT0 - #define MSG_MMU2_FILAMENT0 _UxGT("Filament 1") -#endif -#ifndef MSG_MMU2_FILAMENT1 - #define MSG_MMU2_FILAMENT1 _UxGT("Filament 2") -#endif -#ifndef MSG_MMU2_FILAMENT2 - #define MSG_MMU2_FILAMENT2 _UxGT("Filament 3") -#endif -#ifndef MSG_MMU2_FILAMENT3 - #define MSG_MMU2_FILAMENT3 _UxGT("Filament 4") -#endif -#ifndef MSG_MMU2_FILAMENT4 - #define MSG_MMU2_FILAMENT4 _UxGT("Filament 5") -#endif -#ifndef MSG_MMU2_RESET - #define MSG_MMU2_RESET _UxGT("Reset MMU") -#endif -#ifndef MSG_MMU2_RESETTING - #define MSG_MMU2_RESETTING _UxGT("Resetting MMU...") -#endif -#ifndef MSG_MMU2_EJECT_RECOVER - #define MSG_MMU2_EJECT_RECOVER _UxGT("Remove, click") -#endif + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Drive Strength"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC CONNECTION ERROR"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Write"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT CHANGE"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("PRINT PAUSED"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("LOAD FILAMENT"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("UNLOAD FILAMENT"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("RESUME OPTIONS:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purge more"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Continue"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozzle: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Runout Sensor"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout Dist mm"); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Homing Failed"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Probing Failed"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Too Cold"); -#ifndef MSG_MIX - #define MSG_MIX _UxGT("Mix") -#endif -#ifndef MSG_MIX_COMPONENT - #define MSG_MIX_COMPONENT _UxGT("Component") -#endif -#ifndef MSG_MIXER - #define MSG_MIXER _UxGT("Mixer") -#endif -#ifndef MSG_GRADIENT - #define MSG_GRADIENT _UxGT("Gradient") -#endif -#ifndef MSG_FULL_GRADIENT - #define MSG_FULL_GRADIENT _UxGT("Full gradient") -#endif -#ifndef MSG_TOGGLE_MIX - #define MSG_TOGGLE_MIX _UxGT("Toggle mix") -#endif -#ifndef MSG_CYCLE_MIX - #define MSG_CYCLE_MIX _UxGT("Cycle mix") -#endif -#ifndef MSG_GRADIENT_MIX - #define MSG_GRADIENT_MIX _UxGT("Gradient mix") -#endif -#ifndef MSG_REVERSE_GRADIENT - #define MSG_REVERSE_GRADIENT _UxGT("Reverse Gradient") -#endif -#ifndef MSG_ACTIVE_VTOOL - #define MSG_ACTIVE_VTOOL _UxGT("Active V-tool") -#endif -#ifndef MSG_START_VTOOL - #define MSG_START_VTOOL _UxGT("Start V-tool") -#endif -#ifndef MSG_END_VTOOL - #define MSG_END_VTOOL _UxGT(" End V-tool") -#endif -#ifndef MSG_GRADIENT_ALIAS - #define MSG_GRADIENT_ALIAS _UxGT("Alias V-tool") -#endif -#ifndef MSG_RESET_VTOOLS - #define MSG_RESET_VTOOLS _UxGT("Reset V-tools") -#endif -#ifndef MSG_COMMIT_VTOOL - #define MSG_COMMIT_VTOOL _UxGT("Commit V-tool Mix") -#endif -#ifndef MSG_VTOOLS_RESET - #define MSG_VTOOLS_RESET _UxGT("V-tools were reset") -#endif -#ifndef MSG_START_Z - #define MSG_START_Z _UxGT("Start Z") -#endif -#ifndef MSG_END_Z - #define MSG_END_Z _UxGT(" End Z") -#endif -#ifndef MSG_BRICKOUT - #define MSG_BRICKOUT _UxGT("Brickout") -#endif -#ifndef MSG_INVADERS - #define MSG_INVADERS _UxGT("Invaders") -#endif -#ifndef MSG_SNAKE - #define MSG_SNAKE _UxGT("Sn4k3") -#endif -#ifndef MSG_MAZE - #define MSG_MAZE _UxGT("Maze") -#endif + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("CHOOSE FILAMENT"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Update MMU Firmware!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Needs Attention."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Resume Print"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Resuming..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Load Filament"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Load All"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Load to Nozzle"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Eject Filament"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Eject Filament ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Unload Filament"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Loading Fil. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Ejecting Fil. ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Unloading Fil...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("All"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Reset MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Resetting MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Remove, click"); -// -// 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 - #ifndef MSG_ADVANCED_PAUSE_WAITING_1 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Press button") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("to resume print") - #endif - #ifndef MSG_PAUSE_PRINT_INIT_1 - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Parking...") - #endif - #ifndef MSG_FILAMENT_CHANGE_INIT_1 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filament change") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("to start") - #endif - #ifndef MSG_FILAMENT_CHANGE_INSERT_1 - #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") - #endif - #ifndef MSG_FILAMENT_CHANGE_HEAT_1 - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Press button") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("to heat nozzle") - #endif - #ifndef MSG_FILAMENT_CHANGE_HEATING_1 - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozzle heating") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Please wait...") - #endif - #ifndef MSG_FILAMENT_CHANGE_UNLOAD_1 - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wait for") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") - #endif - #ifndef MSG_FILAMENT_CHANGE_LOAD_1 - #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") - #endif - #ifndef MSG_FILAMENT_CHANGE_CONT_PURGE_1 - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Click to finish") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("filament purge") - #endif - #ifndef MSG_FILAMENT_CHANGE_RESUME_1 - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume...") - #endif -#else // LCD_HEIGHT < 4 - #ifndef MSG_ADVANCED_PAUSE_WAITING_1 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Click to continue") - #endif - #ifndef MSG_PAUSE_PRINT_INIT_1 - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Parking...") - #endif - #ifndef MSG_FILAMENT_CHANGE_INIT_1 - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Please wait...") - #endif - #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_UNLOAD_1 - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...") - #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...") - #endif - #ifndef MSG_FILAMENT_CHANGE_CONT_PURGE_1 - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Click to finish") - #endif - #ifndef MSG_FILAMENT_CHANGE_RESUME_1 - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Resuming...") - #endif -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Component ="); + PROGMEM Language_Str MSG_MIXER = _UxGT("Mixer"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Full Gradient"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Toggle Mix"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Cycle Mix"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradient Mix"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Reverse Gradient"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Active V-tool"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Start V-tool"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" End V-tool"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-tool"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reset V-tools"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Commit V-tool Mix"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools Were Reset"); + PROGMEM Language_Str MSG_START_Z = _UxGT("Start Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" End Z:"); -#ifndef MSG_TMC_DRIVERS - #define MSG_TMC_DRIVERS _UxGT("TMC drivers") -#endif -#ifndef MSG_TMC_CURRENT - #define MSG_TMC_CURRENT _UxGT("Driver current") -#endif -#ifndef MSG_TMC_HYBRID_THRS - #define MSG_TMC_HYBRID_THRS _UxGT("Hybrid threshold") -#endif -#ifndef MSG_TMC_HOMING_THRS - #define MSG_TMC_HOMING_THRS _UxGT("Sensorless homing") -#endif -#ifndef MSG_TMC_STEPPING_MODE - #define MSG_TMC_STEPPING_MODE _UxGT("Stepping mode") -#endif -#ifndef MSG_TMC_STEALTH_ENABLED - #define MSG_TMC_STEALTH_ENABLED _UxGT("StealthChop enabled") -#endif + PROGMEM Language_Str MSG_GAMES = _UxGT("Games"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); -#ifndef MSG_SERVICE_RESET - #define MSG_SERVICE_RESET _UxGT("Reset") -#endif -#ifndef MSG_SERVICE_IN - #define MSG_SERVICE_IN _UxGT(" in:") -#endif + #define MSG_1_LINE(A) A "\0" "\0" + #define MSG_2_LINE(A,B) A "\0" B "\0" + #define MSG_3_LINE(A,B,C) A "\0" B "\0" C -#ifndef MSG_BACKLASH - #define MSG_BACKLASH _UxGT("Backlash") -#endif -#ifndef MSG_BACKLASH_CORRECTION - #define MSG_BACKLASH_CORRECTION _UxGT("Correction") -#endif -#ifndef MSG_BACKLASH_SMOOTHING - #define MSG_BACKLASH_SMOOTHING _UxGT("Smoothing") + // + // 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 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Press Button", "to resume print")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parking...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Wait for", "filament change", "to start")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Insert filament", "and press button", "to continue")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Press button", "to heat nozzle")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Nozzle heating", "Please wait...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Wait for", "filament unload")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Wait for", "filament load")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Wait for", "filament purge")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Click to finish", "filament purge")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Wait for print", "to resume...")); + #else + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Click to continue")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parking...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Please wait...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Insert and Click")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Click to heat")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Heating...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Ejecting...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Loading...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purging...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Click to finish")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Resuming...")); + #endif + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC Drivers"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Driver Current"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybrid Threshold"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Sensorless Homing"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Stepping Mode"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop Enabled"); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" in:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Backlash"); + PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; + PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; + PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Smoothing"); +} + +#if FAN_COUNT == 1 + #define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED + #define MSG_FIRST_EXTRA_FAN_SPEED MSG_EXTRA_FAN_SPEED +#else + #define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED_N + #define MSG_FIRST_EXTRA_FAN_SPEED MSG_EXTRA_FAN_SPEED_N #endif diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 2435020ed1ae..6a69de275e30 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -30,231 +30,518 @@ */ #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") -#define MSG_BACK _UxGT("Atrás") -#define MSG_SD_INSERTED _UxGT("Tarjeta colocada") -#define MSG_SD_REMOVED _UxGT("Tarjeta retirada") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menú principal") -#define MSG_AUTOSTART _UxGT("Inicio automático") -#define MSG_DISABLE_STEPPERS _UxGT("Apagar motores") -#define MSG_DEBUG_MENU _UxGT("Menú depurar") -#define MSG_PROGRESS_BAR_TEST _UxGT("Prueba barra avance") -#define MSG_AUTO_HOME _UxGT("Llevar al origen") -#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_LEVEL_BED_HOMING _UxGT("Origen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Iniciar (Presione)") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Siguiente punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelación lista!") -#define MSG_SET_HOME_OFFSETS _UxGT("Ajustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicado") -#define MSG_SET_ORIGIN _UxGT("Establecer origen") -#define MSG_PREHEAT_1 _UxGT("Precalentar " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Todo") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" End") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Cama") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Config") -#define MSG_PREHEAT_2 _UxGT("Precalentar " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Todo") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" End") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Cama") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Config") -#define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Encender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") -#define MSG_EXTRUDE _UxGT("Extruir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover ejes") -#define MSG_BED_LEVELING _UxGT("Nivelar cama") -#define MSG_LEVEL_BED _UxGT("Nivelar cama") +namespace Language_es { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_MOVING _UxGT("Moviendo...") -#define MSG_FREE_XY _UxGT("Libre 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("Extrusor") -#define MSG_MOVE_0025MM _UxGT("Mover 0.025mm") -#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("Velocidad") -#define MSG_BED_Z _UxGT("Cama Z") -#define MSG_NOZZLE _UxGT("Boquilla") -#define MSG_BED _UxGT("Cama") -#define MSG_FAN_SPEED _UxGT("Ventilador") -#define MSG_FLOW _UxGT("Flujo") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Temperatura Auto.") -#define MSG_LCD_ON _UxGT("Encender") -#define MSG_LCD_OFF _UxGT("Apagar") -#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("Seleccionar") -#define MSG_ACC _UxGT("Aceleración") -#define MSG_JERK _UxGT("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_VMAX _UxGT("Vmax") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vel. viaje min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Acel. max") -#define MSG_A_RETRACT _UxGT("Acel. retrac.") -#define MSG_A_TRAVEL _UxGT("Acel. Viaje") -#define MSG_STEPS_PER_MM _UxGT("Pasos/mm") -#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") -#define MSG_E3STEPS _UxGT("E3 pasos/mm") -#define MSG_E4STEPS _UxGT("E4 pasos/mm") -#define MSG_E5STEPS _UxGT("E5 pasos/mm") -#define MSG_E6STEPS _UxGT("E6 pasos/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimiento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_ADVANCE_K _UxGT("Avance K") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Guardar memoria") -#define MSG_LOAD_EEPROM _UxGT("Cargar memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurar memoria") -#define MSG_REFRESH _UxGT("Volver a cargar") -#define MSG_WATCH _UxGT("Información") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impresión") -#define MSG_RESUME_PRINT _UxGT("Reanudar impresión") -#define MSG_STOP_PRINT _UxGT("Detener impresión") -#define MSG_CARD_MENU _UxGT("Menú de SD") -#define MSG_NO_CARD _UxGT("No hay tarjeta SD") -#define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Esperando órdenes") -#define MSG_PRINT_ABORTED _UxGT("Impresión cancelada") -#define MSG_NO_MOVE _UxGT("Sin movimiento") -#define MSG_KILLED _UxGT("Parada de emergencia") -#define MSG_STOPPED _UxGT("Detenida") -#define MSG_CONTROL_RETRACT _UxGT("Retraer mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Interc. Retraer mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraer V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Levantar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Interc. DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet V") -#define MSG_AUTORETRACT _UxGT("Retracción Auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambiar filamento") -#define MSG_INIT_SDCARD _UxGT("Iniciando tarjeta") -#define MSG_CHANGE_SDCARD _UxGT("Cambiar tarjeta") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z fuera") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Auto-Prueba") -#define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("primero") -#define MSG_ZPROBE_ZOFFSET _UxGT("Desfase Z") -#define MSG_BABYSTEP_X _UxGT("Micropaso X") -#define MSG_BABYSTEP_Y _UxGT("Micropaso Y") -#define MSG_BABYSTEP_Z _UxGT("Micropaso Z") -#define MSG_ENDSTOP_ABORT _UxGT("Cancelado - Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Error: al calentar") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Error: temperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("Error: temperatura") -#define MSG_ERR_MAXTEMP _UxGT("Error: Temp Máxima") -#define MSG_ERR_MINTEMP _UxGT("Error: Temp Mínima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Error: Temp Max Cama") -#define MSG_ERR_MINTEMP_BED _UxGT("Error: Temp Min Cama") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#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_BED_HEATING _UxGT("Calentando Cama...") -#define MSG_DELTA_CALIBRATE _UxGT("Calibración 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_AUTO_CALIBRATE _UxGT("Auto Calibración") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Est. Altura Delta") -#define MSG_INFO_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_PRINTER_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_STATS_MENU _UxGT("Estadísticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. Controlador") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistores") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusores") -#define MSG_INFO_BAUDRATE _UxGT("Baudios") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz cabina") + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Spanish"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo de impresión") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Tiempo total de imp.") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impresión más larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total de Extrusión") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impresiones") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Más larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrusión") -#endif + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" lista"); + PROGMEM Language_Str MSG_YES = _UxGT("SI"); + PROGMEM Language_Str MSG_NO = _UxGT("NO"); + PROGMEM Language_Str MSG_BACK = _UxGT("Atrás"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Cancelando..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD/USB insertado"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD/USB retirado"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("SD/USB lanzado"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Esperando al SD/USB"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Error lectura SD/USB"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("Disp. USB retirado"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Inicio USB fallido"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstops"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menú principal"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Ajustes avanzados"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuración"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Inicio automático"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Apagar motores"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menú depuración"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Prob. barra progreso"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Llevar al origen"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Origen X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Origen Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Origen Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto alineado Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Origen XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Pulsar para comenzar"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Siguiente punto"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("¡Nivelación lista!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Compensación Altura"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ajustar desfases"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfase aplicada"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Establecer origen"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Precalentar ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Precalentar ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Fin"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Fin ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Todo"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Cama"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Precalentar ") PREHEAT_1_LABEL _UxGT(" Ajuste"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Precalentar ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Precalentar ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Fin"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Fin ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Todo"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Cama"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Precalentar ") PREHEAT_2_LABEL _UxGT(" Ajuste"); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Precalen. Personali."); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Enfriar"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Control Láser"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Láser Apagado"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Láser Encendido"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Potencia Láser"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Control Mandrino"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Mandrino Apagado"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Mandrino Encendido"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potencia Mandrino"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Invertir giro"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Encender Fuente"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Apagar Fuente"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extruir"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retraer"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover ejes"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelando Cama"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar Cama"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Nivelar Esquinas"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Siguente Esquina"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor Mallado"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Editar Mallado"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Ed. Mallado parada"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Sondear Punto"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Índice X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Índice Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valor Z"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Comandos Personaliz."); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Probar Sonda"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Punto"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Desviación"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Modo IDEX"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Desfase Boquillas"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Aparcado"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicar"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia Reflejada"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Control Total"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2ª Boquilla X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2ª Boquilla Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2ª Boquilla Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Hacer G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Herramientas UBL"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Nivel.Cama.Uni.(UBL)"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punto de inclinación"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Crear Mallado man."); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Colocar cuña y Medir"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Medir"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Retirar y Medir Cama"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Mover al Siguente"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Activar UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Desactivar UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Temp. Cama"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT ("Hotend Temp"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Editar Mallado"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Edit. Mallado perso."); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Ajuste fino Mallado"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Term. edici. Mallado"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crear Mallado Perso."); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Crear Mallado"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Crear Mallado (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Crear Mallado (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Crear Mallado Frío"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Ajustar alt. Mallado"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Cantidad de altura"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Validar Mallado"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Validar Mallado (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Validar Mallado (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Vali. Mallado perso."); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Calentando Cama"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Calent. Boquilla"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Imprimado manual..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Impri. longit. fija"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Imprimación Lista"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Cancelado"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Dejando G26"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Contin. Mallado cama"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Nivelando Mallado"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Nivelando 3Puntos"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Nivel. Mallado cuad."); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Nivel de Mallado"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Puntos Laterales"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Tipo de mapa "); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Salida Mapa mallado"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Salida para el host"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Salida para CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Off Printer Backup"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Salida Info. UBL"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Cantidad de relleno"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Relleno manual"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Relleno inteligente"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Mallado de relleno"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidar todo"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidar proximos"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Ajustar Fino Todo"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ajustar Fino proxi."); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Almacen de Mallado"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Huecos de memoria"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Cargar Mallado cama"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Guardar Mallado cama"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Mallado %i Cargado"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Mallado %i Guardado"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Sin guardar"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Error: Guardar UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Error: Restaurar UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Desfase de Z: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Desfase de Z Parado"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Paso a Paso"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Crear Mallado Frío"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Relleno inteligente"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Validar Mallado"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Ajustar Fino Todo"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Validar Mallado"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Ajustar Fino Todo"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Guardar Mallado cama"); -#define MSG_INFO_MIN_TEMP _UxGT("Temperatura mínima") -#define MSG_INFO_MAX_TEMP _UxGT("Temperatura máxima") -#define MSG_INFO_PSU _UxGT("Fuente de poder") -#define MSG_DRIVE_STRENGTH _UxGT("Potencia driver") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escribe DAC EEPROM") + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Control LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Luzes"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Luz predefinida"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Rojo"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Naranja"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Amarillo"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Verde"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Azul"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Índigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violeta"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Blanco"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Por defecto"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Luces personalizadas"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensidad Rojo"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensidad Verde"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensidad Azul"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensidad Blanco"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Brillo"); -#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 más") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resumir imp.") + PROGMEM Language_Str MSG_MOVING = _UxGT("Moviendo..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Libre XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend muy frio"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidad"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Cama Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Boquilla"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Boquilla ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Cama"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Recinto"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ventilador"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ventilador ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Vel. Ext. ventilador"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Vel. Ext. ventilador ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Flujo"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flujo ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temperatura Auto."); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Encender"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Apagar"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Seleccionar"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seleccionar *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Aceleración"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocidad"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vel. viaje min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accel"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Acel. max") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Acel. max") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Acel. max") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Acel. max") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Acel. max *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Acel. retrac."); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Acel. Viaje"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Pasos/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" pasos/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" pasos/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" pasos/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E pasos/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* pasos/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Movimiento"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Descarga mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Carga mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Avance K"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Avance K *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Guardar EEPROM"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar EEPROM"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Rest. fábrica"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inicializar EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Actualizar SD/USB"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetear Impresora"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Recargar"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Pantalla de Inf."); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Ajustar"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Iniciar impresión"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Siguinte"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Iniciar"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Parar"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Imprimir"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reiniciar"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Cancelar"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Listo"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impresión"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Reanudar impresión"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Detener impresión"); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Recuper. por interr."); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Imprim. desde SD/USB"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("SD/USB no presente"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Reposo..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Pulsar para Reanudar"); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Impresión Pausada"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Imprimiendo..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impresión cancelada"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sin movimiento"); + PROGMEM Language_Str MSG_KILLED = _UxGT("MUERTA"); + PROGMEM Language_Str MSG_STOPPED = _UxGT("DETENIDA"); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retraer mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Interc. Retraer mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraer V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Levantar mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("DesRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Interc. DesRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("DesRet V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retracción Auto."); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Inter. longitud"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Purgar longitud"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Cambiar Herramienta"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Aumentar Z"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Prime Speed"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Vel. de retracción"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Colocar boquilla"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambiar filamento"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambiar filamento *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Cargar filamento"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Cargar filamento *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Descargar filamento"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Descargar fil. *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Descargar todo"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Iniciar SD/USB"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambiar SD/USB"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Lanzar SD/USB"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z fuera cama"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Factor de desviación"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Auto-Prueba"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reiniciar"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Bajar pistón"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Subir pistón"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: Modo Software"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: Modo 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: Modo OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Modo almacenar"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Poner BLTouch a 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Poner BLTouch a OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Informe de drenaje"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("PELIGRO: ¡Una mala configuración puede producir daños! ¿Proceder igualmente?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Iniciar TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test de desfase Z"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Guardar"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Subir TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Subir Sonda Z"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Bajar Sonda Z"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Origen %s%s%s Primero"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Desfase Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Micropaso X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Calent. fallido"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Calent. cama fallido"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Calent. Cám. fallido"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP. REDUN."); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("FUGA TÉRMICA"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("FUGA TÉRMICA CAMA"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("FUGA TÉRMICA CAMARA"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err:TEMP. MÁX"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err:TEMP. MIN"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err:TEMP. MÁX CAMA"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err:TEMP. MIN CAMA"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err:TEMP. MÁX CÁMARA"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err:TEMP. MIN CÁMARA"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Origen XY Primero"); + PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESORA DETENIDA"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Por favor, reinicie"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Calentando..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Enfriando..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Calentando Cama..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Enfriando Cama..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Calentando Cámara..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Enfriando Cámara..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibración Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Configuración Delta"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibración"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Est. Altura Delta"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Ajustar Sonda Z"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Barra Diagonal"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Altura"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Radio"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Acerca de Impresora"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info. Impresora"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Nivelando 3puntos"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Nivelando Lineal"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Nivelando Bilineal"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Nivelando UBL"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Nivelando en Mallado"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadísticas Imp."); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info. Controlador"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistores"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusores"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudios"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocolo"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz cabina"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Brillo cabina"); -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp Mínima es ") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Boquilla: ") + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impresora incorrecta"); -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando para") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Cont. de impresión"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tiempo total de imp."); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Impresión más larga"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total Extruido"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Impresiones"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Más larga"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruido"); + #endif + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp. Mínima"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp. Máxima"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Fuente alimentación"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Fuerza de empuje"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("ERROR CONEX. TMC"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Escribe DAC EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIAR FILAMENTO"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("IMPRESIÓN PAUSADA"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("CARGAR FILAMENTO"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("DESCARGAR FILAMENTO"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPC. REINICIO:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purgar más"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Continuar imp."); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Boquilla: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Sensor de sección"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Dist de secc. mm"); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Ir a origen Fallado"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Sondeo Fallado"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Muy Frio"); -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte el filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y presione el botón") + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("ELIJE FILAMENTO"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("¡Actu. MMU Firmware!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU Necesita Cuidado"); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Continuar imp."); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Resumiendo..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Cargar Filamento"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Cargar Todo"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Cargar hasta boqui."); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Expulsar Filamento"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Expulsar Filamento ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Descargar Filamento"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Cargando Fil. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Expulsando Fil. ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Descargando Fil...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Todo"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filamento ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Reiniciar MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Reiniciando MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Retirar, y pulsar"); -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar cambio") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filamento") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar cambio fil.") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_MIX = _UxGT("Mezcla"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Componente ="); + PROGMEM Language_Str MSG_MIXER = _UxGT("Miezclador"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Degradado"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Degradado Total"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Mezcla Conmutada"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Mezcla Cíclica"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Mezcla de Degradado"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Degradado inverso"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Activar Herr.V"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Inicio Herr.V"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" Fin Herr.V"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias Herr.V"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reiniciar Herr.V"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Cometer mezc. Herr.V"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("Herr.V reiniciados"); + PROGMEM Language_Str MSG_START_Z = _UxGT("Inicio Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Fin Z:"); -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando para") -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("expulsar filamento") -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperado para") -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("cargar el 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 botón para") -#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Calentar la boquilla") -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Calentando boquilla") -#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Espere por favor") + PROGMEM Language_Str MSG_GAMES = _UxGT("Games"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); + + #if LCD_HEIGHT >= 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Pulsar el botón para", "reanudar impresión")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Aparcando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Esperando para", "iniciar el cambio", "de filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Inserte el filamento", "y pulse el botón", "para continuar...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Pulse el botón para", "calentar la boquilla")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Calentando boquilla", "Espere por favor...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Espere para", "liberar el filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Espere para", "purgar el filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Pulse para finalizar", "la purga de filamen.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Esperando impresora", "para reanudar...")); + #else + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Pulse para continuar")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Aparcando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Por Favor espere...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Inserte y Pulse")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Pulse para Calentar")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Calentando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Liberando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Cargando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purgando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Pulse para finalizar")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Reanudando...")); + #endif + + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Controladores TMC"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Amperaje Controlador"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Límite Hibrido"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Origen sin sensores"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Modo de pasos"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop Habilit."); + + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reiniciar"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" dentro:"); + + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Suavizado"); +} diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index a550260be4bc..29292157c7a5 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -32,357 +32,293 @@ #define DISPLAY_CHARSET_ISO10646_1 #define NOT_EXTENDED_ISO10646_1_5X7 -#define WELCOME_MSG MACHINE_NAME _UxGT(" prest.") -#define MSG_BACK _UxGT("Atzera") -#define MSG_SD_INSERTED _UxGT("Txartela sartuta") -#define MSG_SD_REMOVED _UxGT("Txartela kenduta") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu nagusia") -#define MSG_AUTOSTART _UxGT("Auto hasiera") -#define MSG_DISABLE_STEPPERS _UxGT("Itzali motoreak") -#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_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") -#define MSG_PREHEAT_1 _UxGT("Berotu " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#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_2 _UxGT("Berotu " PREHEAT_2_LABEL) -#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_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") +namespace Language_eu { + using namespace Language_en; // Inherit undefined strings from English -#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_TEMP_BED _UxGT("Ohearen tenperatura") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Mutur beroaren tenp.") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#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_MESH_M1 _UxGT(PREHEAT_1_LABEL " sarea sortu") -#define MSG_UBL_BUILD_MESH_M2 _UxGT(PREHEAT_2_LABEL " 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_MESH_M1 _UxGT(PREHEAT_1_LABEL " sarea balioetsi") -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT(PREHEAT_2_LABEL " 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_EDIT_MESH _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") + constexpr uint8_t CHARSIZE = 1; + PROGMEM Language_Str LANGUAGE = _UxGT("Basque-Euskera"); -#define MSG_MOVING _UxGT("Mugitzen...") -#define MSG_FREE_XY _UxGT("Askatu XY") -#define MSG_MOVE_X _UxGT("Mugitu X") -#define MSG_MOVE_Y _UxGT("Mugitu Y") -#define MSG_MOVE_Z _UxGT("Mugitu Z") -#define MSG_MOVE_E _UxGT("Estrusorea") -#define MSG_MOVE_0025MM _UxGT("Mugitu 0.025mm") -#define MSG_MOVE_01MM _UxGT("Mugitu 0.1mm") -#define MSG_MOVE_1MM _UxGT("Mugitu 1mm") -#define MSG_MOVE_10MM _UxGT("Mugitu 10mm") -#define MSG_SPEED _UxGT("Abiadura") -#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_FLOW _UxGT("Fluxua") -#define MSG_CONTROL _UxGT("Kontrola") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fakt") -#define MSG_AUTOTEMP _UxGT("Auto tenperatura") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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("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_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") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax ") -#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_ESTEPS _UxGT("E pausoak/mm") -#define MSG_E1STEPS _UxGT("E1 pausoak/mm") -#define MSG_E2STEPS _UxGT("E2 pausoak/mm") -#define MSG_E3STEPS _UxGT("E3 pausoak/mm") -#define MSG_E4STEPS _UxGT("E4 pausoak/mm") -#define MSG_E5STEPS _UxGT("E5 pausoak/mm") -#define MSG_E6STEPS _UxGT("E6 pausoak/mm") -#define MSG_TEMPERATURE _UxGT("Tenperatura") -#define MSG_MOTION _UxGT("Mugimendua") -#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") -#define MSG_TUNE _UxGT("Doitu") -#define MSG_PAUSE_PRINT _UxGT("Pausatu inprimak.") -#define MSG_RESUME_PRINT _UxGT("Jarraitu inprima.") -#define MSG_STOP_PRINT _UxGT("Gelditu inprima.") -#define MSG_CARD_MENU _UxGT("SD-tik inprimatu") -#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_PRINT_ABORTED _UxGT("Inprim. deusezta.") -#define MSG_NO_MOVE _UxGT("Mugimendu gabe.") -#define MSG_KILLED _UxGT("AKABATUTA. ") -#define MSG_STOPPED _UxGT("GELDITUTA. ") -#define MSG_CONTROL_RETRACT _UxGT("Atzera egin mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Atzera mm") -#define MSG_CONTROL_RETRACTF _UxGT("Atzera egin V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Igo mm") -#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_CHANGE_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") -#define MSG_BABYSTEP_X _UxGT("Mikro-urratsa X") -#define MSG_BABYSTEP_Y _UxGT("Mikro-urratsa Y") -#define MSG_BABYSTEP_Z _UxGT("Mikro-urratsa Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop deusezta.") -#define MSG_HEATING_FAILED_LCD _UxGT("Err: Beroketa") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: Tenperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("TENP. KONTROL EZA") -#define MSG_ERR_MAXTEMP _UxGT("Err: Tenp Maximoa") -#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_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_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") -#define MSG_INFO_EXTRUDERS _UxGT("Estrusoreak") -#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 - #define MSG_INFO_PRINT_COUNT _UxGT("Inprim. Zenbaketa") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Burututa") - #define MSG_INFO_PRINT_TIME _UxGT("Inprim. denbora") - #define MSG_INFO_PRINT_LONGEST _UxGT("Imprimatze luzeena") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estruituta guztira") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Inprimatze") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Burututa") - #define MSG_INFO_PRINT_TIME _UxGT("Guztira") - #define MSG_INFO_PRINT_LONGEST _UxGT("Luzeena") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estrusio") -#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_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_OPTION_HEADER _UxGT("ALDAKETA AUKERAK:") -//#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purge more") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Inprima. jarraitu") -#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 + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" prest."); + PROGMEM Language_Str MSG_BACK = _UxGT("Atzera"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Txartela sartuta"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Txartela kenduta"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu nagusia"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto hasiera"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Itzali motoreak"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Arazketa Menua"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Prog. Barra Proba"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Hasierara joan"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X jatorrira"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y jatorrira"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z jatorrira"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("XYZ hasieraratzen"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klik egin hasteko"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Hurrengo Puntua"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Berdintzea eginda"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Etxe. offset eza."); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsetak ezarrita"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Hasiera ipini"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Berotu ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Berotu ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Amaia"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Amaia ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Guztia"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Ohea"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Berotu ") PREHEAT_1_LABEL _UxGT(" Ezarp."); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Berotu ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Berotu ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Amaia"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Amaia ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Guztia"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Ohea"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Berotu ") PREHEAT_2_LABEL _UxGT(" Ezarp."); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Hoztu"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Energia piztu"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Energia itzali"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Estruitu"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Atzera eragin"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Ardatzak mugitu"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Ohe berdinketa"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Ohea berdindu"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Ertzak berdindu"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Hurrengo ertza"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Sarea editatu"); + + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 exekutatzen"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL Tresnak"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Sarea eskuz sortu"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Neurtu"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("UBL aktibatu"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL desaktibatu"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Ohearen tenperatura"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Mutur beroaren tenp."); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Sarea editatu"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Sarea editatzea eginda"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Sarea sortu"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = PREHEAT_1_LABEL _UxGT(" sarea sortu"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = PREHEAT_2_LABEL _UxGT(" sarea sortu"); + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Sare hotza sortu"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Sarearen altuera doitu"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Sarea balioetsi"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = PREHEAT_1_LABEL _UxGT(" sarea balioetsi"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = PREHEAT_2_LABEL _UxGT(" sarea balioetsi"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Ohe sarea balioetsi"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Sare berdinketa"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3 puntuko berdinketa"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Lauki-sare berdinketa"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Sarea berdindu"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Mapa mota"); + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED ezarpenak"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Argiak"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Argi aurrehautaketak"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Gorria"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Laranja"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Horia"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Berdea"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Urdina"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Bioleta"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Zuria"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Lehenetsia"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Argi pertsonalizatuak"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intentsitate gorria"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intentsitate berdea"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intentsitate urdina"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intentsitate zuria"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Distira"); + + PROGMEM Language_Str MSG_MOVING = _UxGT("Mugitzen..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Askatu XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mugitu X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mugitu Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mugitu Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Estrusorea"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Estrusorea *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mugitu %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mugitu 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mugitu 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mugitu 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Abiadura"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Ohea"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Pita"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Pita ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Ohea"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Haizagailu abiadura"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Haizagailu abiadura ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Haiz.gehig. abiadura"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Haiz.gehig. abiadura ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxua"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxua ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrola"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto tenperatura"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Aukeratu"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Aukeratu *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Azelerazioa"); + PROGMEM Language_Str MSG_JERK = _UxGT("Astindua"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-astindua"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-astindua"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-astindua"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-astindua"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VBidaia min"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retrakt"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-bidaia"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Pausoak/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" pausoak/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" pausoak/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" pausoak/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E pausoak/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* pausoak/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Tenperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Mugimendua"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Harizpia"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E mm3-tan"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Hariz. Dia."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Hariz. Dia. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Deskargatu mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Kargatu mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K Aurrerapena"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K Aurrerapena *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrastea"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gorde memoria"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Kargatu memoria"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Larri. berriz."); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM-a hasieratu"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Berriz kargatu"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Pantaila info"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Prestatu"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Doitu"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausatu inprimak."); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Jarraitu inprima."); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Gelditu inprima."); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("SD-tik inprimatu"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Ez dago SD-rik"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Lo egin..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Aginduak zain..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Inprim. geldi."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Inprim. deusezta."); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Mugimendu gabe."); + PROGMEM Language_Str MSG_KILLED = _UxGT("AKABATUTA. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("GELDITUTA. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Atzera egin mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Atzera mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Atzera egin V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Igo mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Atzera egin mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Swap Atzera mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Atzera egin V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Atzera egin"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Aldatu harizpia"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Aldatu harizpia *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Harizpia kargatu"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Harizpia kargatu *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Harizpia deskargatu"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Harizpia deskargatu *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Erabat deskargatu"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Hasieratu SD-a"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Aldatu txartela"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z zunda kanpora"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Okertze faktorea"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch AutoProba"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("BLTouch berrabia."); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch jaitsi/luzatu"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("BLTouch igo/jaso"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Etxera %s%s%s lehenengo"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z Konpentsatu"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Mikro-urratsa X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Mikro-urratsa Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Mikro-urratsa Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop deusezta."); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Err: Beroketa"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: Tenperatura"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TENP. KONTROL EZA"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: Tenp Maximoa"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: Tenp Minimoa"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: Ohe Tenp Max"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: Ohe Tenp Min"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Etxera XY lehenengo"); + PROGMEM Language_Str MSG_HALTED = _UxGT("INPRIMA. GELDIRIK"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Berrabia. Mesedez"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Berotzen..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Ohea Berotzen..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibraketa"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibratu X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibratu Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibratu Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibratu Zentrua"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta ezarpenak"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Kalibraketa"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Alt. Ezar."); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Barra diagonala"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Altuera"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Erradioa"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Inprimagailu Inf."); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Inprimagailu Inf."); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3 puntuko berdinketa"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Berdinketa lineala"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Berdinketa bilinearra"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Sare berdinketa"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Inprima. estatis."); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Txartelaren Info."); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistoreak"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Estrusoreak"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudioak"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokoloa"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Kabina Argia"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS + = ; + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Inprim. Zenbaketa"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Burututa"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Inprim. denbora"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Imprimatze luzeena"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Estruituta guztira"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Inprimatze"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Burututa"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Guztira"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Luzeena"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Estrusio"); + #endif + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Tenp. Minimoa"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Tenp. Maximoa"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Elikadura-iturria"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Driver-aren potentzia"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Idatzi DAC EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("HARIZPIA ALDATU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("HARIZPIA KARGATU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("HARIZPIA DESKARGATU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ALDAKETA AUKERAK:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Inprima. jarraitu"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Pita: "); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Hasi. huts egin du"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Neurketak huts egin du"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: hotzegi"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Inprimagailu okerra"); + + // + // Filament Change screens show up to 3 lines on a 4-line display + // ...or up to 2 lines on a 3-line display + // + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Mesedez, itxaron...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Deskargatzen...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Sartu eta click egin")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Berotzen...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Kargatzen...")); +} diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 101d7b44bc41..f262eee2b43b 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -30,141 +30,99 @@ */ #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" valmis.") -#define MSG_SD_INSERTED _UxGT("Kortti asetettu") -#define MSG_SD_REMOVED _UxGT("Kortti poistettu") -#define MSG_MAIN _UxGT("Palaa") -#define MSG_AUTOSTART _UxGT("Automaatti") -#define MSG_DISABLE_STEPPERS _UxGT("Vapauta moottorit") -#define MSG_AUTO_HOME _UxGT("Aja referenssiin") -#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!") -#define MSG_SET_HOME_OFFSETS _UxGT("Set home offsets") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") -#define MSG_SET_ORIGIN _UxGT("Aseta origo") -#define MSG_PREHEAT_1 _UxGT("Esilämmitä " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N _UxGT("Esilämmitä " PREHEAT_1_LABEL " ") -#define MSG_PREHEAT_1_ALL _UxGT("Esilä. " PREHEAT_1_LABEL " Kaikki") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Esilä. " PREHEAT_1_LABEL " Alusta") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Esilämm. " PREHEAT_1_LABEL " konf") -#define MSG_PREHEAT_2 _UxGT("Esilämmitä " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Esilämmitä " PREHEAT_2_LABEL " ") -#define MSG_PREHEAT_2_ALL _UxGT("Esilä. " PREHEAT_2_LABEL " Kaikki") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Esilä. " PREHEAT_2_LABEL " Alusta") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Esilämm. " PREHEAT_2_LABEL " konf") -#define MSG_COOLDOWN _UxGT("Jäähdytä") -#define MSG_SWITCH_PS_ON _UxGT("Virta päälle") -#define MSG_SWITCH_PS_OFF _UxGT("Virta pois") -#define MSG_EXTRUDE _UxGT("Pursota") -#define MSG_RETRACT _UxGT("Vedä takaisin") -#define MSG_MOVE_AXIS _UxGT("Liikuta akseleita") -#define MSG_MOVE_X _UxGT("Liikuta X") -#define MSG_MOVE_Y _UxGT("Liikuta Y") -#define MSG_MOVE_Z _UxGT("Liikuta Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_0025MM _UxGT("Liikuta 0.025mm") -#define MSG_MOVE_01MM _UxGT("Liikuta 0.1mm") -#define MSG_MOVE_1MM _UxGT("Liikuta 1mm") -#define MSG_MOVE_10MM _UxGT("Liikuta 10mm") -#define MSG_SPEED _UxGT("Nopeus") -#define MSG_NOZZLE _UxGT("Suutin") -#define MSG_BED _UxGT("Alusta") -#define MSG_FAN_SPEED _UxGT("Tuul. nopeus") -#define MSG_FLOW _UxGT("Virtaus") -#define MSG_CONTROL _UxGT("Kontrolli") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Kerr") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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_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_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VLiike min") -#define MSG_ACCELERATION MSG_ACC -#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_ESTEPS _UxGT("Esteps/mm") -#define MSG_E1STEPS _UxGT("E1steps/mm") -#define MSG_E2STEPS _UxGT("E2steps/mm") -#define MSG_E3STEPS _UxGT("E3steps/mm") -#define MSG_E4STEPS _UxGT("E4steps/mm") -#define MSG_E5STEPS _UxGT("E5steps/mm") -#define MSG_E6STEPS _UxGT("E6steps/mm") -#define MSG_TEMPERATURE _UxGT("Lämpötila") -#define MSG_MOTION _UxGT("Liike") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD kontrasti") -#define MSG_STORE_EEPROM _UxGT("Tallenna muistiin") -#define MSG_LOAD_EEPROM _UxGT("Lataa muistista") -#define MSG_RESTORE_FAILSAFE _UxGT("Palauta oletus") -#define MSG_REFRESH _UxGT("Päivitä") -#define MSG_WATCH _UxGT("Seuraa") -#define MSG_PREPARE _UxGT("Valmistele") -#define MSG_TUNE _UxGT("Säädä") -#define MSG_PAUSE_PRINT _UxGT("Keskeytä tulostus") -#define MSG_RESUME_PRINT _UxGT("Jatka tulostusta") -#define MSG_STOP_PRINT _UxGT("Pysäytä tulostus") -#define MSG_CARD_MENU _UxGT("Korttivalikko") -#define MSG_NO_CARD _UxGT("Ei korttia") -#define MSG_DWELL _UxGT("Nukkumassa...") -#define MSG_USERWAIT _UxGT("Odotet. valintaa") -#define MSG_PRINT_ABORTED _UxGT("Print aborted") -#define MSG_NO_MOVE _UxGT("Ei liiketta.") -#define MSG_KILLED _UxGT("KILLED. ") -#define MSG_STOPPED _UxGT("STOPPED. ") -#define MSG_CONTROL_RETRACT _UxGT("Vedä mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Va. Vedä mm") -#define MSG_CONTROL_RETRACTF _UxGT("Vedä V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Va. UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoVeto.") -#define MSG_FILAMENTCHANGE _UxGT("Change filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD-Card") -#define MSG_CHANGE_SDCARD _UxGT("Change SD-Card") -#define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") -#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 Offset") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrointi") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibroi X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibroi Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibroi Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibroi Center") +namespace Language_fi { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Finnish"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" valmis."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Kortti asetettu"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Kortti poistettu"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Palaa"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Automaatti"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Vapauta moottorit"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Aja referenssiin"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Aseta origo"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Esilämmitä ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Esilämmitä ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT("Suutin"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT("Suutin ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT(" Kaikki"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Esilä. ") PREHEAT_1_LABEL _UxGT(" Alusta"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Esilämm. ") PREHEAT_1_LABEL _UxGT(" konf"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Esilämmitä ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Esilämmitä ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Esilä. ") PREHEAT_2_LABEL _UxGT("Suutin"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Esilä. ") PREHEAT_2_LABEL _UxGT("Suutin ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Esilä. ") PREHEAT_2_LABEL _UxGT(" Kaikki"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Esilä. ") PREHEAT_2_LABEL _UxGT(" Alusta"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Esilämm. ") PREHEAT_2_LABEL _UxGT(" konf"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Jäähdytä"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Virta päälle"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Virta pois"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Pursota"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Vedä takaisin"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Liikuta akseleita"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Liikuta X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Liikuta Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Liikuta Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Liikuta %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Liikuta 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Liikuta 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Liikuta 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Nopeus"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Suutin"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Suutin ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Alusta"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Tuul. nopeus"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Tuul. nopeus ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Virtaus"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Virtaus ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrolli"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Kerr"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); + PROGMEM Language_Str MSG_ACC = _UxGT("Kiihtyv"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VLiike min"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-peruuta"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Lämpötila"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Liike"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrasti"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Tallenna muistiin"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Lataa muistista"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Palauta oletus"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Päivitä"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Seuraa"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Valmistele"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Säädä"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Keskeytä tulostus"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Jatka tulostusta"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Pysäytä tulostus"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Korttivalikko"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Ei korttia"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Nukkumassa..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Odotet. valintaa"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Ei liiketta."); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Vedä mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Va. Vedä mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Vedä V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Z mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Va. UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoVeto."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrointi"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibroi X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibroi Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibroi Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibroi Center"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Väärä tulostin"); +} diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 0f9a6ea160ed..3dc6f69a4ec2 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -30,513 +30,509 @@ */ #define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" prête.") -#define MSG_YES _UxGT("Oui") -#define MSG_NO _UxGT("Non") -#define MSG_BACK _UxGT("Retour") -#define MSG_SD_INSERTED _UxGT("Carte insérée") -#define MSG_SD_REMOVED _UxGT("Carte retirée") -#define MSG_SD_RELEASED _UxGT("Carte libérée") -#define MSG_LCD_ENDSTOPS _UxGT("Butées") -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Butées SW") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_ADVANCED_SETTINGS _UxGT("Config. avancée") -#define MSG_CONFIGURATION _UxGT("Configuration") -#define MSG_AUTOSTART _UxGT("Exéc. auto#.gcode") -#define MSG_DISABLE_STEPPERS _UxGT("Arrêter moteurs") -#define MSG_DEBUG_MENU _UxGT("Menu debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barre progress.") -#define MSG_AUTO_HOME _UxGT("Origine auto") -#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_AUTO_Z_ALIGN _UxGT("Align. Z auto") -#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_HOME_OFFSETS_APPLIED _UxGT("Décalages appliqués") -#define MSG_SET_ORIGIN _UxGT("Régler origine") -#define MSG_PREHEAT_1 _UxGT("Préchauffage " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N _UxGT("Préchauff. " PREHEAT_1_LABEL " ") -#define MSG_PREHEAT_1_ALL _UxGT("Préch. " PREHEAT_1_LABEL " Tout") -#define MSG_PREHEAT_1_END _UxGT("Préch. " PREHEAT_1_LABEL " buse") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Préch. " PREHEAT_1_LABEL " lit") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Régler préch. " PREHEAT_1_LABEL) -#define MSG_PREHEAT_2 _UxGT("Préchauffage " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Préchauff. " PREHEAT_2_LABEL " ") -#define MSG_PREHEAT_2_ALL _UxGT("Préch. " PREHEAT_2_LABEL " Tout") -#define MSG_PREHEAT_2_END _UxGT("Préch. " PREHEAT_2_LABEL " buse") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Préch. " PREHEAT_2_LABEL " lit") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Régler préch. " PREHEAT_2_LABEL) -#define MSG_PREHEAT_CUSTOM _UxGT("Préchauffage perso") -#define MSG_COOLDOWN _UxGT("Refroidir") -#define MSG_LASER_MENU _UxGT("Contrôle Laser") -#define MSG_LASER_OFF _UxGT("Laser Off") -#define MSG_LASER_ON _UxGT("Laser On") -#define MSG_LASER_POWER _UxGT("Puissance") -#define MSG_SPINDLE_REVERSE _UxGT("Inverser broches") -#define MSG_SWITCH_PS_ON _UxGT("Allumer alim.") -#define MSG_SWITCH_PS_OFF _UxGT("Eteindre alim.") -#define MSG_EXTRUDE _UxGT("Extrusion") -#define MSG_RETRACT _UxGT("Retrait") -#define MSG_MOVE_AXIS _UxGT("Déplacer un axe") -#define MSG_BED_LEVELING _UxGT("Régler Niv. lit") -#define MSG_LEVEL_BED _UxGT("Niveau du 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_MESH_X _UxGT("Index X") -#define MSG_MESH_Y _UxGT("Index Y") -#define MSG_MESH_EDIT_Z _UxGT("Valeur Z") -#define MSG_USER_MENU _UxGT("Commandes perso") +namespace Language_fr { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_UBL_DOING_G29 _UxGT("G29 en cours") -#define MSG_UBL_UNHOMED _UxGT("Origine XYZ requise") -#define MSG_UBL_TOOLS _UxGT("Outils UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifié") -#define MSG_LCD_PROBING_MESH _UxGT("Mesure point") -#define MSG_LCD_TILTING_MESH _UxGT("Touche point") -#define MSG_IDEX_MENU _UxGT("Mode IDEX") -#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Park") -#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplication") -#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Copie miroir") -#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Contrôle complet") -#define MSG_OFFSETS_MENU _UxGT("Offsets Outil") -#define MSG_X_OFFSET _UxGT("Buse 2 X") -#define MSG_Y_OFFSET _UxGT("Buse 2 Y") -#define MSG_Z_OFFSET _UxGT("Buse 2 Z") -#define MSG_UBL_MANUAL_MESH _UxGT("Maillage manuel") -#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_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") -#define MSG_UBL_SET_TEMP_BED _UxGT("Température lit") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Température buse") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#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("Réglage fin maille") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Terminer 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_MESH_M1 _UxGT("Créer maille " PREHEAT_1_LABEL) -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Créer maille " PREHEAT_2_LABEL) -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Créer maille froide") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajuster haut. maille") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Hauteur") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valider maille") -#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Valider maille " PREHEAT_1_LABEL) -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Valider maille " PREHEAT_2_LABEL) -#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 à 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("Point latéral") -#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 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_INFO_UBL _UxGT("Voir info UBL") -#define MSG_EDIT_MESH _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_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)") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Stockage maille") -#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ée") -#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") + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Français"); -#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("Defaut") -#define MSG_CUSTOM_LEDS _UxGT("LEDs 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é") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" prête."); + PROGMEM Language_Str MSG_YES = _UxGT("Oui"); + PROGMEM Language_Str MSG_NO = _UxGT("Non"); + PROGMEM Language_Str MSG_BACK = _UxGT("Retour"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Annulation..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Média inséré"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Média retiré"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Média libéré"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Attente média"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Err lecture média"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB débranché"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Erreur média USB"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Butées"); + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Butées SW"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Config. avancée"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuration"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Exéc. auto#.gcode"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Arrêter moteurs"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu debug"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barre progress."); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Origine auto"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Origine X auto"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Origine Y auto"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Origine Z auto"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Align. Z auto"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Origine XYZ..."); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Clic pour commencer"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Point suivant"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Mise à niveau OK!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Hauteur lissée"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Régl. décal origine"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Décalages appliqués"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Régler origine"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Préchauffage ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Préchauffage ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" buse"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" buse ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" Tout"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Préch. ") PREHEAT_1_LABEL _UxGT(" lit"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Régler préch. ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Préchauffage ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Préchauffage ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Préch. ") PREHEAT_2_LABEL _UxGT(" buse"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Préch. ") PREHEAT_2_LABEL _UxGT(" buse ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Préch. ") PREHEAT_2_LABEL _UxGT(" Tout"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Préch. ") PREHEAT_2_LABEL _UxGT(" lit"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Régler préch. ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Préchauf. perso"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Refroidir"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Contrôle Laser"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Puissance"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Inverser broches"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Allumer alim."); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Eteindre alim."); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrusion"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Rétraction"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Déplacer un axe"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Régler Niv. lit"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveau du lit"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Niveau des coins"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Coin suivant"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Edition Maillage"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Modifier maille"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Arrêt édit. maillage"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Mesure point"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valeur Z"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Commandes perso"); -#define MSG_MOVING _UxGT("Déplacement...") -#define MSG_FREE_XY _UxGT("Débloquer XY") -#define MSG_MOVE_X _UxGT("Déplacer X") -#define MSG_MOVE_Y _UxGT("Déplacer Y") -#define MSG_MOVE_Z _UxGT("Déplacer Z") -#define MSG_MOVE_E _UxGT("Extrudeur") -#define MSG_HOTEND_TOO_COLD _UxGT("Buse trop froide") -#define MSG_MOVE_0025MM _UxGT("Déplacer 0.025mm") -#define MSG_MOVE_01MM _UxGT("Déplacer 0.1mm") -#define MSG_MOVE_1MM _UxGT("Déplacer 1mm") -#define MSG_MOVE_10MM _UxGT("Déplacer 10mm") -#define MSG_SPEED _UxGT("Vitesse") -#define MSG_BED_Z _UxGT("Lit Z") -#define MSG_NOZZLE _UxGT("Buse") -#define MSG_BED _UxGT("Lit") -#define MSG_CHAMBER _UxGT("Caisson") -#define MSG_FAN_SPEED _UxGT("Vitesse ventil.") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra V ventil.") + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Touche point"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("Ecart sonde Z M48"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Ecart"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("Point M48"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Mode IDEX"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplication"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copie miroir"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Contrôle complet"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Offsets Outil"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("Buse 2 X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("Buse 2 Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("Buse 2 Z"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Chauffe lit"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Chauffe buse"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Amorce manuelle..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Amorce longueur fixe"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Amorce terminée"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 annulé"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Sortie G26"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 en cours"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Outils UBL"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Niveau lit unifié"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Maillage manuel"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Poser câle & mesurer"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Mesure"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("ôter et mesurer lit"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Aller au suivant"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Activer l'UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Désactiver l'UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Température lit"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Température lit"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Température buse"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Température buse"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Editer maille"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Editer maille perso"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Réglage fin maille"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Terminer maille"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Créer maille perso"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Créer maille"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Créer maille ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Créer maille ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Créer maille froide"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Ajuster haut. maille"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Hauteur"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Valider maille"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Valider maille ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Valider maille ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Valider maille perso"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continuer maille"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Niveau par maille"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Niveau à 3 points"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Niveau grille"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Maille de niveau"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Point latéral"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Type de carte"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Voir maille"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Voir pour hôte"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Voir pour CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Voir pour sauveg."); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Voir info UBL"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Taux de remplissage"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Remplissage manuel"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Remplissage auto"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Maille remplissage"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Tout annuler"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Annuler le plus près"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Réglage fin (tous)"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Réglage fin (proche)"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Stockage maille"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Slot mémoire"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Charger maille"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Sauver maille"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Maille %i chargée"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Maille %i enreg."); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Pas de mémoire"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Err: Enreg. UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Err: Ouvrir UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Décal. Z arrêté"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Pas à pas"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Créer maille froide"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Remplissage auto"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Valider maille"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Réglage fin (tous)"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Valider maille"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Réglage fin (tous)"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Sauver maille"); -#define MSG_FLOW _UxGT("Flux") -#define MSG_CONTROL _UxGT("Contrôler") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Facteur") -#define MSG_AUTOTEMP _UxGT("Temp. Auto.") -#define MSG_LCD_ON _UxGT("Marche") -#define MSG_LCD_OFF _UxGT("Arrêt") -#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("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_VELOCITY _UxGT("Vélocité") -#define MSG_JUNCTION_DEVIATION _UxGT("Déviat. jonct.") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin ") -#define MSG_VTRAV_MIN _UxGT("V dépl. 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_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_E6STEPS _UxGT("E6 pas/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ètre fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Retrait mm") -#define MSG_FILAMENT_LOAD _UxGT("Charger mm") -#define MSG_ADVANCE_K _UxGT("Avance K") -#define MSG_CONTRAST _UxGT("Contraste LCD") -#define MSG_STORE_EEPROM _UxGT("Enregistrer config.") -#define MSG_LOAD_EEPROM _UxGT("Charger config.") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurer défauts") -#define MSG_INIT_EEPROM _UxGT("Initialiser EEPROM") -#define MSG_SD_UPDATE _UxGT("MaJ Firmware SD") -#define MSG_RESET_PRINTER _UxGT("RaZ imprimante") -#define MSG_REFRESH _UxGT("Actualiser") -#define MSG_WATCH _UxGT("Surveiller") -#define MSG_PREPARE _UxGT("Préparer") -#define MSG_TUNE _UxGT("Régler") -#define MSG_START_PRINT _UxGT("Démarrer impression") -#define MSG_BUTTON_NEXT _UxGT("Suivant") -#define MSG_BUTTON_INIT _UxGT("Init.") -#define MSG_BUTTON_STOP _UxGT("Stop") -#define MSG_BUTTON_PRINT _UxGT("Imprimer") -#define MSG_BUTTON_RESET _UxGT("Reset") -#define MSG_BUTTON_CANCEL _UxGT("Annuler") -#define MSG_BUTTON_DONE _UxGT("Terminé") -#define MSG_PAUSE_PRINT _UxGT("Pause impression") -#define MSG_RESUME_PRINT _UxGT("Reprendre impr.") -#define MSG_STOP_PRINT _UxGT("Arrêter impr.") -#define MSG_OUTAGE_RECOVERY _UxGT("Récupér. coupure") -#define MSG_CARD_MENU _UxGT("Impression SD") -#define MSG_NO_CARD _UxGT("Pas de carte") -#define MSG_DWELL _UxGT("Repos...") -#define MSG_USERWAIT _UxGT("Attente utilis.") -#define MSG_PRINT_PAUSED _UxGT("Impr. en pause") -#define MSG_PRINTING _UxGT("Impression") -#define MSG_PRINT_ABORTED _UxGT("Impr. annulée") -#define MSG_NO_MOVE _UxGT("Moteurs bloqués") -#define MSG_KILLED _UxGT("KILLED") -#define MSG_STOPPED _UxGT("STOPPÉ") -#define MSG_CONTROL_RETRACT _UxGT("Retrait mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Ech. Retr. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retrait V") -#define MSG_CONTROL_RETRACT_ZHOP _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_TOOL_CHANGE _UxGT("Changement outil") -#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Augmenter Z") -#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Vitesse primaire") -#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Vitesse retrait") -#define MSG_NOZZLE_STANDBY _UxGT("Attente buse") -#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Distance retrait") -#define MSG_FILAMENTCHANGE _UxGT("Changer filament") -#define MSG_FILAMENTLOAD _UxGT("Charger filament") -#define MSG_FILAMENTUNLOAD _UxGT("Retrait filament") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Décharger tout") -#define MSG_INIT_SDCARD _UxGT("Init. la carte SD") -#define MSG_CHANGE_SDCARD _UxGT("Actualiser carte SD") -#define MSG_RELEASE_SDCARD _UxGT("Retirer carte SD") -#define MSG_ZPROBE_OUT _UxGT("Sonde Z hors lit") -#define MSG_SKEW_FACTOR _UxGT("Facteur écart") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("Cmd: Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("Cmd: Reset") -#define MSG_BLTOUCH_STOW _UxGT("Cmd: Ranger") -#define MSG_BLTOUCH_DEPLOY _UxGT("Cmd: Déployer") -#define MSG_BLTOUCH_SW_MODE _UxGT("Cmd: Mode SW") -#define MSG_BLTOUCH_5V_MODE _UxGT("Cmd: Mode 5V") -#define MSG_BLTOUCH_OD_MODE _UxGT("Cmd: Mode OD") -#define MSG_BLTOUCH_MODE_STORE _UxGT("Appliquer Mode") -#define MSG_BLTOUCH_MODE_STORE_5V _UxGT("Mise en 5V") -#define MSG_BLTOUCH_MODE_STORE_OD _UxGT("Mise en OD") -#define MSG_BLTOUCH_MODE_ECHO _UxGT("Afficher Mode") -#define MSG_TOUCHMI_PROBE _UxGT("TouchMI") -#define MSG_TOUCHMI_INIT _UxGT("Init. TouchMI") -#define MSG_TOUCHMI_ZTEST _UxGT("Test décalage Z") -#define MSG_TOUCHMI_SAVE _UxGT("Sauvegarde") -#define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("Déployer TouchMI") -#define MSG_MANUAL_DEPLOY _UxGT("Déployer Sonde Z") -#define MSG_MANUAL_STOW _UxGT("Ranger Sonde Z") -#define MSG_HOME _UxGT("Origine") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Premier") -#define MSG_ZPROBE_ZOFFSET _UxGT("Décalage Z") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_BABYSTEP_TOTAL _UxGT("Total") -#define MSG_ENDSTOP_ABORT _UxGT("Butée abandon") -#define MSG_HEATING_FAILED_LCD _UxGT("Err de chauffe") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Err de chauffe lit") -#define MSG_HEATING_FAILED_LCD_CHAMBER _UxGT("Err chauffe caisson") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err TEMP. REDONDANTE") -#define MSG_THERMAL_RUNAWAY _UxGT("Err THERMIQUE") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("Err THERMIQUE LIT") -#define MSG_THERMAL_RUNAWAY_CHAMBER _UxGT("Err THERMIQUE CAISSON") -#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_MAXTEMP_CHAMBER _UxGT("Err MAXTEMP CAISSON") -#define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err MINTEMP CAISSON") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Contrôle LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Lumière"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Préregl. LED"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Rouge"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Orange"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Jaune"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Vert"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Bleu"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Violet"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Blanc"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Defaut"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("LEDs perso."); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensité rouge"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensité vert"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensité bleu"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensité blanc"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Luminosité"); -#define MSG_HALTED _UxGT("IMPR. STOPPÉE") -#define MSG_PLEASE_RESET _UxGT("Redémarrer 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 + PROGMEM Language_Str MSG_MOVING = _UxGT("Déplacement..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Débloquer XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Déplacer X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Déplacer Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Déplacer Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudeur"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudeur *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Buse trop froide"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Déplacer %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Déplacer 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Déplacer 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Déplacer 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Vitesse"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Lit Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Buse"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Buse ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Lit"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Caisson"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vit. ventil. "); // 15 car. max + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vit. ventil. ="); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Vit. enreg. ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra ventil. "); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra ventil. ="); -#define MSG_HEATING _UxGT("En chauffe...") -#define MSG_COOLING _UxGT("Refroidissement") -#define MSG_BED_HEATING _UxGT("Lit en chauffe...") -#define MSG_BED_COOLING _UxGT("Refroid. du lit...") -#define MSG_CHAMBER_HEATING _UxGT("Chauffe caisson...") -#define MSG_CHAMBER_COOLING _UxGT("Refroid. caisson...") -#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_Z_OFFSET_CALIBRATE _UxGT("Delta Z sonde") -#define MSG_DELTA_DIAG_ROD _UxGT("Diagonale") -#define MSG_DELTA_HEIGHT _UxGT("Hauteur") -#define MSG_DELTA_RADIUS _UxGT("Rayon") + PROGMEM Language_Str MSG_FLOW = _UxGT("Flux"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flux ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Contrôler"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Facteur"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temp. Auto."); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Marche"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Arrêt"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Sélectionner"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Sélectionner *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Accélération"); + PROGMEM Language_Str MSG_JERK = _UxGT("Jerk"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT(" jerk"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT(" jerk"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT(" jerk"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve jerk"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Vélocité"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Déviat. jonct."); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vmin course"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accélération"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Acc.rétraction"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Acc.course"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Pas/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" pas/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" pas/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" pas/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E pas/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* pas/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Température"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Mouvement"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diamètre fil."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diamètre fil. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Retrait mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Charger mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Avance K"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Avance K *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Enregistrer config."); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Charger config."); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaurer défauts"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialiser EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("MaJ Firmware SD"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("RaZ imprimante"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Actualiser"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Surveiller"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Préparer"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Régler"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Démarrer impression"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Suivant"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Init."); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Imprimer"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Annuler"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Terminé"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Retour"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Procéder"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pause impression"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Reprendre impr."); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Arrêter impr."); + PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Impression objet"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Annuler objet"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Annuler objet ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Récup. coup."); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Impression SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Pas de média"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Repos..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Attente utilis."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Impr. en pause"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Impression"); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impr. annulée"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Moteurs bloqués"); + PROGMEM Language_Str MSG_KILLED = _UxGT("KILLED"); + PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPÉ"); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Rétraction mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Ech. rétr. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Vit. rétract°"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Saut Z mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Rét.reprise mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Ech.reprise mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("V.rét. reprise"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("V.éch. reprise"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Rétraction auto"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Changement outil"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Augmenter Z"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Vitesse primaire"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Vitesse rétract°"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Attente buse"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Longueur retrait"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Longueur de purge"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Changer filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Changer filament *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Charger filament"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Charger filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Retrait filament"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Retrait filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Retirer tout"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Charger le média"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Actualiser média"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Retirer le média"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonde Z hors lit"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Facteur écart"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reset"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Ranger"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Déployer"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: Mode SW"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: Mode 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: Mode OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Appliquer Mode"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Mise en 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Mise en OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Afficher Mode"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Init. TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test décalage Z"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Sauvegarde"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Déployer TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Déployer Sonde Z"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Ranger Sonde Z"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Origine %s%s%s Premier"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Décalage Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Total"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Butée abandon"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Err de chauffe"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err TEMP. REDONDANTE"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Err THERMIQUE"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err TEMP. MAX"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err TEMP. MIN"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Origine XY Premier"); -#define MSG_INFO_MENU _UxGT("Infos imprimante") -#define MSG_INFO_PRINTER_MENU _UxGT("Infos imprimante") -#define MSG_3POINT_LEVELING _UxGT("Niveau à 3 points") -#define MSG_LINEAR_LEVELING _UxGT("Niveau linéaire") -#define MSG_BILINEAR_LEVELING _UxGT("Niveau bilinéaire") -#define MSG_UBL_LEVELING _UxGT("Niveau lit unifié") -#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("Thermistances") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudeurs") -#define MSG_INFO_BAUDRATE _UxGT("Bauds") -#define MSG_INFO_PROTOCOL _UxGT("Protocole") -#define MSG_CASE_LIGHT _UxGT("Lumière caisson") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Luminosité") + PROGMEM Language_Str MSG_HALTED = _UxGT("IMPR. STOPPÉE"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Redémarrer SVP"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("j"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Nbre impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminées") - #define MSG_INFO_PRINT_TIME _UxGT("Tps impr. total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Impr. la + longue") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total filament") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Impressions") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Terminées") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("+ long") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filament") -#endif + PROGMEM Language_Str MSG_HEATING = _UxGT("En chauffe..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Refroidissement"); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Lit en chauffe..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Refroid. du lit..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Chauffe caisson..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Refroid. caisson..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibration Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrer X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrer Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrer Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrer centre"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Réglages Delta"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Calibration Auto"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Hauteur Delta"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Delta Z sonde"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diagonale"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Hauteur"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Rayon"); -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") -#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("DAC EEPROM sauv.") + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Infos imprimante"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Infos imprimante"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Niveau à 3 points"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Niveau linéaire"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Niveau bilinéaire"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Niveau lit unifié"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Niveau maillage"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Stats. imprimante"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Infos carte"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistances"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrudeurs"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Bauds"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocole"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Lumière caisson"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosité"); -#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_OPTION_RESUME _UxGT("Reprendre impr.") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Buse: ") -#define MSG_RUNOUT_SENSOR _UxGT("Capteur fil.") -#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") -#define MSG_MMU2_FILAMENT_CHANGE_HEADER _UxGT("CHANGER FILAMENT") -#define MSG_MMU2_CHOOSE_FILAMENT_HEADER _UxGT("CHOISIR FILAMENT") -#define MSG_MMU2_MENU _UxGT("MMU") -#define MSG_MMU2_WRONG_FIRMWARE _UxGT("Update MMU firmware!") -#define MSG_MMU2_NOT_RESPONDING _UxGT("MMU ne répond plus") -#define MSG_MMU2_RESUME _UxGT("Continuer impr.") -#define MSG_MMU2_RESUMING _UxGT("Reprise...") -#define MSG_MMU2_LOAD_FILAMENT _UxGT("Charger filament") -#define MSG_MMU2_LOAD_ALL _UxGT("Charger tous") -#define MSG_MMU2_LOAD_TO_NOZZLE _UxGT("Charger dans buse") -#define MSG_MMU2_EJECT_FILAMENT _UxGT("Ejecter filament") -#define MSG_MMU2_EJECT_FILAMENT0 _UxGT("Ejecter fil. 1") -#define MSG_MMU2_EJECT_FILAMENT1 _UxGT("Ejecter fil. 2") -#define MSG_MMU2_EJECT_FILAMENT2 _UxGT("Ejecter fil. 3") -#define MSG_MMU2_EJECT_FILAMENT3 _UxGT("Ejecter fil. 4") -#define MSG_MMU2_EJECT_FILAMENT4 _UxGT("Ejecter fil. 5") -#define MSG_MMU2_UNLOAD_FILAMENT _UxGT("Retrait filament") -#define MSG_MMU2_LOADING_FILAMENT _UxGT("Chargem. fil. %i...") -#define MSG_MMU2_EJECTING_FILAMENT _UxGT("Ejection fil...") -#define MSG_MMU2_UNLOADING_FILAMENT _UxGT("Retrait fil....") -#define MSG_MMU2_ALL _UxGT("Tous") -#define MSG_MMU2_FILAMENT0 _UxGT("Filament 1") -#define MSG_MMU2_FILAMENT1 _UxGT("Filament 2") -#define MSG_MMU2_FILAMENT2 _UxGT("Filament 3") -#define MSG_MMU2_FILAMENT3 _UxGT("Filament 4") -#define MSG_MMU2_FILAMENT4 _UxGT("Filament 5") -#define MSG_MMU2_RESET _UxGT("Réinit. MMU") -#define MSG_MMU2_RESETTING _UxGT("Réinit. MMU...") -#define MSG_MMU2_EJECT_RECOVER _UxGT("Retrait, click") + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Imprimante incorrecte"); -#define MSG_MIX _UxGT("Mix") -#define MSG_MIX_COMPONENT _UxGT("Composante") -#define MSG_MIXER _UxGT("Mixeur") -#define MSG_GRADIENT _UxGT("Dégradé") -#define MSG_FULL_GRADIENT _UxGT("Dégradé complet") -#define MSG_TOGGLE_MIX _UxGT("Toggle mix") -#define MSG_CYCLE_MIX _UxGT("Cycle mix") -#define MSG_GRADIENT_MIX _UxGT("Mix dégradé") -#define MSG_REVERSE_GRADIENT _UxGT("Inverser dégradé") -#define MSG_ACTIVE_VTOOL _UxGT("Active V-tool") -#define MSG_START_VTOOL _UxGT("Début V-tool") -#define MSG_END_VTOOL _UxGT(" Fin V-tool") -#define MSG_GRADIENT_ALIAS _UxGT("Alias V-tool") -#define MSG_RESET_VTOOLS _UxGT("Réinit. V-tools") -#define MSG_COMMIT_VTOOL _UxGT("Valider Mix V-tool") -#define MSG_VTOOLS_RESET _UxGT("V-tools réinit. ok") -#define MSG_START_Z _UxGT("Début Z") -#define MSG_END_Z _UxGT(" Fin Z") -#define MSG_BRICKOUT _UxGT("Casse-briques") -#define MSG_INVADERS _UxGT("Invaders") -#define MSG_SNAKE _UxGT("Sn4k3") -#define MSG_MAZE _UxGT("Labyrinthe") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Nbre impressions"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Terminées"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tps impr. total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Impr. la + longue"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total filament"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Impressions"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Terminées"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Total"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("+ long"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Filament"); + #endif -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Presser bouton") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("pour reprendre") - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Parking...") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attente filament") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("pour démarrer") - #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("Patienter SVP...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("retrait du filament") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("chargement filament") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Attente") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("Purge filament") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Presser pour finir") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("la purge du filament") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Attente reprise") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("impression") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Presser pr continuer") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Patience...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insérer fil.") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Chauffer ?") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Chauffage...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Retrait fil...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Chargement...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purge...") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Terminer ?") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reprise...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp Min"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp Max"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Alimentation"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Puiss. moteur "); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM sauv."); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("ERREUR CONNEXION TMC"); -#define MSG_TMC_DRIVERS _UxGT("Drivers TMC") -#define MSG_TMC_CURRENT _UxGT("Courant driver") -#define MSG_TMC_HYBRID_THRS _UxGT("Seuil hybride") -#define MSG_TMC_HOMING_THRS _UxGT("Home sans capteur") -#define MSG_TMC_STEPPING_MODE _UxGT("Mode pas à pas") -#define MSG_TMC_STEALTH_ENABLED _UxGT("StealthChop activé") -#define MSG_SERVICE_RESET _UxGT("Réinit.") -#define MSG_SERVICE_IN _UxGT(" dans:") -#define MSG_BACKLASH _UxGT("Backlash") -#define MSG_BACKLASH_CORRECTION _UxGT("Correction") -#define MSG_BACKLASH_SMOOTHING _UxGT("Lissage") + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("CHANGER FILAMENT"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("IMPR. PAUSE"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("CHARGER FIL"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("DECHARGER FIL"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPTIONS REPRISE:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purger encore"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Reprendre impr."); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Buse: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Capteur fil."); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Echec origine"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Echec sonde"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Trop froid"); + + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("CHOISIR FILAMENT"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU ne répond plus"); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Continuer impr."); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Reprise..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Charger filament"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Charger tous"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Charger dans buse"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Ejecter filament"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Ejecter fil. ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Retrait filament"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Chargem. fil. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Ejection fil..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Retrait fil...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Tous"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Réinit. MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Réinit. MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Retrait, click"); + + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Composante ~"); + PROGMEM Language_Str MSG_MIXER = _UxGT("Mixeur"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Dégradé"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Dégradé complet"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Toggle mix"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Cycle mix"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Mix dégradé"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Inverser dégradé"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Active V-tool"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Début V-tool"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" Fin V-tool"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-tool"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Réinit. V-tools"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Valider Mix V-tool"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools réinit. ok"); + PROGMEM Language_Str MSG_START_Z = _UxGT("Début Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" Fin Z:"); + PROGMEM Language_Str MSG_GAMES = _UxGT("Jeux"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Casse-briques"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Labyrinthe"); + + #if LCD_HEIGHT >= 4 + // Up to 3 lines allowed + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Presser bouton", "pour reprendre")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parking...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("Attente filament", "pour démarrer")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Insérer filament", "et app. bouton", "pour continuer...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Presser le bouton", "pour chauffer...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Buse en chauffe", "Patienter SVP...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Attente", "retrait du filament")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Attente", "chargement filament")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Attente", "Purge filament")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Presser pour finir", "la purge du filament")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Attente reprise", "impression")); + #else // LCD_HEIGHT < 4 + // Up to 2 lines allowed + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Clic pour continuer")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Patience...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Insérer fil.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Chauffer ?")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Chauffage...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Retrait fil...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Chargement...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purge...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Terminer ?")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Reprise...")); + #endif // LCD_HEIGHT < 4 + + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Courant driver"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Seuil hybride"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Home sans capteur"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Mode pas à pas"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop activé"); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Réinit."); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" dans:"); + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Lissage"); +} diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index cc32251bd460..383bec9fd533 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -32,221 +32,184 @@ #define DISPLAY_CHARSET_ISO10646_1 #define NOT_EXTENDED_ISO10646_1_5X7 -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") -#define MSG_SD_INSERTED _UxGT("Tarxeta inserida") -#define MSG_SD_REMOVED _UxGT("Tarxeta retirada") -#define MSG_LCD_ENDSTOPS _UxGT("FinCarro") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autoarranque") -#define MSG_DISABLE_STEPPERS _UxGT("Apagar motores") -#define MSG_AUTO_HOME _UxGT("Ir a orixe") -#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_LEVEL_BED_HOMING _UxGT("Ir orixes XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Prema pulsador") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Seguinte punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelado feito") -#define MSG_SET_HOME_OFFSETS _UxGT("Offsets na orixe") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets fixados") -#define MSG_SET_ORIGIN _UxGT("Fixar orixe") -#define MSG_PREHEAT_1 _UxGT("Prequentar " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N _UxGT("Prequentar " PREHEAT_1_LABEL " ") -#define MSG_PREHEAT_1_ALL _UxGT("Preque. " PREHEAT_1_LABEL " Todo") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Preque. " PREHEAT_1_LABEL " Cama") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Preque. " PREHEAT_1_LABEL " conf") -#define MSG_PREHEAT_2 _UxGT("Prequentar " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Prequentar " PREHEAT_2_LABEL " ") -#define MSG_PREHEAT_2_ALL _UxGT("Preque. " PREHEAT_2_LABEL " Todo") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Preque. " PREHEAT_2_LABEL " Cama") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Preque. " PREHEAT_2_LABEL " conf") -#define MSG_COOLDOWN _UxGT("Arrefriar") -#define MSG_SWITCH_PS_ON _UxGT("Acender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") -#define MSG_EXTRUDE _UxGT("Extrudir") -#define MSG_RETRACT _UxGT("Retraer") -#define MSG_MOVE_AXIS _UxGT("Mover eixe") -#define MSG_BED_LEVELING _UxGT("Nivelar cama") -#define MSG_LEVEL_BED _UxGT("Nivelar cama") -#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("Extrusor") -#define MSG_MOVE_0025MM _UxGT("Mover 0.025mm") -#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("Cama Z") -#define MSG_NOZZLE _UxGT("Bico") -#define MSG_BED _UxGT("Cama") -#define MSG_FAN_SPEED _UxGT("Velocidade vent.") -#define MSG_FLOW _UxGT("Fluxo") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_AMAX _UxGT("Amax ") -#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_E6STEPS _UxGT("E6 pasos/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movemento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") -#define MSG_FILAMENT_DIAM _UxGT("Diam. fil.") -#define MSG_CONTRAST _UxGT("Constraste LCD") -#define MSG_STORE_EEPROM _UxGT("Gardar en memo.") -#define MSG_LOAD_EEPROM _UxGT("Cargar de memo.") -#define MSG_RESTORE_FAILSAFE _UxGT("Cargar de firm.") -#define MSG_REFRESH _UxGT("Volver a cargar") -#define MSG_WATCH _UxGT("Monitorizacion") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Axustar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impres.") -#define MSG_RESUME_PRINT _UxGT("Seguir impres.") -#define MSG_STOP_PRINT _UxGT("Deter impres.") -#define MSG_CARD_MENU _UxGT("Tarxeta SD") -#define MSG_NO_CARD _UxGT("Sen tarxeta SD") -#define MSG_DWELL _UxGT("En repouso...") -#define MSG_USERWAIT _UxGT("A espera...") -#define MSG_PRINT_ABORTED _UxGT("Impre. cancelada") -#define MSG_NO_MOVE _UxGT("Sen movemento.") -#define MSG_KILLED _UxGT("PROGRAMA MORTO") -#define MSG_STOPPED _UxGT("PROGRAMA PARADO") -#define MSG_CONTROL_RETRACT _UxGT("Retraccion mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Cambio retra. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraccion V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Alzar Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Recup. retra. mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Cambio recup. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Recuperacion V") -#define MSG_AUTORETRACT _UxGT("Retraccion auto.") -#define MSG_FILAMENTCHANGE _UxGT("Cambiar filamen.") -#define MSG_INIT_SDCARD _UxGT("Iniciando SD") -#define MSG_CHANGE_SDCARD _UxGT("Cambiar SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda-Z sen cama") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_BLTOUCH_SELFTEST _UxGT("Comprobar BLTouch") -#define MSG_BLTOUCH_RESET _UxGT("Iniciar BLTouch") -#define MSG_FIRST _UxGT("first") -#define MSG_ZPROBE_ZOFFSET _UxGT("Offset Z") -#define MSG_BABYSTEP_X _UxGT("Micropaso X") -#define MSG_BABYSTEP_Y _UxGT("Micropaso Y") -#define MSG_BABYSTEP_Z _UxGT("Micropaso Z") -#define MSG_ENDSTOP_ABORT _UxGT("Erro fin carro") -#define MSG_HEATING_FAILED_LCD _UxGT("Fallo quentando") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro temperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("Temp. excesiva") -#define MSG_ERR_MAXTEMP _UxGT("Err: temp. max.") -#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_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_DELTA_CALIBRATE _UxGT("Calibracion 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_INFO_MENU _UxGT("Acerca de...") -#define MSG_INFO_PRINTER_MENU _UxGT("Informacion") -#define MSG_INFO_STATS_MENU _UxGT("Estadisticas") -#define MSG_INFO_BOARD_MENU _UxGT("Placa nai") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistores") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusores") -#define MSG_INFO_BAUDRATE _UxGT("Baudios") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Total traballos") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Total completos") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo impresion") - #define MSG_INFO_PRINT_LONGEST _UxGT("Traballo +longo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total extruido") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Traballos") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completos") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo") - #define MSG_INFO_PRINT_LONGEST _UxGT("O +longo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruido") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Fonte alime.") -#define MSG_DRIVE_STRENGTH _UxGT("Potencia motor") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Garda DAC EEPROM") +namespace Language_gl { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Segue traballo") + constexpr uint8_t CHARSIZE = 1; + PROGMEM Language_Str LANGUAGE = _UxGT("Galician"); -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Agarde para") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar troco") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filamento") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Agarde pola") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("descarga do") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamento") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Introduza o") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("filamento e") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("faga click") - #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_RESUME_1 _UxGT("Agarde para") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("seguir co") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("traballo") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Agarde...") - #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_RESUME_1 _UxGT("Seguindo...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" lista."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Tarxeta inserida"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Tarxeta retirada"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("FinCarro"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autoarranque"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Apagar motores"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Ir a orixe"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Ir orixe X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Ir orixe Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Ir orixe Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Ir orixes XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Prema pulsador"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Seguinte punto"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Nivelado feito"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Offsets na orixe"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets fixados"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Fixar orixe"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Prequentar ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Prequentar ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Bico"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Bico ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Todo"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" Cama"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preque. ") PREHEAT_1_LABEL _UxGT(" conf"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Prequentar ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Prequentar ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" Bico"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" Bico ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" Todo"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" Cama"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Preque. ") PREHEAT_2_LABEL _UxGT(" conf"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Arrefriar"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Acender"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Apagar"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudir"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retraer"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover eixe"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelar cama"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar cama"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrusor"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrusor *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidade"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Cama Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Bico"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Bico ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Cama"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Velocidade vent."); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Velocidade vent. ~"); + PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxo"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxo ~"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Escolla"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Escolla *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Acel"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Pasos/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" pasos/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" pasos/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" pasos/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E pasos/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* pasos/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Movemento"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E en mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. fil."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. fil. *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Constraste LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gardar en memo."); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar de memo."); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Cargar de firm."); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Volver a cargar"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Monitorizacion"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Axustar"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impres."); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Seguir impres."); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Deter impres."); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Tarxeta SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Sen tarxeta SD"); + PROGMEM Language_Str MSG_DWELL = _UxGT("En repouso..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("A espera..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impre. cancelada"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sen movemento."); + PROGMEM Language_Str MSG_KILLED = _UxGT("PROGRAMA MORTO"); + PROGMEM Language_Str MSG_STOPPED = _UxGT("PROGRAMA PARADO"); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retraccion mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Cambio retra. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraccion V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Alzar Z mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Recup. retra. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Cambio recup. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Recuperacion V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retraccion auto."); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambiar filamen."); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambiar filamen. *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Iniciando SD"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambiar SD"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda-Z sen cama"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Comprobar BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Iniciar BLTouch"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Offset Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Micropaso X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Erro fin carro"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Fallo quentando"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Erro temperatura"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Temp. excesiva"); + PROGMEM Language_Str MSG_HALTED = _UxGT("SISTEMA MORTO"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Debe reiniciar!"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Quentando..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Quentando cama..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibracion Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Acerca de..."); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Informacion"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estadisticas"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Placa nai"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistores"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusores"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baudios"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocolo"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz"); + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total traballos"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Total completos"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo impresion"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Traballo +longo"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total extruido"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Traballos"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completos"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("O +longo"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extruido"); + #endif + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Fonte alime."); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Potencia motor"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Garda DAC EEPROM"); + + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Segue traballo"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impresora incorrecta"); + + #if LCD_HEIGHT >= 4 + // Up to 3 lines allowed + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Agarde para", "iniciar troco", "de filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Agarde pola", "descarga do", "filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Introduza o", "filamento e", "faga click")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Agarde pola", "carga do", "filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Agarde para", "seguir co", "traballo")); + #else // LCD_HEIGHT < 4 + // Up to 2 lines allowed + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Agarde...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Descargando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Introduza e click")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Cargando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Seguindo...")); + #endif // LCD_HEIGHT < 4 +} diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 39607b56ebfb..573ebb9f1ac6 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -30,222 +30,139 @@ */ #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") -#define MSG_SD_REMOVED _UxGT("SD kartica uklonjena") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Main") -#define MSG_AUTOSTART _UxGT("Auto pokretanje") -#define MSG_DISABLE_STEPPERS _UxGT("Ugasi steppere") -#define MSG_AUTO_HOME _UxGT("Automatski homing") -#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_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") -#define MSG_LEVEL_BED_DONE _UxGT("Niveliranje gotovo!") -#define MSG_SET_HOME_OFFSETS _UxGT("Postavi home offsete") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets postavljeni") -#define MSG_SET_ORIGIN _UxGT("Postavi ishodište") -#define MSG_PREHEAT_1 _UxGT("Predgrij " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Sve") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Bed") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") -#define MSG_PREHEAT_2 _UxGT("Predgrij " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Sve") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" conf") -#define MSG_COOLDOWN _UxGT("Hlađenje") -#define MSG_SWITCH_PS_ON _UxGT("Uključi napajanje") -#define MSG_SWITCH_PS_OFF _UxGT("Isključi napajanje") -#define MSG_EXTRUDE _UxGT("Extrude") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("Miči os") -#define MSG_BED_LEVELING _UxGT("Niveliraj bed") -#define MSG_LEVEL_BED _UxGT("Niveliraj bed") -#define MSG_MOVE_X _UxGT("Miči X") -#define MSG_MOVE_Y _UxGT("Miči Y") -#define MSG_MOVE_Z _UxGT("Miči Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_0025MM _UxGT("Miči 0.025mm") -#define MSG_MOVE_01MM _UxGT("Miči 0.1mm") -#define MSG_MOVE_1MM _UxGT("Miči 1mm") -#define MSG_MOVE_10MM _UxGT("Miči 10mm") -#define MSG_SPEED _UxGT("Brzina") -#define MSG_BED_Z _UxGT("Bed Z") -#define MSG_NOZZLE _UxGT("Dizna") -#define MSG_BED _UxGT("Bed") -#define MSG_FAN_SPEED _UxGT("Brzina ventilatora") -#define MSG_FLOW _UxGT("Flow") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_AMAX _UxGT("Amax ") -#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_ESTEPS _UxGT("Esteps/mm") -#define MSG_E1STEPS _UxGT("E1steps/mm") -#define MSG_E2STEPS _UxGT("E2steps/mm") -#define MSG_E3STEPS _UxGT("E3steps/mm") -#define MSG_E4STEPS _UxGT("E4steps/mm") -#define MSG_E5STEPS _UxGT("E5steps/mm") -#define MSG_E6STEPS _UxGT("E6steps/mm") -#define MSG_TEMPERATURE _UxGT("Temperature") -#define MSG_MOTION _UxGT("Gibanje") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("Kontrast LCD-a") -#define MSG_STORE_EEPROM _UxGT("Pohrani u memoriju") -#define MSG_LOAD_EEPROM _UxGT("Učitaj memoriju") -#define MSG_RESTORE_FAILSAFE _UxGT("Učitaj failsafe") -#define MSG_REFRESH _UxGT("Osvježi") -#define MSG_WATCH _UxGT("Info screen") -#define MSG_PREPARE _UxGT("Pripremi") -#define MSG_TUNE _UxGT("Tune") -#define MSG_PAUSE_PRINT _UxGT("Pauziraj print") -#define MSG_RESUME_PRINT _UxGT("Nastavi print") -#define MSG_STOP_PRINT _UxGT("Zaustavi print") -#define MSG_CARD_MENU _UxGT("Printaj s SD kartice") -#define MSG_NO_CARD _UxGT("Nema SD kartice") -#define MSG_DWELL _UxGT("Sleep...") -#define MSG_USERWAIT _UxGT("Čekaj korisnika...") -#define MSG_PRINT_ABORTED _UxGT("Print otkazan") -#define MSG_NO_MOVE _UxGT("No move.") -#define MSG_KILLED _UxGT("KILLED. ") -#define MSG_STOPPED _UxGT("ZAUSTAVLJEN. ") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") -#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_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Promijeni filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD karticu") -#define MSG_CHANGE_SDCARD _UxGT("Promijeni SD karticu") -#define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("Reset 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 Offset") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") -#define MSG_HEATING_FAILED_LCD _UxGT("Grijanje neuspješno") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") -#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP _UxGT("Err: MAXTEMP") -#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("Grijanje...") -#define MSG_BED_HEATING _UxGT("Grijanje Bed-a...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibracija") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriraj X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriraj Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibriraj Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibriraj Središte") -#define MSG_INFO_MENU _UxGT("O printeru") -#define MSG_INFO_PRINTER_MENU _UxGT("Podaci o printeru") -#define MSG_INFO_STATS_MENU _UxGT("Statistika printera") -#define MSG_INFO_BOARD_MENU _UxGT("Podaci o elektronici") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistori") -#define MSG_INFO_EXTRUDERS _UxGT("Extruderi") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvjetljenje") +namespace Language_hr { + using namespace Language_en; // Inherit undefined strings from English -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Broj printova") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Završeni") - #define MSG_INFO_PRINT_TIME _UxGT("Ukupno printanja") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najduži print") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrudirano ukupno") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Printovi") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Završeni") - #define MSG_INFO_PRINT_TIME _UxGT("Ukupno") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najduži") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrudirano") -#endif + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Croatian"); -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Napajanje") -#define MSG_DRIVE_STRENGTH _UxGT("Drive Strength") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" spreman."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD kartica umetnuta"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD kartica uklonjena"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("Main"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto pokretanje"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Ugasi steppere"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Automatski homing"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home-aj X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home-aj Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home-aj Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Home-aj XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klikni za početak"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Sljedeća točka"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Niveliranje gotovo!"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Postavi home offsete"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets postavljeni"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Postavi ishodište"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Predgrij ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Predgrij ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Dizna"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Dizna ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Sve"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" Bed"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Predgrij ") PREHEAT_1_LABEL _UxGT(" conf"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Predgrij ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Predgrij ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" Dizna"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" Dizna ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" Sve"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" Bed"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Predgrij ") PREHEAT_2_LABEL _UxGT(" conf"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Hlađenje"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Uključi napajanje"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Isključi napajanje"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Miči os"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Niveliraj bed"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveliraj bed"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Miči X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Miči Y"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Miči %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Miči 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Miči 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Miči 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Brzina"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Dizna"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Dizna ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Bed"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Brzina ventilatora"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Brzina ventilatora ~"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Odaberi"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Odaberi *"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperature"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Gibanje"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD-a"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Pohrani u memoriju"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Učitaj memoriju"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Učitaj failsafe"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Osvježi"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Info screen"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Pripremi"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pauziraj print"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Nastavi print"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Zaustavi print"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Printaj s SD kartice"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Nema SD kartice"); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Čekaj korisnika..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print otkazan"); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ZAUSTAVLJEN. "); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Promijeni filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Promijeni filament *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Init. SD karticu"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Promijeni SD karticu"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Grijanje neuspješno"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Grijanje..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Grijanje Bed-a..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibracija"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibriraj X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibriraj Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibriraj Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibriraj Središte"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("O printeru"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Podaci o printeru"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statistika printera"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Podaci o elektronici"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistori"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruderi"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Osvjetljenje"); -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Nastavi print") + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Neispravan pisač"); -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekaj početak") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filamenta") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("promijeni") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čekaj") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Umetni filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i pritisni tipku") - #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_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("Pričekaj...") - #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_RESUME_1 _UxGT("Nastavljam...") -#endif // LCD_HEIGHT < 4 + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Broj printova"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Završeni"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Ukupno printanja"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najduži print"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrudirano ukupno"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Printovi"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Završeni"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Ukupno"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najduži"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrudirano"); + #endif + + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Napajanje"); + + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Nastavi print"); + + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Čekaj", "filament unload")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Pričekaj", "filament load")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Nastavljam...")); + + #if LCD_HEIGHT >= 4 + // Up to 3 lines allowed + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Čekaj početak", "filamenta", "promijeni")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Umetni filament", "i pritisni tipku", "za nastavak...")); + #else + // Up to 2 lines allowed + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT("Pričekaj..."); + //PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_2_LINE("?", "?")); + #endif +} diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index d7a8e310c0d1..8deb208ad2cd 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -31,520 +31,553 @@ #define DISPLAY_CHARSET_ISO10646_1 -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronto.") -#define MSG_YES _UxGT("SI") -#define MSG_NO _UxGT("NO") -#define MSG_BACK _UxGT("Indietro") -#define MSG_SD_INSERTED _UxGT("SD Card inserita") -#define MSG_SD_REMOVED _UxGT("SD Card rimossa") -#define MSG_SD_RELEASED _UxGT("SD Card rilasciata") -#define MSG_LCD_ENDSTOPS _UxGT("Finecor.") // Max 8 caratteri -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Finecorsa Soft") -#define MSG_MAIN _UxGT("Menu principale") -#define MSG_ADVANCED_SETTINGS _UxGT("Impostaz. avanzate") -#define MSG_CONFIGURATION _UxGT("Configurazione") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Disabilita Motori") -#define MSG_DEBUG_MENU _UxGT("Menu di debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test barra avanzam.") -#define MSG_AUTO_HOME _UxGT("Auto Home") -#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_AUTO_Z_ALIGN _UxGT("Allineam.automat. 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") -#define MSG_LEVEL_BED_DONE _UxGT("Livel. terminato!") -#define MSG_Z_FADE_HEIGHT _UxGT("Fade Height") -#define MSG_SET_HOME_OFFSETS _UxGT("Imp. offset home") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset applicato") -#define MSG_SET_ORIGIN _UxGT("Imposta Origine") -#define MSG_PREHEAT_1 _UxGT("Preriscalda " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N _UxGT("Preris." PREHEAT_1_LABEL " ") -#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 " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Preris." PREHEAT_2_LABEL " ") -#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") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2_N _UxGT("conf") -#define MSG_PREHEAT_CUSTOM _UxGT("Prerisc.personal.") -#define MSG_COOLDOWN _UxGT("Raffredda") -#define MSG_LASER_MENU _UxGT("Controllo laser") -#define MSG_LASER_OFF _UxGT("Laser Off") -#define MSG_LASER_ON _UxGT("Laser On") -#define MSG_LASER_POWER _UxGT("Potenza laser") -#define MSG_SPINDLE_MENU _UxGT("Controllo mandrino") -#define MSG_SPINDLE_OFF _UxGT("Mandrino Off") -#define MSG_SPINDLE_ON _UxGT("Mandrino On") -#define MSG_SPINDLE_POWER _UxGT("Potenza mandrino") -#define MSG_SPINDLE_REVERSE _UxGT("Inverti mandrino") -#define MSG_SWITCH_PS_ON _UxGT("Accendi aliment.") -#define MSG_SWITCH_PS_OFF _UxGT("Spegni aliment.") -#define MSG_EXTRUDE _UxGT("Estrudi") -#define MSG_RETRACT _UxGT("Ritrai") -#define MSG_MOVE_AXIS _UxGT("Muovi Asse") -#define MSG_BED_LEVELING _UxGT("Livella piano") -#define MSG_LEVEL_BED MSG_BED_LEVELING -#define MSG_LEVEL_CORNERS _UxGT("Livella spigoli") -#define MSG_NEXT_CORNER _UxGT("Prossimo spigolo") -#define MSG_EDITING_STOPPED _UxGT("Modif. Mesh Fermata") -#define MSG_MESH_X _UxGT("Indice X") -#define MSG_MESH_Y _UxGT("Indice Y") -#define MSG_MESH_EDIT_Z _UxGT("Valore di Z") -#define MSG_USER_MENU _UxGT("Comandi personaliz.") -#define MSG_UBL_DOING_G29 _UxGT("G29 in corso") -#define MSG_UBL_UNHOMED _UxGT("Home XYZ prima") -#define MSG_UBL_TOOLS _UxGT("Strumenti UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_LCD_PROBING_MESH _UxGT("Punto sondato") -#define MSG_LCD_TILTING_MESH _UxGT("Punto inclinaz.") -#define MSG_IDEX_MENU _UxGT("Modo IDEX") -#define MSG_OFFSETS_MENU _UxGT("Strumenti Offsets") -#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Park") -#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplicazione") -#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Copia speculare") -#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Pieno controllo") -#define MSG_X_OFFSET _UxGT("2° ugello X") -#define MSG_Y_OFFSET _UxGT("2° ugello Y") -#define MSG_Z_OFFSET _UxGT("2° ugello Z") -#define MSG_UBL_MANUAL_MESH _UxGT("Mesh Manuale") -#define MSG_UBL_BC_INSERT _UxGT("Metti spes. e misura") -#define MSG_UBL_BC_INSERT2 _UxGT("Misura") -#define MSG_UBL_BC_REMOVE _UxGT("Rimuovi e mis.piatto") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Spostamento succes.") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Attiva UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Disattiva UBL") -#define MSG_UBL_SET_TEMP_BED _UxGT("Temp. Piatto") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Temp. Ugello") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#define MSG_UBL_MESH_EDIT _UxGT("Modifica Mesh") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Modif.Mesh personal.") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ritocca Mesh") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Modif.Mesh fatta") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Crea Mesh personal.") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Crea Mesh") -#define MSG_UBL_BUILD_MESH_M1 _UxGT("Crea Mesh " PREHEAT_1_LABEL) -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Crea Mesh " PREHEAT_2_LABEL) -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Crea Mesh a freddo") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Aggiusta Alt. Mesh") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Altezza") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valida Mesh") -#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Valida Mesh " PREHEAT_1_LABEL) -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Valida Mesh " PREHEAT_2_LABEL) -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valida Mesh pers.") -#define MSG_UBL_CONTINUE_MESH _UxGT("Continua Mesh") -#define MSG_UBL_MESH_LEVELING _UxGT("Livell. Mesh") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Livell. 3 Punti") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Livell. Griglia Mesh") -#define MSG_UBL_MESH_LEVEL _UxGT("Livella Mesh") -#define MSG_UBL_SIDE_POINTS _UxGT("Punti laterali") -#define MSG_UBL_MAP_TYPE _UxGT("Tipo di Mappa") -#define MSG_UBL_OUTPUT_MAP _UxGT("Esporta Mappa") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Esporta per Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Esporta in CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Backup esterno") -#define MSG_UBL_INFO_UBL _UxGT("Esporta Info UBL") -#define MSG_EDIT_MESH _UxGT("Modifica Mesh") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Riempimento") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Riempimento Manuale") -#define MSG_UBL_SMART_FILLIN _UxGT("Riempimento Smart") -#define MSG_UBL_FILLIN_MESH _UxGT("Riempimento Mesh") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalida Tutto") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalid.Punto Vicino") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ritocca All") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ritocca Punto Vicino") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Salvate") -#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") +namespace Language_it { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_LED_CONTROL _UxGT("Controllo LED") -#define MSG_LEDS _UxGT("Luci") -#define MSG_LED_PRESETS _UxGT("Preset luce") -#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("Intensità rosso") -#define MSG_INTENSITY_G _UxGT("Intensità verde") -#define MSG_INTENSITY_B _UxGT("Intensità blu") -#define MSG_INTENSITY_W _UxGT("Intensità bianco") -#define MSG_LED_BRIGHTNESS _UxGT("Luminosità") + constexpr uint8_t CHARSIZE = 1; + PROGMEM Language_Str LANGUAGE = _UxGT("Italian"); -#define MSG_MOVING _UxGT("In movimento...") -#define MSG_FREE_XY _UxGT("XY liberi") -#define MSG_MOVE_X _UxGT("Muovi X") -#define MSG_MOVE_Y _UxGT("Muovi Y") -#define MSG_MOVE_Z _UxGT("Muovi Z") -#define MSG_MOVE_E _UxGT("Estrusore") -#define MSG_HOTEND_TOO_COLD _UxGT("Ugello freddo") -#define MSG_MOVE_0025MM _UxGT("Muovi di 0.025mm") -#define MSG_MOVE_01MM _UxGT("Muovi di 0.1mm") -#define MSG_MOVE_1MM _UxGT("Muovi di 1mm") -#define MSG_MOVE_10MM _UxGT("Muovi di 10mm") -#define MSG_SPEED _UxGT("Velocità") -#define MSG_BED_Z _UxGT("Piatto Z") -#define MSG_NOZZLE _UxGT("Ugello") -#define MSG_BED _UxGT("Piatto") -#define MSG_CHAMBER _UxGT("Camera") -#define MSG_FAN_SPEED _UxGT("Velocità ventola") -#define MSG_EXTRA_FAN_SPEED _UxGT("Extra vel. ventola") -#define MSG_FLOW _UxGT("Flusso") -#define MSG_CONTROL _UxGT("Controllo") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_JUNCTION_DEVIATION _UxGT("Deviaz. giunzioni") -#define MSG_VELOCITY _UxGT("Velocità") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Accelerazione") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-Ritrazione") -#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_ESTEPS _UxGT("Epassi/mm") -#define MSG_E1STEPS _UxGT("E1passi/mm") -#define MSG_E2STEPS _UxGT("E2passi/mm") -#define MSG_E3STEPS _UxGT("E3passi/mm") -#define MSG_E4STEPS _UxGT("E4passi/mm") -#define MSG_E5STEPS _UxGT("E5passi/mm") -#define MSG_E6STEPS _UxGT("E6passi/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") -#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 impostazioni") -#define MSG_LOAD_EEPROM _UxGT("Carica impostazioni") -#define MSG_RESTORE_FAILSAFE _UxGT("Ripristina imp.") -#define MSG_INIT_EEPROM _UxGT("Inizializza EEPROM") -#define MSG_SD_UPDATE _UxGT("Aggiorna SD") -#define MSG_RESET_PRINTER _UxGT("Resetta stampante") -#define MSG_REFRESH _UxGT("Aggiorna") -#define MSG_WATCH _UxGT("Schermata info") -#define MSG_PREPARE _UxGT("Prepara") -#define MSG_TUNE _UxGT("Regola") -#define MSG_START_PRINT _UxGT("Avvia stampa") -#define MSG_BUTTON_NEXT _UxGT("Prossimo") -#define MSG_BUTTON_INIT _UxGT("Inizializza") -#define MSG_BUTTON_STOP _UxGT("Stop") -#define MSG_BUTTON_PRINT _UxGT("Stampa") -#define MSG_BUTTON_RESET _UxGT("Resetta") -#define MSG_BUTTON_CANCEL _UxGT("Annulla") -#define MSG_BUTTON_DONE _UxGT("Fatto") -#define MSG_PAUSE_PRINT _UxGT("Pausa stampa") -#define MSG_RESUME_PRINT _UxGT("Riprendi stampa") -#define MSG_STOP_PRINT _UxGT("Arresta stampa") -#define MSG_OUTAGE_RECOVERY _UxGT("Ripresa da PowerLoss") -#define MSG_CARD_MENU _UxGT("Stampa da SD") -#define MSG_NO_CARD _UxGT("SD non presente") -#define MSG_DWELL _UxGT("Sospensione...") -#define MSG_USERWAIT _UxGT("Premi tasto..") -#define MSG_PRINT_PAUSED _UxGT("Stampa sospesa") -#define MSG_PRINTING _UxGT("Stampa...") -#define MSG_PRINT_ABORTED _UxGT("Stampa annullata") -#define MSG_NO_MOVE _UxGT("Nessun Movimento") -#define MSG_KILLED _UxGT("UCCISO. ") -#define MSG_STOPPED _UxGT("ARRESTATO. ") -#define MSG_CONTROL_RETRACT _UxGT("Ritrai mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Scamb. Ritrai mm") -#define MSG_CONTROL_RETRACTF _UxGT("Ritrai V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Salta mm") -#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_FILAMENT_SWAP_LENGTH _UxGT("Dist. ritrazione") -#define MSG_TOOL_CHANGE _UxGT("Cambio utensile") -#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Risalita Z") -#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Velocità innesco") -#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Velocità retrazione") -#define MSG_NOZZLE_STANDBY _UxGT("Standby ugello") -#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_CHANGE_SDCARD _UxGT("Cambia SD card") -#define MSG_RELEASE_SDCARD _UxGT("Rilascia SD card") -#define MSG_ZPROBE_OUT _UxGT("Z probe fuori piatto") -#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") -#define MSG_BLTOUCH_DEPLOY _UxGT("Estendi BLTouch") -#define MSG_BLTOUCH_SW_MODE _UxGT("BLTouch modo SW") -#define MSG_BLTOUCH_5V_MODE _UxGT("BLTouch modo 5V") -#define MSG_BLTOUCH_OD_MODE _UxGT("BLTouch modo OD") -#define MSG_BLTOUCH_MODE_STORE _UxGT("BLTouch modo mem.") -#define MSG_BLTOUCH_MODE_STORE_5V _UxGT("Metti BLTouch a 5V") -#define MSG_BLTOUCH_MODE_STORE_OD _UxGT("Metti BLTouch a OD") -#define MSG_BLTOUCH_MODE_ECHO _UxGT("Segnala modo") -#define MSG_BLTOUCH_MODE_CHANGE _UxGT("PERICOLO: Impostazioni errate possono cause danni! Procedo comunque?") -#define MSG_TOUCHMI_PROBE _UxGT("TouchMI") -#define MSG_TOUCHMI_INIT _UxGT("Inizializ.TouchMI") -#define MSG_TOUCHMI_ZTEST _UxGT("Test Z offset") -#define MSG_TOUCHMI_SAVE _UxGT("Memorizzare") -#define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("Estendi TouchMI") -#define MSG_MANUAL_DEPLOY _UxGT("Estendi Sonda-Z") -#define MSG_BLTOUCH_STOW _UxGT("Ritrai BLTouch") -#define MSG_MANUAL_STOW _UxGT("Ritrai Sonda-Z") -#define MSG_HOME _UxGT("Home") // Usato come MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("prima") -#define MSG_ZPROBE_ZOFFSET _UxGT("Offset sonda Z") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_BABYSTEP_TOTAL _UxGT("Totali") -#define MSG_ENDSTOP_ABORT _UxGT("Finecorsa annullati") -#define MSG_HEATING_FAILED_LCD _UxGT("Riscald. Fallito") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Risc. piatto fallito") -#define MSG_HEATING_FAILED_LCD_CHAMBER _UxGT("Risc. camera fallito") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP RIDONDANTE") -#define MSG_THERMAL_RUNAWAY _UxGT("TEMP FUORI CONTROLLO") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("TEMP PIAT.FUORI CTRL") -#define MSG_THERMAL_RUNAWAY_CHAMBER _UxGT("T.CAMERA FUORI CTRL") -#define MSG_ERR_MAXTEMP _UxGT("Err: TEMP MASSIMA") -#define MSG_ERR_MINTEMP _UxGT("Err: TEMP MINIMA") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMP MAX PIATTO") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP MIN PIATTO") -#define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Err: TEMP MAX CAMERA") -#define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err: TEMP MIN CAMERA") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("STAMPANTE FERMATA") -#define MSG_PLEASE_RESET _UxGT("Riavviare prego") -#define MSG_SHORT_DAY _UxGT("g") // Un solo carattere -#define MSG_SHORT_HOUR _UxGT("h") // Un solo carattere -#define MSG_SHORT_MINUTE _UxGT("m") // Un solo carattere -#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_CHAMBER_HEATING _UxGT("Risc. camera...") -#define MSG_CHAMBER_COOLING _UxGT("Raffr. camera...") -#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 centro") -#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_Z_OFFSET_CALIBRATE _UxGT("Offset sonda-Z") -#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") -#define MSG_LINEAR_LEVELING _UxGT("Livel. Lineare") -#define MSG_BILINEAR_LEVELING _UxGT("Livel. Bilineare") -#define MSG_UBL_LEVELING _UxGT("Livel.piatto unific.") -#define MSG_MESH_LEVELING _UxGT("Livel. Mesh") -#define MSG_INFO_STATS_MENU _UxGT("Statistiche") -#define MSG_INFO_BOARD_MENU _UxGT("Info. scheda") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistori") -#define MSG_INFO_EXTRUDERS _UxGT("Estrusori") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_PROTOCOL _UxGT("Protocollo") -#define MSG_CASE_LIGHT _UxGT("Luci Case") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Luminosità Luci") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Contat. stampa") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completati") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo totale") - #define MSG_INFO_PRINT_LONGEST _UxGT("Lavoro più lungo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Totale estruso") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Stampe") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completati") - #define MSG_INFO_PRINT_TIME _UxGT("Durata") - #define MSG_INFO_PRINT_LONGEST _UxGT("Più lungo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Estruso") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Temp min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp max") -#define MSG_INFO_PSU _UxGT("Alimentatore") -#define MSG_DRIVE_STRENGTH _UxGT("Potenza Drive") -#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_OPTION_HEADER _UxGT("OPZIONI RIPRESA:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Spurga di più") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Riprendi stampa") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Ugello: ") -#define MSG_RUNOUT_SENSOR _UxGT("Sens.filo termin.") // Max 17 caratteri -#define MSG_RUNOUT_DISTANCE_MM _UxGT("Dist mm filo term.") -#define MSG_ERR_HOMING_FAILED _UxGT("Home fallito") -#define MSG_ERR_PROBING_FAILED _UxGT("Sondaggio fallito") -#define MSG_M600_TOO_COLD _UxGT("M600:Troppo freddo") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronto."); + PROGMEM Language_Str MSG_YES = _UxGT("SI"); + PROGMEM Language_Str MSG_NO = _UxGT("NO"); + PROGMEM Language_Str MSG_BACK = _UxGT("Indietro"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Annullando..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Media inserito"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Media rimosso"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Media rilasciato"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Aspettando media"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Err.leggendo media"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("Dispos.USB rimosso"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Avvio USB fallito"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Finecor."); // Max 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Finecorsa Soft"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principale"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Impostaz. avanzate"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configurazione"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Disabilita Motori"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu di debug"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test barra avanzam."); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto Home"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home asse X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home asse Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home asse Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Home assi XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Premi per iniziare"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Punto successivo"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Livel. terminato!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Fade Height"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Imp. offset home"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Imposta Origine"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Preriscalda ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Preriscalda ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Ugello"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Ugello ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Tutto"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Piatto"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" conf"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Preriscalda ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Preriscalda ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" Ugello"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" Ugello ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" Tutto"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" Piatto"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" conf"); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Prerisc.personal."); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Raffredda"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Controllo laser"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Laser Off"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Laser On"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Potenza laser"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Controllo mandrino"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Mandrino Off"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Mandrino On"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Potenza mandrino"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Inverti mandrino"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Accendi aliment."); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Spegni aliment."); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Estrudi"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Ritrai"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Muovi Asse"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Livella piano"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Livella piano"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Livella spigoli"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Prossimo spigolo"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor Mesh"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Modifica Mesh"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Modif. Mesh Fermata"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Punto sondato"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Indice X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Indice Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valore di Z"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Comandi personaliz."); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punto inclinaz."); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("Test sonda M48"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("Punto M48"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Deviazione"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Modo IDEX"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Strumenti Offsets"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicazione"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia speculare"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Pieno controllo"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2° ugello X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2° ugello Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2° ugello Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 in corso"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Strumenti UBL"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Mesh Manuale"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Metti spes. e misura"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Misura"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Rimuovi e mis.piatto"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Spostamento succes."); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Attiva UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Disattiva UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Temp. Piatto"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Temp. Piatto"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temp. Ugello"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Temp. Ugello"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Modifica Mesh"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Modif.Mesh personal."); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Ritocca Mesh"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Modif.Mesh fatta"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crea Mesh personal."); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Crea Mesh"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Crea Mesh ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Crea Mesh ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Crea Mesh a freddo"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Aggiusta Alt. Mesh"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Altezza"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Valida Mesh"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Valida Mesh ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Valida Mesh ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 riscald.letto"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 riscald.ugello"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Priming manuale..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Prime a lung.fissa"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Priming terminato"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Annullato"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Uscita da G26"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Valida Mesh pers."); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continua Mesh"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Livell. Mesh"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Livell. 3 Punti"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Livell. Griglia Mesh"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Livella Mesh"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Punti laterali"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Tipo di Mappa"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Esporta Mappa"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Esporta per Host"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Esporta in CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Backup esterno"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Esporta Info UBL"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Riempimento"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Riempimento Manuale"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Riempimento Smart"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Riempimento Mesh"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalida Tutto"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalid.Punto Vicino"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Ritocca All"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ritocca Punto Vicino"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Salvate"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Slot di memoria"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Carica Mesh Piatto"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Salva Mesh Piatto"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Mesh %i caricata"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Mesh %i salvata"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Nessuna memoria"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Err: Salvataggio UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Err: Ripristino UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Offset Fermato"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL passo passo"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Crea Mesh a freddo"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Riempimento Smart"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Valida Mesh"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Ritocca All"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Valida Mesh"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Ritocca All"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Salva Mesh Piatto"); -#define MSG_MMU2_FILAMENT_CHANGE_HEADER _UxGT("CAMBIO FILAMENTO") -#define MSG_MMU2_CHOOSE_FILAMENT_HEADER _UxGT("SCELTA FILAMENTO") -#define MSG_MMU2_MENU _UxGT("MMU") -#define MSG_MMU2_WRONG_FIRMWARE _UxGT("Agg.firmware MMU!") -#define MSG_MMU2_NOT_RESPONDING _UxGT("MMU chiede attenz.") -#define MSG_MMU2_RESUME _UxGT("Riprendi stampa") -#define MSG_MMU2_RESUMING _UxGT("Ripresa...") -#define MSG_MMU2_LOAD_FILAMENT _UxGT("Carica filamento") -#define MSG_MMU2_LOAD_ALL _UxGT("Carica tutto") -#define MSG_MMU2_LOAD_TO_NOZZLE _UxGT("Carica fino ugello") -#define MSG_MMU2_EJECT_FILAMENT _UxGT("Espelli filamento") -#define MSG_MMU2_EJECT_FILAMENT0 _UxGT("Espelli filam.1") -#define MSG_MMU2_EJECT_FILAMENT1 _UxGT("Espelli filam.2") -#define MSG_MMU2_EJECT_FILAMENT2 _UxGT("Espelli filam.3") -#define MSG_MMU2_EJECT_FILAMENT3 _UxGT("Espelli filam.4") -#define MSG_MMU2_EJECT_FILAMENT4 _UxGT("Espelli filam.5") -#define MSG_MMU2_UNLOAD_FILAMENT _UxGT("Scarica filamento") -#define MSG_MMU2_LOADING_FILAMENT _UxGT("Caric.fil. %i...") -#define MSG_MMU2_EJECTING_FILAMENT _UxGT("Esplus.filam. ...") -#define MSG_MMU2_UNLOADING_FILAMENT _UxGT("Scaric.filam. ...") -#define MSG_MMU2_ALL _UxGT("Tutto") -#define MSG_MMU2_FILAMENT0 _UxGT("Filamento 1") -#define MSG_MMU2_FILAMENT1 _UxGT("Filamento 2") -#define MSG_MMU2_FILAMENT2 _UxGT("Filamento 3") -#define MSG_MMU2_FILAMENT3 _UxGT("Filamento 4") -#define MSG_MMU2_FILAMENT4 _UxGT("Filamento 5") -#define MSG_MMU2_RESET _UxGT("Azzera MMU") -#define MSG_MMU2_RESETTING _UxGT("Azzeramento MMU...") -#define MSG_MMU2_EJECT_RECOVER _UxGT("Rimuovi, click") + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Controllo LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Luci"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Preset luce"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Rosso"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Arancione"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Giallo"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Verde"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Blu"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indaco"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Viola"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Bianco"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Predefinito"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Luci personalizzate"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensità rosso"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensità verde"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensità blu"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensità bianco"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Luminosità"); -#define MSG_MIX _UxGT("Miscela") -#define MSG_MIX_COMPONENT _UxGT("Componente") -#define MSG_MIXER _UxGT("Miscelatore") -#define MSG_GRADIENT _UxGT("Gradiente") -#define MSG_FULL_GRADIENT _UxGT("Gradiente pieno") -#define MSG_TOGGLE_MIX _UxGT("Alterna miscela") -#define MSG_CYCLE_MIX _UxGT("Ciclo miscela") -#define MSG_GRADIENT_MIX _UxGT("Miscela gradiente") -#define MSG_REVERSE_GRADIENT _UxGT("Inverti gradiente") -#define MSG_ACTIVE_VTOOL _UxGT("V-tool attivo") -#define MSG_START_VTOOL _UxGT("V-tool iniziale") -#define MSG_END_VTOOL _UxGT("V-tool finale") -#define MSG_GRADIENT_ALIAS _UxGT("V-tool alias") -#define MSG_RESET_VTOOLS _UxGT("Ripristina V-tools") -#define MSG_COMMIT_VTOOL _UxGT("Commit mix V-tool") -#define MSG_VTOOLS_RESET _UxGT("V-tools ripristin.") -#define MSG_START_Z _UxGT("Z inizio") -#define MSG_END_Z _UxGT("Z fine") -#define MSG_BRICKOUT _UxGT("Brickout") -#define MSG_INVADERS _UxGT("Invaders") -#define MSG_SNAKE _UxGT("Sn4k3") -#define MSG_MAZE _UxGT("Maze") + PROGMEM Language_Str MSG_MOVING = _UxGT("In movimento..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("XY liberi"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Muovi X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Muovi Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Muovi Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Estrusore"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Estrusore *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Ugello freddo"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Muovi di %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Muovi di 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Muovi di 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Muovi di 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Velocità"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Piatto Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Ugello"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Ugello ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Piatto"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Camera"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. ventola"); // Max 15 characters + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. ventola ="); // Max 15 characters + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Ventola mem. ="); // Max 15 characters + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra vel.vent."); // Max 15 characters + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra v.vent. ="); // Max 15 characters + PROGMEM Language_Str MSG_FLOW = _UxGT("Flusso"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flusso ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Controllo"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("On"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Off"); + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Seleziona"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seleziona *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); + PROGMEM Language_Str MSG_JERK = _UxGT("Jerk"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-jerk"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-jerk"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-jerk"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-jerk"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Deviaz. giunzioni"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocità"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VTrav min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Accelerazione"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-Ritrazione"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-Spostamento"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Passi/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("passi/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("passi/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("passi/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Epassi/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*passi/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diam. filo"); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diam. filo *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Rimuovi mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Carica mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K Avanzamento"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K Avanzamento *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contrasto LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Salva impostazioni"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carica impostazioni"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Ripristina imp."); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inizializza EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aggiorna media"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetta stampante"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aggiorna"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Schermata info"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepara"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Regola"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Avvia stampa"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Prossimo"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Inizializza"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Stampa"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Resetta"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Annulla"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Fatto"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Indietro"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Procedi"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausa stampa"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Riprendi stampa"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Arresta stampa"); + PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Stampa Oggetto"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Cancella Oggetto"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Canc. Oggetto ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Ripresa da PowerLoss"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Stampa da media"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Media non presente"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Sospensione..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Premi tasto.."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Stampa sospesa"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Stampa..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Stampa annullata"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Nessun Movimento"); + PROGMEM Language_Str MSG_KILLED = _UxGT("UCCISO. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ARRESTATO. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Ritrai mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Scamb. Ritrai mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Ritrai V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Salta mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Scamb. UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRitrai"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Dist. ritrazione"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Lunghezza spurgo"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Cambio utensile"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Risalita Z"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Velocità innesco"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Velocità retrazione"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Standby ugello"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Cambia filamento"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Cambia filamento *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Carica filamento"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Carica filamento *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Rimuovi filamento"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Rimuovi filamento *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Rimuovi tutto"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Inizializ. media"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambia media"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Rilascia media"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z probe fuori piatto"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Fattore distorsione"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Autotest BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Resetta BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Estendi BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("BLTouch modo SW"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("BLTouch modo 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("BLTouch modo OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("BLTouch modo mem."); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Metti BLTouch a 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Metti BLTouch a OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Segnala modo"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("PERICOLO: Impostazioni errate possono cause danni! Procedo comunque?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Inizializ.TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test Z offset"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Memorizzare"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Estendi TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Estendi Sonda-Z"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Ritrai BLTouch"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Ritrai Sonda-Z"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s prima"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Offset sonda Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Totali"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Finecorsa annullati"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Riscald. Fallito"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Risc. piatto fallito"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Risc. camera fallito"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP RIDONDANTE"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TEMP FUORI CONTROLLO"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("TEMP PIAT.FUORI CTRL"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("T.CAMERA FUORI CTRL"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: TEMP MASSIMA"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: TEMP MINIMA"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: TEMP MAX PIATTO"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: TEMP MIN PIATTO"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Err: TEMP MAX CAMERA"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Err: TEMP MIN CAMERA"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY prima"); + PROGMEM Language_Str MSG_HALTED = _UxGT("STAMPANTE FERMATA"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Riavviare prego"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("g"); // Un solo carattere + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // Un solo carattere + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // Un solo carattere + PROGMEM Language_Str MSG_HEATING = _UxGT("Riscaldamento..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Raffreddamento.."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Risc. piatto..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Raffr. piatto..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Risc. camera..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Raffr. camera..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibraz. Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibra X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibra Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibra Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibra centro"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Impostaz. Delta"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto calibrazione"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Imp. altezza Delta"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Offset sonda-Z"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Barra Diagonale"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Altezza"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Raggio"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Riguardo stampante"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info. stampante"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Livel. a 3 punti"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Livel. Lineare"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Livel. Bilineare"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Livel.piatto unific."); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Livel. Mesh"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statistiche"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info. scheda"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistori"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Estrusori"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocollo"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Controllo fuga: OFF"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Controllo fuga: ON"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luci Case"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosità Luci"); + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Contat. stampa"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo totale"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Lavoro più lungo"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Totale estruso"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Stampe"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Durata"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Più lungo"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Estruso"); + #endif + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp min"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp max"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Alimentatore"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Potenza Drive"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("ERR.CONNESSIONE TMC"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Scrivi DAC EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIO FILAMENTO"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("STAMPA IN PAUSA"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("CARICA FILAMENTO"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("RIMUOVI FILAMENTO"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPZIONI RIPRESA:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Spurga di più"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Riprendi stampa"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Ugello: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Sens.filo termin."); // Max 17 characters + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Dist mm filo term."); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Home fallito"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Sondaggio fallito"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600:Troppo freddo"); -// -// Le schermate di Cambio Filamento possono visualizzare fino a 3 linee su un display a 4 righe -// ...o fino a 2 linee su un display a 3 righe. -#if LCD_HEIGHT >= 4 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Premi per") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("riprendere") - #define MSG_ADVANCED_PAUSE_WAITING_3 _UxGT("la stampa") - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Parcheggiando...") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attendere avvio") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("del cambio") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("di filamento") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserisci il") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("filamento e premi") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("per continuare") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Premi per") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("riscaldare ugello") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Riscaldam. ugello") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Attendere prego...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attendere") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("l'espulsione") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("del filamento") - #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_CONT_PURGE_1 _UxGT("Premi x terminare") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("lo spurgo") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_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...") -#else // LCD_HEIGHT < 4 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Premi x continuare") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Attendere...") - #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_UNLOAD_1 _UxGT("Espulsione...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Caricamento...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Spurgo filamento") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Premi x terminare") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Ripresa...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("SCELTA FILAMENTO"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Agg.firmware MMU!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU chiede attenz."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Riprendi stampa"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Ripresa..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Carica filamento"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Carica tutto"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Carica fino ugello"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Espelli filamento"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Espelli filam.~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Scarica filamento"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Caric.fil. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Esplus.filam. ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Scaric.filam. ..."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Tutto"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filamento ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Azzera MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Azzeramento MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Rimuovi, click"); -#define MSG_TMC_DRIVERS _UxGT("Drivers TMC") -#define MSG_TMC_CURRENT _UxGT("Driver in uso") -#define MSG_TMC_HYBRID_THRS _UxGT("Soglia modo ibrido") -#define MSG_TMC_HOMING_THRS _UxGT("Azzer. sensorless") -#define MSG_TMC_STEPPING_MODE _UxGT("Modo stepping") -#define MSG_TMC_STEALTH_ENABLED _UxGT("StealthChop abil.") + PROGMEM Language_Str MSG_MIX = _UxGT("Miscela"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Componente ~"); + PROGMEM Language_Str MSG_MIXER = _UxGT("Miscelatore"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradiente"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Gradiente pieno"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Alterna miscela"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Ciclo miscela"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Miscela gradiente"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Inverti gradiente"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("V-tool attivo"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("V-tool iniziale"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("V-tool finale"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("V-tool alias"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Ripristina V-tools"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Commit mix V-tool"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools ripristin."); + PROGMEM Language_Str MSG_START_Z = _UxGT("Z inizio:"); + PROGMEM Language_Str MSG_END_Z = _UxGT("Z fine:"); -#define MSG_SERVICE_RESET _UxGT("Resetta") -#define MSG_SERVICE_IN _UxGT(" tra:") + PROGMEM Language_Str MSG_GAMES = _UxGT("Giochi"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); -#define MSG_BACKLASH _UxGT("Gioco") -#define MSG_BACKLASH_CORRECTION _UxGT("Correzione") -#define MSG_BACKLASH_SMOOTHING _UxGT("Smoothing") + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Stampante errata"); + + // + // Le schermate di Cambio Filamento possono visualizzare fino a 3 linee su un display a 4 righe + // ...o fino a 2 linee su un display a 3 righe. + #if LCD_HEIGHT >= 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_3_LINE("Premi per", "riprendere", "la stampa")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parcheggiando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Attendere avvio", "del cambio", "di filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Inserisci il", "filamento e premi", "per continuare")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Premi per", "riscaldare ugello")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Riscaldam. ugello", "Attendere prego...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Attendere", "l'espulsione", "del filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Attendere", "il caricamento", "del filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Attendere", "lo spurgo", "del filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Premi x terminare", "lo spurgo", "del filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Attendere", "la ripresa", "della stampa...")); + #else // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Premi x continuare")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Attendere...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Inserisci e premi")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Riscalda ugello")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Riscaldamento...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Espulsione...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Caricamento...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Spurgo filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Premi x terminare")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Ripresa...")); + #endif // LCD_HEIGHT < 4 + + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Drivers TMC"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Driver in uso"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Soglia modo ibrido"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Azzer. sensorless"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Modo stepping"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop abil."); + + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Resetta"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" tra:"); + + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Gioco"); + PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; + PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; + PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correzione"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Smoothing"); +} diff --git a/Marlin/src/lcd/language/language_jp-kana.h b/Marlin/src/lcd/language/language_jp-kana.h deleted file mode 100644 index fe41a0f15698..000000000000 --- a/Marlin/src/lcd/language/language_jp-kana.h +++ /dev/null @@ -1,221 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -/** - * Japanese (Kana) - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -#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. - -// 片仮名表示定義 -#define WELCOME_MSG MACHINE_NAME _UxGT(" ready.") -#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_LEVEL_BED_HOMING _UxGT("ゲンテンフッキチュウ") // "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_SET_HOME_OFFSETS _UxGT("キジュンオフセットセッテイ") // "Set home offsets" -#define MSG_HOME_OFFSETS_APPLIED _UxGT("オフセットガテキヨウサレマシタ") // "Offsets applied" -#define MSG_SET_ORIGIN _UxGT("キジュンセット") // "Set origin" -#define MSG_PREHEAT_1 _UxGT(PREHEAT_1_LABEL " ヨネツ") // "Preheat " PREHEAT_1_LABEL -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT(PREHEAT_1_LABEL " スベテヨネツ") // " All" -#define MSG_PREHEAT_1_BEDONLY _UxGT(PREHEAT_1_LABEL " ベッドヨネツ") // " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT("セッテイ") // " conf" -#define MSG_PREHEAT_2 _UxGT(PREHEAT_2_LABEL " ヨネツ") // "Preheat " PREHEAT_2_LABEL -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL _UxGT(PREHEAT_2_LABEL " スベテヨネツ") // " All" -#define MSG_PREHEAT_2_BEDONLY _UxGT(PREHEAT_2_LABEL " ベッドヨネツ") // " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT("セッテイ") // " conf" -#define MSG_COOLDOWN _UxGT("カネツテイシ") // "Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("デンゲン オン") // "Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("デンゲン オフ") // "Switch power off" -#define MSG_EXTRUDE _UxGT("オシダシ") // "Extrude" -#define MSG_RETRACT _UxGT("ヒキコミセッテイ") // "Retract" -#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_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" -#define MSG_MOVE_E _UxGT("エクストルーダー") // "Extruder" -#define MSG_MOVE_0025MM _UxGT("0.025mm イドウ") // "Move 0.025mm" -#define MSG_MOVE_01MM _UxGT("0.1mm イドウ") // "Move 0.1mm" -#define MSG_MOVE_1MM _UxGT(" 1mm イドウ") // "Move 1mm" -#define MSG_MOVE_10MM _UxGT(" 10mm イドウ") // "Move 10mm" -#define MSG_SPEED _UxGT("ソクド") // "Speed" -#define MSG_BED_Z _UxGT("Zオフセット") // "Bed Z" -#define MSG_NOZZLE _UxGT("ノズル") // "Nozzle" -#define MSG_BED _UxGT("ベッド") // "Bed" -#define MSG_FAN_SPEED _UxGT("ファンソクド") // "Fan speed" -#define MSG_FLOW _UxGT("トシュツリョウ") // "Flow" -#define MSG_CONTROL _UxGT("セイギョ") // "Control" -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" サイテイ") // " Min" -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" サイコウ") // " Max" -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" ファクター") // " Fact" -#define MSG_AUTOTEMP _UxGT("ジドウオンドセイギョ") // "Autotemp" -#define MSG_LCD_ON _UxGT("オン") // "On" -#define MSG_LCD_OFF _UxGT("オフ") // "Off" -#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("センタク") // "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_VE_JERK _UxGT("エクストルーダー ヤクド") // "Ve-jerk" -#define MSG_VMAX _UxGT("サイダイオクリソクド ") // "Vmax " -#define MSG_VMIN _UxGT("サイショウオクリソクド") // "Vmin" -#define MSG_VTRAV_MIN _UxGT("サイショウイドウソクド") // "VTrav min" -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("サイダイカソクド ") // "Amax " -#define MSG_A_RETRACT _UxGT("ヒキコミカソクド") // "A-retract" -#define MSG_A_TRAVEL _UxGT("イドウカソクド") // "A-travel" -#define MSG_TEMPERATURE _UxGT("オンド") // "Temperature" -#define MSG_MOTION _UxGT("ウゴキセッテイ") // "Motion" -#define MSG_FILAMENT _UxGT("フィラメント") // "Filament" -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("フィラメントチョッケイ") // "Fil. Dia." -#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_REFRESH _UxGT("リフレッシュ") // "Refresh" -#define MSG_WATCH _UxGT("ジョウホウガメン") // "Info screen" -#define MSG_PREPARE _UxGT("ジュンビセッテイ") // "Prepare" -#define MSG_TUNE _UxGT("チョウセイ") // "Tune" -#define MSG_PAUSE_PRINT _UxGT("イチジテイシ") // "Pause print" -#define MSG_RESUME_PRINT _UxGT("プリントサイカイ") // "Resume print" -#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_PRINT_ABORTED _UxGT("プリントガチュウシサレマシタ") // "Print aborted" -#define MSG_NO_MOVE _UxGT("ウゴキマセン") // "No move." -#define MSG_KILLED _UxGT("ヒジョウテイシ") // "KILLED. " -#define MSG_STOPPED _UxGT("テイシシマシタ") // "STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("ヒキコミリョウ mm") // "Retract mm" -#define MSG_CONTROL_RETRACT_SWAP _UxGT("ヒキコミリョウS mm") // "Swap Re.mm" -#define MSG_CONTROL_RETRACTF _UxGT("ヒキコミソクド mm/s") // "Retract V" -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("ノズルタイヒ mm") // "Hop mm" -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("ホショウリョウ mm") // "UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("ホショウリョウS mm") // "S UnRet mm" -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("ホショウソクド mm/s") // "UnRet V" -#define MSG_AUTORETRACT _UxGT("ジドウヒキコミ") // "AutoRetr." -#define MSG_FILAMENTCHANGE _UxGT("フィラメントコウカン") // "Change filament" -#define MSG_INIT_SDCARD _UxGT("SDカードサイヨミコミ") // "Init. SD card" -#define MSG_CHANGE_SDCARD _UxGT("SDカードコウカン") // "Change SD card" -#define MSG_ZPROBE_OUT _UxGT("Zプローブ ベッドガイ") // "Z probe out. bed" -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch ジコシンダン") // "BLTouch Self-Test" -#define MSG_BLTOUCH_RESET _UxGT("BLTouch リセット") // "Reset 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" -#define MSG_BABYSTEP_X _UxGT("Xジク ビドウ") // "Babystep X" -#define MSG_BABYSTEP_Y _UxGT("Yジク ビドウ") // "Babystep Y" -#define MSG_BABYSTEP_Z _UxGT("Zジク ビドウ") // "Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("イドウゲンカイケンチキノウ") // "Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("カネツシッパイ") // "Heating failed" -#define MSG_ERR_REDUNDANT_TEMP _UxGT("エラー:ジョウチョウサーミスターキノウ") // "Err: REDUNDANT TEMP" -#define MSG_THERMAL_RUNAWAY _UxGT("ネツボウソウ") // "THERMAL RUNAWAY" -#define MSG_ERR_MAXTEMP _UxGT("エラー:サイコウオンチョウカ") // "Err: MAXTEMP" -#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 // "Home XY 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_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_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" -#define MSG_CASE_LIGHT _UxGT("キョウタイナイショウメイ") // "Case light" -#define MSG_INFO_PRINT_COUNT _UxGT("プリントスウ ") // "Print Count" -#define MSG_INFO_COMPLETED_PRINTS _UxGT("カンリョウスウ") // "Completed" -#define MSG_INFO_PRINT_TIME _UxGT("プリントジカンルイケイ") // "Total print time" -#define MSG_INFO_PRINT_LONGEST _UxGT("サイチョウプリントジカン") // "Longest job time" -#define MSG_INFO_PRINT_FILAMENT _UxGT("フィラメントシヨウリョウルイケイ") // "Extruded total" -#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("DACシュツリョク %") // "Driver %" -#define MSG_DAC_EEPROM_WRITE MSG_STORE_EEPROM // "DAC EEPROM Write" -#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" -#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_LOAD_1 _UxGT("フィラメントソウテンチュウ") // "Wait for" -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("シバラクオマチクダサイ") // "filament load" -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("プリントヲサイカイシマス") // "Wait for print" -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("シバラクオマチクダサイ") // "to resume" diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h new file mode 100644 index 000000000000..80be159a8ef6 --- /dev/null +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -0,0 +1,262 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Japanese (Kana) + * UTF-8 for Graphical Display + * + * LCD Menu Messages + * See also http://marlinfw.org/docs/development/lcd_language.html + * + */ + +//#define DISPLAY_CHARSET_ISO10646_KANA + +namespace Language_jp_kana { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 3; + PROGMEM Language_Str LANGUAGE = _UxGT("Japanese"); + + // This is 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. + + // 片仮名表示定義 + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" ジュンビカンリョウ"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("メディアガソウニュウサレマシタ"); // "Card inserted" + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("メディアガアリマセン"); // "Card removed" + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("メディアノトリダシ"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("メディアガアリマセン"); // "Card removed" + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("エンドストップ"); // "Endstops" // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("メイン"); // "Main" + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("ジドウカイシ"); // "Autostart" + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("モーターデンゲン オフ"); // "Disable steppers" + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("デバッグメニュー"); // "Debug Menu" + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("プログレスバー テスト"); // "Progress Bar Test" + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("ゲンテンフッキ"); // "Auto home" + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Xジク ゲンテンフッキ"); // "Home X" + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Yジク ゲンテンフッキ"); // "Home Y" + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Zジク ゲンテンフッキ"); // "Home Z" + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("ゲンテンフッキチュウ"); // "Homing XYZ" + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("レベリングカイシ"); // "Click to Begin" + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("ツギノソクテイテンヘ"); // "Next Point" + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("レベリングカンリョウ"); // "Leveling Done!" + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("キジュンオフセットセッテイ"); // "Set home offsets" + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("オフセットガテキヨウサレマシタ"); // "Offsets applied" + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("キジュンセット"); // "Set origin" + PROGMEM Language_Str MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" ヨネツ"); // "Preheat " PREHEAT_1_LABEL + PROGMEM Language_Str MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" ヨネツ ~"); // "Preheat " PREHEAT_1_LABEL + PROGMEM Language_Str MSG_PREHEAT_1_END = PREHEAT_1_LABEL _UxGT(" ヨネツノズル"); // " Nozzle" + PROGMEM Language_Str MSG_PREHEAT_1_END_E = PREHEAT_1_LABEL _UxGT(" ヨネツノズル ~"); // " Nozzle" + PROGMEM Language_Str MSG_PREHEAT_1_ALL = PREHEAT_1_LABEL _UxGT(" スベテヨネツ"); // " All" + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = PREHEAT_1_LABEL _UxGT(" ベッドヨネツ"); // " Bed" + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = PREHEAT_1_LABEL _UxGT(" ヨネツセッテイ"); // " conf" + PROGMEM Language_Str MSG_PREHEAT_2 = PREHEAT_2_LABEL _UxGT(" ヨネツ"); // "Preheat " PREHEAT_1_LABEL + PROGMEM Language_Str MSG_PREHEAT_2_H = PREHEAT_2_LABEL _UxGT(" ヨネツ ~"); // "Preheat " PREHEAT_1_LABEL + PROGMEM Language_Str MSG_PREHEAT_2_END = PREHEAT_2_LABEL _UxGT(" ヨネツノズル"); // " Nozzle" + PROGMEM Language_Str MSG_PREHEAT_2_END_E = PREHEAT_2_LABEL _UxGT(" ヨネツノズル ~"); // " Nozzle" + PROGMEM Language_Str MSG_PREHEAT_2_ALL = PREHEAT_2_LABEL _UxGT(" スベテヨネツ"); // " All" + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = PREHEAT_2_LABEL _UxGT(" ベッドヨネツ"); // " Bed" + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = PREHEAT_2_LABEL _UxGT(" ヨネツセッテイ"); // " conf" + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("カネツテイシ"); // "Cooldown" + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("デンゲン オン"); // "Switch power on" + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("デンゲン オフ"); // "Switch power off" + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("オシダシ"); // "Extrude" + PROGMEM Language_Str MSG_RETRACT = _UxGT("ヒキコミセッテイ"); // "Retract" + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("ジクイドウ"); // "Move axis" + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("ベッドレベリング"); // "Bed leveling" + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("ベッドレベリング"); // "Level bed" + + PROGMEM Language_Str MSG_MOVING = _UxGT("イドウチュウ"); // "Moving..." + PROGMEM Language_Str MSG_FREE_XY = _UxGT("XYジク カイホウ"); // "Free XY" + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Xジク イドウ"); // "Move X" + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Yジク イドウ"); // "Move Y" + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Zジク イドウ"); // "Move Z" + PROGMEM Language_Str MSG_MOVE_E = _UxGT("エクストルーダー"); // "Extruder" + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("%smm イドウ"); // "Move 0.025mm" + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("0.1mm イドウ"); // "Move 0.1mm" + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT(" 1mm イドウ"); // "Move 1mm" + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT(" 10mm イドウ"); // "Move 10mm" + PROGMEM Language_Str MSG_SPEED = _UxGT("ソクド"); // "Speed" + PROGMEM Language_Str MSG_BED_Z = _UxGT("Zオフセット"); // "Bed Z" + PROGMEM Language_Str MSG_NOZZLE = _UxGT("ノズル"); // "Nozzle" + PROGMEM Language_Str MSG_BED = _UxGT("ベッド"); // "Bed" + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("ファンソクド"); // "Fan speed" + PROGMEM Language_Str MSG_FLOW = _UxGT("トシュツリョウ"); // "Flow" + PROGMEM Language_Str MSG_CONTROL = _UxGT("セイギョ"); // "Control" + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" サイテイ"); // " Min" + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" サイコウ"); // " Max" + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" ファクター"); // " Fact" + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("ジドウオンドセイギョ"); // "Autotemp" + PROGMEM Language_Str MSG_LCD_ON = _UxGT("オン"); // "On" + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("オフ"); // "Off" + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("センタク"); // "Select" + PROGMEM Language_Str MSG_SELECT_E = _UxGT("センタク *"); + PROGMEM Language_Str MSG_ACC = _UxGT("カソクド mm/s²"); // "Accel" + PROGMEM Language_Str MSG_JERK = _UxGT("ヤクドウ mm/s"); // "Jerk" + PROGMEM Language_Str MSG_VA_JERK = _UxGT("ジク ヤクドウ mm/s") LCD_STR_A; // "Va-jerk" + PROGMEM Language_Str MSG_VB_JERK = _UxGT("ジク ヤクドウ mm/s") LCD_STR_B; // "Vb-jerk" + PROGMEM Language_Str MSG_VC_JERK = _UxGT("ジク ヤクドウ mm/s") LCD_STR_C; // "Vc-jerk" + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("ステップ/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("ステップ/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("ステップ/mm"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("エクストルーダー ヤクド"); // "Ve-jerk" + PROGMEM Language_Str MSG_VMAX_A = _UxGT("サイダイオクリソクド ") LCD_STR_A; // "Vmax A" + PROGMEM Language_Str MSG_VMAX_B = _UxGT("サイダイオクリソクド ") LCD_STR_A; // "Vmax B" + PROGMEM Language_Str MSG_VMAX_C = _UxGT("サイダイオクリソクド ") LCD_STR_A; // "Vmax C" + PROGMEM Language_Str MSG_VMAX_E = _UxGT("サイダイオクリソクド ") LCD_STR_A; // "Vmax E" + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("サイダイオクリソクド *"); // "Vmax E1" + PROGMEM Language_Str MSG_VMIN = _UxGT("サイショウオクリソクド"); // "Vmin" + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("サイショウイドウソクド"); // "VTrav min" + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("カソクド mm/s²"); // "Accel" + PROGMEM Language_Str MSG_AMAX = _UxGT("サイダイカソクド "); // "Amax " + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("ヒキコミカソクド"); // "A-retract" + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("イドウカソクド"); // "A-travel" + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("オンド"); // "Temperature" + PROGMEM Language_Str MSG_MOTION = _UxGT("ウゴキセッテイ"); // "Motion" + PROGMEM Language_Str MSG_FILAMENT = _UxGT("フィラメント"); // "Filament" + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("フィラメントチョッケイ"); // "Fil. Dia." + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("フィラメントチョッケイ *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCDコントラスト"); // "LCD contrast" + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("EEPROMヘホゾン"); // "Store memory" + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("EEPROMカラヨミコミ"); // "Load memory" + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("セッテイリセット"); // "Restore failsafe" + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("リフレッシュ"); // "Refresh" + PROGMEM Language_Str MSG_WATCH = _UxGT("ジョウホウガメン"); // "Info screen" + PROGMEM Language_Str MSG_PREPARE = _UxGT("ジュンビセッテイ"); // "Prepare" + PROGMEM Language_Str MSG_TUNE = _UxGT("チョウセイ"); // "Tune" + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("イチジテイシ"); // "Pause print" + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("プリントサイカイ"); // "Resume print" + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("プリントテイシ"); // "Stop print" + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("メディアカラプリント"); // "Print from SD" + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("メディアガアリマセン"); // "Card removed" + PROGMEM Language_Str MSG_DWELL = _UxGT("キュウシ"); // "Sleep..." + PROGMEM Language_Str MSG_USERWAIT = _UxGT("ツヅケルニハクリックシテクダサイ"); // "Wait for user..." + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("プリントガチュウシサレマシタ"); // "Print aborted" + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("ウゴキマセン"); // "No move." + PROGMEM Language_Str MSG_KILLED = _UxGT("ヒジョウテイシ"); // "KILLED. " + PROGMEM Language_Str MSG_STOPPED = _UxGT("テイシシマシタ"); // "STOPPED. " + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("ヒキコミリョウ mm"); // "Retract mm" + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("ヒキコミリョウS mm"); // "Swap Re.mm" + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("ヒキコミソクド mm/s"); // "Retract V" + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("ノズルタイヒ mm"); // "Hop mm" + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("ホショウリョウ mm"); // "UnRet mm" + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("ホショウリョウS mm"); // "S UnRet mm" + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("ホショウソクド mm/s"); // "UnRet V" + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("ジドウヒキコミ"); // "AutoRetr." + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("フィラメントコウカン"); // "Change filament" + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("メディアサイヨミコミ"); // "Init. SD card" + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("メディアコウカン"); // "Change SD card" + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Zプローブ ベッドガイ"); // "Z probe out. bed" + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch ジコシンダン"); // "BLTouch Self-Test" + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("BLTouch リセット"); // "Reset BLTouch" + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("サキニ %s%s%s ヲフッキサセテクダサイ"); // "Home ... first" + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Zオフセット"); // "Z Offset" + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Xジク ビドウ"); // "Babystep X" + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Yジク ビドウ"); // "Babystep Y" + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Zジク ビドウ"); // "Babystep Z" + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("イドウゲンカイケンチキノウ"); // "Endstop abort" + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("カネツシッパイ"); // "Heating failed" + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("エラー:ジョウチョウサーミスターキノウ"); // "Err: REDUNDANT TEMP" + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ネツボウソウ"); // "THERMAL RUNAWAY" + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("エラー:サイコウオンチョウカ"); // "Err: MAXTEMP" + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("エラー:サイテイオンミマン"); // "Err: MINTEMP" + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("エラー:ベッド サイコウオンチョウカ"); // "Err: MAXTEMP BED" + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("エラー:ベッド サイテイオンミマン"); // "Err: MINTEMP BED" + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("サキニ XY ヲフッキサセテクダサイ"); // "Home XY first" + PROGMEM Language_Str MSG_HALTED = _UxGT("プリンターハテイシシマシタ"); // "PRINTER HALTED" + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("リセットシテクダサイ"); // "Please reset" + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("カネツチュウ"); // "Heating..." + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("ベッド カネツチュウ"); // "Bed Heating..." + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("デルタ コウセイ"); // "Delta Calibration" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Xジク コウセイ"); // "Calibrate X" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Yジク コウセイ"); // "Calibrate Y" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Zジク コウセイ"); // "Calibrate Z" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("チュウシン コウセイ"); // "Calibrate Center" + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("コノプリンターニツイテ"); // "About Printer" + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("プリンタージョウホウ"); // "Printer Info" + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("プリントジョウキョウ"); // "Printer Stats" + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("セイギョケイジョウホウ"); // "Board Info" + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("サーミスター"); // "Thermistors" + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("エクストルーダースウ"); // "Extruders" + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("ボーレート"); // "Baud" + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("プロトコル"); // "Protocol" + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("キョウタイナイショウメイ"); // "Case light" + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("プリントスウ "); // "Print Count" + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("カンリョウスウ"); // "Completed" + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("プリントジカンルイケイ"); // "Total print time" + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("サイチョウプリントジカン"); // "Longest job time" + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("フィラメントシヨウリョウルイケイ"); // "Extruded total" + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("セッテイサイテイオン"); // "Min Temp" + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("セッテイサイコウオン"); // "Max Temp" + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("デンゲンシュベツ"); // "Power Supply" + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("モータークドウリョク"); // "Drive Strength" + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X DACシュツリョク %"); // "X Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y DACシュツリョク %"); // "Y Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z DACシュツリョク %"); // "Z Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E DACシュツリョク %"); // "E Driver %" + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("EEPROMヘホゾン"); // "Store memory" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("イチジテイシ"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("プリントサイカイ"); // "Resume print" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("コウカンヲカイシシマス", "シバラクオマチクダサイ")); // "Wait for start of the filament" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("フィラメントヌキダシチュウ", "シバラクオマチクダサイ")); // "Wait for filament unload" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_2_LINE("フィラメントヲソウニュウシ,", "クリックスルトゾッコウシマス")); // "Insert filament and press button" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("フィラメントソウテンチュウ", "シバラクオマチクダサイ")); // "Wait for filament load" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("プリントヲサイカイシマス", "シバラクオマチクダサイ")); // "Wait for print to resume" + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("マチガッタプリンター"); // "Wrong printer" + + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("セッテイカンリ"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("ショウサイセッテイ"); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("コショカイフク"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROMショキカ"); + + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("ツギヘ"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("ショキカ"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("ストップ"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("プリント"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("リセット"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("キャンセル"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("カンリョウ"); + + PROGMEM Language_Str MSG_YES = _UxGT("ハイ"); + PROGMEM Language_Str MSG_NO = _UxGT("イイエ"); + PROGMEM Language_Str MSG_BACK = _UxGT("モドリ"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("ソクド"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("ステップ/mm"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("ユーザーコマンド"); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("プリントガイチジテイシサレマシタ"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("プリントチュウ..."); +} diff --git a/Marlin/src/lcd/language/language_ko_KR.h b/Marlin/src/lcd/language/language_ko_KR.h index aca75b257bac..ac2b7b68f758 100644 --- a/Marlin/src/lcd/language/language_ko_KR.h +++ b/Marlin/src/lcd/language/language_ko_KR.h @@ -28,385 +28,77 @@ * See also http://marlinfw.org/docs/development/lcd_language.html * */ +namespace Language_ko_KR { + using namespace Language_en; // Inherit undefined strings from English -#define CHARSIZE 1 + constexpr uint8_t CHARSIZE = 1; + PROGMEM Language_Str LANGUAGE = _UxGT("Korean"); -#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("엔드스탑") -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("소프트 엔드스탑") -#define MSG_MAIN _UxGT("뒤로") -#define MSG_ADVANCED_SETTINGS _UxGT("고급 설정") -#define MSG_CONFIGURATION _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_X _UxGT("X 홈으로") -#define MSG_AUTO_HOME_Y _UxGT("Y 홈으로") -#define MSG_AUTO_HOME_Z _UxGT("Z 홈으로") -#define MSG_LEVEL_BED_HOMING _UxGT("XYZ 홈으로") -#define MSG_LEVEL_BED_WAITING _UxGT("누르면 시작합니다") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("다음 Point") -#define MSG_LEVEL_BED_DONE _UxGT("레벨링 완료!") -#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") -#define MSG_PREHEAT_1 _UxGT("예열하기 - " PREHEAT_1_LABEL) -#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(" conf") -#define MSG_PREHEAT_2 _UxGT("예열하기 - " PREHEAT_2_LABEL) -#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(" conf") -#define MSG_PREHEAT_CUSTOM _UxGT("Custom 예열") -#define MSG_COOLDOWN _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_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 User Commands") -#define MSG_UBL_DOING_G29 _UxGT("오토레벨링 하기") -#define MSG_UBL_UNHOMED _UxGT("Home XYZ first") -#define MSG_UBL_TOOLS _UxGT("UBL Tools") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_IDEX_MENU _UxGT("IDEX Mode") -#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Park") -#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplication") -#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("미러 사본") -#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Full control") -#define MSG_X_OFFSET _UxGT("2nd nozzle X") -#define MSG_Y_OFFSET _UxGT("2nd nozzle Y") -#define MSG_Z_OFFSET _UxGT("2nd nozzle Z") -#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("Activate UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deactivate UBL") -#define MSG_UBL_SET_TEMP_BED _UxGT("Bed Temp") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Hotend Temp") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#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_MESH_M1 _UxGT("Build Mesh (" PREHEAT_1_LABEL ")") -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Build Mesh (" PREHEAT_2_LABEL ")") -#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_MESH_M1 _UxGT("Validate " PREHEAT_1_LABEL " Mesh") -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Validate Mesh (" PREHEAT_2_LABEL ")") -#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("Output for CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") -#define MSG_UBL_INFO_UBL _UxGT("Output UBL Info") -#define MSG_EDIT_MESH _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("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 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("Free XY") -#define MSG_MOVE_X _UxGT("Move X") -#define MSG_MOVE_Y _UxGT("Move Y") -#define MSG_MOVE_Z _UxGT("Move Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_0025MM _UxGT("Move 0.025mm") -#define MSG_MOVE_01MM _UxGT("Move 0.1mm") -#define MSG_MOVE_1MM _UxGT("Move 1mm") -#define MSG_MOVE_10MM _UxGT("Move 10mm") -#define MSG_SPEED _UxGT("Speed") -#define MSG_BED_Z _UxGT("Bed Z") -#define MSG_NOZZLE _UxGT("노즐") -#define MSG_BED _UxGT("베드") -#define MSG_FAN_SPEED _UxGT("펜 속도") -#define MSG_EXTRA_FAN_SPEED _UxGT("엑스트라 펜 속도") -#define MSG_FLOW _UxGT("Flow") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") -#define MSG_VELOCITY _UxGT("Velocity") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Acceleration") -#define MSG_AMAX _UxGT("Amax ") -#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_ESTEPS _UxGT("Esteps/mm") -#define MSG_E1STEPS _UxGT("E1steps/mm") -#define MSG_E2STEPS _UxGT("E2steps/mm") -#define MSG_E3STEPS _UxGT("E3steps/mm") -#define MSG_E4STEPS _UxGT("E4steps/mm") -#define MSG_E5STEPS _UxGT("E5steps/mm") -#define MSG_E6STEPS _UxGT("E6steps/mm") -#define MSG_TEMPERATURE _UxGT("온도") -#define MSG_MOTION _UxGT("동작") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_FILAMENT_UNLOAD _UxGT("Unload mm") -#define MSG_FILAMENT_LOAD _UxGT("Load mm") -#define MSG_ADVANCE_K _UxGT("Advance K") -#define MSG_CONTRAST _UxGT("LCD contrast") -#define MSG_STORE_EEPROM _UxGT("설정 저장하기") -#define MSG_LOAD_EEPROM _UxGT("설정 읽어오기") -#define MSG_RESTORE_FAILSAFE _UxGT("설정 되돌리기") -#define MSG_INIT_EEPROM _UxGT("EEPROM 초기화") -#define MSG_REFRESH _UxGT("새로고침") -#define MSG_WATCH _UxGT("처음으로") -#define MSG_PREPARE _UxGT("준비하기") -#define MSG_TUNE _UxGT("Tune") -#define MSG_PAUSE_PRINT _UxGT("일시정지") -#define MSG_RESUME_PRINT _UxGT("재시작") -#define MSG_STOP_PRINT _UxGT("출력중지") -#define MSG_OUTAGE_RECOVERY _UxGT("Outage Recovery") -#define MSG_CARD_MENU _UxGT("SD 카드출력") -#define MSG_NO_CARD _UxGT("SD 카드없음") -#define MSG_DWELL _UxGT("슬립모드...") -#define MSG_USERWAIT _UxGT("Click to resume...") -#define MSG_PRINT_PAUSED _UxGT("일시 정지됨") -#define MSG_PRINTING _UxGT("출력중...") -#define MSG_PRINT_ABORTED _UxGT("취소됨") -#define MSG_NO_MOVE _UxGT("No move.") -#define MSG_KILLED _UxGT("죽음. ") -#define MSG_STOPPED _UxGT("멈춤. ") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") -#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("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_CHANGE_SDCARD _UxGT("Change SD card") -#define MSG_ZPROBE_OUT _UxGT("Z Probe past bed") -#define MSG_SKEW_FACTOR _UxGT("Skew Factor") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Deploy BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Stow BLTouch") -#define MSG_MANUAL_DEPLOY _UxGT("Deploy Z-Probe") -#define MSG_MANUAL_STOW _UxGT("Stow Z-Probe") -#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("Probe Z Offset") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") -#define MSG_HEATING_FAILED_LCD _UxGT("Heating failed") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Bed heating failed") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") -#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("BED THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP _UxGT("Err: MAXTEMP") -#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_COOLING _UxGT("Cooling...") -#define MSG_BED_HEATING _UxGT("Bed heating...") -#define MSG_BED_COOLING _UxGT("Bed cooling...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Calibration") -#define MSG_DELTA_CALIBRATE_X _UxGT("Calibrate X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrate Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("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_Z_OFFSET_CALIBRATE _UxGT("Probe Z-offset") -#define MSG_DELTA_DIAG_ROD _UxGT("Diag Rod") -#define MSG_DELTA_HEIGHT _UxGT("Height") -#define MSG_DELTA_RADIUS _UxGT("Radius") -#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("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 >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Print Count") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") - #define MSG_INFO_PRINT_TIME _UxGT("Total print time") - #define MSG_INFO_PRINT_LONGEST _UxGT("Longest job time") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded total") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Prints") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completed") - #define MSG_INFO_PRINT_TIME _UxGT("Total") - #define MSG_INFO_PRINT_LONGEST _UxGT("Longest") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruded") -#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_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_OPTION_RESUME _UxGT("Continue") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") -#define MSG_RUNOUT_SENSOR _UxGT("Runout Sensor") -#define MSG_ERR_HOMING_FAILED _UxGT("Homing failed") -#define MSG_ERR_PROBING_FAILED _UxGT("Probing failed") -#define MSG_M600_TOO_COLD _UxGT("M600: Too cold") - -// -// 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("Please wait...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Click to heat") - #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_RESUME_1 _UxGT("Resuming...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" 준비."); + PROGMEM Language_Str MSG_BACK = _UxGT("뒤로"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("카드 삽입됨"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("카드 제거됨"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("엔드스탑"); + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("소프트 엔드스탑"); + PROGMEM Language_Str MSG_MAIN = _UxGT("뒤로"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("고급 설정"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("설정"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("자동 시작"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("모터 정지"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("디버깅 메뉴"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("프로그레스바 테스트"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("오토홈"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X 홈으로"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y 홈으로"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z 홈으로"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("XYZ 홈으로"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("누르면 시작합니다"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("다음 Point"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("레벨링 완료!"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("예열하기 - ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("예열하기 - ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("예열하기 - ") PREHEAT_1_LABEL _UxGT(" 노즐"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("예열하기 - ") PREHEAT_1_LABEL _UxGT(" 노즐 ~"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("예열하기 - ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("예열하기 - ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("예열하기 - ") PREHEAT_2_LABEL _UxGT(" 노즐"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("예열하기 - ") PREHEAT_2_LABEL _UxGT(" 노즐 ~"); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Custom 예열"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("식히기"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("스위치 전원 켜기"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("스위치 전원 끄기"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("밀어내기"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("당기기"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("축 이동"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("베드 레벨링"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("미러 사본"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("오토레벨링 하기"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("노즐"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("노즐 ~"); + PROGMEM Language_Str MSG_BED = _UxGT("베드"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("펜 속도"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("펜 속도 ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("엑스트라 펜 속도"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("엑스트라 펜 속도 ="); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("온도"); + PROGMEM Language_Str MSG_MOTION = _UxGT("동작"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("설정 저장하기"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("설정 읽어오기"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("설정 되돌리기"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM 초기화"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("새로고침"); + PROGMEM Language_Str MSG_WATCH = _UxGT("처음으로"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("준비하기"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("일시정지"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("재시작"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("출력중지"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("SD 카드출력"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("SD 카드없음"); + PROGMEM Language_Str MSG_DWELL = _UxGT("슬립모드..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("일시 정지됨"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("출력중..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("취소됨"); + PROGMEM Language_Str MSG_KILLED = _UxGT("죽음. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("멈춤. "); + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("잘못된 프린터"); +} diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 8f86d5eaa9fc..d7305d3ea331 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -32,251 +32,216 @@ #define DISPLAY_CHARSET_ISO10646_1 #define NOT_EXTENDED_ISO10646_1_5X7 -#define WELCOME_MSG MACHINE_NAME _UxGT(" gereed.") -#define MSG_BACK _UxGT("Terug") -#define MSG_SD_INSERTED _UxGT("Kaart ingestoken") -#define MSG_SD_REMOVED _UxGT("Kaart verwijderd") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Hoofdmenu") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Motoren uit") -#define MSG_DEBUG_MENU _UxGT("Debug Menu") //accepted English terms -#define MSG_PROGRESS_BAR_TEST _UxGT("Vooruitgang Test") -#define MSG_AUTO_HOME _UxGT("Auto home") -#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_LEVEL_BED_HOMING _UxGT("Homing XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klik voor begin") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Volgende Plaats") -#define MSG_LEVEL_BED_DONE _UxGT("Bed level kompl.") -#define MSG_SET_HOME_OFFSETS _UxGT("Zet home offsets") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("H offset toegep.") -#define MSG_SET_ORIGIN _UxGT("Nulpunt instellen") -#define MSG_PREHEAT_1 _UxGT(PREHEAT_1_LABEL " voorverwarmen") -#define MSG_PREHEAT_1_N _UxGT(PREHEAT_1_LABEL " voorverw. ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1_N _UxGT("aan") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Einde") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1_N _UxGT("Bed") -#define MSG_PREHEAT_1_SETTINGS _UxGT(PREHEAT_1_LABEL " verw. conf") -#define MSG_PREHEAT_2 _UxGT(PREHEAT_2_LABEL " voorverwarmen") -#define MSG_PREHEAT_2_N _UxGT(PREHEAT_2_LABEL " voorverw. ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2_N _UxGT("aan") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Einde") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2_N _UxGT("Bed") -#define MSG_PREHEAT_2_SETTINGS _UxGT(PREHEAT_2_LABEL " verw. conf") -#define MSG_COOLDOWN _UxGT("Afkoelen") -#define MSG_SWITCH_PS_ON _UxGT("Stroom aan") -#define MSG_SWITCH_PS_OFF _UxGT("Stroom uit") -#define MSG_EXTRUDE _UxGT("Extrude") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("As verplaatsen") -#define MSG_BED_LEVELING _UxGT("Bed Leveling") -#define MSG_LEVEL_BED _UxGT("Level bed") +namespace Language_nl { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_MOVING _UxGT("Verplaatsen...") -#define MSG_FREE_XY _UxGT("Vrij XY") -#define MSG_MOVE_X _UxGT("Verplaats X") -#define MSG_MOVE_Y _UxGT("Verplaats Y") -#define MSG_MOVE_Z _UxGT("Verplaats Z") -#define MSG_MOVE_E _UxGT("Extruder") -#define MSG_MOVE_0025MM _UxGT("Verplaats 0.025mm") -#define MSG_MOVE_01MM _UxGT("Verplaats 0.1mm") -#define MSG_MOVE_1MM _UxGT("Verplaats 1mm") -#define MSG_MOVE_10MM _UxGT("Verplaats 10mm") -#define MSG_SPEED _UxGT("Snelheid") -#define MSG_BED_Z _UxGT("Bed Z") -#define MSG_NOZZLE _UxGT("Nozzle") -#define MSG_BED _UxGT("Bed") -#define MSG_FAN_SPEED _UxGT("Fan snelheid") -#define MSG_FLOW _UxGT("Flow") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("Aan") -#define MSG_LCD_OFF _UxGT("Uit") -#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("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_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_AMAX _UxGT("Amax ") -#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_ESTEPS _UxGT("Esteps/mm") -#define MSG_E1STEPS _UxGT("E1steps/mm") -#define MSG_E2STEPS _UxGT("E2steps/mm") -#define MSG_E3STEPS _UxGT("E3steps/mm") -#define MSG_E4STEPS _UxGT("E4steps/mm") -#define MSG_E5STEPS _UxGT("E5steps/mm") -#define MSG_E6STEPS _UxGT("E6steps/mm") -#define MSG_TEMPERATURE _UxGT("Temperatuur") -#define MSG_MOTION _UxGT("Beweging") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_ADVANCE_K _UxGT("Advance K") //accepted english dutch -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") -#define MSG_CONTRAST _UxGT("LCD contrast") -#define MSG_STORE_EEPROM _UxGT("Geheugen opslaan") -#define MSG_LOAD_EEPROM _UxGT("Geheugen laden") -#define MSG_RESTORE_FAILSAFE _UxGT("Noodstop reset") -#define MSG_REFRESH _UxGT("Ververs") -#define MSG_WATCH _UxGT("Info scherm") -#define MSG_PREPARE _UxGT("Voorbereiden") -#define MSG_TUNE _UxGT("Afstellen") -#define MSG_PAUSE_PRINT _UxGT("Print pauzeren") -#define MSG_RESUME_PRINT _UxGT("Print hervatten") -#define MSG_STOP_PRINT _UxGT("Print stoppen") -#define MSG_CARD_MENU _UxGT("Print van SD") -#define MSG_NO_CARD _UxGT("Geen SD kaart") -#define MSG_DWELL _UxGT("Slapen...") -#define MSG_USERWAIT _UxGT("Wachten...") -#define MSG_PRINT_ABORTED _UxGT("Print afgebroken") -#define MSG_NO_MOVE _UxGT("Geen beweging.") -#define MSG_KILLED _UxGT("Afgebroken. ") -#define MSG_STOPPED _UxGT("Gestopt. ") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") //accepted English term in Dutch -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Ruil Retract mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract F") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ruil UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet F") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Verv. Filament") -#define MSG_INIT_SDCARD _UxGT("Init. SD kaart") -#define MSG_CHANGE_SDCARD _UxGT("Verv. SD Kaart") -#define MSG_ZPROBE_OUT _UxGT("Z probe uit. bed") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Zelf-Test") -#define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Eerst") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") //accepted English term in Dutch -#define MSG_BABYSTEP_X _UxGT("Babystap X") -#define MSG_BABYSTEP_Y _UxGT("Babystap Y") -#define MSG_BABYSTEP_Z _UxGT("Babystap Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop afbr.") -#define MSG_HEATING_FAILED_LCD _UxGT("Voorverw. fout") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Redun. temp fout") -#define MSG_THERMAL_RUNAWAY _UxGT("Therm. wegloop") -#define MSG_ERR_MAXTEMP _UxGT("Err: Max. temp") -#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_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_DELTA_CALIBRATE _UxGT("Delta Calibratie") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibreer X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibreer Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibreer Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibreer Midden") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Calibratie") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Zet Delta Hoogte") + constexpr uint8_t CHARSIZE = 1; + PROGMEM Language_Str LANGUAGE = _UxGT("Dutch"); -#define MSG_INFO_STATS_MENU _UxGT("Printer Stats") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") //accepted English term in Dutch -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") -#define MSG_INFO_EXTRUDERS _UxGT("Extruders") -#define MSG_INFO_BAUDRATE _UxGT("Baud") -#define MSG_INFO_MENU _UxGT("Over Printer") -#define MSG_INFO_PRINTER_MENU _UxGT("Printer Info") -#define MSG_INFO_PROTOCOL _UxGT("Protocol") -#define MSG_CASE_LIGHT _UxGT("Case licht") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" gereed."); + PROGMEM Language_Str MSG_BACK = _UxGT("Terug"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Kaart ingestoken"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Kaart verwijderd"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("Hoofdmenu"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motoren uit"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Debug Menu"); //accepted English terms + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Vooruitgang Test"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Auto home"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Home X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Homing XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Klik voor begin"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Volgende Plaats"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Bed level kompl."); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Zet home offsets"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("H offset toegep."); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Nulpunt instellen"); + PROGMEM Language_Str MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" voorverwarmen"); + PROGMEM Language_Str MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" voorverw. ~"); + PROGMEM Language_Str MSG_PREHEAT_1_END = PREHEAT_1_LABEL _UxGT(" voorverw. Einde"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = PREHEAT_1_LABEL _UxGT(" voorverw. Einde ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = PREHEAT_1_LABEL _UxGT(" voorverw. aan"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = PREHEAT_1_LABEL _UxGT(" voorverw. Bed"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = PREHEAT_1_LABEL _UxGT(" verw. conf"); + PROGMEM Language_Str MSG_PREHEAT_2 = PREHEAT_2_LABEL _UxGT(" voorverwarmen"); + PROGMEM Language_Str MSG_PREHEAT_2_H = PREHEAT_2_LABEL _UxGT(" voorverw. ~"); + PROGMEM Language_Str MSG_PREHEAT_2_END = PREHEAT_2_LABEL _UxGT(" voorverw. Einde"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = PREHEAT_2_LABEL _UxGT(" voorverw. Einde ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = PREHEAT_2_LABEL _UxGT(" voorverw. aan"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = PREHEAT_2_LABEL _UxGT(" voorverw. Bed"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = PREHEAT_2_LABEL _UxGT(" verw. conf"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Afkoelen"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Stroom aan"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Stroom uit"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrude"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retract"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("As verplaatsen"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Bed Leveling"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Level bed"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Printed Aantal") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Totaal Voltooid") - #define MSG_INFO_PRINT_TIME _UxGT("Totale Printtijd") - #define MSG_INFO_PRINT_LONGEST _UxGT("Langste Printtijd") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Totaal Extrudeert") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Aantal") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Voltooid") - #define MSG_INFO_PRINT_TIME _UxGT("Printtijd ") - #define MSG_INFO_PRINT_LONGEST _UxGT("Langste") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrud.") -#endif + PROGMEM Language_Str MSG_MOVING = _UxGT("Verplaatsen..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Vrij XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Verplaats X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Verplaats Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Verplaats Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extruder"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extruder *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Verplaats %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Verplaats 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Verplaats 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Verplaats 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Snelheid"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Bed Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozzle"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozzle ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Bed"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan snelheid"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan snelheid ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Flow"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flow ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Autotemp"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Aan"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Uit"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Selecteer"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Selecteer *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Versn"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatuur"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Beweging"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Advance K"); //accepted english dutch + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advance K *"); //accepted english dutch + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E in mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Dia."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Dia. *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD contrast"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Geheugen opslaan"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Geheugen laden"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Noodstop reset"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ververs"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Info scherm"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Voorbereiden"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Afstellen"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Print pauzeren"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Print hervatten"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Print stoppen"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Print van SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Geen SD kaart"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Slapen..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Wachten..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print afgebroken"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Geen beweging."); + PROGMEM Language_Str MSG_KILLED = _UxGT("Afgebroken. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("Gestopt. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retract mm"); //accepted English term in Dutch + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Ruil Retract mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retract F"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Ruil UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet F"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Verv. Filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Verv. Filament *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Init. SD kaart"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Verv. SD Kaart"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z probe uit. bed"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Zelf-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s Eerst"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z Offset"); //accepted English term in Dutch + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystap X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystap Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystap Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop afbr."); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Voorverw. fout"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Redun. temp fout"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Therm. wegloop"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: Max. temp"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: Min. temp"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: Max.tmp bed"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: Min.tmp bed"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY Eerst"); + PROGMEM Language_Str MSG_HALTED = _UxGT("PRINTER GESTOPT"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Reset A.U.B."); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only. Keep English standard + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Voorwarmen..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Bed voorverw..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Calibratie"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibreer X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibreer Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibreer Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibreer Midden"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibratie"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Zet Delta Hoogte"); -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("PSU") //accepted English term in Dutch + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Printer Stats"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Board Info"); //accepted English term in Dutch + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extruders"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Over Printer"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Printer Info"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocol"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Case licht"); -#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_OPTION_RESUME _UxGT("Hervat print") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ") //accepeted English term -// -// 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 - // Up to 3 lines - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wacht voor start") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filament te") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("verwisselen") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament uit") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("te laden") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klik knop om...") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("verw. nozzle.") //nozzle accepted English term - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozzle verw.") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Wacht a.u.b.") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laad filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("en druk knop") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("om verder...") - #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_RESUME_1 _UxGT("Wacht voor print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("om verder") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("te gaan") -#else // LCD_HEIGHT < 4 - // Up to 2 lines - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("start...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("uitladen...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klik knop om...") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("verw. nozzle.") //nozzle accepted English term - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Verwarmen...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laad filament") - #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_RESUME_1 _UxGT("Wacht voor") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("printing...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Onjuiste printer"); + + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Printed Aantal"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Totaal Voltooid"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Totale Printtijd"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Langste Printtijd"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Totaal Extrudeert"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Aantal"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Voltooid"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Printtijd "); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Langste"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Extrud."); + #endif + + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); //accepted English term in Dutch + + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Motorstroom"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Driver %"); //accepted English term in Dutch + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Driver %"); //accepted English term in Dutch + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Driver %"); //accepted English term in Dutch + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Driver %"); //accepted English term in Dutch + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC Opslaan"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Hervat print"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozzle: "); //accepeted English term + // + // 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 + // Up to 3 lines + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Wacht voor start", "filament te", "verwisselen")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Wacht voor", "filament uit", "te laden")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Klik knop om...", "verw. nozzle.")); //nozzle accepted English term + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Nozzle verw.", "Wacht a.u.b.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Laad filament", "en druk knop", "om verder...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Wacht voor", "filament te", "laden")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Wacht voor print", "om verder", "te gaan")); + #else + // Up to 2 lines + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_2_LINE("Wacht voor", "start...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Wacht voor", "uitladen...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Klik knop om...", "verw. nozzle.")); //nozzle accepted English term + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Verwarmen...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_2_LINE("Laad filament", "en druk knop")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Wacht voor", "inladen...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Wacht voor", "printing...")); + #endif +} diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 868f882ebbae..b38d21f81405 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -22,232 +22,560 @@ #pragma once /** - * Polish for DOGM display - includes accented characters + * Polish - includes accented characters + * + * LCD Menu Messages + * See also http://marlinfw.org/docs/development/lcd_language.html + * */ #define DISPLAY_CHARSET_ISO10646_PL -#define CHARSIZE 2 +namespace Language_pl { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Polish"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" gotowy."); + PROGMEM Language_Str MSG_YES = _UxGT("TAK"); + PROGMEM Language_Str MSG_NO = _UxGT("NIE"); + PROGMEM Language_Str MSG_BACK = _UxGT("Wstecz"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Przerywanie..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Karta włożona"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Karta usunięta"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Karta zwolniona"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Oczekiwanie na kartę"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Bład odczytu karty"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("Urządzenie USB usunięte"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Błąd uruchomienia USB"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Krańców."); // Max length 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Progr. Krańcówki"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu główne"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Ustawienie zaawansowane"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfiguracja"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Autostart"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Wyłącz silniki"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu Debugowania"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Testowy pasek postępu"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Pozycja zerowa"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Zeruj X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Zeruj Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Zeruj Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Autowyrównanie Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Pozycja zerowa"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknij by rozp."); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Następny punkt"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Wypoziomowano!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Wys. zanikania"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Ust. poz. zer."); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Poz. zerowa ust."); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Ustaw punkt zero"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Rozgrzej ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Rozgrzej ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" Dysza"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" Dysza ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" wsz."); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" stół"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Rozgrzej ") PREHEAT_1_LABEL _UxGT(" ustaw."); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Rozgrzej ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Rozgrzej ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" Dysza"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" Dysza ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" wsz."); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" stół"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Rozgrzej ") PREHEAT_2_LABEL _UxGT(" ustaw."); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Rozgrzej własne ust."); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Chłodzenie"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Sterowanie Lasera"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Wyłącz Laser"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Włącz Laser"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Zasilanie Lasera"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Sterowanie wrzeciona"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Wyłącz wrzeciono"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Włącz wrzeciono"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Zasilanie wrzeciona"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Rewers wrzeciona"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Włącz zasilacz"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Wyłącz zasilacz"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Ekstruzja"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Wycofanie"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Ruch osi"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Poziomowanie stołu"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Wypoziomuj stół"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Narożniki poziomowania"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Nastepny narożnik"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Edytor siatki"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Edycja siatki"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Edycja siatki zatrzymana"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Punkt pomiarowy"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Indeks X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Indeks Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Wartość Z"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Własne Polecenia"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Test sondy"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Punky"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Odchylenie"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Tryb IDEX"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Przesunięcie narzędzia"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Parkowanie"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikowanie"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Kopia lustrzana"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Pełne sterowanie"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2ga dysza X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2ga dysza Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2ga dysza Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Wykonywanie G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Narzędzia UBL"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Punkt pochylenia"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Ręczne Budowanie Siatki"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Umieść podkładkę i zmierz"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Zmierz"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Usuń & Zmierz Stół"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Przesuwanie do następnego"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Aktywacja UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Dezaktywacja UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Temperatura stołu"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Temperatura stołu"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temperatura dyszy"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Temperatura dyszy"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Edycja siatki"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Edycja własnej siatki"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Dostrajanie siatki"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Koniec edycji siati"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Buduj własna siatkę"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Buduj siatkę"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Buduj siatkę (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Buduj siatkę (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Buduj siatkę na zimno"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Dostrojenie wysokości siatki"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Wartość wysokości"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Sprawdzenie siatki"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Sprawdzenie siatki (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Sprawdzenie siatki (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Sprawdzenie własnej siatki"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 Nagrzewanie stołu"); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 Nagrzewanie dyszy"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Napełnianie ręczne..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Napełnij kreśloną długością"); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Napełianie zakończone"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 Przewane"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Opuszczanie G26"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Kontynuuj tworzenie siatki"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Poziomowanie siatką"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Poziomowaie 3-punktowe"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Poziomowaie według siatki"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Poziomuj siatkę"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Punkty boczne"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Rodzaj mapy"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Wyslij mapę siatki"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Wyslij do Hosta"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Wyslij do CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Kopia poza drukarką"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Wyslij info UBL"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Stopień wypełnienia"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ręczne wypełnienie"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Inteligentne wypełnienie"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Wypełnienie siatki"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Unieważnij wszystko"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Unieważnij najbliższy"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Dostrajaj wszystko"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Dostrajaj najbliższy"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Przechowywanie siatki"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Slot Pamięci"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Załaduj siatke stołu"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Zapisz siatke stołu"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Siatka %i załadowana"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Siatka %i Zapisana"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Brak magazynu"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Błąd: Zapis UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Bład: Odczyt UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Przesunięcie Z: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Przesunięcie Z zatrzymane"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Krok po kroku"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. Tworzeni ezimnej siatki"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. Inteligentne wypełnienie"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. Sprawdzenie siatki"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. Dostrojenie wszystkiego"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. Sprawdzenie siatki"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. Dostrojenie wszystkiego"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. Zapis siatki stołu"); + + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Sterowanie LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Światła"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Ustawienia świateł"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Czerwony"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Pomarańczowy"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Zółty"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Zielony"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Niebieski"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indygo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Fioletowy"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Biały"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Domyślny"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Własne światła"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Czerwony"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Zielony"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Niebieski"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Biały"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Jasność"); + + PROGMEM Language_Str MSG_MOVING = _UxGT("Ruch..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Swobodne XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Przesuń w X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Przesuń w Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Przesuń w Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Ekstruzja (os E)"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Ekstruzja (os E) *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Dysza za zimna"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Przesuń co %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Przesuń co .1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Przesuń co 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Przesuń co 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Predkość"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Stół Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Dysza"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Dysza ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Stół"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Obudowa"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Obroty wiatraka"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Obroty wiatraka ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Obroty dodatkowego wiatraka"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Obroty dodatkowego wiatraka ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Przepływ"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Przepływ ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Ustawienia"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Mnożnik"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto. temperatura"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Wł."); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Wył."); + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autostrojenie"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autostrojenie *"); + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Wybierz"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Wybierz *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Przyspieszenie"); + PROGMEM Language_Str MSG_JERK = _UxGT("Zryw"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("Zryw V") LCD_STR_A; + PROGMEM Language_Str MSG_VB_JERK = _UxGT("Zryw V") LCD_STR_B; + PROGMEM Language_Str MSG_VC_JERK = _UxGT("Zryw V") LCD_STR_C; + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Zryw Ve"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Prędkość (V)"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vskok min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Przyspieszenie (A)"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-wycofanie"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-przesuń."); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("kroki/mm"); + PROGMEM Language_Str MSG_A_STEPS = _UxGT("kroki") LCD_STR_A _UxGT("/mm"); + PROGMEM Language_Str MSG_B_STEPS = _UxGT("kroki") LCD_STR_B _UxGT("/mm"); + PROGMEM Language_Str MSG_C_STEPS = _UxGT("kroki") LCD_STR_C _UxGT("/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("krokiE/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("kroki */mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Ruch"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E w mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Śr. fil."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Śr. fil. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Wyładuj mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Załaduj mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Advance K"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Advance K *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Zapisz w pamięci"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Wczytaj z pamięci"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Ustaw. fabryczne"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initializuj EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Uaktualnij kartę"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetuj drukarkę"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Odswież"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Ekran główny"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Przygotuj"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Strojenie"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Start wydruku"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Następny"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Inic."); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Stop"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Drukuj"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Resetuj"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Przerwij"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Gotowe"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Wstrzymaj druk"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Wznowienie"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Stop"); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Odzyskiwanie po awarii"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Karta SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Brak karty"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Uśpij..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Oczekiwanie..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Druk wstrzymany"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Drukowanie..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Druk przerwany"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Brak ruchu"); + PROGMEM Language_Str MSG_KILLED = _UxGT("Ubity. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("Zatrzymany. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Wycofaj mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Z Wycof. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Wycofaj V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Skok Z mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Cof. wycof. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Z Cof. wyc. mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Cof. wycof. V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Auto. wycofanie"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Długość zmiany"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Długość oczyszczania"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Zmiana narzędzia"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Podniesienie Z"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Prędkość napełniania"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Prędkość wycofania"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Dysza w oczekiwaniu"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Zmień filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Zmień filament *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Załaduj Filament"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Załaduj Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Wyładuj Filament"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Wyładuj Filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Wyładuj wszystkie"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Inicjal. karty SD"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Zmiana karty SD"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Zwolnienie karty"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z za stołem"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Współczynik skrzywienia"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Stow"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Deploy"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: SW-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: 5V-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: OD-Mode"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Mode-Store"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Set BLTouch to 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Set BLTouch to OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Report Drain"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("NIEBEZPIECZNE: Złe ustawienia mogą uszkodzić drukarkę. Kontynuować?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Init TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Z Offset Test"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Save"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Najpierw Home %s%s%s"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Offset Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Łącznie"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Błąd krańcówki"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Rozgrz. nieudane"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Rozgrz. stołu nieudane"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Rozgrz. komory nieudane"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Błąd temperatury"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ZANIK TEMPERATURY"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ZANIK TEMP. STOŁU"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("ZANIK TEMP.KOMORY"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Błąd: MAXTEMP"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Błąd: MINTEMP"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Błąd: MAXTEMP STÓŁ"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Błąd: MINTEMP STÓŁ"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Błąd: MAXTEMP KOMORA"); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Błąd: MINTEMP KOMORA"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Najpierw Home XY"); + PROGMEM Language_Str MSG_HALTED = _UxGT("Drukarka zatrzym."); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Proszę zresetować"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("g"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Rozgrzewanie..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Chłodzenie..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Rozgrzewanie stołu..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Chłodzenie stołu..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Rozgrzewanie komory..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Chłodzenie komory..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Kalibrowanie Delty"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibruj X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibruj Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibruj Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibruj środek"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Ustawienia delty"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto kalibrowanie"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Ustaw wysokość delty"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Przesun. Z sondy"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Ukośne ramię"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Wysokość"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Promień"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("O drukarce"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info drukarki"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Poziomowanie 3-punktowe"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Poziomowanie liniowe"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Poziomowanie biliniowe"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Poziomowanie siatką"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Statystyki"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info płyty"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistory"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Ekstrudery"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Predkość USB"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokół"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Zegar pracy: OFF"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Zegar pracy: ON"); + + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Oświetlenie obudowy"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jasność oświetlenia"); + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Niepoprawna drukarka"); -#define WELCOME_MSG MACHINE_NAME _UxGT(" gotowy.") -#define MSG_SD_INSERTED _UxGT("Karta włożona") -#define MSG_SD_REMOVED _UxGT("Karta usunięta") -#define MSG_LCD_ENDSTOPS _UxGT("Kranców.") // Max length 8 characters -#define MSG_MAIN _UxGT("Menu główne") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Wyłącz silniki") -#define MSG_AUTO_HOME _UxGT("Pozycja zerowa") -#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_LEVEL_BED _UxGT("Poziom. stołu") -#define MSG_LEVEL_BED_HOMING _UxGT("Pozycja zerowa") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknij by rozp.") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Następny punkt") -#define MSG_LEVEL_BED_DONE _UxGT("Wypoziomowano!") -#define MSG_USER_MENU _UxGT("Własne Polecenia") -#define MSG_SET_HOME_OFFSETS _UxGT("Ust. poz. zer.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Poz. zerowa ust.") -#define MSG_SET_ORIGIN _UxGT("Ustaw punkt zero") -#define MSG_PREHEAT_1 _UxGT("Rozgrzej " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" wsz.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Rozgrzej stół " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ustaw. rozg. " PREHEAT_1_LABEL) -#define MSG_PREHEAT_2 _UxGT("Rozgrzej " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" wsz.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Rozgrzej stół " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ustaw. rozg. " PREHEAT_2_LABEL) -#define MSG_COOLDOWN _UxGT("Chłodzenie") -#define MSG_SWITCH_PS_ON _UxGT("Włącz zasilacz") -#define MSG_SWITCH_PS_OFF _UxGT("Wyłącz zasilacz") -#define MSG_EXTRUDE _UxGT("Ekstruzja") -#define MSG_RETRACT _UxGT("Wycofanie") -#define MSG_MOVE_AXIS _UxGT("Ruch osi") -#define MSG_BED_LEVELING _UxGT("Poziom. stołu") -#define MSG_MOVE_X _UxGT("Przesuń w X") -#define MSG_MOVE_Y _UxGT("Przesuń w Y") -#define MSG_MOVE_Z _UxGT("Przesuń w Z") -#define MSG_MOVE_E _UxGT("Ekstruzja (os E)") -#define MSG_MOVE_0025MM _UxGT("Przesuń co .025mm") -#define MSG_MOVE_01MM _UxGT("Przesuń co .1mm") -#define MSG_MOVE_1MM _UxGT("Przesuń co 1mm") -#define MSG_MOVE_10MM _UxGT("Przesuń co 10mm") -#define MSG_SPEED _UxGT("Predkość") -#define MSG_BED_Z _UxGT("Stół Z") -#define MSG_NOZZLE _UxGT("Dysza") -#define MSG_BED _UxGT("Stół") -#define MSG_FAN_SPEED _UxGT("Obroty wiatraka") -#define MSG_FLOW _UxGT("Przepływ") -#define MSG_CONTROL _UxGT("Ustawienia") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Mnożnik") -#define MSG_AUTOTEMP _UxGT("Auto. temperatura") -#define MSG_LCD_ON _UxGT("Wł.") -#define MSG_LCD_OFF _UxGT("Wył.") -#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("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_VE_JERK _UxGT("Zryw Ve") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("Vskok min") -#define MSG_ACCELERATION MSG_ACC -#define MSG_AMAX _UxGT("Amax") -#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_ESTEPS _UxGT("krokiE/mm") -#define MSG_E1STEPS _UxGT("krokiE1/mm") -#define MSG_E2STEPS _UxGT("krokiE2/mm") -#define MSG_E3STEPS _UxGT("krokiE3/mm") -#define MSG_E4STEPS _UxGT("krokiE4/mm") -#define MSG_E5STEPS _UxGT("krokiE5/mm") -#define MSG_E6STEPS _UxGT("krokiE6/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Ruch") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E w mm3") -#define MSG_FILAMENT_DIAM _UxGT("Śr. fil.") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Zapisz w pamięci") -#define MSG_LOAD_EEPROM _UxGT("Wczytaj z pamięci") -#define MSG_RESTORE_FAILSAFE _UxGT("Ustaw. fabryczne") -#define MSG_REFRESH _UxGT("Odswież") -#define MSG_WATCH _UxGT("Ekran główny") -#define MSG_PREPARE _UxGT("Przygotuj") -#define MSG_TUNE _UxGT("Strojenie") -#define MSG_PAUSE_PRINT _UxGT("Pauza") -#define MSG_RESUME_PRINT _UxGT("Wznowienie") -#define MSG_STOP_PRINT _UxGT("Stop") -#define MSG_CARD_MENU _UxGT("Karta SD") -#define MSG_NO_CARD _UxGT("Brak karty") -#define MSG_DWELL _UxGT("Uśpij...") -#define MSG_USERWAIT _UxGT("Oczekiwanie...") -#define MSG_PRINT_ABORTED _UxGT("Druk przerwany") -#define MSG_NO_MOVE _UxGT("Brak ruchu") -#define MSG_KILLED _UxGT("Ubity. ") -#define MSG_STOPPED _UxGT("Zatrzymany. ") -#define MSG_CONTROL_RETRACT _UxGT("Wycofaj mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Z Wycof. mm") -#define MSG_CONTROL_RETRACTF _UxGT("Wycofaj V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Skok Z mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("Cof. wycof. mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Z Cof. wyc. mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Cof. wycof. V") -#define MSG_AUTORETRACT _UxGT("Auto. wycofanie") -#define MSG_FILAMENTCHANGE _UxGT("Zmień filament") -#define MSG_INIT_SDCARD _UxGT("Inicjal. karty SD") -#define MSG_CHANGE_SDCARD _UxGT("Zmiana karty SD") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z za stołem") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("Reset 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("Offset Z") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_ENDSTOP_ABORT _UxGT("Błąd krańcówki") -#define MSG_HEATING_FAILED_LCD _UxGT("Rozgrz. nieudane") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Błąd temperatury") -#define MSG_THERMAL_RUNAWAY _UxGT("Zanik temp.") -#define MSG_ERR_MAXTEMP _UxGT("Err max temp") -#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_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_BED_HEATING _UxGT("Rozgrzewanie stołu...") -#define MSG_DELTA_CALIBRATE _UxGT("Kalibrowanie Delty") -#define MSG_DELTA_CALIBRATE_X _UxGT("Kalibruj X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibruj Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Kalibruj Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Kalibruj środek") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Wydrukowano"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Ukończono"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Czas druku"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najdł. druk"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Użyty fil."); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Wydrukowano"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Ukończono"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Razem"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najdł. druk"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Użyty fil."); + #endif -#define MSG_INFO_MENU _UxGT("O drukarce") -#define MSG_INFO_PRINTER_MENU _UxGT("Info drukarki") -#define MSG_INFO_STATS_MENU _UxGT("Statystyki") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistory") -#define MSG_INFO_EXTRUDERS _UxGT("Ekstrudery") -#define MSG_INFO_BAUDRATE _UxGT("Predkość USB") -#define MSG_INFO_PROTOCOL _UxGT("Protokół") -#define MSG_CASE_LIGHT _UxGT("Oświetlenie") + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Zasilacz"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Siła silnika"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Siła %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Siła %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Siła %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Siła %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("TMC BŁĄD POŁĄCZENIA"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Zapisz DAC EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("ZMIEŃ FILAMENT"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("WYDRUK WSTRZYMANY"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ZAŁADUJ FILAMENT"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("WYŁADUJ FILAMENT"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPCJE WZNOWIENIA:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Oczyść więcej"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Kontynuuj"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Dysza: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Czujnik filamentu"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Dystans do czujnika mm"); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Zerowanie nieudane"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Sondowanie nieudane"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: za zimne"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukończono") - #define MSG_INFO_PRINT_TIME _UxGT("Czas druku") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdł. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Użyty fil.") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Wydrukowano") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Ukończono") - #define MSG_INFO_PRINT_TIME _UxGT("Razem") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdł. druk") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Użyty fil.") -#endif + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("WYBIERZ FILAMENT"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU"); + PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Uaktualnij firmware MMU!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU wymaga uwagi."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Wznów wydruk"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Wznawianie..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Załaduj filament"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Załaduj wszystko"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Załaduj do dyszy"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Wysuń filament"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Wysuń filament ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Wyładuj filament"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Ładowanie fil. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Wysuwanie fil. ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Wyładowywanie fil...."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Wszystko"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Resetuj MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Resetowanie MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Usuń, kliknij"); -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") -#define MSG_INFO_PSU _UxGT("Zasilacz") + PROGMEM Language_Str MSG_MIX = _UxGT("Miks"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Komponent ~"); + PROGMEM Language_Str MSG_MIXER = _UxGT("Mikser"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Pełny gradient"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Przełacz miks"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Cycle Mix"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradient Mix"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Odwrotny gradient"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Active V-tool"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Start V-tool"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT(" End V-tool"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-tool"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Reset V-tools"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Commit V-tool Mix"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools Were Reset"); + PROGMEM Language_Str MSG_START_Z = _UxGT("Start Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT(" End Z:"); -#define MSG_DRIVE_STRENGTH _UxGT("Siła silnika") -#define MSG_DAC_PERCENT _UxGT("Siła %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Zapisz DAC EEPROM") + PROGMEM Language_Str MSG_GAMES = _UxGT("Games"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Invaders"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Sn4k3"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Maze"); -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("ZMIEŃ FILAMENT") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ZMIEŃ OPCJE:") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Wznów drukowanie") + #define MSG_1_LINE(A) A "\0" "\0" + #define MSG_2_LINE(A,B) A "\0" B "\0" + #define MSG_3_LINE(A,B,C) A "\0" B "\0" C -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Czekam na ") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("zmianę filamentu") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("wyjęcie filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Włóz filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i naciśnij przycisk") - #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_RESUME_1 _UxGT("Czekam na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("wznowienie druku") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Proszę czekać...") - #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_RESUME_1 _UxGT("Wznowienie...") -#endif // LCD_HEIGHT < 4 + // + // 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 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Nacisnik przycisk", "by wznowić drukowanie")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkowanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Czekam na", "zmianę filamentu", "by wystartować")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Włóż filament", "i naciśnij przycisk", "by kontynuować")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Naciśnij przycisk", "by nagrzać dyszę")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Nagrzewanie dyszy", "Proszę czekać...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Czekam na", "wyjęcie filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Czekam na", "włożenie filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Czekam na", "oczyszczenie filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Kliknij by zakończyć", "oczyszczanie filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Czekam na", "wznowienie wydruku...")); + #else + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Kliknij by kontynuować")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkowanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Proszę czekać...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Włóż i kliknij")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Kliknij by nagrzać")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Nagrzewanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Wysuwanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Ładowanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Oczyszczanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Kliknij by zakończyć")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Wznawianie...")); + #endif + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("TMC Drivers"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Driver Current"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybrid Threshold"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Sensorless Homing"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Stepping Mode"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop Enabled"); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Reset"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT(" in:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Backlash"); + PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; + PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; + PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Correction"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Smoothing"); +} diff --git a/Marlin/src/lcd/language/language_pt-br.h b/Marlin/src/lcd/language/language_pt-br.h deleted file mode 100644 index 0becbc03e74d..000000000000 --- a/Marlin/src/lcd/language/language_pt-br.h +++ /dev/null @@ -1,446 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -/** - * Portuguese (Brazil) - * UTF-8 for Graphical Display - * - * LCD Menu Messages - * See also http://marlinfw.org/docs/development/lcd_language.html - * - */ - -// Put characters here that should be displayed with M117 -//_UxGT("áãàçÉéêíóõ") - -#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("Fins de curso") -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Fins curso") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_ADVANCED_SETTINGS _UxGT("Config. Avançada") -#define MSG_CONFIGURATION _UxGT("Configuração") -#define MSG_AUTOSTART _UxGT("Início automático") -#define MSG_DISABLE_STEPPERS _UxGT("Desabilit. motores") -#define MSG_DEBUG_MENU _UxGT("Menu Debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra Progres") -#define MSG_AUTO_HOME _UxGT("Ir a origem XYZ") -#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_Z_ALIGN _UxGT("Auto alinhar 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("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 aplicada") -#define MSG_SET_ORIGIN _UxGT("Ajustar Origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq.Todo " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_END _UxGT("Extrusora " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq.Mesa " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar " PREHEAT_1_LABEL) -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_END _UxGT("Extrusora " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar " PREHEAT_2_LABEL) -#define MSG_PREHEAT_CUSTOM _UxGT("Customizar Pre-aq.") -#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("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_MESH_X _UxGT("Índice X") -#define MSG_MESH_Y _UxGT("Índice Y") -#define MSG_MESH_EDIT_Z _UxGT("Valor Z") -#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("Nivel. Mesa Unif.") - -#define MSG_IDEX_MENU _UxGT("Modo IDEX") -#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Estacionar") -#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplicação") -#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Cópia espelhada") -#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Controle Total") -#define MSG_X_OFFSET _UxGT("2o bico X") -#define MSG_Y_OFFSET _UxGT("2o bico Y") -#define MSG_Z_OFFSET _UxGT("2o bico Z") - -#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("Movendo para Próximo") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") -#define MSG_UBL_SET_TEMP_BED _UxGT("Temp. Mesa") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Temp. Extrusora") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#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 Malha Custom") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Montar ") -#define MSG_UBL_BUILD_MESH_M1 _UxGT("Montar " PREHEAT_1_LABEL) -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Montar " PREHEAT_2_LABEL) -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar Malha fria") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Quant. de Altura") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") -#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Checar " PREHEAT_1_LABEL) -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Checar " PREHEAT_2_LABEL) -#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_EDIT_MESH _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") -#define MSG_MOVE_E _UxGT("Mover Extrusor") -#define MSG_HOTEND_TOO_COLD _UxGT("Extrus. mto fria") -#define MSG_MOVE_0025MM _UxGT("Mover 0.025mm") -#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_EXTRA_FAN_SPEED _UxGT("+Vel. Ventoinha") -#define MSG_FLOW _UxGT("Vazão") -#define MSG_CONTROL _UxGT("Controle") -#define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Máx") -#define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fator") -#define MSG_AUTOTEMP _UxGT("Temp. Automática") -#define MSG_LCD_ON _UxGT("Ligado") -#define MSG_LCD_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("Arrancada") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("arrancada VA") - #define MSG_VB_JERK _UxGT("arrancada VB") - #define MSG_VC_JERK _UxGT("arrancada VC") -#else - #define MSG_VA_JERK _UxGT("arrancada VX") - #define MSG_VB_JERK _UxGT("arrancada VY") - #define MSG_VC_JERK _UxGT("arrancada VZ") -#endif -#define MSG_VE_JERK _UxGT("arrancada VE") -#define MSG_JUNCTION_DEVIATION _UxGT("Desv. Junção") -#define MSG_VELOCITY _UxGT("Velocidade") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VDeslocamento min") -#define MSG_ACCELERATION _UxGT("Aceleração") -#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_KINEMATIC - #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_E6STEPS _UxGT("E6/mm") -#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_FILAMENT_UNLOAD _UxGT("Descarr. mm") -#define MSG_FILAMENT_LOAD _UxGT("Carregar mm") -#define MSG_ADVANCE_K _UxGT("Avanço K") -#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_SD_UPDATE _UxGT("Atualiz. SD") -#define MSG_RESET_PRINTER _UxGT("Resetar Impressora") -#define MSG_REFRESH _UxGT("Atualização") -#define MSG_WATCH _UxGT("Informações") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Ajustar") -#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_OUTAGE_RECOVERY _UxGT("Recuperar Impressão") -#define MSG_CARD_MENU _UxGT("Imprimir do SD") -#define MSG_NO_CARD _UxGT("Sem cartão SD") -#define MSG_DWELL _UxGT("Dormindo...") -#define MSG_USERWAIT _UxGT("Clique para retomar") -#define MSG_PRINT_PAUSED _UxGT("Impressão Pausada") -#define MSG_PRINTING _UxGT("Imprimindo...") -#define MSG_PRINT_ABORTED _UxGT("Impressão Abortada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("PARADA DE EMERGÊNCIA") -#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_ZHOP _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_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Des-RetTroca V") -#define MSG_AUTORETRACT _UxGT("Retração Automática") -#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Distancia Retração") -#define MSG_TOOL_CHANGE _UxGT("Mudar Ferramenta") -#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Levantar Z") -#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Preparar Veloc.") -#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Veloc. Retração") -#define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") -#define MSG_FILAMENTLOAD _UxGT("Carregar Filamento") -#define MSG_FILAMENTUNLOAD _UxGT("Descarreg. Filamento") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Descarregar Todos") -#define MSG_INIT_SDCARD _UxGT("Iniciar SD") -#define MSG_CHANGE_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("Estender BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Recolher BLTouch") -#define MSG_MANUAL_DEPLOY _UxGT("Estender Sonda-Z") -#define MSG_MANUAL_STOW _UxGT("Recolher Sonda-Z") - -#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("Abortar Fim de Curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Aquecer mesa falhou") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro:Temp Redundante") -#define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TÉRMICO") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("ESCAPE TÉRMICO MESA") -#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_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPRESSORA PAROU") -#define MSG_PLEASE_RESET _UxGT("Favor resetar") -#define MSG_SHORT_DAY _UxGT("d") -#define MSG_SHORT_HOUR _UxGT("h") -#define MSG_SHORT_MINUTE _UxGT("m") -#define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_COOLING _UxGT("Resfriando...") -#define MSG_BED_HEATING _UxGT("Aquecendo mesa...") -#define MSG_BED_COOLING _UxGT("Esfriando mesa...") -#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_Z_OFFSET_CALIBRATE _UxGT("Desloc. Sonda Z") -#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("Termistores") -#define MSG_INFO_EXTRUDERS _UxGT("Extrusoras") -#define MSG_INFO_BAUDRATE _UxGT("Taxa de Transmissão") -#define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz da Impressora") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Intensidade Brilho") - -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Total de Impressões") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Realizadas") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo de Impressão") - #define MSG_INFO_PRINT_LONGEST _UxGT("Trabalho Mais longo") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total de Extrusão") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Qtd de Impressões") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Realizadas") - #define MSG_INFO_PRINT_TIME _UxGT("Tempo de Impressão") - #define MSG_INFO_PRINT_LONGEST _UxGT("Maior trabalho") - #define MSG_INFO_PRINT_FILAMENT _UxGT("T. Extrusão") -#endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temp Mín") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Máx") -#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_PAUSE _UxGT("IMPRESSÃO PAUSADA") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CARREGAR FILAMENTO") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DESCARREG. FILAMENTO") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Config. de Retomada") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purgar mais") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar Impressão") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Bocal: ") -#define MSG_RUNOUT_SENSOR _UxGT("Sensor filamento") -#define MSG_ERR_HOMING_FAILED _UxGT("Falha ao ir à origem") -#define MSG_ERR_PROBING_FAILED _UxGT("Falha ao sondar") -#define MSG_M600_TOO_COLD _UxGT("M600: Muito frio") - -#if LCD_HEIGHT >= 4 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Aperte o botão para") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("continuar impressão") - - #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_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_UNLOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remoção de filamento") - - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamento") - - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Espere pela") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("purga de filamento") - - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Clique para finaliz.") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("purga 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_ADVANCED_PAUSE_WAITING_1 _UxGT("Clique p. continuar") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguarde...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insira e Clique") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregando...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purgando...") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Clique p. finalizar") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Continuando...") -#endif diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 936492975d8c..769b1fc463c2 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -30,158 +30,134 @@ * */ -#define DISPLAY_CHARSET_ISO10646_1 -#define CHARSIZE 2 + #define DISPLAY_CHARSET_ISO10646_1 -#define WELCOME_MSG MACHINE_NAME _UxGT(" pronta.") -#define MSG_SD_INSERTED _UxGT("Cartão inserido") -#define MSG_SD_REMOVED _UxGT("Cartão removido") -#define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desactivar motores") -#define MSG_AUTO_HOME _UxGT("Ir para origem") -#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_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") -#define MSG_LEVEL_BED_DONE _UxGT("Pronto !") -#define MSG_SET_HOME_OFFSETS _UxGT("Definir desvio") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets aplicados") -#define MSG_SET_ORIGIN _UxGT("Definir origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N _UxGT("Pre-aquecer " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq. " PREHEAT_1_LABEL " Tudo") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq. " PREHEAT_1_LABEL " ") LCD_STR_THERMOMETER _UxGT("Base") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Definições " PREHEAT_1_LABEL) -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer " PREHEAT_2_LABEL " ") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq. " PREHEAT_2_LABEL " Tudo") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq. " PREHEAT_2_LABEL " ") LCD_STR_THERMOMETER _UxGT("Base") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Definições " PREHEAT_2_LABEL) -#define MSG_COOLDOWN _UxGT("Arrefecer") -#define MSG_SWITCH_PS_ON _UxGT("Ligar") -#define MSG_SWITCH_PS_OFF _UxGT("Desligar") -#define MSG_EXTRUDE _UxGT("Extrudir") -#define MSG_RETRACT _UxGT("Retrair") -#define MSG_MOVE_AXIS _UxGT("Mover eixo") -#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_0025MM _UxGT("Mover 0.025mm") -#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(" ") LCD_STR_THERMOMETER _UxGT(" Bico") -#define MSG_BED _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Base") -#define MSG_FAN_SPEED _UxGT("Vel. ventoinha") -#define MSG_FLOW _UxGT("Fluxo") -#define MSG_CONTROL _UxGT("Controlo") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Temp. Automática") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#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_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_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT(" Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_AMAX _UxGT("Amax ") -#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_ESTEPS _UxGT("E passo/mm") -#define MSG_E1STEPS _UxGT("E1 passo/mm") -#define MSG_E2STEPS _UxGT("E2 passo/mm") -#define MSG_E3STEPS _UxGT("E3 passo/mm") -#define MSG_E4STEPS _UxGT("E4 passo/mm") -#define MSG_E5STEPS _UxGT("E5 passo/mm") -#define MSG_E6STEPS _UxGT("E6 passo/mm") -#define MSG_TEMPERATURE _UxGT("Temperatura") -#define MSG_MOTION _UxGT("Movimento") -#define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E em mm3") -#define MSG_FILAMENT_DIAM _UxGT("Fil. Diam.") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Guardar na memoria") -#define MSG_LOAD_EEPROM _UxGT("Carregar da memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Rest. de emergen.") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Recarregar") -#define MSG_WATCH _UxGT("Monitorizar") -#define MSG_PREPARE _UxGT("Preparar") -#define MSG_TUNE _UxGT("Afinar") -#define MSG_PAUSE_PRINT _UxGT("Pausar impressão") -#define MSG_RESUME_PRINT _UxGT("Retomar 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("Em espera...") -#define MSG_USERWAIT _UxGT("Á espera de ordem") -#define MSG_PRINT_ABORTED _UxGT("Impressão cancelada") -#define MSG_NO_MOVE _UxGT("Sem movimento") -#define MSG_KILLED _UxGT("EMERGÊNCIA. ") -#define MSG_STOPPED _UxGT("PARADO. ") -#define MSG_CONTROL_RETRACT _UxGT(" Retrair mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Troca Retrair mm") -#define MSG_CONTROL_RETRACTF _UxGT(" Retrair V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT(" Levantar mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT(" DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Troca DesRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT(" DesRet V") -#define MSG_AUTORETRACT _UxGT(" AutoRetr.") -#define MSG_FILAMENTCHANGE _UxGT("Trocar filamento") -#define MSG_INIT_SDCARD _UxGT("Inici. cartão SD") -#define MSG_CHANGE_SDCARD _UxGT("Trocar cartão SD") -#define MSG_ZPROBE_OUT _UxGT("Sensor fora/base") -#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("Desvio Z") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_ENDSTOP_ABORT _UxGT("Fim de curso") -#define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") -#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_DELTA_CALIBRATE _UxGT("Calibração 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") +namespace Language_pt { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_LCD_ENDSTOPS _UxGT("Fim de curso") + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Portuguese"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronta."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Cartão inserido"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Cartão removido"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Desactivar motores"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Ir para origem"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Ir para origem X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Ir para origem Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Ir para origem Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Indo para origem"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Click para iniciar"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Próximo ponto"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Pronto !"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Definir desvio"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets aplicados"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Definir origem"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL _UxGT(" Bico"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL _UxGT(" Bico ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Pre-aq. ") PREHEAT_1_LABEL _UxGT(" Tudo"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Pre-aq. ") PREHEAT_1_LABEL _UxGT(" ") LCD_STR_THERMOMETER _UxGT("Base"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Definições ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL _UxGT(" Bico"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL _UxGT(" Bico ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Pre-aq. ") PREHEAT_2_LABEL _UxGT(" Tudo"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Pre-aq. ") PREHEAT_2_LABEL _UxGT(" ") LCD_STR_THERMOMETER _UxGT("Base"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Definições ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Arrefecer"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ligar"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Desligar"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrudir"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retrair"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover eixo"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Mover Extrusor"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Mover Extrusor *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidade"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Base Z"); + PROGMEM Language_Str MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" Bico"); + PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Bico ~"); + PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Base"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. ventoinha"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. ventoinha ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxo"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxo ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Controlo"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retracção"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-movimento"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Passo/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" passo/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" passo/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" passo/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E passo/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* passo/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E em mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Fil. Diam."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Fil. Diam. *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Guardar na memoria"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carregar da memoria"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Rest. de emergen."); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT(" Recarregar"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Monitorizar"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Afinar"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impressão"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Retomar impressão"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Parar impressão"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Imprimir do SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Sem cartão SD"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Em espera..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Á espera de ordem"); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impressão cancelada"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sem movimento"); + PROGMEM Language_Str MSG_KILLED = _UxGT("EMERGÊNCIA. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("PARADO. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT(" Retrair mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Troca Retrair mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT(" Retrair V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT(" Levantar mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT(" DesRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Troca DesRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT(" DesRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT(" AutoRetr."); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Trocar filamento"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Trocar filamento *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Inici. cartão SD"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Trocar cartão SD"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sensor fora/base"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Desvio Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Fim de curso"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Aquecimento falhou"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Err: T Máxima"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Err: T Mínima"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Err: T Base Máxima"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Err: T Base Mínima"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Aquecendo..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Aquecendo base..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibração Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); + + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Fim de curso"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); +} diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h new file mode 100644 index 000000000000..cc455c165876 --- /dev/null +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -0,0 +1,418 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Portuguese (Brazil) + * UTF-8 for Graphical Display + * + * LCD Menu Messages + * See also http://marlinfw.org/docs/development/lcd_language.html + * + */ +namespace Language_pt_br { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Portuguese (BR)"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pronto."); + + PROGMEM Language_Str MSG_BACK = _UxGT("Voltar"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Cartão inserido"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Cartão removido"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Fins de curso"); + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Fins curso"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Menu principal"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Config. Avançada"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Configuração"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Início automático"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Desabilit. motores"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu Debug"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Testar Barra Progres"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Ir a origem XYZ"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Ir na origem X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Ir na origem Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Ir na origem Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto alinhar Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Indo para origem"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Clique para Iniciar"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Próximo Ponto"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Fim nivelação!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Suavizar altura"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Compensar origem"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Alteração aplicada"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Ajustar Origem"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Extrusora ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Extrusora ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Pre-aq.Todo ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Pre-aq.Mesa ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Ajustar ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Pre-aquecer ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Extrusora ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Extrusora ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Pre-aq.Todo ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Pre-aq.Mesa ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Ajustar ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Customizar Pre-aq."); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Esfriar"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Ligar"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Desligar"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrusar"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Retrair"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Mover eixo"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Nivelação Mesa"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Nivelar Mesa"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Nivelar Cantos"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Próximo Canto"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Editar Malha"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Fim da Edição"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Índice X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Índice Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Valor Z"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Comando customizado"); + + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("Modo IDEX"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Estacionar"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicação"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Cópia espelhada"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Controle Total"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2o bico X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2o bico Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2o bico Z"); + + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Executando G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Ferramentas UBL"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Nivel. Mesa Unif."); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Fazer malha manual"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Calçar e calibrar"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Medir"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Remover e calibrar"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Movendo para Próximo"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Ativar UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Desativar UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Temp. Mesa"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temp. Extrusora"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Editar Malha"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Editar Malha Custom"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Ajuste Fino da Malha"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Fim da Edição"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Montar Malha Custom"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Montar "); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Montar ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Montar ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Montar Malha fria"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Ajustar Altura"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Quant. de Altura"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Validar Malha"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Checar ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Checar ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Validar Malha Custom"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Continuar Malha"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Nivelação da Malha"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Nivelação 3 pontos"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Nivelação Grid"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Nivelar Malha"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Cantos"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Tipo de Mapa"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Salvar Mapa da Malha"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Enviar Para Host"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Salvar Malha CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Salvar Backup"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Informação do UBL"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Qtd de Enchimento"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Enchimento Manual"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Enchimento Smart"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Preencher malha"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidar tudo"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidar próximo"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Ajuste Fino de Todos"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ajustar Mais Próximo"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Armazenamento Malha"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Slot de Memória"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Ler Malha"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Salvar Malha"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Malha %i carregada"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Malha %i salva"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Sem armazenamento"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Erro ao salvar UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Erro no restauro UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Compensação Z parou"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL passo a passo"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Montar Malha fria"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Enchimento Smart"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Validar Malha"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Ajuste Fino de Todos"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Validar Malha"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Ajuste Fino de Todos"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Salvar Malha"); + + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Controle do LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Luz"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Configuração da Luz"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Luz Vermelha"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Luz Laranja"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Luz Amarela"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Luz Verde"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Luz Azul"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Luz Indigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Luz Violeta"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Luz Branca"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Luz Padrão"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Luz Customizada"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Intensidade Vermelho"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Intensidade Verde"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Intensidade Azul"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Intensidade Branco"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Brilho"); + PROGMEM Language_Str MSG_MOVING = _UxGT("Movendo..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Liberar XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Mover X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Mover Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Mover Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Mover Extrusor"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Mover Extrusor *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Extrus. mto fria"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Mover %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Mover 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Mover 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Velocidade"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Base Z"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Bocal"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Bocal ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Mesa"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. Ventoinha"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventoinha ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("+Vel. Ventoinha"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("+Vel. Ventoinha ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Vazão"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Vazão ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Controle"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Máx"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fator"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Temp. Automática"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Ligado"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Desligado"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Selecionar"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Selecionar *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Acel."); + PROGMEM Language_Str MSG_JERK = _UxGT("Arrancada"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("arrancada V") LCD_STR_A; + PROGMEM Language_Str MSG_VB_JERK = _UxGT("arrancada V") LCD_STR_B; + PROGMEM Language_Str MSG_VC_JERK = _UxGT("arrancada V") LCD_STR_C; + PROGMEM Language_Str MSG_VE_JERK = _UxGT("arrancada VE"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Desv. Junção"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Velocidade"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VDeslocamento min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Aceleração"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Retrair A"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Movimento A"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Passo/mm"); + PROGMEM Language_Str MSG_A_STEPS = _UxGT("Passo ") LCD_STR_A _UxGT("/mm"); + PROGMEM Language_Str MSG_B_STEPS = _UxGT("Passo ") LCD_STR_B _UxGT("/mm"); + PROGMEM Language_Str MSG_C_STEPS = _UxGT("Passo ") LCD_STR_C _UxGT("/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Temperatura"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Movimento"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filamento"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Extrusão em mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Diâmetro Fil."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Diâmetro Fil. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Descarr. mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Carregar mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("Avanço K"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("Avanço K *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Salvar Configuração"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Ler Configuração"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restauro seguro"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Iniciar EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Atualiz. SD"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetar Impressora"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Atualização"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Informações"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Ajustar"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pausar impressão"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Resumir impressão"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Parar impressão"); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Recuperar Impressão"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Imprimir do SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Sem cartão SD"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Dormindo..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Clique para retomar"); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Impressão Pausada"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Imprimindo..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Impressão Abortada"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Sem movimento"); + PROGMEM Language_Str MSG_KILLED = _UxGT("PARADA DE EMERGÊNCIA"); + PROGMEM Language_Str MSG_STOPPED = _UxGT("PAROU. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retrair mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Retrair Troca mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retrair V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Saltar mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Des-Retrair mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Des-RetTroca mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Des-Retrair V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Des-RetTroca V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Retração Automática"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Distancia Retração"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Mudar Ferramenta"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Levantar Z"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Preparar Veloc."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Veloc. Retração"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Trocar Filamento"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Trocar Filamento *"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Carregar Filamento *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Descarreg. Filamento *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Descarregar Todos"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Iniciar SD"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Trocar SD"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda fora da mesa"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Fator de Cisalho"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Testar BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Reiniciar BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Estender BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Recolher BLTouch"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Estender Sonda-Z"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Recolher Sonda-Z"); + + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Home %s%s%s Primeiro"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Compensar Sonda em Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Passinho X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Passinho Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Passinho Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Abortar Fim de Curso"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Aquecimento falhou"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Aquecer mesa falhou"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Erro:Temp Redundante"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ESCAPE TÉRMICO"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("ESCAPE TÉRMICO MESA"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Erro:Temp Máxima"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Erro:Temp Mínima"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Erro:Temp Mesa Máx"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Erro:Temp Mesa Mín"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Home XY Primeiro"); + PROGMEM Language_Str MSG_HALTED = _UxGT("IMPRESSORA PAROU"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Favor resetar"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Aquecendo..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Resfriando..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Aquecendo mesa..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Esfriando mesa..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Calibrar Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Calibrar X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Calibrar Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Calibrar Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); + + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Configuração Delta"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto-Calibração"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Calibrar Altura"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Desloc. Sonda Z"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Haste Diagonal"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Altura"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Raio"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Sobre"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Impressora"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Nivelamento 3 pontos"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Nivelamento Linear"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Nivelamento Bilinear"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Nivelamento UBL"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Nivelamento da Malha"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Estatísticas"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info. da Placa"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistores"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrusoras"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Taxa de Transmissão"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protocolo"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Luz da Impressora"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Intensidade Brilho"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); + + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Total de Impressões"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Realizadas"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo de Impressão"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Trabalho Mais longo"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Total de Extrusão"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Qtd de Impressões"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Realizadas"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tempo de Impressão"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Maior trabalho"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("T. Extrusão"); + #endif + + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Temp Mín"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Temp Máx"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("PSU"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Força do Motor"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Escrever EEPROM DAC"); + + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("IMPRESSÃO PAUSADA"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("CARREGAR FILAMENTO"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("DESCARREG. FILAMENTO"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("Config. de Retomada"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purgar mais"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Continuar Impressão"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Bocal: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Sensor filamento"); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Falha ao ir à origem"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Falha ao sondar"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Muito frio"); + + #if LCD_HEIGHT >= 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Aperte o botão para", "continuar impressão")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Esperando o", "inicio da", "troca de filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Coloque filamento", "pressione o botão", "para continuar...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Pressione o botão", "p/ aquecer o bocal")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Aquecendo o bocal", "Aguarde...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Esperando", "remoção de filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Esperando", "filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Espere pela", "purga de filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Clique para finaliz.", "purga de filamento")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Esperando impressão", "continuar")); + #else // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Clique p. continuar")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Aguarde...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Insira e Clique")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Aquecendo...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Ejetando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Carregando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Purgando...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Clique p. finalizar")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Continuando...")); + #endif +} diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index bba2cdad9a87..410688c54ceb 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -28,373 +28,443 @@ * See also http://marlinfw.org/docs/development/lcd_language.html * */ - #define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 -#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_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_X _UxGT("Парковка X") -#define MSG_AUTO_HOME_Y _UxGT("Парковка Y") -#define MSG_AUTO_HOME_Z _UxGT("Парковка Z") -#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_Z_FADE_HEIGHT _UxGT("Высота спада") -#define MSG_SET_HOME_OFFSETS _UxGT("Запомнить парковку") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Коррекции применены") -#define MSG_SET_ORIGIN _UxGT("Запомнить ноль") -#define MSG_PREHEAT_1 _UxGT("Преднагрев " PREHEAT_1_LABEL) -#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_2 _UxGT("Преднагрев " PREHEAT_2_LABEL) -#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_COOLDOWN _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_LEVEL_BED _UxGT("Калибровать стол") -#define MSG_LEVEL_CORNERS _UxGT("Выровнять углы") -#define MSG_NEXT_CORNER _UxGT("Следующий угол") -#define MSG_EDITING_STOPPED _UxGT("Ред. сетки завершено") -#define MSG_USER_MENU _UxGT("Свои комманды") +namespace Language_ru { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Russian"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" готов."); + PROGMEM Language_Str MSG_BACK = _UxGT("Назад"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Карта вставлена"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Карта извлечена"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("SD карта не активна"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Эндстопы"); // Max length 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Прогр. эндстопы"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Меню"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Другие настройки"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Настройки"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Выкл. двигатели"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Меню отладки"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Тест индикатора"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Авто парковка"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Парковка X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Парковка Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Парковка Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Нулевое положение"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Нажмите чтобы начать"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Следующая точка"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Выравнивание готово!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Высота спада"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Запомнить парковку"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Коррекции применены"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Запомнить ноль"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Преднагрев ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Преднагрев ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" сопло"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" сопло ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" всё"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" стол"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Преднагрев ") PREHEAT_1_LABEL _UxGT(" настр."); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Преднагрев ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Преднагрев ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" сопло"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" сопло ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" всё"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" стол"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Преднагрев ") PREHEAT_2_LABEL _UxGT(" настр."); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охлаждение"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Включить питание"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Выключить питание"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Экструзия"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Втягивание"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Движение по осям"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Калибровка стола"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Калибровать стол"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Выровнять углы"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Следующий угол"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Редактировать сетку"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Ред. сетки завершено"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Свои команды"); + + PROGMEM Language_Str MSG_M48_TEST = _UxGT("Проверка датчика Z"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Отклонение"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("Измерение"); + + // TODO: IDEX Menu + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Размещение сопел"); + + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2-е сопло X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2-е сопло Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2-е сопло Z"); + + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Выполняем G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Утилиты UBL"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("Калибровка UBL"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Постр. сетку от руки"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Пост. шимм и измер."); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Измерение"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Удал. и измер. стол"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Двигаемся дальше"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Активировать UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Деактивировать UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Температура стола"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Температура сопла"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Редактор сеток"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Редакт. свою сетку"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Точная настр. сетки"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Ред. сетки завершено"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Построить свою сетку"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Построить сетку"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Построить сетку ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Построить сетку ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Построить хол. сетку"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Устан. высоту сетки"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Высота"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Проверить сетку"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Проверить сетку ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Проверить сетку ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Проверить свою сетку"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Продолжить сетку"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Калибровка сетки"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Калибровка 3-х точек"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Калибровка растера"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Выровнить сетку"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Крайние точки"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Тип карты"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Вывести карту сетки"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Вывести на хост"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Вывести в CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Забекапить сетку"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Вывод информации UBL"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Кол-во заполнителя"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ручное заполнение"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Умное заполнение"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Заполнить сетку"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Аннулировать всё"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Аннулир. ближ. точку"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Точная настр. всего"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Настр. ближ. точки"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Хранилище сетей"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Слот памяти"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Загрузить сетку стола"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Сохранить сетку стола"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Сетка %i загружена"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Сетка %i сохранена"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Нет хранилища"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Ошибка: Сохран. UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Ошибка: Восстан. UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Смещение Z останов."); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Пошаговое UBL"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Построить хол. сетку"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Умное заполнение"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Проверить сетку"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Точная настр. всего"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Проверить сетку"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Точная настр. всего"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Сохранить сетку стола"); + + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Настройки LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Подсветку"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Предустановки света"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Красный свет"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Оранжевый свет"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Жёлтый свет"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Зелёный свет"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Синий свет"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Индиго свет"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Фиолетовый свет"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Белый свет"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Свет по умолчанию"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Свои настр. света"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Интенсивн. красного"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Интенсивн. зелёного"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Интенсивн. синего"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Интенсивн. белого"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Яркость"); + + PROGMEM Language_Str MSG_MOVING = _UxGT("Движемся..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Освобождаем XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Движение по X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Движение по Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Движение по Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Экструдер"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Экструдер *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Движение %sмм"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Движение 0.1мм"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Движение 1мм"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Движение 10мм"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Скорость"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Z стола"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Сопло"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Сопло ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Стол"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Кулер"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Кулер ~"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Кулер доп."); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Кулер доп. ~"); + PROGMEM Language_Str MSG_FLOW = _UxGT("Поток"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Поток ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Настройки"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Мин"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Макс"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Фактор"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Автотемпература"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Вкл."); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Выкл."); + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Выбор"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Выбор *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Ускорение"); + PROGMEM Language_Str MSG_JERK = _UxGT("Рывок"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-рывок"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-рывок"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-рывок"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-рывок"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Быстрота"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vмакс ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vмакс ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vмакс ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vмакс ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vмакс *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Vмин"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vпутеш. мин"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Ускорение"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Aмакс ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Aмакс ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Aмакс ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Aмакс ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Aмакс *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-втягивание"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-путеш."); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Шаг/мм"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("шаг/мм"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("шаг/мм"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("шаг/мм"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Eшаг/мм"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*шаг/мм"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Движение"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Филамент"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Диаметр филамента"); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Диаметр филамента *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Загрузка мм"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Выгрузка мм"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K продвижения"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K продвижения *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Контраст LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Сохранить настройки"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Загрузить настройки"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Вернуть настройки"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Инициализация EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Обновление прошивки"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Сброс принтера"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Обновить"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Информационный экран"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Подготовить"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Настроить"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Начало печати"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Дальше"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Инициализация"); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Остановить"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Печать"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Сброс"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Отмена"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Готово"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Пауза печати"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Продолжить печать"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Остановить печать"); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Восстановение сбоя"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Печать с SD карты"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Нет SD карты"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Сон..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Продолжить..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Печать на паузе"); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Печать отменена"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Нет движения."); + PROGMEM Language_Str MSG_KILLED = _UxGT("УБИТО. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ОСТАНОВЛЕНО. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Втягивание мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Втягивание смены мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Втягивание V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Втяг. прыжка мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("Возврат мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Возврат смены мм"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Возврат V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Возврат смены V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Авто Втягивание"); + + // TODO: Filament Change Swap / Purge Length + + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Смена сопел"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Поднятие по Z"); + + // TODO: Singlenozzle, nozzle standby + + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Смена филамента"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Смена филамента *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Загрузка филамента"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Загрузка филамента *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Выгрузка филамента *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Выгрузить всё"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Активировать SD"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Сменить SD карту"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Деактивировать SD"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z датчик вне стола"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Фактор наклона"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Тестирование BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Сброс BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Установка BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Набивка BLTouch"); + + // TODO: TouchMI Probe, Manual deploy/stow + + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Паркуй %s%s%s сначала"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Смещение Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Микрошаг X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Микрошаг Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Микрошаг Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Сработал концевик"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Разогрев не удался"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Неудача нагрева стола"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Ошибка: Избыточная Т"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("УБЕГАНИЕ ТЕПЛА"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("УБЕГАНИЕ ТЕПЛА СТОЛА"); + // TODO: Heated chamber + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Ошибка: Т макс."); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Ошибка: Т мин."); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Ошибка: Т стола макс"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Ошибка: Т стола мин."); + // TODO: Heated chamber + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Паркуй XY сначала"); + PROGMEM Language_Str MSG_HALTED = _UxGT("ПРИНТЕР ОСТАНОВЛЕН"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Сделайте сброс"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("д"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("ч"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("м"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Нагрев..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Охлаждение..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Нагрев стола..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Охлаждение стола..."); + // TODO: Heated chamber + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калибровка Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калибровать X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Калибровать Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Калибровать Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калибровать центр"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Настройки Delta"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Авто калибровка"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Задать высоту Delta"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Задать Z-смещение"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Диаг. стержень"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Высота"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Радиус"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("О принтере"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Инф. о принтере"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("Калибровка 3-х точек"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Линейная калибровка"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Билинейная калибр."); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Калибровка UBL"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Калибровка сетки"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Статистика принтера"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Информация о плате"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Термисторы"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Экструдеры"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Бод"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Протокол"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Подсветка корпуса"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Яркость подсветки"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Неверный принтер"); + + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Счётчик печати"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Закончено"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Общее время печати"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Наидольшее задание"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Длина филамента"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Отпечатков"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Закончено"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Всего"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Наидольшее"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Выдавлено"); + #endif + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Мин. Т"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Макс. Т"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("БП"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Сила привода"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Привод %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Привод %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Привод %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Привод %"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Запись DAC EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("ПЕЧАТЬ НА ПАУЗЕ"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ЗАГРУЗКА ФИЛАМЕНТА"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("ВЫГРУЗКА ФИЛАМЕНТА"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ОПЦИИ ВОЗОБНОВЛЕНИЯ:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Выдавить ещё"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Возобновить печать"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Сопла: "); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Возврат не удался"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Не удалось прощупать"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Низкая Т"); + + // TODO: MMU2 + + // TODO: Mixing + + PROGMEM Language_Str MSG_GAMES = _UxGT("Игры"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Кирпичи"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Вторжение"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Змейка"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Лабиринт"); -#define MSG_UBL_DOING_G29 _UxGT("Выполняем G29") -#define MSG_UBL_UNHOMED _UxGT("Паркуем сначала XYZ") -#define MSG_UBL_TOOLS _UxGT("Утилиты UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Калибровка UBL") -#define MSG_UBL_MANUAL_MESH _UxGT("Постр. сетку от руки") -#define MSG_UBL_BC_INSERT _UxGT("Пост. шимм и измер.") -#define MSG_UBL_BC_INSERT2 _UxGT("Измерение") -#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_SET_TEMP_BED _UxGT("Температура стола") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Температура сопла") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#define MSG_UBL_MESH_EDIT _UxGT("Редактор сеток") -#define MSG_UBL_EDIT_CUSTOM_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("Построить сетку") -#define MSG_UBL_BUILD_MESH_M1 _UxGT("Построить сетку " PREHEAT_1_LABEL) -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Построить сетку " PREHEAT_2_LABEL) -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Построить хол. сетку") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Устан. высоту сетки") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Высота") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Проверить сетку") -#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Проверить сетку " PREHEAT_1_LABEL) -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Проверить сетку " PREHEAT_2_LABEL) -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Проверить свою сетку") -#define MSG_UBL_CONTINUE_MESH _UxGT("Продолжить сетку") -#define MSG_UBL_MESH_LEVELING _UxGT("Калибровка сетки") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Калибровка 3-х точек") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Калибровка растера") -#define MSG_UBL_MESH_LEVEL _UxGT("Выровнить сетку") -#define MSG_UBL_SIDE_POINTS _UxGT("Крайние точки") -#define MSG_UBL_MAP_TYPE _UxGT("Тип карты") -#define MSG_UBL_OUTPUT_MAP _UxGT("Вывести карту сетки") -#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_EDIT_MESH _UxGT("Редактировать сетку") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Кол-во заполнителя") -#define MSG_UBL_MANUAL_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_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_Z_OFFSET_STOPPED _UxGT("Смещение Z останов.") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Пошаговое UBL") + // + // 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 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Ожидайте", "начала смены", "филамента")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Ожидайте", "выгрузки", "филамента")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Вставьте пруток", "и нажмите кнопку", "для продолжения")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Нажмите кнопку для", "нагрева сопла...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Нагрев сопла", "Ждите...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Ожидайте", "загрузки прутка")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Ожидайте", "экструзии", "филамента")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Ожидайте", "возобновления", "печати")); + #else + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Ожидайте...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Выгрузка...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Вставь и нажми")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Нагрев...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Загрузка...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Выдавливание...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Возобновление...")); + #endif -#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("Яркость") + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Драйвера TMC"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Текущие настройки"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Гибридный режим"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Режим без эндстопов"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Режим шага"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("Тихий режим вкл"); -#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_0025MM _UxGT("Движение 0.025мм") -#define MSG_MOVE_01MM _UxGT("Движение 0.1мм") -#define MSG_MOVE_1MM _UxGT("Движение 1мм") -#define MSG_MOVE_10MM _UxGT("Движение 10мм") -#define MSG_SPEED _UxGT("Скорость") -#define MSG_BED_Z _UxGT("Z стола") -#define MSG_NOZZLE _UxGT("Сопло") -#define MSG_BED _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_AUTOTEMP _UxGT("Автотемпература") -#define MSG_LCD_ON _UxGT("Вкл.") -#define MSG_LCD_OFF _UxGT("Выкл.") -#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("Выбор") -#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_VE_JERK _UxGT("Ve-рывок") -#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_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_E6STEPS _UxGT("E6шаг/мм") -#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_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_REFRESH _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_DWELL _UxGT("Сон...") -#define MSG_USERWAIT _UxGT("Продолжить...") -#define MSG_PRINT_PAUSED _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_CONTROL_RETRACTF _UxGT("Втягивание V") -#define MSG_CONTROL_RETRACT_ZHOP _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_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_CHANGE_SDCARD _UxGT("Сменить SD карту") -#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_FIRST _UxGT("первый") -#define MSG_ZPROBE_ZOFFSET _UxGT("Смещение Z") -#define MSG_BABYSTEP_X _UxGT("Микрошаг X") -#define MSG_BABYSTEP_Y _UxGT("Микрошаг Y") -#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_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_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_COOLING _UxGT("Охлаждение...") -#define MSG_COOLING_COMPLETE _UxGT("Охлаждение выполнено") -#define MSG_BED_HEATING _UxGT("Нагрев стола...") -#define MSG_BED_COOLING _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_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-х точек") -#define MSG_LINEAR_LEVELING _UxGT("Линейная калибровка") -#define MSG_BILINEAR_LEVELING _UxGT("Билинейная калибр.") -#define MSG_UBL_LEVELING _UxGT("Калибровка UBL") -#define MSG_MESH_LEVELING _UxGT("Калибровка сетки") -#define MSG_INFO_STATS_MENU _UxGT("Статистика принтера") -#define MSG_INFO_BOARD_MENU _UxGT("Информация о плате") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Термисторы") -#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("Яркость подсветки") -#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_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_FILAMENT _UxGT("Выдавлено") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Мин. Т") -#define MSG_INFO_MAX_TEMP _UxGT("Макс. Т") -#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_FILAMENT_CHANGE_OPTION_HEADER _UxGT("ОПЦИИ ВОЗОБНОВЛЕНИЯ:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Выдавить ещё") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _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: Низкая Т") + // TODO: Service -// -// 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("печати") -#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("Возобновление...") -#endif // LCD_HEIGHT < 4 + // TODO: Backlash +} diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 8d028e41cf8f..3c52eecd740e 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -32,530 +32,555 @@ * http://www.facebook.com/farmamam * */ - #define DISPLAY_CHARSET_ISO10646_SK -#define CHARSIZE 2 - -// Characters that can be displayed with M117 -#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("äÄáÁčČďĎéÉíÍĺĹľĽňŇóÓôÔŕŔšŠťŤúÚýÝžŽ³") -#define WELCOME_MSG MACHINE_NAME _UxGT(" pripravená.") -#define MSG_YES _UxGT("ÁNO") -#define MSG_NO _UxGT("NIE") -#define MSG_BACK _UxGT("Naspäť") -#define MSG_SD_INSERTED _UxGT("Karta vložená") -#define MSG_SD_REMOVED _UxGT("Karta vybraná") -#define MSG_SD_RELEASED _UxGT("Karta odpojená") -#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_ADVANCED_SETTINGS _UxGT("Pokročilé nastav.") -#define MSG_CONFIGURATION _UxGT("Konfigurácia") -#define MSG_AUTOSTART _UxGT("Auto-štart") -#define MSG_DISABLE_STEPPERS _UxGT("Uvolniť motory") -#define MSG_DEBUG_MENU _UxGT("Ponuka ladenia") -#define MSG_PROGRESS_BAR_TEST _UxGT("Test uk. priebehu") -#define MSG_AUTO_HOME _UxGT("Domovská pozícia") -#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_AUTO_Z_ALIGN _UxGT("Auto-zarovn. Z") -#define MSG_LEVEL_BED_HOMING _UxGT("Parkovanie XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Kliknutím spusťte") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Ďalší bod") -#define MSG_LEVEL_BED_DONE _UxGT("Meranie hotové!") -#define MSG_Z_FADE_HEIGHT _UxGT("Výška rovnania") -#define MSG_SET_HOME_OFFSETS _UxGT("Nastaviť ofsety") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Ofsety nastavené") -#define MSG_SET_ORIGIN _UxGT("Nastaviť začiatok") -#define MSG_PREHEAT_1 _UxGT("Zahriať " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" všetko") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podlož") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast.") -#define MSG_PREHEAT_2 _UxGT("Zahriať " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" všetko") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" podlož") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" nast.") -#define MSG_PREHEAT_CUSTOM _UxGT("Vlastná teplota") -#define MSG_COOLDOWN _UxGT("Schladiť") -#define MSG_LASER_MENU _UxGT("Nastavenie lasera") -#define MSG_LASER_OFF _UxGT("Vypnúť laser") -#define MSG_LASER_ON _UxGT("Zapnúť laser") -#define MSG_LASER_POWER _UxGT("Výkon lasera") -#define MSG_SPINDLE_MENU _UxGT("Nastavenie vretena") -#define MSG_SPINDLE_OFF _UxGT("Vypnúť vreteno") -#define MSG_SPINDLE_ON _UxGT("Zapnúť vreteno") -#define MSG_SPINDLE_POWER _UxGT("Výkon vretena") -#define MSG_SPINDLE_REVERSE _UxGT("Spätný chod") -#define MSG_SWITCH_PS_ON _UxGT("Zapnúť napájanie") -#define MSG_SWITCH_PS_OFF _UxGT("Vypnúť napájanie") -#define MSG_EXTRUDE _UxGT("Vytlačiť (extr.)") -#define MSG_RETRACT _UxGT("Vytiahnuť (retr.)") -#define MSG_MOVE_AXIS _UxGT("Posunúť osy") -#define MSG_BED_LEVELING _UxGT("Vyrovnanie podložky") -#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_MESH_X _UxGT("Index X") -#define MSG_MESH_Y _UxGT("Index Y") -#define MSG_MESH_EDIT_Z _UxGT("Hodnota Z") -#define MSG_USER_MENU _UxGT("Vlastné príkazy") +namespace Language_sk { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_UBL_DOING_G29 _UxGT("Vykonávam G29") -#define MSG_UBL_UNHOMED _UxGT("Prejdite domov") -#define MSG_UBL_TOOLS _UxGT("Nástroje UBL") -#define MSG_UBL_LEVEL_BED _UxGT("UBL rovnanie") -#define MSG_LCD_PROBING_MESH _UxGT("Skúšam bod") -#define MSG_LCD_TILTING_MESH _UxGT("Vyrovnávam bod") -#define MSG_IDEX_MENU _UxGT("IDEX režim") -#define MSG_OFFSETS_MENU _UxGT("Ofset nástrojov") -#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-parkovanie") -#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplikácia") -#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Zrkadlená kópia") -#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Plná kontrola") -#define MSG_X_OFFSET _UxGT("2. tryska X") -#define MSG_Y_OFFSET _UxGT("2. tryska Y") -#define MSG_Z_OFFSET _UxGT("2. tryska Z") -#define MSG_UBL_MANUAL_MESH _UxGT("Manuálna sieť bodov") -#define MSG_UBL_BC_INSERT _UxGT("Položte a zmerajte") -#define MSG_UBL_BC_INSERT2 _UxGT("Zmerajte") -#define MSG_UBL_BC_REMOVE _UxGT("Odstráňte a zmerajte") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Presun na ďalší") -#define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovať UBL") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovať UBL") -#define MSG_UBL_SET_TEMP_BED _UxGT("Teplota podložky") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Teplota hotendu") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#define MSG_UBL_MESH_EDIT _UxGT("Úprava siete 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") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastná sieť") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvoriť sieť") -#define MSG_UBL_BUILD_MESH_M1 _UxGT("Sieť bodov " PREHEAT_1_LABEL) -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Sieť bodov " PREHEAT_2_LABEL) -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Studená sieť bodov") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upraviť výšku siete") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Výška") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Skontrolovať sieť") -#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Kontrola siete " PREHEAT_1_LABEL) -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Kontrola siete " PREHEAT_2_LABEL) -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast.siete") -#define MSG_UBL_CONTINUE_MESH _UxGT("Pokračovať v sieti") -#define MSG_UBL_MESH_LEVELING _UxGT("Sieťové rovnanie") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-bodové rovnanie") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Mriežkové rovnanie") -#define MSG_UBL_MESH_LEVEL _UxGT("Vyrovnať podložku") -#define MSG_UBL_SIDE_POINTS _UxGT("Postranné body") -#define MSG_UBL_MAP_TYPE _UxGT("Typ siete bodov") -#define MSG_UBL_OUTPUT_MAP _UxGT("Exportovať sieť") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Exportovať do PC") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Exportovať do CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Záloha do PC") -#define MSG_UBL_INFO_UBL _UxGT("Info. o UBL do PC") -#define MSG_EDIT_MESH _UxGT("Upraviť sieť bodov") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Hustota mriežky") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Ručné vyplnenie") -#define MSG_UBL_SMART_FILLIN _UxGT("Chytré vyplnenie") -#define MSG_UBL_FILLIN_MESH _UxGT("Vyplniť mriežku") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Zrušiť všetko") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Zrušiť najbližší") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Upraviť všetky") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Upraviť najbližší") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Úložisko sietí") -#define MSG_UBL_STORAGE_SLOT _UxGT("Pamäť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("Chyba: Ukladanie UBL") -#define MSG_UBL_RESTORE_ERROR _UxGT("Chyba: Obnovenie UBL") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Koniec kompenz. Z") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Postupné UBL") + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Slovak"); -#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") + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" pripravená."); + PROGMEM Language_Str MSG_YES = _UxGT("ÁNO"); + PROGMEM Language_Str MSG_NO = _UxGT("NIE"); + PROGMEM Language_Str MSG_BACK = _UxGT("Naspäť"); + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Ruším..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Karta vložená"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Karta vybraná"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Karta odpojená"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Čakám na kartu"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Chyba čítania karty"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB zaria. odstrán."); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("Chyba spúšťania USB"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Endstopy"); // max 8 znakov + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft. endstopy"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Hlavná ponuka"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Pokročilé nastav."); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Konfigurácia"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Auto-štart"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Uvolniť motory"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Ponuka ladenia"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Test uk. priebehu"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Domovská pozícia"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Domov os X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Domov os Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Domov os Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto-zarovn. Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Parkovanie XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknutím spusťte"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Ďalší bod"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Meranie hotové!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Výška rovnania"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Nastaviť ofsety"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Nastaviť začiatok"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Zahriať ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Zahriať ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" hotend"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" hotend ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" všetko"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" podlož"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" nast."); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Zahriať ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Zahriať ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" hotend"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" hotend ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" všetko"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" podlož"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" nast."); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Vlastná teplota"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Schladiť"); + PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Nastavenie lasera"); + PROGMEM Language_Str MSG_LASER_OFF = _UxGT("Vypnúť laser"); + PROGMEM Language_Str MSG_LASER_ON = _UxGT("Zapnúť laser"); + PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Výkon lasera"); + PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Nastavenie vretena"); + PROGMEM Language_Str MSG_SPINDLE_OFF = _UxGT("Vypnúť vreteno"); + PROGMEM Language_Str MSG_SPINDLE_ON = _UxGT("Zapnúť vreteno"); + PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Výkon vretena"); + PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spätný chod"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Zapnúť napájanie"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Vypnúť napájanie"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Vytlačiť (extr.)"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Vytiahnuť (retr.)"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Posunúť osy"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Vyrovnanie podložky"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Vyrovnať podložku"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Vyrovnať rohy"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Ďalší roh"); + PROGMEM Language_Str MSG_MESH_EDITOR = _UxGT("Editor sieťe bodov"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Upraviť sieť bodov"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Koniec úprav siete"); + PROGMEM Language_Str MSG_PROBING_MESH = _UxGT("Skúšam bod"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("Index X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Index Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Hodnota Z"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Vlastné príkazy"); + PROGMEM Language_Str MSG_M48_TEST = _UxGT("M48 Test sondy"); + PROGMEM Language_Str MSG_M48_POINT = _UxGT("M48 Bod"); + PROGMEM Language_Str MSG_M48_DEVIATION = _UxGT("Odchýlka"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX režim"); + PROGMEM Language_Str MSG_OFFSETS_MENU = _UxGT("Ofset nástrojov"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-parkovanie"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikácia"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Zrkadlená kópia"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Plná kontrola"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. tryska X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. tryska Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. tryska Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Vykonávam G29"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Nástroje UBL"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("UBL rovnanie"); + PROGMEM Language_Str MSG_LCD_TILTING_MESH = _UxGT("Vyrovnávam bod"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Manuálna sieť bodov"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Položte a zmerajte"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Zmerajte"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Odstráňte a zmerajte"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Presun na ďalší"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Aktivovať UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Deaktivovať UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Teplota podložky"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Teplota podložky"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Teplota hotendu"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Teplota hotendu"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Úprava siete bodov"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Upraviť vlastnú sieť"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Doladiť sieť bodov"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Koniec úprav siete"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Vlastná sieť"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Vytvoriť sieť"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Sieť bodov ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Sieť bodov ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Studená sieť bodov"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Upraviť výšku siete"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Výška"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Skontrolovať sieť"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Kontrola siete ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Kontrola siete ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Kontrola vlast.siete"); + PROGMEM Language_Str MSG_G26_HEATING_BED = _UxGT("G26 ohrev podlž."); + PROGMEM Language_Str MSG_G26_HEATING_NOZZLE = _UxGT("G26 ohrev trysky"); + PROGMEM Language_Str MSG_G26_MANUAL_PRIME = _UxGT("Ručné čistenie..."); + PROGMEM Language_Str MSG_G26_FIXED_LENGTH = _UxGT("Čistenie pevn. dĺž."); + PROGMEM Language_Str MSG_G26_PRIME_DONE = _UxGT("Čistenie dokončené"); + PROGMEM Language_Str MSG_G26_CANCELED = _UxGT("G26 zrušený"); + PROGMEM Language_Str MSG_G26_LEAVING = _UxGT("Opúšťam G26"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Pokračovať v sieti"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Sieťové rovnanie"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-bodové rovnanie"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Mriežkové rovnanie"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Vyrovnať podložku"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Postranné body"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Typ siete bodov"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Exportovať sieť"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Exportovať do PC"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Exportovať do CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Záloha do PC"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Info. o UBL do PC"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Hustota mriežky"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ručné vyplnenie"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Chytré vyplnenie"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Vyplniť mriežku"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Zrušiť všetko"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Zrušiť najbližší"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Upraviť všetky"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Upraviť najbližší"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Úložisko sietí"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Pamäťový slot"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Načítať sieť bodov"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Uložiť sieť bodov"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Sieť %i načítaná"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Sieť %i uložená"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Nedostatok miesta"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Chyba: Ukladanie UBL"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Chyba: Obnovenie UBL"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET = _UxGT("Z-Ofset: "); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Koniec kompenz. Z"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Postupné UBL"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Studená sieť bodov"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Chytré vyplnenie"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Skontrolovať sieť"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Upraviť všetky"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Skontrolovať sieť"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Upraviť všetky"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Uložiť sieť bodov"); -#define MSG_MOVING _UxGT("Posúvam...") -#define MSG_FREE_XY _UxGT("Uvolniť XY") -#define MSG_MOVE_X _UxGT("Posunúť X") -#define MSG_MOVE_Y _UxGT("Posunúť Y") -#define MSG_MOVE_Z _UxGT("Posunúť Z") -#define MSG_MOVE_E _UxGT("Extrudér") -#define MSG_HOTEND_TOO_COLD _UxGT("Hotend je studený") -#define MSG_MOVE_0025MM _UxGT("Posunúť o 0,025mm") -#define MSG_MOVE_01MM _UxGT("Posunúť o 0,1mm") -#define MSG_MOVE_1MM _UxGT("Posunúť o 1mm") -#define MSG_MOVE_10MM _UxGT("Posunúť o 10mm") -#define MSG_SPEED _UxGT("Rýchlosť") -#define MSG_BED_Z _UxGT("Výška podl.") -#define MSG_NOZZLE _UxGT("Tryska") -#define MSG_BED _UxGT("Podložka") -#define MSG_CHAMBER _UxGT("Komora") -#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") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fakt") -#define MSG_AUTOTEMP _UxGT("Auto-teplota") -#define MSG_LCD_ON _UxGT("Zap") -#define MSG_LCD_OFF _UxGT("Vyp") -#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("Vybrať") -#define MSG_ACC _UxGT("Zrýchlenie") -#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_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") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_ACCELERATION _UxGT("Akcelerácia") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retrakt") -#define MSG_A_TRAVEL _UxGT("A-prejazd") -#define MSG_STEPS_PER_MM _UxGT("Kroky/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_ESTEPS _UxGT("Ekrokov/mm") -#define MSG_E1STEPS _UxGT("E1krokov/mm") -#define MSG_E2STEPS _UxGT("E2krokov/mm") -#define MSG_E3STEPS _UxGT("E3krokov/mm") -#define MSG_E4STEPS _UxGT("E4krokov/mm") -#define MSG_E5STEPS _UxGT("E5krokov/mm") -#define MSG_E6STEPS _UxGT("E6krokov/mm") -#define MSG_TEMPERATURE _UxGT("Teplota") -#define MSG_MOTION _UxGT("Pohyb") -#define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm³") -#define MSG_FILAMENT_DIAM _UxGT("Priem. fil.") -#define MSG_FILAMENT_UNLOAD _UxGT("Vysunúť mm") -#define MSG_FILAMENT_LOAD _UxGT("Zaviesť mm") -#define MSG_ADVANCE_K _UxGT("K pre posun") -#define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EEPROM _UxGT("Uložiť nastavenie") -#define MSG_LOAD_EEPROM _UxGT("Načítať nastavenie") -#define MSG_RESTORE_FAILSAFE _UxGT("Obnoviť nastavenie") -#define MSG_INIT_EEPROM _UxGT("Inicializ. EEPROM") -#define MSG_SD_UPDATE _UxGT("Aktualizovať z SD") -#define MSG_RESET_PRINTER _UxGT("Reštart. tlačiar.") -#define MSG_REFRESH _UxGT("Obnoviť") -#define MSG_WATCH _UxGT("Info. obrazovka") -#define MSG_PREPARE _UxGT("Príprava tlače") -#define MSG_TUNE _UxGT("Doladenie tlače") -#define MSG_START_PRINT _UxGT("Spustiť tlač") -#define MSG_BUTTON_NEXT _UxGT("Ďalší") -#define MSG_BUTTON_INIT _UxGT("Inicial.") -#define MSG_BUTTON_STOP _UxGT("Zastaviť") -#define MSG_BUTTON_PRINT _UxGT("Tlačiť") -#define MSG_BUTTON_RESET _UxGT("Vynulovať") -#define MSG_BUTTON_CANCEL _UxGT("Zrušiť") -#define MSG_BUTTON_DONE _UxGT("Hotovo") -#define MSG_PAUSE_PRINT _UxGT("Pozastaviť tlač") -#define MSG_RESUME_PRINT _UxGT("Obnoviť tlač") -#define MSG_STOP_PRINT _UxGT("Zastaviť tlač") -#define MSG_OUTAGE_RECOVERY _UxGT("Obnova po výp. nap.") -#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("Pokrač. kliknutím...") -#define MSG_PRINT_PAUSED _UxGT("Tlač pozastavená") -#define MSG_PRINTING _UxGT("Tlačím...") -#define MSG_PRINT_ABORTED _UxGT("Tlač zrušená") -#define MSG_NO_MOVE _UxGT("Žiadny pohyb.") -#define MSG_KILLED _UxGT("PRERUŠENÉ. ") -#define MSG_STOPPED _UxGT("ZASTAVENÉ. ") -#define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Výmena Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retraktovať V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Zdvih Z mm") -#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_FILAMENT_SWAP_LENGTH _UxGT("Dĺžka retrakcie") -#define MSG_TOOL_CHANGE _UxGT("Výmena nástroja") -#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Zdvihnúť Z") -#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Primárna rýchl.") -#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Rýchl. retrakcie") -#define MSG_NOZZLE_STANDBY _UxGT("Záložná tryska") -#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") + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Nastavenie LED"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Svetlo"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Prednastavené farby"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Červená"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Oranžová"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Žltá"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Zelená"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Modrá"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Indigo"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Fialová"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Biela"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Obnoviť nastavenie"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Vlastná farba"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Inten. červenej"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Inten. zelenej"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Inten. modrej"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Inten. bielej"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Jas"); -#define MSG_INIT_SDCARD _UxGT("Načítať SD kartu") -#define MSG_CHANGE_SDCARD _UxGT("Vymeniť SD kartu") -#define MSG_RELEASE_SDCARD _UxGT("Odpojiť 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("Cmd: Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("Cmd: Reset") -#define MSG_BLTOUCH_STOW _UxGT("Cmd: Zasunúť") -#define MSG_BLTOUCH_DEPLOY _UxGT("Cmd: Vysunúť") -#define MSG_BLTOUCH_SW_MODE _UxGT("Cmd: Režim SW") -#define MSG_BLTOUCH_5V_MODE _UxGT("Cmd: Režim 5V") -#define MSG_BLTOUCH_OD_MODE _UxGT("Cmd: Režim OD") -#define MSG_BLTOUCH_MODE_STORE _UxGT("Cmd: Ulož. režim") -#define MSG_BLTOUCH_MODE_STORE_5V _UxGT("Prepnúť do 5V") -#define MSG_BLTOUCH_MODE_STORE_OD _UxGT("Prepnúť do OD") -#define MSG_BLTOUCH_MODE_ECHO _UxGT("Zobraziť režim") -#define MSG_BLTOUCH_MODE_CHANGE _UxGT("POZOR: Zlé nastav. môže spôsobiť poškoden. Pokračovať?") -#define MSG_TOUCHMI_PROBE _UxGT("TouchMI") -#define MSG_TOUCHMI_INIT _UxGT("Inicializ. TouchMI") -#define MSG_TOUCHMI_ZTEST _UxGT("Test ofsetu Z") -#define MSG_TOUCHMI_SAVE _UxGT("Uložiť") -#define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("Zasunúť TouchMI") -#define MSG_MANUAL_DEPLOY _UxGT("Zasunúť sondu Z") -#define MSG_MANUAL_STOW _UxGT("Vysunúť sondu Z") -#define MSG_HOME _UxGT("Najskôr os") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("domov") -#define MSG_ZPROBE_ZOFFSET _UxGT("Ofset sondy Z") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_BABYSTEP_TOTAL _UxGT("Celkom") -#define MSG_ENDSTOP_ABORT _UxGT("Zastavenie Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Chyba ohrevu") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Chyba ohrevu podl.") -#define MSG_HEATING_FAILED_LCD_CHAMBER _UxGT("Chyba ohrevu komory") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Chyba: REDUND. TEP.") -#define MSG_THERMAL_RUNAWAY _UxGT("TEPLOTNÝ SKOK") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("TEPLOTNÝ SKOK PODL.") -#define MSG_THERMAL_RUNAWAY_CHAMBER _UxGT("TEPLOTNÝ SKOK KOMO.") -#define MSG_ERR_MAXTEMP _UxGT("Chyba: MAXTEMP") -#define MSG_ERR_MINTEMP _UxGT("Chyba: MINTEMP") -#define MSG_ERR_MAXTEMP_BED _UxGT("Chyba: MAXTEMP PODL.") -#define MSG_ERR_MINTEMP_BED _UxGT("Chyba: MINTEMP PODL.") -#define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Chyba: MAXTEMP KOMO.") -#define MSG_ERR_MINTEMP_CHAMBER _UxGT("Chyba: MINTEMP KOMO.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("TLAČIAREŇ ZASTAVENÁ") -#define MSG_PLEASE_RESET _UxGT("Reštartuje ju") -#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 podložky...") -#define MSG_BED_COOLING _UxGT("Ochladz. podložky...") -#define MSG_CHAMBER_HEATING _UxGT("Ohrev komory...") -#define MSG_CHAMBER_COOLING _UxGT("Ochladz. komory...") -#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("Auto-kalibrácia") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Nast. výšku delty") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Ofset 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") -#define MSG_LINEAR_LEVELING _UxGT("Lineárne rovnanie") -#define MSG_BILINEAR_LEVELING _UxGT("Bilineárne rovnanie") -#define MSG_UBL_LEVELING _UxGT("UBL rovnanie") -#define MSG_MESH_LEVELING _UxGT("Mriežkové rovnanie") -#define MSG_INFO_STATS_MENU _UxGT("Štatistika") -#define MSG_INFO_BOARD_MENU _UxGT("Info. o doske") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistory") -#define MSG_INFO_EXTRUDERS _UxGT("Extrudéry") -#define MSG_INFO_BAUDRATE _UxGT("Rýchlosť") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Osvetlenie") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Jas svetla") + PROGMEM Language_Str MSG_MOVING = _UxGT("Posúvam..."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Uvolniť XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Posunúť X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Posunúť Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Posunúť Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Extrudér"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Extrudér *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Posunúť o %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Posunúť o 0,1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Posunúť o 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Posunúť o 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Rýchlosť"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Výška podl."); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Tryska"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Tryska ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Podložka"); + PROGMEM Language_Str MSG_CHAMBER = _UxGT("Komora"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Rýchlosť vent."); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rýchlosť vent. ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Rýchlosť ex. vent."); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rýchlosť ex. vent. ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Prietok"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Prietok ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Ovládanie"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto-teplota"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Zap"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Vyp"); + PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID kalibrácia"); + PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID kalibrácia *"); + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Vybrať"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vybrať *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Zrýchlenie"); + PROGMEM Language_Str MSG_JERK = _UxGT("Skok"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-skok"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-skok"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-skok"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-skok"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Rýchlosť"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vmax ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vmax ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vmax ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vmax ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vmax *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Vmin"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VPrej Min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Akcelerácia"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Amax ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Amax ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Amax ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Amax ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Amax *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-retrakt"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-prejazd"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Kroky/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("krokov/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("krokov/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("krokov/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Ekrokov/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*krokov/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Teplota"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Pohyb"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filament"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E na mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Priem. fil."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Priem. fil. *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Vysunúť mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Zaviesť mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K pre posun"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K pre posun *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Uložiť nastavenie"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Načítať nastavenie"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Obnoviť nastavenie"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inicializ. EEPROM"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aktualizovať z SD"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reštart. tlačiar."); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Obnoviť"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Info. obrazovka"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Príprava tlače"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Doladenie tlače"); + PROGMEM Language_Str MSG_START_PRINT = _UxGT("Spustiť tlač"); + PROGMEM Language_Str MSG_BUTTON_NEXT = _UxGT("Ďalší"); + PROGMEM Language_Str MSG_BUTTON_INIT = _UxGT("Inicial."); + PROGMEM Language_Str MSG_BUTTON_STOP = _UxGT("Zastaviť"); + PROGMEM Language_Str MSG_BUTTON_PRINT = _UxGT("Tlačiť"); + PROGMEM Language_Str MSG_BUTTON_RESET = _UxGT("Vynulovať"); + PROGMEM Language_Str MSG_BUTTON_CANCEL = _UxGT("Zrušiť"); + PROGMEM Language_Str MSG_BUTTON_DONE = _UxGT("Hotovo"); + PROGMEM Language_Str MSG_BUTTON_BACK = _UxGT("Naspäť"); + PROGMEM Language_Str MSG_BUTTON_PROCEED = _UxGT("Pokračovať"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Pozastaviť tlač"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Obnoviť tlač"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Zastaviť tlač"); + PROGMEM Language_Str MSG_PRINTING_OBJECT = _UxGT("Tlačím objekt"); + PROGMEM Language_Str MSG_CANCEL_OBJECT = _UxGT("Zrušiť objekt"); + PROGMEM Language_Str MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť objekt ="); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Obnova po výp. nap."); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Tlačiť z SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Žiadna SD karta"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Spím..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Pokrač. kliknutím..."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Tlač pozastavená"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Tlačím..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Tlač zrušená"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Žiadny pohyb."); + PROGMEM Language_Str MSG_KILLED = _UxGT("PRERUŠENÉ. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ZASTAVENÉ. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Retrakt mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Výmena Re.mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Retraktovať V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Zdvih Z mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("AutoRetr."); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Dĺžka výmeny"); + PROGMEM Language_Str MSG_FILAMENT_PURGE_LENGTH = _UxGT("Dĺžka vytlačenia"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Výmena nástroja"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Zdvihnúť Z"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Primárna rýchl."); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Rýchl. retrakcie"); + PROGMEM Language_Str MSG_NOZZLE_STANDBY = _UxGT("Záložná tryska"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Vymeniť filament"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Vymeniť filament *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Zaviesť filament"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Zaviesť filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Vysunúť filament"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Vysunúť filament *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Vysunúť všetko"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Načítať SD kartu"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Vymeniť SD kartu"); + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Odpojiť SD kartu"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Sonda Z mimo podl."); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Faktor skosenia"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reset"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Zasunúť"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Vysunúť"); + PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: Režim SW"); + PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: Režim 5V"); + PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: Režim OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE = _UxGT("Cmd: Ulož. režim"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_5V = _UxGT("Prepnúť do 5V"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_STORE_OD = _UxGT("Prepnúť do OD"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_ECHO = _UxGT("Zobraziť režim"); + PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("POZOR: Zlé nastav. môže spôsobiť poškoden. Pokračovať?"); + PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Inicializ. TouchMI"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test ofsetu Z"); + PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Uložiť"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Zasunúť TouchMI"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Zasunúť sondu Z"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Vysunúť sondu Z"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Najskôr os %s%s%s domov"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Ofset sondy Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + PROGMEM Language_Str MSG_BABYSTEP_TOTAL = _UxGT("Celkom"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Zastavenie Endstop"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Chyba ohrevu"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Chyba ohrevu podl."); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_CHAMBER = _UxGT("Chyba ohrevu komory"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Chyba: REDUND. TEP."); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TEPLOTNÝ SKOK"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("TEPLOTNÝ SKOK PODL."); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("TEPLOTNÝ SKOK KOMO."); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Chyba: MAXTEMP"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Chyba: MINTEMP"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Chyba: MAXTEMP PODL."); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Chyba: MINTEMP PODL."); + PROGMEM Language_Str MSG_ERR_MAXTEMP_CHAMBER = _UxGT("Chyba: MAXTEMP KOMO."); + PROGMEM Language_Str MSG_ERR_MINTEMP_CHAMBER = _UxGT("Chyba: MINTEMP KOMO."); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Najskôr os XY domov"); + PROGMEM Language_Str MSG_HALTED = _UxGT("TLAČIAREŇ ZASTAVENÁ"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Reštartuje ju"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("d"); + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("h"); + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("m"); + PROGMEM Language_Str MSG_HEATING = _UxGT("Ohrev..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Ochladzovanie..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Ohrev podložky..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Ochladz. podložky..."); + PROGMEM Language_Str MSG_CHAMBER_HEATING = _UxGT("Ohrev komory..."); + PROGMEM Language_Str MSG_CHAMBER_COOLING = _UxGT("Ochladz. komory..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta kalibrácia"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Kalibrovať X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibrovať Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibrovať Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrovať stred"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta nastavenia"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto-kalibrácia"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Nast. výšku delty"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Ofset sondy Z"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Diag. rameno"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Výška"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Polomer"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("O tlačiarni"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Info. o tlačiarni"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-bodové rovnanie"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Lineárne rovnanie"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("Bilineárne rovnanie"); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("UBL rovnanie"); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mriežkové rovnanie"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Štatistika"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Info. o doske"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistory"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Extrudéry"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Rýchlosť"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_OFF = _UxGT("Tepl. ochrana: VYP"); + PROGMEM Language_Str MSG_INFO_RUNAWAY_ON = _UxGT("Tepl. ochrana: ZAP"); -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Počet tlačí") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Dokončené") - #define MSG_INFO_PRINT_TIME _UxGT("Celkový čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdlhšia tlač") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Celkom vytlačené") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Tlače") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Hotovo") - #define MSG_INFO_PRINT_TIME _UxGT("Čas") - #define MSG_INFO_PRINT_LONGEST _UxGT("Najdlhšia") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Vytlačené") -#endif + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Osvetlenie"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas svetla"); + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Nesprávna tlačiareň"); -#define MSG_INFO_MIN_TEMP _UxGT("Teplota min") -#define MSG_INFO_MAX_TEMP _UxGT("Teplota max") -#define MSG_INFO_PSU _UxGT("Nap. zdroj") -#define MSG_DRIVE_STRENGTH _UxGT("Budenie motorov") -#define MSG_DAC_PERCENT _UxGT("Motor %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Uložiť do EEPROM") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Počet tlačí"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Dokončené"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Celkový čas"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia tlač"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Celkom vytlačené"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Tlače"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Hotovo"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Čas"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Vytlačené"); + #endif -#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_OPTION_HEADER _UxGT("MOŽNOSTI POKRAČ.:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlačiť viacej") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnoviť tlač") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") -#define MSG_RUNOUT_SENSOR _UxGT("Senzor filamentu") -#define MSG_RUNOUT_DISTANCE_MM _UxGT("Vzd. mm fil. senz.") -#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ý") + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Teplota min"); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Nap. zdroj"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Budenie motorov"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Motor %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Motor %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Motor %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Motor %"); + PROGMEM Language_Str MSG_ERROR_TMC = _UxGT("CHYBA KOMUNIKÁ. TMC"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Uložiť do EEPROM"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER = _UxGT("VÝMENA FILAMENTU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("PAUZA TLAČE"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ZAVEDENIE FILAMENTU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("VYSUNUTIE FILAMENTU"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("MOŽNOSTI POKRAČ.:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Vytlačiť viacej"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Obnoviť tlač"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Tryska: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Senzor filamentu"); + PROGMEM Language_Str MSG_RUNOUT_DISTANCE_MM = _UxGT("Vzd. mm fil. senz."); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Parkovanie zlyhalo"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Kalibrácia zlyhala"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Príliš studený"); -#define MSG_MMU2_FILAMENT_CHANGE_HEADER _UxGT("VÝMENA FILAMENTU") -#define MSG_MMU2_CHOOSE_FILAMENT_HEADER _UxGT("VYBERTE FILAMENT") -#define MSG_MMU2_MENU _UxGT("MMU2") -#define MSG_MMU2_WRONG_FIRMWARE _UxGT("Aktualizujte FW MMU!") -#define MSG_MMU2_NOT_RESPONDING _UxGT("MMU potrebuje zásah.") -#define MSG_MMU2_RESUME _UxGT("Obnoviť tlač") -#define MSG_MMU2_RESUMING _UxGT("Obnovovanie...") -#define MSG_MMU2_LOAD_FILAMENT _UxGT("Zaviesť filament") -#define MSG_MMU2_LOAD_ALL _UxGT("Zaviesť všetky") -#define MSG_MMU2_LOAD_TO_NOZZLE _UxGT("Zaviesť po trysku") -#define MSG_MMU2_EJECT_FILAMENT _UxGT("Vysunúť filament") -#define MSG_MMU2_EJECT_FILAMENT0 _UxGT("Vysunúť filament 1") -#define MSG_MMU2_EJECT_FILAMENT1 _UxGT("Vysunúť filament 2") -#define MSG_MMU2_EJECT_FILAMENT2 _UxGT("Vysunúť filament 3") -#define MSG_MMU2_EJECT_FILAMENT3 _UxGT("Vysunúť filament 4") -#define MSG_MMU2_EJECT_FILAMENT4 _UxGT("Vysunúť filament 5") -#define MSG_MMU2_UNLOAD_FILAMENT _UxGT("Vyňať filament") -#define MSG_MMU2_LOADING_FILAMENT _UxGT("Zavádzanie fil. %i...") -#define MSG_MMU2_EJECTING_FILAMENT _UxGT("Vysúvanie fil. ...") -#define MSG_MMU2_UNLOADING_FILAMENT _UxGT("Vysúvanie fil. ...") -#define MSG_MMU2_ALL _UxGT("Všetky") -#define MSG_MMU2_FILAMENT0 _UxGT("Filament 1") -#define MSG_MMU2_FILAMENT1 _UxGT("Filament 2") -#define MSG_MMU2_FILAMENT2 _UxGT("Filament 3") -#define MSG_MMU2_FILAMENT3 _UxGT("Filament 4") -#define MSG_MMU2_FILAMENT4 _UxGT("Filament 5") -#define MSG_MMU2_RESET _UxGT("Reštartovať MMU") -#define MSG_MMU2_RESETTING _UxGT("Reštart MMU...") -#define MSG_MMU2_EJECT_RECOVER _UxGT("Odstráňte, kliknite") + PROGMEM Language_Str MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("VYBERTE FILAMENT"); + PROGMEM Language_Str MSG_MMU2_MENU = _UxGT("MMU2"); + PROGMEM Language_Str MSG_MMU2_WRONG_FIRMWARE = _UxGT("Aktualizujte FW MMU!"); + PROGMEM Language_Str MSG_MMU2_NOT_RESPONDING = _UxGT("MMU potrebuje zásah."); + PROGMEM Language_Str MSG_MMU2_RESUME = _UxGT("Obnoviť tlač"); + PROGMEM Language_Str MSG_MMU2_RESUMING = _UxGT("Obnovovanie..."); + PROGMEM Language_Str MSG_MMU2_LOAD_FILAMENT = _UxGT("Zaviesť filament"); + PROGMEM Language_Str MSG_MMU2_LOAD_ALL = _UxGT("Zaviesť všetky"); + PROGMEM Language_Str MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("Zaviesť po trysku"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT = _UxGT("Vysunúť filament"); + PROGMEM Language_Str MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Vysunúť filament ~"); + PROGMEM Language_Str MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Vyňať filament"); + PROGMEM Language_Str MSG_MMU2_LOADING_FILAMENT = _UxGT("Zavádzanie fil. %i..."); + PROGMEM Language_Str MSG_MMU2_EJECTING_FILAMENT = _UxGT("Vysúvanie fil. ..."); + PROGMEM Language_Str MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Vysúvanie fil. ..."); + PROGMEM Language_Str MSG_MMU2_ALL = _UxGT("Všetky"); + PROGMEM Language_Str MSG_MMU2_FILAMENT_N = _UxGT("Filament ~"); + PROGMEM Language_Str MSG_MMU2_RESET = _UxGT("Reštartovať MMU"); + PROGMEM Language_Str MSG_MMU2_RESETTING = _UxGT("Reštart MMU..."); + PROGMEM Language_Str MSG_MMU2_EJECT_RECOVER = _UxGT("Odstráňte, kliknite"); -#define MSG_MIX _UxGT("Mix") -#define MSG_MIX_COMPONENT _UxGT("Zložka") -#define MSG_MIXER _UxGT("Mixér") -#define MSG_GRADIENT _UxGT("Gradient") -#define MSG_FULL_GRADIENT _UxGT("Plný gradient") -#define MSG_TOGGLE_MIX _UxGT("Prepnúť mix") -#define MSG_CYCLE_MIX _UxGT("Cyklický mix") -#define MSG_GRADIENT_MIX _UxGT("Gradientný mix") -#define MSG_REVERSE_GRADIENT _UxGT("Otočiť gradient") -#define MSG_ACTIVE_VTOOL _UxGT("Aktívny V-tool") -#define MSG_START_VTOOL _UxGT("Počiat. V-tool") -#define MSG_END_VTOOL _UxGT("Konečn. V-tool") -#define MSG_GRADIENT_ALIAS _UxGT("Alias V-tool") -#define MSG_RESET_VTOOLS _UxGT("Vynulovať V-tools") -#define MSG_COMMIT_VTOOL _UxGT("Uložiť V-tool Mix") -#define MSG_VTOOLS_RESET _UxGT("V-tools vynulované") -#define MSG_START_Z _UxGT("Počiat.Z") -#define MSG_END_Z _UxGT("Konečn.Z") -#define MSG_BRICKOUT _UxGT("Brickout") -#define MSG_INVADERS _UxGT("Nájazdníci") -#define MSG_SNAKE _UxGT("Had") -#define MSG_MAZE _UxGT("Bludisko") + PROGMEM Language_Str MSG_MIX = _UxGT("Mix"); + PROGMEM Language_Str MSG_MIX_COMPONENT_N = _UxGT("Zložka ~"); + PROGMEM Language_Str MSG_MIXER = _UxGT("Mixér"); + PROGMEM Language_Str MSG_GRADIENT = _UxGT("Gradient"); + PROGMEM Language_Str MSG_FULL_GRADIENT = _UxGT("Plný gradient"); + PROGMEM Language_Str MSG_TOGGLE_MIX = _UxGT("Prepnúť mix"); + PROGMEM Language_Str MSG_CYCLE_MIX = _UxGT("Cyklický mix"); + PROGMEM Language_Str MSG_GRADIENT_MIX = _UxGT("Gradientný mix"); + PROGMEM Language_Str MSG_REVERSE_GRADIENT = _UxGT("Otočiť gradient"); + PROGMEM Language_Str MSG_ACTIVE_VTOOL = _UxGT("Aktívny V-tool"); + PROGMEM Language_Str MSG_START_VTOOL = _UxGT("Počiat. V-tool"); + PROGMEM Language_Str MSG_END_VTOOL = _UxGT("Konečn. V-tool"); + PROGMEM Language_Str MSG_GRADIENT_ALIAS = _UxGT("Alias V-tool"); + PROGMEM Language_Str MSG_RESET_VTOOLS = _UxGT("Vynulovať V-tools"); + PROGMEM Language_Str MSG_COMMIT_VTOOL = _UxGT("Uložiť V-tool Mix"); + PROGMEM Language_Str MSG_VTOOLS_RESET = _UxGT("V-tools vynulované"); + PROGMEM Language_Str MSG_START_Z = _UxGT("Počiat.Z:"); + PROGMEM Language_Str MSG_END_Z = _UxGT("Konečn.Z:"); -// -// 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_ADVANCED_PAUSE_WAITING_1 _UxGT("Stlačte tlačidlo") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("pre obnovu tlače") - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Parkovanie...") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na spustenie") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("výmeny filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stlačte tlačidlo") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pre pokračovanie") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Stlačte tlačidlo") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("pre ohrev trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev trysky") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Čakajte prosím...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunutie") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #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 prosím") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("na vytlačenie") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Stlačte tlačidlo") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("pre dokončenie") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_3 _UxGT("vytláčania filam.") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čakajte prosím na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("obnovenie tlače...") -#else // LCD_HEIGHT < 4 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Kliknite pre pokr.") - #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Parkovanie...") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte prosím...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte a kliknite") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Kliknite pre ohrev") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysúvanie...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádzanie...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačovanie...") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Klik. pre dokonč.") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračovanie...") -#endif // LCD_HEIGHT < 4 -#define MSG_TMC_DRIVERS _UxGT("Ovládače TMC") -#define MSG_TMC_CURRENT _UxGT("Prúd ovládača") -#define MSG_TMC_HYBRID_THRS _UxGT("Hybridný prah") -#define MSG_TMC_HOMING_THRS _UxGT("Bezsenzor. domov") -#define MSG_TMC_STEPPING_MODE _UxGT("Režim krokovania") -#define MSG_TMC_STEALTH_ENABLED _UxGT("StealthChop zapnutý") + PROGMEM Language_Str MSG_GAMES = _UxGT("Hry"); + PROGMEM Language_Str MSG_BRICKOUT = _UxGT("Brickout"); + PROGMEM Language_Str MSG_INVADERS = _UxGT("Nájazdníci"); + PROGMEM Language_Str MSG_SNAKE = _UxGT("Had"); + PROGMEM Language_Str MSG_MAZE = _UxGT("Bludisko"); -#define MSG_SERVICE_RESET _UxGT("Vynulovať") -#define MSG_SERVICE_IN _UxGT(" za:") -#define MSG_BACKLASH _UxGT("Kompenz. vôle") -#define MSG_BACKLASH_CORRECTION _UxGT("Korekcia") -#define MSG_BACKLASH_SMOOTHING _UxGT("Vyhladzovanie") + // + // 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 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Stlačte tlačidlo", "pre obnovu tlače")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkovanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Čakajte prosím", "na spustenie", "výmeny filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Vložte filament", "a stlačte tlačidlo", "pre pokračovanie")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Stlačte tlačidlo", "pre ohrev trysky")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Ohrev trysky", "Čakajte prosím...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_3_LINE("Čakajte prosím", "na vysunutie", "filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_3_LINE("Čakajte prosím", "na zavedenie", "filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_3_LINE("Čakajte prosím", "na vytlačenie", "filamentu")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_3_LINE("Stlačte tlačidlo", "pre dokončenie", "vytláčania filam.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Čakajte prosím na", "obnovenie tlače...")); + #else + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Kliknite pre pokr.")); + PROGMEM Language_Str MSG_PAUSE_PRINT_INIT = _UxGT(MSG_1_LINE("Parkovanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Čakajte prosím...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Vložte a kliknite")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Kliknite pre ohrev")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Ohrev...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Vysúvanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Zavádzanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Vytlačovanie...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Klik. pre dokonč.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Pokračovanie...")); + #endif + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Ovládače TMC"); + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Prúd ovládača"); + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Hybridný prah"); + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Bezsenzor. domov"); + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Režim krokovania"); + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop zapnutý"); + PROGMEM Language_Str MSG_SERVICE_RESET = _UxGT("Vynulovať"); + PROGMEM Language_Str MSG_SERVICE_IN = _UxGT("za:"); + PROGMEM Language_Str MSG_BACKLASH = _UxGT("Kompenz. vôle"); + PROGMEM Language_Str MSG_BACKLASH_A = LCD_STR_A; + PROGMEM Language_Str MSG_BACKLASH_B = LCD_STR_B; + PROGMEM Language_Str MSG_BACKLASH_C = LCD_STR_C; + PROGMEM Language_Str MSG_BACKLASH_CORRECTION = _UxGT("Korekcia"); + PROGMEM Language_Str MSG_BACKLASH_SMOOTHING = _UxGT("Vyhladzovanie"); +} diff --git a/Marlin/src/lcd/language/language_test.h b/Marlin/src/lcd/language/language_test.h index b2be749a0027..b03d92039ab2 100644 --- a/Marlin/src/lcd/language/language_test.h +++ b/Marlin/src/lcd/language/language_test.h @@ -114,114 +114,124 @@ #define STRG_OKTAL_e "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" #define STRG_OKTAL_f "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" -#if ENABLED(DISPLAYTEST) - #define WELCOME_MSG _UxGT("Language TEST") - - #define MSG_WATCH _UxGT("Display test") - #define MSG_PREPARE STRG_OKTAL_b - #define MSG_CONTROL STRG_OKTAL_c -#endif - -#if ENABLED(WEST) - #define WELCOME_MSG _UxGT("Language TEST") - - #define MSG_WATCH _UxGT("\001\002\003\004\005\006\007\010\011") - #define MSG_PREPARE _UxGT("UTF8") - #define MSG_CONTROL _UxGT("ASCII") - - //#define MSG_MAIN _UxGT("..") - #define MSG_DISABLE_STEPPERS STRG_C2_8 - #define MSG_AUTO_HOME STRG_C2_9 - #define MSG_SET_HOME_OFFSETS STRG_C2_a - #define MSG_PREHEAT_1 STRG_C2_b - #define MSG_PREHEAT_2 STRG_C3_8 - #define MSG_COOLDOWN STRG_C3_9 - #define MSG_SWITCH_PS_OFF STRG_C3_a - #define MSG_MOVE_AXIS STRG_C3_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f - -#endif - -#if ENABLED(CYRIL) - #define WELCOME_MSG _UxGT("Language TEST") - - #define MSG_WATCH _UxGT("\001\002\003\004\005\006\007\010\011") - #define MSG_PREPARE _UxGT("UTF8") - #define MSG_CONTROL _UxGT("ASCII") - - //#define MSG_MAIN _UxGT("..") - #define MSG_DISABLE_STEPPERS STRG_D0_8 - #define MSG_AUTO_HOME STRG_D0_9 - #define MSG_SET_HOME_OFFSETS STRG_D0_a - #define MSG_PREHEAT_1 STRG_D0_b - #define MSG_PREHEAT_2 STRG_D1_8 - #define MSG_COOLDOWN STRG_D1_9 - #define MSG_SWITCH_PS_OFF STRG_D1_a - #define MSG_MOVE_AXIS STRG_D1_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f - -#endif - -#if ENABLED(KANA) - #define WELCOME_MSG _UxGT("Language TEST") - - #define MSG_WATCH _UxGT("\001\002\003\004\005\006\007\010\011") - #define MSG_PREPARE _UxGT("UTF8") - #define MSG_CONTROL _UxGT("ASCII") - - //#define MSG_MAIN _UxGT("..") - #define MSG_DISABLE_STEPPERS STRG_E382_8 - #define MSG_AUTO_HOME STRG_E382_9 - #define MSG_SET_HOME_OFFSETS STRG_E382_a - #define MSG_PREHEAT_1 STRG_E382_b - #define MSG_PREHEAT_2 STRG_E383_8 - #define MSG_COOLDOWN STRG_E383_9 - #define MSG_SWITCH_PS_OFF STRG_E383_a - #define MSG_MOVE_AXIS STRG_E383_b - - #define MSG_MAIN STRG_OKTAL_2 - #define MSG_TEMPERATURE STRG_OKTAL_3 - #define MSG_MOTION STRG_OKTAL_4 - #define MSG_FILAMENT STRG_OKTAL_5 - #define MSG_CONTRAST STRG_OKTAL_6 - #define MSG_RESTORE_FAILSAFE STRG_OKTAL_7 - - #define MSG_NOZZLE STRG_OKTAL_8 - #define MSG_FAN_SPEED STRG_OKTAL_9 - #define MSG_AUTOTEMP STRG_OKTAL_a - #define MSG_MIN STRG_OKTAL_b - #define MSG_MAX STRG_OKTAL_c - #define MSG_FACTOR STRG_OKTAL_d - #define MSG_PID_P STRG_OKTAL_e - #define MSG_PID_I STRG_OKTAL_f -#endif +namespace Language_test { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 1; + + #if ENABLED(DISPLAYTEST) + PROGMEM Language_Str WELCOME_MSG = _UxGT("Language TEST"); + + PROGMEM Language_Str MSG_WATCH = _UxGT("Display test"); + PROGMEM Language_Str MSG_PREPARE = STRG_OKTAL_b; + PROGMEM Language_Str MSG_CONTROL = STRG_OKTAL_c; + #endif + + #if ENABLED(WEST) + PROGMEM Language_Str WELCOME_MSG = _UxGT("Language TEST"); + + PROGMEM Language_Str MSG_WATCH = _UxGT("\001\002\003\004\005\006\007\010\011"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("UTF8"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("ASCII"); + + PROGMEM Language_Str MSG_MAIN = _UxGT(".."); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = STRG_C2_8; + PROGMEM Language_Str MSG_AUTO_HOME = STRG_C2_9; + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = STRG_C2_a; + PROGMEM Language_Str MSG_PREHEAT_1 = STRG_C2_b; + PROGMEM Language_Str MSG_PREHEAT_2 = STRG_C3_8; + PROGMEM Language_Str MSG_COOLDOWN = STRG_C3_9; + PROGMEM Language_Str MSG_SWITCH_PS_OFF = STRG_C3_a; + PROGMEM Language_Str MSG_MOVE_AXIS = STRG_C3_b; + + PROGMEM Language_Str MSG_MAIN = STRG_OKTAL_2; + PROGMEM Language_Str MSG_TEMPERATURE = STRG_OKTAL_3; + PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; + PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; + PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; + + PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; + PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; + PROGMEM Language_Str MSG_FAN_SPEED = STRG_OKTAL_9; + PROGMEM Language_Str MSG_FAN_SPEED_N = STRG_OKTAL_9; + PROGMEM Language_Str MSG_AUTOTEMP = STRG_OKTAL_a; + PROGMEM Language_Str MSG_MIN = STRG_OKTAL_b; + PROGMEM Language_Str MSG_MAX = STRG_OKTAL_c; + PROGMEM Language_Str MSG_FACTOR = STRG_OKTAL_d; + PROGMEM Language_Str MSG_PID_P = STRG_OKTAL_e; + PROGMEM Language_Str MSG_PID_I = STRG_OKTAL_f; + + #endif + + #if ENABLED(CYRIL) + PROGMEM Language_Str WELCOME_MSG = _UxGT("Language TEST"); + + PROGMEM Language_Str MSG_WATCH = _UxGT("\001\002\003\004\005\006\007\010\011"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("UTF8"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("ASCII"); + + PROGMEM Language_Str MSG_MAIN = _UxGT(".."); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = STRG_D0_8; + PROGMEM Language_Str MSG_AUTO_HOME = STRG_D0_9; + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = STRG_D0_a; + PROGMEM Language_Str MSG_PREHEAT_1 = STRG_D0_b; + PROGMEM Language_Str MSG_PREHEAT_2 = STRG_D1_8; + PROGMEM Language_Str MSG_COOLDOWN = STRG_D1_9; + PROGMEM Language_Str MSG_SWITCH_PS_OFF = STRG_D1_a; + PROGMEM Language_Str MSG_MOVE_AXIS = STRG_D1_b; + + PROGMEM Language_Str MSG_MAIN = STRG_OKTAL_2; + PROGMEM Language_Str MSG_TEMPERATURE = STRG_OKTAL_3; + PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; + PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; + PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; + + PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; + PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; + PROGMEM Language_Str MSG_FAN_SPEED_N = STRG_OKTAL_9; + PROGMEM Language_Str MSG_AUTOTEMP = STRG_OKTAL_a; + PROGMEM Language_Str MSG_MIN = STRG_OKTAL_b; + PROGMEM Language_Str MSG_MAX = STRG_OKTAL_c; + PROGMEM Language_Str MSG_FACTOR = STRG_OKTAL_d; + PROGMEM Language_Str MSG_PID_P = STRG_OKTAL_e; + PROGMEM Language_Str MSG_PID_I = STRG_OKTAL_f; + + #endif + + #if ENABLED(KANA) + PROGMEM Language_Str WELCOME_MSG = _UxGT("Language TEST"); + + PROGMEM Language_Str MSG_WATCH = _UxGT("\001\002\003\004\005\006\007\010\011"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("UTF8"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("ASCII"); + + PROGMEM Language_Str MSG_MAIN = _UxGT(".."); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = STRG_E382_8; + PROGMEM Language_Str MSG_AUTO_HOME = STRG_E382_9; + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = STRG_E382_a; + PROGMEM Language_Str MSG_PREHEAT_1 = STRG_E382_b; + PROGMEM Language_Str MSG_PREHEAT_2 = STRG_E383_8; + PROGMEM Language_Str MSG_COOLDOWN = STRG_E383_9; + PROGMEM Language_Str MSG_SWITCH_PS_OFF = STRG_E383_a; + PROGMEM Language_Str MSG_MOVE_AXIS = STRG_E383_b; + + PROGMEM Language_Str MSG_MAIN = STRG_OKTAL_2; + PROGMEM Language_Str MSG_TEMPERATURE = STRG_OKTAL_3; + PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; + PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; + PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; + + PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; + PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; + PROGMEM Language_Str MSG_FAN_SPEED_N = STRG_OKTAL_9; + PROGMEM Language_Str MSG_AUTOTEMP = STRG_OKTAL_a; + PROGMEM Language_Str MSG_MIN = STRG_OKTAL_b; + PROGMEM Language_Str MSG_MAX = STRG_OKTAL_c; + PROGMEM Language_Str MSG_FACTOR = STRG_OKTAL_d; + PROGMEM Language_Str MSG_PID_P = STRG_OKTAL_e; + PROGMEM Language_Str MSG_PID_I = STRG_OKTAL_f; + #endif +} diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index e8e72b82b189..24b9e9137a28 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -1,4 +1,4 @@ -/** + /** * Marlin 3D Printer Firmware * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * @@ -34,401 +34,405 @@ */ #define DISPLAY_CHARSET_ISO10646_TR -#define CHARSIZE 2 -#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("İÖÇğüşöç³") -#define WELCOME_MSG MACHINE_NAME _UxGT(" hazır.") -#define MSG_BACK _UxGT("Geri") -#define MSG_SD_INSERTED _UxGT("SD K. Yerleştirildi.") -#define MSG_SD_REMOVED _UxGT("SD Kart Çıkarıldı.") -#define MSG_LCD_ENDSTOPS _UxGT("Enstops") // Max length 8 characters -#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Yazılımsal Endstops") -#define MSG_MAIN _UxGT("Ana") -#define MSG_ADVANCED_SETTINGS _UxGT("Gelişmiş Ayarlar") -#define MSG_CONFIGURATION _UxGT("Yapılandırma") -#define MSG_AUTOSTART _UxGT("Oto. Başlat") -#define MSG_DISABLE_STEPPERS _UxGT("Motorları Durdur") -#define MSG_DEBUG_MENU _UxGT("Hata Ayıklama") -#define MSG_PROGRESS_BAR_TEST _UxGT("Durum Çubuğu Testi") -#define MSG_AUTO_HOME _UxGT("Eksenleri Sıfırla") -#define MSG_AUTO_HOME_X _UxGT("X Sıfırla") -#define MSG_AUTO_HOME_Y _UxGT("Y Sıfırla") -#define MSG_AUTO_HOME_Z _UxGT("Z Sıfırla") -#define MSG_AUTO_Z_ALIGN _UxGT("Oto. Z-Hizalama") -#define MSG_LEVEL_BED_HOMING _UxGT("XYZ Sıfırlanıyor") -#define MSG_LEVEL_BED_WAITING _UxGT("Başlatmak için tıkla") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sonraki Nokta") -#define MSG_LEVEL_BED_DONE _UxGT("Hizalama Tamam!") -#define MSG_Z_FADE_HEIGHT _UxGT("Kaçınma Yüksekliği") -#define MSG_SET_HOME_OFFSETS _UxGT("Offset Ayarla") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset Tamam") -#define MSG_SET_ORIGIN _UxGT("Sıfır Belirle") -#define MSG_PREHEAT_1 _UxGT("Ön Isınma " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tüm") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Nozul") -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Tabla") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ayarlar") -#define MSG_PREHEAT_2 _UxGT("Ön Isınma " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tüm") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Nozul") -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Tabla") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Ayarlar") -#define MSG_PREHEAT_CUSTOM _UxGT("Özel Ön Isınma") -#define MSG_COOLDOWN _UxGT("Soğut") -#define MSG_SWITCH_PS_ON _UxGT("Gücü Aç") -#define MSG_SWITCH_PS_OFF _UxGT("Gücü Kapat") -#define MSG_EXTRUDE _UxGT("Ekstrüzyon") -#define MSG_RETRACT _UxGT("Geri Çek") -#define MSG_MOVE_AXIS _UxGT("Eksen Hareketleri") -#define MSG_BED_LEVELING _UxGT("Tabla Hizalama") -#define MSG_LEVEL_BED _UxGT("Tabla Hizası") -#define MSG_LEVEL_CORNERS _UxGT("Hizalama Köşeleri") -#define MSG_NEXT_CORNER _UxGT("Sonraki Köşe") -#define MSG_EDITING_STOPPED _UxGT("Mesh Düzenleme Durdu") -#define MSG_MESH_X _UxGT("İndeks X") -#define MSG_MESH_Y _UxGT("İndeks Y") -#define MSG_MESH_EDIT_Z _UxGT("Z Değeri") -#define MSG_USER_MENU _UxGT("Özel Komutlar") -#define MSG_UBL_DOING_G29 _UxGT("G29 Çalışıyor") -#define MSG_UBL_UNHOMED _UxGT("Ilk XYZ Sıfırla") -#define MSG_UBL_TOOLS _UxGT("UBL Araçları") -#define MSG_UBL_LEVEL_BED _UxGT("UBL Yatak Hizalama") -#define MSG_IDEX_MENU _UxGT("IDEX Modu") -#define MSG_IDEX_MODE_AUTOPARK _UxGT("Oto-Park") -#define MSG_IDEX_MODE_DUPLICATE _UxGT("Kopyala") -#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Yansıtılmış kopya") -#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Tam Kontrol") -#define MSG_X_OFFSET _UxGT("2. nozul X") -#define MSG_Y_OFFSET _UxGT("2. nozul Y") -#define MSG_Z_OFFSET _UxGT("2. nozul Z") -#define MSG_UBL_MANUAL_MESH _UxGT("Elle Mesh Oluştur") -#define MSG_UBL_BC_INSERT _UxGT("Altlık & Ölçü Ver") -#define MSG_UBL_BC_INSERT2 _UxGT("Ölçü") -#define MSG_UBL_BC_REMOVE _UxGT("Yataktan Ölçü Kaldır") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Sonrakine Git") -#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL'yi Etkinleştir") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL'yi Etkisizleştir") -#define MSG_UBL_SET_TEMP_BED _UxGT("Yatak Sıcaklığı") -#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED -#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Nozul Sıcaklığı") -#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND -#define MSG_UBL_MESH_EDIT _UxGT("Mesh Düzenleme") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Özel Mesh Düzenleme") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("İnce Ayar Mesh") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Mesh Düzenleme Tamam") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Özel Mesh Oluştur") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Mesh Oluştur") -#define MSG_UBL_BUILD_MESH_M1 _UxGT("Mesh Oluştur (" PREHEAT_1_LABEL ")") -#define MSG_UBL_BUILD_MESH_M2 _UxGT("Mesh Oluştur (" PREHEAT_2_LABEL ")") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Soğuk Mesh Oluştur") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Mesh Yükseklik Ayarı") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Yükseklik miktarı") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Doğrulama Mesh") -#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Doğrulama Mesh (" PREHEAT_1_LABEL ")") -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Doğrulama Mesh (" PREHEAT_2_LABEL ")") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Özel Mesh Doğrulama") -#define MSG_UBL_CONTINUE_MESH _UxGT("Tabla Mesh Devam et") -#define MSG_UBL_MESH_LEVELING _UxGT("Mesh Hizalama") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Nokta Hizalama") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Kafes Mesh Hizalama") -#define MSG_UBL_MESH_LEVEL _UxGT("Mesh Seviyesi") -#define MSG_UBL_SIDE_POINTS _UxGT("Yan Noktalar") -#define MSG_UBL_MAP_TYPE _UxGT("Haritalama Türü") -#define MSG_UBL_OUTPUT_MAP _UxGT("Mesh Çıkış Haritası") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Host için Çıktı") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("CSV için Çıktı") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Yazıcıda Yedek Kpalı") -#define MSG_UBL_INFO_UBL _UxGT("UBL Çıkış Bilgisi") -#define MSG_EDIT_MESH _UxGT("Mesh Düzenle") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Dolgu Miktarı") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Manuel Dolgu") -#define MSG_UBL_SMART_FILLIN _UxGT("Akıllı Dogu") -#define MSG_UBL_FILLIN_MESH _UxGT("Mesh Dolgu") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Tümünü Geçersiz Kıl") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Yakını Geçersiz Kıl") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Tümünü İnce Ayarla") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Yakını İnce Ayarla") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Depolama") -#define MSG_UBL_STORAGE_SLOT _UxGT("Bellek Yuvası") -#define MSG_UBL_LOAD_MESH _UxGT("Yatak Mesh Yükle") -#define MSG_UBL_SAVE_MESH _UxGT("Yatak Mesh Kayıt Et") -#define MSG_MESH_LOADED _UxGT("Mesh %i yüklendi") -#define MSG_MESH_SAVED _UxGT("Mesh %i kayıtlandı") -#define MSG_NO_STORAGE _UxGT("Depolama Yok") -#define MSG_UBL_SAVE_ERROR _UxGT("Hata: UBL Kayıt") -#define MSG_UBL_RESTORE_ERROR _UxGT("Hata: UBL Yenileme") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Ofset Durduruldu") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Adım Adım UBL") -#define MSG_LED_CONTROL _UxGT("LED Kontrolü") -#define MSG_LEDS _UxGT("Işıklar") -#define MSG_LED_PRESETS _UxGT("Işık Hazır Ayarları") -#define MSG_SET_LEDS_RED _UxGT("Kırmızı") -#define MSG_SET_LEDS_ORANGE _UxGT("Turuncu") -#define MSG_SET_LEDS_YELLOW _UxGT("Sarı") -#define MSG_SET_LEDS_GREEN _UxGT("Yeşil") -#define MSG_SET_LEDS_BLUE _UxGT("Mavi") -#define MSG_SET_LEDS_INDIGO _UxGT("Lacivert") -#define MSG_SET_LEDS_VIOLET _UxGT("Menekşe") -#define MSG_SET_LEDS_WHITE _UxGT("Beyaz") -#define MSG_SET_LEDS_DEFAULT _UxGT("Varsayılan") -#define MSG_CUSTOM_LEDS _UxGT("Özel Işıklar") -#define MSG_INTENSITY_R _UxGT("Kırmızı Şiddeti") -#define MSG_INTENSITY_G _UxGT("Yeşil Şiddeti") -#define MSG_INTENSITY_B _UxGT("Mavi Şiddeti") -#define MSG_INTENSITY_W _UxGT("Beyaz Şiddeti") -#define MSG_LED_BRIGHTNESS _UxGT("Parlaklık") -#define MSG_MOVING _UxGT("Hareket Ediyor..") -#define MSG_FREE_XY _UxGT("Durdur XY") -#define MSG_MOVE_X _UxGT("X Hareketi") -#define MSG_MOVE_Y _UxGT("Y Hareketi") -#define MSG_MOVE_Z _UxGT("Z Hareketi") -#define MSG_MOVE_E _UxGT("Ekstruder") -#define MSG_HOTEND_TOO_COLD _UxGT("Nozul Çok Soğuk") -#define MSG_MOVE_0025MM _UxGT("0.025mm") -#define MSG_MOVE_01MM _UxGT("0.1mm") -#define MSG_MOVE_1MM _UxGT("1mm") -#define MSG_MOVE_10MM _UxGT("10mm") -#define MSG_SPEED _UxGT("Hız") -#define MSG_BED_Z _UxGT("Z Mesafesi") -#define MSG_NOZZLE _UxGT("Nozul") -#define MSG_BED _UxGT("Tabla") -#define MSG_FAN_SPEED _UxGT("Fan Hızı") -#define MSG_EXTRA_FAN_SPEED _UxGT("Ekstra Fan Hızı") -#define MSG_FLOW _UxGT("Akış") -#define MSG_CONTROL _UxGT("Kontrol") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Çarpan") -#define MSG_AUTOTEMP _UxGT("Oto. Sıcaklık") -#define MSG_LCD_ON _UxGT("Açık") -#define MSG_LCD_OFF _UxGT("Kapalı") -#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("Seç") -#define MSG_ACC _UxGT("İvme") -#define MSG_JERK _UxGT("Sarsım") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-Sarsım") - #define MSG_VB_JERK _UxGT("Vb-Sarsım") - #define MSG_VC_JERK _UxGT("Vc-Sarsım") -#else - #define MSG_VA_JERK _UxGT("Vx-Sarsım") - #define MSG_VB_JERK _UxGT("Vy-Sarsım") - #define MSG_VC_JERK _UxGT("Vz-Sarsım") -#endif -#define MSG_VE_JERK _UxGT("Ve-Sarsım") -#define MSG_JUNCTION_DEVIATION _UxGT("Jonksiyon Sapması") -#define MSG_VELOCITY _UxGT("Hız Vektörü") -#define MSG_VMAX _UxGT("HızVektör.max ") -#define MSG_VMIN _UxGT("HızVektör.min") -#define MSG_VTRAV_MIN _UxGT("HV.gezinme min") -#define MSG_ACCELERATION _UxGT("Ivme") -#define MSG_AMAX _UxGT("Max. ivme ") -#define MSG_A_RETRACT _UxGT("Ivme-geri çekme") -#define MSG_A_TRAVEL _UxGT("Ivme-gezinme") -#define MSG_STEPS_PER_MM _UxGT("Adım/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("A adım/mm") - #define MSG_BSTEPS _UxGT("B adım/mm") - #define MSG_CSTEPS _UxGT("C adım/mm") -#else - #define MSG_ASTEPS _UxGT("X adım/mm") - #define MSG_BSTEPS _UxGT("Y adım/mm") - #define MSG_CSTEPS _UxGT("Z adım/mm") -#endif -#define MSG_ESTEPS _UxGT("E adım/mm") -#define MSG_E1STEPS _UxGT("E1 adım/mm") -#define MSG_E2STEPS _UxGT("E2 adım/mm") -#define MSG_E3STEPS _UxGT("E3 adım/mm") -#define MSG_E4STEPS _UxGT("E4 adım/mm") -#define MSG_E5STEPS _UxGT("E5 adım/mm") -#define MSG_E6STEPS _UxGT("E6 adım/mm") -#define MSG_TEMPERATURE _UxGT("Sıcaklık") -#define MSG_MOTION _UxGT("Hareket") -#define MSG_FILAMENT _UxGT("Filaman") -#define MSG_VOLUMETRIC_ENABLED _UxGT("Ekstrüzyon/mm³") -#define MSG_FILAMENT_DIAM _UxGT("Filaman Çapı") -#define MSG_FILAMENT_UNLOAD _UxGT("Çıkart mm") -#define MSG_FILAMENT_LOAD _UxGT("Yükle mm") -#define MSG_ADVANCE_K _UxGT("K İlerlet") -#define MSG_CONTRAST _UxGT("LCD Kontrast") -#define MSG_STORE_EEPROM _UxGT("Hafızaya Al") -#define MSG_LOAD_EEPROM _UxGT("Hafızadan Yükle") -#define MSG_RESTORE_FAILSAFE _UxGT("Fabrika Ayarları") -#define MSG_INIT_EEPROM _UxGT("EEPROM'u başlat") -#define MSG_SD_UPDATE _UxGT("SD Güncellemesi") -#define MSG_RESET_PRINTER _UxGT("Yazıcıyı Resetle") -#define MSG_REFRESH _UxGT("Yenile") -#define MSG_WATCH _UxGT("Bilgi Ekranı") -#define MSG_PREPARE _UxGT("Hazırlık") -#define MSG_TUNE _UxGT("Ayar") -#define MSG_PAUSE_PRINT _UxGT("Duraklat") -#define MSG_RESUME_PRINT _UxGT("Sürdür") -#define MSG_STOP_PRINT _UxGT("Durdur") -#define MSG_OUTAGE_RECOVERY _UxGT("Kesinti Kurtarma") -#define MSG_CARD_MENU _UxGT("SD Karttan Yazdır") -#define MSG_NO_CARD _UxGT("SD Kart Yok!") -#define MSG_DWELL _UxGT("Uyku...") -#define MSG_USERWAIT _UxGT("Operatör bekleniyor.") -#define MSG_PRINT_PAUSED _UxGT("Baskı Duraklatıldı") -#define MSG_PRINTING _UxGT("Baskı Yapılıyor...") -#define MSG_PRINT_ABORTED _UxGT("Baskı Durduruldu!") -#define MSG_NO_MOVE _UxGT("İşlem yok.") -#define MSG_KILLED _UxGT("Kilitlendi. ") -#define MSG_STOPPED _UxGT("Durdu. ") -#define MSG_CONTROL_RETRACT _UxGT("Geri Çek mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Geri Çekme V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Atlama mm") -#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("Oto. Geri Çekme") -#define MSG_FILAMENT_SWAP_LENGTH _UxGT("G.Çekme Boyu") -#define MSG_TOOL_CHANGE _UxGT("Takım Değişimi") -#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Z Yükselt") -#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Birincil Hız") -#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Geri Çekme Hızı") -#define MSG_FILAMENTCHANGE _UxGT("Filaman Değiştir") -#define MSG_FILAMENTLOAD _UxGT("Filaman Yükle") -#define MSG_FILAMENTUNLOAD _UxGT("Filaman Çıkart") -#define MSG_FILAMENTUNLOAD_ALL _UxGT("Tümünü Çıkart") -#define MSG_INIT_SDCARD _UxGT("SD Kart Başlatılıyor") -#define MSG_CHANGE_SDCARD _UxGT("SD Kart Değiştir") -#define MSG_ZPROBE_OUT _UxGT("Z Prob Açık. Tabla") -#define MSG_SKEW_FACTOR _UxGT("Çarpıklık Faktörü") -#define MSG_BLTOUCH _UxGT("BLTouch") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("Sıfırla BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch Aç") -#define MSG_BLTOUCH_STOW _UxGT("BLTouch Kapat") -#define MSG_MANUAL_DEPLOY _UxGT("Z-Prob Aç") -#define MSG_MANUAL_STOW _UxGT("Z-Sensör Kapat") -#define MSG_HOME _UxGT("Sıfırla") -#define MSG_FIRST _UxGT("Önce") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") -#define MSG_BABYSTEP_X _UxGT("Miniadım X") -#define MSG_BABYSTEP_Y _UxGT("Miniadım Y") -#define MSG_BABYSTEP_Z _UxGT("Miniadım Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop iptal") -#define MSG_HEATING_FAILED_LCD _UxGT("Isınma başarısız") -#define MSG_HEATING_FAILED_LCD_BED _UxGT("Yatak Isınma Başrsız") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Hata: Sıcaklık Aşımı") -#define MSG_THERMAL_RUNAWAY _UxGT("TERMAL PROBLEM") -#define MSG_THERMAL_RUNAWAY_BED _UxGT("TABLA TERMAL PROBLEM") -#define MSG_ERR_MAXTEMP _UxGT("Hata: MAX.SICAKLIK") -#define MSG_ERR_MINTEMP _UxGT("Hata: MIN.SICAKLIK") -#define MSG_ERR_MAXTEMP_BED _UxGT("Hata: MAX.SIC. TABLA") -#define MSG_ERR_MINTEMP_BED _UxGT("Hata: MIN.SIC. TABLA") -#define MSG_ERR_Z_HOMING _UxGT("Önce XY Sıfırla") -#define MSG_HALTED _UxGT("YAZICI DURDURULDU") -#define MSG_PLEASE_RESET _UxGT("Lütfen Resetleyin") -#define MSG_SHORT_DAY _UxGT("G") // One character only -#define MSG_SHORT_HOUR _UxGT("S") // One character only -#define MSG_SHORT_MINUTE _UxGT("D") // One character only -#define MSG_HEATING _UxGT("Isınıyor...") -#define MSG_COOLING _UxGT("Soğuyor...") -#define MSG_BED_HEATING _UxGT("Tabla Isınıyor...") -#define MSG_BED_COOLING _UxGT("Tabla Soğuyor...") -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrasyonu") -#define MSG_DELTA_CALIBRATE_X _UxGT("Ayarla X") -#define MSG_DELTA_CALIBRATE_Y _UxGT("Ayarla Y") -#define MSG_DELTA_CALIBRATE_Z _UxGT("Ayarla Z") -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Ayarla Merkez") -#define MSG_DELTA_SETTINGS _UxGT("Delta Ayarları") -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Oto Kalibrasyon") -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Yük. Ayarla") -#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Z Prob Ofseti") -#define MSG_DELTA_DIAG_ROD _UxGT("Çapral Mil") -#define MSG_DELTA_HEIGHT _UxGT("Yükseklik") -#define MSG_DELTA_RADIUS _UxGT("Yarıçap") -#define MSG_INFO_MENU _UxGT("Yazıcı Hakkında") -#define MSG_INFO_PRINTER_MENU _UxGT("Yazıcı Bilgisi") -#define MSG_3POINT_LEVELING _UxGT("3-Nokta Hizalama") -#define MSG_LINEAR_LEVELING _UxGT("Doğrusal Hizalama") -#define MSG_BILINEAR_LEVELING _UxGT("İki Yönlü Doğ. Hiza.") -#define MSG_UBL_LEVELING _UxGT("Birleşik Tabla Hiza.") -#define MSG_MESH_LEVELING _UxGT("Mesh Hizalama") -#define MSG_INFO_STATS_MENU _UxGT("İstatistikler") -#define MSG_INFO_BOARD_MENU _UxGT("Kontrolcü Bilgisi") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistörler") -#define MSG_INFO_EXTRUDERS _UxGT("Ekstruderler") -#define MSG_INFO_BAUDRATE _UxGT("İletişim Hızı") -#define MSG_INFO_PROTOCOL _UxGT("Protokol") -#define MSG_CASE_LIGHT _UxGT("Aydınlatmayı Aç") -#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Aydınlatma Parlaklğı") -#if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Baskı Sayısı") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") - #define MSG_INFO_PRINT_TIME _UxGT("Toplam Baskı Süresi") - #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun Baskı Süresi") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Toplam Filaman") -#else - #define MSG_INFO_PRINT_COUNT _UxGT("Baskı") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") - #define MSG_INFO_PRINT_TIME _UxGT("Süre") - #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filaman") -#endif -#define MSG_INFO_MIN_TEMP _UxGT("Min Sıc.") -#define MSG_INFO_MAX_TEMP _UxGT("Max Sıc.") -#define MSG_INFO_PSU _UxGT("Güç Kaynağı") -#define MSG_DRIVE_STRENGTH _UxGT("Sürücü Gücü") -#define MSG_DAC_PERCENT _UxGT("Sürücü %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Yaz") -#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("BASKI DURAKLATILDI") -#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("FILAMAN YüKLE") -#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("FILAMAN ÇIKART") -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Seçenekler:") -#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Daha Fazla Tasviye") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Baskıyı sürdür") -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozul: ") -#define MSG_RUNOUT_SENSOR _UxGT("Runout Sensörü") -#define MSG_ERR_HOMING_FAILED _UxGT("Sıfırlama Başarısız") -#define MSG_ERR_PROBING_FAILED _UxGT("Probing Başarısız") -#define MSG_M600_TOO_COLD _UxGT("M600: Çok Soğuk") -// -// Filament Değiştirme ekranları, 4 satırlı bir ekranda 3 satıra kadar gösterilir -// ...veya 3 satırlı ekranda 2 satıra kadar -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Baskıya devam etmek") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("için Butona bas") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Filaman değişimi") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("için başlama") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("bekleniyor") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Filamanı yükle") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("ve devam için") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tuşa bas...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Nozulü Isıtmak için") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Butona Bas.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozul Isınıyor") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Lütfen Bekleyin...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Filamanın çıkması") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("bekleniyor") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Filamanın yüklenmesi") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("bekleniyor..") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Filaman Temizlemesi") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("için bekle") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Filaman Temizlemesi") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("bitirmek için tıkla") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Baskının devam ") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("etmesi için bekle") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Sürdürmek İçin Tıkla") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Lütfen bekleyiniz...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Yükle ve bas") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Isıtmak için Tıkla") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Isınıyor...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Çıkartılıyor...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Yüklüyor...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Temizleniyor...") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Bitirmek için Tıkla") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Sürdürülüyor...") -#endif // LCD_HEIGHT < 4 +namespace Language_tr { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Turkish"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" hazır."); + PROGMEM Language_Str MSG_BACK = _UxGT("Geri"); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("SD K. Yerleştirildi."); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("SD Kart Çıkarıldı."); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Enstops"); // Max length 8 characters + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Yazılımsal Endstops"); + PROGMEM Language_Str MSG_MAIN = _UxGT("Ana"); + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Gelişmiş Ayarlar"); + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Yapılandırma"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Oto. Başlat"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Motorları Durdur"); + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Hata Ayıklama"); + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Durum Çubuğu Testi"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Eksenleri Sıfırla"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("X Sıfırla"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Y Sıfırla"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Z Sıfırla"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Oto. Z-Hizalama"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("XYZ Sıfırlanıyor"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Başlatmak için tıkla"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Sonraki Nokta"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Hizalama Tamam!"); + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Kaçınma Yüksekliği"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Offset Ayarla"); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset Tamam"); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Sıfır Belirle"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Ön Isınma ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Ön Isınma ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Nozul"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Nozul ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Tüm"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Tabla"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Ayarlar"); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Ön Isınma ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Ön Isınma ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Nozul"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Nozul ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Tüm"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Tabla"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Ön Isınma ") PREHEAT_2_LABEL _UxGT(" Ayarlar"); + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Özel Ön Isınma"); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Soğut"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Gücü Aç"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Gücü Kapat"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Ekstrüzyon"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Geri Çek"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Eksen Hareketleri"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Tabla Hizalama"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Tabla Hizası"); + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Hizalama Köşeleri"); + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Sonraki Köşe"); + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Mesh Düzenle"); + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Mesh Düzenleme Durdu"); + PROGMEM Language_Str MSG_MESH_X = _UxGT("İndeks X"); + PROGMEM Language_Str MSG_MESH_Y = _UxGT("İndeks Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Z Değeri"); + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Özel Komutlar"); + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("IDEX Modu"); + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Oto-Park"); + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Kopyala"); + PROGMEM Language_Str MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Yansıtılmış kopya"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Tam Kontrol"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_X = _UxGT("2. nozul X"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Y = _UxGT("2. nozul Y"); + PROGMEM Language_Str MSG_HOTEND_OFFSET_Z = _UxGT("2. nozul Z"); + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("G29 Çalışıyor"); + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL Araçları"); + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("UBL Yatak Hizalama"); + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Elle Mesh Oluştur"); + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Altlık & Ölçü Ver"); + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Ölçü"); + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Yataktan Ölçü Kaldır"); + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Sonrakine Git"); + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("UBL'yi Etkinleştir"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL'yi Etkisizleştir"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Yatak Sıcaklığı"); + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Yatak Sıcaklığı"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Nozul Sıcaklığı"); + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Nozul Sıcaklığı"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Mesh Düzenleme"); + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Özel Mesh Düzenleme"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("İnce Ayar Mesh"); + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Mesh Düzenleme Tamam"); + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Özel Mesh Oluştur"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Mesh Oluştur"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Mesh Oluştur (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Mesh Oluştur (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Soğuk Mesh Oluştur"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Mesh Yükseklik Ayarı"); + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Yükseklik miktarı"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Doğrulama Mesh"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Doğrulama Mesh (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Doğrulama Mesh (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Özel Mesh Doğrulama"); + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Tabla Mesh Devam et"); + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Mesh Hizalama"); + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-Nokta Hizalama"); + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Kafes Mesh Hizalama"); + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Mesh Seviyesi"); + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Yan Noktalar"); + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Haritalama Türü"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Mesh Çıkış Haritası"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Host için Çıktı"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("CSV için Çıktı"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Yazıcıda Yedek Kpalı"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("UBL Çıkış Bilgisi"); + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Dolgu Miktarı"); + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Manuel Dolgu"); + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Akıllı Dogu"); + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Mesh Dolgu"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Tümünü Geçersiz Kıl"); + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Yakını Geçersiz Kıl"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Tümünü İnce Ayarla"); + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Yakını İnce Ayarla"); + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Depolama"); + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Bellek Yuvası"); + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Yatak Mesh Yükle"); + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Yatak Mesh Kayıt Et"); + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 Mesh %i yüklendi"); + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 Mesh %i kayıtlandı"); + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("Depolama Yok"); + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Hata: UBL Kayıt"); + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Hata: UBL Yenileme"); + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Ofset Durduruldu"); + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Adım Adım UBL"); + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Soğuk Mesh Oluştur"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Akıllı Dogu"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Doğrulama Mesh"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Tümünü İnce Ayarla"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Doğrulama Mesh"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Tümünü İnce Ayarla"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Yatak Mesh Kayıt Et"); + + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("LED Kontrolü"); + PROGMEM Language_Str MSG_LEDS = _UxGT("Işıklar"); + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Işık Hazır Ayarları"); + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Kırmızı"); + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Turuncu"); + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Sarı"); + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Yeşil"); + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Mavi"); + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Lacivert"); + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Menekşe"); + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Beyaz"); + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Varsayılan"); + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Özel Işıklar"); + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Kırmızı Şiddeti"); + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Yeşil Şiddeti"); + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Mavi Şiddeti"); + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Beyaz Şiddeti"); + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("Parlaklık"); + PROGMEM Language_Str MSG_MOVING = _UxGT("Hareket Ediyor.."); + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Durdur XY"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("X Hareketi"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Y Hareketi"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Z Hareketi"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Ekstruder"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Ekstruder *"); + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Nozul Çok Soğuk"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("%smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Hız"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Mesafesi"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Nozul"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozul ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Tabla"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan Hızı"); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan Hızı ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Ekstra Fan Hızı"); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Ekstra Fan Hızı ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Akış"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Akış ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrol"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Min"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Çarpan"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Oto. Sıcaklık"); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Açık"); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Kapalı"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Seç"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seç *"); + PROGMEM Language_Str MSG_ACC = _UxGT("İvme"); + PROGMEM Language_Str MSG_JERK = _UxGT("Sarsım"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-Sarsım"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-Sarsım"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-Sarsım"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-Sarsım"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Jonksiyon Sapması"); + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Hız Vektörü"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("HızVektör.max ") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("HızVektör.max ") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("HızVektör.max ") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("HızVektör.max ") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("HızVektör.max *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("HızVektör.min"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("HV.gezinme min"); + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Ivme"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Max. ivme ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Max. ivme ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Max. ivme ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Max. ivme ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Max. ivme *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("Ivme-geri çekme"); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("Ivme-gezinme"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Adım/mm"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT(" adım/mm"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT(" adım/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT(" adım/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("E adım/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("* adım/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Sıcaklık"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Hareket"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Filaman"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("Ekstrüzyon/mm³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Filaman Çapı"); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Filaman Çapı *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Çıkart mm"); + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Yükle mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K İlerlet"); + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K İlerlet *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD Kontrast"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Hafızaya Al"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Hafızadan Yükle"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Fabrika Ayarları"); + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM'u başlat"); + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("SD Güncellemesi"); + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Yazıcıyı Resetle"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Yenile"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Bilgi Ekranı"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Hazırlık"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Ayar"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Duraklat"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Sürdür"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Durdur"); + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Kesinti Kurtarma"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("SD Karttan Yazdır"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("SD Kart Yok!"); + PROGMEM Language_Str MSG_DWELL = _UxGT("Uyku..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Operatör bekleniyor."); + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Baskı Duraklatıldı"); + PROGMEM Language_Str MSG_PRINTING = _UxGT("Baskı Yapılıyor..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Baskı Durduruldu!"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("İşlem yok."); + PROGMEM Language_Str MSG_KILLED = _UxGT("Kilitlendi. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("Durdu. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Geri Çek mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Re.mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Geri Çekme V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Atlama mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("S UnRet mm"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("UnRet V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("Oto. Geri Çekme"); + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("G.Çekme Boyu"); + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Takım Değişimi"); + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Z Yükselt"); + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Birincil Hız"); + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Geri Çekme Hızı"); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Filaman Değiştir"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Filaman Değiştir *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Filaman Yükle"); + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Filaman Yükle *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Filaman Çıkart"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Filaman Çıkart *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Tümünü Çıkart"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("SD Kart Başlatılıyor"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("SD Kart Değiştir"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z Prob Açık. Tabla"); + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Çarpıklık Faktörü"); + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Self-Test"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Sıfırla BLTouch"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch Aç"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("BLTouch Kapat"); + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Z-Prob Aç"); + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Z-Sensör Kapat"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Sıfırla %s%s%s Önce"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Miniadım X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Miniadım Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Miniadım Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Endstop iptal"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Isınma başarısız"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Yatak Isınma Başrsız"); + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Hata: Sıcaklık Aşımı"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("TERMAL PROBLEM"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("TABLA TERMAL PROBLEM"); + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Hata: MAX.SICAKLIK"); + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Hata: MIN.SICAKLIK"); + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Hata: MAX.SIC. TABLA"); + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Hata: MIN.SIC. TABLA"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Önce XY Sıfırla"); + PROGMEM Language_Str MSG_HALTED = _UxGT("YAZICI DURDURULDU"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Lütfen Resetleyin"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("G"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("S"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("D"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Isınıyor..."); + PROGMEM Language_Str MSG_COOLING = _UxGT("Soğuyor..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Tabla Isınıyor..."); + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Tabla Soğuyor..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrasyonu"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Ayarla X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Ayarla Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Ayarla Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Ayarla Merkez"); + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Delta Ayarları"); + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Oto Kalibrasyon"); + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Yük. Ayarla"); + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Z Prob Ofseti"); + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Çapral Mil"); + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Yükseklik"); + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Yarıçap"); + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Yazıcı Hakkında"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Yazıcı Bilgisi"); + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("3-Nokta Hizalama"); + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("Doğrusal Hizalama"); + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("İki Yönlü Doğ. Hiza."); + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("Birleşik Tabla Hiza."); + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Mesh Hizalama"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("İstatistikler"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Kontrolcü Bilgisi"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Termistörler"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Ekstruderler"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("İletişim Hızı"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Protokol"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Aydınlatmayı Aç"); + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Aydınlatma Parlaklğı"); + + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Yanlış Yazıcı"); + + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Baskı Sayısı"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Tamamlanan"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Toplam Baskı Süresi"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("En Uzun Baskı Süresi"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Toplam Filaman"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Baskı"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Tamamlanan"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Süre"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("En Uzun"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Filaman"); + #endif + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Min Sıc."); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Max Sıc."); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Güç Kaynağı"); + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Sürücü Gücü"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X Sürücü %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y Sürücü %"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z Sürücü %"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E Sürücü %"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Yaz"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("BASKI DURAKLATILDI"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("FILAMAN YüKLE"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("FILAMAN ÇIKART"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("Seçenekler:"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Daha Fazla Tasviye"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Baskıyı sürdür"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozul: "); + PROGMEM Language_Str MSG_RUNOUT_SENSOR = _UxGT("Runout Sensörü"); + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Sıfırlama Başarısız"); + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("Probing Başarısız"); + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Çok Soğuk"); + // + // Filament Değiştirme ekranları, 4 satırlı bir ekranda 3 satıra kadar gösterilir + // ...veya 3 satırlı ekranda 2 satıra kadar + #if LCD_HEIGHT >= 4 + // Up to 3 lines allowed + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Baskıya devam etmek", "için Butona bas")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Filaman değişimi", "için başlama", "bekleniyor")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Filamanı yükle", "ve devam için", "tuşa bas...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Nozulü Isıtmak için", "Butona Bas.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Nozul Isınıyor", "Lütfen Bekleyin...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Filamanın çıkması", "bekleniyor")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Filamanın yüklenmesi", "bekleniyor..")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Filaman Temizlemesi", "için bekle")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Filaman Temizlemesi", "bitirmek için tıkla")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Baskının devam ", "etmesi için bekle")); + #else // LCD_HEIGHT < 4 + // Up to 2 lines allowed + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Sürdürmek İçin Tıkla")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Lütfen bekleyiniz...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Yükle ve bas")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Isıtmak için Tıkla")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Isınıyor...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Çıkartılıyor...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Yüklüyor...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Temizleniyor...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Bitirmek için Tıkla")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Sürdürülüyor...")); + #endif // LCD_HEIGHT < 4 +} diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 90ecf5c6937b..a81778f8c540 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -30,212 +30,220 @@ */ #define DISPLAY_CHARSET_ISO10646_5 -#define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" готовий.") -#define MSG_SD_INSERTED _UxGT("Картка вставлена") -#define MSG_SD_REMOVED _UxGT("Картка видалена") -#define MSG_LCD_ENDSTOPS _UxGT("Кінцевик") // Max length 8 characters -#define MSG_MAIN _UxGT("Меню") -#define MSG_AUTOSTART _UxGT("Автостарт") -#define MSG_DISABLE_STEPPERS _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_LEVEL_BED_HOMING _UxGT("Паркування XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Почати") -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Слідуюча Точка") -#define MSG_LEVEL_BED_DONE _UxGT("Завершено!") -#define MSG_SET_HOME_OFFSETS _UxGT("Зберегти паркув.") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Зміщення застос.") -#define MSG_SET_ORIGIN _UxGT("Встанов. початок") -#define MSG_PREHEAT_1 _UxGT("Нагрів " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL 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("Нагрів " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL 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_EXTRUDE _UxGT("Екструзія") -#define MSG_RETRACT _UxGT("Втягування") -#define MSG_MOVE_AXIS _UxGT("Рух по осям") -#define MSG_BED_LEVELING _UxGT("Нівелювання столу") -#define MSG_LEVEL_BED _UxGT("Нівелювання столу") -#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_0025MM _UxGT("Рух по 0.025mm") -#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_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_AUTOTEMP _UxGT("Автотемпер.") -#define MSG_LCD_ON _UxGT("Увімк.") -#define MSG_LCD_OFF _UxGT("Вимк.") -#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("Вибрати") -#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_VE_JERK _UxGT("Ve-ривок") -#define MSG_VMAX _UxGT("Vмакс") -#define MSG_VMIN _UxGT("Vмін") -#define MSG_VTRAV_MIN _UxGT("Vруху мін") -#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_E6STEPS _UxGT("E6кроків/мм") -#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_CONTRAST _UxGT("контраст LCD") -#define MSG_STORE_EEPROM _UxGT("Зберегти в ПЗП") -#define MSG_LOAD_EEPROM _UxGT("Зчитати з ПЗП") -#define MSG_RESTORE_FAILSAFE _UxGT("Відновити базові") -#define MSG_REFRESH _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_DWELL _UxGT("Сплячка...") -#define MSG_USERWAIT _UxGT("Очікування дій...") -#define MSG_PRINT_ABORTED _UxGT("Друк скасовано") -#define MSG_NO_MOVE _UxGT("Немає руху.") -#define MSG_KILLED _UxGT("ПЕРЕРВАНО. ") -#define MSG_STOPPED _UxGT("ЗУПИНЕНО. ") -#define MSG_FILAMENTCHANGE _UxGT("Зміна волокна") -#define MSG_INIT_SDCARD _UxGT("Старт SD картки") -#define MSG_CHANGE_SDCARD _UxGT("Заміна SD карти") -#define MSG_ZPROBE_OUT _UxGT("Z дет. не в межах") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Само-Тест") -#define MSG_BLTOUCH_RESET _UxGT("Скинути BLTouch") -#define MSG_HOME _UxGT("Дім") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("перший") -#define MSG_ZPROBE_ZOFFSET _UxGT("Зміщення Z") -#define MSG_BABYSTEP_X _UxGT("Мікрокрок X") -#define MSG_BABYSTEP_Y _UxGT("Мікрокрок Y") -#define MSG_BABYSTEP_Z _UxGT("Мікрокрок Z") -#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_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_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("Калібр. Центру") +namespace Language_uk { + using namespace Language_en; // Inherit undefined strings from English -#define MSG_INFO_MENU _UxGT("Про принтер") -#define MSG_INFO_PRINTER_MENU _UxGT("Інформація") -#define MSG_INFO_STATS_MENU _UxGT("Статистика") -#define MSG_INFO_BOARD_MENU _UxGT("Про плату") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Термістори") -#define MSG_INFO_EXTRUDERS _UxGT("Екструдери") -#define MSG_INFO_BAUDRATE _UxGT("біт/с") -#define MSG_INFO_PROTOCOL _UxGT("Протокол") -#define MSG_CASE_LIGHT _UxGT("Підсвітка") + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Ukranian"); -#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_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_FILAMENT _UxGT("Ексдруд.") -#endif + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" готовий."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Картка вставлена"); + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Картка видалена"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Кінцевик"); // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("Меню"); + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Автостарт"); + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Вимк. двигуни"); + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Авто паркування"); + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Паркування X"); + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Паркування Y"); + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Паркування Z"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Паркування XYZ"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Почати"); + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Слідуюча Точка"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Завершено!"); + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Зберегти паркув."); + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Зміщення застос."); + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Встанов. початок"); + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Нагрів ") PREHEAT_1_LABEL; + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Нагрів ") PREHEAT_1_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" Сопло"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" Сопло ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" Все"); + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" Стіл"); + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Нагрів ") PREHEAT_1_LABEL _UxGT(" нал."); + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Нагрів ") PREHEAT_2_LABEL; + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Нагрів ") PREHEAT_2_LABEL " ~"; + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" Сопло"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" Сопло ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" Все"); + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" Стіл"); + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Нагрів ") PREHEAT_2_LABEL _UxGT(" нал."); + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Охолодження"); + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Увімкнути живлення"); + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Вимкнути живлення"); + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Екструзія"); + PROGMEM Language_Str MSG_RETRACT = _UxGT("Втягування"); + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Рух по осям"); + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Нівелювання столу"); + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Нівелювання столу"); + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Рух по X"); + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Рух по Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Рух по Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Екструдер"); + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Екструдер *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("Рух по %smm"); + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Рух по 0.1mm"); + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Рух по 1mm"); + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Рух по 10mm"); + PROGMEM Language_Str MSG_SPEED = _UxGT("Швидкість"); + PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Столу"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Сопло"); + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Сопло ~"); + PROGMEM Language_Str MSG_BED = _UxGT("Стіл"); + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Охолодж."); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Охолодж. ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("Потік"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Потік ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Налаштування"); + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Мін"); + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Макс"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Факт"); + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Автотемпер."); + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Увімк."); + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Вимк."); + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Вибрати"); + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Вибрати *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Приск."); + PROGMEM Language_Str MSG_JERK = _UxGT("Ривок"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("V") LCD_STR_A _UxGT("-ривок"); + PROGMEM Language_Str MSG_VB_JERK = _UxGT("V") LCD_STR_B _UxGT("-ривок"); + PROGMEM Language_Str MSG_VC_JERK = _UxGT("V") LCD_STR_C _UxGT("-ривок"); + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Ve-ривок"); + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vмакс") LCD_STR_A; + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vмакс") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vмакс") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vмакс") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vмакс *"); + PROGMEM Language_Str MSG_VMIN = _UxGT("Vмін"); + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vруху мін"); + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Aмакс ") LCD_STR_A; + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Aмакс ") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Aмакс ") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Aмакс ") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Aмакс *"); + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("A-втягув."); + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("A-руху"); + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Кроків/мм"); + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("кроків/мм"); + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("кроків/мм"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("кроків/мм"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("Eкроків/мм"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("*кроків/мм"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Температура"); + PROGMEM Language_Str MSG_MOTION = _UxGT("Рух"); + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Волокно"); + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм³"); + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Діам. волок."); + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Діам. волок. *"); + PROGMEM Language_Str MSG_CONTRAST = _UxGT("контраст LCD"); + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Зберегти в ПЗП"); + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Зчитати з ПЗП"); + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Відновити базові"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Поновити"); + PROGMEM Language_Str MSG_WATCH = _UxGT("Інформація"); + PROGMEM Language_Str MSG_PREPARE = _UxGT("Підготувати"); + PROGMEM Language_Str MSG_TUNE = _UxGT("Підлаштування"); + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Призупинити друк"); + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Відновити друк"); + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Скасувати друк"); + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("Друкувати з SD"); + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Відсутня SD карт."); + PROGMEM Language_Str MSG_DWELL = _UxGT("Сплячка..."); + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Очікування дій..."); + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Друк скасовано"); + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Немає руху."); + PROGMEM Language_Str MSG_KILLED = _UxGT("ПЕРЕРВАНО. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("ЗУПИНЕНО. "); + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Зміна волокна"); + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Зміна волокна *"); + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Старт SD картки"); + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Заміна SD карти"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z дет. не в межах"); + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Само-Тест"); + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Скинути BLTouch"); + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Дім %s%s%s перший"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Зміщення Z"); + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Мікрокрок X"); + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Мікрокрок Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Мікрокрок Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("невдача кінцевика"); + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Невдалий нагрів"); + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("ЗБІЙ ТЕМПЕРАТУРИ"); + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Дім XY перший"); + PROGMEM Language_Str MSG_HALTED = _UxGT("ПРИНТЕР ЗУПИНЕНО"); + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Перезавантажте"); + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("д"); // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("г"); // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("х"); // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Нагрівання..."); + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Нагрівання столу..."); + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Калібр. Delta"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Калібрування X"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Калібрування Y"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Калібрування Z"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калібр. Центру"); -#define MSG_INFO_MIN_TEMP _UxGT("Мін Темп.") -#define MSG_INFO_MAX_TEMP _UxGT("Макс Темп.") -#define MSG_INFO_PSU _UxGT("Джерело жив.") + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Про принтер"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Інформація"); + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Статистика"); + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Про плату"); + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Термістори"); + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Екструдери"); + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("біт/с"); + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Протокол"); + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Підсвітка"); -#define MSG_DRIVE_STRENGTH _UxGT("Сила мотору") -#define MSG_DAC_PERCENT _UxGT("% мотору") -#define MSG_DAC_EEPROM_WRITE _UxGT("Запис ЦАП на ПЗП") + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("Неправильний принтер"); -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Відновити друк") + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("К-сть друків"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Весь час друку"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Найдовший час"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Екструдовано"); + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Друків"); + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Загалом"); + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Найдовший"); + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Ексдруд."); + #endif -#if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #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_LOAD_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("ввід волокна") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Зачекайте на") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("відновлення") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("друку") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #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_LOAD_1 _UxGT("Ввід...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Відновлення...") -#endif // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Мін Темп."); + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Макс Темп."); + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Джерело жив."); + + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Сила мотору"); + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X % мотору"); + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y % мотору"); + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z % мотору"); + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E % мотору"); + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Запис ЦАП на ПЗП"); + + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Відновити друк"); + + #if LCD_HEIGHT >= 4 + // Up to 3 lines allowed + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Зачекайте на", "початок заміни", "волокна")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Зачекайте на", "вивід волокна")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Вставте волокно", "та натисніть для", "продовження...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Зачекайте на", "ввід волокна")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_3_LINE("Зачекайте на", "відновлення", "друку")); + #else + // Up to 2 lines allowed + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Зачекайте...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Вивід...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Вставте і нат.")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Ввід...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Відновлення...")); + #endif +} diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h new file mode 100644 index 000000000000..344826efa6c4 --- /dev/null +++ b/Marlin/src/lcd/language/language_vi.h @@ -0,0 +1,452 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Vietnamese + * + * LCD Menu Messages + * See also http://marlinfw.org/docs/development/lcd_language.html + * + */ +namespace Language_vi { + using namespace Language_en; // Inherit undefined strings from English + + constexpr uint8_t CHARSIZE = 2; + PROGMEM Language_Str LANGUAGE = _UxGT("Vietnamese"); + + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT(" Sẵn sàng."); // Ready + PROGMEM Language_Str MSG_BACK = _UxGT("Trở lại"); // Back + PROGMEM Language_Str MSG_MEDIA_ABORTING = _UxGT("Đang hủy bỏ..."); + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("Phương tiện được cắm vào"); // Media inserted + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("Phương tiện được rút ra"); + PROGMEM Language_Str MSG_MEDIA_RELEASED = _UxGT("Phương tiện đã phát hành"); + PROGMEM Language_Str MSG_MEDIA_WAITING = _UxGT("Chờ đợi phương tiện"); + PROGMEM Language_Str MSG_MEDIA_READ_ERROR = _UxGT("Lỗi đọc phương tiện"); + PROGMEM Language_Str MSG_MEDIA_USB_REMOVED = _UxGT("USB được rút ra"); + PROGMEM Language_Str MSG_MEDIA_USB_FAILED = _UxGT("USB khởi thất bại"); + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("Công tắc"); // Endstops - công tắc hành trình + PROGMEM Language_Str MSG_LCD_SOFT_ENDSTOPS = _UxGT("Công tắc mềm"); // soft Endstops + PROGMEM Language_Str MSG_MAIN = _UxGT("Chính"); // Main + PROGMEM Language_Str MSG_ADVANCED_SETTINGS = _UxGT("Thiết lập cấp cao"); // Advanced Settings + PROGMEM Language_Str MSG_CONFIGURATION = _UxGT("Cấu hình"); // Configuration + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("Khởi chạy tự động"); // Autostart + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("Tắt động cơ bước"); // Disable steppers + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("Menu gỡ lỗi"); // Debug Menu + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("Kiểm tra tiến độ"); // Progress bar test + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("Về nhà tự động"); // Auto home + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("Về nhà X"); // home x + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Về nhà Y"); // home y + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Về nhà Z"); + PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Chỉnh canh Z tự động"); + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Đang về nhà XYZ"); // Homing XYZ + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Nhấn để bắt đầu"); // Click to Begin + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Điểm tiếp theo"); // Next Point + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("San lấp được hoàn thành"); // Leveling Done! + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Chiều cao mờ dần"); // Fade Height + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Đặt bù đắp nhà"); // Set home offsets + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Bù đắp được áp dụng"); // Offsets applied + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("Đặt nguồn gốc"); // Set origin + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" trước"); // Preheat + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" trước ~"); // Preheat + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Đầu"); + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Đầu ~"); + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Tất cả"); // all + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Bàn"); // bed -- using vietnamese term for 'table' instead + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" Cấu hình"); // conf + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" trước"); // Preheat + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" trước ~"); // Preheat + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Đầu"); + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Đầu ~"); + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Tất cả"); // all + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Bàn"); // bed -- using vietnamese term for 'table' instead + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("Làm nóng ") PREHEAT_2_LABEL _UxGT(" Cấu hình"); // conf + PROGMEM Language_Str MSG_PREHEAT_CUSTOM = _UxGT("Sự nóng trước tự chọn"); // Preheat Custom + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("Nguội xuống"); // Cooldown + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Bật nguồn"); // Switch power on + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Tắt nguồn"); // Switch power off + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Ép đùn"); // Extrude + PROGMEM Language_Str MSG_RETRACT = _UxGT("Rút lại"); // Retract + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Di chuyển trục"); // Move axis + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("San Lấp Bàn"); // Bed Leveling + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Làm bằng mặt bàn"); // Level bed + PROGMEM Language_Str MSG_LEVEL_CORNERS = _UxGT("Làm bằng góc bàn"); // Level corners + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("Góc tiếp theo"); // Next corner + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("Chỉnh lưới đã dừng"); // Mesh Editing Stopped + PROGMEM Language_Str MSG_MESH_X = _UxGT("Mục lục X"); // Index X + PROGMEM Language_Str MSG_MESH_Y = _UxGT("Mục lục Y"); + PROGMEM Language_Str MSG_MESH_EDIT_Z = _UxGT("Giá trị Z"); // Z Value + PROGMEM Language_Str MSG_USER_MENU = _UxGT("Các lệnh tự chọn"); // Custom Commands + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("Đang chạy G29"); // Doing G29 + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("Công cụ UBL"); // UBL tools + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("San Lấp Bàn Thống Nhất (UBL)"); // Unified Bed Leveling + PROGMEM Language_Str MSG_IDEX_MENU = _UxGT("chế độ IDEX"); // IDEX Mode + PROGMEM Language_Str MSG_IDEX_MODE_AUTOPARK = _UxGT("Đậu tự động"); // Auto-Park + PROGMEM Language_Str MSG_IDEX_MODE_DUPLICATE = _UxGT("Sự gấp đôi"); // Duplication + PROGMEM Language_Str MSG_IDEX_MODE_SCALED_COPY = _UxGT("Bản sao thu nhỏ"); + PROGMEM Language_Str MSG_IDEX_MODE_FULL_CTRL = _UxGT("Toàn quyền điều khiển"); // Full control + PROGMEM Language_Str MSG_IDEX_X_OFFSET = _UxGT("Đầu phun X nhì"); // 2nd nozzle X + PROGMEM Language_Str MSG_IDEX_Y_OFFSET = _UxGT("Đầu phun Y nhì"); + PROGMEM Language_Str MSG_IDEX_Z_OFFSET = _UxGT("Đầu phun Z nhì"); + PROGMEM Language_Str MSG_IDEX_SAVE_OFFSETS = _UxGT("Lưu bù đắp"); // Save offsets + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("Tự xây dựng lưới"); // Manually Build Mesh + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("Đặt chêm và đo"); // Place shim & measure + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("Đo"); // Measure + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("Tháo và đo bàn"); // Remove & measure bed + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("Chuyển sang tiếp theo"); // moving to next + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("Bật UBL"); + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("Tắt UBL"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("Nhiệt độ bàn"); // Bed Temp + PROGMEM Language_Str MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Bed Temp"); + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("Nhiệt độ đầu phun"); // Hotend Temp + PROGMEM Language_Str MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Hotend Temp"); + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("Chỉnh sửa lưới"); // Mesh Edit + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Chỉnh sửa lưới tự chọn"); // Edit Custom Mesh + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("Chỉnh lưới chính xác"); // Fine tuning mesh + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("Chỉnh sửa xong lưới"); // Done Editing Mesh + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Xây dựng lưới tự chọn"); // Build Custom Mesh + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("Xây dựng lưới"); // Build Mesh + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("Xây dựng lưới (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("Xây dựng lưới (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("Xây dựng lưới lạnh"); // Build cold mesh + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Điều chỉnh chiều cao lưới"); // Adjust Mesh Height + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Số lượng chiều cao"); // Height Amount + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Thẩm tra lưới"); // Validate Mesh + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("Thẩm tra lưới (") PREHEAT_1_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("Thẩm tra lưới (") PREHEAT_2_LABEL _UxGT(")"); + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Thẩm tra lưới tự chọn"); // validate custom mesh + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("Tiếp tục xây lưới bàn"); // Continue Bed Mesh + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("Đang san lấp lưới"); // Mesh Leveling + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Đang san lấp 3-điểm"); // 3-Point Leveling + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("Đang san lấp lưới phẳng"); // Grid (planar) Mesh Leveling + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("Làm bằng lưới"); // Level Mesh + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Điểm bên cạnh"); // Side Points + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Loại bản đồ"); // Map Type + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Đầu ra bản đồ lưới"); // Output Mesh Map + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Đầu ra cho máy chủ"); // Output for Host + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Đầu ra cho CSV"); // Output for CSV + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Hỗ trợ lưới"); // Off Printer Backup | backup mesh + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Đầu ra thông tin UBL"); // Output UBL Info + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("Chỉnh sửa lưới"); // Edit mesh + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Số lượng lấp đầy"); // Fill-in Amount + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Tự lấp đầy"); // Manual Fill-in + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Lấp đầy thông minh"); // Smart Fill-in + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("Lưới lấp đầy"); // Fill-in Mesh + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("Bác bỏ tất cả"); // Invalidate All + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Bác bỏ gần nhất"); // Invalidate Closest + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("Chỉnh chính xác tất cả"); // Fine Tune ALl + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Chỉnh chính xác gần nhất"); // Fine Tune Closest + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("Lưu trữ lưới"); // Mesh Storage + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("Khe nhớ"); // Memory Slot + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("Tải lưới bàn"); // Load Bed Mesh + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("Lưu lưới bàn"); // Save Bed Mesh + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 %i lưới được nạp"); // Mesh %i loaded + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 %i lưới đã lưu"); + PROGMEM Language_Str MSG_NO_STORAGE = _UxGT("Không lưu trữ"); // No Storage + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("Điều sai: Lưu UBL"); // Err: UBL Save + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("Điều Sai: Khôi Phục UBL"); // Err: UBL Restore + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Đầu Dò-Z Đã Ngừng"); // Z-Offset Stopped + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Bước-Từng-Bước UBL"); // Step-By-Step UBL + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Xây dựng lưới lạnh"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2.Lấp đầy thông minh"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Thẩm tra lưới"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Chỉnh chính xác tất cả"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Thẩm tra lưới"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Chỉnh chính xác tất cả"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7.Lưu lưới bàn"); + + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("Điều khiển LED"); // LED Control + PROGMEM Language_Str MSG_LEDS = _UxGT("Đèn"); // Lights + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("Đèn định sẵn"); // Light Presets + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("Đỏ"); // Red + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("Cam"); // Orange + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("Vàng"); // Yellow + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("Xanh Lá"); // Green + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("Xanh"); // Blue + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("Xanh Đậm"); // Indigo + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("Tím"); // Violet + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("Trắng"); // White + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("Mặc định"); // Default + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("Đèn Tự Chọn"); // Custom Lights + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("Cường Độ Đỏ"); // Red Intensity + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("Cường Độ Xanh Lá"); // Green Intensity + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("Cường Độ Xanh"); // Blue Intensity + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("Cường Độ Trắng"); // White Intensity + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("độ sáng"); // Brightness + + PROGMEM Language_Str MSG_MOVING = _UxGT("Di chuyển..."); // Moving + PROGMEM Language_Str MSG_FREE_XY = _UxGT("Giải phóng XY"); // Free XY + PROGMEM Language_Str MSG_MOVE_X = _UxGT("Di chuyển X"); // Move X + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("Di chuyển Y"); + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("Di chuyển Z"); + PROGMEM Language_Str MSG_MOVE_E = _UxGT("Máy đùn"); // Extruder + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("Máy đùn *"); // Extruder + PROGMEM Language_Str MSG_HOTEND_TOO_COLD = _UxGT("Đầu nóng quá lạnh"); // Hotend too cold + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("Di chuyển 0.1mm"); // Move 0.1mm + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("Di chuyển 1mm"); // Move 1mm + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("Di chuyển 10mm"); // Move 10mm + PROGMEM Language_Str MSG_SPEED = _UxGT("Tốc độ"); // Speed + PROGMEM Language_Str MSG_BED_Z = _UxGT("Z Bàn"); + PROGMEM Language_Str MSG_NOZZLE = _UxGT("Đầu phun"); // Nozzle + PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Đầu phun ~"); // Nozzle + PROGMEM Language_Str MSG_BED = _UxGT("Bàn"); // bed + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Tốc độ quạt"); // fan speed + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Tốc độ quạt ="); // fan speed + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Tốc độ quạt phụ"); // Extra fan speed + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Tốc độ quạt phụ ="); // Extra fan speed + PROGMEM Language_Str MSG_FLOW = _UxGT("Lưu Lượng"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("Lưu Lượng ~"); + PROGMEM Language_Str MSG_CONTROL = _UxGT("Điều khiển"); // Control + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" Đa"); // min + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Thiểu"); + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Hệ Số"); // factor + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Nhiệt độ tự động"); // Autotemp + PROGMEM Language_Str MSG_LCD_ON = _UxGT("Bật"); // on + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Tắt"); // off + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("Lựa"); // Select + PROGMEM Language_Str MSG_SELECT_E = _UxGT("Lựa *"); + PROGMEM Language_Str MSG_ACC = _UxGT("Tăng Tốc"); + PROGMEM Language_Str MSG_JERK = _UxGT("Giật"); + PROGMEM Language_Str MSG_VA_JERK = _UxGT("Giật-V") LCD_STR_A; + PROGMEM Language_Str MSG_VB_JERK = _UxGT("Giật-V") LCD_STR_B; + PROGMEM Language_Str MSG_VC_JERK = _UxGT("Giật-V") LCD_STR_C; + PROGMEM Language_Str MSG_VE_JERK = _UxGT("Giật-Ve"); + PROGMEM Language_Str MSG_JUNCTION_DEVIATION = _UxGT("Độ Lệch Chỗ Giao"); // Junction Dev + PROGMEM Language_Str MSG_VELOCITY = _UxGT("Vận tốc"); // velocity + PROGMEM Language_Str MSG_VMAX_A = _UxGT("Vđa") LCD_STR_A; // Vmax + PROGMEM Language_Str MSG_VMAX_B = _UxGT("Vđa") LCD_STR_B; // Vmax + PROGMEM Language_Str MSG_VMAX_C = _UxGT("Vđa") LCD_STR_C; // Vmax + PROGMEM Language_Str MSG_VMAX_E = _UxGT("Vđa") LCD_STR_E; // Vmax + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("Vđa *"); // Vmax + PROGMEM Language_Str MSG_VMIN = _UxGT("Vthiểu"); // Vmin + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("Vchuyển thiểu"); // VTrav min + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("Sự tăng tốc"); // Acceleration + PROGMEM Language_Str MSG_AMAX_A = _UxGT("Tăng tốc ca") LCD_STR_A; // Amax + PROGMEM Language_Str MSG_AMAX_B = _UxGT("Tăng tốc ca") LCD_STR_B; // Amax + PROGMEM Language_Str MSG_AMAX_C = _UxGT("Tăng tốc ca") LCD_STR_C; // Amax + PROGMEM Language_Str MSG_AMAX_E = _UxGT("Tăng tốc ca") LCD_STR_E; // Amax + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("Tăng tốc ca *"); // Amax + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("TT-Rút"); // A-retract + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("TT-Chuyển"); // A-travel + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("Bước/mm"); // Steps + PROGMEM Language_Str MSG_A_STEPS = _UxGT("Bước") LCD_STR_A _UxGT("/mm"); // Asteps/mm + PROGMEM Language_Str MSG_B_STEPS = _UxGT("Bước") LCD_STR_B _UxGT("/mm"); + PROGMEM Language_Str MSG_C_STEPS = _UxGT("Bước") LCD_STR_C _UxGT("/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("BướcE/mm"); + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("Bước */mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("Nhiệt độ"); // Temperature + PROGMEM Language_Str MSG_MOTION = _UxGT("Chuyển động"); // Motion + PROGMEM Language_Str MSG_FILAMENT = _UxGT("Vật liệu in"); // dây nhựa + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("E bằng mm³"); // E in mm + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("Đường kính nhựa"); // Fil. Dai. + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("Đường kính nhựa *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("Dỡ mm"); // unload mm + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("Nạp mm"); + PROGMEM Language_Str MSG_ADVANCE_K = _UxGT("K Cấp Cao"); // Advance K + PROGMEM Language_Str MSG_ADVANCE_K_E = _UxGT("K Cấp Cao *"); // Advance K + PROGMEM Language_Str MSG_CONTRAST = _UxGT("Độ tương phản LCD"); // LCD contrast + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Lưu các thiết lập"); // Store settings + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Tải các cài đặt"); // Load settings + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Khôi phục phòng hư"); // Restore failsafe + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Khởi Tạo EEPROM"); // Initialize EEPROM + PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Cập Nhật phương tiện"); // Update media + PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Bặt Lại Máy In"); + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Cập Nhật"); // Refresh + PROGMEM Language_Str MSG_WATCH = _UxGT("Màn Hình Thông Tin"); // Info screen + PROGMEM Language_Str MSG_PREPARE = _UxGT("Chuẩn bị"); // Prepare + PROGMEM Language_Str MSG_TUNE = _UxGT("Điều Chỉnh"); // Tune + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("Tạm dừng in"); // Pause print + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("Tiếp tục in"); // Resume print + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("Ngừng in"); // Stop print + PROGMEM Language_Str MSG_OUTAGE_RECOVERY = _UxGT("Phục Hồi Mất Điện"); // Outage Recovery + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("In từ phương tiện"); // Print from media + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("Không có phương tiện"); // No media + PROGMEM Language_Str MSG_DWELL = _UxGT("Ngủ..."); // Sleep + PROGMEM Language_Str MSG_USERWAIT = _UxGT("Nhấn để tiếp tục..."); // Click to resume (same as 'continue') + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("In tạm dừng"); // print paused + PROGMEM Language_Str MSG_PRINTING = _UxGT("Đang in..."); // printing + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("In đã hủy bỏ"); // Print aborted + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Không di chuyển."); // No move. + PROGMEM Language_Str MSG_KILLED = _UxGT("Đà CHẾT. "); + PROGMEM Language_Str MSG_STOPPED = _UxGT("Đà NGỪNG. "); + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Rút mm"); // Retract mm + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Rút Trao.mm"); // Swap Re.mm + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Rút V"); + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Nhảy mm"); // hop + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("BỏRút mm"); // UnRet mm + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("BỏRút T mm"); // S UnRet mm + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("BỏRút V"); // UnRet V + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("BỏRút T V"); // S UnRet V + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("RútTựĐộng"); // AutoRetr. + PROGMEM Language_Str MSG_FILAMENT_SWAP_LENGTH = _UxGT("Khoảng Cách Rút"); // Retract Distance + PROGMEM Language_Str MSG_TOOL_CHANGE = _UxGT("Thay Đổi Công Cụ"); // Tool Change + PROGMEM Language_Str MSG_TOOL_CHANGE_ZLIFT = _UxGT("Đưa Lên Z"); // Z Raise + PROGMEM Language_Str MSG_SINGLENOZZLE_PRIME_SPD = _UxGT("Tốc Độ Tuôn Ra"); // Prime Speed + PROGMEM Language_Str MSG_SINGLENOZZLE_RETRACT_SPD = _UxGT("Tốc Độ Rút Lại"); // Retract Speed + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Thay dây nhựa"); // change filament + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Thay dây nhựa *"); // change filament + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Nạp dây nhựa"); // load filament + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Nạp dây nhựa *"); // load filament + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Dỡ dây nhựa"); // unload filament + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Dỡ dây nhựa *"); // unload filament + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Dỡ tất cả"); // Unload All + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("Khởi tạo phương tiện"); // Init. media + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Thay phương tiện"); // Change midea + PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Phát hành phương tiện"); + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Đầu Dò Z qua bàn"); // Z Probe past bed + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("Hệ số nghiêng"); // Skew Factor + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTOUCH"); // BLTouch + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Tự kiểm tra BLTOUCH "); // BLTouch Self-Test + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Bặt lại BLTouch"); // Reset BLTouch + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Đem BLTouch"); // Deploy BLTouch + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cất BLTouch"); // Stow BLTouch + PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Đem Đầu Dò-Z"); // Deploy Z-Probe + PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Cất Đầu Dò-Z"); // Stow Z-Probe + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Về nhà %s%s%s Trước"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Đầu Dò Bù Đắp Z"); // Probe Z Offset + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Nhít X"); // Babystep X + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Nhít Y"); + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Nhít Z"); + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("Hủy bỏ công tắc"); // Endstop abort + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("Sưởi đầu phun không thành công"); // Heating failed + PROGMEM Language_Str MSG_HEATING_FAILED_LCD_BED = _UxGT("Sưởi bàn không thành công"); // Bed heating failed + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("Điều sai: nhiệt độ dư"); // Err: REDUNDANT TEMP + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("Vấn đề nhiệt"); // THERMAL RUNAWAY | problem + PROGMEM Language_Str MSG_THERMAL_RUNAWAY_BED = _UxGT("Vấn đề nhiệt bàn"); // BED THERMAL RUNAWAY + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("Điều sai: nhiệt độ tối đa"); // Err: MAXTEMP + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("Điều sai: nhiệt độ tối thiểu"); // Err: MINTEMP + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("Điều sai: nhiệt độ bàn tối đa"); // Err: MAXTEMP BED + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("Điều sai: nhiệt độ bàn tối thiểu"); // Err: MINTEMP BED + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("Về nhà XY Trước"); // Home XY First + PROGMEM Language_Str MSG_HALTED = _UxGT("MÁY IN Đà DỪNG LẠI"); // PRINTER HALTED + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("Xin bặt lại"); // Please reset + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("n"); // d - ngày - One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("g"); // h - giờ - One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("p"); // m - phút - One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("Đang sưởi nóng..."); // heating + PROGMEM Language_Str MSG_COOLING = _UxGT("Đang làm nguội..."); // cooling + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("Đang sưởi nong bàn..."); // bed heating + PROGMEM Language_Str MSG_BED_COOLING = _UxGT("Đang làm nguội bàn..."); // bed cooling + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("Cân Chỉnh Delta"); // Delta calibration + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("Chỉnh X lại"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("Chỉnh Y lại"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("Chỉnh Z lại"); + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("Chỉnh Z Center"); // Calibrate Center + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("Cài Đặt Delta"); // Delta Settings + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("Cân Chỉnh Tự Động"); // Auto Calibration + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Đặt Chiều Cao Delta"); // Set Delta Height + PROGMEM Language_Str MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Đầu Dò Z-Bù Đắp"); // Probe Z-offset + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("Gậy Chéo"); // Diag Rod + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("Chiều Cao"); // Height + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("Bán Kính"); // Radius + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("Về Máy In"); + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("Thông Tin Máy In"); // Printer Info + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("San lấp 3-Điểm"); // 3-Point Leveling + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("San Lấp Tuyến Tính"); // Linear Leveling + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("San Lấp Song Tuyến"); // Bilinear Leveling + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("San Lấp Bàn Thống Nhất"); // Unified Bed Leveling + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("Lưới San Lấp"); // Mesh Leveling + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("Thống Kê Máy In"); // Printer Stats + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("Thông Tin Bo Mạch"); // Board Info + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("Điện Trở Nhiệt"); // Thermistors + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("Máy đùn"); // Extruders + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("Baud"); // Baud + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("Giao Thức"); // Protocol + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("Đèn Khuông"); // Case light + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Độ Sáng"); // Light Brightness + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("Số In"); // Print Count + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Đã hoàn thành"); + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tổng số thời gian in"); // Total print time + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Thời gian việc lâu nhất"); // Longest job time + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Tổng số đùn"); // Extruded total + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("In"); // prints + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("Đã hoàn thành"); // Completed + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("Tổng số"); // total + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("Dài nhất"); // Longest + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("Đã ép đùn"); + #endif + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("Nhiệt độ tối thiểu"); // Min Temp + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("Nhiệt độ tối đa"); // Max temp + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("Bộ nguồn"); // PSU + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("Sức mạnh ổ đĩa"); // Drive Strength + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X % trình điều khiển"); // X Driver % + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y % trình điều khiển"); // Y Driver % + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z % trình điều khiển"); // Z Driver % + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E % trình điều khiển"); // E Driver % + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("Ghi DAC EEPROM"); // DAC EEPROM Write + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("In tạm dừng"); // PRINT PAUSED + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("Nạp dây nhựa"); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("Dỡ dây nhựa"); // unload filament + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("Tùy chọn hồi phục:"); // RESUME OPTIONS + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Xả thêm"); // Purge more + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Tiếp tục"); // continue + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Đầu Phun: "); // Nozzle + PROGMEM Language_Str MSG_RUNOUT_SENSOR_ENABLE = _UxGT("Cảm Biến Hết"); // Runout Sensor + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("Sự nhà không thành công"); // Homing failed + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT(" không thành công"); // Probing failed + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: Quá lạnh"); + + // + // 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 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_2_LINE("Nhấn nút", "để tiếp tục in")); // Press button to resume print + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("Chờ cho sự", "thay đổi dây nhựa", "bắt đầu")); // wait for filament change to start + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("Đút dây nhựa vào", "và nhấn nút", "để tiếp tục")); // insert filament and press button to continue // + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("Nhấn nút", "để làm nóng đầu phun")); // Press button to heat nozzle + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("Đầu phun đang nóng lên", "Xin chờ...")); // Nozzle heating Please wait + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("Chờ tro", "dây nhựa ra")); // Wait for filament unload + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("Chờ tro", "dây nhựa vào")); // Wait for filament load + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("Chờ tro", "xả dây nhựa")); // wait for filament purge + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_2_LINE("Nhấn nút để kết thúc", "xả dây nhựa")); // Click to finish dây nhựa purge + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("Chờ tro in", "tiếp tục...")); // Wait for print to resume + #else // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Nhấn nút để tiếp tục")); // Click to continue + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Xin chờ...")); + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("Chèn và nhấn")); // Insert and Click + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_1_LINE("Nhấn để sưởi")); // Click to heat + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("Đang sưởi nóng")); // Heating + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("Đang dỡ ra...")); // Ejecting + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("Đang nạp...")); // Loading + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Đang xả...")); // Purging + PROGMEM Language_Str MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Nhấn nút để kết thúc")); // Click to finish + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Đang tiếp tục...")); // Resuming + #endif // LCD_HEIGHT < 4 + + PROGMEM Language_Str MSG_TMC_DRIVERS = _UxGT("Trình điều khiển TMC"); // TMC drivers + PROGMEM Language_Str MSG_TMC_CURRENT = _UxGT("Dòng điện trình điều khiển"); // Driver current + PROGMEM Language_Str MSG_TMC_HYBRID_THRS = _UxGT("Ngưỡng Hỗn Hợp"); // Hybrid threshold + PROGMEM Language_Str MSG_TMC_HOMING_THRS = _UxGT("Vô cảm biến"); // Sensorless homing + PROGMEM Language_Str MSG_TMC_STEPPING_MODE = _UxGT("Chế độ từng bước"); // Stepping mode + PROGMEM Language_Str MSG_TMC_STEALTH_ENABLED = _UxGT("CắtTàngHình được kích hoạt"); // StealthChop enabled +} diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 93835a9dc1dd..8d13210623a0 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -28,358 +28,369 @@ * See also http://marlinfw.org/docs/development/lcd_language.html * */ +namespace Language_zh_CN { + using namespace Language_en; // Inherit undefined strings from English -#define CHARSIZE 3 + constexpr uint8_t CHARSIZE = 3; + PROGMEM Language_Str LANGUAGE = _UxGT("Simplified Chinese"); -#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_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" -#define MSG_PREHEAT_1 _UxGT("预热" PREHEAT_1_LABEL) //"Preheat PREHEAT_2_LABEL" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") //MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 全部") //MSG_PREHEAT_1 " All" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 热床") //MSG_PREHEAT_1 " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" 设置") //MSG_PREHEAT_1 " conf" -#define MSG_PREHEAT_2 _UxGT("预热" PREHEAT_2_LABEL) //"Preheat PREHEAT_2_LABEL" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") //MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 全部") //MSG_PREHEAT_2 " All" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" 热床") //MSG_PREHEAT_2 " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" 设置") //MSG_PREHEAT_2 " conf" -#define MSG_COOLDOWN _UxGT("降温") //"Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("电源打开") //"Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("电源关闭") //"Switch power off" -#define MSG_EXTRUDE _UxGT("挤出") //"Extrude" -#define MSG_RETRACT _UxGT("回抽") //"Retract" -#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" + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT("已就绪."); //" ready." + PROGMEM Language_Str MSG_BACK = _UxGT("返回"); // ”Back“ + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("存储卡已插入"); //"Card inserted" + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("存储卡被拔出"); //"Card removed" + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("挡块"); //"Endstops" // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("主菜单"); //"Main" + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("自动开始"); //"Autostart" + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("关闭步进电机"); //"Disable steppers" + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("调试菜单"); // "Debug Menu" + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("进度条测试"); // "Progress Bar Test" + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("回原点"); //"Auto home" + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("回X原位"); //"Home X" + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("回Y原位"); //"Home Y" + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("回Z原位"); //"Home Z" + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("平台调平XYZ归原位"); //"Homing XYZ" + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("单击开始热床调平"); //"Click to Begin" + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("下个热床调平点"); //"Next Point" + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("完成热床调平"); //"Leveling Done!" + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("淡出高度"); // "Fade Height" + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("设置原点偏移"); //"Set home offsets" + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("偏移已启用"); //"Offsets applied" + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("设置原点"); //"Set origin" + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("预热 ") PREHEAT_1_LABEL; //"Preheat PREHEAT_2_LABEL" + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("预热 ") PREHEAT_1_LABEL " ~"; //"Preheat PREHEAT_2_LABEL" + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 喷嘴"); //MSG_PREHEAT_1 " " + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 喷嘴 ~"); //MSG_PREHEAT_1 " " + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 全部"); //MSG_PREHEAT_1 " All" + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 热床"); //MSG_PREHEAT_1 " Bed" + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("预热 ") PREHEAT_1_LABEL _UxGT(" 设置"); //MSG_PREHEAT_1 " conf" + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("预热 ") PREHEAT_2_LABEL; //"Preheat PREHEAT_2_LABEL" + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("预热 ") PREHEAT_2_LABEL " ~"; //"Preheat PREHEAT_2_LABEL" + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 喷嘴"); //MSG_PREHEAT_2 " " + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 喷嘴 ~"); //MSG_PREHEAT_2 " " + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 全部"); //MSG_PREHEAT_2 " All" + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 热床"); //MSG_PREHEAT_2 " Bed" + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("预热 ") PREHEAT_2_LABEL _UxGT(" 设置"); //MSG_PREHEAT_2 " conf" + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("降温"); //"Cooldown" + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("电源打开"); //"Switch power on" + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("电源关闭"); //"Switch power off" + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("挤出"); //"Extrude" + PROGMEM Language_Str MSG_RETRACT = _UxGT("回抽"); //"Retract" + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("移动轴"); //"Move axis" + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("调平热床"); //"Bed leveling" + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("调平热床"); //"Level bed" + PROGMEM Language_Str 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" + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("下个边角"); // "Next corner" + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("编辑网格"); // "Edit Mesh" + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("网格编辑已停止"); // "Mesh Editing Stopped" + PROGMEM Language_Str 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" + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("执行G29"); // "Doing G29" + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL工具"); // "UBL Tools" + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("统一热床调平(UBL)"); // "Unified Bed Leveling" + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("手工创设网格"); // "Manually Build Mesh" + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("放置垫片并测量"); // "Place shim & measure" + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("测量"); // "Measure" + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("移除并测量热床"); // "Remove & measure bed" + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("移动到下一个"); // "Moving to next" + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("激活UBL"); // "Activate UBL" + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("关闭UBL"); // "Deactivate UBL" + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("设置热床温度"); // "Bed Temp" + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("热端温度"); // "Hotend Temp" + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("网格编辑"); // "Mesh Edit" + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("编辑客户网格"); // "Edit Custom Mesh" + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("细调网格"); // "Fine Tuning Mesh" + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("完成编辑网格"); // "Done Editing Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("创设客户网格"); // "Build Custom Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("创设网格"); // "Build Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("创设 ") PREHEAT_1_LABEL _UxGT(" 网格"); // "Build PREHEAT_1_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("创设 ") PREHEAT_2_LABEL _UxGT(" 网格"); // "Build PREHEAT_2_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("创设冷网格"); // "Build Cold Mesh" + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("调整网格高度"); // "Adjust Mesh Height" + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("高度合计"); // "Height Amount" + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("批准网格"); // "Validate Mesh" + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("批准 ") PREHEAT_1_LABEL _UxGT(" 网格"); // "Validate PREHEAT_1_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("批准 ") PREHEAT_2_LABEL _UxGT(" 网格"); // "Validate PREHEAT_2_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("批准客户网格"); // "Validate Custom Mesh" + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("继续热床网格"); // "Continue Bed Mesh" + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("网格调平"); // "Mesh Leveling" + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("三点调平"); // "3-Point Leveling" + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("格子网格调平"); // "Grid Mesh Leveling" + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("调平网格"); // "Level Mesh" + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("边点"); // "Side Points" + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("图类型"); // "Map Type" + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("输出网格图"); // "Output Mesh Map" + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("输出到主机"); // "Output for Host" + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("输出到CSV"); // "Output for CSV" + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("输出到备份"); // "Off Printer Backup" + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("输出UBL信息"); // "Output UBL Info" + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("填充合计"); // "Fill-in Amount" + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("手工填充"); // "Manual Fill-in" + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("聪明填充"); // "Smart Fill-in" + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("填充网格"); // "Fill-in Mesh" + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("作废所有的"); // "Invalidate All" + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("作废最近的"); // "Invalidate Closest" + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("细调所有的"); // "Fine Tune All" + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("细调最近的"); // "Fine Tune Closest" + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("网格存储"); // "Mesh Storage" + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("存储槽"); // "Memory Slot" + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("装载热床网格"); // "Load Bed Mesh" + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("保存热床网格"); // "Save Bed Mesh" + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 网格 %i 已装载"); // "Mesh %i loaded" + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 网格 %i 已保存"); // "Mesh %i saved" + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("没有存储"); // "No storage" + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("错误: UBL保存"); // "Err: UBL Save" + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("错误: UBL还原"); // "Err: UBL Restore" + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z偏移已停止"); // "Z-Offset Stopped" + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("一步步UBL"); // "Step-By-Step UBL" + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. 创设冷网格"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. 聪明填充"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. 批准网格"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. 细调所有的"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. 批准网格"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. 细调所有的"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. 保存热床网格"); -#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_TEMP_BED _UxGT("设置热床温度") // "Bed Temp" -#define MSG_UBL_SET_TEMP_HOTEND _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_MESH_M1 _UxGT("创设" PREHEAT_1_LABEL "网格") // "Build PREHEAT_1_LABEL Mesh" -#define MSG_UBL_BUILD_MESH_M2 _UxGT("创设" PREHEAT_2_LABEL "网格") // "Build PREHEAT_2_LABEL 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_MESH_M1 _UxGT("批准" PREHEAT_1_LABEL "网格") // "Validate PREHEAT_1_LABEL Mesh" -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("批准" PREHEAT_2_LABEL "网格") // "Validate PREHEAT_2_LABEL 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_EDIT_MESH _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" + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("灯管控制"); // "LED Control") + PROGMEM Language_Str MSG_LEDS = _UxGT("灯"); // "Lights") + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("灯预置"); // "Light Presets") + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("红"); // "Red") + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("橙"); // "Orange") + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("黄"); // "Yellow") + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("绿"); // "Green") + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("蓝"); // "Blue") + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("青"); // "Indigo") + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("紫"); // "Violet") + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("白"); // "White") + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("缺省"); // "Default") + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("定制灯"); // "Custom Lights") + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("红饱和度"); // "Red Intensity") + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("绿饱和度"); // "Green Intensity") + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("蓝饱和度"); // "Blue Intensity") + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("白饱和度"); // "White Intensity") + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("亮度"); // "Brightness") -#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") + PROGMEM Language_Str MSG_MOVING = _UxGT("移动 ..."); // "Moving...") + PROGMEM Language_Str MSG_FREE_XY = _UxGT("释放 XY"); // "Free XY") + PROGMEM Language_Str MSG_MOVE_X = _UxGT("移动X"); //"Move X" + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("移动Y"); //"Move Y" + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("移动Z"); //"Move Z" + PROGMEM Language_Str MSG_MOVE_E = _UxGT("挤出机"); //"Extruder" + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("挤出机 *"); //"Extruder" + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("移动 %s mm"); //"Move 0.025mm" + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("移动 0.1 mm"); //"Move 0.1mm" + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("移动 1 mm"); //"Move 1mm" + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("移动 10 mm"); //"Move 10mm" + PROGMEM Language_Str MSG_SPEED = _UxGT("速率"); //"Speed" + PROGMEM Language_Str MSG_BED_Z = _UxGT("热床Z"); //"Bed Z" + PROGMEM Language_Str MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" 喷嘴"); //"Nozzle" 噴嘴 + PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" 喷嘴 ~"); //"Nozzle" 噴嘴 + PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 热床"); //"Bed" + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("风扇速率"); //"Fan speed" + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("风扇速率 ="); //"Fan speed" + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("额外风扇速率"); // "Extra fan speed" + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("额外风扇速率 ="); // "Extra fan speed" + PROGMEM Language_Str MSG_FLOW = _UxGT("挤出速率"); //"Flow" + PROGMEM Language_Str MSG_FLOW_N = _UxGT("挤出速率 ~"); //"Flow" + PROGMEM Language_Str MSG_CONTROL = _UxGT("控制"); //"Control" + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" 最小"); //" " LCD_STR_THERMOMETER " Min" + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" 最大"); //" " LCD_STR_THERMOMETER " Max" + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" 因数"); //" " LCD_STR_THERMOMETER " Fact" + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("自动控温"); //"Autotemp" + PROGMEM Language_Str MSG_LCD_ON = _UxGT("开"); //"On" + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("关"); //"Off" + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); //"PID-P" + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); //"PID-I" + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); //"PID-D" + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); //"PID-C" + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("选择"); //"Select" + PROGMEM Language_Str MSG_SELECT_E = _UxGT("选择 *"); + PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration + PROGMEM Language_Str MSG_JERK = _UxGT("抖动速率"); // "Jerk" + PROGMEM Language_Str MSG_VA_JERK = _UxGT("轴抖动速率") LCD_STR_A; //"Va-jerk" + PROGMEM Language_Str MSG_VB_JERK = _UxGT("轴抖动速率") LCD_STR_B; //"Vb-jerk" + PROGMEM Language_Str MSG_VC_JERK = _UxGT("轴抖动速率") LCD_STR_C; //"Vc-jerk" + PROGMEM Language_Str MSG_VE_JERK = _UxGT("挤出机抖动速率"); //"Ve-jerk" + PROGMEM Language_Str MSG_VELOCITY = _UxGT("速度"); // "Velocity" + PROGMEM Language_Str MSG_VMAX_A = _UxGT("最大进料速率") LCD_STR_A; //"Vmax " max_feedrate_mm_s + PROGMEM Language_Str MSG_VMAX_B = _UxGT("最大进料速率") LCD_STR_B; //"Vmax " max_feedrate_mm_s + PROGMEM Language_Str MSG_VMAX_C = _UxGT("最大进料速率") LCD_STR_C; //"Vmax " max_feedrate_mm_s + PROGMEM Language_Str MSG_VMAX_E = _UxGT("最大进料速率") LCD_STR_E; //"Vmax " max_feedrate_mm_s + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("最大进料速率 *"); //"Vmax " max_feedrate_mm_s + PROGMEM Language_Str MSG_VMIN = _UxGT("最小进料速率"); //"Vmin" min_feedrate_mm_s + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("最小移动速率"); //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("加速度"); // "Acceleration" + PROGMEM Language_Str MSG_AMAX_A = _UxGT("最大打印加速度") LCD_STR_A; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves + PROGMEM Language_Str MSG_AMAX_B = _UxGT("最大打印加速度") LCD_STR_B; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves + PROGMEM Language_Str MSG_AMAX_C = _UxGT("最大打印加速度") LCD_STR_C; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves + PROGMEM Language_Str MSG_AMAX_E = _UxGT("最大打印加速度") LCD_STR_E; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("最大打印加速度 *"); //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("收进加速度"); //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("非打印移动加速度"); //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("轴步数/mm"); //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("轴步数/mm"); //"Asteps/mm" + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("轴步数/mm"); //"Bsteps/mm" + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("轴步数/mm"); //"Csteps/mm" + PROGMEM Language_Str MSG_E_STEPS = _UxGT("挤出机步数/mm"); //"Esteps/mm" + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("挤出机~步数/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("温度"); //"Temperature" + PROGMEM Language_Str MSG_MOTION = _UxGT("运动"); //"Motion" + PROGMEM Language_Str MSG_FILAMENT = _UxGT("丝料测容"); //"Filament" menu_advanced_filament + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("测容积mm³"); //"E in mm3" volumetric_enabled + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("丝料直径"); //"Fil. Dia." + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("丝料直径 *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("卸载 mm"); // "Unload mm" + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("装载 mm"); // "Load mm" + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD对比度"); //"LCD contrast" + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("保存设置"); //"Store memory" + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("装载设置"); //"Load memory" + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("恢复安全值"); //"Restore failsafe" + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("初始化设置"); // "Initialize EEPROM" + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("刷新"); //"Refresh" + PROGMEM Language_Str MSG_WATCH = _UxGT("信息屏"); //"Info screen" + PROGMEM Language_Str MSG_PREPARE = _UxGT("准备"); //"Prepare" + PROGMEM Language_Str MSG_TUNE = _UxGT("调整"); //"Tune" + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("暂停打印"); //"Pause print" + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("恢复打印"); //"Resume print" + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("停止打印"); //"Stop print" + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("从存储卡上打印"); //"Print from SD" + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("无存储卡"); //"No SD card" + PROGMEM Language_Str MSG_DWELL = _UxGT("休眠中 ..."); //"Sleep..." + PROGMEM Language_Str MSG_USERWAIT = _UxGT("点击继续 ..."); //"Click to resume..." + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("暫停打印"); // "Print paused" + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("已取消打印"); //"Print aborted" + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("无移动"); //"No move." + PROGMEM Language_Str MSG_KILLED = _UxGT("已杀掉"); //"KILLED. " + PROGMEM Language_Str MSG_STOPPED = _UxGT("已停止"); //"STOPPED. " + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("回抽长度mm"); //"Retract mm" retract_length, retract length (positive mm) + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("换手回抽长度mm"); //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("回抽速率mm/s"); //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); //"Hop mm" retract_zraise, retract Z-lift + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("回抽恢复长度mm"); //"UnRet +mm" retract_recover_extra, additional recover length (mm, added to retract length when recovering) + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("换手回抽恢复长度mm"); //"S UnRet+mm" swap_retract_recover_extra, additional swap recover length (mm, added to retract length when recovering from extruder change) + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("回抽恢复后进料速率mm/s"); //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); // "S UnRet V" + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("自动抽回"); //"AutoRetr." autoretract_enabled, + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("更换丝料"); //"Change filament" + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("更换丝料 *"); //"Change filament" + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("装载丝料"); // "Load filament" + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("装载丝料 *"); // "Load filament" + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("卸载丝料"); // "Unload filament" + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("卸载丝料 *"); // "Unload filament" + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("卸载全部"); // "Unload All" + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("初始化存储卡"); //"Init. SD card" + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("更换存储卡"); //"Change SD card" + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z探针在热床之外"); //"Z probe out. bed" Z probe is not within the physical limits + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("偏斜因数"); // "Skew Factor" + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); // "BLTouch" + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch 自检"); // "BLTouch Self-Test" + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("重置BLTouch"); // "Reset BLTouch" + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("部署BLTouch"); // "Deploy BLTouch" + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("装载BLTouch"); // "Stow BLTouch" + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("归位 %s%s%s 先"); //"Home ... first" + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z偏移"); //"Z Offset" + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("微量调整X轴"); //"Babystep X" lcd_babystep_x, Babystepping enables the user to control the axis in tiny amounts + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("微量调整Y轴"); //"Babystep Y" + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("微量调整Z轴"); //"Babystep Z" + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("挡块终止"); //"Endstop abort" + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("加热失败"); //"Heating failed" + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("错误:REDUNDANT TEMP"); //"Err: REDUNDANT TEMP" + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("温控失控"); //"THERMAL RUNAWAY" + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("错误:最高温度"); //"Err: MAXTEMP" + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("错误:最低温度"); //"Err: MINTEMP" + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("错误:最高热床温度"); //"Err: MAXTEMP BED" + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("错误:最低热床温度"); //"Err: MINTEMP BED" + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("归位 XY 先"); // "Home XY First" + PROGMEM Language_Str MSG_HALTED = _UxGT("打印停机"); //"PRINTER HALTED" + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("请重置"); //"Please reset" + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("天"); //"d" // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("时"); //"h" // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("分"); //"m" // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("加热中 ..."); //"Heating..." + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("加热热床中 ..."); //"Bed Heating..." + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("⊿校准"); //"Delta Calibration" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("⊿校准X"); //"Calibrate X" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("⊿校准Y"); //"Calibrate Y" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("⊿校准Z"); //"Calibrate Z" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("⊿校准中心"); //"Calibrate Center" + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("⊿设置"); // "Delta Settings" + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("⊿自动校准"); // "Auto Calibration" + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("设置⊿高度"); // "Set Delta Height" + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("⊿斜柱"); // "Diag Rod" + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("⊿高度"); // "Height" + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("⊿半径"); // "Radius" + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("关于打印机"); //"About Printer" + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("打印机信息"); //"Printer Info" + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("三点调平"); // "3-Point Leveling" + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("线性调平"); // "Linear Leveling" + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("双线性调平"); // "Bilinear Leveling" + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("统一热床调平(UBL)"); // "Unified Bed Leveling" + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("网格调平"); // "Mesh Leveling" + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("打印机统计"); //"Printer Stats" + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("主板信息"); //"Board Info" + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("温度计"); //"Thermistors" + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("挤出机"); //"Extruders" + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("波特率"); //"Baud" + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("协议"); //"Protocol" + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("外壳灯"); // "Case light" + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("灯亮度"); // "Light 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" -#define MSG_MOVE_E _UxGT("挤出机") //"Extruder" -#define MSG_MOVE_0025MM _UxGT("移动 0.025 mm") //"Move 0.025mm" -#define MSG_MOVE_01MM _UxGT("移动 0.1 mm") //"Move 0.1mm" -#define MSG_MOVE_1MM _UxGT("移动 1 mm") //"Move 1mm" -#define MSG_MOVE_10MM _UxGT("移动 10 mm") //"Move 10mm" -#define MSG_SPEED _UxGT("速率") //"Speed" -#define MSG_BED_Z _UxGT("热床Z") //"Bed Z" -#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" -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最大") //" " LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 因数") //" " LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP _UxGT("自动控温") //"Autotemp" -#define MSG_LCD_ON _UxGT("开") //"On" -#define MSG_LCD_OFF _UxGT("关") //"Off" -#define MSG_PID_P _UxGT("PID-P") //"PID-P" -#define MSG_PID_I _UxGT("PID-I") //"PID-I" -#define MSG_PID_D _UxGT("PID-D") //"PID-D" -#define MSG_PID_C _UxGT("PID-C") //"PID-C" -#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_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_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_E6STEPS _UxGT("挤出机6步数/mm") //"E6steps/mm" -#define MSG_TEMPERATURE _UxGT("温度") //"Temperature" -#define MSG_MOTION _UxGT("运动") //"Motion" -#define MSG_FILAMENT _UxGT("丝料测容") //"Filament" menu_advanced_filament -#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" -#define MSG_TUNE _UxGT("调整") //"Tune" -#define MSG_PAUSE_PRINT _UxGT("暂停打印") //"Pause print" -#define MSG_RESUME_PRINT _UxGT("恢复打印") //"Resume print" -#define MSG_STOP_PRINT _UxGT("停止打印") //"Stop print" -#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_NO_MOVE _UxGT("无移动") //"No move." -#define MSG_KILLED _UxGT("已杀掉") //"KILLED. " -#define MSG_STOPPED _UxGT("已停止") //"STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("回抽长度mm") //"Retract mm" retract_length, retract length (positive mm) -#define MSG_CONTROL_RETRACT_SWAP _UxGT("换手回抽长度mm") //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change -#define MSG_CONTROL_RETRACTF _UxGT("回抽速率mm/s") //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") //"Hop mm" retract_zraise, retract Z-lift -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("回抽恢复长度mm") //"UnRet +mm" retract_recover_extra, additional recover length (mm, added to retract length when recovering) -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("换手回抽恢复长度mm") //"S UnRet+mm" swap_retract_recover_extra, 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_CHANGE_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" -#define MSG_BABYSTEP_X _UxGT("微量调整X轴") //"Babystep X" lcd_babystep_x, Babystepping enables the user to control the axis in tiny amounts -#define MSG_BABYSTEP_Y _UxGT("微量调整Y轴") //"Babystep Y" -#define MSG_BABYSTEP_Z _UxGT("微量调整Z轴") //"Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("挡块终止") //"Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("加热失败") //"Heating failed" -#define MSG_ERR_REDUNDANT_TEMP _UxGT("错误:REDUNDANT TEMP") //"Err: REDUNDANT TEMP" -#define MSG_THERMAL_RUNAWAY _UxGT("温控失控") //"THERMAL RUNAWAY" -#define MSG_ERR_MAXTEMP _UxGT("错误:最高温度") //"Err: MAXTEMP" -#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_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_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" + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("打印机不正确"); // "The printer is incorrect" -#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 print time" - #define MSG_INFO_PRINT_LONGEST _UxGT("最长工作时间") //"Longest job time" - #define MSG_INFO_PRINT_FILAMENT _UxGT("总计挤出") //"Extruded total" -#else - #define MSG_INFO_PRINT_COUNT _UxGT("打印数") //"Prints" - #define MSG_INFO_COMPLETED_PRINTS _UxGT("完成") //"Completed" - #define MSG_INFO_PRINT_TIME _UxGT("总共") //"Total" - #define MSG_INFO_PRINT_LONGEST _UxGT("最长") //"Longest" - #define MSG_INFO_PRINT_FILAMENT _UxGT("已挤出") //"Extruded" -#endif + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("打印计数"); //"Print Count" + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("完成了"); //"Completed" + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("总打印时间"); //"Total print time" + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("最长工作时间"); //"Longest job time" + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("总计挤出"); //"Extruded total" + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("打印数"); //"Prints" + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("完成"); //"Completed" + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("总共"); //"Total" + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("最长"); //"Longest" + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("已挤出"); //"Extruded" + #endif -#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_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" + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("最低温度"); //"Min Temp" + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("最高温度"); //"Max Temp" + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("电源供应"); //"Power Supply" + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("驱动力度"); // "Drive Strength" + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X 驱动 %"); // "X Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y 驱动 %"); // "Y Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z 驱动 %"); // "Z Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E 驱动 %"); // "E Driver %" + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("保存驱动设置"); // "DAC EEPROM Write" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("打印已暂停"); // "PRINT PAUSED" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("装载丝料"); // "LOAD FILAMENT" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("卸载丝料"); // "UNLOAD FILAMENT" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("恢复选项:"); // "RESUME OPTIONS:" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("清除更多"); // "Purge more" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("恢复打印"); //"Resume print" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" 喷嘴: "); // " Nozzle: " + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("归原位失败"); // "Homing failed" + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("探针探测失败"); // "Probing failed" + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: 太凉"); // "M600: Too cold" -#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("请等待 ...") //"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_RESUME_1 _UxGT("恢复中 ...") //"Resuming..." -#endif // LCD_HEIGHT < 4 + #if LCD_HEIGHT >= 4 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("等待开始", "丝料", "变更")); // "Wait for start of the filament change" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("等待", "卸下丝料")); // "Wait for filament unload" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("插入丝料", "并按键", "来继续 ...")); // "Insert filament and press button to continue..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("按下按钮来", "加热喷嘴.")); // "Press button to heat nozzle." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("加热喷嘴", "请等待 ...")); // "Heating nozzle Please wait..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("等待", "进料")); // "Wait for filament load" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("等待", "丝料清除")); // "Wait for filament purge" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("等待打印", "恢复")); // "Wait for print to resume" + #else + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("请等待 ...")); //"Please wait..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("退出中 ...")); //"Ejecting..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("插入并单击")); //"Insert and Click" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("加热中 ...")); // "Heating..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("装载中 ...")); //"Loading..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("清除中 ...")); // "Purging..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("恢复中 ...")); //"Resuming..." + #endif +} diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 90ac8bd573ee..58c7dc705b50 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -28,358 +28,369 @@ * See also http://marlinfw.org/docs/development/lcd_language.html * */ +namespace Language_zh_TW { + using namespace Language_en; // Inherit undefined strings from English -#define CHARSIZE 3 + constexpr uint8_t CHARSIZE = 3; + PROGMEM Language_Str LANGUAGE = _UxGT("Traditional Chinese"); -#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_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" -#define MSG_PREHEAT_1 _UxGT("預熱" PREHEAT_1_LABEL) //"Preheat PREHEAT_1_LABEL" -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") //MSG_PREHEAT_1 " " -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 全部") //MSG_PREHEAT_1 " All" -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 熱床") //MSG_PREHEAT_1 " Bed" -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" 設置") //MSG_PREHEAT_1 " conf" -#define MSG_PREHEAT_2 _UxGT("預熱" PREHEAT_2_LABEL) //"Preheat PREHEAT_2_LABEL" -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") //MSG_PREHEAT_2 " " -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 全部") //MSG_PREHEAT_2 " All" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" 熱床") //MSG_PREHEAT_2 " Bed" -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" 設置") //MSG_PREHEAT_2 " conf" -#define MSG_COOLDOWN _UxGT("降溫") //"Cooldown" -#define MSG_SWITCH_PS_ON _UxGT("電源打開") //"Switch power on" -#define MSG_SWITCH_PS_OFF _UxGT("電源關閉") //"Switch power off" -#define MSG_EXTRUDE _UxGT("擠出") //"Extrude" -#define MSG_RETRACT _UxGT("回縮") //"Retract" -#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" + PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT("已就緒."); //" ready." + PROGMEM Language_Str MSG_BACK = _UxGT("返回"); // ”Back“ + PROGMEM Language_Str MSG_MEDIA_INSERTED = _UxGT("記憶卡已插入"); //"Card inserted" + PROGMEM Language_Str MSG_MEDIA_REMOVED = _UxGT("記憶卡被拔出"); //"Card removed" + PROGMEM Language_Str MSG_LCD_ENDSTOPS = _UxGT("擋塊"); //"Endstops" // Max length 8 characters + PROGMEM Language_Str MSG_MAIN = _UxGT("主選單"); //"Main" + PROGMEM Language_Str MSG_AUTOSTART = _UxGT("自動開始"); //"Autostart" + PROGMEM Language_Str MSG_DISABLE_STEPPERS = _UxGT("關閉步進馬達"); //"Disable steppers" + PROGMEM Language_Str MSG_DEBUG_MENU = _UxGT("除錯選單"); // "Debug Menu" + PROGMEM Language_Str MSG_PROGRESS_BAR_TEST = _UxGT("進度條測試"); // "Progress Bar Test" + PROGMEM Language_Str MSG_AUTO_HOME = _UxGT("自動回原點"); //"Auto home" + PROGMEM Language_Str MSG_AUTO_HOME_X = _UxGT("回X原點"); //"Home X" + PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("回Y原點"); //"Home Y" + PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("回Z原點"); //"Home Z" + PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("平台調平XYZ歸原點"); //"Homing XYZ" + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("單擊開始熱床調平"); //"Click to Begin" + PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("下個熱床調平點"); //"Next Point" + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("完成熱床調平"); //"Leveling Done!" + PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("淡出高度"); // "Fade Height" + PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("設置原點偏移"); //"Set home offsets" + PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("偏移已啟用"); //"Offsets applied" + PROGMEM Language_Str MSG_SET_ORIGIN = _UxGT("設置原點"); //"Set origin" + PROGMEM Language_Str MSG_PREHEAT_1 = _UxGT("預熱 ") PREHEAT_1_LABEL; //"Preheat PREHEAT_1_LABEL" + PROGMEM Language_Str MSG_PREHEAT_1_H = _UxGT("預熱 ") PREHEAT_1_LABEL " ~"; //"Preheat PREHEAT_1_LABEL" + PROGMEM Language_Str MSG_PREHEAT_1_END = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 噴嘴"); //MSG_PREHEAT_1 " " + PROGMEM Language_Str MSG_PREHEAT_1_END_E = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 噴嘴 ~"); //MSG_PREHEAT_1 " " + PROGMEM Language_Str MSG_PREHEAT_1_ALL = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 全部"); //MSG_PREHEAT_1 " All" + PROGMEM Language_Str MSG_PREHEAT_1_BEDONLY = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 熱床"); //MSG_PREHEAT_1 " Bed" + PROGMEM Language_Str MSG_PREHEAT_1_SETTINGS = _UxGT("預熱 ") PREHEAT_1_LABEL _UxGT(" 設置"); //MSG_PREHEAT_1 " conf" + PROGMEM Language_Str MSG_PREHEAT_2 = _UxGT("預熱 ") PREHEAT_2_LABEL; //"Preheat PREHEAT_2_LABEL" + PROGMEM Language_Str MSG_PREHEAT_2_H = _UxGT("預熱 ") PREHEAT_2_LABEL " ~"; //"Preheat PREHEAT_2_LABEL" + PROGMEM Language_Str MSG_PREHEAT_2_END = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 噴嘴"); //MSG_PREHEAT_2 " " + PROGMEM Language_Str MSG_PREHEAT_2_END_E = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 噴嘴 ~"); //MSG_PREHEAT_2 " " + PROGMEM Language_Str MSG_PREHEAT_2_ALL = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 全部"); //MSG_PREHEAT_2 " All" + PROGMEM Language_Str MSG_PREHEAT_2_BEDONLY = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 熱床"); //MSG_PREHEAT_2 " Bed" + PROGMEM Language_Str MSG_PREHEAT_2_SETTINGS = _UxGT("預熱 ") PREHEAT_2_LABEL _UxGT(" 設置"); //MSG_PREHEAT_2 " conf" + PROGMEM Language_Str MSG_COOLDOWN = _UxGT("降溫"); //"Cooldown" + PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("電源打開"); //"Switch power on" + PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("電源關閉"); //"Switch power off" + PROGMEM Language_Str MSG_EXTRUDE = _UxGT("擠出"); //"Extrude" + PROGMEM Language_Str MSG_RETRACT = _UxGT("回縮"); //"Retract" + PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("移動軸"); //"Move axis" + PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("調平熱床"); //"Bed leveling" + PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("調平熱床"); //"Level bed" + PROGMEM Language_Str 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" + PROGMEM Language_Str MSG_NEXT_CORNER = _UxGT("下個邊角"); // "Next corner" + PROGMEM Language_Str MSG_EDIT_MESH = _UxGT("編輯網格"); // "Edit Mesh" + PROGMEM Language_Str MSG_EDITING_STOPPED = _UxGT("網格編輯已停止"); // "Mesh Editing Stopped" + PROGMEM Language_Str 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" + PROGMEM Language_Str MSG_UBL_DOING_G29 = _UxGT("執行G29"); // "Doing G29" + PROGMEM Language_Str MSG_UBL_TOOLS = _UxGT("UBL工具"); // "UBL Tools" + PROGMEM Language_Str MSG_UBL_LEVEL_BED = _UxGT("統一熱床調平(UBL)"); // "Unified Bed Leveling" + PROGMEM Language_Str MSG_UBL_MANUAL_MESH = _UxGT("手工建網"); // "Manually Build Mesh" + PROGMEM Language_Str MSG_UBL_BC_INSERT = _UxGT("放置墊片並測量"); // "Place shim & measure" + PROGMEM Language_Str MSG_UBL_BC_INSERT2 = _UxGT("測量"); // "Measure" + PROGMEM Language_Str MSG_UBL_BC_REMOVE = _UxGT("移除並測量熱床"); // "Remove & measure bed" + PROGMEM Language_Str MSG_UBL_MOVING_TO_NEXT = _UxGT("移動到下一個"); // "Moving to next" + PROGMEM Language_Str MSG_UBL_ACTIVATE_MESH = _UxGT("啟動UBL"); // "Activate UBL" + PROGMEM Language_Str MSG_UBL_DEACTIVATE_MESH = _UxGT("關閉UBL"); // "Deactivate UBL" + PROGMEM Language_Str MSG_UBL_SET_TEMP_BED = _UxGT("設置熱床溫度"); // "Bed Temp" + PROGMEM Language_Str MSG_UBL_SET_TEMP_HOTEND = _UxGT("熱端溫度"); // "Hotend Temp" + PROGMEM Language_Str MSG_UBL_MESH_EDIT = _UxGT("網格編輯"); // "Mesh Edit" + PROGMEM Language_Str MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("編輯客戶網格"); // "Edit Custom Mesh" + PROGMEM Language_Str MSG_UBL_FINE_TUNE_MESH = _UxGT("細調網格"); // "Fine Tuning Mesh" + PROGMEM Language_Str MSG_UBL_DONE_EDITING_MESH = _UxGT("完成編輯網格"); // "Done Editing Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("創設客戶網格"); // "Build Custom Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_MESH_MENU = _UxGT("創設網格"); // "Build Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M1 = _UxGT("創設 ") PREHEAT_1_LABEL _UxGT(" 網格"); // "Build PREHEAT_1_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_MESH_M2 = _UxGT("創設 ") PREHEAT_2_LABEL _UxGT(" 網格"); // "Build PREHEAT_2_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_BUILD_COLD_MESH = _UxGT("創設冷網格"); // "Build Cold Mesh" + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("調整網格高度"); // "Adjust Mesh Height" + PROGMEM Language_Str MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("高度合計"); // "Height Amount" + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_MENU = _UxGT("批准網格"); // "Validate Mesh" + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M1 = _UxGT("批准 ") PREHEAT_1_LABEL _UxGT(" 網格"); // "Validate PREHEAT_1_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_VALIDATE_MESH_M2 = _UxGT("批准 ") PREHEAT_2_LABEL _UxGT(" 網格"); // "Validate PREHEAT_2_LABEL Mesh" + PROGMEM Language_Str MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("批准客戶網格"); // "Validate Custom Mesh" + PROGMEM Language_Str MSG_UBL_CONTINUE_MESH = _UxGT("繼續熱床網格"); // "Continue Bed Mesh" + PROGMEM Language_Str MSG_UBL_MESH_LEVELING = _UxGT("網格調平"); // "Mesh Leveling" + PROGMEM Language_Str MSG_UBL_3POINT_MESH_LEVELING = _UxGT("三點調平"); // "3-Point Leveling" + PROGMEM Language_Str MSG_UBL_GRID_MESH_LEVELING = _UxGT("格子網格調平"); // "Grid Mesh Leveling" + PROGMEM Language_Str MSG_UBL_MESH_LEVEL = _UxGT("調平網格"); // "Level Mesh" + PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("邊點"); // "Side Points" + PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("圖類型"); // "Map Type" + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("輸出網格圖"); // "Output Mesh Map" + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("輸出到主機"); // "Output for Host" + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("輸出到CSV"); // "Output for CSV" + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("輸出到備份"); // "Off Printer Backup" + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("輸出UBL信息"); // "Output UBL Info" + PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("填充合計"); // "Fill-in Amount" + PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("手工填充"); // "Manual Fill-in" + PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("聰明填充"); // "Smart Fill-in" + PROGMEM Language_Str MSG_UBL_FILLIN_MESH = _UxGT("填充網格"); // "Fill-in Mesh" + PROGMEM Language_Str MSG_UBL_INVALIDATE_ALL = _UxGT("作廢所有的"); // "Invalidate All" + PROGMEM Language_Str MSG_UBL_INVALIDATE_CLOSEST = _UxGT("作廢最近的"); // "Invalidate Closest" + PROGMEM Language_Str MSG_UBL_FINE_TUNE_ALL = _UxGT("細調所有的"); // "Fine Tune All" + PROGMEM Language_Str MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("細調最近的"); // "Fine Tune Closest" + PROGMEM Language_Str MSG_UBL_STORAGE_MESH_MENU = _UxGT("網格存儲"); // "Mesh Storage" + PROGMEM Language_Str MSG_UBL_STORAGE_SLOT = _UxGT("存儲槽"); // "Memory Slot" + PROGMEM Language_Str MSG_UBL_LOAD_MESH = _UxGT("裝載熱床網格"); // "Load Bed Mesh" + PROGMEM Language_Str MSG_UBL_SAVE_MESH = _UxGT("保存熱床網格"); // "Save Bed Mesh" + PROGMEM Language_Str MSG_MESH_LOADED = _UxGT("M117 網格 %i 已裝載"); // "Mesh %i loaded" + PROGMEM Language_Str MSG_MESH_SAVED = _UxGT("M117 網格 %i 已保存"); // "Mesh %i saved" + PROGMEM Language_Str MSG_UBL_NO_STORAGE = _UxGT("沒有存儲"); // "No storage" + PROGMEM Language_Str MSG_UBL_SAVE_ERROR = _UxGT("錯誤: UBL保存"); // "Err: UBL Save" + PROGMEM Language_Str MSG_UBL_RESTORE_ERROR = _UxGT("錯誤: UBL還原"); // "Err: UBL Restore" + PROGMEM Language_Str MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z偏移已停止"); // "Z-Offset Stopped" + PROGMEM Language_Str MSG_UBL_STEP_BY_STEP_MENU = _UxGT("一步步UBL"); // "Step-By-Step UBL" + PROGMEM Language_Str MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1. 創設冷網格"); + PROGMEM Language_Str MSG_UBL_2_SMART_FILLIN = _UxGT("2. 聰明填充"); + PROGMEM Language_Str MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3. 批准網格"); + PROGMEM Language_Str MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4. 細調所有的"); + PROGMEM Language_Str MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5. 批准網格"); + PROGMEM Language_Str MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6. 細調所有的"); + PROGMEM Language_Str MSG_UBL_7_SAVE_MESH = _UxGT("7. 保存熱床網格"); -#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_TEMP_BED _UxGT("設置熱床溫度") // "Bed Temp" -#define MSG_UBL_SET_TEMP_HOTEND _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_MESH_M1 _UxGT("創設" PREHEAT_1_LABEL "網格") // "Build PREHEAT_1_LABEL Mesh" -#define MSG_UBL_BUILD_MESH_M2 _UxGT("創設" PREHEAT_2_LABEL "網格") // "Build PREHEAT_2_LABEL 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_MESH_M1 _UxGT("批准" PREHEAT_1_LABEL "網格") // "Validate PREHEAT_1_LABEL Mesh" -#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("批准" PREHEAT_2_LABEL "網格") // "Validate PREHEAT_2_LABEL 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_EDIT_MESH _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" + PROGMEM Language_Str MSG_LED_CONTROL = _UxGT("燈管控制"); // "LED Control") + PROGMEM Language_Str MSG_LEDS = _UxGT("燈"); // "Lights") + PROGMEM Language_Str MSG_LED_PRESETS = _UxGT("燈預置"); // "Light Presets") + PROGMEM Language_Str MSG_SET_LEDS_RED = _UxGT("红"); // "Red") + PROGMEM Language_Str MSG_SET_LEDS_ORANGE = _UxGT("橙"); // "Orange") + PROGMEM Language_Str MSG_SET_LEDS_YELLOW = _UxGT("黃"); // "Yellow") + PROGMEM Language_Str MSG_SET_LEDS_GREEN = _UxGT("綠"); // "Green") + PROGMEM Language_Str MSG_SET_LEDS_BLUE = _UxGT("藍"); // "Blue") + PROGMEM Language_Str MSG_SET_LEDS_INDIGO = _UxGT("青"); // "Indigo") + PROGMEM Language_Str MSG_SET_LEDS_VIOLET = _UxGT("紫"); // "Violet") + PROGMEM Language_Str MSG_SET_LEDS_WHITE = _UxGT("白"); // "White") + PROGMEM Language_Str MSG_SET_LEDS_DEFAULT = _UxGT("缺省"); // "Default") + PROGMEM Language_Str MSG_CUSTOM_LEDS = _UxGT("定制燈"); // "Custom Lights") + PROGMEM Language_Str MSG_INTENSITY_R = _UxGT("紅飽和度"); // "Red Intensity") + PROGMEM Language_Str MSG_INTENSITY_G = _UxGT("綠飽和度"); // "Green Intensity") + PROGMEM Language_Str MSG_INTENSITY_B = _UxGT("藍飽和度"); // "Blue Intensity") + PROGMEM Language_Str MSG_INTENSITY_W = _UxGT("白飽和度"); // "White Intensity") + PROGMEM Language_Str MSG_LED_BRIGHTNESS = _UxGT("亮度"); // "Brightness") -#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") + PROGMEM Language_Str MSG_MOVING = _UxGT("移動 ..."); // "Moving...") + PROGMEM Language_Str MSG_FREE_XY = _UxGT("釋放 XY"); // "Free XY") + PROGMEM Language_Str MSG_MOVE_X = _UxGT("移動X"); //"Move X" + PROGMEM Language_Str MSG_MOVE_Y = _UxGT("移動Y"); //"Move Y" + PROGMEM Language_Str MSG_MOVE_Z = _UxGT("移動Z"); //"Move Z" + PROGMEM Language_Str MSG_MOVE_E = _UxGT("擠出機"); //"Extruder" + PROGMEM Language_Str MSG_MOVE_EN = _UxGT("擠出機 *"); + PROGMEM Language_Str MSG_MOVE_Z_DIST = _UxGT("移動 %s mm"); //"Move 0.025mm" + PROGMEM Language_Str MSG_MOVE_01MM = _UxGT("移動 0.1 mm"); //"Move 0.1mm" + PROGMEM Language_Str MSG_MOVE_1MM = _UxGT("移動 1 mm"); //"Move 1mm" + PROGMEM Language_Str MSG_MOVE_10MM = _UxGT("移動 10 mm"); //"Move 10mm" + PROGMEM Language_Str MSG_SPEED = _UxGT("速率"); //"Speed" + PROGMEM Language_Str MSG_BED_Z = _UxGT("熱床Z"); //"Bed Z" + PROGMEM Language_Str MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴"); //"Nozzle" 噴嘴 + PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴 ~"); + PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 熱床"); //"Bed" + PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("風扇速率"); //"Fan speed" + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("風扇速率 ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("額外風扇速率"); // "Extra fan speed" + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("額外風扇速率 ="); + PROGMEM Language_Str MSG_FLOW = _UxGT("擠出速率"); + PROGMEM Language_Str MSG_FLOW_N = _UxGT("擠出速率 ~"); //"Flow" + PROGMEM Language_Str MSG_CONTROL = _UxGT("控制"); //"Control" + PROGMEM Language_Str MSG_MIN = " " LCD_STR_THERMOMETER _UxGT(" 最小"); //" " LCD_STR_THERMOMETER " Min" + PROGMEM Language_Str MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" 最大"); //" " LCD_STR_THERMOMETER " Max" + PROGMEM Language_Str MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" 系數"); //" " LCD_STR_THERMOMETER " Fact" + PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("自動控溫"); //"Autotemp" + PROGMEM Language_Str MSG_LCD_ON = _UxGT("開"); //"On" + PROGMEM Language_Str MSG_LCD_OFF = _UxGT("關"); //"Off" + PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); //"PID-P" + PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); + PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); //"PID-I" + PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); + PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); //"PID-D" + PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); + PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); //"PID-C" + PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_SELECT = _UxGT("選擇"); //"Select" + PROGMEM Language_Str MSG_SELECT_E = _UxGT("選擇 *"); + PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration + PROGMEM Language_Str MSG_JERK = _UxGT("抖動速率"); //"Jerk" + PROGMEM Language_Str MSG_VA_JERK = _UxGT("軸抖動速率") LCD_STR_A; //"Va-jerk" + PROGMEM Language_Str MSG_VB_JERK = _UxGT("軸抖動速率") LCD_STR_B; //"Vb-jerk" + PROGMEM Language_Str MSG_VC_JERK = _UxGT("軸抖動速率") LCD_STR_C; //"Vc-jerk" + PROGMEM Language_Str MSG_VE_JERK = _UxGT("擠出機抖動速率"); //"Ve-jerk" + PROGMEM Language_Str MSG_VELOCITY = _UxGT("速度"); // "Velocity" + PROGMEM Language_Str MSG_VMAX_A = _UxGT("最大進料速率") LCD_STR_A; //"Vmax " max_feedrate_mm_s + PROGMEM Language_Str MSG_VMAX_B = _UxGT("最大進料速率") LCD_STR_B; + PROGMEM Language_Str MSG_VMAX_C = _UxGT("最大進料速率") LCD_STR_C; + PROGMEM Language_Str MSG_VMAX_E = _UxGT("最大進料速率") LCD_STR_E; + PROGMEM Language_Str MSG_VMAX_EN = _UxGT("最大進料速率 *"); //"Vmax " max_feedrate_mm_s + PROGMEM Language_Str MSG_VMIN = _UxGT("最小進料速率"); //"Vmin" min_feedrate_mm_s + PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("最小移動速率"); //"VTrav min" min_travel_feedrate_mm_s, (target) speed of the move + PROGMEM Language_Str MSG_ACCELERATION = _UxGT("加速度"); // "Acceleration" + PROGMEM Language_Str MSG_AMAX_A = _UxGT("最大列印加速度") LCD_STR_A; //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves + PROGMEM Language_Str MSG_AMAX_B = _UxGT("最大列印加速度") LCD_STR_B; + PROGMEM Language_Str MSG_AMAX_C = _UxGT("最大列印加速度") LCD_STR_C; + PROGMEM Language_Str MSG_AMAX_E = _UxGT("最大列印加速度") LCD_STR_E; + PROGMEM Language_Str MSG_AMAX_EN = _UxGT("最大列印加速度 *"); //"Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves + PROGMEM Language_Str MSG_A_RETRACT = _UxGT("回縮加速度"); //"A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts + PROGMEM Language_Str MSG_A_TRAVEL = _UxGT("非列印移動加速度"); //"A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + PROGMEM Language_Str MSG_STEPS_PER_MM = _UxGT("軸步數/mm"); //"Steps/mm" axis_steps_per_mm, axis steps-per-unit G92 + PROGMEM Language_Str MSG_A_STEPS = LCD_STR_A _UxGT("軸步數/mm"); //"Asteps/mm" axis_steps_per_mm, axis steps-per-unit G92 + PROGMEM Language_Str MSG_B_STEPS = LCD_STR_B _UxGT("軸步數/mm"); + PROGMEM Language_Str MSG_C_STEPS = LCD_STR_C _UxGT("軸步數/mm"); + PROGMEM Language_Str MSG_E_STEPS = _UxGT("擠出機步數/mm"); //"Esteps/mm" + PROGMEM Language_Str MSG_EN_STEPS = _UxGT("擠出機~步數/mm"); + PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("溫度"); //"Temperature" + PROGMEM Language_Str MSG_MOTION = _UxGT("運作"); //"Motion" + PROGMEM Language_Str MSG_FILAMENT = _UxGT("絲料測容"); //"Filament" menu_control_volumetric + PROGMEM Language_Str MSG_VOLUMETRIC_ENABLED = _UxGT("測容積mm³"); //"E in mm3" volumetric_enabled + PROGMEM Language_Str MSG_FILAMENT_DIAM = _UxGT("絲料直徑"); //"Fil. Dia." + PROGMEM Language_Str MSG_FILAMENT_DIAM_E = _UxGT("絲料直徑 *"); + PROGMEM Language_Str MSG_FILAMENT_UNLOAD = _UxGT("卸載 mm"); // "Unload mm" + PROGMEM Language_Str MSG_FILAMENT_LOAD = _UxGT("装載 mm"); // "Load mm" + PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD對比度"); //"LCD contrast" + PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("保存設置"); //"Store memory" + PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("載入設置"); //"Load memory" + PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("恢復安全值"); //"Restore failsafe" + PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("初始化設置"); // "Initialize EEPROM" + PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("刷新"); //"Refresh" + PROGMEM Language_Str MSG_WATCH = _UxGT("資訊界面"); //"Info screen" + PROGMEM Language_Str MSG_PREPARE = _UxGT("準備"); //"Prepare" + PROGMEM Language_Str MSG_TUNE = _UxGT("調整"); //"Tune" + PROGMEM Language_Str MSG_PAUSE_PRINT = _UxGT("暫停列印"); //"Pause print" + PROGMEM Language_Str MSG_RESUME_PRINT = _UxGT("恢復列印"); //"Resume print" + PROGMEM Language_Str MSG_STOP_PRINT = _UxGT("停止列印"); //"Stop print" + PROGMEM Language_Str MSG_MEDIA_MENU = _UxGT("從記憶卡上列印"); //"Print from SD" + PROGMEM Language_Str MSG_NO_MEDIA = _UxGT("無記憶卡"); //"No SD card" + PROGMEM Language_Str MSG_DWELL = _UxGT("休眠 ..."); //"Sleep..." + PROGMEM Language_Str MSG_USERWAIT = _UxGT("點擊繼續 ..."); //"Click to resume..." + PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("列印已暫停"); // "Print paused" + PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("已取消列印"); //"Print aborted" + PROGMEM Language_Str MSG_NO_MOVE = _UxGT("無移動"); //"No move." + PROGMEM Language_Str MSG_KILLED = _UxGT("已砍掉"); //"KILLED. " + PROGMEM Language_Str MSG_STOPPED = _UxGT("已停止"); //"STOPPED. " + PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("回縮長度mm"); //"Retract mm" retract_length, retract length (positive mm) + PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("換手回抽長度mm"); //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change + PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("回縮速率mm/s"); //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) + PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Hop mm"); //"Hop mm" retract_zraise, retract Z-lift + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER = _UxGT("回縮恢復長度mm"); //"UnRet +mm" retract_recover_extra, additional recover length (mm, added to retract length when recovering) + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("換手回縮恢復長度mm"); //"S UnRet+mm" swap_retract_recover_extra, additional swap recover length (mm, added to retract length when recovering from extruder change) + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVERF = _UxGT("回縮恢復後進料速率mm/s"); //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) + PROGMEM Language_Str MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("S UnRet V"); // "S UnRet V" + PROGMEM Language_Str MSG_AUTORETRACT = _UxGT("自動回縮"); //"AutoRetr." autoretract_enabled, + PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("更換絲料"); //"Change filament" + PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("更換絲料 *"); + PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("裝載絲料"); // "Load filament" + PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("裝載絲料 *"); + PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("卸載絲料"); // "Unload filament" + PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("卸載絲料 *"); // "Unload filament" + PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("卸載全部"); // "Unload All" + PROGMEM Language_Str MSG_INIT_MEDIA = _UxGT("初始化記憶卡"); //"Init. SD card" + PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("更換記憶卡"); //"Change SD card" + PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z探針在熱床之外"); //"Z probe out. bed" Z probe is not within the physical limits + PROGMEM Language_Str MSG_SKEW_FACTOR = _UxGT("偏斜因數"); // "Skew Factor" + PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); // "BLTouch" + PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch 自檢"); // "BLTouch Self-Test" + PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("重置BLTouch"); // "Reset BLTouch" + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("部署BLTouch"); // "Deploy BLTouch" + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("裝載BLTouch"); // "Stow BLTouch" + PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("歸位 %s%s%s 先"); //"Home ... first" + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z偏移"); //"Z Offset" + PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("微量調整X軸"); //"Babystep X" lcd_babystep_x, Babystepping enables the user to control the axis in tiny amounts + PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("微量調整Y軸"); //"Babystep Y" + PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("微量調整Z軸"); //"Babystep Z" + PROGMEM Language_Str MSG_ENDSTOP_ABORT = _UxGT("擋塊終止"); //"Endstop abort" + PROGMEM Language_Str MSG_HEATING_FAILED_LCD = _UxGT("加熱失敗"); //"Heating failed" + PROGMEM Language_Str MSG_ERR_REDUNDANT_TEMP = _UxGT("錯誤:REDUNDANT TEMP"); //"Err: REDUNDANT TEMP" + PROGMEM Language_Str MSG_THERMAL_RUNAWAY = _UxGT("溫控失控"); //"THERMAL RUNAWAY" + PROGMEM Language_Str MSG_ERR_MAXTEMP = _UxGT("錯誤:最高溫度"); //"Err: MAXTEMP" + PROGMEM Language_Str MSG_ERR_MINTEMP = _UxGT("錯誤:最低溫度"); //"Err: MINTEMP" + PROGMEM Language_Str MSG_ERR_MAXTEMP_BED = _UxGT("錯誤:最高熱床溫度"); //"Err: MAXTEMP BED" + PROGMEM Language_Str MSG_ERR_MINTEMP_BED = _UxGT("錯誤:最低熱床溫度"); //"Err: MINTEMP BED" + PROGMEM Language_Str MSG_ERR_Z_HOMING = _UxGT("歸位 XY 先"); //"Home XY First" + PROGMEM Language_Str MSG_HALTED = _UxGT("印表機停機"); //"PRINTER HALTED" + PROGMEM Language_Str MSG_PLEASE_RESET = _UxGT("請重置"); //"Please reset" + PROGMEM Language_Str MSG_SHORT_DAY = _UxGT("天"); //"d" // One character only + PROGMEM Language_Str MSG_SHORT_HOUR = _UxGT("時"); //"h" // One character only + PROGMEM Language_Str MSG_SHORT_MINUTE = _UxGT("分"); //"m" // One character only + PROGMEM Language_Str MSG_HEATING = _UxGT("加熱中 ..."); //"Heating..." + PROGMEM Language_Str MSG_BED_HEATING = _UxGT("加熱熱床中 ..."); //"Bed Heating..." + PROGMEM Language_Str MSG_DELTA_CALIBRATE = _UxGT("⊿校準"); //"Delta Calibration" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_X = _UxGT("⊿校準X"); //"Calibrate X" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Y = _UxGT("⊿校準Y"); //"Calibrate Y" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_Z = _UxGT("⊿校準Z"); //"Calibrate Z" + PROGMEM Language_Str MSG_DELTA_CALIBRATE_CENTER = _UxGT("⊿校準中心"); //"Calibrate Center" + PROGMEM Language_Str MSG_DELTA_SETTINGS = _UxGT("⊿設置"); // "Delta Settings" + PROGMEM Language_Str MSG_DELTA_AUTO_CALIBRATE = _UxGT("⊿自動校準"); // "Auto Calibration" + PROGMEM Language_Str MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("設置⊿高度"); // "Set Delta Height" + PROGMEM Language_Str MSG_DELTA_DIAG_ROD = _UxGT("⊿斜柱"); // "Diag Rod" + PROGMEM Language_Str MSG_DELTA_HEIGHT = _UxGT("⊿高度"); // "Height" + PROGMEM Language_Str MSG_DELTA_RADIUS = _UxGT("⊿半徑"); // "Radius" + PROGMEM Language_Str MSG_INFO_MENU = _UxGT("關於印表機"); //"About Printer" + PROGMEM Language_Str MSG_INFO_PRINTER_MENU = _UxGT("印表機訊息"); //"Printer Info" + PROGMEM Language_Str MSG_3POINT_LEVELING = _UxGT("三點調平"); // "3-Point Leveling" + PROGMEM Language_Str MSG_LINEAR_LEVELING = _UxGT("線性調平"); // "Linear Leveling" + PROGMEM Language_Str MSG_BILINEAR_LEVELING = _UxGT("雙線性調平"); // "Bilinear Leveling" + PROGMEM Language_Str MSG_UBL_LEVELING = _UxGT("統一熱床調平(UBL)"); // "Unified Bed Leveling" + PROGMEM Language_Str MSG_MESH_LEVELING = _UxGT("網格調平"); // "Mesh Leveling" + PROGMEM Language_Str MSG_INFO_STATS_MENU = _UxGT("印表機統計"); //"Printer Stats" + PROGMEM Language_Str MSG_INFO_BOARD_MENU = _UxGT("主板訊息"); //"Board Info" + PROGMEM Language_Str MSG_INFO_THERMISTOR_MENU = _UxGT("溫度計"); //"Thermistors" + PROGMEM Language_Str MSG_INFO_EXTRUDERS = _UxGT("擠出機"); //"Extruders" + PROGMEM Language_Str MSG_INFO_BAUDRATE = _UxGT("傳輸率"); //"Baud" + PROGMEM Language_Str MSG_INFO_PROTOCOL = _UxGT("協議"); //"Protocol" + PROGMEM Language_Str MSG_CASE_LIGHT = _UxGT("外殼燈"); // "Case light" + PROGMEM Language_Str MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("燈亮度"); // "Light 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" -#define MSG_MOVE_E _UxGT("擠出機") //"Extruder" -#define MSG_MOVE_0025MM _UxGT("移動 0.025 mm") //"Move 0.025mm" -#define MSG_MOVE_01MM _UxGT("移動 0.1 mm") //"Move 0.1mm" -#define MSG_MOVE_1MM _UxGT("移動 1 mm") //"Move 1mm" -#define MSG_MOVE_10MM _UxGT("移動 10 mm") //"Move 10mm" -#define MSG_SPEED _UxGT("速率") //"Speed" -#define MSG_BED_Z _UxGT("熱床Z") //"Bed Z" -#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" -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最大") //" " LCD_STR_THERMOMETER " Max" -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 系數") //" " LCD_STR_THERMOMETER " Fact" -#define MSG_AUTOTEMP _UxGT("自動控溫") //"Autotemp" -#define MSG_LCD_ON _UxGT("開") //"On" -#define MSG_LCD_OFF _UxGT("關") //"Off" -#define MSG_PID_P _UxGT("PID-P") //"PID-P" -#define MSG_PID_I _UxGT("PID-I") //"PID-I" -#define MSG_PID_D _UxGT("PID-D") //"PID-D" -#define MSG_PID_C _UxGT("PID-C") //"PID-C" -#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_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_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_E6STEPS _UxGT("擠出機6步數/mm") //"E6steps/mm" -#define MSG_TEMPERATURE _UxGT("溫度") //"Temperature" -#define MSG_MOTION _UxGT("運作") //"Motion" -#define MSG_FILAMENT _UxGT("絲料測容") //"Filament" menu_control_volumetric -#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" -#define MSG_TUNE _UxGT("調整") //"Tune" -#define MSG_PAUSE_PRINT _UxGT("暫停列印") //"Pause print" -#define MSG_RESUME_PRINT _UxGT("恢復列印") //"Resume print" -#define MSG_STOP_PRINT _UxGT("停止列印") //"Stop print" -#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_NO_MOVE _UxGT("無移動") //"No move." -#define MSG_KILLED _UxGT("已砍掉") //"KILLED. " -#define MSG_STOPPED _UxGT("已停止") //"STOPPED. " -#define MSG_CONTROL_RETRACT _UxGT("回縮長度mm") //"Retract mm" retract_length, retract length (positive mm) -#define MSG_CONTROL_RETRACT_SWAP _UxGT("換手回抽長度mm") //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change -#define MSG_CONTROL_RETRACTF _UxGT("回縮速率mm/s") //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") //"Hop mm" retract_zraise, retract Z-lift -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("回縮恢復長度mm") //"UnRet +mm" retract_recover_extra, additional recover length (mm, added to retract length when recovering) -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("換手回縮恢復長度mm") //"S UnRet+mm" swap_retract_recover_extra, 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_CHANGE_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" -#define MSG_BABYSTEP_X _UxGT("微量調整X軸") //"Babystep X" lcd_babystep_x, Babystepping enables the user to control the axis in tiny amounts -#define MSG_BABYSTEP_Y _UxGT("微量調整Y軸") //"Babystep Y" -#define MSG_BABYSTEP_Z _UxGT("微量調整Z軸") //"Babystep Z" -#define MSG_ENDSTOP_ABORT _UxGT("擋塊終止") //"Endstop abort" -#define MSG_HEATING_FAILED_LCD _UxGT("加熱失敗") //"Heating failed" -#define MSG_ERR_REDUNDANT_TEMP _UxGT("錯誤:REDUNDANT TEMP") //"Err: REDUNDANT TEMP" -#define MSG_THERMAL_RUNAWAY _UxGT("溫控失控") //"THERMAL RUNAWAY" -#define MSG_ERR_MAXTEMP _UxGT("錯誤:最高溫度") //"Err: MAXTEMP" -#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_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_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" + PROGMEM Language_Str MSG_EXPECTED_PRINTER = _UxGT("打印機不正確"); // "The printer is incorrect" -#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 print time" - #define MSG_INFO_PRINT_LONGEST _UxGT("最長工作時間") //"Longest job time" - #define MSG_INFO_PRINT_FILAMENT _UxGT("總計擠出") //"Extruded total" -#else - #define MSG_INFO_PRINT_COUNT _UxGT("列印數") //"Prints" - #define MSG_INFO_COMPLETED_PRINTS _UxGT("完成") //"Completed" - #define MSG_INFO_PRINT_TIME _UxGT("總共") //"Total" - #define MSG_INFO_PRINT_LONGEST _UxGT("最長") //"Longest" - #define MSG_INFO_PRINT_FILAMENT _UxGT("已擠出") //"Extruded" -#endif + #if LCD_WIDTH >= 20 + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("列印計數"); //"Print Count" + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("已完成"); //"Completed" + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("總列印時間"); //"Total print time" + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("最長工作時間"); //"Longest job time" + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("總計擠出"); //"Extruded total" + #else + PROGMEM Language_Str MSG_INFO_PRINT_COUNT = _UxGT("列印數"); //"Prints" + PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS = _UxGT("完成"); //"Completed" + PROGMEM Language_Str MSG_INFO_PRINT_TIME = _UxGT("總共"); //"Total" + PROGMEM Language_Str MSG_INFO_PRINT_LONGEST = _UxGT("最長"); //"Longest" + PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT = _UxGT("已擠出"); //"Extruded" + #endif -#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_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" + PROGMEM Language_Str MSG_INFO_MIN_TEMP = _UxGT("最低溫度"); //"Min Temp" + PROGMEM Language_Str MSG_INFO_MAX_TEMP = _UxGT("最高溫度"); //"Max Temp" + PROGMEM Language_Str MSG_INFO_PSU = _UxGT("電源供應"); //"Power Supply" + PROGMEM Language_Str MSG_DRIVE_STRENGTH = _UxGT("驅動力度"); // "Drive Strength" + PROGMEM Language_Str MSG_DAC_PERCENT_X = _UxGT("X 驅動 %"); // "X Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_Y = _UxGT("Y 驅動 %"); // "Y Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_Z = _UxGT("Z 驅動 %"); // "Z Driver %" + PROGMEM Language_Str MSG_DAC_PERCENT_E = _UxGT("E 驅動 %"); // "E Driver %" + PROGMEM Language_Str MSG_DAC_EEPROM_WRITE = _UxGT("保存驅動設置"); // "DAC EEPROM Write" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("列印已暫停"); // "PRINT PAUSED" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("裝載絲料"); // "LOAD FILAMENT" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("卸載絲料"); // "UNLOAD FILAMENT" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("恢複選項:"); // "RESUME OPTIONS:" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("清除更多"); // "Purge more" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("恢復列印"); //"Resume print" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" 噴嘴: "); // " Nozzle: " + PROGMEM Language_Str MSG_LCD_HOMING_FAILED = _UxGT("歸原位失敗"); // "Homing failed" + PROGMEM Language_Str MSG_LCD_PROBING_FAILED = _UxGT("探針探測失敗"); // "Probing failed" + PROGMEM Language_Str MSG_M600_TOO_COLD = _UxGT("M600: 太冷"); // "M600: Too cold" -#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("請等待 ...") //"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_RESUME_1 _UxGT("恢復中 ...") //"Resuming..." -#endif // LCD_HEIGHT < 4 + #if LCD_HEIGHT >= 4 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_3_LINE("等待開始", "絲料", "變更")); //"Wait for start of the filament change" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_2_LINE("等待", "卸下絲料")); //"Wait for filament unload" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_3_LINE("插入絲料", "並按鍵", "繼續 ...")); //"Insert filament and press button to continue..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEAT = _UxGT(MSG_2_LINE("按下按鈕來", "加熱噴嘴.")); // "Press button to heat nozzle." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_2_LINE("加熱噴嘴", "請等待 ...")); // "Heating nozzle Please wait..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_2_LINE("等待", "進料")); //"Wait for filament load" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_2_LINE("等待", "絲料清除")); // "Wait for filament purge" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_2_LINE("等待列印", "恢復")); //"Wait for print to resume" + #else // LCD_HEIGHT < 4 + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("請等待 ...")); //"Please wait..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_UNLOAD = _UxGT(MSG_1_LINE("退出中 ...")); //"Ejecting..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_INSERT = _UxGT(MSG_1_LINE("插入並點擊")); //"Insert and Click" + PROGMEM Language_Str MSG_FILAMENT_CHANGE_HEATING = _UxGT(MSG_1_LINE("加熱中 ...")); // "Heating..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_LOAD = _UxGT(MSG_1_LINE("載入中 ...")); //"Loading..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("清除中 ...")); // "Purging..." + PROGMEM Language_Str MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("恢復中 ...")); //"Resuming..." + #endif // LCD_HEIGHT < 4 +} diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp new file mode 100644 index 000000000000..9f28e14080dc --- /dev/null +++ b/Marlin/src/lcd/lcdprint.cpp @@ -0,0 +1,63 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * lcdprint.cpp + */ + +#include "../inc/MarlinConfigPre.h" + +#if HAS_SPI_LCD + +#include "lcdprint.h" +#include "../core/language.h" + +/** + * lcd_put_u8str_ind_P + * Print a string with an index substituted within it + */ +lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const uint8_t ind, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { + uint8_t *p = (uint8_t*)pstr; + lcd_uint_t n = maxlen; + for (; n; n--) { + wchar_t ch; + p = get_utf8_value_cb(p, read_byte_rom, &ch); + if (!ch) break; + if (ch == '=' || ch == '~' || ch == '*') { + if (ch == '*') { lcd_put_wchar('E'); n--; } + // lcd_put_int(ind); n--; if (ind >= 10) n--; + // if (ind >= 0) + { + lcd_put_wchar(ind + ((ch == '=') ? '0' : LCD_FIRST_TOOL)); + n--; + } + // else if (ind == -1) { PGM_P const b = GET_TEXT(MSG_BED); lcd_put_u8str_P(b); n -= utf8_strlen_P(b); } + // else if (ind == -2) { PGM_P const c = GET_TEXT(MSG_CHAMBER); lcd_put_u8str_P(c); n -= utf8_strlen_P(c); } + if (n) n -= lcd_put_u8str_max_P((PGM_P)p, n); + break; + } + lcd_put_wchar(ch); + } + return n; +} + +#endif // HAS_SPI_LCD diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index 59cd5468550e..7128d79c5725 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -10,17 +10,19 @@ #include "fontutils.h" -#include "../inc/MarlinConfigPre.h" +#include "../inc/MarlinConfig.h" #if HAS_GRAPHICAL_LCD #include "dogm/u8g_fontutf8.h" + typedef u8g_uint_t lcd_uint_t; #else #define _UxGT(a) a + typedef uint8_t lcd_uint_t; #endif #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) -int lcd_glyph_height(void); +int lcd_glyph_height(); int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length); @@ -36,6 +38,11 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length); */ int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length); +/** + * Set the print baseline position + */ +void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row); + /** * @brief Draw a ROM UTF-8 string * @@ -47,13 +54,37 @@ int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length); * Draw a ROM UTF-8 string */ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length); - -void lcd_moveto(const uint8_t col, const uint8_t row); +inline int lcd_put_u8str_max_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P utf8_str_P, pixel_len_t max_length) { + lcd_moveto(col, row); + return lcd_put_u8str_max_P(utf8_str_P, max_length); +} void lcd_put_int(const int i); +inline void lcd_put_int(const lcd_uint_t col, const lcd_uint_t row, const int i) { + lcd_moveto(col, row); + lcd_put_int(i); +} + +inline int lcd_put_u8str_P(PGM_P const pstr) { return lcd_put_u8str_max_P(pstr, PIXEL_LEN_NOLIMIT); } +inline int lcd_put_u8str_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const pstr) { + lcd_moveto(col, row); + return lcd_put_u8str_P(pstr); +} -inline int lcd_put_u8str_P(PGM_P str) { return lcd_put_u8str_max_P(str, PIXEL_LEN_NOLIMIT); } +lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const uint8_t ind, const lcd_uint_t maxlen=LCD_WIDTH); +inline lcd_uint_t lcd_put_u8str_ind_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const pstr, const uint8_t ind, const lcd_uint_t maxlen=LCD_WIDTH) { + lcd_moveto(col, row); + return lcd_put_u8str_ind_P(pstr, ind, maxlen); +} inline int lcd_put_u8str(const char* str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); } +inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, PGM_P const str) { + lcd_moveto(col, row); + return lcd_put_u8str(str); +} inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); } +inline int lcd_put_wchar(const lcd_uint_t col, const lcd_uint_t row, const wchar_t c) { + lcd_moveto(col, row); + return lcd_put_wchar(c); +} diff --git a/Marlin/src/lcd/menu/game/brickout.cpp b/Marlin/src/lcd/menu/game/brickout.cpp index ad23031360bc..921a6f6e3081 100644 --- a/Marlin/src/lcd/menu/game/brickout.cpp +++ b/Marlin/src/lcd/menu/game/brickout.cpp @@ -28,8 +28,6 @@ #define BRICK_H 5 #define BRICK_TOP MENU_FONT_ASCENT -#define BRICK_ROWS 4 -#define BRICK_COLS 16 #define PADDLE_H 2 #define PADDLE_VEL 3 @@ -42,52 +40,47 @@ #define BRICK_COL(X) ((X) / (BRICK_W)) #define BRICK_ROW(Y) ((Y - (BRICK_TOP)) / (BRICK_H)) -uint8_t balls_left, brick_count; -uint16_t bricks[BRICK_ROWS]; +brickout_data_t &bdat = marlin_game_data.brickout; inline void reset_bricks(const uint16_t v) { - brick_count = (BRICK_COLS) * (BRICK_ROWS); - LOOP_L_N(i, BRICK_ROWS) bricks[i] = v; + bdat.brick_count = (BRICK_COLS) * (BRICK_ROWS); + LOOP_L_N(i, BRICK_ROWS) bdat.bricks[i] = v; } -int8_t paddle_x, hit_dir; -fixed_t ballx, bally, ballh, ballv; - void reset_ball() { constexpr uint8_t ball_dist = 24; - bally = BTOF(PADDLE_Y - ball_dist); - ballv = FTOP(1.3f); - ballh = -FTOP(1.25f); - uint8_t bx = paddle_x + (PADDLE_W) / 2 + ball_dist; - if (bx >= LCD_PIXEL_WIDTH - 10) { bx -= ball_dist * 2; ballh = -ballh; } - ballx = BTOF(bx); - hit_dir = -1; + bdat.bally = BTOF(PADDLE_Y - ball_dist); + bdat.ballv = FTOP(1.3f); + bdat.ballh = -FTOP(1.25f); + uint8_t bx = bdat.paddle_x + (PADDLE_W) / 2 + ball_dist; + if (bx >= LCD_PIXEL_WIDTH - 10) { bx -= ball_dist * 2; bdat.ballh = -bdat.ballh; } + bdat.ballx = BTOF(bx); + bdat.hit_dir = -1; } void BrickoutGame::game_screen() { if (game_frame()) { // Run logic twice for finer resolution // Update Paddle Position - paddle_x = (int8_t)ui.encoderPosition; - paddle_x = constrain(paddle_x, 0, (LCD_PIXEL_WIDTH - (PADDLE_W)) / (PADDLE_VEL)); - ui.encoderPosition = paddle_x; - paddle_x *= (PADDLE_VEL); + bdat.paddle_x = constrain(int8_t(ui.encoderPosition), 0, (LCD_PIXEL_WIDTH - (PADDLE_W)) / (PADDLE_VEL)); + ui.encoderPosition = bdat.paddle_x; + bdat.paddle_x *= (PADDLE_VEL); // Run the ball logic if (game_state) do { // Provisionally update the ball position - const fixed_t newx = ballx + ballh, newy = bally + ballv; // current next position + const fixed_t newx = bdat.ballx + bdat.ballh, newy = bdat.bally + bdat.ballv; // current next position if (!WITHIN(newx, 0, BTOF(LCD_PIXEL_WIDTH - 1))) { // out in x? - ballh = -ballh; _BUZZ(5, 220); // bounce x + bdat.ballh = -bdat.ballh; _BUZZ(5, 220); // bounce x } if (newy < 0) { // out in y? - ballv = -ballv; _BUZZ(5, 280); // bounce v - hit_dir = 1; + bdat.ballv = -bdat.ballv; _BUZZ(5, 280); // bounce v + bdat.hit_dir = 1; } // Did the ball go below the bottom? else if (newy > BTOF(LCD_PIXEL_HEIGHT)) { - BUZZ(500, 75); - if (--balls_left) reset_ball(); else game_state = 0; + _BUZZ(500, 75); + if (--bdat.balls_left) reset_ball(); else game_state = 0; break; // done } @@ -95,42 +88,42 @@ void BrickoutGame::game_screen() { if (WITHIN(newy, BTOF(BRICK_TOP), BTOF(BRICK_BOT))) { const int8_t bit = BRICK_COL(FTOB(newx)), row = BRICK_ROW(FTOB(newy)); const uint16_t mask = _BV(bit); - if (bricks[row] & mask) { + if (bdat.bricks[row] & mask) { // Yes. Remove it! - bricks[row] &= ~mask; + bdat.bricks[row] &= ~mask; // Score! score += BRICK_ROWS - row; // If bricks are gone, go to reset state - if (!--brick_count) game_state = 2; + if (!--bdat.brick_count) game_state = 2; // Bounce the ball cleverly - if ((ballv < 0) == (hit_dir < 0)) { ballv = -ballv; ballh += fixed_t(random(-16, 16)); _BUZZ(5, 880); } - else { ballh = -ballh; ballv += fixed_t(random(-16, 16)); _BUZZ(5, 640); } + if ((bdat.ballv < 0) == (bdat.hit_dir < 0)) { bdat.ballv = -bdat.ballv; bdat.ballh += fixed_t(random(-16, 16)); _BUZZ(5, 880); } + else { bdat.ballh = -bdat.ballh; bdat.ballv += fixed_t(random(-16, 16)); _BUZZ(5, 640); } } } // Is the ball moving down and in paddle range? - else if (ballv > 0 && WITHIN(newy, BTOF(PADDLE_Y), BTOF(PADDLE_Y + PADDLE_H))) { + else if (bdat.ballv > 0 && WITHIN(newy, BTOF(PADDLE_Y), BTOF(PADDLE_Y + PADDLE_H))) { // Ball actually hitting paddle - const int8_t diff = FTOB(newx) - paddle_x; + const int8_t diff = FTOB(newx) - bdat.paddle_x; if (WITHIN(diff, 0, PADDLE_W - 1)) { // Reverse Y direction - ballv = -ballv; _BUZZ(3, 880); - hit_dir = -1; + bdat.ballv = -bdat.ballv; _BUZZ(3, 880); + bdat.hit_dir = -1; // Near edges affects X velocity const bool is_left_edge = (diff <= 1); if (is_left_edge || diff >= PADDLE_W-1 - 1) { - if ((ballh > 0) == is_left_edge) ballh = -ballh; + if ((bdat.ballh > 0) == is_left_edge) bdat.ballh = -bdat.ballh; } else if (diff <= 3) { - ballh += fixed_t(random(-64, 0)); - NOLESS(ballh, BTOF(-2)); - NOMORE(ballh, BTOF(2)); + bdat.ballh += fixed_t(random(-64, 0)); + NOLESS(bdat.ballh, BTOF(-2)); + NOMORE(bdat.ballh, BTOF(2)); } else if (diff >= PADDLE_W-1 - 3) { - ballh += fixed_t(random( 0, 64)); - NOLESS(ballh, BTOF(-2)); - NOMORE(ballh, BTOF(2)); + bdat.ballh += fixed_t(random( 0, 64)); + NOLESS(bdat.ballh, BTOF(-2)); + NOMORE(bdat.ballh, BTOF(2)); } // Paddle hit after clearing the board? Reset the board. @@ -138,7 +131,7 @@ void BrickoutGame::game_screen() { } } - ballx += ballh; bally += ballv; // update with new velocity + bdat.ballx += bdat.ballh; bdat.bally += bdat.ballv; // update with new velocity } while (false); } @@ -151,7 +144,7 @@ void BrickoutGame::game_screen() { const uint8_t yy = y * BRICK_H + BRICK_TOP; if (PAGE_CONTAINS(yy, yy + BRICK_H - 1)) { for (uint8_t x = 0; x < BRICK_COLS; ++x) { - if (TEST(bricks[y], x)) { + if (TEST(bdat.bricks[y], x)) { const uint8_t xx = x * BRICK_W; for (uint8_t v = 0; v < BRICK_H - 1; ++v) if (PAGE_CONTAINS(yy + v, yy + v)) @@ -164,20 +157,20 @@ void BrickoutGame::game_screen() { // Draw paddle if (PAGE_CONTAINS(PADDLE_Y-1, PADDLE_Y)) { - u8g.drawHLine(paddle_x, PADDLE_Y, PADDLE_W); + u8g.drawHLine(bdat.paddle_x, PADDLE_Y, PADDLE_W); #if PADDLE_H > 1 - u8g.drawHLine(paddle_x, PADDLE_Y-1, PADDLE_W); + u8g.drawHLine(bdat.paddle_x, PADDLE_Y-1, PADDLE_W); #if PADDLE_H > 2 - u8g.drawHLine(paddle_x, PADDLE_Y-2, PADDLE_W); + u8g.drawHLine(bdat.paddle_x, PADDLE_Y-2, PADDLE_W); #endif #endif } // Draw ball while game is running if (game_state) { - const uint8_t by = FTOB(bally); + const uint8_t by = FTOB(bdat.bally); if (PAGE_CONTAINS(by, by+1)) - u8g.drawFrame(FTOB(ballx), by, 2, 2); + u8g.drawFrame(FTOB(bdat.ballx), by, 2, 2); } // Or draw GAME OVER else @@ -187,24 +180,25 @@ void BrickoutGame::game_screen() { // Score Digits //const uint8_t sx = (LCD_PIXEL_WIDTH - (score >= 10 ? score >= 100 ? score >= 1000 ? 4 : 3 : 2 : 1) * MENU_FONT_WIDTH) / 2; constexpr uint8_t sx = 0; - lcd_moveto(sx, MENU_FONT_ASCENT - 1); - lcd_put_int(score); + lcd_put_int(sx, MENU_FONT_ASCENT - 1, score); // Balls Left lcd_moveto(LCD_PIXEL_WIDTH - MENU_FONT_WIDTH * 3, MENU_FONT_ASCENT - 1); PGM_P const ohs = PSTR("ooo\0\0"); - lcd_put_u8str_P(ohs + 3 - balls_left); + lcd_put_u8str_P(ohs + 3 - bdat.balls_left); } // A click always exits this game if (ui.use_click()) exit_game(); } +#define SCREEN_M ((LCD_PIXEL_WIDTH) / 2) + void BrickoutGame::enter_game() { init_game(2, game_screen); // 2 = reset bricks on paddle hit constexpr uint8_t paddle_start = SCREEN_M - (PADDLE_W) / 2; - paddle_x = paddle_start; - balls_left = 3; + bdat.paddle_x = paddle_start; + bdat.balls_left = 3; reset_bricks(0x0000); reset_ball(); ui.encoderPosition = paddle_start / (PADDLE_VEL); diff --git a/Marlin/src/lcd/menu/game/brickout.h b/Marlin/src/lcd/menu/game/brickout.h new file mode 100644 index 000000000000..9037e538307f --- /dev/null +++ b/Marlin/src/lcd/menu/game/brickout.h @@ -0,0 +1,38 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include "types.h" + +#define BRICK_ROWS 4 +#define BRICK_COLS 16 + +typedef struct { + uint8_t balls_left, brick_count; + uint16_t bricks[BRICK_ROWS]; + int8_t paddle_x, hit_dir; + fixed_t ballx, bally, ballh, ballv; +} brickout_data_t; + +class BrickoutGame : MarlinGame { public: static void enter_game(), game_screen(); }; + +extern BrickoutGame brickout; diff --git a/Marlin/src/lcd/menu/game/game.cpp b/Marlin/src/lcd/menu/game/game.cpp index 939355243718..6f8d24769299 100644 --- a/Marlin/src/lcd/menu/game/game.cpp +++ b/Marlin/src/lcd/menu/game/game.cpp @@ -30,6 +30,8 @@ int MarlinGame::score; uint8_t MarlinGame::game_state; millis_t MarlinGame::next_frame; +MarlinGameData marlin_game_data; + bool MarlinGame::game_frame() { static int8_t slew; if (ui.first_page) slew = 2; @@ -46,17 +48,13 @@ void MarlinGame::draw_game_over() { u8g.setColorIndex(0); u8g.drawBox(lx - 1, ly - gohigh - 1, gowide + 2, gohigh + 2); u8g.setColorIndex(1); - if (ui.get_blink()) { - lcd_moveto(lx, ly); - lcd_put_u8str_P(PSTR("GAME OVER")); - } + if (ui.get_blink()) lcd_put_u8str_P(lx, ly, PSTR("GAME OVER")); } } void MarlinGame::init_game(const uint8_t init_state, const screenFunc_t screen) { score = 0; game_state = init_state; - ui.encoder_direction_normal(); ui.goto_screen(screen); ui.defer_status_screen(); } diff --git a/Marlin/src/lcd/menu/game/game.h b/Marlin/src/lcd/menu/game/game.h index 398f06af35c1..f168ccec79d9 100644 --- a/Marlin/src/lcd/menu/game/game.h +++ b/Marlin/src/lcd/menu/game/game.h @@ -28,51 +28,43 @@ //#define MUTE_GAMES -#ifdef MUTE_GAMES +#if ENABLED(MUTE_GAMES) || !HAS_BUZZER #define _BUZZ(D,F) NOOP #else #define _BUZZ(D,F) BUZZ(D,F) #endif -// Simple 8:8 fixed-point -typedef int16_t fixed_t; -#define FTOP(F) fixed_t((F)*256.0f) -#define PTOF(P) (float(P)*(1.0f/256.0f)) -#define BTOF(X) (fixed_t(X)<<8) -#define FTOB(X) int8_t(fixed_t(X)>>8) - -#define SCREEN_M ((LCD_PIXEL_WIDTH) / 2) - #if HAS_GAME_MENU void menu_game(); #endif -class MarlinGame { -protected: - static int score; - static uint8_t game_state; - static millis_t next_frame; - - static bool game_frame(); - static void draw_game_over(); - static void exit_game(); -public: - static void init_game(const uint8_t init_state, const screenFunc_t screen); -}; - #if ENABLED(MARLIN_BRICKOUT) - class BrickoutGame : MarlinGame { public: static void enter_game(); static void game_screen(); }; - extern BrickoutGame brickout; + #include "brickout.h" #endif #if ENABLED(MARLIN_INVADERS) - class InvadersGame : MarlinGame { public: static void enter_game(); static void game_screen(); }; - extern InvadersGame invaders; -#endif -#if ENABLED(MARLIN_SNAKE) - class SnakeGame : MarlinGame { public: static void enter_game(); static void game_screen(); }; - extern SnakeGame snake; + #include "invaders.h" #endif #if ENABLED(MARLIN_MAZE) - class MazeGame : MarlinGame { public: static void enter_game(); static void game_screen(); }; - extern MazeGame maze; + #include "maze.h" +#endif +#if ENABLED(MARLIN_SNAKE) + #include "snake.h" #endif + +// Pool game data to save SRAM +union MarlinGameData { + #if ENABLED(MARLIN_BRICKOUT) + brickout_data_t brickout; + #endif + #if ENABLED(MARLIN_INVADERS) + invaders_data_t invaders; + #endif + #if ENABLED(MARLIN_SNAKE) + snake_data_t snake; + #endif + #if ENABLED(MARLIN_MAZE) + maze_data_t maze; + #endif +}; + +extern MarlinGameData marlin_game_data; diff --git a/Marlin/src/lcd/menu/game/invaders.cpp b/Marlin/src/lcd/menu/game/invaders.cpp index 55a1e4a8499b..4517c5f43c4b 100644 --- a/Marlin/src/lcd/menu/game/invaders.cpp +++ b/Marlin/src/lcd/menu/game/invaders.cpp @@ -26,6 +26,28 @@ #include "game.h" +#define CANNON_W 11 +#define CANNON_H 8 +#define CANNON_VEL 4 +#define CANNON_Y (LCD_PIXEL_HEIGHT - 1 - CANNON_H) + +#define INVADER_VEL 3 + +#define INVADER_TOP MENU_FONT_ASCENT +#define INVADERS_WIDE ((INVADER_COL_W) * (INVADER_COLS)) +#define INVADERS_HIGH ((INVADER_ROW_H) * (INVADER_ROWS)) + +#define UFO_H 5 +#define UFO_W 13 + +#define LASER_H 4 +#define SHOT_H 3 +#define EXPL_W 11 +#define LIFE_W 8 +#define LIFE_H 5 + +#define INVADER_RIGHT ((INVADER_COLS) * (INVADER_COL_W)) + // 11x8 const unsigned char invader[3][2][16] PROGMEM = { { { B00000110,B00000000, @@ -120,20 +142,6 @@ const unsigned char ufo[] PROGMEM = { B01111111,B11110000 }; -#define INVASION_SIZE 3 - -#if INVASION_SIZE == 3 - #define INVADER_COLS 5 -#elif INVASION_SIZE == 4 - #define INVADER_COLS 6 -#else - #define INVADER_COLS 8 - #undef INVASION_SIZE - #define INVASION_SIZE 5 -#endif - -#define INVADER_ROWS INVASION_SIZE - constexpr uint8_t inv_type[] = { #if INVADER_ROWS == 5 0, 1, 1, 2, 2 @@ -146,107 +154,74 @@ constexpr uint8_t inv_type[] = { #endif }; -#define INVADER_RIGHT ((INVADER_COLS) * (COL_W)) +invaders_data_t &idat = marlin_game_data.invaders; -#define CANNON_W 11 -#define CANNON_H 8 -#define CANNON_VEL 4 -#define CANNON_Y (LCD_PIXEL_HEIGHT - 1 - CANNON_H) - -#define COL_W 14 -#define INVADER_H 8 -#define ROW_H (INVADER_H + 2) -#define INVADER_VEL 3 - -#define INVADER_TOP MENU_FONT_ASCENT -#define INVADERS_WIDE ((COL_W) * (INVADER_COLS)) -#define INVADERS_HIGH ((ROW_H) * (INVADER_ROWS)) - -#define UFO_H 5 -#define UFO_W 13 - -#define LASER_H 4 -#define SHOT_H 3 -#define EXPL_W 11 -#define LIFE_W 8 -#define LIFE_H 5 - -#define INVADER_COL(X) ((X - invaders_x) / (COL_W)) -#define INVADER_ROW(Y) ((Y - invaders_y + 2) / (ROW_H)) - -#define INV_X_LEFT(C,T) (invaders_x + (C) * (COL_W) + inv_off[T]) +#define INV_X_LEFT(C,T) (idat.pos.x + (C) * (INVADER_COL_W) + inv_off[T]) #define INV_X_CTR(C,T) (INV_X_LEFT(C,T) + inv_wide[T] / 2) -#define INV_Y_BOT(R) (invaders_y + (R + 1) * (ROW_H) - 2) - -typedef struct { int8_t x, y, v; } laser_t; +#define INV_Y_BOT(R) (idat.pos.y + (R + 1) * (INVADER_ROW_H) - 2) -uint8_t cannons_left; -int8_t cannon_x; -laser_t explod, laser, bullet[10]; constexpr uint8_t inv_off[] = { 2, 1, 0 }, inv_wide[] = { 8, 11, 12 }; -int8_t invaders_x, invaders_y, invaders_dir, leftmost, rightmost, botmost; -uint8_t invader_count, quit_count, bugs[INVADER_ROWS], shooters[(INVADER_ROWS) * (INVADER_COLS)]; inline void update_invader_data() { uint8_t inv_mask = 0; // Get a list of all active invaders uint8_t sc = 0; LOOP_L_N(y, INVADER_ROWS) { - uint8_t m = bugs[y]; - if (m) botmost = y + 1; + uint8_t m = idat.bugs[y]; + if (m) idat.botmost = y + 1; inv_mask |= m; for (uint8_t x = 0; x < INVADER_COLS; ++x) - if (TEST(m, x)) shooters[sc++] = (y << 4) | x; + if (TEST(m, x)) idat.shooters[sc++] = (y << 4) | x; } - leftmost = 0; - LOOP_L_N(i, INVADER_COLS) { if (TEST(inv_mask, i)) break; leftmost -= COL_W; } - rightmost = LCD_PIXEL_WIDTH - (INVADERS_WIDE); - for (uint8_t i = INVADER_COLS; i--;) { if (TEST(inv_mask, i)) break; rightmost += COL_W; } - if (invader_count == 2) invaders_dir = invaders_dir > 0 ? INVADER_VEL + 1 : -(INVADER_VEL + 1); + idat.leftmost = 0; + LOOP_L_N(i, INVADER_COLS) { if (TEST(inv_mask, i)) break; idat.leftmost -= INVADER_COL_W; } + idat.rightmost = LCD_PIXEL_WIDTH - (INVADERS_WIDE); + for (uint8_t i = INVADER_COLS; i--;) { if (TEST(inv_mask, i)) break; idat.rightmost += INVADER_COL_W; } + if (idat.count == 2) idat.dir = idat.dir > 0 ? INVADER_VEL + 1 : -(INVADER_VEL + 1); } inline void reset_bullets() { - LOOP_L_N(i, COUNT(bullet)) bullet[i].v = 0; + LOOP_L_N(i, COUNT(idat.bullet)) idat.bullet[i].v = 0; } inline void reset_invaders() { - invaders_x = 0; invaders_y = INVADER_TOP; - invaders_dir = INVADER_VEL; - invader_count = (INVADER_COLS) * (INVADER_ROWS); - LOOP_L_N(i, INVADER_ROWS) bugs[i] = _BV(INVADER_COLS) - 1; + idat.pos.x = 0; idat.pos.y = INVADER_TOP; + idat.dir = INVADER_VEL; + idat.count = (INVADER_COLS) * (INVADER_ROWS); + LOOP_L_N(i, INVADER_ROWS) idat.bugs[i] = _BV(INVADER_COLS) - 1; update_invader_data(); reset_bullets(); } -int8_t ufox, ufov; + inline void spawn_ufo() { - ufov = random(0, 2) ? 1 : -1; - ufox = ufov > 0 ? -(UFO_W) : LCD_PIXEL_WIDTH - 1; + idat.ufov = random(0, 2) ? 1 : -1; + idat.ufox = idat.ufov > 0 ? -(UFO_W) : LCD_PIXEL_WIDTH - 1; } inline void reset_player() { - cannon_x = 0; + idat.cannon_x = 0; ui.encoderPosition = 0; } inline void fire_cannon() { - laser.x = cannon_x + CANNON_W / 2; - laser.y = LCD_PIXEL_HEIGHT - CANNON_H - (LASER_H); - laser.v = -(LASER_H); + idat.laser.x = idat.cannon_x + CANNON_W / 2; + idat.laser.y = LCD_PIXEL_HEIGHT - CANNON_H - (LASER_H); + idat.laser.v = -(LASER_H); } inline void explode(const int8_t x, const int8_t y, const int8_t v=4) { - explod.x = x - (EXPL_W) / 2; - explod.y = y; - explod.v = v; + idat.explod.x = x - (EXPL_W) / 2; + idat.explod.y = y; + idat.explod.v = v; } inline void kill_cannon(uint8_t &game_state, const uint8_t st) { reset_bullets(); - explode(cannon_x + (CANNON_W) / 2, CANNON_Y, 6); + explode(idat.cannon_x + (CANNON_W) / 2, CANNON_Y, 6); _BUZZ(1000, 10); - if (--cannons_left) { - laser.v = 0; + if (--idat.cannons_left) { + idat.laser.v = 0; game_state = st; reset_player(); } @@ -255,59 +230,55 @@ inline void kill_cannon(uint8_t &game_state, const uint8_t st) { } void InvadersGame::game_screen() { - static bool game_blink; - ui.refresh(LCDVIEW_CALL_NO_REDRAW); // Call as often as possible // Run game logic once per full screen if (ui.first_page) { // Update Cannon Position - int16_t ep = int16_t(ui.encoderPosition); - ep = constrain(ep, 0, (LCD_PIXEL_WIDTH - (CANNON_W)) / (CANNON_VEL)); + int16_t ep = constrain(int16_t(ui.encoderPosition), 0, (LCD_PIXEL_WIDTH - (CANNON_W)) / (CANNON_VEL)); ui.encoderPosition = ep; ep *= (CANNON_VEL); - if (ep > cannon_x) { cannon_x += CANNON_VEL - 1; if (ep - cannon_x < 2) cannon_x = ep; } - if (ep < cannon_x) { cannon_x -= CANNON_VEL - 1; if (cannon_x - ep < 2) cannon_x = ep; } + if (ep > idat.cannon_x) { idat.cannon_x += CANNON_VEL - 1; if (ep - idat.cannon_x < 2) idat.cannon_x = ep; } + if (ep < idat.cannon_x) { idat.cannon_x -= CANNON_VEL - 1; if (idat.cannon_x - ep < 2) idat.cannon_x = ep; } // Run the game logic if (game_state) do { // Move the UFO, if any - if (ufov) { ufox += ufov; if (!WITHIN(ufox, -(UFO_W), LCD_PIXEL_WIDTH - 1)) ufov = 0; } + if (idat.ufov) { idat.ufox += idat.ufov; if (!WITHIN(idat.ufox, -(UFO_W), LCD_PIXEL_WIDTH - 1)) idat.ufov = 0; } if (game_state > 1) { if (--game_state == 2) { reset_invaders(); } else if (game_state == 100) { game_state = 1; } break; } - static uint8_t blink_count; - const bool did_blink = (++blink_count > invader_count >> 1); + const bool did_blink = (++idat.blink_count > idat.count >> 1); if (did_blink) { - game_blink = !game_blink; - blink_count = 0; + idat.game_blink = !idat.game_blink; + idat.blink_count = 0; } - if (invader_count && did_blink) { - const int8_t newx = invaders_x + invaders_dir; - if (!WITHIN(newx, leftmost, rightmost)) { // Invaders reached the edge? - invaders_dir *= -1; // Invaders change direction - invaders_y += (ROW_H) / 2; // Invaders move down - invaders_x -= invaders_dir; // ...and only move down this time. - if (invaders_y + botmost * (ROW_H) - 2 >= CANNON_Y) // Invaders reached the bottom? - kill_cannon(game_state, 20); // Kill the cannon. Reset invaders. + if (idat.count && did_blink) { + const int8_t newx = idat.pos.x + idat.dir; + if (!WITHIN(newx, idat.leftmost, idat.rightmost)) { // Invaders reached the edge? + idat.dir *= -1; // Invaders change direction + idat.pos.y += (INVADER_ROW_H) / 2; // Invaders move down + idat.pos.x -= idat.dir; // ...and only move down this time. + if (idat.pos.y + idat.botmost * (INVADER_ROW_H) - 2 >= CANNON_Y) // Invaders reached the bottom? + kill_cannon(game_state, 20); // Kill the cannon. Reset invaders. } - invaders_x += invaders_dir; // Invaders take one step left/right + idat.pos.x += idat.dir; // Invaders take one step left/right // Randomly shoot if invaders are listed - if (invader_count && !random(0, 20)) { + if (idat.count && !random(0, 20)) { // Find a free bullet laser_t *b = nullptr; - LOOP_L_N(i, COUNT(bullet)) if (!bullet[i].v) { b = &bullet[i]; break; } + LOOP_L_N(i, COUNT(idat.bullet)) if (!idat.bullet[i].v) { b = &idat.bullet[i]; break; } if (b) { // Pick a random shooter and update the bullet //SERIAL_ECHOLNPGM("free bullet found"); - const uint8_t inv = shooters[random(0, invader_count + 1)], col = inv & 0x0F, row = inv >> 4, type = inv_type[row]; + const uint8_t inv = idat.shooters[random(0, idat.count + 1)], col = inv & 0x0F, row = inv >> 4, type = inv_type[row]; b->x = INV_X_CTR(col, type); b->y = INV_Y_BOT(row); b->v = 2 + random(0, 2); @@ -316,34 +287,34 @@ void InvadersGame::game_screen() { } // Update the laser position - if (laser.v) { - laser.y += laser.v; - if (laser.y < 0) laser.v = 0; + if (idat.laser.v) { + idat.laser.y += idat.laser.v; + if (idat.laser.y < 0) idat.laser.v = 0; } // Did the laser collide with an invader? - if (laser.v && WITHIN(laser.y, invaders_y, invaders_y + INVADERS_HIGH - 1)) { - const int8_t col = INVADER_COL(laser.x); + if (idat.laser.v && WITHIN(idat.laser.y, idat.pos.y, idat.pos.y + INVADERS_HIGH - 1)) { + const int8_t col = idat.laser_col(); if (WITHIN(col, 0, INVADER_COLS - 1)) { - const int8_t row = INVADER_ROW(laser.y); + const int8_t row = idat.laser_row(); if (WITHIN(row, 0, INVADER_ROWS - 1)) { const uint8_t mask = _BV(col); - if (bugs[row] & mask) { + if (idat.bugs[row] & mask) { const uint8_t type = inv_type[row]; const int8_t invx = INV_X_LEFT(col, type); - if (WITHIN(laser.x, invx, invx + inv_wide[type] - 1)) { + if (WITHIN(idat.laser.x, invx, invx + inv_wide[type] - 1)) { // Turn off laser - laser.v = 0; + idat.laser.v = 0; // Remove the invader! - bugs[row] &= ~mask; + idat.bugs[row] &= ~mask; // Score! score += INVADER_ROWS - row; // Explode sound! _BUZZ(40, 10); // Explosion bitmap! - explode(invx + inv_wide[type] / 2, invaders_y + row * (ROW_H)); + explode(invx + inv_wide[type] / 2, idat.pos.y + row * (INVADER_ROW_H)); // If invaders are gone, go to reset invaders state - if (--invader_count) update_invader_data(); else { game_state = 20; reset_bullets(); } + if (--idat.count) update_invader_data(); else { game_state = 20; reset_bullets(); } } // laser x hit } // invader exists } // good row @@ -351,31 +322,31 @@ void InvadersGame::game_screen() { } // laser in invader zone // Handle alien bullets - LOOP_L_N(s, COUNT(bullet)) { - laser_t *b = &bullet[s]; + LOOP_L_N(s, COUNT(idat.bullet)) { + laser_t *b = &idat.bullet[s]; if (b->v) { // Update alien bullet position b->y += b->v; if (b->y >= LCD_PIXEL_HEIGHT) b->v = 0; // Offscreen - else if (b->y >= CANNON_Y && WITHIN(b->x, cannon_x, cannon_x + CANNON_W - 1)) + else if (b->y >= CANNON_Y && WITHIN(b->x, idat.cannon_x, idat.cannon_x + CANNON_W - 1)) kill_cannon(game_state, 120); // Hit the cannon } } // Randomly spawn a UFO - if (!ufov && !random(0,500)) spawn_ufo(); + if (!idat.ufov && !random(0,500)) spawn_ufo(); // Did the laser hit a ufo? - if (laser.v && ufov && laser.y < UFO_H + 2 && WITHIN(laser.x, ufox, ufox + UFO_W - 1)) { + if (idat.laser.v && idat.ufov && idat.laser.y < UFO_H + 2 && WITHIN(idat.laser.x, idat.ufox, idat.ufox + UFO_W - 1)) { // Turn off laser and UFO - laser.v = ufov = 0; + idat.laser.v = idat.ufov = 0; // Score! score += 10; // Explode! _BUZZ(40, 10); // Explosion bitmap - explode(ufox + (UFO_W) / 2, 1); + explode(idat.ufox + (UFO_W) / 2, 1); } } while (false); @@ -383,59 +354,59 @@ void InvadersGame::game_screen() { } // Click-and-hold to abort - if (ui.button_pressed()) --quit_count; else quit_count = 10; + if (ui.button_pressed()) --idat.quit_count; else idat.quit_count = 10; // Click to fire or exit if (ui.use_click()) { if (!game_state) - quit_count = 0; - else if (game_state == 1 && !laser.v) + idat.quit_count = 0; + else if (game_state == 1 && !idat.laser.v) fire_cannon(); } - if (!quit_count) exit_game(); + if (!idat.quit_count) exit_game(); u8g.setColorIndex(1); // Draw invaders - if (PAGE_CONTAINS(invaders_y, invaders_y + botmost * (ROW_H) - 2 - 1)) { - int8_t yy = invaders_y; + if (PAGE_CONTAINS(idat.pos.y, idat.pos.y + idat.botmost * (INVADER_ROW_H) - 2 - 1)) { + int8_t yy = idat.pos.y; for (uint8_t y = 0; y < INVADER_ROWS; ++y) { const uint8_t type = inv_type[y]; if (PAGE_CONTAINS(yy, yy + INVADER_H - 1)) { - int8_t xx = invaders_x; + int8_t xx = idat.pos.x; for (uint8_t x = 0; x < INVADER_COLS; ++x) { - if (TEST(bugs[y], x)) - u8g.drawBitmapP(xx, yy, 2, INVADER_H, invader[type][game_blink]); - xx += COL_W; + if (TEST(idat.bugs[y], x)) + u8g.drawBitmapP(xx, yy, 2, INVADER_H, invader[type][idat.game_blink]); + xx += INVADER_COL_W; } } - yy += ROW_H; + yy += INVADER_ROW_H; } } // Draw UFO - if (ufov && PAGE_UNDER(UFO_H + 2)) - u8g.drawBitmapP(ufox, 2, 2, UFO_H, ufo); + if (idat.ufov && PAGE_UNDER(UFO_H + 2)) + u8g.drawBitmapP(idat.ufox, 2, 2, UFO_H, ufo); // Draw cannon if (game_state && PAGE_CONTAINS(CANNON_Y, CANNON_Y + CANNON_H - 1) && (game_state < 2 || (game_state & 0x02))) - u8g.drawBitmapP(cannon_x, CANNON_Y, 2, CANNON_H, cannon); + u8g.drawBitmapP(idat.cannon_x, CANNON_Y, 2, CANNON_H, cannon); // Draw laser - if (laser.v && PAGE_CONTAINS(laser.y, laser.y + LASER_H - 1)) - u8g.drawVLine(laser.x, laser.y, LASER_H); + if (idat.laser.v && PAGE_CONTAINS(idat.laser.y, idat.laser.y + LASER_H - 1)) + u8g.drawVLine(idat.laser.x, idat.laser.y, LASER_H); // Draw invader bullets - LOOP_L_N (i, COUNT(bullet)) { - if (bullet[i].v && PAGE_CONTAINS(bullet[i].y - (SHOT_H - 1), bullet[i].y)) - u8g.drawVLine(bullet[i].x, bullet[i].y - (SHOT_H - 1), SHOT_H); + LOOP_L_N (i, COUNT(idat.bullet)) { + if (idat.bullet[i].v && PAGE_CONTAINS(idat.bullet[i].y - (SHOT_H - 1), idat.bullet[i].y)) + u8g.drawVLine(idat.bullet[i].x, idat.bullet[i].y - (SHOT_H - 1), SHOT_H); } // Draw explosion - if (explod.v && PAGE_CONTAINS(explod.y, explod.y + 7 - 1)) { - u8g.drawBitmapP(explod.x, explod.y, 2, 7, explosion); - --explod.v; + if (idat.explod.v && PAGE_CONTAINS(idat.explod.y, idat.explod.y + 7 - 1)) { + u8g.drawBitmapP(idat.explod.x, idat.explod.y, 2, 7, explosion); + --idat.explod.v; } // Blink GAME OVER when game is over @@ -445,12 +416,11 @@ void InvadersGame::game_screen() { // Draw Score //const uint8_t sx = (LCD_PIXEL_WIDTH - (score >= 10 ? score >= 100 ? score >= 1000 ? 4 : 3 : 2 : 1) * MENU_FONT_WIDTH) / 2; constexpr uint8_t sx = 0; - lcd_moveto(sx, MENU_FONT_ASCENT - 1); - lcd_put_int(score); + lcd_put_int(sx, MENU_FONT_ASCENT - 1, score); // Draw lives - if (cannons_left) - for (uint8_t i = 1; i <= cannons_left; ++i) + if (idat.cannons_left) + for (uint8_t i = 1; i <= idat.cannons_left; ++i) u8g.drawBitmapP(LCD_PIXEL_WIDTH - i * (LIFE_W), 6 - (LIFE_H), 1, LIFE_H, life); } @@ -458,9 +428,9 @@ void InvadersGame::game_screen() { void InvadersGame::enter_game() { init_game(20, game_screen); // countdown to reset invaders - cannons_left = 3; - quit_count = 10; - laser.v = 0; + idat.cannons_left = 3; + idat.quit_count = 10; + idat.laser.v = 0; reset_invaders(); reset_player(); } diff --git a/Marlin/src/lcd/menu/game/invaders.h b/Marlin/src/lcd/menu/game/invaders.h new file mode 100644 index 000000000000..f04e91da6406 --- /dev/null +++ b/Marlin/src/lcd/menu/game/invaders.h @@ -0,0 +1,62 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include "types.h" + +#define INVASION_SIZE 3 + +#if INVASION_SIZE == 3 + #define INVADER_COLS 5 +#elif INVASION_SIZE == 4 + #define INVADER_COLS 6 +#else + #define INVADER_COLS 8 + #undef INVASION_SIZE + #define INVASION_SIZE 5 +#endif + +#define INVADER_ROWS INVASION_SIZE + +#define INVADER_COL_W 14 +#define INVADER_H 8 +#define INVADER_ROW_H (INVADER_H + 2) + +typedef struct { int8_t x, y, v; } laser_t; + +typedef struct { + pos_t pos; + uint8_t cannons_left; + int8_t cannon_x; + laser_t bullet[10], laser, explod; + int8_t dir, leftmost, rightmost, botmost; + uint8_t count, quit_count, blink_count; + uint8_t bugs[INVADER_ROWS], shooters[(INVADER_ROWS) * (INVADER_COLS)]; + int8_t ufox, ufov; + bool game_blink; + int8_t laser_col() { return ((laser.x - pos.x) / (INVADER_COL_W)); }; + int8_t laser_row() { return ((laser.y - pos.y + 2) / (INVADER_ROW_H)); }; +} invaders_data_t; + +class InvadersGame : MarlinGame { public: static void enter_game(), game_screen(); }; + +extern InvadersGame invaders; diff --git a/Marlin/src/lcd/menu/game/maze.cpp b/Marlin/src/lcd/menu/game/maze.cpp index bb07ce0d6428..13784f0d76c0 100644 --- a/Marlin/src/lcd/menu/game/maze.cpp +++ b/Marlin/src/lcd/menu/game/maze.cpp @@ -80,10 +80,7 @@ void MazeGame::game_screen() { u8g.setColorIndex(1); // Draw Score - if (PAGE_UNDER(HEADER_H)) { - lcd_moveto(0, HEADER_H - 1); - lcd_put_int(score); - } + if (PAGE_UNDER(HEADER_H)) lcd_put_int(0, HEADER_H - 1, score); // Draw the maze // for (uint8_t n = 0; n < head_ind; ++n) { diff --git a/Marlin/src/lcd/menu/game/maze.h b/Marlin/src/lcd/menu/game/maze.h new file mode 100644 index 000000000000..5d7fff66afd6 --- /dev/null +++ b/Marlin/src/lcd/menu/game/maze.h @@ -0,0 +1,30 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include "types.h" + +typedef struct { pos_t pos; } maze_data_t; + +class MazeGame : MarlinGame { public: static void enter_game(), game_screen(); }; + +extern MazeGame maze; diff --git a/Marlin/src/lcd/menu/game/snake.cpp b/Marlin/src/lcd/menu/game/snake.cpp index a39fb1890dd7..713c2ddd74ff 100644 --- a/Marlin/src/lcd/menu/game/snake.cpp +++ b/Marlin/src/lcd/menu/game/snake.cpp @@ -65,20 +65,12 @@ constexpr fixed_t snakev = FTOP(0.20); -int8_t snake_dir, // NESW - foodx, foody, food_cnt, - old_encoder; -fixed_t snakex, snakey; - -// Up to 50 lines, then you win! -typedef struct { int8_t x, y; } pos_t; -uint8_t head_ind; -pos_t snake_tail[50]; +snake_data_t &sdat = marlin_game_data.snake; // Remove the first pixel from the tail. // If needed, shift out the first segment. void shorten_tail() { - pos_t &p = snake_tail[0], &q = snake_tail[1]; + pos_t &p = sdat.snake_tail[0], &q = sdat.snake_tail[1]; bool shift = false; if (p.x == q.x) { // Vertical line @@ -91,21 +83,21 @@ void shorten_tail() { shift = p.x == q.x; } if (shift) { - head_ind--; - for (uint8_t i = 0; i <= head_ind; ++i) - snake_tail[i] = snake_tail[i + 1]; + sdat.head_ind--; + for (uint8_t i = 0; i <= sdat.head_ind; ++i) + sdat.snake_tail[i] = sdat.snake_tail[i + 1]; } } // The food is on a line inline bool food_on_line() { - for (uint8_t n = 0; n < head_ind; ++n) { - pos_t &p = snake_tail[n], &q = snake_tail[n + 1]; + for (uint8_t n = 0; n < sdat.head_ind; ++n) { + pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; if (p.x == q.x) { - if ((foodx == p.x - 1 || foodx == p.x) && WITHIN(foody, _MIN(p.y, q.y), _MAX(p.y, q.y))) + if ((sdat.foodx == p.x - 1 || sdat.foodx == p.x) && WITHIN(sdat.foody, _MIN(p.y, q.y), _MAX(p.y, q.y))) return true; } - else if ((foody == p.y - 1 || foody == p.y) && WITHIN(foodx, _MIN(p.x, q.x), _MAX(p.x, q.x))) + else if ((sdat.foody == p.y - 1 || sdat.foody == p.y) && WITHIN(sdat.foodx, _MIN(p.x, q.x), _MAX(p.x, q.x))) return true; } return false; @@ -114,54 +106,54 @@ inline bool food_on_line() { // Add a new food blob void food_reset() { do { - foodx = random(0, GAME_W); - foody = random(0, GAME_H); + sdat.foodx = random(0, GAME_W); + sdat.foody = random(0, GAME_H); } while (food_on_line()); } // Turn the snake cw or ccw inline void turn_snake(const bool cw) { - snake_dir += cw ? 1 : -1; - snake_dir &= 0x03; - head_ind++; - snake_tail[head_ind].x = FTOB(snakex); - snake_tail[head_ind].y = FTOB(snakey); + sdat.snake_dir += cw ? 1 : -1; + sdat.snake_dir &= 0x03; + sdat.head_ind++; + sdat.snake_tail[sdat.head_ind].x = FTOB(sdat.snakex); + sdat.snake_tail[sdat.head_ind].y = FTOB(sdat.snakey); } // Reset the snake for a new game void snake_reset() { // Init the head and velocity - snakex = BTOF(1); - snakey = BTOF(GAME_H / 2); + sdat.snakex = BTOF(1); + sdat.snakey = BTOF(GAME_H / 2); //snakev = FTOP(0.25); // Init the tail with a cw turn - snake_dir = 0; - head_ind = 0; - snake_tail[0].x = 0; - snake_tail[0].y = GAME_H / 2; + sdat.snake_dir = 0; + sdat.head_ind = 0; + sdat.snake_tail[0].x = 0; + sdat.snake_tail[0].y = GAME_H / 2; turn_snake(true); // Clear food flag - food_cnt = 5; + sdat.food_cnt = 5; // Clear the controls ui.encoderPosition = 0; - old_encoder = 0; + sdat.old_encoder = 0; } // Check if head segment overlaps another bool snake_overlap() { // 4 lines must exist before a collision is possible - if (head_ind < 4) return false; + if (sdat.head_ind < 4) return false; // Is the last segment crossing any others? - const pos_t &h1 = snake_tail[head_ind - 1], &h2 = snake_tail[head_ind]; + const pos_t &h1 = sdat.snake_tail[sdat.head_ind - 1], &h2 = sdat.snake_tail[sdat.head_ind]; // VERTICAL head segment? if (h1.x == h2.x) { // Loop from oldest to segment two away from head - for (uint8_t n = 0; n < head_ind - 2; ++n) { + for (uint8_t n = 0; n < sdat.head_ind - 2; ++n) { // Segment p to q - const pos_t &p = snake_tail[n], &q = snake_tail[n + 1]; + const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; if (p.x != q.x) { // Crossing horizontal segment if (WITHIN(h1.x, _MIN(p.x, q.x), _MAX(p.x, q.x)) && (h1.y <= p.y) == (h2.y >= p.y)) return true; @@ -171,9 +163,9 @@ bool snake_overlap() { } else { // Loop from oldest to segment two away from head - for (uint8_t n = 0; n < head_ind - 2; ++n) { + for (uint8_t n = 0; n < sdat.head_ind - 2; ++n) { // Segment p to q - const pos_t &p = snake_tail[n], &q = snake_tail[n + 1]; + const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; if (p.y != q.y) { // Crossing vertical segment if (WITHIN(h1.y, _MIN(p.y, q.y), _MAX(p.y, q.y)) && (h1.x <= p.x) == (h2.x >= p.x)) return true; @@ -189,14 +181,14 @@ void SnakeGame::game_screen() { if (game_frame()) do { // Run logic twice for finer resolution // Move the snake's head one unit in the current direction - const int8_t oldx = FTOB(snakex), oldy = FTOB(snakey); - switch (snake_dir) { - case 0: snakey -= snakev; break; - case 1: snakex += snakev; break; - case 2: snakey += snakev; break; - case 3: snakex -= snakev; break; + const int8_t oldx = FTOB(sdat.snakex), oldy = FTOB(sdat.snakey); + switch (sdat.snake_dir) { + case 0: sdat.snakey -= snakev; break; + case 1: sdat.snakex += snakev; break; + case 2: sdat.snakey += snakev; break; + case 3: sdat.snakex -= snakev; break; } - const int8_t x = FTOB(snakex), y = FTOB(snakey); + const int8_t x = FTOB(sdat.snakex), y = FTOB(sdat.snakey); // If movement took place... if (oldx != x || oldy != y) { @@ -207,17 +199,17 @@ void SnakeGame::game_screen() { break; // ...out of do-while } - snake_tail[head_ind].x = x; - snake_tail[head_ind].y = y; + sdat.snake_tail[sdat.head_ind].x = x; + sdat.snake_tail[sdat.head_ind].y = y; // Change snake direction if set - const int8_t enc = int8_t(ui.encoderPosition), diff = enc - old_encoder; + const int8_t enc = int8_t(ui.encoderPosition), diff = enc - sdat.old_encoder; if (diff) { - old_encoder = enc; + sdat.old_encoder = enc; turn_snake(diff > 0); } - if (food_cnt) --food_cnt; else shorten_tail(); + if (sdat.food_cnt) --sdat.food_cnt; else shorten_tail(); // Did the snake collide with itself or go out of bounds? if (snake_overlap()) { @@ -225,11 +217,11 @@ void SnakeGame::game_screen() { _BUZZ(400, 40); // Bzzzt! } // Is the snake at the food? - else if (x == foodx && y == foody) { + else if (x == sdat.foodx && y == sdat.foody) { _BUZZ(5, 220); _BUZZ(5, 280); score++; - food_cnt = 2; + sdat.food_cnt = 2; food_reset(); } } @@ -239,10 +231,7 @@ void SnakeGame::game_screen() { u8g.setColorIndex(1); // Draw Score - if (PAGE_UNDER(HEADER_H)) { - lcd_moveto(0, HEADER_H - 1); - lcd_put_int(score); - } + if (PAGE_UNDER(HEADER_H)) lcd_put_int(0, HEADER_H - 1, score); // DRAW THE PLAYFIELD BORDER u8g.drawFrame(BOARD_L - 2, BOARD_T - 2, BOARD_R - BOARD_L + 4, BOARD_B - BOARD_T + 4); @@ -251,8 +240,8 @@ void SnakeGame::game_screen() { #if SNAKE_WH < 2 // At this scale just draw a line - for (uint8_t n = 0; n < head_ind; ++n) { - const pos_t &p = snake_tail[n], &q = snake_tail[n + 1]; + for (uint8_t n = 0; n < sdat.head_ind; ++n) { + const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; if (p.x == q.x) { const int8_t y1 = GAMEY(_MIN(p.y, q.y)), y2 = GAMEY(_MAX(p.y, q.y)); if (PAGE_CONTAINS(y1, y2)) @@ -267,8 +256,8 @@ void SnakeGame::game_screen() { #elif SNAKE_WH == 2 // At this scale draw two lines - for (uint8_t n = 0; n < head_ind; ++n) { - const pos_t &p = snake_tail[n], &q = snake_tail[n + 1]; + for (uint8_t n = 0; n < sdat.head_ind; ++n) { + const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; if (p.x == q.x) { const int8_t y1 = GAMEY(_MIN(p.y, q.y)), y2 = GAMEY(_MAX(p.y, q.y)); if (PAGE_CONTAINS(y1, y2 + 1)) @@ -286,8 +275,8 @@ void SnakeGame::game_screen() { #else // Draw a series of boxes - for (uint8_t n = 0; n < head_ind; ++n) { - const pos_t &p = snake_tail[n], &q = snake_tail[n + 1]; + for (uint8_t n = 0; n < sdat.head_ind; ++n) { + const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1]; if (p.x == q.x) { const int8_t y1 = _MIN(p.y, q.y), y2 = _MAX(p.y, q.y); if (PAGE_CONTAINS(GAMEY(y1), GAMEY(y2) + SNAKE_SIZ - 1)) { @@ -311,9 +300,9 @@ void SnakeGame::game_screen() { #endif // Draw food - const int8_t fy = GAMEY(foody); + const int8_t fy = GAMEY(sdat.foody); if (PAGE_CONTAINS(fy, fy + FOOD_WH - 1)) { - const int8_t fx = GAMEX(foodx); + const int8_t fx = GAMEX(sdat.foodx); u8g.drawFrame(fx, fy, FOOD_WH, FOOD_WH); if (FOOD_WH == 5) u8g.drawPixel(fx + 2, fy + 2); } diff --git a/Marlin/src/lcd/menu/game/snake.h b/Marlin/src/lcd/menu/game/snake.h new file mode 100644 index 000000000000..ec8524f2ef90 --- /dev/null +++ b/Marlin/src/lcd/menu/game/snake.h @@ -0,0 +1,38 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include "types.h" + +typedef struct { + int8_t snake_dir, // NESW + foodx, foody, + food_cnt, + old_encoder; + pos_t snake_tail[50]; + fixed_t snakex, snakey; + uint8_t head_ind; +} snake_data_t; + +class SnakeGame : MarlinGame { public: static void enter_game(), game_screen(); }; + +extern SnakeGame snake; diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL_Servo_STM32F7.h b/Marlin/src/lcd/menu/game/types.h similarity index 62% rename from Marlin/src/HAL/HAL_STM32F7/HAL_Servo_STM32F7.h rename to Marlin/src/lcd/menu/game/types.h index 6ff0bfc489ac..872d034dca46 100644 --- a/Marlin/src/HAL/HAL_STM32F7/HAL_Servo_STM32F7.h +++ b/Marlin/src/lcd/menu/game/types.h @@ -4,7 +4,6 @@ * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez * * 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 @@ -22,16 +21,26 @@ */ #pragma once -#include <../../libraries/Servo/src/Servo.h> +#include -// Inherit and expand on the official library -class libServo : public Servo { +typedef struct { int8_t x, y; } pos_t; + +// Simple 8:8 fixed-point +typedef int16_t fixed_t; +#define FTOP(F) fixed_t((F)*256.0f) +#define PTOF(P) (float(P)*(1.0f/256.0f)) +#define BTOF(X) (fixed_t(X)<<8) +#define FTOB(X) int8_t(fixed_t(X)>>8) + +class MarlinGame { +protected: + static int score; + static uint8_t game_state; + static millis_t next_frame; + + static bool game_frame(); + static void draw_game_over(); + static void exit_game(); public: - int8_t attach(const int pin); - int8_t attach(const int pin, const int min, const int max); - void move(const int value); -private: - uint16_t min_ticks; - uint16_t max_ticks; - uint8_t servoIndex; // index into the channel data for this servo + static void init_game(const uint8_t init_state, const screenFunc_t screen); }; diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 9ede8da3014e..f4a2e6cbbd5f 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -25,13 +25,14 @@ #if HAS_LCD_MENU #include "menu.h" -#include "../ultralcd.h" #include "../../module/planner.h" #include "../../module/motion.h" #include "../../module/printcounter.h" #include "../../gcode/queue.h" -#include "../../sd/cardreader.h" -#include "../../libs/buzzer.h" + +#if HAS_BUZZER + #include "../../libs/buzzer.h" +#endif #if ENABLED(EEPROM_SETTINGS) #include "../../module/configuration_store.h" @@ -63,14 +64,17 @@ typedef struct { } menuPosition; menuPosition screen_history[6]; uint8_t screen_history_depth = 0; -bool screen_changed; -// Value Editing -PGM_P MenuItemBase::editLabel; -void* MenuItemBase::editValue; -int32_t MenuItemBase::minEditValue, MenuItemBase::maxEditValue; -screenFunc_t MenuItemBase::callbackFunc; -bool MenuItemBase::liveEdit; +uint8_t MenuItemBase::itemIndex; // Index number for draw and action +chimera_t editable; // Value Editing + +// Menu Edit Items +PGM_P MenuEditItemBase::editLabel; +void* MenuEditItemBase::editValue; +int32_t MenuEditItemBase::minEditValue, + MenuEditItemBase::maxEditValue; +screenFunc_t MenuEditItemBase::callbackFunc; +bool MenuEditItemBase::liveEdit; // Prevent recursion into screen handlers bool no_reentry = false; @@ -86,10 +90,21 @@ void MarlinUI::save_previous_screen() { screen_history[screen_history_depth++] = { currentScreen, encoderPosition, encoderTopLine, screen_items }; } -void MarlinUI::goto_previous_screen() { +void MarlinUI::_goto_previous_screen( + #if ENABLED(TURBO_BACK_MENU_ITEM) + const bool is_back/*=false*/ + #endif +) { + #if DISABLED(TURBO_BACK_MENU_ITEM) + constexpr bool is_back = false; + #endif if (screen_history_depth > 0) { menuPosition &sh = screen_history[--screen_history_depth]; - goto_screen(sh.menu_function, sh.encoder_position, sh.top_line, sh.items); + goto_screen(sh.menu_function, + is_back ? 0 : sh.encoder_position, + is_back ? 0 : sh.top_line, + sh.items + ); } else return_to_status(); @@ -99,7 +114,7 @@ void MarlinUI::goto_previous_screen() { /////////// Common Menu Actions //////////// //////////////////////////////////////////// -void MenuItem_gcode::action(PGM_P const pgcode) { queue.inject_P(pgcode); } +void MenuItem_gcode::action(PGM_P const, PGM_P const pgcode) { queue.inject_P(pgcode); } //////////////////////////////////////////// /////////// Menu Editing Actions /////////// @@ -108,33 +123,34 @@ void MenuItem_gcode::action(PGM_P const pgcode) { queue.inject_P(pgcode); } /** * Functions for editing single values * - * The "DEFINE_MENU_EDIT_ITEM" macro generates the functions needed to edit a numerical value. + * The "DEFINE_MENU_EDIT_ITEM" macro generates the classes needed to edit a numerical value. * * The prerequisite is that in the header the type was already declared: * - * DECLARE_MENU_EDIT_TYPE(int16_t, int3, i16tostr3, 1) + * DEFINE_MENU_EDIT_ITEM_TYPE(int16_t, int3, i16tostr3, 1) * - * For example, DEFINE_MENU_EDIT_ITEM(int3) expands into these functions: + * For example, DEFINE_MENU_EDIT_ITEM(int3) expands into: * - * bool MenuItem_int3::_edit(); - * void MenuItem_int3::edit(); // edit int16_t (interactively) - * void MenuItem_int3::action_edit(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback = null, const bool live = false); + * template class TMenuEditItem * * You can then use one of the menu macros to present the edit interface: - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) + * EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999) * * This expands into a more primitive menu item: - * MENU_ITEM_VARIANT(int3, _edit, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * _MENU_ITEM_P(int3, false, GET_TEXT(MSG_SPEED), &feedrate_percentage, 10, 999) * * ...which calls: - * MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999) + * MenuItem_int3::draw(encoderLine == _thisItemNr, _lcdLineNr, plabel, &feedrate_percentage, 10, 999) */ -void MenuItemBase::edit(strfunc_t strfunc, loadfunc_t loadfunc) { - ui.encoder_direction_normal(); - if (int16_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; - if (int16_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue; +void MenuEditItemBase::edit_screen(strfunc_t strfunc, loadfunc_t loadfunc) { + #if ENABLED(TOUCH_BUTTONS) + ui.repeat_delay = BUTTON_DELAY_EDIT; + #endif + if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; + if (int32_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue; if (ui.should_draw()) - draw_edit_screen(editLabel, strfunc(ui.encoderPosition + minEditValue)); + draw_edit_screen(strfunc(ui.encoderPosition + minEditValue)); if (ui.lcd_clicked || (liveEdit && ui.should_draw())) { if (editValue != nullptr) loadfunc(editValue, ui.encoderPosition + minEditValue); if (callbackFunc && (liveEdit || ui.lcd_clicked)) (*callbackFunc)(); @@ -142,7 +158,17 @@ void MenuItemBase::edit(strfunc_t strfunc, loadfunc_t loadfunc) { } } -void MenuItemBase::init(PGM_P const el, void * const ev, const int32_t minv, const int32_t maxv, const uint16_t ep, const screenFunc_t cs, const screenFunc_t cb, const bool le) { +void MenuEditItemBase::goto_edit_screen( + PGM_P const el, // Edit label + void * const ev, // Edit value pointer + const int32_t minv, // Encoder minimum + const int32_t maxv, // Encoder maximum + const uint16_t ep, // Initial encoder value + const screenFunc_t cs, // MenuItem_type::draw_edit_screen => MenuEditItemBase::edit() + const screenFunc_t cb, // Callback after edit + const bool le // Flag to call cb() during editing +) { + ui.screen_changed = true; ui.save_previous_screen(); ui.refresh(); editLabel = el; @@ -155,28 +181,31 @@ void MenuItemBase::init(PGM_P const el, void * const ev, const int32_t minv, con liveEdit = le; } -#define DEFINE_MENU_EDIT_ITEM(NAME) template class TMenuItem +// TODO: Remove these but test build size with and without +#define DEFINE_MENU_EDIT_ITEM(NAME) template class TMenuEditItem +DEFINE_MENU_EDIT_ITEM(percent); // 100% right-justified DEFINE_MENU_EDIT_ITEM(int3); // 123, -12 right-justified DEFINE_MENU_EDIT_ITEM(int4); // 1234, -123 right-justified DEFINE_MENU_EDIT_ITEM(int8); // 123, -12 right-justified DEFINE_MENU_EDIT_ITEM(uint8); // 123 right-justified -DEFINE_MENU_EDIT_ITEM(uint16_3); // 123, -12 right-justified +DEFINE_MENU_EDIT_ITEM(uint16_3); // 123 right-justified DEFINE_MENU_EDIT_ITEM(uint16_4); // 1234 right-justified DEFINE_MENU_EDIT_ITEM(uint16_5); // 12345 right-justified DEFINE_MENU_EDIT_ITEM(float3); // 123 right-justified -DEFINE_MENU_EDIT_ITEM(float52); // 123.45 +DEFINE_MENU_EDIT_ITEM(float52); // _2.34, 12.34, -2.34 or 123.45, -23.45 DEFINE_MENU_EDIT_ITEM(float43); // 1.234 DEFINE_MENU_EDIT_ITEM(float5); // 12345 right-justified DEFINE_MENU_EDIT_ITEM(float5_25); // 12345 right-justified (25 increment) DEFINE_MENU_EDIT_ITEM(float51); // 1234.5 right-justified +DEFINE_MENU_EDIT_ITEM(float41sign); // +123.4 DEFINE_MENU_EDIT_ITEM(float51sign); // +1234.5 DEFINE_MENU_EDIT_ITEM(float52sign); // +123.45 DEFINE_MENU_EDIT_ITEM(long5); // 12345 right-justified DEFINE_MENU_EDIT_ITEM(long5_25); // 12345 right-justified (25 increment) -void MenuItem_bool::action_edit(PGM_P pstr, bool *ptr, screenFunc_t callback) { - UNUSED(pstr); *ptr ^= true; ui.refresh(); +void MenuItem_bool::action(PGM_P const, bool * const ptr, screenFunc_t callback) { + *ptr ^= true; ui.refresh(); if (callback) (*callback)(); } @@ -184,13 +213,10 @@ void MenuItem_bool::action_edit(PGM_P pstr, bool *ptr, screenFunc_t callback) { ///////////////// Menu Tree //////////////// //////////////////////////////////////////// -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - float lcd_z_fade_height; - void _lcd_set_z_fade_height() { set_z_fade_height(lcd_z_fade_height); } -#endif +#include "../../Marlin.h" bool printer_busy() { - return planner.movesplanned() || IS_SD_PRINTING() || print_job_timer.isRunning(); + return planner.movesplanned() || printingIsActive(); } /** @@ -199,9 +225,12 @@ bool printer_busy() { void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) { if (currentScreen != screen) { - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - // Shadow for editing the fade height - lcd_z_fade_height = planner.z_fade_height; + #if ENABLED(TOUCH_BUTTONS) + repeat_delay = BUTTON_DELAY_MENU; + #endif + + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) + progress_reset(); #endif #if BOTH(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING) @@ -272,7 +301,11 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co drawing_screen = false; #endif - set_ui_selection(false); + #if HAS_LCD_MENU + encoder_direction_normal(); + #endif + + set_selection(false); } } @@ -288,7 +321,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co static PGM_P sync_message; void MarlinUI::_synchronize() { - if (should_draw()) draw_menu_item_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message); + if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message); if (no_reentry) return; // Make this the current handler till all moves are done no_reentry = true; @@ -302,8 +335,7 @@ void MarlinUI::_synchronize() { // Display the synchronize screen with a custom message // ** This blocks the command queue! ** void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) { - static const char moving[] PROGMEM = MSG_MOVING; - sync_message = msg ? msg : moving; + sync_message = msg ?: GET_TEXT(MSG_MOVING); _synchronize(); } @@ -320,10 +352,10 @@ void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) { void scroll_screen(const uint8_t limit, const bool is_menu) { ui.encoder_direction_menus(); ENCODER_RATE_MULTIPLY(false); - if (ui.encoderPosition > 0x8000) ui.encoderPosition = 0; + if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; if (ui.first_page) { encoderLine = ui.encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); - screen_changed = false; + ui.screen_changed = false; } if (screen_items > 0 && encoderLine >= screen_items - limit) { encoderLine = _MAX(0, screen_items - limit); @@ -338,19 +370,21 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { encoderTopLine = encoderLine; } -void MarlinUI::completion_feedback(const bool good/*=true*/) { - if (good) { - BUZZ(100, 659); - BUZZ(100, 698); +#if HAS_BUZZER + void MarlinUI::completion_feedback(const bool good/*=true*/) { + if (good) { + BUZZ(100, 659); + BUZZ(100, 698); + } + else BUZZ(20, 440); } - else BUZZ(20, 440); -} +#endif #if HAS_LINE_TO_Z void line_to_z(const float &z) { - current_position[Z_AXIS] = z; - planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder); + current_position.z = z; + line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.z)); } #endif @@ -367,16 +401,15 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) { #else constexpr bool do_probe = true; #endif - ui.encoder_direction_normal(); if (ui.encoderPosition) { - const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR); + const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR_Z); ui.encoderPosition = 0; const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment, - new_probe_offset = zprobe_zoffset + diff, + new_probe_offset = probe_offset.z + diff, new_offs = #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff + do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff #else new_probe_offset #endif @@ -385,9 +418,9 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) { babystep.add_steps(Z_AXIS, babystep_increment); - if (do_probe) zprobe_zoffset = new_offs; + if (do_probe) probe_offset.z = new_offs; #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - else hotend_offset[Z_AXIS][active_extruder] = new_offs; + else hotend_offset[active_extruder].z = new_offs; #endif ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); @@ -396,13 +429,13 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) { if (ui.should_draw()) { #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) if (!do_probe) - draw_edit_screen(PSTR(MSG_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder])); + MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), ftostr43sign(hotend_offset[active_extruder].z)); else #endif - draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); + MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), ftostr43sign(probe_offset.z)); #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) - if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_zoffset); + if (do_probe) _lcd_zoffset_overlay_gfx(probe_offset.z); #endif } } @@ -426,14 +459,25 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) { #endif #if ENABLED(EEPROM_SETTINGS) - void lcd_store_settings() { ui.completion_feedback(settings.save()); } - void lcd_load_settings() { ui.completion_feedback(settings.load()); } + void lcd_store_settings() { + const bool saved = settings.save(); + #if HAS_BUZZER + ui.completion_feedback(saved); + #endif + UNUSED(saved); + } + void lcd_load_settings() { + const bool loaded = settings.load(); + #if HAS_BUZZER + ui.completion_feedback(loaded); + #endif + UNUSED(loaded); + } #endif void _lcd_draw_homing() { constexpr uint8_t line = (LCD_HEIGHT - 1) / 2; - if (ui.should_draw()) draw_menu_item_static(line, PSTR(MSG_LEVEL_BED_HOMING)); - ui.refresh(LCDVIEW_CALL_NO_REDRAW); + if (ui.should_draw()) MenuItem_static::draw(line, GET_TEXT(MSG_LEVEL_BED_HOMING)); } #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) @@ -444,14 +488,18 @@ void _lcd_draw_homing() { // // Selection screen presents a prompt and two options // -bool ui_selection; // = false -void set_ui_selection(const bool sel) { ui_selection = sel; } -void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - if (ui.encoderPosition) { - ui_selection = int16_t(ui.encoderPosition) > 0; - ui.encoderPosition = 0; +bool MarlinUI::selection; // = false +bool MarlinUI::update_selection() { + encoder_direction_select(); + if (encoderPosition) { + selection = int16_t(encoderPosition) > 0; + encoderPosition = 0; } - const bool got_click = ui.use_click(); + return selection; +} + +void MenuItem_confirm::select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { + const bool ui_selection = ui.update_selection(), got_click = ui.use_click(); if (got_click || ui.should_draw()) { draw_select_screen(yes, no, ui_selection, pref, string, suff); if (got_click) { ui_selection ? yesFunc() : noFunc(); } diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 7bd1c819cd32..ce821d0dd2b6 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -28,201 +28,277 @@ #include "limits.h" extern int8_t encoderLine, encoderTopLine, screen_items; -extern bool screen_changed; -constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); +#if HOTENDS + constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP); +#endif void scroll_screen(const uint8_t limit, const bool is_menu); bool printer_busy(); -//////////////////////////////////////////// -////////// Menu Item Numeric Types ///////// -//////////////////////////////////////////// - -#define DECLARE_MENU_EDIT_TYPE(TYPE, NAME, STRFUNC, SCALE) \ - struct MenuItemInfo_##NAME { \ - typedef TYPE type_t; \ - static constexpr float scale = SCALE; \ - static inline char* strfunc(const float value) { return STRFUNC((TYPE) value); } \ - }; - -DECLARE_MENU_EDIT_TYPE(uint8_t, percent, ui8tostr4pct, 1 ); // 100% right-justified -DECLARE_MENU_EDIT_TYPE(int16_t, int3, i16tostr3, 1 ); // 123, -12 right-justified -DECLARE_MENU_EDIT_TYPE(int16_t, int4, i16tostr4sign, 1 ); // 1234, -123 right-justified -DECLARE_MENU_EDIT_TYPE(int8_t, int8, i8tostr3, 1 ); // 123, -12 right-justified -DECLARE_MENU_EDIT_TYPE(uint8_t, uint8, ui8tostr3, 1 ); // 123 right-justified -DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_3, ui16tostr3, 1 ); // 123 right-justified -DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_4, ui16tostr4, 0.1 ); // 1234 right-justified -DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_5, ui16tostr5, 0.01 ); // 12345 right-justified -DECLARE_MENU_EDIT_TYPE(float, float3, ftostr3, 1 ); // 123 right-justified -DECLARE_MENU_EDIT_TYPE(float, float52, ftostr42_52, 100 ); // _2.34, 12.34, -2.34 or 123.45, -23.45 -DECLARE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000 ); // 1.234 -DECLARE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f ); // 12345 right-justified -DECLARE_MENU_EDIT_TYPE(float, float5_25, ftostr5rj, 0.04f ); // 12345 right-justified (25 increment) -DECLARE_MENU_EDIT_TYPE(float, float51, ftostr51rj, 10 ); // _1234.5 right-justified -DECLARE_MENU_EDIT_TYPE(float, float51sign, ftostr51sign, 10 ); // +1234.5 -DECLARE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100 ); // +123.45 -DECLARE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f ); // 12345 right-justified -DECLARE_MENU_EDIT_TYPE(uint32_t, long5_25, ftostr5rj, 0.04f ); // 12345 right-justified (25 increment) - -//////////////////////////////////////////// -///////// Menu Item Draw Functions ///////// -//////////////////////////////////////////// - typedef void (*selectFunc_t)(); -void draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff); -void set_ui_selection(const bool sel); -void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr); -inline void do_select_screen_yn(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) { - do_select_screen(PSTR(MSG_YES), PSTR(MSG_NO), yesFunc, noFunc, pref, string, suff); -} - -void draw_edit_screen(PGM_P const pstr, const char* const value=nullptr); -void draw_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char); -void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const bool center=true, const bool invert=false, const char *valstr=nullptr); -void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm); -FORCE_INLINE void draw_menu_item_back(const bool sel, const uint8_t row, PGM_P const pstr) { draw_menu_item(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); } -FORCE_INLINE void draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { _draw_menu_item_edit(sel, row, pstr, data, false); } -FORCE_INLINE void draw_menu_item_edit_P(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { _draw_menu_item_edit(sel, row, pstr, data, true); } -#define draw_menu_item_submenu(sel, row, pstr, data) draw_menu_item(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]) -#define draw_menu_item_gcode(sel, row, pstr, gcode) draw_menu_item(sel, row, pstr, '>', ' ') -#define draw_menu_item_function(sel, row, pstr, data) draw_menu_item(sel, row, pstr, '>', ' ') -#define DRAW_MENU_ITEM_SETTING_EDIT_GENERIC(VAL) draw_menu_item_edit(sel, row, pstr, VAL) -#define DRAW_BOOL_SETTING(sel, row, pstr, data) draw_menu_item_edit_P(sel, row, pstr, (*(data))?PSTR(MSG_LCD_ON):PSTR(MSG_LCD_OFF)) -#if ENABLED(SDSUPPORT) - class CardReader; - void draw_sd_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir); - FORCE_INLINE void draw_menu_item_sdfile(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { draw_sd_menu_item(sel, row, pstr, theCard, false); } - FORCE_INLINE void draw_menu_item_sdfolder(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { draw_sd_menu_item(sel, row, pstr, theCard, true); } -#endif +#define SS_LEFT 0x00 +#define SS_CENTER 0x01 +#define SS_INVERT 0x02 +#define SS_DEFAULT SS_CENTER #if HAS_GRAPHICAL_LCD && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) void _lcd_zoffset_overlay_gfx(const float zvalue); #endif //////////////////////////////////////////// -/////// Edit Setting Draw Functions //////// +///////////// Base Menu Items ////////////// //////////////////////////////////////////// -#define _DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(TYPE, NAME, STRFUNC) \ - FORCE_INLINE void draw_menu_item_edit_##NAME (const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const pstr2, TYPE * const data, ...) { \ - UNUSED(pstr2); \ - DRAW_MENU_ITEM_SETTING_EDIT_GENERIC(STRFUNC(*(data))); \ - } \ - FORCE_INLINE void draw_menu_item_edit_accessor_##NAME (const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const pstr2, TYPE (*pget)(), void (*pset)(TYPE), ...) { \ - UNUSED(pstr2); UNUSED(pset); \ - DRAW_MENU_ITEM_SETTING_EDIT_GENERIC(STRFUNC(pget())); \ - } \ - typedef void NAME##_void -#define DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(NAME) _DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(MenuItemInfo_##NAME::type_t, NAME, MenuItemInfo_##NAME::strfunc) - -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(percent); // 100% right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int3); // 123, -12 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int4); // 1234, -123 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int8); // 123, -12 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint8); // 123 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_3); // 123 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_4); // 1234 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_5); // 12345 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float3); // 123 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52); // _2.34, 12.34, -2.34 or 123.45, -23.45 -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float43); // 1.234 -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float5); // 12345 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float5_25); // 12345 right-justified (25 increment) -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float51); // _1234.5 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float51sign); // +1234.5 -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52sign); // +123.45 -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(long5); // 12345 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(long5_25); // 12345 right-justified (25 increment) - -#define draw_menu_item_edit_bool(sel, row, pstr, pstr2, data, ...) DRAW_BOOL_SETTING(sel, row, pstr, data) -#define draw_menu_item_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, data) +class MenuItemBase { + public: + // An index to interject in the item label and for + // use by the action + static uint8_t itemIndex; -//////////////////////////////////////////// -/////////////// Menu Actions /////////////// -//////////////////////////////////////////// + // Store the index of the item ahead of use by indexed items + FORCE_INLINE static void init(const uint8_t ind) { itemIndex = ind; } + + // Draw an item either selected (pre_char) or not (space) with post_char + static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char); + + // Draw an item either selected ('>') or not (space) with post_char + FORCE_INLINE static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char post_char) { + _draw(sel, row, pstr, '>', post_char); + } +}; + +class MenuItem_static : public MenuItemBase { + public: + static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const valstr=nullptr); +}; + +// CONFIRM_ITEM(LABEL,Y,N,FY,FN,V...), +// YESNO_ITEM(LABEL,FY,FN,V...) +class MenuItem_confirm : public MenuItemBase { + public: + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { + _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); + } + // Implemented for HD44780 and DOGM + // Draw the prompt, buttons, and state + static void draw_select_screen( + PGM_P const yes, // Right option label + PGM_P const no, // Left option label + const bool yesno, // Is "yes" selected? + PGM_P const pref, // Prompt prefix + const char * const string, // Prompt runtime string + PGM_P const suff // Prompt suffix + ); + static void select_screen( + PGM_P const yes, PGM_P const no, + selectFunc_t yesFunc, selectFunc_t noFunc, + PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr + ); + static inline void select_screen( + PGM_P const yes, PGM_P const no, + selectFunc_t yesFunc, selectFunc_t noFunc, + PGM_P const pref, const progmem_str string, PGM_P const suff=nullptr + ) { + char str[strlen_P((PGM_P)string) + 1]; + strcpy_P(str, (PGM_P)string); + select_screen(yes, no, yesFunc, noFunc, pref, str, suff); + } + // Shortcut for prompt with "NO"/ "YES" labels + FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) { + select_screen(GET_TEXT(MSG_YES), GET_TEXT(MSG_NO), yesFunc, noFunc, pref, string, suff); + } +}; + +// BACK_ITEM(LABEL) +class MenuItem_back : public MenuItemBase { + public: + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr) { + _draw(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); + } + // Back Item action goes back one step in history + FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); } +}; -class MenuItem_back { +// SUBMENU(LABEL, screen_handler) +class MenuItem_submenu : public MenuItemBase { public: - static inline void action() { ui.goto_previous_screen(); } + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { + _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); + } + static inline void action(PGM_P const, const screenFunc_t func) { ui.save_previous_screen(); ui.goto_screen(func); } }; -class MenuItem_submenu { +// Any menu item that invokes an immediate action +class MenuItem_button : public MenuItemBase { public: - static inline void action(const screenFunc_t func) { ui.save_previous_screen(); ui.goto_screen(func); } + // Button-y Items are selectable lines with no other indicator + static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { + _draw(sel, row, pstr, '>', ' '); + } }; -class MenuItem_gcode { +// GCODES_ITEM(LABEL, GCODES) +class MenuItem_gcode : public MenuItem_button { public: - static void action(const char * const pgcode); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { + _draw(sel, row, pstr, '>', ' '); + } + static void action(PGM_P const, const char * const pgcode); + static inline void action(PGM_P const pstr, const uint8_t, const char * const pgcode) { action(pstr, pgcode); } }; -class MenuItem_function { +// ACTION_ITEM(LABEL, FUNC) +class MenuItem_function : public MenuItem_button { public: - static inline void action(const menuAction_t func) { (*func)(); }; + //static inline void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); }; + static inline void action(PGM_P const, const menuAction_t func) { (*func)(); }; }; +#if ENABLED(SDSUPPORT) + class CardReader; + class MenuItem_sdbase { + public: + // Implemented for HD44780 and DOGM + static void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir); + }; +#endif + //////////////////////////////////////////// -/////////// Menu Editing Actions /////////// +///////////// Edit Menu Items ////////////// //////////////////////////////////////////// -class MenuItemBase { +// The Menu Edit shadow value +typedef union { + bool state; + float decimal; + int8_t int8; + int16_t int16; + int32_t int32; + uint8_t uint8; + uint16_t uint16; + uint32_t uint32; +} chimera_t; +extern chimera_t editable; + +// Base class for Menu Edit Items +class MenuEditItemBase : public MenuItemBase { private: + // These values are statically constructed by init() via action() + // The action() method acts like the instantiator. The entire lifespan + // of a menu item is within its declaration, so all these values decompose + // into behavior and unused items get optimized out. static PGM_P editLabel; static void *editValue; - static int32_t minEditValue, maxEditValue; + static int32_t minEditValue, maxEditValue; // Encoder value range static screenFunc_t callbackFunc; static bool liveEdit; protected: - typedef char* (*strfunc_t)(const int32_t); + typedef const char* (*strfunc_t)(const int32_t); typedef void (*loadfunc_t)(void *, const int32_t); - static void init(PGM_P const el, void * const ev, const int32_t minv, const int32_t maxv, const uint16_t ep, const screenFunc_t cs, const screenFunc_t cb, const bool le); - static void edit(strfunc_t, loadfunc_t); + static void goto_edit_screen( + PGM_P const el, // Edit label + void * const ev, // Edit value pointer + const int32_t minv, // Encoder minimum + const int32_t maxv, // Encoder maximum + const uint16_t ep, // Initial encoder value + const screenFunc_t cs, // MenuItem_type::draw_edit_screen => MenuEditItemBase::edit() + const screenFunc_t cb, // Callback after edit + const bool le // Flag to call cb() during editing + ); + static void edit_screen(strfunc_t, loadfunc_t); // Edit value handler + public: + // Implemented for HD44780 and DOGM + // Draw the current item at specified row with edit data + static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm=false); + + // Implemented for HD44780 and DOGM + // This low-level method is good to draw from anywhere + static void draw_edit_screen(PGM_P const pstr, const char* const value); + + // This method is for the current menu item + static inline void draw_edit_screen(const char* const value) { draw_edit_screen(editLabel, value); } }; +// Template for specific Menu Edit Item Types template -class TMenuItem : MenuItemBase { +class TMenuEditItem : MenuEditItemBase { private: typedef typename NAME::type_t type_t; static inline float unscale(const float value) { return value * (1.0f / NAME::scale); } static inline float scale(const float value) { return value * NAME::scale; } static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); } - static char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); } + static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); } public: - static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=nullptr, const bool live=false) { - // Make sure minv and maxv fit within int16_t - const int32_t minv = _MAX(scale(minValue), INT_MIN), - maxv = _MIN(scale(maxValue), INT_MAX); - init(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, edit, callback, live); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t * const data, ...) { + MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(*(data))); + } + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t (*pget)(), ...) { + MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(pget())); + } + // Edit screen for this type of item + static void edit_screen() { MenuEditItemBase::edit_screen(to_string, load); } + static void action( + PGM_P const pstr, // Edit label + type_t * const ptr, // Value pointer + const type_t minValue, // Value range + const type_t maxValue, + const screenFunc_t callback=nullptr, // Value update callback + const bool live=false // Callback during editing + ) { + // Make sure minv and maxv fit within int32_t + const int32_t minv = _MAX(scale(minValue), INT32_MIN), + maxv = _MIN(scale(maxValue), INT32_MAX); + goto_edit_screen(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, + edit_screen, callback, live); } - static void edit() { MenuItemBase::edit(to_string, load); } }; -#define DECLARE_MENU_EDIT_ITEM(NAME) typedef TMenuItem MenuItem_##NAME; - -DECLARE_MENU_EDIT_ITEM(percent); -DECLARE_MENU_EDIT_ITEM(int3); -DECLARE_MENU_EDIT_ITEM(int4); -DECLARE_MENU_EDIT_ITEM(int8); -DECLARE_MENU_EDIT_ITEM(uint8); -DECLARE_MENU_EDIT_ITEM(uint16_3); -DECLARE_MENU_EDIT_ITEM(uint16_4); -DECLARE_MENU_EDIT_ITEM(uint16_5); -DECLARE_MENU_EDIT_ITEM(float3); -DECLARE_MENU_EDIT_ITEM(float52); -DECLARE_MENU_EDIT_ITEM(float43); -DECLARE_MENU_EDIT_ITEM(float5); -DECLARE_MENU_EDIT_ITEM(float5_25); -DECLARE_MENU_EDIT_ITEM(float51); -DECLARE_MENU_EDIT_ITEM(float51sign); -DECLARE_MENU_EDIT_ITEM(float52sign); -DECLARE_MENU_EDIT_ITEM(long5); -DECLARE_MENU_EDIT_ITEM(long5_25); - -class MenuItem_bool { +// Provide a set of Edit Item Types which encompass a primitive +// type, a string function, and a scale factor for edit and display. +// These items call the Edit Item draw method passing the prepared string. +#define DEFINE_MENU_EDIT_ITEM_TYPE(TYPE, NAME, STRFUNC, SCALE) \ + struct MenuEditItemInfo_##NAME { \ + typedef TYPE type_t; \ + static constexpr float scale = SCALE; \ + static inline const char* strfunc(const float value) { return STRFUNC((TYPE)value); } \ + }; \ + typedef TMenuEditItem MenuItem_##NAME + +// TYPE NAME STRFUNC SCALE +DEFINE_MENU_EDIT_ITEM_TYPE(uint8_t, percent, ui8tostr4pct, 100.0/255); // 100% right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(int16_t, int3, i16tostr3, 1 ); // 123, -12 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(int16_t, int4, i16tostr4sign, 1 ); // 1234, -123 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(int8_t, int8, i8tostr3, 1 ); // 123, -12 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(uint8_t, uint8, ui8tostr3, 1 ); // 123 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(uint16_t, uint16_3, ui16tostr3, 1 ); // 123 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(uint16_t, uint16_4, ui16tostr4, 0.1 ); // 1234 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(uint16_t, uint16_5, ui16tostr5, 0.01 ); // 12345 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float, float3, ftostr3, 1 ); // 123 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float, float52, ftostr42_52, 100 ); // _2.34, 12.34, -2.34 or 123.45, -23.45 +DEFINE_MENU_EDIT_ITEM_TYPE(float, float43, ftostr43sign, 1000 ); // 1.234 +DEFINE_MENU_EDIT_ITEM_TYPE(float, float5, ftostr5rj, 1 ); // 12345 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float, float5_25, ftostr5rj, 0.04f ); // 12345 right-justified (25 increment) +DEFINE_MENU_EDIT_ITEM_TYPE(float, float51, ftostr51rj, 10 ); // 1234.5 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float, float41sign, ftostr41sign, 10 ); // +123.4 +DEFINE_MENU_EDIT_ITEM_TYPE(float, float51sign, ftostr51sign, 10 ); // +1234.5 +DEFINE_MENU_EDIT_ITEM_TYPE(float, float52sign, ftostr52sign, 100 ); // +123.45 +DEFINE_MENU_EDIT_ITEM_TYPE(uint32_t, long5, ftostr5rj, 0.01f ); // 12345 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(uint32_t, long5_25, ftostr5rj, 0.04f ); // 12345 right-justified (25 increment) + +class MenuItem_bool : public MenuEditItemBase { public: - static void action_edit(PGM_P const pstr, bool* ptr, const screenFunc_t callbackFunc=nullptr); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const bool onoff) { + MenuEditItemBase::draw(sel, row, pstr, onoff ? GET_TEXT(MSG_LCD_ON) : GET_TEXT(MSG_LCD_OFF), true); + } + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, bool * const data, ...) { + draw(sel, row, pstr, *data); + } + FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const, bool (*pget)(), ...) { + draw(sel, row, pstr, pget()); + } + static void action(PGM_P const pstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr); }; //////////////////////////////////////////// @@ -237,8 +313,10 @@ class MenuItem_bool { * _menuLineNr is the menu item to draw and process * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM */ -#define SCREEN_OR_MENU_LOOP() \ +#define SCREEN_OR_MENU_LOOP(IS_MENU) \ + scroll_screen(IS_MENU ? 1 : LCD_HEIGHT, IS_MENU); \ int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ + bool _skipStatic = IS_MENU; \ for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \ _thisItemNr = 0 @@ -249,24 +327,12 @@ class MenuItem_bool { * START_MENU Opening code for a screen with menu items. * Scroll as-needed to keep the selected line in view. */ -#define START_SCREEN() \ - scroll_screen(LCD_HEIGHT, false); \ - bool _skipStatic = false; \ - SCREEN_OR_MENU_LOOP() - -#define START_MENU() \ - scroll_screen(1, true); \ - bool _skipStatic = true; \ - SCREEN_OR_MENU_LOOP() - -#define END_SCREEN() \ - } \ - screen_items = _thisItemNr - -#define END_MENU() \ - } \ - screen_items = _thisItemNr; \ - UNUSED(_skipStatic) +#define START_SCREEN() SCREEN_OR_MENU_LOOP(false) +#define START_MENU() SCREEN_OR_MENU_LOOP(true) +#define NEXT_ITEM() (++_thisItemNr) +#define SKIP_ITEM() NEXT_ITEM() +#define END_SCREEN() } screen_items = _thisItemNr +#define END_MENU() END_SCREEN(); UNUSED(_skipStatic) #if ENABLED(ENCODER_RATE_MULTIPLIER) #define ENCODER_RATE_MULTIPLY(F) (ui.encoderRateMultiplierEnabled = F) @@ -280,69 +346,156 @@ class MenuItem_bool { /** * MENU_ITEM generates draw & handler code for a menu item, potentially calling: * - * draw_menu_item_[_variant](sel, row, label, arg3...) - * MenuItem_::action[_variant](arg3...) + * MenuItem_::draw(sel, row, label, arg3...) + * MenuItem_::action(arg3...) * * Examples: - * MENU_ITEM(back, MSG_WATCH, 0 [dummy parameter] ) - * or - * MENU_BACK(MSG_WATCH) - * draw_menu_item_back(sel, row, PSTR(MSG_WATCH)) - * MenuItem_back::action() - * - * MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause) - * draw_menu_item_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) - * MenuItem_function::action(lcd_sdcard_pause) + * BACK_ITEM(MSG_WATCH) + * MenuItem_back::action(plabel, ...) + * MenuItem_back::draw(sel, row, plabel, ...) * - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * draw_menu_item_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * ACTION_ITEM(MSG_PAUSE_PRINT, lcd_sdcard_pause) + * MenuItem_function::action(plabel, lcd_sdcard_pause) + * MenuItem_function::draw(sel, row, plabel, lcd_sdcard_pause) * + * EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999) + * MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999) + * MenuItem_int3::draw(sel, row, plabel, &feedrate_percentage, 10, 999) */ -#define _MENU_ITEM_VARIANT_P(TYPE, VARIANT, USE_MULTIPLIER, PLABEL, ...) do { \ - _skipStatic = false; \ - if (_menuLineNr == _thisItemNr) { \ - if (encoderLine == _thisItemNr && ui.use_click()) { \ - _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ - MenuItem_##TYPE ::action ## VARIANT(__VA_ARGS__); \ - if (screen_changed) return; \ - } \ - if (ui.should_draw()) \ - draw_menu_item ## VARIANT ## _ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ - } \ - ++_thisItemNr; \ + +#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, PLABEL, V...) do { \ + PGM_P const plabel = PLABEL; \ + if (encoderLine == _thisItemNr && ui.use_click()) { \ + _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ + MenuItem_##TYPE::action(plabel, ##V); \ + if (ui.screen_changed) return; \ + } \ + if (ui.should_draw()) \ + MenuItem_##TYPE::draw \ + (encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V); \ }while(0) -// Used to print static text with no visible cursor. -// Parameters: label [, bool center [, bool invert [, char *value] ] ] -#define STATIC_ITEM_P(PLABEL, ...) do{ \ - if (_menuLineNr == _thisItemNr) { \ - if (_skipStatic && encoderLine <= _thisItemNr) { \ - ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - if (ui.should_draw()) \ - draw_menu_item_static(_lcdLineNr, PLABEL, ## __VA_ARGS__); \ - } \ - ++_thisItemNr; \ +#define _MENU_ITEM_P(TYPE, V...) do { \ + _skipStatic = false; \ + if (_menuLineNr == _thisItemNr) \ + _MENU_INNER_P(TYPE, ##V); \ + NEXT_ITEM(); \ +}while(0) + +// Indexed items set a global index value +#define _MENU_ITEM_N_P(TYPE, N, V...) do{ \ + _skipStatic = false; \ + if (_menuLineNr == _thisItemNr) { \ + MenuItemBase::init(N); \ + _MENU_INNER_P(TYPE, ##V); \ + } \ + NEXT_ITEM(); \ +}while(0) + +// STATIC_ITEM draws a styled string with no highlight. +// Parameters: label [, style [, char *value] ] + +#define STATIC_ITEM_INNER_P(PLABEL, V...) do{ \ + if (_skipStatic && encoderLine <= _thisItemNr) { \ + ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ + ++encoderLine; \ + } \ + if (ui.should_draw()) \ + MenuItem_static::draw(_lcdLineNr, PLABEL, ##V); \ +} while(0) + +#define STATIC_ITEM_P(PLABEL, V...) do{ \ + if (_menuLineNr == _thisItemNr) \ + STATIC_ITEM_INNER_P(PLABEL, ##V); \ + NEXT_ITEM(); \ } while(0) -#define MENU_ITEM_ADDON_START(X) do{ \ - if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \ - SETCURSOR(X, _lcdLineNr) +#define STATIC_ITEM_N_P(PLABEL, N, V...) do{ \ + if (_menuLineNr == _thisItemNr) { \ + MenuItemBase::init(N); \ + STATIC_ITEM_INNER_P(PLABEL, ##V); \ + } \ + NEXT_ITEM(); \ +}while(0) + +#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_P( GET_TEXT(LABEL), ##V) +#define STATIC_ITEM_N(LABEL, N, V...) STATIC_ITEM_N_P(GET_TEXT(LABEL), ##V) + +#define MENU_ITEM_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, false, PLABEL, ##V) +#define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_P(TYPE, GET_TEXT(LABEL), ##V) + +#define MENU_ITEM_N_P(TYPE, N, PLABEL, V...) _MENU_ITEM_N_P(TYPE, N, false, PLABEL, ##V) +#define MENU_ITEM_N(TYPE, N, LABEL, V...) MENU_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V) + +#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL) -#define MENU_ITEM_ADDON_END() } }while(0) +#define ACTION_ITEM_P(PLABEL, ACTION) MENU_ITEM_P(function, PLABEL, ACTION) +#define ACTION_ITEM(LABEL, ACTION) ACTION_ITEM_P(GET_TEXT(LABEL), ACTION) -#define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) +#define ACTION_ITEM_N_P(N, PLABEL, ACTION) MENU_ITEM_N_P(function, N, PLABEL, ACTION) +#define ACTION_ITEM_N(N, LABEL, ACTION) ACTION_ITEM_N_P(N, GET_TEXT(LABEL), ACTION) -#define MENU_BACK(LABEL) MENU_ITEM(back, LABEL) -#define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) -#define MENU_ITEM_P(TYPE, PLABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, , false, PLABEL, ## __VA_ARGS__) -#define MENU_ITEM(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, , false, PSTR(LABEL), ## __VA_ARGS__) -#define MENU_ITEM_EDIT(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, false, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, false, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, true, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, true, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) +#define GCODES_ITEM_P(PLABEL, GCODES) MENU_ITEM_P(gcode, PLABEL, GCODES) +#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_P(GET_TEXT(LABEL), GCODES) + +#define GCODES_ITEM_N_P(N, PLABEL, GCODES) MENU_ITEM_N_P(gcode, N, PLABEL, GCODES) +#define GCODES_ITEM_N(N, LABEL, GCODES) GCODES_ITEM_N_P(N, GET_TEXT(LABEL), GCODES) + +#define SUBMENU_P(PLABEL, DEST) MENU_ITEM_P(submenu, PLABEL, DEST) +#define SUBMENU(LABEL, DEST) SUBMENU_P(GET_TEXT(LABEL), DEST) + +#define SUBMENU_N_P(N, PLABEL, DEST) MENU_ITEM_N_P(submenu, N, PLABEL, DEST) +#define SUBMENU_N(N, LABEL, DEST) SUBMENU_N_P(N, GET_TEXT(LABEL), DEST) + +#define EDIT_ITEM_P(TYPE, PLABEL, V...) MENU_ITEM_P(TYPE, PLABEL, ##V) +#define EDIT_ITEM(TYPE, LABEL, V...) EDIT_ITEM_P(TYPE, GET_TEXT(LABEL), ##V) + +#define EDIT_ITEM_N_P(TYPE, N, PLABEL, V...) MENU_ITEM_N_P(TYPE, N, PLABEL, ##V) +#define EDIT_ITEM_N(TYPE, N, LABEL, V...) EDIT_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V) + +#define EDIT_ITEM_FAST_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, true, PLABEL, ##V) +#define EDIT_ITEM_FAST(TYPE, LABEL, V...) EDIT_ITEM_FAST_P(TYPE, GET_TEXT(LABEL), ##V) + +#define EDIT_ITEM_FAST_N_P(TYPE, N, PLABEL, V...) _MENU_ITEM_N_P(TYPE, N, true, PLABEL, ##V) +#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...) EDIT_ITEM_FAST_N_P(TYPE, N, GET_TEXT(LABEL), ##V) + +#define _CONFIRM_ITEM_INNER_P(PLABEL, V...) do { \ + if (encoderLine == _thisItemNr && ui.use_click()) { \ + ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \ + return; \ + } \ + if (ui.should_draw()) MenuItem_confirm::draw \ + (encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V); \ +}while(0) + +#define _CONFIRM_ITEM_P(PLABEL, V...) do { \ + _skipStatic = false; \ + if (_menuLineNr == _thisItemNr) \ + _CONFIRM_ITEM_INNER_P(PLABEL, ##V); \ + NEXT_ITEM(); \ +}while(0) + +// Indexed items set a global index value +#define _CONFIRM_ITEM_N_P(N, V...) do{ \ + _skipStatic = false; \ + if (_menuLineNr == _thisItemNr) { \ + MenuItemBase::init(N); \ + _CONFIRM_ITEM_INNER_P(TYPE, ##V); \ + } \ + NEXT_ITEM(); \ +}while(0) + +#define CONFIRM_ITEM_P(PLABEL,A,B,V...) _CONFIRM_ITEM_P(PLABEL, GET_TEXT(A), GET_TEXT(B), ##V) +#define CONFIRM_ITEM(LABEL, V...) CONFIRM_ITEM_P(GET_TEXT(LABEL), ##V) + +#define YESNO_ITEM_P(PLABEL, V...) _CONFIRM_ITEM_P(PLABEL, ##V) +#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_P(GET_TEXT(LABEL), ##V) + +#define CONFIRM_ITEM_N_P(N,PLABEL,A,B,V...) _CONFIRM_ITEM_N_P(N, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V) +#define CONFIRM_ITEM_N(N,LABEL, V...) CONFIRM_ITEM_N_P(N, GET_TEXT(LABEL), ##V) + +#define YESNO_ITEM_N_P(N,PLABEL, V...) _CONFIRM_ITEM_N_P(N, PLABEL, ##V) +#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_P(N, GET_TEXT(LABEL), ##V) //////////////////////////////////////////// /////////////// Menu Screens /////////////// @@ -352,7 +505,7 @@ void menu_main(); void menu_move(); #if ENABLED(SDSUPPORT) - void menu_sdcard(); + void menu_media(); #endif // First Fan Speed title in "Tune" and "Control>Temperature" menus @@ -382,13 +535,12 @@ void _lcd_draw_homing(); void lcd_enqueue_one_now_P(PGM_P const cmd); #endif -#if ENABLED(LEVEL_BED_CORNERS) - void _lcd_level_bed_corners(); +#if HAS_GRAPHICAL_LCD && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + void _lcd_zoffset_overlay_gfx(const float zvalue); #endif -#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - extern float lcd_z_fade_height; - void _lcd_set_z_fade_height(); +#if ENABLED(LEVEL_BED_CORNERS) + void _lcd_level_bed_corners(); #endif #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) diff --git a/Marlin/src/lcd/menu/menu_addon.h b/Marlin/src/lcd/menu/menu_addon.h new file mode 100644 index 000000000000..e7553293a143 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_addon.h @@ -0,0 +1,33 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include "../lcdprint.h" +#if HAS_GRAPHICAL_LCD + #include "../dogm/ultralcd_DOGM.h" +#endif + +#define MENU_ITEM_ADDON_START(X) do{ \ + if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \ + SETCURSOR(X, _lcdLineNr) + +#define MENU_ITEM_ADDON_END() } }while(0) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 2dc865c3b454..3deb5ec043f4 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -43,32 +43,34 @@ #include "../../module/temperature.h" #endif -#ifdef FILAMENT_RUNOUT_DISTANCE_MM +#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM #include "../../feature/runout.h" float lcd_runout_distance_mm; #endif +#if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) + #include "../../module/configuration_store.h" +#endif + void menu_tmc(); void menu_backlash(); +void menu_cancelobject(); #if ENABLED(DAC_STEPPER_CURRENT) #include "../../feature/dac/stepper_dac.h" - uint8_t driverPercent[XYZE]; - inline void dac_driver_getValues() { LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); } - static void dac_driver_commit() { dac_current_set_percents(driverPercent); } - void menu_dac() { - dac_driver_getValues(); + static xyze_uint8_t driverPercent; + LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - #define EDIT_DAC_PERCENT(N) MENU_ITEM_EDIT_CALLBACK(uint8, MSG_##N " " MSG_DAC_PERCENT, &driverPercent[_AXIS(N)], 0, 100, dac_driver_commit) + BACK_ITEM(MSG_ADVANCED_SETTINGS); + #define EDIT_DAC_PERCENT(A) EDIT_ITEM(uint8, MSG_DAC_PERCENT_##A, &driverPercent[_AXIS(A)], 0, 100, []{ dac_current_set_percents(driverPercent); }) EDIT_DAC_PERCENT(X); EDIT_DAC_PERCENT(Y); EDIT_DAC_PERCENT(Z); EDIT_DAC_PERCENT(E); - MENU_ITEM(function, MSG_DAC_EEPROM_WRITE, dac_commit_eeprom); + ACTION_ITEM(MSG_DAC_EEPROM_WRITE, dac_commit_eeprom); END_MENU(); } @@ -80,8 +82,8 @@ void menu_backlash(); void menu_pwm() { START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - #define EDIT_CURRENT_PWM(LABEL,I) MENU_ITEM_EDIT_CALLBACK(long5, LABEL, &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) + BACK_ITEM(MSG_ADVANCED_SETTINGS); + #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_P(long5, PSTR(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) EDIT_CURRENT_PWM(MSG_X MSG_Y, 0); #endif @@ -96,16 +98,6 @@ void menu_backlash(); #endif -#if HAS_M206_COMMAND - // - // Set the home offset based on the current_position - // - void _lcd_set_home_offsets() { - queue.inject_P(PSTR("M428")); - ui.return_to_status(); - } -#endif - #if ENABLED(SD_FIRMWARE_UPDATE) #include "../../module/configuration_store.h" #endif @@ -116,54 +108,29 @@ void menu_backlash(); // void menu_advanced_filament() { START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); + BACK_ITEM(MSG_ADVANCED_SETTINGS); #if ENABLED(LIN_ADVANCE) #if EXTRUDERS == 1 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); + EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); #elif EXTRUDERS > 1 - #define EDIT_ADVANCE_K(N) MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E##N, &planner.extruder_advance_K[N-1], 0, 999) - EDIT_ADVANCE_K(1); - EDIT_ADVANCE_K(2); - #if EXTRUDERS > 2 - EDIT_ADVANCE_K(3); - #if EXTRUDERS > 3 - EDIT_ADVANCE_K(4); - #if EXTRUDERS > 4 - EDIT_ADVANCE_K(5); - #if EXTRUDERS > 5 - EDIT_ADVANCE_K(6); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 + #define EDIT_ADVANCE_K(N) EDIT_ITEM_N(float52, N, MSG_ADVANCE_K_E, &planner.extruder_advance_K[N], 0, 999) + for (uint8_t n = 0; n < EXTRUDERS; n++) + EDIT_ADVANCE_K(n); + #endif #endif #if DISABLED(NO_VOLUMETRICS) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); + EDIT_ITEM(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 - #define EDIT_FIL_DIAM(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E##N, &planner.filament_size[N-1], 1.5f, 3.25f, planner.calculate_volumetric_multipliers) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - EDIT_FIL_DIAM(1); - EDIT_FIL_DIAM(2); - #if EXTRUDERS > 2 - EDIT_FIL_DIAM(3); - #if EXTRUDERS > 3 - EDIT_FIL_DIAM(4); - #if EXTRUDERS > 4 - EDIT_FIL_DIAM(5); - #if EXTRUDERS > 5 - EDIT_FIL_DIAM(6); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 + EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); + #elif EXTRUDERS > 1 + #define EDIT_FIL_DIAM(N) EDIT_ITEM_FAST_N(float43, N, MSG_FILAMENT_DIAM_E, &planner.filament_size[N], 1.5f, 3.25f, planner.calculate_volumetric_multipliers) + EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); + for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_DIAM(n); + #endif } #endif @@ -177,50 +144,24 @@ void menu_backlash(); ; #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[0].unload_length, 0, extrude_maxlength); - #else // EXTRUDERS > 1 - #define EDIT_FIL_UNLOAD(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E##N, &fc_settings[N-1].unload_length, 0, extrude_maxlength) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); - EDIT_FIL_UNLOAD(1); - EDIT_FIL_UNLOAD(2); - #if EXTRUDERS > 2 - EDIT_FIL_UNLOAD(3); - #if EXTRUDERS > 3 - EDIT_FIL_UNLOAD(4); - #if EXTRUDERS > 4 - EDIT_FIL_UNLOAD(5); - #if EXTRUDERS > 5 - EDIT_FIL_UNLOAD(6); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 + EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[0].unload_length, 0, extrude_maxlength); + #elif EXTRUDERS > 1 + #define EDIT_FIL_UNLOAD(N) EDIT_ITEM_FAST_N(float3, N, MSG_FILAMENTUNLOAD_E, &fc_settings[N].unload_length, 0, extrude_maxlength) + EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); + for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_UNLOAD(n); + #endif #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[0].load_length, 0, extrude_maxlength); - #else // EXTRUDERS > 1 - #define EDIT_FIL_LOAD(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E##N, &fc_settings[N-1].load_length, 0, extrude_maxlength) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); - EDIT_FIL_LOAD(1); - EDIT_FIL_LOAD(2); - #if EXTRUDERS > 2 - EDIT_FIL_LOAD(3); - #if EXTRUDERS > 3 - EDIT_FIL_LOAD(4); - #if EXTRUDERS > 4 - EDIT_FIL_LOAD(5); - #if EXTRUDERS > 5 - EDIT_FIL_LOAD(6); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 + EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[0].load_length, 0, extrude_maxlength); + #elif EXTRUDERS > 1 + #define EDIT_FIL_LOAD(N) EDIT_ITEM_FAST_N(float3, N, MSG_FILAMENTLOAD_E, &fc_settings[N].load_length, 0, extrude_maxlength) + EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); + for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FIL_LOAD(n); + #endif #endif - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - MENU_ITEM_EDIT_CALLBACK(float3, MSG_RUNOUT_DISTANCE_MM, &lcd_runout_distance_mm, 1, 30, []{ + #if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM + EDIT_ITEM(float3, MSG_RUNOUT_DISTANCE_MM, &lcd_runout_distance_mm, 1, 30, []{ runout.set_runout_distance(lcd_runout_distance_mm); }); #endif @@ -280,9 +221,10 @@ void menu_backlash(); PID_PARAM(Kd, e) = scalePID_d(raw_Kd); thermalManager.updatePID(); } + #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ - void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \ - void copy_and_scalePID_d_E ## N() { copy_and_scalePID_d(N); } + void copy_and_scalePID_i_E##N() { copy_and_scalePID_i(N); } \ + void copy_and_scalePID_d_E##N() { copy_and_scalePID_d(N); } #else @@ -293,30 +235,28 @@ void menu_backlash(); #if ENABLED(PID_AUTOTUNE_MENU) #define DEFINE_PIDTEMP_FUNCS(N) \ _DEFINE_PIDTEMP_BASE_FUNCS(N); \ - void lcd_autotune_callback_E ## N() { _lcd_autotune(N); } // + void lcd_autotune_callback_E##N() { _lcd_autotune(N); } // #else #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); // #endif #if HOTENDS DEFINE_PIDTEMP_FUNCS(0); - #if ENABLED(PID_PARAMS_PER_HOTEND) - #if HOTENDS > 1 - DEFINE_PIDTEMP_FUNCS(1); - #if HOTENDS > 2 - DEFINE_PIDTEMP_FUNCS(2); - #if HOTENDS > 3 - DEFINE_PIDTEMP_FUNCS(3); - #if HOTENDS > 4 - DEFINE_PIDTEMP_FUNCS(4); - #if HOTENDS > 5 - DEFINE_PIDTEMP_FUNCS(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // PID_PARAMS_PER_HOTEND + #if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND) + DEFINE_PIDTEMP_FUNCS(1); + #if HOTENDS > 2 + DEFINE_PIDTEMP_FUNCS(2); + #if HOTENDS > 3 + DEFINE_PIDTEMP_FUNCS(3); + #if HOTENDS > 4 + DEFINE_PIDTEMP_FUNCS(4); + #if HOTENDS > 5 + DEFINE_PIDTEMP_FUNCS(5); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 && PID_PARAMS_PER_HOTEND #endif // HOTENDS #define SHOW_MENU_ADVANCED_TEMPERATURE ((ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU)) @@ -328,15 +268,15 @@ void menu_backlash(); void menu_advanced_temperature() { START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); + BACK_ITEM(MSG_ADVANCED_SETTINGS); // // Autotemp, Min, Max, Fact // #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND - 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, 10); + EDIT_ITEM(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); + EDIT_ITEM(float3, MSG_MIN, &planner.autotemp_min, 0, float(HEATER_0_MAXTEMP) - 15); + EDIT_ITEM(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - 15); + EDIT_ITEM(float52, MSG_FACTOR, &planner.autotemp_factor, 0, 10); #endif // @@ -347,55 +287,61 @@ void menu_backlash(); // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4 // PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5 // - #if ENABLED(PID_EDIT_MENU) - #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) + #if ENABLED(PID_EDIT_MENU) + #define __PID_BASE_MENU_ITEMS(N) \ + raw_Ki = unscalePID_i(PID_PARAM(Ki, N)); \ + raw_Kd = unscalePID_d(PID_PARAM(Kd, N)); \ + EDIT_ITEM_N(float52sign, N, MSG_PID_P_E, &PID_PARAM(Kp, N), 1, 9990); \ + EDIT_ITEM_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \ + EDIT_ITEM_N(float52sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); }) #if ENABLED(PID_EXTRUSION_SCALING) - #define _PID_EDIT_MENU_ITEMS(ELABEL, eindex) \ - _PID_BASE_MENU_ITEMS(ELABEL, eindex); \ - MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990) + #define _PID_BASE_MENU_ITEMS(N) \ + __PID_BASE_MENU_ITEMS(N); \ + EDIT_ITEM_N(float3, N, MSG_PID_C_E, &PID_PARAM(Kc, N), 1, 9990) + #else + #define _PID_BASE_MENU_ITEMS(N) __PID_BASE_MENU_ITEMS(N) + #endif + + #if ENABLED(PID_FAN_SCALING) + #define _PID_EDIT_MENU_ITEMS(N) \ + _PID_BASE_MENU_ITEMS(N); \ + EDIT_ITEM(float3, PID_LABEL(MSG_PID_F,N), &PID_PARAM(Kf, N), 1, 9990) #else - #define _PID_EDIT_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex) + #define _PID_EDIT_MENU_ITEMS(N) _PID_BASE_MENU_ITEMS(N) #endif #else - #define _PID_EDIT_MENU_ITEMS(ELABEL, eindex) NOOP + #define _PID_EDIT_MENU_ITEMS(N) NOOP #endif #if ENABLED(PID_AUTOTUNE_MENU) - #define PID_EDIT_MENU_ITEMS(ELABEL, eindex) \ - _PID_EDIT_MENU_ITEMS(ELABEL, eindex); \ - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex) + #define PID_EDIT_MENU_ITEMS(N) \ + _PID_EDIT_MENU_ITEMS(N); \ + EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, heater_maxtemp[N] - 15, []{ _lcd_autotune(MenuItemBase::itemIndex); }) #else - #define PID_EDIT_MENU_ITEMS(ELABEL, eindex) _PID_EDIT_MENU_ITEMS(ELABEL, eindex) + #define PID_EDIT_MENU_ITEMS(N) _PID_EDIT_MENU_ITEMS(N) #endif - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - PID_EDIT_MENU_ITEMS(" " MSG_E1, 0); - PID_EDIT_MENU_ITEMS(" " MSG_E2, 1); + PID_EDIT_MENU_ITEMS(0); + #if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND) + PID_EDIT_MENU_ITEMS(1); #if HOTENDS > 2 - PID_EDIT_MENU_ITEMS(" " MSG_E3, 2); + PID_EDIT_MENU_ITEMS(2); #if HOTENDS > 3 - PID_EDIT_MENU_ITEMS(" " MSG_E4, 3); + PID_EDIT_MENU_ITEMS(3); #if HOTENDS > 4 - PID_EDIT_MENU_ITEMS(" " MSG_E5, 4); + PID_EDIT_MENU_ITEMS(4); #if HOTENDS > 5 - PID_EDIT_MENU_ITEMS(" " MSG_E6, 5); + PID_EDIT_MENU_ITEMS(5); #endif // HOTENDS > 5 #endif // HOTENDS > 4 #endif // HOTENDS > 3 #endif // HOTENDS > 2 - #else // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 - PID_EDIT_MENU_ITEMS("", 0); - #endif // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 + #endif // HOTENDS > 1 && PID_PARAMS_PER_HOTEND END_MENU(); } @@ -404,86 +350,54 @@ void menu_backlash(); #if DISABLED(SLIM_LCD_MENUS) - 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); } - #if E_STEPPERS > 5 - void _reset_e5_acceleration_rate() { _reset_e_acceleration_rate(5); } - #endif // E_STEPPERS > 5 - #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) { + inline void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) planner.reset_acceleration_rates(); } + inline void _planner_refresh_e_positioning(const uint8_t e) { if (e == active_extruder) - _planner_refresh_positioning(); + planner.refresh_positioning(); else planner.steps_to_mm[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(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); } - #if E_STEPPERS > 5 - void _planner_refresh_e5_positioning() { _planner_refresh_e_positioning(5); } - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 #endif // M203 / M205 Velocity options void menu_advanced_velocity() { START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); + BACK_ITEM(MSG_ADVANCED_SETTINGS); // M203 Max Feedrate - #define EDIT_VMAX(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_##N, &planner.settings.max_feedrate_mm_s[_AXIS(N)], 1, 999) + constexpr xyze_feedrate_t max_fr_edit = + #ifdef MAX_FEEDRATE_EDIT_VALUES + MAX_FEEDRATE_EDIT_VALUES + #elif ENABLED(LIMITED_MAX_FR_EDITING) + DEFAULT_MAX_FEEDRATE + #else + { 999, 999, 999, 999 } + #endif + ; + #if ENABLED(LIMITED_MAX_FR_EDITING) && !defined(MAX_FEEDRATE_EDIT_VALUES) + const xyze_feedrate_t max_fr_edit_scaled = max_fr_edit * 2; + #else + const xyze_feedrate_t &max_fr_edit_scaled = max_fr_edit; + #endif + #define EDIT_VMAX(N) EDIT_ITEM_FAST(float3, MSG_VMAX_##N, &planner.settings.max_feedrate_mm_s[_AXIS(N)], 1, max_fr_edit_scaled[_AXIS(N)]) EDIT_VMAX(A); EDIT_VMAX(B); EDIT_VMAX(C); #if ENABLED(DISTINCT_E_FACTORS) - #define EDIT_VMAX_E(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E##N, &planner.settings.max_feedrate_mm_s[E_AXIS_N(N-1)], 1, 999) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, 999); - EDIT_VMAX_E(1); - EDIT_VMAX_E(2); - #if E_STEPPERS > 2 - EDIT_VMAX_E(3); - #if E_STEPPERS > 3 - EDIT_VMAX_E(4); - #if E_STEPPERS > 4 - EDIT_VMAX_E(5); - #if E_STEPPERS > 5 - EDIT_VMAX_E(6); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 + #define EDIT_VMAX_E(N) EDIT_ITEM_FAST_N(float3, N, MSG_VMAX_EN, &planner.settings.max_feedrate_mm_s[E_AXIS_N(N)], 1, max_fr_edit_scaled.e) + EDIT_ITEM_FAST(float3, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e); + for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_VMAX_E(n); #elif E_STEPPERS - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, 999); + EDIT_ITEM_FAST(float3, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, max_fr_edit_scaled.e); #endif // M205 S Min Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMIN, &planner.settings.min_feedrate_mm_s, 0, 999); + EDIT_ITEM_FAST(float3, MSG_VMIN, &planner.settings.min_feedrate_mm_s, 0, 999); // M205 T Min Travel Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.settings.min_travel_feedrate_mm_s, 0, 999); + EDIT_ITEM_FAST(float3, MSG_VTRAV_MIN, &planner.settings.min_travel_feedrate_mm_s, 0, 999); END_MENU(); } @@ -491,43 +405,46 @@ void menu_backlash(); // M201 / M204 Accelerations void menu_advanced_acceleration() { START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); + BACK_ITEM(MSG_ADVANCED_SETTINGS); + static float max_accel = _MAX(planner.settings.max_acceleration_mm_per_s2[A_AXIS], planner.settings.max_acceleration_mm_per_s2[B_AXIS], planner.settings.max_acceleration_mm_per_s2[C_AXIS]); // M204 P Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5_25, MSG_ACC, &planner.settings.acceleration, 25, 99000); + EDIT_ITEM_FAST(float5_25, MSG_ACC, &planner.settings.acceleration, 25, max_accel); // M204 R Retract Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.settings.retract_acceleration, 100, 99000); + EDIT_ITEM_FAST(float5, MSG_A_RETRACT, &planner.settings.retract_acceleration, 100, max_accel); // M204 T Travel Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5_25, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 25, 99000); + EDIT_ITEM_FAST(float5_25, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 25, max_accel); // M201 settings - #define EDIT_AMAX(Q,L) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5_25, MSG_AMAX MSG_##Q, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, 99000, _reset_acceleration_rates) + constexpr xyze_ulong_t max_accel_edit = + #ifdef MAX_ACCEL_EDIT_VALUES + MAX_ACCEL_EDIT_VALUES + #elif ENABLED(LIMITED_MAX_ACCEL_EDITING) + DEFAULT_MAX_ACCELERATION + #else + { 99000, 99000, 99000, 99000 } + #endif + ; + #if ENABLED(LIMITED_MAX_ACCEL_EDITING) && !defined(MAX_ACCEL_EDIT_VALUES) + const xyze_ulong_t max_accel_edit_scaled = max_accel_edit * 2; + #else + const xyze_ulong_t &max_accel_edit_scaled = max_accel_edit; + #endif + + #define EDIT_AMAX(Q,L) EDIT_ITEM_FAST(long5_25, MSG_AMAX_##Q, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, max_accel_edit_scaled[_AXIS(Q)], []{ planner.reset_acceleration_rates(); }) EDIT_AMAX(A,100); EDIT_AMAX(B,100); EDIT_AMAX(C, 10); #if ENABLED(DISTINCT_E_FACTORS) - #define EDIT_AMAX_E(N,E) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E##N, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(E)], 100, 99000, _reset_e##E##_acceleration_rate) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, 99000, _reset_acceleration_rates); - EDIT_AMAX_E(1,0); - EDIT_AMAX_E(2,1); - #if E_STEPPERS > 2 - EDIT_AMAX_E(3,2); - #if E_STEPPERS > 3 - EDIT_AMAX_E(4,3); - #if E_STEPPERS > 4 - EDIT_AMAX_E(5,4); - #if E_STEPPERS > 5 - EDIT_AMAX_E(6,5); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 + #define EDIT_AMAX_E(N) EDIT_ITEM_FAST_N(long5_25, N, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(N)], 100, max_accel_edit_scaled.e, []{ _reset_e_acceleration_rate(MenuItemBase::itemIndex); }) + EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); }); + for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_AMAX_E(n); #elif E_STEPPERS - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); + EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); }); #endif END_MENU(); @@ -536,26 +453,35 @@ void menu_backlash(); // M205 Jerk void menu_advanced_jerk() { START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); + BACK_ITEM(MSG_ADVANCED_SETTINGS); - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) #if ENABLED(LIN_ADVANCE) - MENU_ITEM_EDIT_CALLBACK(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f, planner.recalculate_max_e_jerk); + EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f, planner.recalculate_max_e_jerk); #else - MENU_ITEM_EDIT(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f); + EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.5f); #endif #endif #if HAS_CLASSIC_JERK - #define EDIT_JERK(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_V##N##_JERK, &planner.max_jerk[_AXIS(N)], 1, 990) + constexpr xyze_float_t max_jerk_edit = + #ifdef MAX_ACCEL_EDIT_VALUES + MAX_JERK_EDIT_VALUES + #elif ENABLED(LIMITED_JERK_EDITING) + { (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 } + #else + { 990, 990, 990, 990 } + #endif + ; + #define EDIT_JERK(N) EDIT_ITEM_FAST(float3, MSG_V##N##_JERK, &planner.max_jerk[_AXIS(N)], 1, max_jerk_edit[_AXIS(N)]) EDIT_JERK(A); EDIT_JERK(B); #if ENABLED(DELTA) EDIT_JERK(C); #else - MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1f, 990); + EDIT_ITEM_FAST(float52sign, MSG_VC_JERK, &planner.max_jerk.c, 0.1f, max_jerk_edit.c); #endif - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) - EDIT_JERK(E); + #if HAS_CLASSIC_E_JERK + EDIT_ITEM_FAST(float52sign, MSG_VE_JERK, &planner.max_jerk.e, 0.1f, max_jerk_edit.e); #endif #endif @@ -565,60 +491,32 @@ void menu_backlash(); // M92 Steps-per-mm void menu_advanced_steps_per_mm() { START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); + BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_QSTEPS(Q) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float51, MSG_##Q##STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, _planner_refresh_positioning) + #define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float51, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); }) EDIT_QSTEPS(A); EDIT_QSTEPS(B); EDIT_QSTEPS(C); #if ENABLED(DISTINCT_E_FACTORS) - #define EDIT_ESTEPS(N,E) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float51, MSG_E##N##STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(E)], 5, 9999, _planner_refresh_e##E##_positioning) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float51, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, _planner_refresh_positioning); - EDIT_ESTEPS(1,0); - EDIT_ESTEPS(2,1); - #if E_STEPPERS > 2 - EDIT_ESTEPS(3,2); - #if E_STEPPERS > 3 - EDIT_ESTEPS(4,3); - #if E_STEPPERS > 4 - EDIT_ESTEPS(5,4); - #if E_STEPPERS > 5 - EDIT_ESTEPS(6,5); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 + #define EDIT_ESTEPS(N) EDIT_ITEM_FAST_N(float51, N, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(N)], 5, 9999, []{ _planner_refresh_e_positioning(MenuItemBase::itemIndex); }) + EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, []{ planner.refresh_positioning(); }); + for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_ESTEPS(n); #elif E_STEPPERS - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float51, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); + EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); #endif END_MENU(); } - #if ENABLED(EEPROM_SETTINGS) - - #include "../../module/configuration_store.h" - - static void lcd_init_eeprom_confirm() { - do_select_screen( - PSTR(MSG_BUTTON_INIT), PSTR(MSG_BUTTON_CANCEL), - []{ ui.completion_feedback(settings.init_eeprom()); }, - ui.goto_previous_screen, - PSTR(MSG_INIT_EEPROM), nullptr, PSTR("?") - ); - } - - #endif - #endif // !SLIM_LCD_MENUS void menu_advanced_settings() { - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM lcd_runout_distance_mm = runout.runout_distance(); #endif START_MENU(); - MENU_BACK(MSG_CONFIGURATION); + BACK_ITEM(MSG_CONFIGURATION); #if DISABLED(SLIM_LCD_MENUS) @@ -626,87 +524,92 @@ void menu_advanced_settings() { // // Set Home Offsets // - MENU_ITEM(function, MSG_SET_HOME_OFFSETS, _lcd_set_home_offsets); + ACTION_ITEM(MSG_SET_HOME_OFFSETS, []{ queue.inject_P(PSTR("M428")); ui.return_to_status(); }); #endif // M203 / M205 - Feedrate items - MENU_ITEM(submenu, MSG_VELOCITY, menu_advanced_velocity); + SUBMENU(MSG_VELOCITY, menu_advanced_velocity); // M201 - Acceleration items - MENU_ITEM(submenu, MSG_ACCELERATION, menu_advanced_acceleration); + SUBMENU(MSG_ACCELERATION, menu_advanced_acceleration); // M205 - Max Jerk - MENU_ITEM(submenu, MSG_JERK, menu_advanced_jerk); + SUBMENU(MSG_JERK, menu_advanced_jerk); if (!printer_busy()) { // M92 - Steps Per mm - MENU_ITEM(submenu, MSG_STEPS_PER_MM, menu_advanced_steps_per_mm); + SUBMENU(MSG_STEPS_PER_MM, menu_advanced_steps_per_mm); } #endif // !SLIM_LCD_MENUS #if ENABLED(BACKLASH_GCODE) - MENU_ITEM(submenu, MSG_BACKLASH, menu_backlash); + SUBMENU(MSG_BACKLASH, menu_backlash); + #endif + + #if ENABLED(CANCEL_OBJECTS) + SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); }); #endif #if ENABLED(DAC_STEPPER_CURRENT) - MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_dac); + SUBMENU(MSG_DRIVE_STRENGTH, menu_dac); #endif #if HAS_MOTOR_CURRENT_PWM - MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_pwm); + SUBMENU(MSG_DRIVE_STRENGTH, menu_pwm); #endif #if HAS_TRINAMIC - MENU_ITEM(submenu, MSG_TMC_DRIVERS, menu_tmc); + SUBMENU(MSG_TMC_DRIVERS, menu_tmc); #endif #if SHOW_MENU_ADVANCED_TEMPERATURE - MENU_ITEM(submenu, MSG_TEMPERATURE, menu_advanced_temperature); + SUBMENU(MSG_TEMPERATURE, menu_advanced_temperature); #endif #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM(submenu, MSG_FILAMENT, menu_advanced_filament); + SUBMENU(MSG_FILAMENT, menu_advanced_filament); #elif ENABLED(LIN_ADVANCE) #if EXTRUDERS == 1 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); + EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); #elif EXTRUDERS > 1 - #define EDIT_ADVANCE_K(N) MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E##N, &planner.extruder_advance_K[N-1], 0, 999) - EDIT_ADVANCE_K(1); - EDIT_ADVANCE_K(2); - #if EXTRUDERS > 2 - EDIT_ADVANCE_K(3); - #if EXTRUDERS > 3 - EDIT_ADVANCE_K(4); - #if EXTRUDERS > 4 - EDIT_ADVANCE_K(5); - #if EXTRUDERS > 5 - EDIT_ADVANCE_K(6); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 + #define EDIT_ADVANCE_K(N) EDIT_ITEM_N(float52, N, MSG_ADVANCE_K_E, &planner.extruder_advance_K[N], 0, 999) + for (uint8_t n = 0; n < E_STEPPERS; n++) EDIT_ADVANCE_K(n); + #endif #endif // M540 S - Abort on endstop hit when SD printing #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) - MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &planner.abort_on_endstop_hit); + EDIT_ITEM(bool, MSG_ENDSTOP_ABORT, &planner.abort_on_endstop_hit); #endif #if ENABLED(SD_FIRMWARE_UPDATE) bool sd_update_state = settings.sd_update_status(); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_SD_UPDATE, &sd_update_state, []{ + EDIT_ITEM(bool, MSG_MEDIA_UPDATE, &sd_update_state, []{ // // Toggle the SD Firmware Update state in EEPROM // - const bool new_state = !settings.sd_update_status(); - ui.completion_feedback(settings.set_sd_update_status(new_state)); + const bool new_state = !settings.sd_update_status(), + didset = settings.set_sd_update_status(new_state); + #if HAS_BUZZER + ui.completion_feedback(didset); + #endif ui.return_to_status(); if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else ui.reset_status(); }); #endif #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm); + CONFIRM_ITEM(MSG_INIT_EEPROM, + MSG_BUTTON_INIT, MSG_BUTTON_CANCEL, + []{ + const bool inited = settings.init_eeprom(); + #if HAS_BUZZER + ui.completion_feedback(inited); + #endif + UNUSED(inited); + }, + ui.goto_previous_screen, + GET_TEXT(MSG_INIT_EEPROM), (PGM_P)nullptr, PSTR("?") + ); #endif END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_backlash.cpp b/Marlin/src/lcd/menu/menu_backlash.cpp index 147c593901f9..cc0b3a2c9925 100644 --- a/Marlin/src/lcd/menu/menu_backlash.cpp +++ b/Marlin/src/lcd/menu/menu_backlash.cpp @@ -34,17 +34,17 @@ void menu_backlash() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); - MENU_MULTIPLIER_ITEM_EDIT(percent, MSG_BACKLASH_CORRECTION, &backlash.correction, all_off, all_on); + EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &backlash.correction, all_off, all_on); - #define EDIT_BACKLASH_DISTANCE(N) MENU_MULTIPLIER_ITEM_EDIT(float43, MSG_##N, &backlash.distance_mm[_AXIS(N)], 0.0f, 9.9f); + #define EDIT_BACKLASH_DISTANCE(N) EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &backlash.distance_mm[_AXIS(N)], 0.0f, 9.9f); EDIT_BACKLASH_DISTANCE(A); EDIT_BACKLASH_DISTANCE(B); EDIT_BACKLASH_DISTANCE(C); #ifdef BACKLASH_SMOOTHING_MM - MENU_MULTIPLIER_ITEM_EDIT(float43, MSG_BACKLASH_SMOOTHING, &backlash.smoothing_mm, 0.0f, 9.9f); + EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &backlash.smoothing_mm, 0.0f, 9.9f); #endif END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 10d0e5d7cdfb..a7fffb1e02ed 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -58,26 +58,24 @@ static inline void _lcd_goto_next_corner() { line_to_z(LEVEL_CORNERS_Z_HOP); 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.set(X_MIN_BED + LEVEL_CORNERS_INSET, Y_MIN_BED + LEVEL_CORNERS_INSET); break; case 1: - current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET; + current_position.x = X_MAX_BED - (LEVEL_CORNERS_INSET); break; case 2: - current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET; + current_position.y = Y_MAX_BED - (LEVEL_CORNERS_INSET); break; case 3: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; + current_position.x = X_MIN_BED + LEVEL_CORNERS_INSET; break; #if ENABLED(LEVEL_CENTER_TOO) case 4: - current_position[X_AXIS] = X_CENTER; - current_position[Y_AXIS] = Y_CENTER; + current_position.set(X_CENTER, Y_CENTER); break; #endif } - planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder); + line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m.x)); line_to_z(LEVEL_CORNERS_HEIGHT); if (++bed_corner > 3 #if ENABLED(LEVEL_CENTER_TOO) @@ -86,32 +84,30 @@ static inline void _lcd_goto_next_corner() { ) bed_corner = 0; } -static inline void menu_level_bed_corners() { - do_select_screen( - PSTR(MSG_BUTTON_NEXT), PSTR(MSG_BUTTON_DONE), - _lcd_goto_next_corner, - []{ - #if HAS_LEVELING - set_bed_leveling_enabled(leveling_was_active); - #endif - ui.goto_previous_screen_no_defer(); - }, - PSTR( - #if ENABLED(LEVEL_CENTER_TOO) - MSG_LEVEL_BED_NEXT_POINT - #else - MSG_NEXT_CORNER - #endif - ), nullptr, PSTR("?") - ); -} - static inline void _lcd_level_bed_corners_homing() { _lcd_draw_homing(); if (all_axes_homed()) { bed_corner = 0; - ui.goto_screen(menu_level_bed_corners); - set_ui_selection(true); + ui.goto_screen([]{ + MenuItem_confirm::select_screen( + GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE), + _lcd_goto_next_corner, + []{ + #if HAS_LEVELING + set_bed_leveling_enabled(leveling_was_active); + #endif + ui.goto_previous_screen_no_defer(); + }, + GET_TEXT( + #if ENABLED(LEVEL_CENTER_TOO) + MSG_LEVEL_BED_NEXT_POINT + #else + MSG_NEXT_CORNER + #endif + ), (PGM_P)nullptr, PSTR("?") + ); + }); + ui.set_selection(true); _lcd_goto_next_corner(); } } @@ -120,7 +116,7 @@ void _lcd_level_bed_corners() { ui.defer_status_screen(); if (!all_axes_known()) { set_all_unhomed(); - queue.inject_P(PSTR("G28")); + queue.inject_P(G28_STR); } // Disable leveling so the planner won't mess with us diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index c463faa9103f..f4fbf59a4284 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -74,12 +74,14 @@ #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING) // Display "Done" screen and wait for moves to complete line_to_z(MANUAL_PROBE_HEIGHT); - ui.synchronize(PSTR(MSG_LEVEL_BED_DONE)); + ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE)); #endif ui.goto_previous_screen_no_defer(); - ui.completion_feedback(); + #if HAS_BUZZER + ui.completion_feedback(); + #endif } - if (ui.should_draw()) draw_menu_item_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE)); + if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE)); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); } @@ -89,7 +91,6 @@ // Step 7: Get the Z coordinate, click goes to the next point or exits // void _lcd_level_bed_get_z() { - ui.encoder_direction_normal(); if (ui.use_click()) { @@ -120,7 +121,7 @@ // Encoder knob or keypad buttons adjust the Z position // if (ui.encoderPosition) { - const float z = current_position[Z_AXIS] + float(int16_t(ui.encoderPosition)) * (MESH_EDIT_Z_STEP); + const float z = current_position.z + float(int32_t(ui.encoderPosition)) * (MESH_EDIT_Z_STEP); line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5f, (LCD_PROBE_Z_RANGE) * 0.5f)); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); ui.encoderPosition = 0; @@ -130,8 +131,8 @@ // Draw on first display, then only on Z change // if (ui.should_draw()) { - const float v = current_position[Z_AXIS]; - draw_edit_screen(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); + const float v = current_position.z; + MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); } } @@ -141,8 +142,8 @@ void _lcd_level_bed_moving() { if (ui.should_draw()) { char msg[10]; - sprintf_P(msg, PSTR("%i / %u"), (int)(manual_probe_index + 1), total_probe_points); - draw_edit_screen(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg); + sprintf_P(msg, PSTR("%i / %u"), int(manual_probe_index + 1), total_probe_points); + MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg); } ui.refresh(LCDVIEW_CALL_NO_REDRAW); if (!ui.wait_for_bl_move) ui.goto_screen(_lcd_level_bed_get_z); @@ -168,7 +169,7 @@ // Move to the first probe position // void _lcd_level_bed_homing_done() { - if (ui.should_draw()) draw_edit_screen(PSTR(MSG_LEVEL_BED_WAITING)); + if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING)); if (ui.use_click()) { manual_probe_index = 0; _lcd_level_goto_next_point(); @@ -194,7 +195,7 @@ ui.defer_status_screen(); set_all_unhomed(); ui.goto_screen(_lcd_level_bed_homing); - queue.inject_P(PSTR("G28")); + queue.inject_P(G28_STR); } #endif // PROBE_MANUALLY || MESH_BED_LEVELING @@ -209,10 +210,10 @@ void menu_edit_mesh() { static uint8_t xind, yind; // =0 START_MENU(); - MENU_BACK(MSG_BED_LEVELING); - MENU_ITEM_EDIT(uint8, MSG_MESH_X, &xind, 0, GRID_MAX_POINTS_X - 1); - MENU_ITEM_EDIT(uint8, MSG_MESH_Y, &yind, 0, GRID_MAX_POINTS_Y - 1); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_MESH_EDIT_Z, &Z_VALUES(xind, yind), -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner); + BACK_ITEM(MSG_BED_LEVELING); + EDIT_ITEM(uint8, MSG_MESH_X, &xind, 0, GRID_MAX_POINTS_X - 1); + EDIT_ITEM(uint8, MSG_MESH_Y, &yind, 0, GRID_MAX_POINTS_Y - 1); + EDIT_ITEM_FAST(float43, MSG_MESH_EDIT_Z, &Z_VALUES(xind, yind), -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner); END_MENU(); } @@ -234,60 +235,62 @@ */ void menu_bed_leveling() { START_MENU(); - MENU_BACK(MSG_MOTION); + BACK_ITEM(MSG_MOTION); const bool is_homed = all_axes_known(); // Auto Home if not using manual probing #if NONE(PROBE_MANUALLY, MESH_BED_LEVELING) - if (!is_homed) MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, G28_STR); #endif // Level Bed #if EITHER(PROBE_MANUALLY, MESH_BED_LEVELING) // Manual leveling uses a guided procedure - MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); + 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")); + GCODES_ITEM(MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29")); #endif #if ENABLED(MESH_EDIT_MENU) if (leveling_is_valid()) - MENU_ITEM(submenu, MSG_EDIT_MESH, menu_edit_mesh); + SUBMENU(MSG_EDIT_MESH, menu_edit_mesh); #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); + bool show_state = planner.leveling_active; + EDIT_ITEM(bool, MSG_BED_LEVELING, &show_state, _lcd_toggle_bed_leveling); } // Z Fade Height #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &lcd_z_fade_height, 0, 100, _lcd_set_z_fade_height); + // Shadow for editing the fade height + editable.decimal = planner.z_fade_height; + EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); }); #endif // // Mesh Bed Leveling Z-Offset // #if ENABLED(MESH_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); + EDIT_ITEM(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); #endif #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); + 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); + EDIT_ITEM(float52, MSG_ZPROBE_ZOFFSET, &probe_offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif #if ENABLED(LEVEL_BED_CORNERS) - MENU_ITEM(submenu, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); + 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); + ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings); + ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_cancelobject.cpp b/Marlin/src/lcd/menu/menu_cancelobject.cpp new file mode 100644 index 000000000000..162578a0c4e6 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_cancelobject.cpp @@ -0,0 +1,74 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +// +// Cancel Object Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(CANCEL_OBJECTS) + +#include "menu.h" +#include "menu_addon.h" + +#include "../../feature/cancel_object.h" + +static void lcd_cancel_object_confirm() { + const int8_t v = MenuItemBase::itemIndex; + const char item_num[] = { + ' ', + char((v > 9) ? '0' + (v / 10) : ' '), + char('0' + (v % 10)), + '\0' + }; + MenuItem_confirm::confirm_screen( + []{ + cancelable.cancel_object(MenuItemBase::itemIndex - 1); + #if HAS_BUZZER + ui.completion_feedback(); + #endif + ui.goto_previous_screen(); + }, + ui.goto_previous_screen, + GET_TEXT(MSG_CANCEL_OBJECT), item_num, PSTR("?") + ); +} + +void menu_cancelobject() { + START_MENU(); + BACK_ITEM(MSG_MAIN); + + // Draw cancelable items in a loop + int8_t a = cancelable.active_object; + for (int8_t i = -1; i < cancelable.object_count; i++) { + if (i == a) continue; + int8_t j = i < 0 ? a : i; + if (!cancelable.is_canceled(j)) + SUBMENU_N(j, MSG_CANCEL_OBJECT_N, lcd_cancel_object_confirm); + if (i < 0) SKIP_ITEM(); + } + + END_MENU(); +} + +#endif // HAS_LCD_MENU && CANCEL_OBJECTS diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index c1395e22fc85..5199f90ea01a 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -50,19 +50,15 @@ #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST) void menu_advanced_settings(); -void menu_delta_calibrate(); - -static void lcd_factory_settings() { - settings.reset(); - ui.completion_feedback(); -} +#if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) + void menu_delta_calibrate(); +#endif #if ENABLED(LCD_PROGRESS_BAR_TEST) #include "../lcdprint.h" static void progress_bar_test() { - ui.encoder_direction_normal(); static int8_t bar_percent = 0; if (ui.use_click()) { ui.goto_previous_screen(); @@ -70,11 +66,10 @@ static void lcd_factory_settings() { return; } bar_percent += (int8_t)ui.encoderPosition; - bar_percent = constrain(bar_percent, 0, 100); + LIMIT(bar_percent, 0, 100); ui.encoderPosition = 0; - draw_menu_item_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true); - lcd_moveto((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2); - lcd_put_int(bar_percent); lcd_put_wchar('%'); + MenuItem_static::draw(0, GET_TEXT(MSG_PROGRESS_BAR_TEST), SS_CENTER|SS_INVERT); + lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%'); lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent); } @@ -90,10 +85,10 @@ static void lcd_factory_settings() { void menu_debug() { START_MENU(); - MENU_BACK(MSG_CONFIGURATION); + BACK_ITEM(MSG_CONFIGURATION); #if ENABLED(LCD_PROGRESS_BAR_TEST) - MENU_ITEM(submenu, MSG_PROGRESS_BAR_TEST, _progress_bar_test); + SUBMENU(MSG_PROGRESS_BAR_TEST, _progress_bar_test); #endif END_MENU(); @@ -107,13 +102,21 @@ static void lcd_factory_settings() { void menu_tool_change() { START_MENU(); - MENU_BACK(MSG_CONFIGURATION); + BACK_ITEM(MSG_CONFIGURATION); #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - MENU_ITEM_EDIT(float3, MSG_FILAMENT_SWAP_LENGTH, &toolchange_settings.swap_length, 0, 200); - MENU_MULTIPLIER_ITEM_EDIT(int4, MSG_SINGLENOZZLE_RETRACT_SPD, &toolchange_settings.retract_speed, 10, 5400); - MENU_MULTIPLIER_ITEM_EDIT(int4, MSG_SINGLENOZZLE_PRIME_SPD, &toolchange_settings.prime_speed, 10, 5400); + static constexpr float max_extrude = + #if ENABLED(PREVENT_LENGTHY_EXTRUDE) + EXTRUDE_MAXLENGTH + #else + 500 + #endif + ; + EDIT_ITEM(float3, MSG_FILAMENT_SWAP_LENGTH, &toolchange_settings.swap_length, 0, max_extrude); + EDIT_ITEM(float3, MSG_FILAMENT_PURGE_LENGTH, &toolchange_settings.extra_prime, 0, max_extrude); + EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_RETRACT_SPD, &toolchange_settings.retract_speed, 10, 5400); + EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_PRIME_SPD, &toolchange_settings.prime_speed, 10, 5400); #endif - MENU_ITEM_EDIT(float3, MSG_TOOL_CHANGE_ZLIFT, &toolchange_settings.z_raise, 0, 10); + EDIT_ITEM(float3, MSG_TOOL_CHANGE_ZLIFT, &toolchange_settings.z_raise, 0, 10); END_MENU(); } @@ -127,22 +130,22 @@ static void lcd_factory_settings() { auto _recalc_offsets = []{ if (active_extruder && all_axes_known()) { // For the 2nd extruder re-home so the next tool-change gets the new offsets. - queue.inject_P(PSTR("G28")); // In future, we can babystep the 2nd extruder (if active), making homing unnecessary. + queue.inject_P(G28_STR); // In future, we can babystep the 2nd extruder (if active), making homing unnecessary. active_extruder = 0; } }; START_MENU(); - MENU_BACK(MSG_CONFIGURATION); + BACK_ITEM(MSG_CONFIGURATION); #if ENABLED(DUAL_X_CARRIAGE) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float51, MSG_X_OFFSET, &hotend_offset[X_AXIS][1], float(X2_HOME_POS - 25), float(X2_HOME_POS + 25), _recalc_offsets); + EDIT_ITEM_FAST(float51, MSG_HOTEND_OFFSET_X, &hotend_offset[1].x, float(X2_HOME_POS - 25), float(X2_HOME_POS + 25), _recalc_offsets); #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52sign, MSG_X_OFFSET, &hotend_offset[X_AXIS][1], -10.0, 10.0, _recalc_offsets); + EDIT_ITEM_FAST(float41sign, MSG_HOTEND_OFFSET_X, &hotend_offset[1].x, -99.0, 99.0, _recalc_offsets); #endif - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52sign, MSG_Y_OFFSET, &hotend_offset[Y_AXIS][1], -10.0, 10.0, _recalc_offsets); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52sign, MSG_Z_OFFSET, &hotend_offset[Z_AXIS][1], Z_PROBE_LOW_POINT, 10.0, _recalc_offsets); + EDIT_ITEM_FAST(float41sign, MSG_HOTEND_OFFSET_Y, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets); + EDIT_ITEM_FAST(float41sign, MSG_HOTEND_OFFSET_Z, &hotend_offset[1].z, Z_PROBE_LOW_POINT, 10.0, _recalc_offsets); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); #endif END_MENU(); } @@ -152,19 +155,19 @@ static void lcd_factory_settings() { void menu_idex() { START_MENU(); - MENU_BACK(MSG_CONFIGURATION); + BACK_ITEM(MSG_CONFIGURATION); - MENU_ITEM(gcode, MSG_IDEX_MODE_AUTOPARK, PSTR("M605 S1\nG28 X\nG1 X100")); + GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605 S1\nG28 X\nG1 X100")); const bool need_g28 = !(TEST(axis_known_position, Y_AXIS) && TEST(axis_known_position, Z_AXIS)); - MENU_ITEM(gcode, MSG_IDEX_MODE_DUPLICATE, need_g28 + GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28 ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100") // If Y or Z is not homed, do a full G28 first : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100") ); - MENU_ITEM(gcode, MSG_IDEX_MODE_MIRRORED_COPY, need_g28 + GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28 ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") // If Y or Z is not homed, do a full G28 first : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") ); - MENU_ITEM(gcode, MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X")); + GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X")); END_MENU(); } @@ -192,27 +195,19 @@ static void lcd_factory_settings() { void menu_bltouch() { START_MENU(); - MENU_BACK(MSG_CONFIGURATION); - MENU_ITEM(function, MSG_BLTOUCH_RESET, bltouch._reset); - MENU_ITEM(function, MSG_BLTOUCH_SELFTEST, bltouch._selftest); - MENU_ITEM(function, MSG_BLTOUCH_DEPLOY, bltouch._deploy); - MENU_ITEM(function, MSG_BLTOUCH_STOW, bltouch._stow); - MENU_ITEM(function, MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode); + BACK_ITEM(MSG_CONFIGURATION); + ACTION_ITEM(MSG_BLTOUCH_RESET, bltouch._reset); + ACTION_ITEM(MSG_BLTOUCH_SELFTEST, bltouch._selftest); + ACTION_ITEM(MSG_BLTOUCH_DEPLOY, bltouch._deploy); + ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow); + ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode); #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU) - MENU_ITEM(submenu, MSG_BLTOUCH_5V_MODE, []{ - do_select_screen(PSTR(MSG_BLTOUCH_5V_MODE), PSTR(MSG_BUTTON_CANCEL), bltouch._set_5V_mode, ui.goto_previous_screen, PSTR(MSG_BLTOUCH_MODE_CHANGE)); - }); - MENU_ITEM(submenu, MSG_BLTOUCH_OD_MODE, []{ - do_select_screen(PSTR(MSG_BLTOUCH_OD_MODE), PSTR(MSG_BUTTON_CANCEL), bltouch._set_OD_mode, ui.goto_previous_screen, PSTR(MSG_BLTOUCH_MODE_CHANGE)); - }); - MENU_ITEM(function, MSG_BLTOUCH_MODE_STORE, bltouch._mode_store); - MENU_ITEM(submenu, MSG_BLTOUCH_MODE_STORE_5V, []{ - do_select_screen(PSTR(MSG_BLTOUCH_MODE_STORE_5V), PSTR(MSG_BUTTON_CANCEL), bltouch.mode_conv_5V, ui.goto_previous_screen, PSTR(MSG_BLTOUCH_MODE_CHANGE)); - }); - MENU_ITEM(submenu, MSG_BLTOUCH_MODE_STORE_OD, []{ - do_select_screen(PSTR(MSG_BLTOUCH_MODE_STORE_OD), PSTR(MSG_BUTTON_CANCEL), bltouch.mode_conv_OD, ui.goto_previous_screen, PSTR(MSG_BLTOUCH_MODE_CHANGE)); - }); - MENU_ITEM(function, MSG_BLTOUCH_MODE_ECHO, bltouch_report); + CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); + ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store); + CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); + ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report); #endif END_MENU(); } @@ -223,11 +218,11 @@ static void lcd_factory_settings() { void menu_touchmi() { START_MENU(); ui.defer_status_screen(); - MENU_BACK(MSG_CONFIGURATION); - MENU_ITEM(gcode, MSG_TOUCHMI_INIT, PSTR("M851 Z0\nG28\nG1 F200 Z0")); - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - MENU_ITEM(gcode, MSG_TOUCHMI_SAVE, PSTR("M500\nG1 F200 Z10")); - MENU_ITEM(gcode, MSG_TOUCHMI_ZTEST, PSTR("G28\nG1 F200 Z0")); + BACK_ITEM(MSG_CONFIGURATION); + GCODES_ITEM(MSG_TOUCHMI_INIT, PSTR("M851 Z0\nG28\nG1 F200 Z0")); + SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); + GCODES_ITEM(MSG_TOUCHMI_SAVE, PSTR("M500\nG1 F200 Z10")); + GCODES_ITEM(MSG_TOUCHMI_ZTEST, PSTR("G28\nG1 F200 Z0")); END_MENU(); } #endif @@ -240,9 +235,9 @@ static void lcd_factory_settings() { void menu_case_light() { START_MENU(); - MENU_BACK(MSG_CONFIGURATION); - MENU_ITEM_EDIT_CALLBACK(uint8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); + BACK_ITEM(MSG_CONFIGURATION); + EDIT_ITEM(percent, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true); + EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); END_MENU(); } @@ -256,23 +251,23 @@ static void lcd_factory_settings() { void menu_config_retract() { START_MENU(); - MENU_BACK(MSG_CONFIGURATION); + BACK_ITEM(MSG_CONFIGURATION); #if ENABLED(FWRETRACT_AUTORETRACT) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); + EDIT_ITEM(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); #endif - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT, &fwretract.settings.retract_length, 0, 100); + EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT, &fwretract.settings.retract_length, 0, 100); #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.settings.swap_retract_length, 0, 100); + EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.settings.swap_retract_length, 0, 100); #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &fwretract.settings.retract_feedrate_mm_s, 1, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_ZHOP, &fwretract.settings.retract_zraise, 0, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.settings.retract_recover_extra, -100, 100); + EDIT_ITEM(float3, MSG_CONTROL_RETRACTF, &fwretract.settings.retract_feedrate_mm_s, 1, 999); + EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_ZHOP, &fwretract.settings.retract_zraise, 0, 999); + EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.settings.retract_recover_extra, -100, 100); #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.settings.swap_retract_recover_extra, -100, 100); + EDIT_ITEM(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.settings.swap_retract_recover_extra, -100, 100); #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.settings.retract_recover_feedrate_mm_s, 1, 999); + EDIT_ITEM(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.settings.retract_recover_feedrate_mm_s, 1, 999); #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.settings.swap_retract_recover_feedrate_mm_s, 1, 999); + EDIT_ITEM(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.settings.swap_retract_recover_feedrate_mm_s, 1, 999); #endif END_MENU(); } @@ -282,36 +277,21 @@ static void lcd_factory_settings() { #if DISABLED(SLIM_LCD_MENUS) void _menu_configuration_preheat_settings(const uint8_t material) { - #if HOTENDS > 5 - #define MINTEMP_ALL _MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP, HEATER_5_MINTEMP) - #define MAXTEMP_ALL _MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP) - #elif HOTENDS > 4 - #define MINTEMP_ALL _MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP) - #define MAXTEMP_ALL _MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP) - #elif HOTENDS > 3 - #define MINTEMP_ALL _MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP) - #define MAXTEMP_ALL _MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP) - #elif HOTENDS > 2 - #define MINTEMP_ALL _MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP) - #define MAXTEMP_ALL _MAX(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 + #define _MINTEMP_ITEM(N) HEATER_##N##_MINTEMP, + #define _MAXTEMP_ITEM(N) HEATER_##N##_MAXTEMP, + #define MINTEMP_ALL _MIN(REPEAT(HOTENDS, _MINTEMP_ITEM) 999) + #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0) START_MENU(); - MENU_BACK(MSG_CONFIGURATION); - MENU_ITEM_EDIT(uint8, MSG_FAN_SPEED, &ui.preheat_fan_speed[material], 0, 255); + BACK_ITEM(MSG_CONFIGURATION); + EDIT_ITEM(percent, MSG_FAN_SPEED, &ui.preheat_fan_speed[material], 0, 255); #if HAS_TEMP_HOTEND - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); + EDIT_ITEM(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); #endif #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 10); + EDIT_ITEM(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 10); #endif #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); #endif END_MENU(); } @@ -323,21 +303,21 @@ static void lcd_factory_settings() { void menu_configuration() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); // // Debug Menu when certain options are enabled // #if HAS_DEBUG_MENU - MENU_ITEM(submenu, MSG_DEBUG_MENU, menu_debug); + SUBMENU(MSG_DEBUG_MENU, menu_debug); #endif - MENU_ITEM(submenu, MSG_ADVANCED_SETTINGS, menu_advanced_settings); + SUBMENU(MSG_ADVANCED_SETTINGS, menu_advanced_settings); #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); + 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); + EDIT_ITEM(float52, MSG_ZPROBE_ZOFFSET, &probe_offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif const bool busy = printer_busy(); @@ -346,23 +326,23 @@ void menu_configuration() { // Delta Calibration // #if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, menu_delta_calibrate); + SUBMENU(MSG_DELTA_CALIBRATE, menu_delta_calibrate); #endif #if HAS_HOTEND_OFFSET - MENU_ITEM(submenu, MSG_OFFSETS_MENU, menu_tool_offsets); + SUBMENU(MSG_OFFSETS_MENU, menu_tool_offsets); #endif #if ENABLED(DUAL_X_CARRIAGE) - MENU_ITEM(submenu, MSG_IDEX_MENU, menu_idex); + SUBMENU(MSG_IDEX_MENU, menu_idex); #endif #if ENABLED(BLTOUCH) - MENU_ITEM(submenu, MSG_BLTOUCH, menu_bltouch); + SUBMENU(MSG_BLTOUCH, menu_bltouch); #endif #if ENABLED(TOUCH_MI_PROBE) - MENU_ITEM(submenu, MSG_TOUCHMI_PROBE, menu_touchmi); + SUBMENU(MSG_TOUCHMI_PROBE, menu_touchmi); #endif } @@ -370,7 +350,7 @@ void menu_configuration() { // Set single nozzle filament retract and prime length // #if EXTRUDERS > 1 - MENU_ITEM(submenu, MSG_TOOL_CHANGE, menu_tool_change); + SUBMENU(MSG_TOOL_CHANGE, menu_tool_change); #endif // @@ -379,41 +359,46 @@ void menu_configuration() { #if ENABLED(CASE_LIGHT_MENU) #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) if (PWM_PIN(CASE_LIGHT_PIN)) - MENU_ITEM(submenu, MSG_CASE_LIGHT, menu_case_light); + SUBMENU(MSG_CASE_LIGHT, menu_case_light); else #endif - MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); + EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); #endif #if HAS_LCD_CONTRAST - MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); + EDIT_ITEM(int3, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); #endif #if ENABLED(FWRETRACT) - MENU_ITEM(submenu, MSG_RETRACT, menu_config_retract); + SUBMENU(MSG_RETRACT, menu_config_retract); #endif #if HAS_FILAMENT_SENSOR - MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); + EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); #endif #if ENABLED(POWER_LOSS_RECOVERY) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed); + EDIT_ITEM(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed); #endif #if DISABLED(SLIM_LCD_MENUS) // Preheat configurations - MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, menu_preheat_material1_settings); - MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, menu_preheat_material2_settings); + SUBMENU(MSG_PREHEAT_1_SETTINGS, menu_preheat_material1_settings); + SUBMENU(MSG_PREHEAT_2_SETTINGS, menu_preheat_material2_settings); #endif #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); if (!busy) - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); + ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings); #endif if (!busy) - MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); + ACTION_ITEM(MSG_RESTORE_FAILSAFE, []{ + settings.reset(); + #if HAS_BUZZER + ui.completion_feedback(); + #endif + }); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_custom.cpp b/Marlin/src/lcd/menu/menu_custom.cpp index 33ec5352e030..f6178133bef9 100644 --- a/Marlin/src/lcd/menu/menu_custom.cpp +++ b/Marlin/src/lcd/menu/menu_custom.cpp @@ -39,7 +39,7 @@ void _lcd_user_gcode(PGM_P const cmd) { queue.inject_P(cmd); - #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) + #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) && HAS_BUZZER ui.completion_feedback(); #endif #if ENABLED(USER_SCRIPT_RETURN) @@ -47,39 +47,23 @@ void _lcd_user_gcode(PGM_P const cmd) { #endif } -#if defined(USER_DESC_1) && defined(USER_GCODE_1) - void lcd_user_gcode_1() { _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); } -#endif -#if defined(USER_DESC_2) && defined(USER_GCODE_2) - void lcd_user_gcode_2() { _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); } -#endif -#if defined(USER_DESC_3) && defined(USER_GCODE_3) - void lcd_user_gcode_3() { _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); } -#endif -#if defined(USER_DESC_4) && defined(USER_GCODE_4) - void lcd_user_gcode_4() { _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); } -#endif -#if defined(USER_DESC_5) && defined(USER_GCODE_5) - void lcd_user_gcode_5() { _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); } -#endif - void menu_user() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); #if defined(USER_DESC_1) && defined(USER_GCODE_1) - MENU_ITEM(function, USER_DESC_1, lcd_user_gcode_1); + ACTION_ITEM_P(PSTR(USER_DESC_1), []{ _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); }); #endif #if defined(USER_DESC_2) && defined(USER_GCODE_2) - MENU_ITEM(function, USER_DESC_2, lcd_user_gcode_2); + ACTION_ITEM_P(PSTR(USER_DESC_2), []{ _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); }); #endif #if defined(USER_DESC_3) && defined(USER_GCODE_3) - MENU_ITEM(function, USER_DESC_3, lcd_user_gcode_3); + ACTION_ITEM_P(PSTR(USER_DESC_3), []{ _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); }); #endif #if defined(USER_DESC_4) && defined(USER_GCODE_4) - MENU_ITEM(function, USER_DESC_4, lcd_user_gcode_4); + ACTION_ITEM_P(PSTR(USER_DESC_4), []{ _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); }); #endif #if defined(USER_DESC_5) && defined(USER_GCODE_5) - MENU_ITEM(function, USER_DESC_5, lcd_user_gcode_5); + ACTION_ITEM_P(PSTR(USER_DESC_5), []{ _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); }); #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index a4770d0f86c3..75c427bafaac 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -36,8 +36,12 @@ #include "../../feature/bedlevel/bedlevel.h" #endif -void _man_probe_pt(const float &rx, const float &ry) { - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extensible_ui/ui_api.h" +#endif + +void _man_probe_pt(const xy_pos_t &xy) { + do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES); ui.synchronize(); move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); ui.goto_screen(lcd_move_z); @@ -47,17 +51,24 @@ void _man_probe_pt(const float &rx, const float &ry) { #include "../../gcode/gcode.h" - float lcd_probe_pt(const float &rx, const float &ry) { - _man_probe_pt(rx, ry); + #if ENABLED(HOST_PROMPT_SUPPORT) + #include "../../feature/host_actions.h" // for host_prompt_do + #endif + + float lcd_probe_pt(const xy_pos_t &xy) { + _man_probe_pt(xy); KEEPALIVE_STATE(PAUSED_FOR_USER); ui.defer_status_screen(); wait_for_user = true; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR); + #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress")); #endif while (wait_for_user) idle(); ui.goto_previous_screen_no_defer(); - return current_position[Z_AXIS]; + return current_position.z; } #endif @@ -72,62 +83,65 @@ void _man_probe_pt(const float &rx, const float &ry) { } void _lcd_delta_calibrate_home() { - queue.inject_P(PSTR("G28")); + queue.inject_P(G28_STR); ui.goto_screen(_lcd_calibrate_homing); } - void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); } - void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); } - void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); } - void _goto_center() { _man_probe_pt(0,0); } + void _goto_tower_a(const float &a) { + xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) }; + _man_probe_pt(tower_vec * delta_calibration_radius()); + } + void _goto_tower_x() { _goto_tower_a(210); } + void _goto_tower_y() { _goto_tower_a(330); } + void _goto_tower_z() { _goto_tower_a( 90); } + void _goto_center() { xy_pos_t ctr{0}; _man_probe_pt(ctr); } #endif -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() { + auto _recalc_delta_settings = []() { + #if HAS_LEVELING + reset_bed_level(); // After changing kinematics bed-level data is no longer valid + #endif + recalc_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); - #define EDIT_ENDSTOP_ADJ(LABEL,N) MENU_ITEM_EDIT_CALLBACK(float43, LABEL, &delta_endstop_adj[_AXIS(N)], -5, 5, _recalc_delta_settings) - EDIT_ENDSTOP_ADJ("Ex",A); - EDIT_ENDSTOP_ADJ("Ey",B); - EDIT_ENDSTOP_ADJ("Ez",C); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); - #define EDIT_ANGLE_TRIM(LABEL,N) MENU_ITEM_EDIT_CALLBACK(float43, LABEL, &delta_tower_angle_trim[_AXIS(N)], -5, 5, _recalc_delta_settings) - EDIT_ANGLE_TRIM("Tx",A); - EDIT_ANGLE_TRIM("Ty",B); - EDIT_ANGLE_TRIM("Tz",C); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); + BACK_ITEM(MSG_DELTA_CALIBRATE); + EDIT_ITEM(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); + #define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_endstop_adj.N, -5, 5, _recalc_delta_settings) + EDIT_ENDSTOP_ADJ("Ex", a); + EDIT_ENDSTOP_ADJ("Ey", b); + EDIT_ENDSTOP_ADJ("Ez", c); + EDIT_ITEM(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); + #define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings) + EDIT_ANGLE_TRIM("Tx", a); + EDIT_ANGLE_TRIM("Ty", b); + EDIT_ANGLE_TRIM("Tz", c); + EDIT_ITEM(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); END_MENU(); } void menu_delta_calibrate() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); #if ENABLED(DELTA_AUTO_CALIBRATION) - MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); + GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); + ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings); + ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings); #endif #endif - MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings); + SUBMENU(MSG_DELTA_SETTINGS, lcd_delta_settings); #if ENABLED(DELTA_CALIBRATION_MENU) - MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home); + SUBMENU(MSG_AUTO_HOME, _lcd_delta_calibrate_home); if (all_axes_homed()) { - 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); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center); + SUBMENU(MSG_DELTA_CALIBRATE_X, _goto_tower_x); + SUBMENU(MSG_DELTA_CALIBRATE_Y, _goto_tower_y); + SUBMENU(MSG_DELTA_CALIBRATE_Z, _goto_tower_z); + SUBMENU(MSG_DELTA_CALIBRATE_CENTER, _goto_center); } #endif diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index d76a6aa77e88..51f96677fc60 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -47,92 +47,50 @@ inline PGM_P _change_filament_temp_command() { return PSTR("M701 T%d"); case PAUSE_MODE_UNLOAD_FILAMENT: return _change_filament_temp_extruder >= 0 ? PSTR("M702 T%d") : PSTR("M702 ;%d"); + case PAUSE_MODE_CHANGE_FILAMENT: case PAUSE_MODE_PAUSE_PRINT: default: return PSTR("M600 B0 T%d"); } - return PSTR(MSG_FILAMENTCHANGE); + return GET_TEXT(MSG_FILAMENTCHANGE); } +// Initiate Filament Load/Unload/Change at the specified temperature static void _change_filament_temp(const uint16_t temperature) { char cmd[11]; sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder); thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder); lcd_enqueue_one_now(cmd); } -inline void _lcd_change_filament_temp_1_func() { _change_filament_temp(ui.preheat_hotend_temp[0]); } -inline void _lcd_change_filament_temp_2_func() { _change_filament_temp(ui.preheat_hotend_temp[1]); } -inline void _lcd_change_filament_temp_custom_cb() { _change_filament_temp(thermalManager.temp_hotend[_change_filament_temp_extruder].target); } -static PGM_P change_filament_header(const PauseMode mode) { +// +// Menu to choose the temperature and start Filament Change +// + +inline PGM_P change_filament_header(const PauseMode mode) { switch (mode) { case PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENTLOAD); + return GET_TEXT(MSG_FILAMENTLOAD); case PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENTUNLOAD); + return GET_TEXT(MSG_FILAMENTUNLOAD); default: break; } - return PSTR(MSG_FILAMENTCHANGE); + return GET_TEXT(MSG_FILAMENTCHANGE); } void _menu_temp_filament_op(const PauseMode 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_BACK); - MENU_ITEM(function, MSG_PREHEAT_1, _lcd_change_filament_temp_1_func); - MENU_ITEM(function, MSG_PREHEAT_2, _lcd_change_filament_temp_2_func); - uint16_t max_temp; - switch (extruder) { - default: max_temp = HEATER_0_MAXTEMP; - #if HOTENDS > 1 - case 1: max_temp = HEATER_1_MAXTEMP; break; - #if HOTENDS > 2 - case 2: max_temp = HEATER_2_MAXTEMP; break; - #if HOTENDS > 3 - case 3: max_temp = HEATER_3_MAXTEMP; break; - #if HOTENDS > 4 - case 4: max_temp = HEATER_4_MAXTEMP; break; - #if HOTENDS > 5 - case 5: max_temp = HEATER_5_MAXTEMP; break; - #endif - #endif - #endif - #endif - #endif - } - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[_change_filament_temp_extruder].target, EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_cb); + if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_CENTER|SS_INVERT); + BACK_ITEM(MSG_BACK); + ACTION_ITEM(MSG_PREHEAT_1, []{ _change_filament_temp(ui.preheat_hotend_temp[0]); }); + ACTION_ITEM(MSG_PREHEAT_2, []{ _change_filament_temp(ui.preheat_hotend_temp[1]); }); + EDIT_ITEM_FAST(int3, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[_change_filament_temp_extruder].target, EXTRUDE_MINTEMP, heater_maxtemp[extruder] - 15, []{ + _change_filament_temp(thermalManager.temp_hotend[_change_filament_temp_extruder].target); + }); END_MENU(); } -#if E_STEPPERS - void menu_temp_e0_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 0); } - void menu_temp_e0_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); } - void menu_temp_e0_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); } - #if E_STEPPERS > 1 - void menu_temp_e1_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 1); } - void menu_temp_e1_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 1); } - void menu_temp_e1_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 1); } - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - void menu_unload_filament_all_temp() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); } - #endif - #if E_STEPPERS > 2 - void menu_temp_e2_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 2); } - void menu_temp_e2_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 2); } - void menu_temp_e2_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 2); } - #if E_STEPPERS > 3 - void menu_temp_e3_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 3); } - void menu_temp_e3_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 3); } - void menu_temp_e3_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 3); } - #if E_STEPPERS > 4 - void menu_temp_e4_filament_change() { _menu_temp_filament_op(PAUSE_MODE_PAUSE_PRINT, 4); } - void menu_temp_e4_filament_load() { _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 4); } - void menu_temp_e4_filament_unload() { _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 -#endif // E_STEPPERS /** * @@ -142,169 +100,93 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) void menu_change_filament() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); + + // Say "filament change" when no print is active + editable.int8 = printingIsPaused() ? PAUSE_MODE_PAUSE_PRINT : PAUSE_MODE_CHANGE_FILAMENT; // Change filament #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE); + PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE); if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_change); + SUBMENU_P(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0")); + GCODES_ITEM_P(msg, 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, menu_temp_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, menu_temp_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, menu_temp_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, menu_temp_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, menu_temp_e4_filament_change); - else - MENU_ITEM_P(gcode, msg4, PSTR("M600 B0 T4")); - #if E_STEPPERS > 5 - PGM_P msg5 = PSTR(MSG_FILAMENTCHANGE " " MSG_E6); - if (thermalManager.targetTooColdToExtrude(5)) - MENU_ITEM_P(submenu, msg5, menu_temp_e5_filament_change); - else - MENU_ITEM_P(gcode, msg5, PSTR("M600 B0 T5")); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 + PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E); + for (uint8_t s = 0; s < E_STEPPERS; s++) { + if (thermalManager.targetTooColdToExtrude(s)) + SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); + else { + ACTION_ITEM_N_P(s, msg, []{ + char cmd[12]; + sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex)); + lcd_enqueue_one_now(cmd); + }); + } + } + #endif #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) if (!printer_busy()) { // Load filament #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD); + PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD); if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_load); + SUBMENU_P(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); }); else - MENU_ITEM_P(gcode, msg0, PSTR("M701")); + GCODES_ITEM_P(msg_load, 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, menu_temp_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, menu_temp_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, menu_temp_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, menu_temp_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, menu_temp_e4_filament_load); - else - MENU_ITEM_P(gcode, msg4, PSTR("M701 T4")); - #if E_STEPPERS > 5 - PGM_P msg5 = PSTR(MSG_FILAMENTLOAD " " MSG_E6); - if (thermalManager.targetTooColdToExtrude(5)) - MENU_ITEM_P(submenu, msg5, menu_temp_e5_filament_load); - else - MENU_ITEM_P(gcode, msg5, PSTR("M701 T5")); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 + PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E); + for (uint8_t s = 0; s < E_STEPPERS; s++) { + if (thermalManager.targetTooColdToExtrude(s)) + SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); }); + else { + ACTION_ITEM_N_P(s, msg_load, []{ + char cmd[12]; + sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex)); + lcd_enqueue_one_now(cmd); + }); + } + } + #endif // Unload filament #if E_STEPPERS == 1 - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702")); + PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD); + if (thermalManager.targetTooColdToExtrude(active_extruder)) + SUBMENU_P(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); }); else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD, menu_temp_e0_filament_unload); + GCODES_ITEM_P(msg_unload, PSTR("M702")); #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) - #if E_STEPPERS > 5 - && thermalManager.targetHotEnoughToExtrude(5) - #endif // E_STEPPERS > 5 - #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, menu_unload_filament_all_temp); - #endif - if (thermalManager.targetHotEnoughToExtrude(0)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E1, PSTR("M702 T0")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E1, menu_temp_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, menu_temp_e1_filament_unload); - #if E_STEPPERS > 2 - if (thermalManager.targetHotEnoughToExtrude(2)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E3, PSTR("M702 T2")); + { + bool too_cold = false; + for (uint8_t s = 0; s < E_STEPPERS; s++) { + if (thermalManager.targetTooColdToExtrude(s)) { + too_cold = true; break; + } + } + if (!too_cold) + GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E3, menu_temp_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, menu_temp_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, menu_temp_e4_filament_unload); - #if E_STEPPERS > 5 - if (thermalManager.targetHotEnoughToExtrude(5)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E6, PSTR("M702 T5")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E6, menu_temp_e5_filament_unload); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - } + SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); }); + } + #endif + PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E); + for (uint8_t s = 0; s < E_STEPPERS; s++) { + if (thermalManager.targetTooColdToExtrude(s)) + SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); }); + else { + ACTION_ITEM_N_P(s, msg_unload, []{ + char cmd[12]; + sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex)); + lcd_enqueue_one_now(cmd); + }); + } + } + #endif + } // !printer_busy #endif END_MENU(); @@ -315,20 +197,22 @@ static uint8_t hotend_status_extruder = 0; static PGM_P pause_header() { switch (pause_mode) { + case PAUSE_MODE_CHANGE_FILAMENT: + return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER); case PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_LOAD); + return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_LOAD); case PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); + return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); default: break; } - return PSTR(MSG_FILAMENT_CHANGE_HEADER_PAUSE); + return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_PAUSE); } // Portions from STATIC_ITEM... #define HOTEND_STATUS_ITEM() do { \ if (_menuLineNr == _thisItemNr) { \ if (ui.should_draw()) { \ - draw_menu_item_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \ + MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT); \ ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \ } \ if (_skipStatic && encoderLine <= _thisItemNr) { \ @@ -340,163 +224,60 @@ static PGM_P pause_header() { ++_thisItemNr; \ }while(0) -void lcd_pause_resume_print() { - pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; -} - -void lcd_pause_extrude_more() { - pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; -} - void menu_pause_option() { START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); + STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER); #endif - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_pause_extrude_more); + ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_PURGE, []{ pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; }); #if HAS_FILAMENT_SENSOR if (runout.filament_ran_out) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); + EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset); else #endif - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_pause_resume_print); + ACTION_ITEM(MSG_FILAMENT_CHANGE_OPTION_RESUME, []{ pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; }); END_MENU(); } // // ADVANCED_PAUSE_FEATURE message screens // +// Warning: msg must have three null bytes to delimit lines! +// +void _lcd_pause_message(PGM_P const msg) { + PGM_P const msg1 = msg; + PGM_P const msg2 = msg1 + strlen_P(msg1) + 1; + PGM_P const msg3 = msg2 + strlen_P(msg2) + 1; + const bool has2 = msg2[0], has3 = msg3[0], + skip1 = !has2 && (LCD_HEIGHT) >= 5; -void _lcd_pause_message(PGM_P const msg1, PGM_P const msg2=nullptr, PGM_P const msg3=nullptr) { START_SCREEN(); - STATIC_ITEM_P(pause_header(), true, true); - STATIC_ITEM_P(msg1); - if (msg2) STATIC_ITEM_P(msg2); - if (msg3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3); - if ((!!msg2) + (!!msg3) + 2 < (LCD_HEIGHT) - 1) STATIC_ITEM(" "); - HOTEND_STATUS_ITEM(); + STATIC_ITEM_P(pause_header(), SS_CENTER|SS_INVERT); // 1: Header + if (skip1) SKIP_ITEM(); // Move a single-line message down + STATIC_ITEM_P(msg1); // 2: Message Line 1 + if (has2) STATIC_ITEM_P(msg2); // 3: Message Line 2 + if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3); // 4: Message Line 3 (if LCD has 5 lines) + if (skip1 + 1 + has2 + has3 < (LCD_HEIGHT) - 2) SKIP_ITEM(); // Push Hotend Status down, if needed + HOTEND_STATUS_ITEM(); // 5: Hotend Status END_SCREEN(); } -void lcd_pause_pausing_message() { - _lcd_pause_message(PSTR(MSG_PAUSE_PRINT_INIT_1) - #ifdef MSG_PAUSE_PRINT_INIT_2 - , PSTR(MSG_PAUSE_PRINT_INIT_2) - #ifdef MSG_PAUSE_PRINT_INIT_3 - , PSTR(MSG_PAUSE_PRINT_INIT_3) - #endif - #endif - ); -} - -void lcd_pause_changing_message() { - _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_INIT_1) - #ifdef MSG_FILAMENT_CHANGE_INIT_2 - , PSTR(MSG_FILAMENT_CHANGE_INIT_2) - #ifdef MSG_FILAMENT_CHANGE_INIT_3 - , PSTR(MSG_FILAMENT_CHANGE_INIT_3) - #endif - #endif - ); -} - -void lcd_pause_unload_message() { - _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_UNLOAD_1) - #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2 - , PSTR(MSG_FILAMENT_CHANGE_UNLOAD_2) - #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3 - , PSTR(MSG_FILAMENT_CHANGE_UNLOAD_3) - #endif - #endif - ); -} - -void lcd_pause_heating_message() { - _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_HEATING_1) - #ifdef MSG_FILAMENT_CHANGE_HEATING_2 - , PSTR(MSG_FILAMENT_CHANGE_HEATING_2) - #ifdef MSG_FILAMENT_CHANGE_HEATING_3 - , PSTR(MSG_FILAMENT_CHANGE_HEATING_3) - #endif - #endif - ); -} - -void lcd_pause_heat_message() { - _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_HEAT_1) - #ifdef MSG_FILAMENT_CHANGE_HEAT_2 - , PSTR(MSG_FILAMENT_CHANGE_HEAT_2) - #ifdef MSG_FILAMENT_CHANGE_HEAT_3 - , PSTR(MSG_FILAMENT_CHANGE_HEAT_3) - #endif - #endif - ); -} - -void lcd_pause_insert_message() { - _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_INSERT_1) - #ifdef MSG_FILAMENT_CHANGE_INSERT_2 - , PSTR(MSG_FILAMENT_CHANGE_INSERT_2) - #ifdef MSG_FILAMENT_CHANGE_INSERT_3 - , PSTR(MSG_FILAMENT_CHANGE_INSERT_3) - #endif - #endif - ); -} - -void lcd_pause_load_message() { - _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_LOAD_1) - #ifdef MSG_FILAMENT_CHANGE_LOAD_2 - , PSTR(MSG_FILAMENT_CHANGE_LOAD_2) - #ifdef MSG_FILAMENT_CHANGE_LOAD_3 - , PSTR(MSG_FILAMENT_CHANGE_LOAD_3) - #endif - #endif - ); -} - -void lcd_pause_waiting_message() { - _lcd_pause_message(PSTR(MSG_ADVANCED_PAUSE_WAITING_1) - #ifdef MSG_ADVANCED_PAUSE_WAITING_2 - , PSTR(MSG_ADVANCED_PAUSE_WAITING_2) - #ifdef MSG_ADVANCED_PAUSE_WAITING_3 - , PSTR(MSG_ADVANCED_PAUSE_WAITING_3) - #endif - #endif - ); -} - -void lcd_pause_resume_message() { - _lcd_pause_message(PSTR(MSG_FILAMENT_CHANGE_RESUME_1) - #ifdef MSG_FILAMENT_CHANGE_RESUME_2 - , PSTR(MSG_FILAMENT_CHANGE_RESUME_2) - #ifdef MSG_FILAMENT_CHANGE_RESUME_3 - , PSTR(MSG_FILAMENT_CHANGE_RESUME_3) - #endif - #endif - ); -} +void lcd_pause_pausing_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_INIT)); } +void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INIT)); } +void lcd_pause_unload_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD)); } +void lcd_pause_heating_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); } +void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT)); } +void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); } +void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD)); } +void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING)); } +void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); } void lcd_pause_purge_message() { - _lcd_pause_message( - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_1) - #ifdef MSG_FILAMENT_CHANGE_CONT_PURGE_2 - , PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_2) - #ifdef MSG_FILAMENT_CHANGE_CONT_PURGE_3 - , PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_3) - #endif - #endif - #else - PSTR(MSG_FILAMENT_CHANGE_PURGE_1) - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - , PSTR(MSG_FILAMENT_CHANGE_PURGE_2) - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - , PSTR(MSG_FILAMENT_CHANGE_PURGE_3) - #endif - #endif - #endif - ); + #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) + _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_CONT_PURGE)); + #else + _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE)); + #endif } FORCE_INLINE screenFunc_t ap_message_screen(const PauseMessage message) { diff --git a/Marlin/src/lcd/menu/menu_game.cpp b/Marlin/src/lcd/menu/menu_game.cpp index f5eb60a87961..4f9748dc126d 100644 --- a/Marlin/src/lcd/menu/menu_game.cpp +++ b/Marlin/src/lcd/menu/menu_game.cpp @@ -29,21 +29,20 @@ void menu_game() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); #if ENABLED(MARLIN_BRICKOUT) - MENU_ITEM(submenu, MSG_BRICKOUT, brickout.enter_game); + SUBMENU(MSG_BRICKOUT, brickout.enter_game); #endif #if ENABLED(MARLIN_INVADERS) - MENU_ITEM(submenu, MSG_INVADERS, invaders.enter_game); + SUBMENU(MSG_INVADERS, invaders.enter_game); #endif #if ENABLED(MARLIN_SNAKE) - MENU_ITEM(submenu, MSG_SNAKE, snake.enter_game); + SUBMENU(MSG_SNAKE, snake.enter_game); #endif #if ENABLED(MARLIN_MAZE) - MENU_ITEM(submenu, MSG_MAZE, maze.enter_game); + SUBMENU(MSG_MAZE, maze.enter_game); #endif END_MENU(); } #endif // HAS_GAME_MENU - diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index f7b6f3a49188..e7b4dbe7ce87 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -28,19 +28,14 @@ #if HAS_LCD_MENU && ENABLED(LCD_INFO_MENU) +#include "menu.h" + #if HAS_GAMES #include "game/game.h" #endif -#include "menu.h" -// #include "../../module/motion.h" -// #include "../../module/planner.h" -// #include "../../module/temperature.h" -// #include "../../Marlin.h" - -// #if HAS_LEVELING -// #include "../../feature/bedlevel/bedlevel.h" -// #endif +#define VALUE_ITEM(MSG, VALUE, STYL) do{ strcpy_P(buffer, PSTR(": ")); strcpy(buffer + 2, VALUE); STATIC_ITEM(MSG, STYL, buffer); }while(0) +#define VALUE_ITEM_P(MSG, PVALUE, STYL) do{ strcpy_P(buffer, PSTR(": ")); strcpy_P(buffer + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, buffer); }while(0) #if ENABLED(PRINTCOUNTER) @@ -50,48 +45,43 @@ // About Printer > Printer Stats // void menu_info_stats() { - if (ui.use_click()) return ui.goto_previous_screen(); - - char buffer[21]; - printStatistics stats = print_job_timer.getStats(); + if (ui.use_click()) return ui.go_back(); - START_SCREEN(); // 12345678901234567890 - STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, i16tostr3left(stats.totalPrints)); // Print Count: 999 - STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, i16tostr3left(stats.finishedPrints)); // Completed : 666 + char buffer[21]; // For macro usage - duration_t elapsed = stats.printTime; - elapsed.toString(buffer); + printStatistics stats = print_job_timer.getStats(); - STATIC_ITEM(MSG_INFO_PRINT_TIME ":", false, false); // Total print Time: - STATIC_ITEM("> ", false, false, buffer); // > 99y 364d 23h 59m 59s + START_SCREEN(); // 12345678901234567890 + VALUE_ITEM(MSG_INFO_PRINT_COUNT, i16tostr3left(stats.totalPrints), SS_LEFT); // Print Count: 999 + VALUE_ITEM(MSG_INFO_COMPLETED_PRINTS, i16tostr3left(stats.finishedPrints), SS_LEFT); // Completed : 666 - elapsed = stats.longestPrint; - elapsed.toString(buffer); + STATIC_ITEM(MSG_INFO_PRINT_TIME, SS_LEFT); // Total print Time: + STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s - STATIC_ITEM(MSG_INFO_PRINT_LONGEST ":", false, false); // Longest job time: - STATIC_ITEM("> ", false, false, buffer); // > 99y 364d 23h 59m 59s + STATIC_ITEM(MSG_INFO_PRINT_LONGEST, SS_LEFT); // Longest job time: + STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer)); // > 99y 364d 23h 59m 59s + STATIC_ITEM(MSG_INFO_PRINT_FILAMENT, SS_LEFT); // Extruded total: sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10); - STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ":", false, false); // Extruded total: - STATIC_ITEM("> ", false, false, buffer); // > 125m + STATIC_ITEM_P(PSTR("> "), SS_LEFT, buffer); // > 125m + + #if SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0 + strcpy_P(buffer, GET_TEXT(MSG_SERVICE_IN)); + #endif #if SERVICE_INTERVAL_1 > 0 - elapsed = stats.nextService1; - elapsed.toString(buffer); - STATIC_ITEM(SERVICE_NAME_1 MSG_SERVICE_IN, false, false); // Service X in: - STATIC_ITEM("> ", false, false, buffer); // > 7d 12h 11m 10s + STATIC_ITEM_P(PSTR(SERVICE_NAME_1 " "), SS_LEFT, buffer); // Service X in: + STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s #endif + #if SERVICE_INTERVAL_2 > 0 - elapsed = stats.nextService2; - elapsed.toString(buffer); - STATIC_ITEM(SERVICE_NAME_2 MSG_SERVICE_IN, false, false); - STATIC_ITEM("> ", false, false, buffer); + STATIC_ITEM_P(PSTR(SERVICE_NAME_2 " "), SS_LEFT, buffer); + STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer)); #endif + #if SERVICE_INTERVAL_3 > 0 - elapsed = stats.nextService3; - elapsed.toString(buffer); - STATIC_ITEM(SERVICE_NAME_3 MSG_SERVICE_IN, false, false); - STATIC_ITEM("> ", false, false, buffer); + STATIC_ITEM_P(PSTR(SERVICE_NAME_3 " "), SS_LEFT, buffer); + STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer)); #endif END_SCREEN(); @@ -103,67 +93,116 @@ // About Printer > Thermistors // void menu_info_thermistors() { - if (ui.use_click()) return ui.goto_previous_screen(); + if (ui.use_click()) return ui.go_back(); + + char buffer[21]; // For macro usage + START_SCREEN(); - #define THERMISTOR_ID TEMP_SENSOR_0 - #include "../thermistornames.h" - STATIC_ITEM("T0: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP), false); + + #if EXTRUDERS + #define THERMISTOR_ID TEMP_SENSOR_0 + #include "../thermistornames.h" + STATIC_ITEM_P(PSTR(LCD_STR_E0 ": " THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_0_MAXTEMP), SS_LEFT); + #endif #if TEMP_SENSOR_1 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_1 #include "../thermistornames.h" - STATIC_ITEM("T1: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP), false); + STATIC_ITEM_P(PSTR(LCD_STR_E1 ": " THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_1_MAXTEMP), SS_LEFT); #endif #if TEMP_SENSOR_2 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_2 #include "../thermistornames.h" - STATIC_ITEM("T2: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP), false); + STATIC_ITEM_P(PSTR(LCD_STR_E2 ": " THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_2_MAXTEMP), SS_LEFT); #endif #if TEMP_SENSOR_3 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_3 #include "../thermistornames.h" - STATIC_ITEM("T3: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP), false); + STATIC_ITEM_P(PSTR(LCD_STR_E3 ": " THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_3_MAXTEMP), SS_LEFT); #endif #if TEMP_SENSOR_4 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_4 #include "../thermistornames.h" - STATIC_ITEM("T4: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_4_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_4_MAXTEMP), false); + STATIC_ITEM_P(PSTR(LCD_STR_E4 ": " THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_4_MAXTEMP), SS_LEFT); #endif #if TEMP_SENSOR_5 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_5 #include "../thermistornames.h" - STATIC_ITEM("T5: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_5_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_5_MAXTEMP), false); + STATIC_ITEM_P(PSTR(LCD_STR_E5 ": " THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT); + #endif + + #if EXTRUDERS + { + STATIC_ITEM( + #if WATCH_HOTENDS + MSG_INFO_RUNAWAY_ON + #else + MSG_INFO_RUNAWAY_OFF + #endif + , SS_LEFT + ); + } #endif #if HAS_HEATED_BED + { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED #include "../thermistornames.h" - STATIC_ITEM("TBed:" THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP), false); + STATIC_ITEM_P(PSTR("BED:" THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT); + STATIC_ITEM( + #if WATCH_BED + MSG_INFO_RUNAWAY_ON + #else + MSG_INFO_RUNAWAY_OFF + #endif + , SS_LEFT + ); + } #endif + + #if HAS_HEATED_CHAMBER + { + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_CHAMBER + #include "../thermistornames.h" + STATIC_ITEM_P(PSTR("CHAM:" THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_LEFT); + STATIC_ITEM( + #if WATCH_CHAMBER + MSG_INFO_RUNAWAY_ON + #else + MSG_INFO_RUNAWAY_OFF + #endif + , SS_LEFT + ); + } + #endif + END_SCREEN(); } @@ -171,55 +210,99 @@ void menu_info_thermistors() { // About Printer > Board Info // void menu_info_board() { - if (ui.use_click()) return ui.goto_previous_screen(); + if (ui.use_click()) return ui.go_back(); + + char buffer[21]; // For macro usage + START_SCREEN(); - STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController - STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000 - STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0 - STATIC_ITEM(MSG_INFO_PSU ": " PSU_NAME, true); + STATIC_ITEM_P(PSTR(BOARD_INFO_NAME), SS_CENTER|SS_INVERT); // MyPrinterController + #ifdef BOARD_WEBSITE_URL + STATIC_ITEM_P(PSTR(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com + #endif + VALUE_ITEM_P(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000 + VALUE_ITEM_P(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER); // Protocol: 1.0 + VALUE_ITEM_P(MSG_INFO_PSU, PSU_NAME, SS_CENTER); END_SCREEN(); } // // About Printer > Printer Info // -void menu_info_printer() { - if (ui.use_click()) return ui.goto_previous_screen(); - START_SCREEN(); - STATIC_ITEM(MSG_MARLIN, true, true); // Marlin - STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch - STATIC_ITEM(STRING_DISTRIBUTION_DATE, true); // YYYY-MM-DD HH:MM - STATIC_ITEM(MACHINE_NAME, true); // My3DPrinter - STATIC_ITEM(WEBSITE_URL, true); // www.my3dprinter.com - STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS), true); // Extruders: 2 - #if ENABLED(AUTO_BED_LEVELING_3POINT) - STATIC_ITEM(MSG_3POINT_LEVELING, true); // 3-Point Leveling - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - STATIC_ITEM(MSG_LINEAR_LEVELING, true); // Linear Leveling - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - STATIC_ITEM(MSG_BILINEAR_LEVELING, true); // Bi-linear Leveling - #elif ENABLED(AUTO_BED_LEVELING_UBL) - STATIC_ITEM(MSG_UBL_LEVELING, true); // Unified Bed Leveling - #elif ENABLED(MESH_BED_LEVELING) - STATIC_ITEM(MSG_MESH_LEVELING, true); // Mesh Leveling +#if ENABLED(LCD_PRINTER_INFO_IS_BOOTSCREEN) + + void menu_show_marlin_bootscreen() { + if (ui.use_click()) { ui.goto_previous_screen_no_defer(); } + ui.draw_marlin_bootscreen(); + } + + #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + void menu_show_custom_bootscreen() { + if (ui.use_click()) { ui.goto_screen(menu_show_marlin_bootscreen); } + ui.draw_custom_bootscreen(); + } #endif - END_SCREEN(); -} + +#else + + void menu_info_printer() { + if (ui.use_click()) return ui.go_back(); + START_SCREEN(); + STATIC_ITEM_P(PSTR(MSG_MARLIN), SS_CENTER|SS_INVERT); // Marlin + STATIC_ITEM_P(PSTR(SHORT_BUILD_VERSION)); // x.x.x-Branch + STATIC_ITEM_P(PSTR(STRING_DISTRIBUTION_DATE)); // YYYY-MM-DD HH:MM + STATIC_ITEM_P(PSTR(MACHINE_NAME)); // My3DPrinter + STATIC_ITEM_P(PSTR(WEBSITE_URL)); // www.my3dprinter.com + char buffer[21]; + VALUE_ITEM_P(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // Extruders: 2 + #if ENABLED(AUTO_BED_LEVELING_3POINT) + STATIC_ITEM(MSG_3POINT_LEVELING); // 3-Point Leveling + #elif ENABLED(AUTO_BED_LEVELING_LINEAR) + STATIC_ITEM(MSG_LINEAR_LEVELING); // Linear Leveling + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + STATIC_ITEM(MSG_BILINEAR_LEVELING); // Bi-linear Leveling + #elif ENABLED(AUTO_BED_LEVELING_UBL) + STATIC_ITEM(MSG_UBL_LEVELING); // Unified Bed Leveling + #elif ENABLED(MESH_BED_LEVELING) + STATIC_ITEM(MSG_MESH_LEVELING); // Mesh Leveling + #endif + END_SCREEN(); + } + +#endif // // "About Printer" submenu // void menu_info() { START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, menu_info_printer); // Printer Info > - MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, menu_info_board); // Board Info > - MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, menu_info_thermistors); // Thermistors > + BACK_ITEM(MSG_MAIN); + #if ENABLED(LCD_PRINTER_INFO_IS_BOOTSCREEN) + SUBMENU(MSG_INFO_PRINTER_MENU, ( + #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + menu_show_custom_bootscreen + #else + menu_show_marlin_bootscreen + #endif + )); + #else + SUBMENU(MSG_INFO_PRINTER_MENU, menu_info_printer); // Printer Info > + SUBMENU(MSG_INFO_BOARD_MENU, menu_info_board); // Board Info > + #if EXTRUDERS + SUBMENU(MSG_INFO_THERMISTOR_MENU, menu_info_thermistors); // Thermistors > + #endif + #endif + #if ENABLED(PRINTCOUNTER) - MENU_ITEM(submenu, MSG_INFO_STATS_MENU, menu_info_stats); // Printer Stats > + SUBMENU(MSG_INFO_STATS_MENU, menu_info_stats); // Printer Stats > #endif + #if HAS_GAMES - MENU_ITEM(submenu, "Game", ( + #if ENABLED(GAMES_EASTER_EGG) + SKIP_ITEM(); + SKIP_ITEM(); + SKIP_ITEM(); + #endif + SUBMENU(MSG_GAMES, ( #if HAS_GAME_MENU menu_game #elif ENABLED(MARLIN_BRICKOUT) @@ -233,6 +316,7 @@ void menu_info() { #endif )); #endif + END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_job_recovery.cpp b/Marlin/src/lcd/menu/menu_job_recovery.cpp index 449251d9b24a..0b0b0409219e 100644 --- a/Marlin/src/lcd/menu/menu_job_recovery.cpp +++ b/Marlin/src/lcd/menu/menu_job_recovery.cpp @@ -50,8 +50,8 @@ void menu_job_recovery() { ui.defer_status_screen(); START_MENU(); STATIC_ITEM(MSG_OUTAGE_RECOVERY); - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_power_loss_recovery_cancel); + ACTION_ITEM(MSG_RESUME_PRINT, lcd_power_loss_recovery_resume); + ACTION_ITEM(MSG_STOP_PRINT, lcd_power_loss_recovery_cancel); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_led.cpp b/Marlin/src/lcd/menu/menu_led.cpp index a84a8c01f50c..e6644c6852fd 100644 --- a/Marlin/src/lcd/menu/menu_led.cpp +++ b/Marlin/src/lcd/menu/menu_led.cpp @@ -36,17 +36,17 @@ void menu_led_presets() { START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_LED_PRESETS, true, true); + STATIC_ITEM(MSG_LED_PRESETS, SS_CENTER|SS_INVERT); #endif - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white); - MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red); - MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange); - MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow); - MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green); - MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue); - MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo); - MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet); + BACK_ITEM(MSG_LED_CONTROL); + ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white); + ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red); + ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange); + ACTION_ITEM(MSG_SET_LEDS_YELLOW,leds.set_yellow); + ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green); + ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue); + ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo); + ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet); END_MENU(); } @@ -54,14 +54,14 @@ void menu_led_custom() { START_MENU(); - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); - MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); - MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); + BACK_ITEM(MSG_LED_CONTROL); + EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); + EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); + EDIT_ITEM(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); #if EITHER(RGBW_LED, NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); + EDIT_ITEM(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); #if ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); + EDIT_ITEM(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); #endif #endif END_MENU(); @@ -69,14 +69,14 @@ void menu_led_custom() { void menu_led() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); bool led_on = leds.lights_on; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_LEDS, &led_on, leds.toggle); - MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default); + EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle); + ACTION_ITEM(MSG_SET_LEDS_DEFAULT, leds.set_default); #if ENABLED(LED_COLOR_PRESETS) - MENU_ITEM(submenu, MSG_LED_PRESETS, menu_led_presets); + SUBMENU(MSG_LED_PRESETS, menu_led_presets); #endif - MENU_ITEM(submenu, MSG_CUSTOM_LEDS, menu_led_custom); + SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index d334a56fe8d4..fadf0ab0304c 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -42,12 +42,6 @@ #define MACHINE_CAN_STOP (EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL)) #define MACHINE_CAN_PAUSE (ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE)) -#if MACHINE_CAN_STOP - void menu_abort_confirm() { - do_select_screen(PSTR(MSG_BUTTON_STOP), PSTR(MSG_BACK), ui.abort_print, ui.goto_previous_screen, PSTR(MSG_STOP_PRINT), nullptr, PSTR("?")); - } -#endif // MACHINE_CAN_STOP - #if ENABLED(PRUSA_MMU2) #include "../../lcd/menu/menu_mmu2.h" #endif @@ -62,7 +56,7 @@ void menu_configuration(); #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) - void menu_temp_e0_filament_change(); + void _menu_temp_filament_op(const PauseMode, const int8_t); void menu_change_filament(); #endif @@ -83,174 +77,202 @@ void menu_configuration(); void menu_mixer(); #endif -#if HAS_SERVICE_INTERVALS && ENABLED(PRINTCOUNTER) - #if SERVICE_INTERVAL_1 > 0 - void menu_service1(); - #endif - #if SERVICE_INTERVAL_2 > 0 - void menu_service2(); - #endif - #if SERVICE_INTERVAL_3 > 0 - void menu_service3(); - #endif -#endif +extern const char M21_STR[]; void menu_main() { START_MENU(); - MENU_BACK(MSG_WATCH); + BACK_ITEM(MSG_WATCH); - const bool busy = IS_SD_PRINTING() || print_job_timer.isRunning() + const bool busy = printingIsActive() #if ENABLED(SDSUPPORT) - , card_detected = card.isDetected() + , card_detected = card.isMounted() , card_open = card_detected && card.isFileOpen() #endif ; if (busy) { #if MACHINE_CAN_PAUSE - MENU_ITEM(function, MSG_PAUSE_PRINT, ui.pause_print); + ACTION_ITEM(MSG_PAUSE_PRINT, ui.pause_print); #endif #if MACHINE_CAN_STOP - MENU_ITEM(submenu, MSG_STOP_PRINT, menu_abort_confirm); + SUBMENU(MSG_STOP_PRINT, []{ + MenuItem_confirm::select_screen( + GET_TEXT(MSG_BUTTON_STOP), GET_TEXT(MSG_BACK), + ui.abort_print, ui.goto_previous_screen, + GET_TEXT(MSG_STOP_PRINT), (PGM_P)nullptr, PSTR("?") + ); + }); #endif - MENU_ITEM(submenu, MSG_TUNE, menu_tune); + SUBMENU(MSG_TUNE, menu_tune); } else { + #if !HAS_ENCODER_WHEEL && ENABLED(SDSUPPORT) + + // *** IF THIS SECTION IS CHANGED, REPRODUCE BELOW *** + // // Autostart // #if ENABLED(MENU_ADDAUTOSTART) - if (!busy) MENU_ITEM(function, MSG_AUTOSTART, card.beginautostart); + if (!busy) ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); #endif if (card_detected) { if (!card_open) { - MENU_ITEM(submenu, MSG_CARD_MENU, menu_sdcard); + SUBMENU(MSG_MEDIA_MENU, menu_media); MENU_ITEM(gcode, #if PIN_EXISTS(SD_DETECT) - MSG_CHANGE_SDCARD, PSTR("M21") + MSG_CHANGE_MEDIA, M21_STR #else - MSG_RELEASE_SDCARD, PSTR("M22") + MSG_RELEASE_MEDIA, PSTR("M22") #endif ); } } else { #if PIN_EXISTS(SD_DETECT) - MENU_ITEM(function, MSG_NO_CARD, nullptr); + ACTION_ITEM(MSG_NO_MEDIA, nullptr); #else - MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); - MENU_ITEM(function, MSG_SD_RELEASED, nullptr); + GCODES_ITEM(MSG_INIT_MEDIA, M21_STR); + ACTION_ITEM(MSG_MEDIA_RELEASED, nullptr); #endif } + #endif // !HAS_ENCODER_WHEEL && SDSUPPORT #if MACHINE_CAN_PAUSE - const bool paused = (print_job_timer.isPaused() - #if ENABLED(SDSUPPORT) - || card.isPaused() - #endif - ); - if (paused) MENU_ITEM(function, MSG_RESUME_PRINT, ui.resume_print); + if (printingIsPaused()) ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print); #endif - MENU_ITEM(submenu, MSG_MOTION, menu_motion); + SUBMENU(MSG_MOTION, menu_motion); } #if HAS_CUTTER - MENU_ITEM(submenu, MSG_CUTTER(MENU), menu_spindle_laser); + SUBMENU(MSG_CUTTER(MENU), menu_spindle_laser); #endif - MENU_ITEM(submenu, MSG_TEMPERATURE, menu_temperature); + SUBMENU(MSG_TEMPERATURE, menu_temperature); #if ENABLED(MIXING_EXTRUDER) - MENU_ITEM(submenu, MSG_MIXER, menu_mixer); + SUBMENU(MSG_MIXER, menu_mixer); #endif #if ENABLED(MMU2_MENUS) - if (!busy) MENU_ITEM(submenu, MSG_MMU2_MENU, menu_mmu2); + if (!busy) SUBMENU(MSG_MMU2_MENU, menu_mmu2); #endif - MENU_ITEM(submenu, MSG_CONFIGURATION, menu_configuration); + SUBMENU(MSG_CONFIGURATION, menu_configuration); #if ENABLED(CUSTOM_USER_MENUS) - MENU_ITEM(submenu, MSG_USER_MENU, menu_user); + #ifdef CUSTOM_USER_MENU_TITLE + SUBMENU_P(PSTR(CUSTOM_USER_MENU_TITLE), menu_user); + #else + SUBMENU(MSG_USER_MENU, menu_user); + #endif #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES) if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); + GCODES_ITEM(MSG_FILAMENTCHANGE, PSTR("M600 B0")); else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, menu_temp_e0_filament_change); + SUBMENU(MSG_FILAMENTCHANGE, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); #else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, menu_change_filament); + SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament); #endif #endif #if ENABLED(LCD_INFO_MENU) - MENU_ITEM(submenu, MSG_INFO_MENU, menu_info); + SUBMENU(MSG_INFO_MENU, menu_info); #endif #if ENABLED(LED_CONTROL_MENU) - MENU_ITEM(submenu, MSG_LED_CONTROL, menu_led); + SUBMENU(MSG_LED_CONTROL, menu_led); #endif // // Switch power on/off // - #if HAS_POWER_SWITCH + #if ENABLED(PSU_CONTROL) if (powersupply_on) - MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); + GCODES_ITEM(MSG_SWITCH_PS_OFF, PSTR("M81")); else - MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); + GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80")); #endif #if HAS_ENCODER_WHEEL && ENABLED(SDSUPPORT) + + // *** IF THIS SECTION IS CHANGED, REPRODUCE ABOVE *** + // // Autostart // #if ENABLED(MENU_ADDAUTOSTART) - if (!busy) MENU_ITEM(function, MSG_AUTOSTART, card.beginautostart); + if (!busy) ACTION_ITEM(MSG_AUTOSTART, card.beginautostart); #endif if (card_detected) { if (!card_open) { MENU_ITEM(gcode, #if PIN_EXISTS(SD_DETECT) - MSG_CHANGE_SDCARD, PSTR("M21") + MSG_CHANGE_MEDIA, M21_STR #else - MSG_RELEASE_SDCARD, PSTR("M22") + MSG_RELEASE_MEDIA, PSTR("M22") #endif ); - MENU_ITEM(submenu, MSG_CARD_MENU, menu_sdcard); + SUBMENU(MSG_MEDIA_MENU, menu_media); } } else { #if PIN_EXISTS(SD_DETECT) - MENU_ITEM(function, MSG_NO_CARD, nullptr); + ACTION_ITEM(MSG_NO_MEDIA, nullptr); #else - MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); - MENU_ITEM(function, MSG_SD_RELEASED, nullptr); + GCODES_ITEM(MSG_INIT_MEDIA, M21_STR); + ACTION_ITEM(MSG_MEDIA_RELEASED, nullptr); #endif } + #endif // HAS_ENCODER_WHEEL && SDSUPPORT - #if HAS_SERVICE_INTERVALS && ENABLED(PRINTCOUNTER) + #if HAS_SERVICE_INTERVALS + static auto _service_reset = [](const int index) { + print_job_timer.resetServiceInterval(index); + #if HAS_BUZZER + ui.completion_feedback(); + #endif + ui.reset_status(); + ui.return_to_status(); + }; #if SERVICE_INTERVAL_1 > 0 - MENU_ITEM(submenu, SERVICE_NAME_1, menu_service1); + CONFIRM_ITEM_P(PSTR(SERVICE_NAME_1), + MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, + []{ _service_reset(1); }, ui.goto_previous_screen, + GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_1), PSTR("?") + ); #endif #if SERVICE_INTERVAL_2 > 0 - MENU_ITEM(submenu, SERVICE_NAME_2, menu_service2); + CONFIRM_ITEM_P(PSTR(SERVICE_NAME_2), + MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, + []{ _service_reset(2); }, ui.goto_previous_screen, + GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_2), PSTR("?") + ); #endif #if SERVICE_INTERVAL_3 > 0 - MENU_ITEM(submenu, SERVICE_NAME_3, menu_service3); + CONFIRM_ITEM_P(PSTR(SERVICE_NAME_3), + MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, + []{ _service_reset(3); }, ui.goto_previous_screen, + GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_3), PSTR("?") + ); #endif #endif #if HAS_GAMES && DISABLED(LCD_INFO_MENU) - MENU_ITEM(submenu, "Game", ( + #if ENABLED(GAMES_EASTER_EGG) + SKIP_ITEM(); + SKIP_ITEM(); + #endif + SUBMENU(MSG_GAMES, ( #if HAS_GAME_MENU menu_game #elif ENABLED(MARLIN_BRICKOUT) diff --git a/Marlin/src/lcd/menu/menu_sdcard.cpp b/Marlin/src/lcd/menu/menu_media.cpp similarity index 60% rename from Marlin/src/lcd/menu/menu_sdcard.cpp rename to Marlin/src/lcd/menu/menu_media.cpp index 894d9288a94a..a12c8b79bbc9 100644 --- a/Marlin/src/lcd/menu/menu_sdcard.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -31,17 +31,10 @@ #include "menu.h" #include "../../sd/cardreader.h" -#if !PIN_EXISTS(SD_DETECT) - void lcd_sd_refresh() { - encoderTopLine = 0; - card.initsd(); - } -#endif - void lcd_sd_updir() { - ui.encoderPosition = card.updir() ? ENCODER_STEPS_PER_MENU_ITEM : 0; + ui.encoderPosition = card.cdup() ? ENCODER_STEPS_PER_MENU_ITEM : 0; encoderTopLine = 0; - screen_changed = true; + ui.screen_changed = true; ui.refresh(); } @@ -59,10 +52,10 @@ void lcd_sd_updir() { // safe_delay(50); // ui.synchronize(); // ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - // ui.drawing_screen = screen_changed = true; + // ui.drawing_screen = ui.screen_changed = true; //#endif - goto_screen(menu_sdcard, sd_encoder_position, sd_top_line, sd_items); + goto_screen(menu_media, sd_encoder_position, sd_top_line, sd_items); sd_encoder_position = 0xFFFF; defer_status_screen(); @@ -79,21 +72,12 @@ inline void sdcard_start_selected_file() { ui.reset_status(); } -#if ENABLED(SD_MENU_CONFIRM_START) - - void menu_sd_confirm() { - do_select_screen( - PSTR(MSG_BUTTON_PRINT), PSTR(MSG_BUTTON_CANCEL), - sdcard_start_selected_file, ui.goto_previous_screen, - PSTR(MSG_START_PRINT " "), card.longest_filename(), PSTR("?") - ); - } - -#endif - -class MenuItem_sdfile { +class MenuItem_sdfile : public MenuItem_sdbase { public: - static void action(CardReader &) { + static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { + MenuItem_sdbase::draw(sel, row, pstr, theCard, false); + } + static void action(PGM_P const pstr, CardReader &) { #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) // Save menu state for the selected file sd_encoder_position = ui.encoderPosition; @@ -101,20 +85,34 @@ class MenuItem_sdfile { sd_items = screen_items; #endif #if ENABLED(SD_MENU_CONFIRM_START) - MenuItem_submenu::action(menu_sd_confirm); + MenuItem_submenu::action(pstr, []{ + char * const longest = card.longest_filename(); + char buffer[strlen(longest) + 2]; + buffer[0] = ' '; + strcpy(buffer + 1, longest); + MenuItem_confirm::select_screen( + GET_TEXT(MSG_BUTTON_PRINT), GET_TEXT(MSG_BUTTON_CANCEL), + sdcard_start_selected_file, ui.goto_previous_screen, + GET_TEXT(MSG_START_PRINT), buffer, PSTR("?") + ); + }); #else sdcard_start_selected_file(); + UNUSED(pstr); #endif } }; -class MenuItem_sdfolder { +class MenuItem_sdfolder : public MenuItem_sdbase { public: - static void action(CardReader &theCard) { - card.chdir(theCard.filename); + static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { + MenuItem_sdbase::draw(sel, row, pstr, theCard, true); + } + static void action(PGM_P const, CardReader &theCard) { + card.cd(theCard.filename); encoderTopLine = 0; ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM); - screen_changed = true; + ui.screen_changed = true; #if HAS_GRAPHICAL_LCD ui.drawing_screen = false; #endif @@ -122,21 +120,25 @@ class MenuItem_sdfolder { } }; -void menu_sdcard() { +void menu_media() { ui.encoder_direction_menus(); - const uint16_t fileCnt = card.get_num_Files(); + #if HAS_GRAPHICAL_LCD + static uint16_t fileCnt; + if (ui.first_page) fileCnt = card.get_num_Files(); + #else + const uint16_t fileCnt = card.get_num_Files(); + #endif START_MENU(); - MENU_BACK(MSG_MAIN); - card.getWorkDirName(); - if (card.filename[0] == '/') { + BACK_ITEM(MSG_MAIN); + if (card.flag.workDirIsRoot) { #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); + ACTION_ITEM(MSG_REFRESH, []{ encoderTopLine = 0; card.mount(); }); #endif } - else if (card.isDetected()) - MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); + else if (card.isMounted()) + ACTION_ITEM_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) { if (_menuLineNr == _thisItemNr) { @@ -149,12 +151,12 @@ void menu_sdcard() { card.getfilename_sorted(nr); if (card.flag.filenameIsDir) - MENU_ITEM(sdfolder, MSG_CARD_MENU, card); + MENU_ITEM(sdfolder, MSG_MEDIA_MENU, card); else - MENU_ITEM(sdfile, MSG_CARD_MENU, card); + MENU_ITEM(sdfile, MSG_MEDIA_MENU, card); } else { - MENU_ITEM_DUMMY(); + SKIP_ITEM(); } } END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index 1a17dbd26094..51e24d935834 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -29,11 +29,9 @@ #if HAS_LCD_MENU && ENABLED(MIXING_EXTRUDER) #include "menu.h" -#include "../../feature/mixing.h" +#include "menu_addon.h" -#include "../dogm/ultralcd_DOGM.h" -#include "../ultralcd.h" -#include "../lcdprint.h" +#include "../../feature/mixing.h" #define CHANNEL_MIX_EDITING !DUAL_MIXING_EXTRUDER @@ -41,19 +39,19 @@ void lcd_mixer_gradient_z_start_edit() { ui.defer_status_screen(); - ui.encoder_direction_normal(); ENCODER_RATE_MULTIPLY(true); if (ui.encoderPosition != 0) { - mixer.gradient.start_z += float(int16_t(ui.encoderPosition)) * 0.1; + mixer.gradient.start_z += float(int32_t(ui.encoderPosition)) * 0.1; ui.encoderPosition = 0; NOLESS(mixer.gradient.start_z, 0); NOMORE(mixer.gradient.start_z, Z_MAX_POS); } if (ui.should_draw()) { char tmp[21]; - sprintf_P(tmp, PSTR(MSG_START_Z ": %4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); + strcpy_P(tmp, GET_TEXT(MSG_START_Z)); + sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); SETCURSOR(2, (LCD_HEIGHT - 1) / 2); - LCDPRINT(tmp); + lcd_put_u8str(tmp); } if (ui.lcd_clicked) { @@ -66,10 +64,9 @@ void lcd_mixer_gradient_z_end_edit() { ui.defer_status_screen(); - ui.encoder_direction_normal(); ENCODER_RATE_MULTIPLY(true); if (ui.encoderPosition != 0) { - mixer.gradient.end_z += float(int16_t(ui.encoderPosition)) * 0.1; + mixer.gradient.end_z += float(int32_t(ui.encoderPosition)) * 0.1; ui.encoderPosition = 0; NOLESS(mixer.gradient.end_z, 0); NOMORE(mixer.gradient.end_z, Z_MAX_POS); @@ -77,9 +74,10 @@ if (ui.should_draw()) { char tmp[21]; - sprintf_P(tmp, PSTR(MSG_END_Z ": %4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); + strcpy_P(tmp, GET_TEXT(MSG_END_Z)); + sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); SETCURSOR(2, (LCD_HEIGHT - 1) / 2); - LCDPRINT(tmp); + lcd_put_u8str(tmp); } if (ui.lcd_clicked) { @@ -92,27 +90,27 @@ void lcd_mixer_edit_gradient_menu() { START_MENU(); - MENU_BACK(MSG_MIXER); + BACK_ITEM(MSG_MIXER); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_START_VTOOL, &mixer.gradient.start_vtool, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_END_VTOOL, &mixer.gradient.end_vtool, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); + EDIT_ITEM(int8, MSG_START_VTOOL, &mixer.gradient.start_vtool, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); + EDIT_ITEM(int8, MSG_END_VTOOL, &mixer.gradient.end_vtool, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); #if ENABLED(GRADIENT_VTOOL) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_GRADIENT_ALIAS, &mixer.gradient.vtool_index, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); + EDIT_ITEM(int8, MSG_GRADIENT_ALIAS, &mixer.gradient.vtool_index, 0, MIXING_VIRTUAL_TOOLS - 1, mixer.refresh_gradient); #endif char tmp[18]; - MENU_ITEM(submenu, MSG_START_Z ":", lcd_mixer_gradient_z_start_edit); + SUBMENU(MSG_START_Z, lcd_mixer_gradient_z_start_edit); MENU_ITEM_ADDON_START(9); sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); - MENU_ITEM(submenu, MSG_END_Z ":", lcd_mixer_gradient_z_end_edit); + SUBMENU(MSG_END_Z, lcd_mixer_gradient_z_end_edit); MENU_ITEM_ADDON_START(9); sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); END_MENU(); @@ -124,10 +122,10 @@ static uint8_t v_index; #if DUAL_MIXING_EXTRUDER void _lcd_draw_mix(const uint8_t y) { - char tmp[21]; - sprintf_P(tmp, PSTR(MSG_MIX ": %3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1])); - SETCURSOR(2, y); - LCDPRINT(tmp); + char tmp[20]; // "100%_100%" + sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1])); + SETCURSOR(2, y); lcd_put_u8str_P(GET_TEXT(MSG_MIX)); + SETCURSOR_RJ(9, y); lcd_put_u8str(tmp); } #endif @@ -158,34 +156,11 @@ void _lcd_mixer_select_vtool() { void lcd_mixer_mix_edit() { - #if CHANNEL_MIX_EDITING - - #define EDIT_COLOR(N) MENU_MULTIPLIER_ITEM_EDIT(float52, MSG_MIX_COMPONENT " " STRINGIFY(N), &mixer.collector[N-1], 0, 10); - - START_MENU(); - MENU_BACK(MSG_MIXER); - EDIT_COLOR(1); - EDIT_COLOR(2); - #if MIXING_STEPPERS > 2 - EDIT_COLOR(3); - #if MIXING_STEPPERS > 3 - EDIT_COLOR(4); - #if MIXING_STEPPERS > 4 - EDIT_COLOR(5); - #if MIXING_STEPPERS > 5 - EDIT_COLOR(6); - #endif - #endif - #endif - #endif - MENU_ITEM(function, MSG_CYCLE_MIX, _lcd_mixer_cycle_mix); - MENU_ITEM(function, MSG_COMMIT_VTOOL, _lcd_mixer_commit_vtool); - END_MENU(); - - #elif DUAL_MIXING_EXTRUDER + #if DUAL_MIXING_EXTRUDER && !CHANNEL_MIX_EDITING + // Adjust 2-channel mix from the encoder if (ui.encoderPosition != 0) { - mixer.mix[0] += int16_t(ui.encoderPosition); + mixer.mix[0] += int32_t(ui.encoderPosition); ui.encoderPosition = 0; if (mixer.mix[0] < 0) mixer.mix[0] += 101; if (mixer.mix[0] > 100) mixer.mix[0] -= 101; @@ -193,6 +168,7 @@ void lcd_mixer_mix_edit() { } _lcd_draw_mix((LCD_HEIGHT - 1) / 2); + // Click to commit the change if (ui.lcd_clicked) { mixer.update_vtool_from_mix(); ui.goto_previous_screen(); @@ -201,7 +177,18 @@ void lcd_mixer_mix_edit() { #else START_MENU(); - MENU_BACK(MSG_MIXER); + BACK_ITEM(MSG_MIXER); + + #if CHANNEL_MIX_EDITING + + for (uint8_t n = 1; n <= MIXING_STEPPERS; n++) + EDIT_ITEM_FAST_N(float52, n, MSG_MIX_COMPONENT_N, &mixer.collector[n-1], 0, 10); + + ACTION_ITEM(MSG_CYCLE_MIX, _lcd_mixer_cycle_mix); + ACTION_ITEM(MSG_COMMIT_VTOOL, _lcd_mixer_commit_vtool); + + #endif + END_MENU(); #endif @@ -247,64 +234,55 @@ void lcd_mixer_mix_edit() { } #endif -// -// Reset All V-Tools -// -void menu_mixer_vtools_reset_confirm() { - do_select_screen( - PSTR(MSG_BUTTON_RESET), PSTR(MSG_BUTTON_CANCEL), - []{ - mixer.reset_vtools(); - LCD_MESSAGEPGM(MSG_VTOOLS_RESET); - ui.return_to_status(); - }, - ui.goto_previous_screen, - PSTR(MSG_RESET_VTOOLS), nullptr, PSTR("?") - ); -} - void menu_mixer() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); v_index = mixer.get_current_vtool(); - MENU_ITEM_EDIT_CALLBACK(uint8, MSG_ACTIVE_VTOOL, &v_index, 0, MIXING_VIRTUAL_TOOLS - 1, _lcd_mixer_select_vtool + EDIT_ITEM(uint8, MSG_ACTIVE_VTOOL, &v_index, 0, MIXING_VIRTUAL_TOOLS - 1, _lcd_mixer_select_vtool #if DUAL_MIXING_EXTRUDER , true #endif ); - MENU_ITEM(submenu, MSG_MIX, - #if CHANNEL_MIX_EDITING - _lcd_goto_mix_edit - #elif DUAL_MIXING_EXTRUDER - lcd_mixer_mix_edit - #endif - ); - #if DUAL_MIXING_EXTRUDER { char tmp[10]; + SUBMENU(MSG_MIX, lcd_mixer_mix_edit); MENU_ITEM_ADDON_START(10); mixer.update_mix_from_vtool(); sprintf_P(tmp, PSTR("%3d;%3d%%"), int(mixer.mix[0]), int(mixer.mix[1])); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); - MENU_ITEM(function, MSG_TOGGLE_MIX, _lcd_mixer_toggle_mix); + ACTION_ITEM(MSG_TOGGLE_MIX, _lcd_mixer_toggle_mix); } + #else + SUBMENU(MSG_MIX, _lcd_goto_mix_edit); #endif - MENU_ITEM(submenu, MSG_RESET_VTOOLS, menu_mixer_vtools_reset_confirm); + // + // Reset All V-Tools + // + CONFIRM_ITEM(MSG_RESET_VTOOLS, + MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, + []{ + mixer.reset_vtools(); + LCD_MESSAGEPGM(MSG_VTOOLS_RESET); + ui.return_to_status(); + }, + ui.goto_previous_screen, + GET_TEXT(MSG_RESET_VTOOLS), (PGM_P)nullptr, PSTR("?") + ); #if ENABLED(GRADIENT_MIX) { char tmp[13]; - MENU_ITEM(submenu, MSG_GRADIENT, lcd_mixer_edit_gradient_menu); + SUBMENU(MSG_GRADIENT, lcd_mixer_edit_gradient_menu); MENU_ITEM_ADDON_START(10); sprintf_P(tmp, PSTR("T%i->T%i"), mixer.gradient.start_vtool, mixer.gradient.end_vtool); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); - MENU_ITEM(function, MSG_REVERSE_GRADIENT, _lcd_mixer_reverse_gradient); + ACTION_ITEM(MSG_REVERSE_GRADIENT, _lcd_mixer_reverse_gradient); } #endif diff --git a/Marlin/src/lcd/menu/menu_mmu2.cpp b/Marlin/src/lcd/menu/menu_mmu2.cpp index a7dc4e839148..ad3d649ee43d 100644 --- a/Marlin/src/lcd/menu/menu_mmu2.cpp +++ b/Marlin/src/lcd/menu/menu_mmu2.cpp @@ -38,23 +38,18 @@ bool mmuMenuWait; void _mmu2_load_filamentToNozzle(uint8_t index) { ui.reset_status(); ui.return_to_status(); - ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); if (mmu2.load_filament_to_nozzle(index)) ui.reset_status(); } -inline void action_mmu2_load_filament_to_nozzl_e(const uint8_t tool) { +inline void action_mmu2_load_filament_to_nozzle(const uint8_t tool) { _mmu2_load_filamentToNozzle(tool); ui.return_to_status(); } -inline void action_mmu2_load_filament_to_nozzle_0() { action_mmu2_load_filament_to_nozzl_e(0); } -inline void action_mmu2_load_filament_to_nozzle_1() { action_mmu2_load_filament_to_nozzl_e(1); } -inline void action_mmu2_load_filament_to_nozzle_2() { action_mmu2_load_filament_to_nozzl_e(2); } -inline void action_mmu2_load_filament_to_nozzle_3() { action_mmu2_load_filament_to_nozzl_e(3); } -inline void action_mmu2_load_filament_to_nozzle_4() { action_mmu2_load_filament_to_nozzl_e(4); } void _mmu2_load_filament(uint8_t index) { ui.return_to_status(); - ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); mmu2.load_filament(index); ui.reset_status(); } @@ -63,32 +58,19 @@ void action_mmu2_load_all() { _mmu2_load_filament(i); ui.return_to_status(); } -inline void action_mmu2_load_filament_0() { _mmu2_load_filament(0); } -inline void action_mmu2_load_filament_1() { _mmu2_load_filament(1); } -inline void action_mmu2_load_filament_2() { _mmu2_load_filament(2); } -inline void action_mmu2_load_filament_3() { _mmu2_load_filament(3); } -inline void action_mmu2_load_filament_4() { _mmu2_load_filament(4); } void menu_mmu2_load_filament() { START_MENU(); - MENU_BACK(MSG_MMU2_MENU); - MENU_ITEM(function, MSG_MMU2_ALL, action_mmu2_load_all); - MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_load_filament_0); - MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_load_filament_1); - MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_load_filament_2); - MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_load_filament_3); - MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_load_filament_4); + BACK_ITEM(MSG_MMU2_MENU); + ACTION_ITEM(MSG_MMU2_ALL, action_mmu2_load_all); + LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_load_filament(MenuItemBase::itemIndex); }); END_MENU(); } void menu_mmu2_load_to_nozzle() { START_MENU(); - MENU_BACK(MSG_MMU2_MENU); - MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_load_filament_to_nozzle_0); - MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_load_filament_to_nozzle_1); - MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_load_filament_to_nozzle_2); - MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_load_filament_to_nozzle_3); - MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_load_filament_to_nozzle_4); + BACK_ITEM(MSG_MMU2_MENU); + LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_load_filament_to_nozzle(MenuItemBase::itemIndex); }); END_MENU(); } @@ -99,14 +81,9 @@ void menu_mmu2_load_to_nozzle() { void _mmu2_eject_filament(uint8_t index) { ui.reset_status(); ui.return_to_status(); - ui.status_printf_P(0, PSTR(MSG_MMU2_EJECTING_FILAMENT), int(index + 1)); + ui.status_printf_P(0, GET_TEXT(MSG_MMU2_EJECTING_FILAMENT), int(index + 1)); if (mmu2.eject_filament(index, true)) ui.reset_status(); } -inline void action_mmu2_eject_filament_0() { _mmu2_eject_filament(0); } -inline void action_mmu2_eject_filament_1() { _mmu2_eject_filament(1); } -inline void action_mmu2_eject_filament_2() { _mmu2_eject_filament(2); } -inline void action_mmu2_eject_filament_3() { _mmu2_eject_filament(3); } -inline void action_mmu2_eject_filament_4() { _mmu2_eject_filament(4); } void action_mmu2_unload_filament() { ui.reset_status(); @@ -118,12 +95,8 @@ void action_mmu2_unload_filament() { void menu_mmu2_eject_filament() { START_MENU(); - MENU_BACK(MSG_MMU2_MENU); - MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_eject_filament_0); - MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_eject_filament_1); - MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_eject_filament_2); - MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_eject_filament_3); - MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_eject_filament_4); + BACK_ITEM(MSG_MMU2_MENU); + LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_eject_filament(MenuItemBase::itemIndex); }); END_MENU(); } @@ -138,12 +111,12 @@ void action_mmu2_reset() { void menu_mmu2() { START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM(submenu, MSG_MMU2_LOAD_FILAMENT, menu_mmu2_load_filament); - MENU_ITEM(submenu, MSG_MMU2_LOAD_TO_NOZZLE, menu_mmu2_load_to_nozzle); - MENU_ITEM(submenu, MSG_MMU2_EJECT_FILAMENT, menu_mmu2_eject_filament); - MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_unload_filament); - MENU_ITEM(function, MSG_MMU2_RESET, action_mmu2_reset); + BACK_ITEM(MSG_MAIN); + SUBMENU(MSG_MMU2_LOAD_FILAMENT, menu_mmu2_load_filament); + SUBMENU(MSG_MMU2_LOAD_TO_NOZZLE, menu_mmu2_load_to_nozzle); + SUBMENU(MSG_MMU2_EJECT_FILAMENT, menu_mmu2_eject_filament); + ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_unload_filament); + ACTION_ITEM(MSG_MMU2_RESET, action_mmu2_reset); END_MENU(); } @@ -155,22 +128,13 @@ inline void action_mmu2_choose(const uint8_t tool) { currentTool = tool; mmuMenuWait = false; } -inline void action_mmu2_choose0() { action_mmu2_choose(0); } -inline void action_mmu2_choose1() { action_mmu2_choose(1); } -inline void action_mmu2_choose2() { action_mmu2_choose(2); } -inline void action_mmu2_choose3() { action_mmu2_choose(3); } -inline void action_mmu2_choose4() { action_mmu2_choose(4); } void menu_mmu2_choose_filament() { START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, true, true); + STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_CENTER|SS_INVERT); #endif - MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_choose0); - MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_choose1); - MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_choose2); - MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_choose3); - MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_choose4); + LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_choose(MenuItemBase::itemIndex); }); END_MENU(); } @@ -178,21 +142,16 @@ void menu_mmu2_choose_filament() { // MMU2 Filament Runout // -inline void action_mmu2_M600_load_current_filament() { mmu2.load_filament(currentTool); } -inline void action_mmu2_M600_load_current_filament_to_nozzle() { mmu2.load_filament_to_nozzle(currentTool); } -inline void action_mmu2_M600_unload_filament() { mmu2.unload(); } -inline void action_mmu2_M600_resume() { mmuMenuWait = false; } - void menu_mmu2_pause() { currentTool = mmu2.get_current_tool(); START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_MMU2_FILAMENT_CHANGE_HEADER, true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_CENTER|SS_INVERT); #endif - MENU_ITEM(function, MSG_MMU2_RESUME, action_mmu2_M600_resume); - MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_M600_unload_filament); - MENU_ITEM(function, MSG_MMU2_LOAD_FILAMENT, action_mmu2_M600_load_current_filament); - MENU_ITEM(function, MSG_MMU2_LOAD_TO_NOZZLE, action_mmu2_M600_load_current_filament_to_nozzle); + ACTION_ITEM(MSG_MMU2_RESUME, []{ mmuMenuWait = false; }); + ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); }); + ACTION_ITEM(MSG_MMU2_LOAD_FILAMENT, []{ mmu2.load_filament(currentTool); }); + ACTION_ITEM(MSG_MMU2_LOAD_TO_NOZZLE, []{ mmu2.load_filament_to_nozzle(currentTool); }); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index a87329e325f6..cb1527cf8122 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -29,6 +29,8 @@ #if HAS_LCD_MENU #include "menu.h" +#include "menu_addon.h" + #include "../../module/motion.h" #if ENABLED(DELTA) @@ -72,9 +74,8 @@ inline void manual_move_to_current(AxisEnum axis // "Motion" > "Move Axis" submenu // -static void _lcd_move_xyz(PGM_P name, AxisEnum axis) { +static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); - ui.encoder_direction_normal(); if (ui.encoderPosition && !ui.processing_manual_move) { // Start with no limits to movement @@ -86,26 +87,26 @@ static void _lcd_move_xyz(PGM_P name, AxisEnum axis) { if (soft_endstops_enabled) switch (axis) { case X_AXIS: #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - min = soft_endstop[X_AXIS].min; + min = soft_endstop.min.x; #endif #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - max = soft_endstop[X_AXIS].max; + max = soft_endstop.max.x; #endif break; case Y_AXIS: #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - min = soft_endstop[Y_AXIS].min; + min = soft_endstop.min.y; #endif #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - max = soft_endstop[Y_AXIS].max; + max = soft_endstop.max.y; #endif break; case Z_AXIS: #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - min = soft_endstop[Z_AXIS].min; + min = soft_endstop.min.z; #endif #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - max = soft_endstop[Z_AXIS].max; + max = soft_endstop.max.z; #endif default: break; } @@ -121,16 +122,16 @@ static void _lcd_move_xyz(PGM_P name, AxisEnum axis) { #endif // Get the new position - const float diff = float(int16_t(ui.encoderPosition)) * move_menu_scale; + const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale; #if IS_KINEMATIC manual_move_offset += diff; - if (int16_t(ui.encoderPosition) < 0) + if (int32_t(ui.encoderPosition) < 0) NOLESS(manual_move_offset, min - current_position[axis]); else NOMORE(manual_move_offset, max - current_position[axis]); #else current_position[axis] += diff; - if (int16_t(ui.encoderPosition) < 0) + if (int32_t(ui.encoderPosition) < 0) NOLESS(current_position[axis], min); else NOMORE(current_position[axis], max); @@ -146,92 +147,72 @@ static void _lcd_move_xyz(PGM_P name, AxisEnum axis) { + manual_move_offset #endif , axis); - draw_edit_screen(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); + MenuEditItemBase::draw_edit_screen(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); } } -void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); } -void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS); } -void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS); } -static void _lcd_move_e( - #if E_MANUAL > 1 - const int8_t eindex=-1 - #endif -) { - if (ui.use_click()) return ui.goto_previous_screen_no_defer(); - ui.encoder_direction_normal(); - if (ui.encoderPosition) { - if (!ui.processing_manual_move) { - const float diff = float(int16_t(ui.encoderPosition)) * move_menu_scale; - #if IS_KINEMATIC - manual_move_offset += diff; - #else - current_position[E_AXIS] += diff; - #endif - manual_move_to_current(E_AXIS - #if E_MANUAL > 1 - , eindex +void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } +void lcd_move_y() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Y), Y_AXIS); } +void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); } + +#if E_MANUAL + + static void lcd_move_e( + #if E_MANUAL > 1 + const int8_t eindex=-1 + #endif + ) { + if (ui.use_click()) return ui.goto_previous_screen_no_defer(); + if (ui.encoderPosition) { + if (!ui.processing_manual_move) { + const float diff = float(int32_t(ui.encoderPosition)) * move_menu_scale; + #if IS_KINEMATIC + manual_move_offset += diff; + #else + current_position.e += diff; #endif - ); - ui.refresh(LCDVIEW_REDRAW_NOW); - } - ui.encoderPosition = 0; - } - if (ui.should_draw()) { - PGM_P pos_label; - #if E_MANUAL == 1 - pos_label = PSTR(MSG_MOVE_E); - #else - switch (eindex) { - default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; - case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; - #if E_MANUAL > 2 - case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; - #if E_MANUAL > 3 - case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; - #if E_MANUAL > 4 - case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break; - #if E_MANUAL > 5 - case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break; - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 + manual_move_to_current(E_AXIS + #if E_MANUAL > 1 + , eindex + #endif + ); + ui.refresh(LCDVIEW_REDRAW_NOW); } - #endif // E_MANUAL > 1 - - draw_edit_screen(pos_label, ftostr41sign(current_position[E_AXIS] - #if IS_KINEMATIC - + manual_move_offset - #endif - #if ENABLED(MANUAL_E_MOVES_RELATIVE) - - manual_move_e_origin + ui.encoderPosition = 0; + } + if (ui.should_draw()) { + #if E_MANUAL > 1 + MenuItemBase::init(eindex); #endif - )); + MenuEditItemBase::draw_edit_screen( + GET_TEXT( + #if E_MANUAL > 1 + MSG_MOVE_EN + #else + MSG_MOVE_E + #endif + ), + ftostr41sign(current_position.e + #if IS_KINEMATIC + + manual_move_offset + #endif + #if ENABLED(MANUAL_E_MOVES_RELATIVE) + - manual_move_e_origin + #endif + ) + ); + } // should_draw } -} -inline void lcd_move_e() { _lcd_move_e(); } -#if E_MANUAL > 1 - inline void lcd_move_e0() { _lcd_move_e(0); } - inline void lcd_move_e1() { _lcd_move_e(1); } - #if E_MANUAL > 2 - inline void lcd_move_e2() { _lcd_move_e(2); } - #if E_MANUAL > 3 - inline void lcd_move_e3() { _lcd_move_e(3); } - #if E_MANUAL > 4 - inline void lcd_move_e4() { _lcd_move_e(4); } - #if E_MANUAL > 5 - inline void lcd_move_e5() { _lcd_move_e(5); } - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 -#endif // E_MANUAL > 1 +#endif // E_MANUAL // // "Motion" > "Move Xmm" > "Move XYZ" submenu // +#ifndef SHORT_MANUAL_Z_MOVE + #define SHORT_MANUAL_Z_MOVE 0.025 +#endif + screenFunc_t _manual_move_func_ptr; void _goto_manual_move(const float scale) { @@ -239,76 +220,55 @@ void _goto_manual_move(const float scale) { move_menu_scale = scale; ui.goto_screen(_manual_move_func_ptr); } -void menu_move_10mm() { _goto_manual_move(10); } -void menu_move_1mm() { _goto_manual_move( 1); } -void menu_move_01mm() { _goto_manual_move( 0.1f); } -void menu_move_0025mm() { _goto_manual_move( 0.025f); } void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=-1) { _manual_move_func_ptr = func; START_MENU(); if (LCD_HEIGHT >= 4) { switch (axis) { - case X_AXIS: STATIC_ITEM(MSG_MOVE_X, true, true); break; - case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, true, true); break; - case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, true, true); break; + case X_AXIS: STATIC_ITEM(MSG_MOVE_X, SS_CENTER|SS_INVERT); break; + case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, SS_CENTER|SS_INVERT); break; + case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, SS_CENTER|SS_INVERT); break; default: #if ENABLED(MANUAL_E_MOVES_RELATIVE) - manual_move_e_origin = current_position[E_AXIS]; + manual_move_e_origin = current_position.e; #endif - STATIC_ITEM(MSG_MOVE_E, true, true); + STATIC_ITEM(MSG_MOVE_E, SS_CENTER|SS_INVERT); break; } } #if ENABLED(PREVENT_COLD_EXTRUSION) if (axis == E_AXIS && thermalManager.tooColdToExtrude(eindex >= 0 ? eindex : active_extruder)) - MENU_BACK(MSG_HOTEND_TOO_COLD); + BACK_ITEM(MSG_HOTEND_TOO_COLD); else #endif { - MENU_BACK(MSG_MOVE_AXIS); - MENU_ITEM(submenu, MSG_MOVE_10MM, menu_move_10mm); - MENU_ITEM(submenu, MSG_MOVE_1MM, menu_move_1mm); - MENU_ITEM(submenu, MSG_MOVE_01MM, menu_move_01mm); - if (axis == Z_AXIS) - MENU_ITEM(submenu, MSG_MOVE_0025MM, menu_move_0025mm); + BACK_ITEM(MSG_MOVE_AXIS); + SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); }); + SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); + SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); }); + if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { + extern const char NUL_STR[]; + SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); + MENU_ITEM_ADDON_START(0); + char tmp[20], numstr[10]; + // Determine digits needed right of decimal + const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : + !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; + sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); + lcd_put_u8str(tmp); + MENU_ITEM_ADDON_END(); + } } END_MENU(); } -void lcd_move_get_x_amount() { _menu_move_distance(X_AXIS, lcd_move_x); } -void lcd_move_get_y_amount() { _menu_move_distance(Y_AXIS, lcd_move_y); } -void lcd_move_get_z_amount() { _menu_move_distance(Z_AXIS, lcd_move_z); } -void lcd_move_get_e_amount() { _menu_move_distance(E_AXIS, lcd_move_e, -1); } -#if E_MANUAL > 1 - void lcd_move_get_e0_amount() { _menu_move_distance(E_AXIS, lcd_move_e0, 0); } - void lcd_move_get_e1_amount() { _menu_move_distance(E_AXIS, lcd_move_e1, 1); } - #if E_MANUAL > 2 - void lcd_move_get_e2_amount() { _menu_move_distance(E_AXIS, lcd_move_e2, 2); } - #if E_MANUAL > 3 - void lcd_move_get_e3_amount() { _menu_move_distance(E_AXIS, lcd_move_e3, 3); } - #if E_MANUAL > 4 - void lcd_move_get_e4_amount() { _menu_move_distance(E_AXIS, lcd_move_e4, 4); } - #if E_MANUAL > 5 - void lcd_move_get_e5_amount() { _menu_move_distance(E_AXIS, lcd_move_e5, 5); } - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 -#endif // E_MANUAL > 1 - -#if ENABLED(DELTA) - void lcd_lower_z_to_clip_height() { - line_to_z(delta_clip_start_height); - ui.synchronize(); - } -#endif void menu_move() { START_MENU(); - MENU_BACK(MSG_MOTION); + BACK_ITEM(MSG_MOTION); #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM) - MENU_ITEM_EDIT(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); + EDIT_ITEM(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); #endif if ( @@ -320,104 +280,93 @@ void menu_move() { ) { if ( #if ENABLED(DELTA) - current_position[Z_AXIS] <= delta_clip_start_height + current_position.z <= delta_clip_start_height #else true #endif ) { - MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount); - MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount); + SUBMENU(MSG_MOVE_X, []{ _menu_move_distance(X_AXIS, lcd_move_x); }); + SUBMENU(MSG_MOVE_Y, []{ _menu_move_distance(Y_AXIS, lcd_move_y); }); } #if ENABLED(DELTA) else - MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height); + ACTION_ITEM(MSG_FREE_XY, []{ line_to_z(delta_clip_start_height); ui.synchronize(); }); #endif - MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount); + SUBMENU(MSG_MOVE_Z, []{ _menu_move_distance(Z_AXIS, lcd_move_z); }); } else - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + GCODES_ITEM(MSG_AUTO_HOME, G28_STR); #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, MAGNETIC_SWITCHING_TOOLHEAD) - #if EXTRUDERS == 6 + #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; - case 4: MENU_ITEM(gcode, MSG_SELECT " " MSG_E6, PSTR("T5")); break; - case 5: MENU_ITEM(gcode, MSG_SELECT " " MSG_E5, PSTR("T4")); break; - } - #elif EXTRUDERS == 5 || 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; + case 0: GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); break; + case 1: GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); break; + case 2: GCODES_ITEM_N(3, MSG_SELECT_E, PSTR("T3")); break; + case 3: GCODES_ITEM_N(2, MSG_SELECT_E, PSTR("T2")); break; + #if EXTRUDERS == 6 + case 4: GCODES_ITEM_N(5, MSG_SELECT_E, PSTR("T5")); break; + case 5: GCODES_ITEM_N(4, MSG_SELECT_E, PSTR("T4")); break; + #endif } #elif EXTRUDERS == 3 if (active_extruder < 2) { if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); } #else if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); #endif #elif ENABLED(DUAL_X_CARRIAGE) if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); #endif - #if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) + #if E_MANUAL - // 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 MSG_MOVE_E3, lcd_move_get_e2_amount); - #endif + // The current extruder + SUBMENU(MSG_MOVE_E, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(); }, -1); }); - #else + #define SUBMENU_MOVE_E(N) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(MenuItemBase::itemIndex); }, MenuItemBase::itemIndex); }); - // 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); - #if E_MANUAL > 5 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount); - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 + #if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) - #endif + // ...and the non-switching + #if E_MANUAL == 5 + SUBMENU_MOVE_E(4); + #elif E_MANUAL == 3 + SUBMENU_MOVE_E(2); + #endif + + #elif E_MANUAL > 1 + + // Independent extruders with one E-stepper per hotend + for (uint8_t n = 0; n < E_MANUAL; n++) SUBMENU_MOVE_E(n); + + #endif + + #endif // E_MANUAL END_MENU(); } -void _lcd_ubl_level_bed(); -void menu_bed_leveling(); +#if ENABLED(AUTO_BED_LEVELING_UBL) + void _lcd_ubl_level_bed(); +#elif ENABLED(LCD_BED_LEVELING) + void menu_bed_leveling(); +#endif void menu_motion() { START_MENU(); @@ -425,7 +374,7 @@ void menu_motion() { // // ^ Main // - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); // // Move Axis @@ -433,23 +382,23 @@ void menu_motion() { #if ENABLED(DELTA) if (all_axes_homed()) #endif - MENU_ITEM(submenu, MSG_MOVE_AXIS, menu_move); + SUBMENU(MSG_MOVE_AXIS, menu_move); // // Auto Home // - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + GCODES_ITEM(MSG_AUTO_HOME, G28_STR); #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); + GCODES_ITEM(MSG_AUTO_HOME_X, PSTR("G28 X")); + GCODES_ITEM(MSG_AUTO_HOME_Y, PSTR("G28 Y")); + GCODES_ITEM(MSG_AUTO_HOME_Z, PSTR("G28 Z")); #endif // // Auto Z-Align // #if ENABLED(Z_STEPPER_AUTO_ALIGN) - MENU_ITEM(gcode, MSG_AUTO_Z_ALIGN, PSTR("G34")); + GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34")); #endif // @@ -457,35 +406,40 @@ void menu_motion() { // #if ENABLED(AUTO_BED_LEVELING_UBL) - MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); + SUBMENU(MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); #elif ENABLED(LCD_BED_LEVELING) - if (!g29_in_progress) MENU_ITEM(submenu, MSG_BED_LEVELING, menu_bed_leveling); + if (!g29_in_progress) SUBMENU(MSG_BED_LEVELING, menu_bed_leveling); #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) #if DISABLED(PROBE_MANUALLY) - MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29")); + GCODES_ITEM(MSG_LEVEL_BED, PSTR("G28\nG29")); #endif if (all_axes_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); + bool show_state = planner.leveling_active; + EDIT_ITEM(bool, MSG_BED_LEVELING, &show_state, _lcd_toggle_bed_leveling); } #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &lcd_z_fade_height, 0, 100, _lcd_set_z_fade_height); + editable.decimal = planner.z_fade_height; + EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); }); #endif #endif #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) - MENU_ITEM(function, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); + ACTION_ITEM(MSG_LEVEL_CORNERS, _lcd_level_bed_corners); + #endif + + #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) + GCODES_ITEM(MSG_M48_TEST, PSTR("G28\nM48 P10")); #endif // // Disable Steppers // - MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); + GCODES_ITEM(MSG_DISABLE_STEPPERS, PSTR("M84")); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_service.cpp b/Marlin/src/lcd/menu/menu_service.cpp deleted file mode 100644 index 5f30856f0bd7..000000000000 --- a/Marlin/src/lcd/menu/menu_service.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ - -// -// Service Menus -// - -#include "../../inc/MarlinConfigPre.h" - -#if HAS_LCD_MENU && HAS_SERVICE_INTERVALS && ENABLED(PRINTCOUNTER) - -#include "menu.h" -#include "../../module/printcounter.h" - -inline void _menu_service(const int index, PGM_P const name) { - char sram[30]; - strncpy_P(sram, name, 29); - do_select_screen( - PSTR(MSG_BUTTON_RESET), PSTR(MSG_BUTTON_CANCEL), - []{ - print_job_timer.resetServiceInterval(index); - ui.completion_feedback(true); - ui.reset_status(); - ui.return_to_status(); - }, - ui.goto_previous_screen, - PSTR(MSG_SERVICE_RESET), sram, PSTR("?") - ); -} - -#if SERVICE_INTERVAL_1 > 0 - void menu_service1() { _menu_service(1, PSTR(SERVICE_NAME_1)); } -#endif - -#if SERVICE_INTERVAL_2 > 0 - void menu_service2() { _menu_service(2, PSTR(SERVICE_NAME_2)); } -#endif - -#if SERVICE_INTERVAL_3 > 0 - void menu_service3() { _menu_service(3, PSTR(SERVICE_NAME_3)); } -#endif - -#endif // HAS_LCD_MENU && HAS_SERVICE_INTERVALS && PRINTCOUNTER diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index e3fda1dc378f..1c480577f17c 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -35,17 +35,17 @@ void menu_spindle_laser() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); if (cutter.enabled()) { #if ENABLED(SPINDLE_LASER_PWM) - MENU_ITEM_EDIT_CALLBACK(CUTTER_MENU_TYPE, MSG_CUTTER(POWER), &cutter.power, SPEED_POWER_MIN, SPEED_POWER_MAX, cutter.update_output); + EDIT_ITEM(CUTTER_MENU_TYPE, MSG_CUTTER(POWER), &cutter.power, SPEED_POWER_MIN, SPEED_POWER_MAX); #endif - MENU_ITEM(function, MSG_CUTTER(OFF), cutter.disable); + ACTION_ITEM(MSG_CUTTER(OFF), cutter.disable); } else { - MENU_ITEM(function, MSG_CUTTER(ON), cutter.enable_forward); + ACTION_ITEM(MSG_CUTTER(ON), cutter.enable_forward); #if ENABLED(SPINDLE_CHANGE_DIR) - MENU_ITEM(function, MSG_SPINDLE_REVERSE, cutter.enable_reverse); + ACTION_ITEM(MSG_SPINDLE_REVERSE, cutter.enable_reverse); #endif } END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index ad987850fdf6..0c90a88753ee 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -48,7 +48,9 @@ uint8_t MarlinUI::preheat_fan_speed[2]; // void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const uint8_t fan) { - if (temph > 0) thermalManager.setTargetHotend(_MIN(heater_maxtemp[endnum] - 15, temph), endnum); + #if HOTENDS + if (temph > 0) thermalManager.setTargetHotend(_MIN(heater_maxtemp[endnum] - 15, temph), endnum); + #endif #if HAS_HEATED_BED if (tempb >= 0) thermalManager.setTargetBed(tempb); #else @@ -66,231 +68,87 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb ui.return_to_status(); } -#if HOTENDS > 1 - - void lcd_preheat_m1_e1_only() { _lcd_preheat(1, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e1_only() { _lcd_preheat(1, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e1() { _lcd_preheat(1, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e1() { _lcd_preheat(1, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } - #endif - #if HOTENDS > 2 - void lcd_preheat_m1_e2_only() { _lcd_preheat(2, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e2_only() { _lcd_preheat(2, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e2() { _lcd_preheat(2, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e2() { _lcd_preheat(2, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } - #endif - #if HOTENDS > 3 - void lcd_preheat_m1_e3_only() { _lcd_preheat(3, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e3_only() { _lcd_preheat(3, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e3() { _lcd_preheat(3, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e3() { _lcd_preheat(3, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } - #endif - #if HOTENDS > 4 - void lcd_preheat_m1_e4_only() { _lcd_preheat(4, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e4_only() { _lcd_preheat(4, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e4() { _lcd_preheat(4, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e4() { _lcd_preheat(4, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } - #endif - #if HOTENDS > 5 - void lcd_preheat_m1_e5_only() { _lcd_preheat(5, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e5_only() { _lcd_preheat(5, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } - #if HAS_HEATED_BED - void lcd_preheat_m1_e5() { _lcd_preheat(5, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e5() { _lcd_preheat(5, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } - #endif - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - +#if HAS_TEMP_HOTEND + inline void _preheat_end(const uint8_t m, const uint8_t e) { + _lcd_preheat(e, ui.preheat_hotend_temp[m], -1, ui.preheat_fan_speed[m]); + } #if HAS_HEATED_BED - void lcd_preheat_m1_e0(); - void lcd_preheat_m2_e0(); - #else - void lcd_preheat_m1_e0_only(); - void lcd_preheat_m2_e0_only(); + inline void _preheat_both(const uint8_t m, const uint8_t e) { + _lcd_preheat(e, ui.preheat_hotend_temp[m], ui.preheat_bed_temp[m], ui.preheat_fan_speed[m]); + } #endif - - void lcd_preheat_m1_all() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 3); - #if HOTENDS > 4 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 4); - #if HOTENDS > 5 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - lcd_preheat_m1_e0(); - #else - lcd_preheat_m1_e0_only(); - #endif - } - - void lcd_preheat_m2_all() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 3); - #if HOTENDS > 4 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 4); - #if HOTENDS > 5 - thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - lcd_preheat_m2_e0(); - #else - lcd_preheat_m2_e0_only(); - #endif +#endif +#if HAS_HEATED_BED + inline void _preheat_bed(const uint8_t m) { + _lcd_preheat(0, 0, ui.preheat_bed_temp[m], ui.preheat_fan_speed[m]); } - -#endif // HOTENDS > 1 +#endif #if HAS_TEMP_HOTEND || HAS_HEATED_BED - void lcd_preheat_m1_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } - + #define _PREHEAT_ITEMS(M,N) do{ \ + ACTION_ITEM_N(N, MSG_PREHEAT_##M##_H, []{ _preheat_both(M-1, MenuItemBase::itemIndex); }); \ + ACTION_ITEM_N(N, MSG_PREHEAT_##M##_END_E, []{ _preheat_end(M-1, MenuItemBase::itemIndex); }); \ + }while(0) #if HAS_HEATED_BED - void lcd_preheat_m1_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } - void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } + #define PREHEAT_ITEMS(M,N) _PREHEAT_ITEMS(M,N) + #else + #define PREHEAT_ITEMS(M,N) \ + ACTION_ITEM_N(N, MSG_PREHEAT_##M##_H, []{ _preheat_end(M-1, MenuItemBase::itemIndex); }) #endif void menu_preheat_m1() { START_MENU(); - MENU_BACK(MSG_TEMPERATURE); + BACK_ITEM(MSG_TEMPERATURE); #if HOTENDS == 1 #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0); - MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only); + ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_both(0, 0); }); + ACTION_ITEM(MSG_PREHEAT_1_END, []{ _preheat_end(0, 0); }); #else - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); + ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_end(0, 0); }); #endif #elif HOTENDS > 1 #if HAS_HEATED_BED - 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); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E2, lcd_preheat_m1_e1_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only); + _PREHEAT_ITEMS(1,0); #endif - #if HOTENDS > 2 + for (uint8_t n = 1; n < HOTENDS; n++) PREHEAT_ITEMS(1,n); + ACTION_ITEM(MSG_PREHEAT_1_ALL, []() { #if HAS_HEATED_BED - 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); + _preheat_bed(0); #endif - #if HOTENDS > 3 - #if HAS_HEATED_BED - 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 - 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 - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4_only); - #endif - #if HOTENDS > 5 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H6, lcd_preheat_m1_e5); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E6, lcd_preheat_m1_e5_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H6, lcd_preheat_m1_e5_only); - #endif - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all); + HOTEND_LOOP() thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], e); + }); #endif // HOTENDS > 1 #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly); + ACTION_ITEM(MSG_PREHEAT_1_BEDONLY, []{ _preheat_bed(0); }); #endif END_MENU(); } void menu_preheat_m2() { START_MENU(); - MENU_BACK(MSG_TEMPERATURE); + BACK_ITEM(MSG_TEMPERATURE); #if HOTENDS == 1 #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0); - MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only); + ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_both(1, 0); }); + ACTION_ITEM(MSG_PREHEAT_2_END, []{ _preheat_end(1, 0); }); #else - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); + ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_end(1, 0); }); #endif #elif HOTENDS > 1 #if HAS_HEATED_BED - 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); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E2, lcd_preheat_m2_e1_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only); + _PREHEAT_ITEMS(2,0); #endif - #if HOTENDS > 2 + for (uint8_t n = 1; n < HOTENDS; n++) PREHEAT_ITEMS(2,n); + ACTION_ITEM(MSG_PREHEAT_2_ALL, []() { #if HAS_HEATED_BED - 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); + _preheat_bed(1); #endif - #if HOTENDS > 3 - #if HAS_HEATED_BED - 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 - 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 - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4_only); - #endif - #if HOTENDS > 5 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H6, lcd_preheat_m2_e5); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E6, lcd_preheat_m2_e5_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H6, lcd_preheat_m2_e5_only); - #endif - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all); + HOTEND_LOOP() thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], e); + }); #endif // HOTENDS > 1 #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly); + ACTION_ITEM(MSG_PREHEAT_2_BEDONLY, []{ _preheat_bed(1); }); #endif END_MENU(); } @@ -305,48 +163,35 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb void menu_temperature() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); // // Nozzle: // Nozzle [1-5]: // #if HOTENDS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, thermalManager.start_watching_E0); - #else // HOTENDS > 1 - #define EDIT_TARGET(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, thermalManager.start_watching_E##N) - EDIT_TARGET(0); - EDIT_TARGET(1); - #if HOTENDS > 2 - EDIT_TARGET(2); - #if HOTENDS > 3 - EDIT_TARGET(3); - #if HOTENDS > 4 - EDIT_TARGET(4); - #if HOTENDS > 5 - EDIT_TARGET(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(0); }); + #elif HOTENDS > 1 + #define EDIT_TARGET(N) EDIT_ITEM_FAST_N(int3, N, MSG_NOZZLE_N, &thermalManager.temp_hotend[N].target, 0, heater_maxtemp[N] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }) + HOTEND_LOOP() EDIT_TARGET(e); + #endif #if ENABLED(SINGLENOZZLE) - MENU_MULTIPLIER_ITEM_EDIT(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15); + EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15); #endif // // Bed: // #if HAS_HEATED_BED - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed); + EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed); #endif // // Chamber: // #if HAS_HEATED_CHAMBER - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_CHAMBER, &thermalManager.temp_chamber.target, 0, CHAMBER_MAXTEMP - 5, thermalManager.start_watching_chamber); + EDIT_ITEM_FAST(int3, MSG_CHAMBER, &thermalManager.temp_chamber.target, 0, CHAMBER_MAXTEMP - 5, thermalManager.start_watching_chamber); #endif // @@ -354,22 +199,31 @@ void menu_temperature() { // #if FAN_COUNT > 0 #if HAS_FAN0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(percent, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0); + editable.uint8 = thermalManager.fan_speed[0]; + EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); }); #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(percent, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255); + EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255); #endif #endif - #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(percent, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1); + #if HAS_FAN1 + editable.uint8 = thermalManager.fan_speed[1]; + EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(percent, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255); + EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255); #endif + #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 1 + editable.uint8 = thermalManager.fan_speed[1]; + EDIT_ITEM_FAST_N(percent, 2, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); #endif - #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(percent, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2); + #if HAS_FAN2 + editable.uint8 = thermalManager.fan_speed[2]; + EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(percent, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255); + EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255); #endif + #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 2 + editable.uint8 = thermalManager.fan_speed[2]; + EDIT_ITEM_FAST_N(percent, 3, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); #endif #endif // FAN_COUNT > 0 @@ -379,11 +233,11 @@ void menu_temperature() { // Preheat for Material 1 and 2 // #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_5 != 0 || HAS_HEATED_BED - MENU_ITEM(submenu, MSG_PREHEAT_1, menu_preheat_m1); - MENU_ITEM(submenu, MSG_PREHEAT_2, menu_preheat_m2); + SUBMENU(MSG_PREHEAT_1, menu_preheat_m1); + SUBMENU(MSG_PREHEAT_2, menu_preheat_m2); #else - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); + ACTION_ITEM(MSG_PREHEAT_1, []{ _preheat_end(0, 0); }); + ACTION_ITEM(MSG_PREHEAT_2, []{ _preheat_end(1, 0); }); #endif // @@ -394,7 +248,7 @@ void menu_temperature() { #if HAS_TEMP_BED if (thermalManager.temp_bed.target) has_heat = true; #endif - if (has_heat) MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); + if (has_heat) ACTION_ITEM(MSG_COOLDOWN, lcd_cooldown); #endif // HAS_TEMP_HOTEND diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index 8b905cd09536..ef0e207a6042 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -29,54 +29,14 @@ #if HAS_TRINAMIC && HAS_LCD_MENU #include "menu.h" -#include "../../module/stepper_indirection.h" +#include "../../module/stepper/indirection.h" #include "../../feature/tmc_util.h" -#define TMC_EDIT_STORED_I_RMS(ST,MSG) MENU_ITEM_EDIT_CALLBACK(uint16_4, MSG, &stepper##ST.val_mA, 100, 3000, refresh_stepper_current_##ST) - -#if AXIS_IS_TMC(X) - void refresh_stepper_current_X() { stepperX.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(Y) - void refresh_stepper_current_Y() { stepperY.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(Z) - void refresh_stepper_current_Z() { stepperZ.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(X2) - void refresh_stepper_current_X2() { stepperX2.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(Y2) - void refresh_stepper_current_Y2() { stepperY2.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(Z2) - void refresh_stepper_current_Z2() { stepperZ2.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(Z3) - void refresh_stepper_current_Z3() { stepperZ3.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(E0) - void refresh_stepper_current_E0() { stepperE0.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(E1) - void refresh_stepper_current_E1() { stepperE1.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(E2) - void refresh_stepper_current_E2() { stepperE2.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(E3) - void refresh_stepper_current_E3() { stepperE3.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(E4) - void refresh_stepper_current_E4() { stepperE4.refresh_stepper_current(); } -#endif -#if AXIS_IS_TMC(E5) - void refresh_stepper_current_E5() { stepperE5.refresh_stepper_current(); } -#endif +#define TMC_EDIT_STORED_I_RMS(ST,MSG) EDIT_ITEM_P(uint16_4, PSTR(MSG), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); }) void menu_tmc_current() { START_MENU(); - MENU_BACK(MSG_TMC_DRIVERS); + BACK_ITEM(MSG_TMC_DRIVERS); #if AXIS_IS_TMC(X) TMC_EDIT_STORED_I_RMS(X, MSG_X); #endif @@ -99,73 +59,33 @@ void menu_tmc_current() { TMC_EDIT_STORED_I_RMS(Z3, MSG_Z3); #endif #if AXIS_IS_TMC(E0) - TMC_EDIT_STORED_I_RMS(E0, MSG_E1); + TMC_EDIT_STORED_I_RMS(E0, LCD_STR_E0); #endif #if AXIS_IS_TMC(E1) - TMC_EDIT_STORED_I_RMS(E1, MSG_E2); + TMC_EDIT_STORED_I_RMS(E1, LCD_STR_E1); #endif #if AXIS_IS_TMC(E2) - TMC_EDIT_STORED_I_RMS(E2, MSG_E3); + TMC_EDIT_STORED_I_RMS(E2, LCD_STR_E2); #endif #if AXIS_IS_TMC(E3) - TMC_EDIT_STORED_I_RMS(E3, MSG_E4); + TMC_EDIT_STORED_I_RMS(E3, LCD_STR_E3); #endif #if AXIS_IS_TMC(E4) - TMC_EDIT_STORED_I_RMS(E4, MSG_E5); + TMC_EDIT_STORED_I_RMS(E4, LCD_STR_E4); #endif #if AXIS_IS_TMC(E5) - TMC_EDIT_STORED_I_RMS(E5, MSG_E6); + TMC_EDIT_STORED_I_RMS(E5, LCD_STR_E5); #endif END_MENU(); } #if ENABLED(HYBRID_THRESHOLD) - #define TMC_EDIT_STORED_HYBRID_THRS(ST, MSG) MENU_ITEM_EDIT_CALLBACK(uint8, MSG, &stepper##ST.stored.hybrid_thrs, 0, 255, refresh_hybrid_thrs_##ST); - - #if AXIS_HAS_STEALTHCHOP(X) - void refresh_hybrid_thrs_X() { stepperX.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - void refresh_hybrid_thrs_Y() { stepperY.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - void refresh_hybrid_thrs_Z() { stepperZ.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - void refresh_hybrid_thrs_X2() { stepperX2.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - void refresh_hybrid_thrs_Y2() { stepperY2.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - void refresh_hybrid_thrs_Z2() { stepperZ2.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - void refresh_hybrid_thrs_Z3() { stepperZ3.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - void refresh_hybrid_thrs_E0() { stepperE0.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - void refresh_hybrid_thrs_E1() { stepperE1.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - void refresh_hybrid_thrs_E2() { stepperE2.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - void refresh_hybrid_thrs_E3() { stepperE3.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - void refresh_hybrid_thrs_E4() { stepperE4.refresh_hybrid_thrs(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - void refresh_hybrid_thrs_E5() { stepperE5.refresh_hybrid_thrs(); } - #endif + #define TMC_EDIT_STORED_HYBRID_THRS(ST, MSG) EDIT_ITEM_P(uint8, PSTR(MSG), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); void menu_tmc_hybrid_thrs() { START_MENU(); - MENU_BACK(MSG_TMC_DRIVERS); + BACK_ITEM(MSG_TMC_DRIVERS); #if AXIS_HAS_STEALTHCHOP(X) TMC_EDIT_STORED_HYBRID_THRS(X, MSG_X); #endif @@ -188,22 +108,22 @@ void menu_tmc_current() { TMC_EDIT_STORED_HYBRID_THRS(Z3, MSG_Z3); #endif #if AXIS_HAS_STEALTHCHOP(E0) - TMC_EDIT_STORED_HYBRID_THRS(E0, MSG_E1); + TMC_EDIT_STORED_HYBRID_THRS(E0, LCD_STR_E0); #endif #if AXIS_HAS_STEALTHCHOP(E1) - TMC_EDIT_STORED_HYBRID_THRS(E1, MSG_E2); + TMC_EDIT_STORED_HYBRID_THRS(E1, LCD_STR_E1); #endif #if AXIS_HAS_STEALTHCHOP(E2) - TMC_EDIT_STORED_HYBRID_THRS(E2, MSG_E3); + TMC_EDIT_STORED_HYBRID_THRS(E2, LCD_STR_E2); #endif #if AXIS_HAS_STEALTHCHOP(E3) - TMC_EDIT_STORED_HYBRID_THRS(E3, MSG_E4); + TMC_EDIT_STORED_HYBRID_THRS(E3, LCD_STR_E3); #endif #if AXIS_HAS_STEALTHCHOP(E4) - TMC_EDIT_STORED_HYBRID_THRS(E4, MSG_E5); + TMC_EDIT_STORED_HYBRID_THRS(E4, LCD_STR_E4); #endif #if AXIS_HAS_STEALTHCHOP(E5) - TMC_EDIT_STORED_HYBRID_THRS(E5, MSG_E6); + TMC_EDIT_STORED_HYBRID_THRS(E5, LCD_STR_E5); #endif END_MENU(); } @@ -212,24 +132,17 @@ void menu_tmc_current() { #if ENABLED(SENSORLESS_HOMING) - #define TMC_EDIT_STORED_SGT(ST) MENU_ITEM_EDIT_CALLBACK(int4, MSG_##ST, &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, refresh_homing_thrs_##ST); - - #if X_SENSORLESS - void refresh_homing_thrs_X() { stepperX.refresh_homing_thrs(); } - #endif - #if Y_SENSORLESS - void refresh_homing_thrs_Y() { stepperY.refresh_homing_thrs(); } - #endif - #if Z_SENSORLESS - void refresh_homing_thrs_Z() { stepperZ.refresh_homing_thrs(); } - #endif + #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_P(int4, PSTR(MSG_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); }); void menu_tmc_homing_thrs() { START_MENU(); - MENU_BACK(MSG_TMC_DRIVERS); + BACK_ITEM(MSG_TMC_DRIVERS); #if X_SENSORLESS TMC_EDIT_STORED_SGT(X); #endif + #if X2_SENSORLESS + TMC_EDIT_STORED_SGT(X2); + #endif #if Y_SENSORLESS TMC_EDIT_STORED_SGT(Y); #endif @@ -243,52 +156,12 @@ void menu_tmc_current() { #if HAS_STEALTHCHOP - #define TMC_EDIT_STEP_MODE(ST, MSG) MENU_ITEM_EDIT_CALLBACK(bool, MSG, &stepper##ST.stored.stealthChop_enabled, refresh_stepping_mode_##ST) - - #if AXIS_HAS_STEALTHCHOP(X) - void refresh_stepping_mode_X() { stepperX.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Y) - void refresh_stepping_mode_Y() { stepperY.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Z) - void refresh_stepping_mode_Z() { stepperZ.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(X2) - void refresh_stepping_mode_X2() { stepperX2.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Y2) - void refresh_stepping_mode_Y2() { stepperY2.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Z2) - void refresh_stepping_mode_Z2() { stepperZ2.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(Z3) - void refresh_stepping_mode_Z3() { stepperZ3.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E0) - void refresh_stepping_mode_E0() { stepperE0.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E1) - void refresh_stepping_mode_E1() { stepperE1.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E2) - void refresh_stepping_mode_E2() { stepperE2.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E3) - void refresh_stepping_mode_E3() { stepperE3.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E4) - void refresh_stepping_mode_E4() { stepperE4.refresh_stepping_mode(); } - #endif - #if AXIS_HAS_STEALTHCHOP(E5) - void refresh_stepping_mode_E5() { stepperE5.refresh_stepping_mode(); } - #endif + #define TMC_EDIT_STEP_MODE(ST, MSG) EDIT_ITEM_P(bool, PSTR(MSG), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); }) void menu_tmc_step_mode() { START_MENU(); STATIC_ITEM(MSG_TMC_STEALTH_ENABLED); - MENU_BACK(MSG_TMC_DRIVERS); + BACK_ITEM(MSG_TMC_DRIVERS); #if AXIS_HAS_STEALTHCHOP(X) TMC_EDIT_STEP_MODE(X, MSG_X); #endif @@ -311,22 +184,22 @@ void menu_tmc_current() { TMC_EDIT_STEP_MODE(Z3, MSG_Z3); #endif #if AXIS_HAS_STEALTHCHOP(E0) - TMC_EDIT_STEP_MODE(E0, MSG_E1); + TMC_EDIT_STEP_MODE(E0, LCD_STR_E0); #endif #if AXIS_HAS_STEALTHCHOP(E1) - TMC_EDIT_STEP_MODE(E1, MSG_E2); + TMC_EDIT_STEP_MODE(E1, LCD_STR_E1); #endif #if AXIS_HAS_STEALTHCHOP(E2) - TMC_EDIT_STEP_MODE(E2, MSG_E3); + TMC_EDIT_STEP_MODE(E2, LCD_STR_E2); #endif #if AXIS_HAS_STEALTHCHOP(E3) - TMC_EDIT_STEP_MODE(E3, MSG_E4); + TMC_EDIT_STEP_MODE(E3, LCD_STR_E3); #endif #if AXIS_HAS_STEALTHCHOP(E4) - TMC_EDIT_STEP_MODE(E4, MSG_E5); + TMC_EDIT_STEP_MODE(E4, LCD_STR_E4); #endif #if AXIS_HAS_STEALTHCHOP(E5) - TMC_EDIT_STEP_MODE(E5, MSG_E6); + TMC_EDIT_STEP_MODE(E5, LCD_STR_E5); #endif END_MENU(); } @@ -335,16 +208,16 @@ void menu_tmc_current() { void menu_tmc() { START_MENU(); - MENU_BACK(MSG_CONTROL); - MENU_ITEM(submenu, MSG_TMC_CURRENT, menu_tmc_current); + BACK_ITEM(MSG_CONTROL); + SUBMENU(MSG_TMC_CURRENT, menu_tmc_current); #if ENABLED(HYBRID_THRESHOLD) - MENU_ITEM(submenu, MSG_TMC_HYBRID_THRS, menu_tmc_hybrid_thrs); + SUBMENU(MSG_TMC_HYBRID_THRS, menu_tmc_hybrid_thrs); #endif #if ENABLED(SENSORLESS_HOMING) - MENU_ITEM(submenu, MSG_TMC_HOMING_THRS, menu_tmc_homing_thrs); + SUBMENU(MSG_TMC_HOMING_THRS, menu_tmc_homing_thrs); #endif #if HAS_STEALTHCHOP - MENU_ITEM(submenu, MSG_TMC_STEPPING_MODE, menu_tmc_step_mode); + SUBMENU(MSG_TMC_STEPPING_MODE, menu_tmc_step_mode); #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index adbcbefc569f..4fba6fe719a9 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -42,27 +42,6 @@ #include "../../module/tool_change.h" #endif -// Refresh the E factor after changing flow -#if EXTRUDERS - void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); } - #if EXTRUDERS > 1 - void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); } - void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); } - #if EXTRUDERS > 2 - void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); } - #if EXTRUDERS > 3 - void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); } - #if EXTRUDERS > 4 - void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); } - #if EXTRUDERS > 5 - void _lcd_refresh_e_factor_5() { planner.refresh_e_factor(5); } - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 -#endif // EXTRUDERS - #if ENABLED(BABYSTEPPING) #include "../../feature/babystep.h" @@ -73,16 +52,20 @@ void _lcd_babystep(const AxisEnum axis, PGM_P const msg) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); - ui.encoder_direction_normal(); if (ui.encoderPosition) { - const int16_t steps = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR); + const int16_t steps = int16_t(ui.encoderPosition) * ( + #if ENABLED(BABYSTEP_XY) + axis != Z_AXIS ? BABYSTEP_MULTIPLICATOR_XY : + #endif + BABYSTEP_MULTIPLICATOR_Z + ); ui.encoderPosition = 0; ui.refresh(LCDVIEW_REDRAW_NOW); babystep.add_steps(axis, steps); } if (ui.should_draw()) { const float spm = planner.steps_to_mm[axis]; - draw_edit_screen(msg, ftostr54sign(spm * babystep.accum)); + MenuEditItemBase::draw_edit_screen(msg, ftostr54sign(spm * babystep.accum)); #if ENABLED(BABYSTEP_DISPLAY_TOTAL) const bool in_view = (true #if HAS_GRAPHICAL_LCD @@ -96,7 +79,8 @@ #else lcd_moveto(0, LCD_HEIGHT - 1); #endif - lcd_put_u8str_P(PSTR(MSG_BABYSTEP_TOTAL ":")); + lcd_put_u8str_P(GET_TEXT(MSG_BABYSTEP_TOTAL)); + lcd_put_wchar(':'); lcd_put_u8str(ftostr54sign(spm * babystep.axis_total[BS_TOTAL_AXIS(axis)])); } #endif @@ -110,33 +94,31 @@ } #if ENABLED(BABYSTEP_XY) - void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); } - void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEP_Y)); } - void lcd_babystep_x() { _lcd_babystep_go(_lcd_babystep_x); } - void lcd_babystep_y() { _lcd_babystep_go(_lcd_babystep_y); } + void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT(MSG_BABYSTEP_X)); } + void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT(MSG_BABYSTEP_Y)); } #endif #if DISABLED(BABYSTEP_ZPROBE_OFFSET) - void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEP_Z)); } - void lcd_babystep_z() { _lcd_babystep_go(_lcd_babystep_z); } + void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT(MSG_BABYSTEP_Z)); } + void lcd_babystep_z() { _lcd_babystep_go(_lcd_babystep_z); } #endif #endif // BABYSTEPPING void menu_tune() { START_MENU(); - MENU_BACK(MSG_MAIN); + BACK_ITEM(MSG_MAIN); // // Speed: // - MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999); + EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999); // // Manual bed leveling, Bed Z: // #if BOTH(MESH_BED_LEVELING, LCD_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); + EDIT_ITEM(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); #endif // @@ -144,34 +126,21 @@ void menu_tune() { // Nozzle [1-4]: // #if HOTENDS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, thermalManager.start_watching_E0); - #else // HOTENDS > 1 - #define EDIT_NOZZLE(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, thermalManager.start_watching_E##N) - EDIT_NOZZLE(0); - EDIT_NOZZLE(1); - #if HOTENDS > 2 - EDIT_NOZZLE(2); - #if HOTENDS > 3 - EDIT_NOZZLE(3); - #if HOTENDS > 4 - EDIT_NOZZLE(4); - #if HOTENDS > 5 - EDIT_NOZZLE(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, []{ thermalManager.start_watching_hotend(0); }); + #elif HOTENDS > 1 + #define EDIT_NOZZLE(N) EDIT_ITEM_FAST_N(int3, N, MSG_NOZZLE_N, &thermalManager.temp_hotend[N].target, 0, heater_maxtemp[N] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }) + HOTEND_LOOP() EDIT_NOZZLE(e); + #endif #if ENABLED(SINGLENOZZLE) - MENU_MULTIPLIER_ITEM_EDIT(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15); + EDIT_ITEM_FAST(uint16_3, MSG_NOZZLE_STANDBY, &singlenozzle_temp[active_extruder ? 0 : 1], 0, HEATER_0_MAXTEMP - 15); #endif // // Bed: // #if HAS_HEATED_BED - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed); + EDIT_ITEM_FAST(int3, MSG_BED, &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed); #endif // @@ -179,22 +148,31 @@ void menu_tune() { // #if FAN_COUNT > 0 #if HAS_FAN0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0); + editable.uint8 = thermalManager.fan_speed[0]; + EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); }); #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255); + EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255); #endif #endif - #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1); + #if HAS_FAN1 + editable.uint8 = thermalManager.fan_speed[1]; + EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255); + EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255); #endif + #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 1 + editable.uint8 = thermalManager.fan_speed[1]; + EDIT_ITEM_FAST_N(percent, 2, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); #endif - #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2); + #if HAS_FAN2 + editable.uint8 = thermalManager.fan_speed[2]; + EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255); + EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255); #endif + #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 2 + editable.uint8 = thermalManager.fan_speed[2]; + EDIT_ITEM_FAST_N(percent, 3, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); #endif #endif // FAN_COUNT > 0 @@ -203,25 +181,12 @@ void menu_tune() { // Flow [1-5]: // #if EXTRUDERS == 1 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); + EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, []{ planner.refresh_e_factor(0); }); #elif EXTRUDERS - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor); - #define EDIT_FLOW(N) MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_LCD_N##N, &planner.flow_percentage[N], 10, 999, _lcd_refresh_e_factor_##N) - EDIT_FLOW(0); - EDIT_FLOW(1); - #if EXTRUDERS > 2 - EDIT_FLOW(2); - #if EXTRUDERS > 3 - EDIT_FLOW(3); - #if EXTRUDERS > 4 - EDIT_FLOW(4); - #if EXTRUDERS > 5 - EDIT_FLOW(5); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS + EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); }); + #define EDIT_FLOW(N) EDIT_ITEM_N(int3, N, MSG_FLOW_N, &planner.flow_percentage[N], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }) + for (uint8_t n = 0; n < EXTRUDERS; n++) EDIT_FLOW(n); + #endif // // Babystep X: @@ -230,13 +195,13 @@ void menu_tune() { // #if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEP_XY) - MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); - MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y); + SUBMENU(MSG_BABYSTEP_X, []{ _lcd_babystep_go(_lcd_babystep_x); }); + SUBMENU(MSG_BABYSTEP_Y, []{ _lcd_babystep_go(_lcd_babystep_y); }); #endif #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); + SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #else - MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z); + SUBMENU(MSG_BABYSTEP_Z, lcd_babystep_z); #endif #endif diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 2323804658b2..2290c838604d 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -37,10 +37,9 @@ static int16_t ubl_storage_slot = 0, custom_hotend_temp = 190, side_points = 3, ubl_fillin_amount = 5, - ubl_height_amount = 1, - n_edit_pts = 1, - x_plot = 0, - y_plot = 0; + ubl_height_amount = 1; + +static uint8_t n_edit_pts = 1, x_plot = 0, y_plot = 0; #if HAS_HEATED_BED static int16_t custom_bed_temp = 50; @@ -66,7 +65,7 @@ static void _lcd_mesh_fine_tune(PGM_P msg) { } if (ui.should_draw()) { - draw_edit_screen(msg, ftostr43sign(mesh_edit_value)); + MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(mesh_edit_value)); #if ENABLED(MESH_EDIT_GFX_OVERLAY) _lcd_zoffset_overlay_gfx(mesh_edit_value); #endif @@ -80,7 +79,7 @@ void _lcd_mesh_edit_NOP() { float lcd_mesh_edit() { ui.goto_screen(_lcd_mesh_edit_NOP); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - _lcd_mesh_fine_tune(PSTR("Mesh Editor")); + _lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDITOR)); return mesh_edit_value; } @@ -90,7 +89,7 @@ void lcd_mesh_edit_setup(const float &initial) { } void _lcd_z_offset_edit() { - _lcd_mesh_fine_tune(PSTR("Z-Offset: ")); + _lcd_mesh_fine_tune(GET_TEXT(MSG_UBL_Z_OFFSET)); } float lcd_z_offset_edit() { @@ -108,7 +107,7 @@ void lcd_z_offset_edit_setup(const float &initial) { */ void _lcd_ubl_build_custom_mesh() { char ubl_lcd_gcode[20]; - queue.inject_P(PSTR("G28")); + queue.inject_P(G28_STR); #if HAS_HEATED_BED sprintf_P(ubl_lcd_gcode, PSTR("M190 S%i"), custom_bed_temp); lcd_enqueue_one_now(ubl_lcd_gcode); @@ -128,12 +127,12 @@ void _lcd_ubl_build_custom_mesh() { */ void _lcd_ubl_custom_mesh() { START_MENU(); - MENU_BACK(MSG_UBL_BUILD_MESH_MENU); - MENU_ITEM_EDIT(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); + BACK_ITEM(MSG_UBL_BUILD_MESH_MENU); + EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 10)); + EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 10)); #endif - MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); + ACTION_ITEM(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); END_MENU(); } @@ -158,9 +157,9 @@ void _lcd_ubl_adjust_height_cmd() { */ void _menu_ubl_height_adjust() { START_MENU(); - MENU_BACK(MSG_EDIT_MESH); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_MESH_HEIGHT_AMOUNT, &ubl_height_amount, -9, 9, _lcd_ubl_adjust_height_cmd); - MENU_ITEM(function, MSG_WATCH, ui.return_to_status); + BACK_ITEM(MSG_EDIT_MESH); + EDIT_ITEM(int3, MSG_UBL_MESH_HEIGHT_AMOUNT, &ubl_height_amount, -9, 9, _lcd_ubl_adjust_height_cmd); + ACTION_ITEM(MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -175,11 +174,11 @@ void _menu_ubl_height_adjust() { */ void _lcd_ubl_edit_mesh() { START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM(gcode, MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(gcode, MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29 P4 T")); - MENU_ITEM(submenu, MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust); - MENU_ITEM(function, MSG_WATCH, ui.return_to_status); + BACK_ITEM(MSG_UBL_TOOLS); + GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); + GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29 P4 T")); + SUBMENU(MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust); + ACTION_ITEM(MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -196,7 +195,7 @@ void _lcd_ubl_validate_custom_mesh() { #endif ; sprintf_P(ubl_lcd_gcode, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp); - lcd_enqueue_one_now_P(PSTR("G28")); + lcd_enqueue_one_now_P(G28_STR); lcd_enqueue_one_now(ubl_lcd_gcode); } @@ -211,28 +210,19 @@ void _lcd_ubl_validate_custom_mesh() { */ void _lcd_ubl_validate_mesh() { START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); + BACK_ITEM(MSG_UBL_TOOLS); #if HAS_HEATED_BED - MENU_ITEM(gcode, MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - MENU_ITEM(gcode, MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); + GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); + GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); #else - MENU_ITEM(gcode, MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - MENU_ITEM(gcode, MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); + GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); + GCODES_ITEM(MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); #endif - MENU_ITEM(function, MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); - MENU_ITEM(function, MSG_WATCH, ui.return_to_status); + ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); + ACTION_ITEM(MSG_WATCH, ui.return_to_status); END_MENU(); } -/** - * UBL Grid Leveling Command - */ -void _lcd_ubl_grid_level_cmd() { - char ubl_lcd_gcode[12]; - sprintf_P(ubl_lcd_gcode, PSTR("G29 J%i"), side_points); - lcd_enqueue_one_now(ubl_lcd_gcode); -} - /** * UBL Grid Leveling submenu * @@ -242,9 +232,13 @@ void _lcd_ubl_grid_level_cmd() { */ void _lcd_ubl_grid_level() { START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM_EDIT(int3, MSG_UBL_SIDE_POINTS, &side_points, 2, 6); - MENU_ITEM(function, MSG_UBL_MESH_LEVEL, _lcd_ubl_grid_level_cmd); + BACK_ITEM(MSG_UBL_TOOLS); + EDIT_ITEM(int3, MSG_UBL_SIDE_POINTS, &side_points, 2, 6); + ACTION_ITEM(MSG_UBL_MESH_LEVEL, []{ + char ubl_lcd_gcode[12]; + sprintf_P(ubl_lcd_gcode, PSTR("G29 J%i"), side_points); + lcd_enqueue_one_now(ubl_lcd_gcode); + }); END_MENU(); } @@ -258,10 +252,10 @@ void _lcd_ubl_grid_level() { */ void _lcd_ubl_mesh_leveling() { START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM(gcode, MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29 J0")); - MENU_ITEM(submenu, MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); - MENU_ITEM(function, MSG_WATCH, ui.return_to_status); + BACK_ITEM(MSG_UBL_TOOLS); + GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29 J0")); + SUBMENU(MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); + ACTION_ITEM(MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -286,11 +280,11 @@ void _lcd_ubl_fillin_amount_cmd() { */ void _menu_ubl_fillin() { 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(gcode, MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0")); - MENU_ITEM(function, MSG_WATCH, ui.return_to_status); + BACK_ITEM(MSG_UBL_BUILD_MESH_MENU); + EDIT_ITEM(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); + GCODES_ITEM(MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); + GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0")); + ACTION_ITEM(MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -315,9 +309,9 @@ void _lcd_ubl_invalidate() { */ void _lcd_ubl_build_mesh() { START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); + BACK_ITEM(MSG_UBL_TOOLS); #if HAS_HEATED_BED - MENU_ITEM(gcode, MSG_UBL_BUILD_MESH_M1, PSTR( + GCODES_ITEM(MSG_UBL_BUILD_MESH_M1, PSTR( "G28\n" "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n" "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" @@ -325,7 +319,7 @@ void _lcd_ubl_build_mesh() { "M104 S0\n" "M140 S0" )); - MENU_ITEM(gcode, MSG_UBL_BUILD_MESH_M2, PSTR( + GCODES_ITEM(MSG_UBL_BUILD_MESH_M2, PSTR( "G28\n" "M190 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\n" "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" @@ -334,26 +328,26 @@ void _lcd_ubl_build_mesh() { "M140 S0" )); #else - MENU_ITEM(gcode, MSG_UBL_BUILD_MESH_M1, PSTR( + GCODES_ITEM(MSG_UBL_BUILD_MESH_M1, PSTR( "G28\n" "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" "G29 P1\n" "M104 S0" )); - MENU_ITEM(gcode, MSG_UBL_BUILD_MESH_M2, PSTR( + GCODES_ITEM(MSG_UBL_BUILD_MESH_M2, PSTR( "G28\n" "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" "G29 P1\n" "M104 S0" )); #endif - MENU_ITEM(submenu, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); - MENU_ITEM(gcode, MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - MENU_ITEM(submenu, MSG_UBL_FILLIN_MESH, _menu_ubl_fillin); - MENU_ITEM(gcode, MSG_UBL_CONTINUE_MESH, PSTR("G29 P1 C")); - MENU_ITEM(function, MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); - MENU_ITEM(gcode, MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29 I")); - MENU_ITEM(function, MSG_WATCH, ui.return_to_status); + SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); + GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); + SUBMENU(MSG_UBL_FILLIN_MESH, _menu_ubl_fillin); + GCODES_ITEM(MSG_UBL_CONTINUE_MESH, PSTR("G29 P1 C")); + ACTION_ITEM(MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); + GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29 I")); + ACTION_ITEM(MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -364,7 +358,7 @@ 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_one_now(ubl_lcd_gcode); - sprintf_P(ubl_lcd_gcode, PSTR("M117 " MSG_MESH_LOADED), ubl_storage_slot); + sprintf_P(ubl_lcd_gcode, GET_TEXT(MSG_MESH_LOADED), ubl_storage_slot); lcd_enqueue_one_now(ubl_lcd_gcode); } @@ -375,7 +369,7 @@ 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_one_now(ubl_lcd_gcode); - sprintf_P(ubl_lcd_gcode, PSTR("M117 " MSG_MESH_SAVED), ubl_storage_slot); + sprintf_P(ubl_lcd_gcode, GET_TEXT(MSG_MESH_SAVED), ubl_storage_slot); lcd_enqueue_one_now(ubl_lcd_gcode); } @@ -390,14 +384,14 @@ void _lcd_ubl_save_mesh_cmd() { void _lcd_ubl_storage_mesh() { int16_t a = settings.calc_num_meshes(); START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); + BACK_ITEM(MSG_UBL_LEVEL_BED); if (!WITHIN(ubl_storage_slot, 0, a - 1)) { - STATIC_ITEM(MSG_NO_STORAGE); + STATIC_ITEM(MSG_UBL_NO_STORAGE); } else { - MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1); - MENU_ITEM(function, MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd); - MENU_ITEM(function, MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); + EDIT_ITEM(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1); + ACTION_ITEM(MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd); + ACTION_ITEM(MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); } END_MENU(); } @@ -421,9 +415,9 @@ void _lcd_ubl_map_homing() { */ void _lcd_ubl_map_lcd_edit_cmd() { 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); + dtostrf(ubl.mesh_index_to_xpos(x_plot), 0, 2, str); + dtostrf(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, int(n_edit_pts)); lcd_enqueue_one_now(ubl_lcd_gcode); } @@ -431,21 +425,19 @@ void _lcd_ubl_map_lcd_edit_cmd() { * UBL LCD Map Movement */ void ubl_map_move_to_xy() { - REMEMBER(fr, feedrate_mm_s, MMM_TO_MMS(XY_PROBE_SPEED)); + const feedRate_t fr_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); - set_destination_from_current(); // sync destination at the start + destination = current_position; // sync destination at the start #if ENABLED(DELTA) - if (current_position[Z_AXIS] > delta_clip_start_height) { - destination[Z_AXIS] = delta_clip_start_height; - prepare_move_to_destination(); + if (current_position.z > delta_clip_start_height) { + destination.z = delta_clip_start_height; + prepare_internal_move_to_destination(fr_mm_s); } #endif - destination[X_AXIS] = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]); - destination[Y_AXIS] = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]); - - prepare_move_to_destination(); + destination.set(ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot)); + prepare_internal_move_to_destination(fr_mm_s); } /** @@ -468,10 +460,9 @@ void _lcd_ubl_output_map_lcd() { static int16_t step_scaler = 0; if (ui.use_click()) return _lcd_ubl_map_lcd_edit_cmd(); - ui.encoder_direction_normal(); if (ui.encoderPosition) { - step_scaler += int16_t(ui.encoderPosition); + step_scaler += int32_t(ui.encoderPosition); x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM); ui.encoderPosition = 0; ui.refresh(LCDVIEW_REDRAW_NOW); @@ -493,9 +484,8 @@ void _lcd_ubl_output_map_lcd() { if (y_plot < 0) y_plot = GRID_MAX_POINTS_Y - 1; #if IS_KINEMATIC - const float x = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]), - y = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]); - if (position_is_reachable(x, y)) break; // Found a valid point + const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }; + if (position_is_reachable(xy)) break; // Found a valid point x_plot += (step_scaler < 0) ? -1 : 1; #endif @@ -529,7 +519,7 @@ void _lcd_ubl_output_map_lcd() { void _lcd_ubl_output_map_lcd_cmd() { if (!all_axes_known()) { set_all_unhomed(); - queue.inject_P(PSTR("G28")); + queue.inject_P(G28_STR); } ui.goto_screen(_lcd_ubl_map_homing); } @@ -545,11 +535,11 @@ void _lcd_ubl_output_map_lcd_cmd() { */ void _lcd_ubl_output_map() { START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29 T0")); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29 T1")); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29 S-1")); - MENU_ITEM(function, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map_lcd_cmd); + BACK_ITEM(MSG_UBL_LEVEL_BED); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29 T0")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29 T1")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29 S-1")); + ACTION_ITEM(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map_lcd_cmd); END_MENU(); } @@ -564,12 +554,12 @@ void _lcd_ubl_output_map() { */ void _menu_ubl_tools() { START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(submenu, MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); - MENU_ITEM(gcode, MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); - MENU_ITEM(submenu, MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(submenu, MSG_EDIT_MESH, _lcd_ubl_edit_mesh); - MENU_ITEM(submenu, MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling); + BACK_ITEM(MSG_UBL_LEVEL_BED); + SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); + GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); + SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); + SUBMENU(MSG_EDIT_MESH, _lcd_ubl_edit_mesh); + SUBMENU(MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling); END_MENU(); } @@ -587,14 +577,14 @@ void _menu_ubl_tools() { */ void _lcd_ubl_step_by_step() { 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(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); - MENU_ITEM(gcode, "6 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(function, "7 " MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); + BACK_ITEM(MSG_UBL_LEVEL_BED); + GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); + GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29 P3 T0")); + SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); + GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); + SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); + GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); + ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd); END_MENU(); } @@ -614,19 +604,20 @@ void _lcd_ubl_step_by_step() { void _lcd_ubl_level_bed() { START_MENU(); - MENU_BACK(MSG_MOTION); + BACK_ITEM(MSG_MOTION); if (planner.leveling_active) - MENU_ITEM(gcode, MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); + GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); else - MENU_ITEM(gcode, MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); - MENU_ITEM(submenu, MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); - MENU_ITEM(function, MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd); - MENU_ITEM(submenu, MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); - MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); - MENU_ITEM(submenu, MSG_UBL_TOOLS, _menu_ubl_tools); - MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W")); + GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); + SUBMENU(MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); + ACTION_ITEM(MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd); + SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); + SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); + SUBMENU(MSG_UBL_TOOLS, _menu_ubl_tools); + GCODES_ITEM(MSG_UBL_INFO_UBL, PSTR("G29 W")); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &lcd_z_fade_height, 0, 100, _lcd_set_z_fade_height); + editable.decimal = planner.z_fade_height; + EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); }); #endif END_MENU(); } diff --git a/Marlin/src/lcd/thermistornames.h b/Marlin/src/lcd/thermistornames.h index 61582ca396a9..17772d788045 100644 --- a/Marlin/src/lcd/thermistornames.h +++ b/Marlin/src/lcd/thermistornames.h @@ -19,7 +19,6 @@ * along with this program. If not, see . * */ -#pragma once /** * thermistornames.h @@ -37,6 +36,8 @@ #define THERMISTOR_NAME "User Parameters" // Thermcouples +#elif THERMISTOR_ID == -5 + #define THERMISTOR_NAME "MAX31865" #elif THERMISTOR_ID == -4 #define THERMISTOR_NAME "AD8495" #elif THERMISTOR_ID == -3 @@ -57,6 +58,10 @@ #define THERMISTOR_NAME "Generic 10K" #elif THERMISTOR_ID == 5 #define THERMISTOR_NAME "ATC 104GT-2" +#elif THERMISTOR_ID == 501 + #define THERMISTOR_NAME "Zonestar (Tronxy X3A)" +#elif THERMISTOR_ID == 512 + #define THERMISTOR_NAME "RPW-Ultra" #elif THERMISTOR_ID == 6 #define THERMISTOR_NAME "EPCOS (alt)" #elif THERMISTOR_ID == 7 @@ -75,10 +80,14 @@ #define THERMISTOR_NAME "E3104FXT (alt)" #elif THERMISTOR_ID == 13 #define THERMISTOR_NAME "Hisens 3950" +#elif THERMISTOR_ID == 15 + #define THERMISTOR_NAME "100k JGAurora A5" #elif THERMISTOR_ID == 18 #define THERMISTOR_NAME "ATC Semitec 204GT-2" #elif THERMISTOR_ID == 20 - #define THERMISTOR_NAME "PT100 UltiMB" + #define THERMISTOR_NAME "Pt100 UltiMB" +#elif THERMISTOR_ID == 201 + #define THERMISTOR_NAME "Pt100 OverLord" #elif THERMISTOR_ID == 60 #define THERMISTOR_NAME "Makers Tool" #elif THERMISTOR_ID == 70 @@ -98,13 +107,11 @@ #elif THERMISTOR_ID == 1010 #define THERMISTOR_NAME "PT1000 1K" #elif THERMISTOR_ID == 147 - #define THERMISTOR_NAME "PT100 4K7" + #define THERMISTOR_NAME "Pt100 4K7" #elif THERMISTOR_ID == 110 - #define THERMISTOR_NAME "PT100 1K" + #define THERMISTOR_NAME "Pt100 1K" #elif THERMISTOR_ID == 666 #define THERMISTOR_NAME "Einstart S" -#elif THERMISTOR_ID == 501 - #define THERMISTOR_NAME "Zonestar (Tronxy X3A)" // High Temperature thermistors #elif THERMISTOR_ID == 61 diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index d652d90abf43..e8176c1b1b66 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -26,42 +26,58 @@ #include "../feature/leds/leds.h" #endif +#if ENABLED(HOST_ACTION_COMMANDS) + #include "../feature/host_actions.h" +#endif + +#include "ultralcd.h" +MarlinUI ui; + // All displays share the MarlinUI class #if HAS_DISPLAY - #include "ultralcd.h" + #include "../gcode/queue.h" #include "fontutils.h" - MarlinUI ui; #include "../sd/cardreader.h" #if ENABLED(EXTENSIBLE_UI) #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) #endif - #if ENABLED(HOST_ACTION_COMMANDS) - #include "../feature/host_actions.h" - #endif #endif #if HAS_SPI_LCD #if ENABLED(STATUS_MESSAGE_SCROLLING) uint8_t MarlinUI::status_scroll_offset; // = 0 - #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 + constexpr uint8_t MAX_MESSAGE_LENGTH = _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH)); #else - #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) + constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH); #endif #elif ENABLED(EXTENSIBLE_UI) - #define MAX_MESSAGE_LENGTH 63 + constexpr uint8_t MAX_MESSAGE_LENGTH = 63; #endif -#ifdef MAX_MESSAGE_LENGTH +#if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI) uint8_t MarlinUI::alert_level; // = 0 char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; #endif #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t MarlinUI::progress_bar_percent; // = 0 + MarlinUI::progress_t MarlinUI::progress_override; // = 0 + #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) + uint32_t MarlinUI::remaining_time; + #endif +#endif + +#if ENABLED(PCA9632_BUZZER) || USE_BEEPER + #include "../libs/buzzer.h" // for BUZZ() macro + #if ENABLED(PCA9632_BUZZER) + #include "../feature/leds/pca9632.h" + #endif + void MarlinUI::buzz(const long duration, const uint16_t freq) { + #if ENABLED(PCA9632_BUZZER) + pca9632_buzz(duration, freq); + #elif USE_BEEPER + buzzer.tone(duration, freq); + #endif + } #endif #if HAS_SPI_LCD @@ -77,7 +93,6 @@ #include "../module/planner.h" #include "../module/printcounter.h" #include "../module/motion.h" -#include "../gcode/queue.h" #include "../Marlin.h" @@ -89,19 +104,22 @@ #include "../feature/bedlevel/bedlevel.h" #endif -#if HAS_BUZZER - #include "../libs/buzzer.h" -#endif - #if HAS_TRINAMIC #include "../feature/tmc_util.h" #endif +#if HAS_ADC_BUTTONS + #include "../module/thermistor/thermistors.h" +#endif + #if HAS_ENCODER_ACTION volatile uint8_t MarlinUI::buttons; #if HAS_SLOW_BUTTONS volatile uint8_t MarlinUI::slow_buttons; #endif + #if ENABLED(TOUCH_BUTTONS) + #include "../feature/touch/xpt2046.h" + #endif #endif #if ENABLED(INIT_SDCARD_ON_BOOT) @@ -118,7 +136,7 @@ uint8_t MarlinUI::lcd_status_update_delay = 1; // First update one loop delayed millis_t MarlinUI::next_filament_display; // = 0 #endif -millis_t next_button_update_ms; +millis_t MarlinUI::next_button_update_ms; // = 0 #if HAS_GRAPHICAL_LCD bool MarlinUI::drawing_screen, MarlinUI::first_page; // = false @@ -126,7 +144,7 @@ millis_t next_button_update_ms; // Encoder Handling #if HAS_ENCODER_ACTION - uint16_t MarlinUI::encoderPosition; + uint32_t MarlinUI::encoderPosition; volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update #endif @@ -166,6 +184,7 @@ millis_t next_button_update_ms; #endif screenFunc_t MarlinUI::currentScreen; // Initialized in CTOR + bool MarlinUI::screen_changed; #if ENABLED(ENCODER_RATE_MULTIPLIER) bool MarlinUI::encoderRateMultiplierEnabled; @@ -176,8 +195,13 @@ millis_t next_button_update_ms; } #endif - #if ENABLED(REVERSE_MENU_DIRECTION) - int8_t MarlinUI::encoderDirection = 1; + #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION) + int8_t MarlinUI::encoderDirection = ENCODERBASE; + #endif + + #if ENABLED(TOUCH_BUTTONS) + uint8_t MarlinUI::touch_buttons; + uint8_t MarlinUI::repeat_delay; #endif bool MarlinUI::lcd_clicked; @@ -200,13 +224,13 @@ millis_t next_button_update_ms; #endif - void _wrap_string(uint8_t &x, uint8_t &y, const char * const string, read_byte_cb_t cb_read_byte, bool wordwrap/*=false*/) { - SETCURSOR(x, y); + void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, bool wordwrap/*=false*/) { + SETCURSOR(col, row); if (!string) return; - auto _newline = [&x, &y]() { - x = 0; y++; // move x to string len (plus space) - SETCURSOR(0, y); // simulate carriage return + auto _newline = [&col, &row]() { + col = 0; row++; // Move col to string len (plus space) + SETCURSOR(0, row); // Simulate carriage return }; uint8_t *p = (uint8_t*)string; @@ -222,9 +246,9 @@ millis_t next_button_update_ms; if (eol || ch == ' ' || ch == '-' || ch == '+' || ch == '.') { if (!c && ch == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces // Past the right and the word is not too long? - if (x + c > LCD_WIDTH && x >= (LCD_WIDTH) / 4) _newline(); // should it wrap? + if (col + c > LCD_WIDTH && col >= (LCD_WIDTH) / 4) _newline(); // should it wrap? c += !eol; // +1 so the space will be printed - x += c; // advance x to new position + col += c; // advance col to new position while (c) { // character countdown --c; // count down to zero wrd = get_utf8_value_cb(wrd, cb_read_byte, &ch); // get characters again @@ -241,25 +265,25 @@ millis_t next_button_update_ms; p = get_utf8_value_cb(p, cb_read_byte, &ch); if (!ch) break; lcd_put_wchar(ch); - x++; - if (x >= LCD_WIDTH) _newline(); + col++; + if (col >= LCD_WIDTH) _newline(); } } } void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0; - uint8_t x = 0, y = 0; + uint8_t col = 0, row = 0; if (!string && plen + slen <= LCD_WIDTH) { - x = (LCD_WIDTH - plen - slen) / 2; - y = LCD_HEIGHT > 3 ? 1 : 0; + col = (LCD_WIDTH - plen - slen) / 2; + row = LCD_HEIGHT > 3 ? 1 : 0; } - wrap_string_P(x, y, pref, true); + wrap_string_P(col, row, pref, true); if (string) { - if (x) { x = 0; y++; } // Move to the start of the next line - wrap_string(x, y, string); + if (col) { col = 0; row++; } // Move to the start of the next line + wrap_string(col, row, string); } - if (suff) wrap_string_P(x, y, suff); + if (suff) wrap_string_P(col, row, suff); } #endif // HAS_LCD_MENU @@ -280,6 +304,10 @@ void MarlinUI::init() { SET_INPUT_PULLUP(BTN_ENC); #endif + #if BUTTON_EXISTS(BACK) + SET_INPUT_PULLUP(BTN_BACK); + #endif + #if BUTTON_EXISTS(UP) SET_INPUT(BTN_UP); #endif @@ -324,8 +352,10 @@ void MarlinUI::init() { #endif #endif - #if HAS_ENCODER_ACTION && HAS_SLOW_BUTTONS - slow_buttons = 0; + #if HAS_ENCODER_ACTION + #if HAS_SLOW_BUTTONS + slow_buttons = 0; + #endif #endif update_buttons(); @@ -382,7 +412,7 @@ bool MarlinUI::get_blink() { #if HAS_ENCODER_ACTION refresh(LCDVIEW_REDRAW_NOW); #if HAS_LCD_MENU - if (encoderDirection == -1) { // ADC_KEYPAD forces REVERSE_MENU_DIRECTION, so this indicates menu navigation + if (encoderDirection == -(ENCODERBASE)) { // ADC_KEYPAD forces REVERSE_MENU_DIRECTION, so this indicates menu navigation if (RRK(EN_KEYPAD_UP)) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; else if (RRK(EN_KEYPAD_DOWN)) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; else if (RRK(EN_KEYPAD_LEFT)) { MenuItem_back::action(); quick_feedback(); } @@ -443,7 +473,7 @@ bool MarlinUI::get_blink() { #endif // HAS_LCD_MENU - if (!homed && RRK(EN_KEYPAD_F1)) queue.inject_P(PSTR("G28")); + if (!homed && RRK(EN_KEYPAD_F1)) queue.inject_P(G28_STR); return true; } @@ -470,7 +500,6 @@ bool MarlinUI::get_blink() { void MarlinUI::status_screen() { #if HAS_LCD_MENU - encoder_direction_normal(); ENCODER_RATE_MULTIPLY(false); #endif @@ -499,7 +528,7 @@ void MarlinUI::status_screen() { if (expire_status_ms > 0) { // Expire the message if a job is active and the bar has ticks - if (get_progress() > 2 && !print_job_timer.isPaused()) { + if (get_progress_percent() > 2 && !print_job_timer.isPaused()) { if (ELAPSED(ms, expire_status_ms)) { status_message[0] = '\0'; expire_status_ms = 0; @@ -529,7 +558,7 @@ void MarlinUI::status_screen() { return; } - #endif // HAS_LCD_MENU + #endif #if ENABLED(ULTIPANEL_FEEDMULTIPLY) @@ -548,18 +577,18 @@ void MarlinUI::status_screen() { else if ((old_frm < 100 && new_frm > 100) || (old_frm > 100 && new_frm < 100)) new_frm = 100; - new_frm = constrain(new_frm, 10, 999); + LIMIT(new_frm, 10, 999); if (old_frm != new_frm) { feedrate_percentage = new_frm; encoderPosition = 0; - #if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #if HAS_BUZZER && ENABLED(BEEP_ON_FEEDRATE_CHANGE) static millis_t next_beep; #ifndef GOT_MS const millis_t ms = millis(); #endif if (ELAPSED(ms, next_beep)) { - BUZZ(FEEDRATE_CHANGE_BEEP_DURATION, FEEDRATE_CHANGE_BEEP_FREQUENCY); + buzz(FEEDRATE_CHANGE_BEEP_DURATION, FEEDRATE_CHANGE_BEEP_FREQUENCY); next_beep = ms + 500UL; } #endif @@ -570,16 +599,19 @@ void MarlinUI::status_screen() { draw_status_screen(); } -void MarlinUI::kill_screen(PGM_P lcd_msg) { +void MarlinUI::kill_screen(PGM_P lcd_error, PGM_P lcd_component) { init(); - set_alert_status_P(lcd_msg); + status_printf_P(1, PSTR(S_FMT ": " S_FMT), lcd_error, lcd_component); + #if HAS_LCD_MENU + return_to_status(); + #endif // RED ALERT. RED ALERT. #ifdef LED_BACKLIGHT_TIMEOUT leds.set_color(LEDColorRed()); #ifdef NEOPIXEL_BKGD_LED_INDEX - pixels.setPixelColor(NEOPIXEL_BKGD_LED_INDEX, 255, 0, 0, 0); - pixels.show(); + neo.set_pixel_color(NEOPIXEL_BKGD_LED_INDEX, 255, 0, 0, 0); + neo.show(); #endif #endif @@ -599,14 +631,15 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { UNUSED(clear_buttons); #endif - // Buzz and wait. The delay is needed for buttons to settle! - buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - - #if HAS_LCD_MENU - #if ENABLED(LCD_USE_I2C_BUZZER) - delay(10); - #elif PIN_EXISTS(BEEPER) - for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } + #if HAS_BUZZER + // Buzz and wait. Is the delay needed for buttons to settle? + buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + #if HAS_LCD_MENU + #if USE_BEEPER + for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } + #else + delay(10); + #endif #endif #endif } @@ -641,18 +674,16 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { + const feedRate_t fr_mm_s = MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]); #if IS_KINEMATIC - const float old_feedrate = feedrate_mm_s; - feedrate_mm_s = MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]); - #if EXTRUDERS > 1 const int8_t old_extruder = active_extruder; if (manual_move_axis == E_AXIS) active_extruder = manual_move_e_index; #endif // Set movement on a single axis - set_destination_from_current(); + destination = current_position; destination[manual_move_axis] += manual_move_offset; // Reset for the next move @@ -664,17 +695,16 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { // 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. processing_manual_move = true; - prepare_move_to_destination(); // will call set_current_from_destination() + prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination processing_manual_move = false; - feedrate_mm_s = old_feedrate; #if EXTRUDERS > 1 active_extruder = old_extruder; #endif #else - planner.buffer_line(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(current_position, fr_mm_s, manual_move_axis == E_AXIS ? manual_move_e_index : active_extruder); manual_move_axis = (int8_t)NO_AXIS; #endif @@ -718,32 +748,25 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { LCDViewAction MarlinUI::lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; -bool MarlinUI::detected() { - return - #if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE) - lcd.LcdDetected() == 1 - #else - true - #endif - ; -} - void MarlinUI::update() { static uint16_t max_display_update_time = 0; static millis_t next_lcd_update_ms; millis_t ms = millis(); + #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS + static millis_t return_to_status_ms = 0; + #define RESET_STATUS_TIMEOUT() (return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS) + #else + #define RESET_STATUS_TIMEOUT() NOOP + #endif + #ifdef LED_BACKLIGHT_TIMEOUT leds.update_timeout(powersupply_on); #endif #if HAS_LCD_MENU - #if LCD_TIMEOUT_TO_STATUS - static millis_t return_to_status_ms = 0; - #endif - // Handle any queued Move Axis motion manage_manual_move(); @@ -752,28 +775,62 @@ void MarlinUI::update() { update_buttons(); // If the action button is pressed... - static bool wait_for_unclick; // = 0 - if (!external_control && button_pressed()) { - 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 - wait_for_user = false; // - Any click clears wait for user - quick_feedback(); // - Always make a click sound + static bool wait_for_unclick; // = false + + #if ENABLED(TOUCH_BUTTONS) + + if (touch_buttons) { + RESET_STATUS_TIMEOUT(); + if (buttons & (EN_A | EN_B)) { // Menu arrows, in priority + if (ELAPSED(ms, next_button_update_ms)) { + encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP) * encoderDirection; + if (buttons & EN_A) encoderDiff *= -1; + next_button_update_ms = ms + repeat_delay; // Assume the repeat delay + if (!wait_for_unclick) { + next_button_update_ms += 250; // Longer delay on first press + wait_for_unclick = true; // Avoid Back/Select click while repeating + #if HAS_BUZZER + buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + #endif + } + } + } + else if (!wait_for_unclick && (buttons & EN_C)) { // OK button, 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 + wait_for_user = false; // - Any click clears wait for user + quick_feedback(); // - Always make a click sound + } } - } - else wait_for_unclick = false; - - #if HAS_DIGITAL_BUTTONS && BUTTON_EXISTS(BACK) - if (LCD_BACK_CLICKED()) { - quick_feedback(); - goto_previous_screen(); + else // keep wait_for_unclick value + + #endif // TOUCH_BUTTONS + + { + // Integrated LCD click handling via button_pressed + if (!external_control && button_pressed()) { + 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 + wait_for_user = false; // - Any click clears wait for user + quick_feedback(); // - Always make a click sound + } + } + else + wait_for_unclick = false; } - #endif + + if (LCD_BACK_CLICKED()) { + quick_feedback(); + goto_previous_screen(); + } #endif // HAS_LCD_MENU #if ENABLED(INIT_SDCARD_ON_BOOT) - + // + // SPI SD Card detection (and first card init when the LCD is present) + // const uint8_t sd_status = (uint8_t)IS_SD_INSERTED(); if (sd_status != lcd_sd_status && detected()) { @@ -782,18 +839,20 @@ void MarlinUI::update() { if (sd_status) { safe_delay(500); // Some boards need a delay to get settled - card.initsd(); + card.mount(); if (old_sd_status == 2) card.beginautostart(); // Initial boot else - set_status_P(PSTR(MSG_SD_INSERTED)); + set_status_P(GET_TEXT(MSG_MEDIA_INSERTED)); } #if PIN_EXISTS(SD_DETECT) else { card.release(); if (old_sd_status != 2) { - set_status_P(PSTR(MSG_SD_REMOVED)); - if (!on_status_screen()) return_to_status(); + set_status_P(GET_TEXT(MSG_MEDIA_REMOVED)); + #if HAS_LCD_MENU + return_to_status(); + #endif } } @@ -823,6 +882,16 @@ void MarlinUI::update() { next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; + #if ENABLED(TOUCH_BUTTONS) + + if (on_status_screen()) next_lcd_update_ms += (LCD_UPDATE_INTERVAL) * 2; + + #if HAS_ENCODER_ACTION + touch_buttons = touch.read_buttons(); + #endif + + #endif + #if ENABLED(LCD_HAS_STATUS_INDICATORS) update_indicators(); #endif @@ -834,13 +903,7 @@ void MarlinUI::update() { #endif #if ENABLED(REPRAPWORLD_KEYPAD) - - if (handle_keypad()) { - #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - #endif - } - + if (handle_keypad()) RESET_STATUS_TIMEOUT(); #endif const float abs_diff = ABS(encoderDiff); @@ -886,9 +949,7 @@ void MarlinUI::update() { encoderDiff = 0; } - #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - #endif + RESET_STATUS_TIMEOUT(); refresh(LCDVIEW_REDRAW_NOW); @@ -914,16 +975,14 @@ void MarlinUI::update() { #if HAS_LCD_MENU && 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 == menu_sdcard && !lcd_status_update_delay--) { + if (currentScreen == menu_media && !lcd_status_update_delay--) { lcd_status_update_delay = 4; if (++filename_scroll_pos > filename_scroll_max) { filename_scroll_pos = 0; lcd_status_update_delay = 12; } refresh(LCDVIEW_REDRAW_NOW); - #if LCD_TIMEOUT_TO_STATUS - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - #endif + RESET_STATUS_TIMEOUT(); } #endif @@ -974,7 +1033,8 @@ void MarlinUI::update() { // 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); + if (on_status_screen()) + NOLESS(max_display_update_time, millis() - ms); return; } } @@ -991,13 +1051,14 @@ void MarlinUI::update() { // 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); + if (on_status_screen()) + NOLESS(max_display_update_time, millis() - ms); } #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS // Return to Status Screen after a timeout if (on_status_screen() || defer_return_to_status) - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; + RESET_STATUS_TIMEOUT(); else if (ELAPSED(ms, return_to_status_ms)) return_to_status(); #endif @@ -1047,31 +1108,33 @@ void MarlinUI::update() { #endif // Calculate the ADC value for the voltage divider with specified pull-down resistor value - #define ADC_BUTTON_VALUE(r) (int(4096.0 * (ADC_BUTTONS_VALUE_SCALE) * r / (r + ADC_BUTTONS_R_PULLUP))) + #define ADC_BUTTON_VALUE(r) int(HAL_ADC_RANGE * (ADC_BUTTONS_VALUE_SCALE) * r / (r + ADC_BUTTONS_R_PULLUP)) + static constexpr uint16_t adc_button_tolerance = HAL_ADC_RANGE * 25 / 1024, + adc_other_button = HAL_ADC_RANGE * 1000 / 1024; static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { // VALUE_MIN, VALUE_MAX, KEY - { 4000, 4096, 1 + BLEN_KEYPAD_F1 }, // F1 - { 4000, 4096, 1 + BLEN_KEYPAD_F2 }, // F2 - { 4000, 4096, 1 + BLEN_KEYPAD_F3 }, // F3 - { ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN) - 100, - ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN) + 100, 1 + BLEN_KEYPAD_LEFT }, // LEFT ( 272 ... 472) - { ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN) - 100, - ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN) + 100, 1 + BLEN_KEYPAD_RIGHT }, // RIGHT (1948 ... 2148) - { ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN) - 100, - ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN) + 100, 1 + BLEN_KEYPAD_UP }, // UP ( 618 ... 818) - { ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN) - 100, - ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN) + 100, 1 + BLEN_KEYPAD_DOWN }, // DOWN (2686 ... 2886) - { ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) - 100, - ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) + 100, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER (1205 ... 1405) + { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F1 }, // F1 + { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F2 }, // F2 + { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F3 }, // F3 + { ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN) - adc_button_tolerance, + ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_LEFT }, // LEFT ( 272 ... 472) + { ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN) - adc_button_tolerance, + ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_RIGHT }, // RIGHT (1948 ... 2148) + { ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN) - adc_button_tolerance, + ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_UP }, // UP ( 618 ... 818) + { ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN) - adc_button_tolerance, + ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_DOWN }, // DOWN (2686 ... 2886) + { ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) - adc_button_tolerance, + ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER (1205 ... 1405) }; - uint8_t get_ADC_keyValue(void) { + uint8_t get_ADC_keyValue() { if (thermalManager.ADCKey_count >= 16) { - const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw << 2; - thermalManager.current_ADCKey_raw = 1024; + const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw; + thermalManager.current_ADCKey_raw = HAL_ADC_RANGE; thermalManager.ADCKey_count = 0; - if (currentkpADCValue < 4000) + if (currentkpADCValue < adc_other_button) for (uint8_t i = 0; i < ADC_KEY_NUM; i++) { const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin), hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax); @@ -1176,13 +1239,19 @@ void MarlinUI::update() { #endif // UP || DWN || LFT || RT - buttons = newbutton + buttons = (newbutton #if HAS_SLOW_BUTTONS | slow_buttons #endif - ; + #if ENABLED(TOUCH_BUTTONS) && HAS_ENCODER_ACTION + | touch_buttons + #endif + ); + #elif HAS_ADC_BUTTONS + buttons = 0; + #endif #if HAS_ADC_BUTTONS @@ -1194,13 +1263,13 @@ void MarlinUI::update() { #if HAS_SHIFT_ENCODER - GET_SHIFT_BUTTON_STATES( + GET_SHIFT_BUTTON_STATES(( #if ENABLED(REPRAPWORLD_KEYPAD) keypad_buttons #else buttons #endif - ); + )); #endif @@ -1239,23 +1308,6 @@ void MarlinUI::update() { #endif // HAS_ENCODER_WHEEL } - #if HAS_SLOW_BUTTONS - - uint8_t MarlinUI::read_slow_buttons() { - #if ENABLED(LCD_I2C_TYPE_MCP23017) - // Reading these buttons this is likely to be too slow to call inside interrupt context - // so they are called during normal lcd_update - uint8_t slow_bits = lcd.readButtons() << B_I2C_BTN_OFFSET; - #if ENABLED(LCD_I2C_VIKI) - if ((slow_bits & (B_MI | B_RI)) && PENDING(millis(), next_button_update_ms)) // LCD clicked - slow_bits &= ~(B_MI | B_RI); // Disable LCD clicked buttons if screen is updated - #endif // LCD_I2C_VIKI - return slow_bits; - #endif // LCD_I2C_TYPE_MCP23017 - } - - #endif - #endif // HAS_ENCODER_ACTION #endif // HAS_SPI_LCD @@ -1309,8 +1361,6 @@ void MarlinUI::update() { #if ENABLED(EXTENSIBLE_UI) ExtUI::onStatusChanged(status_message); #endif - - refresh(); } bool MarlinUI::has_status() { return (status_message[0] != '\0'); } @@ -1318,6 +1368,10 @@ void MarlinUI::update() { void MarlinUI::set_status(const char * const message, const bool persist) { if (alert_level) return; + #if ENABLED(HOST_PROMPT_SUPPORT) + host_action_notify(message); + #endif + // 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! @@ -1357,6 +1411,10 @@ void MarlinUI::update() { if (level < alert_level) return; alert_level = level; + #if ENABLED(HOST_PROMPT_SUPPORT) + host_action_notify(message); + #endif + // Since the message is encoded in UTF8 it must // only be cut on a character boundary. @@ -1385,15 +1443,17 @@ void MarlinUI::update() { #endif } + #include "../Marlin.h" #include "../module/printcounter.h" + PGM_P print_paused = GET_TEXT(MSG_PRINT_PAUSED); + /** * Reset the status message */ void MarlinUI::reset_status() { - static const char paused[] PROGMEM = MSG_PRINT_PAUSED; - static const char printing[] PROGMEM = MSG_PRINTING; - static const char welcome[] PROGMEM = WELCOME_MSG; + PGM_P printing = GET_TEXT(MSG_PRINTING); + PGM_P welcome = GET_TEXT(WELCOME_MSG); #if SERVICE_INTERVAL_1 > 0 static const char service1[] PROGMEM = { "> " SERVICE_NAME_1 "!" }; #endif @@ -1404,8 +1464,8 @@ void MarlinUI::update() { static const char service3[] PROGMEM = { "> " SERVICE_NAME_3 "!" }; #endif PGM_P msg; - if (!IS_SD_PRINTING() && print_job_timer.isPaused()) - msg = paused; + if (printingIsPaused()) + msg = print_paused; #if ENABLED(SDSUPPORT) else if (IS_SD_PRINTING()) return set_status(card.longest_filename(), true); @@ -1442,11 +1502,11 @@ void MarlinUI::update() { host_action_cancel(); #endif #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("UI Abort")); + host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), PSTR("Dismiss")); #endif print_job_timer.stop(); - set_status_P(PSTR(MSG_PRINT_ABORTED)); - #if HAS_SPI_LCD + set_status_P(GET_TEXT(MSG_PRINT_ABORTED)); + #if HAS_LCD_MENU return_to_status(); #endif } @@ -1457,7 +1517,7 @@ void MarlinUI::update() { void MarlinUI::pause_print() { #if HAS_LCD_MENU - synchronize(PSTR(MSG_PAUSE_PRINT)); + synchronize(GET_TEXT(MSG_PAUSE_PRINT)); #endif #if ENABLED(POWER_LOSS_RECOVERY) @@ -1468,7 +1528,7 @@ void MarlinUI::update() { host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume")); #endif - set_status_P(PSTR(MSG_PRINT_PAUSED)); + set_status_P(print_paused); #if ENABLED(PARK_HEAD_ON_PAUSE) #if HAS_SPI_LCD @@ -1487,9 +1547,7 @@ void MarlinUI::update() { #if ENABLED(PARK_HEAD_ON_PAUSE) wait_for_heatup = wait_for_user = false; #endif - #if ENABLED(SDSUPPORT) - if (card.isPaused()) queue.inject_P(PSTR("M24")); - #endif + if (IS_SD_PAUSED()) queue.inject_P(M24_STR); #ifdef ACTION_ON_RESUME host_action_resume(); #endif @@ -1497,17 +1555,54 @@ void MarlinUI::update() { } #if HAS_PRINT_PROGRESS - uint8_t MarlinUI::get_progress() { + + MarlinUI::progress_t MarlinUI::_get_progress() { #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t &progress = progress_bar_percent; + const progress_t p = progress_override & PROGRESS_MASK; #else - uint8_t progress = 0; - #endif - #if ENABLED(SDSUPPORT) - if (IS_SD_PRINTING()) progress = card.percentDone(); + constexpr progress_t p = 0; #endif - return progress; + return (p + #if ENABLED(SDSUPPORT) + #if HAS_PRINT_PROGRESS_PERMYRIAD + ?: card.permyriadDone() + #else + ?: card.percentDone() + #endif + #endif + ); } + #endif -#endif // HAS_DISPLAY +#else // !HAS_DISPLAY + + // + // Send the status line as a host notification + // + + void MarlinUI::set_status(const char * const message, const bool) { + #if ENABLED(HOST_PROMPT_SUPPORT) + host_action_notify(message); + #else + UNUSED(message); + #endif + } + + void MarlinUI::set_status_P(PGM_P message, const int8_t) { + #if ENABLED(HOST_PROMPT_SUPPORT) + host_action_notify(message); + #else + UNUSED(message); + #endif + } + + void MarlinUI::status_printf_P(const uint8_t, PGM_P const message, ...) { + #if ENABLED(HOST_PROMPT_SUPPORT) + host_action_notify(message); + #else + UNUSED(message); + #endif + } + +#endif // !HAS_DISPLAY diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 5a63f67e8784..71e820e57fb5 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -27,10 +27,10 @@ #include "../libs/buzzer.h" #endif -#define HAS_DIGITAL_BUTTONS (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL) || BUTTON_EXISTS(EN1, EN2) || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT)) -#define HAS_SHIFT_ENCODER (!HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_SPI_LCD && DISABLED(NEWPANEL)))) -#define HAS_ENCODER_WHEEL ((!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTON_EXISTS(EN1, EN2)) #define HAS_ENCODER_ACTION (HAS_LCD_MENU || ENABLED(ULTIPANEL_FEEDMULTIPLY)) +#define HAS_ENCODER_WHEEL ((!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTON_EXISTS(EN1, EN2)) +#define HAS_DIGITAL_BUTTONS (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT)) +#define HAS_SHIFT_ENCODER (!HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_SPI_LCD && DISABLED(NEWPANEL)))) // I2C buttons must be read in the main thread #define HAS_SLOW_BUTTONS EITHER(LCD_I2C_VIKI, LCD_I2C_PANELOLU2) @@ -56,27 +56,27 @@ uint8_t get_ADC_keyValue(); #endif - #define LCD_UPDATE_INTERVAL 100 + #if ENABLED(TOUCH_BUTTONS) + #define LCD_UPDATE_INTERVAL 50 + #else + #define LCD_UPDATE_INTERVAL 100 + #endif #if HAS_LCD_MENU #if HAS_GRAPHICAL_LCD #define SETCURSOR(col, row) lcd_moveto(col * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT)) #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT)) - #define LCDPRINT(p) u8g.print(p) - #define LCDWRITE(c) u8g.print(c) #else #define SETCURSOR(col, row) lcd_moveto(col, row) #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - (len), row) - #define LCDPRINT(p) lcd_put_u8str(p) - #define LCDWRITE(c) lcd_put_wchar(c) #endif - #include "fontutils.h" + #include "lcdprint.h" - void _wrap_string(uint8_t &x, uint8_t &y, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); - inline void wrap_string_P(uint8_t &x, uint8_t &y, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(x, y, pstr, read_byte_rom, wordwrap); } - inline void wrap_string(uint8_t &x, uint8_t &y, const char * const string, const bool wordwrap=false) { _wrap_string(x, y, string, read_byte_ram, wordwrap); } + void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false); + inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); } + inline void wrap_string(uint8_t &col, uint8_t &row, const char * const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); } #if ENABLED(SDSUPPORT) #include "../sd/cardreader.h" @@ -86,13 +86,12 @@ typedef void (*menuAction_t)(); // Manual Movement - constexpr float manual_feedrate_mm_m[XYZE] = MANUAL_FEEDRATE; extern float move_menu_scale; #if ENABLED(ADVANCED_PAUSE_FEATURE) void lcd_pause_show_message(const PauseMessage message, - const PauseMode mode=PAUSE_MODE_SAME, - const uint8_t extruder=active_extruder); + const PauseMode mode=PAUSE_MODE_SAME, + const uint8_t extruder=active_extruder); #endif #if ENABLED(AUTO_BED_LEVELING_UBL) @@ -147,13 +146,15 @@ #define BUTTON_PRESSED(BN) !READ(BTN_## BN) - #if BUTTON_EXISTS(ENC) + #if BUTTON_EXISTS(ENC) || ENABLED(TOUCH_BUTTONS) #define BLEN_C 2 #define EN_C _BV(BLEN_C) #endif #if ENABLED(LCD_I2C_VIKI) + #include + #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' @@ -211,7 +212,7 @@ #endif -#if BUTTON_EXISTS(BACK) +#if BUTTON_EXISTS(BACK) || ENABLED(TOUCH_BUTTONS) #define BLEN_D 3 #define EN_D _BV(BLEN_D) #define LCD_BACK_CLICKED() (buttons & EN_D) @@ -254,15 +255,13 @@ class MarlinUI { #endif } - static inline void 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 HAS_BUZZER + static void buzz(const long duration, const uint16_t freq); + #endif + + #if ENABLED(LCD_HAS_STATUS_INDICATORS) + static void update_indicators(); + #endif // LCD implementations static void clear_lcd(); @@ -272,7 +271,7 @@ class MarlinUI { static void init(); static void update(); - static void set_alert_status_P(PGM_P message); + static void set_alert_status_P(PGM_P const message); static char status_message[]; static bool has_status(); @@ -291,25 +290,55 @@ class MarlinUI { static void resume_print(); #if HAS_PRINT_PROGRESS + #if HAS_PRINT_PROGRESS_PERMYRIAD + typedef uint16_t progress_t; + #define PROGRESS_SCALE 100U + #define PROGRESS_MASK 0x7FFF + #else + typedef uint8_t progress_t; + #define PROGRESS_SCALE 1U + #define PROGRESS_MASK 0x7F + #endif #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - static uint8_t progress_bar_percent; - static void set_progress(const uint8_t progress) { progress_bar_percent = _MIN(progress, 100); } + static progress_t progress_override; + static void set_progress(const progress_t p) { progress_override = _MIN(p, 100U * (PROGRESS_SCALE)); } + static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); } + static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); } + #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME) + static uint32_t remaining_time; + FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; } + FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time; } + FORCE_INLINE static void reset_remaining_time() { set_remaining_time(0); } + #endif #endif - static uint8_t get_progress(); + static progress_t _get_progress(); + #if HAS_PRINT_PROGRESS_PERMYRIAD + FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); } + #endif + static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); } #else - static constexpr uint8_t get_progress() { return 0; } + static constexpr uint8_t get_progress_percent() { return 0; } #endif #if HAS_SPI_LCD + static millis_t next_button_update_ms; + static bool detected(); static LCDViewAction lcdDrawUpdate; - static inline bool should_draw() { return bool(lcdDrawUpdate); } - static inline void refresh(const LCDViewAction type) { lcdDrawUpdate = type; } - static inline void refresh() { refresh(LCDVIEW_CLEAR_CALL_REDRAW); } + FORCE_INLINE static bool should_draw() { return bool(lcdDrawUpdate); } + FORCE_INLINE static void refresh(const LCDViewAction type) { lcdDrawUpdate = type; } + FORCE_INLINE static void refresh() { refresh(LCDVIEW_CLEAR_CALL_REDRAW); } + + #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + static void draw_custom_bootscreen(const uint8_t frame=0); + static void show_custom_bootscreen(); + #endif #if ENABLED(SHOW_BOOTSCREEN) + static void draw_marlin_bootscreen(const bool line2=false); + static void show_marlin_bootscreen(); static void show_bootscreen(); #endif @@ -329,8 +358,8 @@ class MarlinUI { static millis_t progress_bar_ms; // Start time for the current progress bar cycle static void draw_progress_bar(const uint8_t percent); #if PROGRESS_MSG_EXPIRE > 0 - static millis_t MarlinUI::expire_status_ms; // = 0 - static inline void reset_progress_bar_timeout() { expire_status_ms = 0; } + static millis_t expire_status_ms; // = 0 + FORCE_INLINE static void reset_progress_bar_timeout() { expire_status_ms = 0; } #endif #endif @@ -341,7 +370,7 @@ class MarlinUI { #if HAS_LCD_CONTRAST static int16_t contrast; static void set_contrast(const int16_t value); - static inline void refresh_contrast() { set_contrast(contrast); } + FORCE_INLINE static void refresh_contrast() { set_contrast(contrast); } #endif #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) @@ -349,7 +378,9 @@ class MarlinUI { #endif static void quick_feedback(const bool clear_buttons=true); - static void completion_feedback(const bool good=true); + #if HAS_BUZZER + static void completion_feedback(const bool good=true); + #endif #if DISABLED(LIGHTWEIGHT_UI) static void draw_status_message(const bool blink); @@ -366,7 +397,7 @@ class MarlinUI { #endif static bool get_blink(); - static void kill_screen(PGM_P const lcd_msg); + static void kill_screen(PGM_P const lcd_error, PGM_P const lcd_component); static void draw_kill_screen(); static void set_status(const char* const message, const bool persist=false); static void set_status_P(PGM_P const message, const int8_t level=0); @@ -375,13 +406,16 @@ class MarlinUI { #else // No LCD + // Send status to host as a notification + void set_status(const char* message, const bool=false); + void set_status_P(PGM_P message, const int8_t=0); + void status_printf_P(const uint8_t, PGM_P message, ...); + static inline void init() {} static inline void update() {} static inline void refresh() {} - static inline void set_alert_status_P(PGM_P message) { UNUSED(message); } - static inline void set_status(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); } - static inline void set_status_P(PGM_P const message, const int8_t level=0) { UNUSED(message); UNUSED(level); } - static inline void status_printf_P(const uint8_t level, PGM_P const fmt, ...) { UNUSED(level); UNUSED(fmt); } + static inline void return_to_status() {} + static inline void set_alert_status_P(PGM_P const) {} static inline void reset_status() {} static inline void reset_alert_level() {} static constexpr bool has_status() { return false; } @@ -390,6 +424,11 @@ class MarlinUI { #if HAS_LCD_MENU + #if ENABLED(TOUCH_BUTTONS) + static uint8_t touch_buttons; + static uint8_t repeat_delay; + #endif + #if ENABLED(ENCODER_RATE_MULTIPLIER) static bool encoderRateMultiplierEnabled; static millis_t lastEncoderMovementMillis; @@ -418,6 +457,11 @@ class MarlinUI { static int16_t preheat_hotend_temp[2], preheat_bed_temp[2]; static uint8_t preheat_fan_speed[2]; + // Select Screen (modal NO/YES style dialog) + static bool selection; + static void set_selection(const bool sel) { selection = sel; } + static bool update_selection(); + static void manage_manual_move(); static bool lcd_clicked; @@ -426,18 +470,30 @@ class MarlinUI { static void synchronize(PGM_P const msg=nullptr); static screenFunc_t currentScreen; + static bool screen_changed; static void goto_screen(const screenFunc_t screen, const uint16_t encoder=0, const uint8_t top=0, const uint8_t items=0); static void save_previous_screen(); - static void goto_previous_screen(); + + // goto_previous_screen and go_back may also be used as menu item callbacks + #if ENABLED(TURBO_BACK_MENU_ITEM) + static void _goto_previous_screen(const bool is_back); + static inline void goto_previous_screen() { _goto_previous_screen(false); } + static inline void go_back() { _goto_previous_screen(true); } + #else + static void _goto_previous_screen(); + FORCE_INLINE static void goto_previous_screen() { _goto_previous_screen(); } + FORCE_INLINE static void go_back() { _goto_previous_screen(); } + #endif + static void return_to_status(); static inline bool on_status_screen() { return currentScreen == status_screen; } - static inline void run_current_screen() { (*currentScreen)(); } + FORCE_INLINE static void run_current_screen() { (*currentScreen)(); } #if ENABLED(LIGHTWEIGHT_UI) static void lcd_in_status(const bool inStatus); #endif - static inline void defer_status_screen(const bool defer=true) { + FORCE_INLINE static void defer_status_screen(const bool defer=true) { #if LCD_TIMEOUT_TO_STATUS defer_return_to_status = defer; #else @@ -455,11 +511,15 @@ class MarlinUI { #endif #if ENABLED(G26_MESH_VALIDATION) - static inline void chirp() { buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); } + FORCE_INLINE static void chirp() { + #if HAS_BUZZER + buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + #endif + } #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - static void ubl_plot(const uint8_t x, const uint8_t inverted_y); + static void ubl_plot(const uint8_t x_plot, const uint8_t y_plot); #endif static void draw_select_screen_prompt(PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr); @@ -468,7 +528,7 @@ class MarlinUI { static constexpr bool lcd_clicked = false; static constexpr bool on_status_screen() { return true; } - static inline void run_current_screen() { status_screen(); } + FORCE_INLINE static void run_current_screen() { status_screen(); } #endif @@ -497,29 +557,45 @@ class MarlinUI { static volatile uint8_t slow_buttons; static uint8_t read_slow_buttons(); #endif + static void update_buttons(); static inline bool button_pressed() { return BUTTON_CLICK(); } #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) static void wait_for_release(); #endif - static uint16_t encoderPosition; + static uint32_t encoderPosition; #if ENABLED(REVERSE_ENCODER_DIRECTION) #define ENCODERBASE -1 #else #define ENCODERBASE +1 #endif - #if ENABLED(REVERSE_MENU_DIRECTION) + + #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION) static int8_t encoderDirection; - static inline void encoder_direction_normal() { encoderDirection = +(ENCODERBASE); } - static inline void encoder_direction_menus() { encoderDirection = -(ENCODERBASE); } #else static constexpr int8_t encoderDirection = ENCODERBASE; - static inline void encoder_direction_normal() {} - static inline void encoder_direction_menus() {} #endif + FORCE_INLINE static void encoder_direction_normal() { + #if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION) + encoderDirection = ENCODERBASE; + #endif + } + + FORCE_INLINE static void encoder_direction_menus() { + #if ENABLED(REVERSE_MENU_DIRECTION) + encoderDirection = -(ENCODERBASE); + #endif + } + + FORCE_INLINE static void encoder_direction_select() { + #if ENABLED(REVERSE_SELECT_DIRECTION) + encoderDirection = -(ENCODERBASE); + #endif + } + #else static inline void update_buttons() {} @@ -548,5 +624,8 @@ class MarlinUI { extern MarlinUI ui; -#define LCD_MESSAGEPGM(x) ui.set_status_P(PSTR(x)) -#define LCD_ALERTMESSAGEPGM(x) ui.set_alert_status_P(PSTR(x)) +#define LCD_MESSAGEPGM_P(x) ui.set_status_P(x) +#define LCD_ALERTMESSAGEPGM_P(x) ui.set_alert_status_P(x) + +#define LCD_MESSAGEPGM(x) LCD_MESSAGEPGM_P(GET_TEXT(x)) +#define LCD_ALERTMESSAGEPGM(x) LCD_ALERTMESSAGEPGM_P(GET_TEXT(x)) diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index ae90f761f703..549ba3c364ed 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -21,7 +21,7 @@ */ /** - * The monitor_driver routines are a close copy of the TMC code + * The monitor_driver routines are a close copy of the TMC code */ #include "../../inc/MarlinConfig.h" @@ -32,9 +32,9 @@ L6470_Marlin L6470; -#include "../stepper_indirection.h" +#include "../../module/stepper/indirection.h" +#include "../../module/planner.h" #include "../../gcode/gcode.h" -#include "../planner.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../core/debug_out.h" @@ -339,19 +339,19 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], // Position calcs & checks // - const float center[] = { - LOGICAL_X_POSITION(current_position[X_AXIS]), - LOGICAL_Y_POSITION(current_position[Y_AXIS]), - LOGICAL_Z_POSITION(current_position[Z_AXIS]), - current_position[E_AXIS] + const xyze_pos_t center = { + LOGICAL_X_POSITION(current_position.x), + LOGICAL_Y_POSITION(current_position.y), + LOGICAL_Z_POSITION(current_position.z), + current_position.e }; switch (axis_mon[0][0]) { default: position_max = position_min = 0; break; case 'X': { - position_min = center[X_AXIS] - displacement; - position_max = center[X_AXIS] + displacement; + position_min = center.x - displacement; + position_max = center.x + displacement; echo_min_max('X', position_min, position_max); if (false #ifdef X_MIN_POS @@ -367,8 +367,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], } break; case 'Y': { - position_min = center[Y_AXIS] - displacement; - position_max = center[Y_AXIS] + displacement; + position_min = center.y - displacement; + position_max = center.y + displacement; echo_min_max('Y', position_min, position_max); if (false #ifdef Y_MIN_POS @@ -384,8 +384,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], } break; case 'Z': { - position_min = center[E_AXIS] - displacement; - position_max = center[E_AXIS] + displacement; + position_min = center.z - displacement; + position_max = center.z + displacement; echo_min_max('Z', position_min, position_max); if (false #ifdef Z_MIN_POS @@ -401,8 +401,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], } break; case 'E': { - position_min = center[E_AXIS] - displacement; - position_max = center[E_AXIS] + displacement; + position_min = center.e - displacement; + position_max = center.e + displacement; echo_min_max('E', position_min, position_max); } break; } diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index 92745b6e3e04..bc9a033e4a2d 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -27,13 +27,11 @@ #define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P) -#define MAX_L6470 (7 + MAX_EXTRUDERS) // Maximum number of axes in Marlin +enum L6470_driver_enum : unsigned char { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5, MAX_L6470 }; #define L6470_ERROR_MASK (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD | STATUS_OCD | STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B) #define dSPIN_STEP_CLOCK_FWD dSPIN_STEP_CLOCK #define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1 -#define HAS_L6470_EXTRUDER ( AXIS_DRIVER_TYPE_E0(L6470) || AXIS_DRIVER_TYPE_E1(L6470) || AXIS_DRIVER_TYPE_E2(L6470) \ - || AXIS_DRIVER_TYPE_E3(L6470) || AXIS_DRIVER_TYPE_E4(L6470) || AXIS_DRIVER_TYPE_E5(L6470) ) class L6470_Marlin { public: diff --git a/Marlin/src/libs/buzzer.cpp b/Marlin/src/libs/buzzer.cpp index aa20127fa02b..549c76008e4d 100644 --- a/Marlin/src/libs/buzzer.cpp +++ b/Marlin/src/libs/buzzer.cpp @@ -22,7 +22,7 @@ #include "../inc/MarlinConfig.h" -#if DISABLED(LCD_USE_I2C_BUZZER) && PIN_EXISTS(BEEPER) +#if USE_BEEPER #include "buzzer.h" #include "../module/temperature.h" @@ -78,4 +78,4 @@ void Buzzer::tick() { else if (ELAPSED(now, state.endtime)) reset(); } -#endif // !LCD_USE_I2C_BUZZER && BEEPER +#endif // USE_BEEPER diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index d045938dd9fe..026b9330f96d 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -23,11 +23,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(LCD_USE_I2C_BUZZER) - - #define BUZZ(d,f) ui.buzz(d,f) - -#elif PIN_EXISTS(BEEPER) +#if USE_BEEPER #include "circularqueue.h" @@ -115,10 +111,18 @@ // Provide a buzzer instance extern Buzzer buzzer; + + // Buzz directly via the BEEPER pin tone queue #define BUZZ(d,f) buzzer.tone(d, f) -#else // No buzz capability +#elif HAS_BUZZER + + // Buzz indirectly via the MarlinUI instance + #define BUZZ(d,f) ui.buzz(d,f) + +#else + // No buzz capability #define BUZZ(d,f) NOOP #endif diff --git a/Marlin/src/libs/circularqueue.h b/Marlin/src/libs/circularqueue.h index 479e90daba47..6b1923986d7b 100644 --- a/Marlin/src/libs/circularqueue.h +++ b/Marlin/src/libs/circularqueue.h @@ -52,8 +52,8 @@ class CircularQueue { * items that can be stored on the queue. */ CircularQueue() { - this->buffer.size = N; - this->buffer.count = this->buffer.head = this->buffer.tail = 0; + buffer.size = N; + buffer.count = buffer.head = buffer.tail = 0; } /** @@ -63,15 +63,15 @@ class CircularQueue { * @return type T item */ T dequeue() { - if (this->isEmpty()) return T(); + if (isEmpty()) return T(); - uint8_t index = this->buffer.head; + uint8_t index = buffer.head; - --this->buffer.count; - if (++this->buffer.head == this->buffer.size) - this->buffer.head = 0; + --buffer.count; + if (++buffer.head == buffer.size) + buffer.head = 0; - return this->buffer.queue[index]; + return buffer.queue[index]; } /** @@ -82,13 +82,13 @@ class CircularQueue { * @return true if the operation was successful */ bool enqueue(T const &item) { - if (this->isFull()) return false; + if (isFull()) return false; - this->buffer.queue[this->buffer.tail] = item; + buffer.queue[buffer.tail] = item; - ++this->buffer.count; - if (++this->buffer.tail == this->buffer.size) - this->buffer.tail = 0; + ++buffer.count; + if (++buffer.tail == buffer.size) + buffer.tail = 0; return true; } @@ -98,27 +98,21 @@ class CircularQueue { * @details Returns true if there are no items on the queue, false otherwise. * @return true if queue is empty */ - bool isEmpty() { - return this->buffer.count == 0; - } + bool isEmpty() { return buffer.count == 0; } /** * @brief Checks if the queue is full * @details Returns true if the queue is full, false otherwise. * @return true if queue is full */ - bool isFull() { - return this->buffer.count == this->buffer.size; - } + bool isFull() { return buffer.count == buffer.size; } /** * @brief Gets the queue size * @details Returns the maximum number of items a queue can have. * @return the queue size */ - uint8_t size() { - return this->buffer.size; - } + uint8_t size() { return buffer.size; } /** * @brief Gets the next item from the queue without removing it @@ -126,16 +120,12 @@ class CircularQueue { * or updating the pointers. * @return first item in the queue */ - T peek() { - return this->buffer.queue[this->buffer.head]; - } + T peek() { return buffer.queue[buffer.head]; } /** * @brief Gets the number of items on the queue * @details Returns the current number of items stored on the queue. * @return number of items in the queue */ - uint8_t count() { - return this->buffer.count; - } + uint8_t count() { return buffer.count; } }; diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index c376e5dae27b..0df3659b1bdf 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -120,7 +120,7 @@ struct duration_t { * 59m 59s * 59s */ - void toString(char *buffer) const { + char* toString(char * const buffer) const { int y = this->year(), d = this->day() % 365, h = this->hour() % 24, @@ -132,6 +132,7 @@ struct duration_t { else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s); else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s); else sprintf_P(buffer, PSTR("%is"), s); + return buffer; } /** @@ -150,15 +151,15 @@ struct duration_t { m = uint16_t(this->minute() % 60UL); if (with_days) { uint16_t d = this->day(); - sprintf_P(buffer, PSTR("%ud %02u:%02u"), d, h % 24, m); + sprintf_P(buffer, PSTR("%hud %02hu:%02hu"), d, h % 24, m); return d >= 10 ? 9 : 8; } else if (h < 100) { - sprintf_P(buffer, PSTR("%02u:%02u"), h, m); + sprintf_P(buffer, PSTR("%02hu:%02hu"), h, m); return 5; } else { - sprintf_P(buffer, PSTR("%u:%02u"), h, m); + sprintf_P(buffer, PSTR("%hu:%02hu"), h, m); return 6; } } diff --git a/Marlin/src/libs/heatshrink/LICENSE b/Marlin/src/libs/heatshrink/LICENSE new file mode 100644 index 000000000000..a40fc72b9175 --- /dev/null +++ b/Marlin/src/libs/heatshrink/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2013-2015, Scott Vokes +All rights reserved. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/Marlin/src/libs/heatshrink/heatshrink_common.h b/Marlin/src/libs/heatshrink/heatshrink_common.h new file mode 100644 index 000000000000..c8dc95406e90 --- /dev/null +++ b/Marlin/src/libs/heatshrink/heatshrink_common.h @@ -0,0 +1,20 @@ +/** + * libs/heatshrink/heatshrink_common.h + */ +#pragma once + +#define HEATSHRINK_AUTHOR "Scott Vokes " +#define HEATSHRINK_URL "https://github.com/atomicobject/heatshrink" + +/* Version 0.4.1 */ +#define HEATSHRINK_VERSION_MAJOR 0 +#define HEATSHRINK_VERSION_MINOR 4 +#define HEATSHRINK_VERSION_PATCH 1 + +#define HEATSHRINK_MIN_WINDOW_BITS 4 +#define HEATSHRINK_MAX_WINDOW_BITS 15 + +#define HEATSHRINK_MIN_LOOKAHEAD_BITS 3 + +#define HEATSHRINK_LITERAL_MARKER 0x01 +#define HEATSHRINK_BACKREF_MARKER 0x00 diff --git a/Marlin/src/libs/heatshrink/heatshrink_config.h b/Marlin/src/libs/heatshrink/heatshrink_config.h new file mode 100644 index 000000000000..90520f126439 --- /dev/null +++ b/Marlin/src/libs/heatshrink/heatshrink_config.h @@ -0,0 +1,26 @@ +/** + * libs/heatshrink/heatshrink_config.h + */ +#pragma once + +// Should functionality assuming dynamic allocation be used? +#ifndef HEATSHRINK_DYNAMIC_ALLOC + //#define HEATSHRINK_DYNAMIC_ALLOC 1 +#endif + +#if HEATSHRINK_DYNAMIC_ALLOC + // Optional replacement of malloc/free + #define HEATSHRINK_MALLOC(SZ) malloc(SZ) + #define HEATSHRINK_FREE(P, SZ) free(P) +#else + // Required parameters for static configuration + #define HEATSHRINK_STATIC_INPUT_BUFFER_SIZE 32 + #define HEATSHRINK_STATIC_WINDOW_BITS 8 + #define HEATSHRINK_STATIC_LOOKAHEAD_BITS 4 +#endif + +// Turn on logging for debugging +#define HEATSHRINK_DEBUGGING_LOGS 0 + +// Use indexing for faster compression. (This requires additional space.) +#define HEATSHRINK_USE_INDEX 1 diff --git a/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp b/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp new file mode 100644 index 000000000000..4684af975e80 --- /dev/null +++ b/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp @@ -0,0 +1,355 @@ +/** + * libs/heatshrink/heatshrink_decoder.cpp + */ +#include +#include +#include "heatshrink_decoder.h" + +#pragma GCC optimize ("O3") + +/* States for the polling state machine. */ +typedef enum { + HSDS_TAG_BIT, /* tag bit */ + HSDS_YIELD_LITERAL, /* ready to yield literal byte */ + HSDS_BACKREF_INDEX_MSB, /* most significant byte of index */ + HSDS_BACKREF_INDEX_LSB, /* least significant byte of index */ + HSDS_BACKREF_COUNT_MSB, /* most significant byte of count */ + HSDS_BACKREF_COUNT_LSB, /* least significant byte of count */ + HSDS_YIELD_BACKREF /* ready to yield back-reference */ +} HSD_state; + +#if HEATSHRINK_DEBUGGING_LOGS + #include + #include + #include + #define LOG(...) fprintf(stderr, __VA_ARGS__) + #define ASSERT(X) assert(X) + static const char *state_names[] = { + "tag_bit", + "yield_literal", + "backref_index_msb", + "backref_index_lsb", + "backref_count_msb", + "backref_count_lsb", + "yield_backref" + }; +#else + #define LOG(...) /* no-op */ + #define ASSERT(X) /* no-op */ +#endif + +typedef struct { + uint8_t *buf; /* output buffer */ + size_t buf_size; /* buffer size */ + size_t *output_size; /* bytes pushed to buffer, so far */ +} output_info; + +#define NO_BITS ((uint16_t)-1) + +/* Forward references. */ +static uint16_t get_bits(heatshrink_decoder *hsd, uint8_t count); +static void push_byte(heatshrink_decoder *hsd, output_info *oi, uint8_t byte); + +#if HEATSHRINK_DYNAMIC_ALLOC +heatshrink_decoder *heatshrink_decoder_alloc(uint16_t input_buffer_size, uint8_t window_sz2, uint8_t lookahead_sz2) { + if ((window_sz2 < HEATSHRINK_MIN_WINDOW_BITS) || + (window_sz2 > HEATSHRINK_MAX_WINDOW_BITS) || + (input_buffer_size == 0) || + (lookahead_sz2 < HEATSHRINK_MIN_LOOKAHEAD_BITS) || + (lookahead_sz2 >= window_sz2)) { + return nullptr; + } + size_t buffers_sz = (1 << window_sz2) + input_buffer_size; + size_t sz = sizeof(heatshrink_decoder) + buffers_sz; + heatshrink_decoder *hsd = HEATSHRINK_MALLOC(sz); + if (hsd == nullptr) return nullptr; + hsd->input_buffer_size = input_buffer_size; + hsd->window_sz2 = window_sz2; + hsd->lookahead_sz2 = lookahead_sz2; + heatshrink_decoder_reset(hsd); + LOG("-- allocated decoder with buffer size of %zu (%zu + %u + %u)\n", + sz, sizeof(heatshrink_decoder), (1 << window_sz2), input_buffer_size); + return hsd; +} + +void heatshrink_decoder_free(heatshrink_decoder *hsd) { + size_t buffers_sz = (1 << hsd->window_sz2) + hsd->input_buffer_size; + size_t sz = sizeof(heatshrink_decoder) + buffers_sz; + HEATSHRINK_FREE(hsd, sz); + (void)sz; /* may not be used by free */ +} +#endif + +void heatshrink_decoder_reset(heatshrink_decoder *hsd) { + size_t buf_sz = 1 << HEATSHRINK_DECODER_WINDOW_BITS(hsd); + size_t input_sz = HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd); + memset(hsd->buffers, 0, buf_sz + input_sz); + hsd->state = HSDS_TAG_BIT; + hsd->input_size = 0; + hsd->input_index = 0; + hsd->bit_index = 0x00; + hsd->current_byte = 0x00; + hsd->output_count = 0; + hsd->output_index = 0; + hsd->head_index = 0; +} + +/* Copy SIZE bytes into the decoder's input buffer, if it will fit. */ +HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, + uint8_t *in_buf, size_t size, size_t *input_size) { + if (hsd == nullptr || in_buf == nullptr || input_size == nullptr) + return HSDR_SINK_ERROR_NULL; + + size_t rem = HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd) - hsd->input_size; + if (rem == 0) { + *input_size = 0; + return HSDR_SINK_FULL; + } + + size = rem < size ? rem : size; + LOG("-- sinking %zd bytes\n", size); + /* copy into input buffer (at head of buffers) */ + memcpy(&hsd->buffers[hsd->input_size], in_buf, size); + hsd->input_size += size; + *input_size = size; + return HSDR_SINK_OK; +} + + +/***************** + * Decompression * + *****************/ + +#define BACKREF_COUNT_BITS(HSD) (HEATSHRINK_DECODER_LOOKAHEAD_BITS(HSD)) +#define BACKREF_INDEX_BITS(HSD) (HEATSHRINK_DECODER_WINDOW_BITS(HSD)) + +// States +static HSD_state st_tag_bit(heatshrink_decoder *hsd); +static HSD_state st_yield_literal(heatshrink_decoder *hsd, output_info *oi); +static HSD_state st_backref_index_msb(heatshrink_decoder *hsd); +static HSD_state st_backref_index_lsb(heatshrink_decoder *hsd); +static HSD_state st_backref_count_msb(heatshrink_decoder *hsd); +static HSD_state st_backref_count_lsb(heatshrink_decoder *hsd); +static HSD_state st_yield_backref(heatshrink_decoder *hsd, output_info *oi); + +HSD_poll_res heatshrink_decoder_poll(heatshrink_decoder *hsd, uint8_t *out_buf, size_t out_buf_size, size_t *output_size) { + if (hsd == nullptr || out_buf == nullptr || output_size == nullptr) + return HSDR_POLL_ERROR_NULL; + + *output_size = 0; + + output_info oi; + oi.buf = out_buf; + oi.buf_size = out_buf_size; + oi.output_size = output_size; + + while (1) { + LOG("-- poll, state is %d (%s), input_size %d\n", hsd->state, state_names[hsd->state], hsd->input_size); + uint8_t in_state = hsd->state; + switch (in_state) { + case HSDS_TAG_BIT: + hsd->state = st_tag_bit(hsd); + break; + case HSDS_YIELD_LITERAL: + hsd->state = st_yield_literal(hsd, &oi); + break; + case HSDS_BACKREF_INDEX_MSB: + hsd->state = st_backref_index_msb(hsd); + break; + case HSDS_BACKREF_INDEX_LSB: + hsd->state = st_backref_index_lsb(hsd); + break; + case HSDS_BACKREF_COUNT_MSB: + hsd->state = st_backref_count_msb(hsd); + break; + case HSDS_BACKREF_COUNT_LSB: + hsd->state = st_backref_count_lsb(hsd); + break; + case HSDS_YIELD_BACKREF: + hsd->state = st_yield_backref(hsd, &oi); + break; + default: + return HSDR_POLL_ERROR_UNKNOWN; + } + + // If the current state cannot advance, check if input or output + // buffer are exhausted. + if (hsd->state == in_state) + return (*output_size == out_buf_size) ? HSDR_POLL_MORE : HSDR_POLL_EMPTY; + } +} + +static HSD_state st_tag_bit(heatshrink_decoder *hsd) { + uint32_t bits = get_bits(hsd, 1); // get tag bit + if (bits == NO_BITS) + return HSDS_TAG_BIT; + else if (bits) + return HSDS_YIELD_LITERAL; + else if (HEATSHRINK_DECODER_WINDOW_BITS(hsd) > 8) + return HSDS_BACKREF_INDEX_MSB; + else { + hsd->output_index = 0; + return HSDS_BACKREF_INDEX_LSB; + } +} + +static HSD_state st_yield_literal(heatshrink_decoder *hsd, output_info *oi) { + /* Emit a repeated section from the window buffer, and add it (again) + * to the window buffer. (Note that the repetition can include + * itself.)*/ + if (*oi->output_size < oi->buf_size) { + uint16_t byte = get_bits(hsd, 8); + if (byte == NO_BITS) { return HSDS_YIELD_LITERAL; } /* out of input */ + uint8_t *buf = &hsd->buffers[HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd)]; + uint16_t mask = (1 << HEATSHRINK_DECODER_WINDOW_BITS(hsd)) - 1; + uint8_t c = byte & 0xFF; + LOG("-- emitting literal byte 0x%02x ('%c')\n", c, isprint(c) ? c : '.'); + buf[hsd->head_index++ & mask] = c; + push_byte(hsd, oi, c); + return HSDS_TAG_BIT; + } + return HSDS_YIELD_LITERAL; +} + +static HSD_state st_backref_index_msb(heatshrink_decoder *hsd) { + uint8_t bit_ct = BACKREF_INDEX_BITS(hsd); + ASSERT(bit_ct > 8); + uint16_t bits = get_bits(hsd, bit_ct - 8); + LOG("-- backref index (msb), got 0x%04x (+1)\n", bits); + if (bits == NO_BITS) { return HSDS_BACKREF_INDEX_MSB; } + hsd->output_index = bits << 8; + return HSDS_BACKREF_INDEX_LSB; +} + +static HSD_state st_backref_index_lsb(heatshrink_decoder *hsd) { + uint8_t bit_ct = BACKREF_INDEX_BITS(hsd); + uint16_t bits = get_bits(hsd, bit_ct < 8 ? bit_ct : 8); + LOG("-- backref index (lsb), got 0x%04x (+1)\n", bits); + if (bits == NO_BITS) { return HSDS_BACKREF_INDEX_LSB; } + hsd->output_index |= bits; + hsd->output_index++; + uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); + hsd->output_count = 0; + return (br_bit_ct > 8) ? HSDS_BACKREF_COUNT_MSB : HSDS_BACKREF_COUNT_LSB; +} + +static HSD_state st_backref_count_msb(heatshrink_decoder *hsd) { + uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); + ASSERT(br_bit_ct > 8); + uint16_t bits = get_bits(hsd, br_bit_ct - 8); + LOG("-- backref count (msb), got 0x%04x (+1)\n", bits); + if (bits == NO_BITS) { return HSDS_BACKREF_COUNT_MSB; } + hsd->output_count = bits << 8; + return HSDS_BACKREF_COUNT_LSB; +} + +static HSD_state st_backref_count_lsb(heatshrink_decoder *hsd) { + uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); + uint16_t bits = get_bits(hsd, br_bit_ct < 8 ? br_bit_ct : 8); + LOG("-- backref count (lsb), got 0x%04x (+1)\n", bits); + if (bits == NO_BITS) { return HSDS_BACKREF_COUNT_LSB; } + hsd->output_count |= bits; + hsd->output_count++; + return HSDS_YIELD_BACKREF; +} + +static HSD_state st_yield_backref(heatshrink_decoder *hsd, output_info *oi) { + size_t count = oi->buf_size - *oi->output_size; + if (count > 0) { + size_t i = 0; + if (hsd->output_count < count) count = hsd->output_count; + uint8_t *buf = &hsd->buffers[HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd)]; + uint16_t mask = (1 << HEATSHRINK_DECODER_WINDOW_BITS(hsd)) - 1; + uint16_t neg_offset = hsd->output_index; + LOG("-- emitting %zu bytes from -%u bytes back\n", count, neg_offset); + ASSERT(neg_offset <= mask + 1); + ASSERT(count <= (size_t)(1 << BACKREF_COUNT_BITS(hsd))); + + for (i = 0; i < count; i++) { + uint8_t c = buf[(hsd->head_index - neg_offset) & mask]; + push_byte(hsd, oi, c); + buf[hsd->head_index & mask] = c; + hsd->head_index++; + LOG(" -- ++ 0x%02x\n", c); + } + hsd->output_count -= count; + if (hsd->output_count == 0) { return HSDS_TAG_BIT; } + } + return HSDS_YIELD_BACKREF; +} + +/* Get the next COUNT bits from the input buffer, saving incremental progress. + * Returns NO_BITS on end of input, or if more than 15 bits are requested. */ +static uint16_t get_bits(heatshrink_decoder *hsd, uint8_t count) { + uint16_t accumulator = 0; + int i = 0; + if (count > 15) return NO_BITS; + LOG("-- popping %u bit(s)\n", count); + + /* If we aren't able to get COUNT bits, suspend immediately, because we + * don't track how many bits of COUNT we've accumulated before suspend. */ + if (hsd->input_size == 0 && hsd->bit_index < (1 << (count - 1))) return NO_BITS; + + for (i = 0; i < count; i++) { + if (hsd->bit_index == 0x00) { + if (hsd->input_size == 0) { + LOG(" -- out of bits, suspending w/ accumulator of %u (0x%02x)\n", accumulator, accumulator); + return NO_BITS; + } + hsd->current_byte = hsd->buffers[hsd->input_index++]; + LOG(" -- pulled byte 0x%02x\n", hsd->current_byte); + if (hsd->input_index == hsd->input_size) { + hsd->input_index = 0; /* input is exhausted */ + hsd->input_size = 0; + } + hsd->bit_index = 0x80; + } + accumulator <<= 1; + if (hsd->current_byte & hsd->bit_index) { + accumulator |= 0x01; + if (0) { + LOG(" -- got 1, accumulator 0x%04x, bit_index 0x%02x\n", + accumulator, hsd->bit_index); + } + } + else if (0) { + LOG(" -- got 0, accumulator 0x%04x, bit_index 0x%02x\n", + accumulator, hsd->bit_index); + } + hsd->bit_index >>= 1; + } + + if (count > 1) LOG(" -- accumulated %08x\n", accumulator); + return accumulator; +} + +HSD_finish_res heatshrink_decoder_finish(heatshrink_decoder *hsd) { + if (hsd == nullptr) { return HSDR_FINISH_ERROR_NULL; } + switch (hsd->state) { + case HSDS_TAG_BIT: + return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; + + /* If we want to finish with no input, but are in these states, it's + * because the 0-bit padding to the last byte looks like a backref + * marker bit followed by all 0s for index and count bits. */ + case HSDS_BACKREF_INDEX_LSB: + case HSDS_BACKREF_INDEX_MSB: + case HSDS_BACKREF_COUNT_LSB: + case HSDS_BACKREF_COUNT_MSB: + return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; + + /* If the output stream is padded with 0xFFs (possibly due to being in + * flash memory), also explicitly check the input size rather than + * uselessly returning MORE but yielding 0 bytes when polling. */ + case HSDS_YIELD_LITERAL: + return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; + + default: return HSDR_FINISH_MORE; + } +} + +static void push_byte(heatshrink_decoder *hsd, output_info *oi, uint8_t byte) { + LOG(" -- pushing byte: 0x%02x ('%c')\n", byte, isprint(byte) ? byte : '.'); + oi->buf[(*oi->output_size)++] = byte; + (void)hsd; +} diff --git a/Marlin/src/libs/heatshrink/heatshrink_decoder.h b/Marlin/src/libs/heatshrink/heatshrink_decoder.h new file mode 100644 index 000000000000..11fafe617fff --- /dev/null +++ b/Marlin/src/libs/heatshrink/heatshrink_decoder.h @@ -0,0 +1,96 @@ +/** + * libs/heatshrink/heatshrink_decoder.h + */ +#pragma once + +#include +#include +#include "heatshrink_common.h" +#include "heatshrink_config.h" + +typedef enum { + HSDR_SINK_OK, /* data sunk, ready to poll */ + HSDR_SINK_FULL, /* out of space in internal buffer */ + HSDR_SINK_ERROR_NULL=-1, /* NULL argument */ +} HSD_sink_res; + +typedef enum { + HSDR_POLL_EMPTY, /* input exhausted */ + HSDR_POLL_MORE, /* more data remaining, call again w/ fresh output buffer */ + HSDR_POLL_ERROR_NULL=-1, /* NULL arguments */ + HSDR_POLL_ERROR_UNKNOWN=-2, +} HSD_poll_res; + +typedef enum { + HSDR_FINISH_DONE, /* output is done */ + HSDR_FINISH_MORE, /* more output remains */ + HSDR_FINISH_ERROR_NULL=-1, /* NULL arguments */ +} HSD_finish_res; + +#if HEATSHRINK_DYNAMIC_ALLOC +#define HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(BUF) \ + ((BUF)->input_buffer_size) +#define HEATSHRINK_DECODER_WINDOW_BITS(BUF) \ + ((BUF)->window_sz2) +#define HEATSHRINK_DECODER_LOOKAHEAD_BITS(BUF) \ + ((BUF)->lookahead_sz2) +#else +#define HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(_) \ + HEATSHRINK_STATIC_INPUT_BUFFER_SIZE +#define HEATSHRINK_DECODER_WINDOW_BITS(_) \ + (HEATSHRINK_STATIC_WINDOW_BITS) +#define HEATSHRINK_DECODER_LOOKAHEAD_BITS(BUF) \ + (HEATSHRINK_STATIC_LOOKAHEAD_BITS) +#endif + +typedef struct { + uint16_t input_size; /* bytes in input buffer */ + uint16_t input_index; /* offset to next unprocessed input byte */ + uint16_t output_count; /* how many bytes to output */ + uint16_t output_index; /* index for bytes to output */ + uint16_t head_index; /* head of window buffer */ + uint8_t state; /* current state machine node */ + uint8_t current_byte; /* current byte of input */ + uint8_t bit_index; /* current bit index */ + +#if HEATSHRINK_DYNAMIC_ALLOC + /* Fields that are only used if dynamically allocated. */ + uint8_t window_sz2; /* window buffer bits */ + uint8_t lookahead_sz2; /* lookahead bits */ + uint16_t input_buffer_size; /* input buffer size */ + + /* Input buffer, then expansion window buffer */ + uint8_t buffers[]; +#else + /* Input buffer, then expansion window buffer */ + uint8_t buffers[(1 << HEATSHRINK_DECODER_WINDOW_BITS(_)) + HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(_)]; +#endif +} heatshrink_decoder; + +#if HEATSHRINK_DYNAMIC_ALLOC +/* Allocate a decoder with an input buffer of INPUT_BUFFER_SIZE bytes, + * an expansion buffer size of 2^WINDOW_SZ2, and a lookahead + * size of 2^lookahead_sz2. (The window buffer and lookahead sizes + * must match the settings used when the data was compressed.) + * Returns NULL on error. */ +heatshrink_decoder *heatshrink_decoder_alloc(uint16_t input_buffer_size, uint8_t expansion_buffer_sz2, uint8_t lookahead_sz2); + +/* Free a decoder. */ +void heatshrink_decoder_free(heatshrink_decoder *hsd); +#endif + +/* Reset a decoder. */ +void heatshrink_decoder_reset(heatshrink_decoder *hsd); + +/* Sink at most SIZE bytes from IN_BUF into the decoder. *INPUT_SIZE is set to + * indicate how many bytes were actually sunk (in case a buffer was filled). */ +HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, uint8_t *in_buf, size_t size, size_t *input_size); + +/* Poll for output from the decoder, copying at most OUT_BUF_SIZE bytes into + * OUT_BUF (setting *OUTPUT_SIZE to the actual amount copied). */ +HSD_poll_res heatshrink_decoder_poll(heatshrink_decoder *hsd, uint8_t *out_buf, size_t out_buf_size, size_t *output_size); + +/* Notify the dencoder that the input stream is finished. + * If the return value is HSDR_FINISH_MORE, there is still more output, so + * call heatshrink_decoder_poll and repeat. */ +HSD_finish_res heatshrink_decoder_finish(heatshrink_decoder *hsd); diff --git a/Marlin/src/libs/least_squares_fit.cpp b/Marlin/src/libs/least_squares_fit.cpp index e7ef43614607..135329679454 100644 --- a/Marlin/src/libs/least_squares_fit.cpp +++ b/Marlin/src/libs/least_squares_fit.cpp @@ -34,7 +34,7 @@ #include "../inc/MarlinConfig.h" -#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR) +#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) #include "least_squares_fit.h" diff --git a/Marlin/src/libs/least_squares_fit.h b/Marlin/src/libs/least_squares_fit.h index 8eb47585e00b..acb29402c5a0 100644 --- a/Marlin/src/libs/least_squares_fit.h +++ b/Marlin/src/libs/least_squares_fit.h @@ -44,28 +44,32 @@ struct linear_fit_data { A, B, D, N; }; -void inline incremental_LSF_reset(struct linear_fit_data *lsf) { +inline void incremental_LSF_reset(struct linear_fit_data *lsf) { memset(lsf, 0, sizeof(linear_fit_data)); } -void inline incremental_WLSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z, const float &w) { +inline void incremental_WLSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z, const float &w) { // weight each accumulator by factor w, including the "number" of samples // (analogous to calling inc_LSF twice with same values to weight it by 2X) - lsf->xbar += w * x; - lsf->ybar += w * y; - lsf->zbar += w * z; - lsf->x2bar += w * x * x; // don't use sq(x) -- let compiler re-use w*x four times - lsf->y2bar += w * y * y; - lsf->z2bar += w * z * z; - lsf->xybar += w * x * y; - lsf->xzbar += w * x * z; - lsf->yzbar += w * y * z; + const float wx = w * x, wy = w * y, wz = w * z; + lsf->xbar += wx; + lsf->ybar += wy; + lsf->zbar += wz; + lsf->x2bar += wx * x; + lsf->y2bar += wy * y; + lsf->z2bar += wz * z; + lsf->xybar += wx * y; + lsf->xzbar += wx * z; + lsf->yzbar += wy * 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(ABS(wx), lsf->max_absx); + lsf->max_absy = _MAX(ABS(wy), lsf->max_absy); +} +inline void incremental_WLSF(struct linear_fit_data *lsf, const xy_pos_t &pos, const float &z, const float &w) { + incremental_WLSF(lsf, pos.x, pos.y, z, w); } -void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) { +inline void incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) { lsf->xbar += x; lsf->ybar += y; lsf->zbar += z; @@ -79,5 +83,8 @@ void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const f lsf->max_absy = _MAX(ABS(y), lsf->max_absy); lsf->N += 1.0; } +inline void incremental_LSF(struct linear_fit_data *lsf, const xy_pos_t &pos, const float &z) { + incremental_LSF(lsf, pos.x, pos.y, z); +} int finish_incremental_LSF(struct linear_fit_data *); diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 336f189e23d5..b95a7c8afc58 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -26,9 +26,10 @@ #include "nozzle.h" +Nozzle nozzle; + #include "../Marlin.h" #include "../module/motion.h" -#include "point_t.h" #if ENABLED(NOZZLE_CLEAN_FEATURE) @@ -36,26 +37,30 @@ * @brief Stroke clean pattern * @details Wipes the nozzle back and forth in a linear movement * - * @param start point_t defining the starting point - * @param end point_t defining the ending point + * @param start xyz_pos_t defining the starting point + * @param end xyz_pos_t defining the ending point * @param strokes number of strokes to execute */ - void Nozzle::stroke(const point_t &start, const point_t &end, const uint8_t &strokes) { + void Nozzle::stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) { #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; + const xyz_pos_t oldpos = current_position; #endif // Move to the starting point - do_blocking_move_to(start.x, start.y, start.z); + #if ENABLED(NOZZLE_CLEAN_NO_Z) + do_blocking_move_to_xy(start); + #else + do_blocking_move_to(start); + #endif // Start the stroke pattern for (uint8_t i = 0; i < (strokes >> 1); i++) { - do_blocking_move_to_xy(end.x, end.y); - do_blocking_move_to_xy(start.x, start.y); + do_blocking_move_to_xy(end); + do_blocking_move_to_xy(start); } #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); + do_blocking_move_to(oldpos); #endif } @@ -63,25 +68,29 @@ * @brief Zig-zag clean pattern * @details Apply a zig-zag cleaning pattern * - * @param start point_t defining the starting point - * @param end point_t defining the ending point + * @param start xyz_pos_t defining the starting point + * @param end xyz_pos_t defining the ending point * @param strokes number of strokes to execute * @param objects number of triangles to do */ - void Nozzle::zigzag(const point_t &start, const point_t &end, const uint8_t &strokes, const uint8_t &objects) { - const float diffx = end.x - start.x, diffy = end.y - start.y; - if (!diffx || !diffy) return; + void Nozzle::zigzag(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes, const uint8_t &objects) { + const xy_pos_t diff = end - start; + if (!diff.x || !diff.y) return; #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; + const xyz_pos_t back = current_position; #endif - do_blocking_move_to(start.x, start.y, start.z); + #if ENABLED(NOZZLE_CLEAN_NO_Z) + do_blocking_move_to_xy(start); + #else + do_blocking_move_to(start); + #endif const uint8_t zigs = objects << 1; - const bool horiz = ABS(diffx) >= ABS(diffy); // Do a horizontal wipe? - const float P = (horiz ? diffx : diffy) / zigs; // Period of each zig / zag - const point_t *side; + const bool horiz = ABS(diff.x) >= ABS(diff.y); // Do a horizontal wipe? + const float P = (horiz ? diff.x : diff.y) / zigs; // Period of each zig / zag + const xyz_pos_t *side; for (uint8_t j = 0; j < strokes; j++) { for (int8_t i = 0; i < zigs; i++) { side = (i & 1) ? &end : &start; @@ -100,7 +109,7 @@ } #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); + do_blocking_move_to(back); #endif } @@ -108,18 +117,22 @@ * @brief Circular clean pattern * @details Apply a circular cleaning pattern * - * @param start point_t defining the middle of circle + * @param start xyz_pos_t defining the middle of circle * @param strokes number of strokes to execute * @param radius radius of circle */ - void Nozzle::circle(const point_t &start, const point_t &middle, const uint8_t &strokes, const float &radius) { + void Nozzle::circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const float &radius) { if (strokes == 0) return; #if ENABLED(NOZZLE_CLEAN_GOBACK) - const float ix = current_position[X_AXIS], iy = current_position[Y_AXIS], iz = current_position[Z_AXIS]; + const xyz_pos_t back = current_position; #endif - do_blocking_move_to(start.x, start.y, start.z); + #if ENABLED(NOZZLE_CLEAN_NO_Z) + do_blocking_move_to_xy(start); + #else + do_blocking_move_to(start); + #endif for (uint8_t s = 0; s < strokes; s++) for (uint8_t i = 0; i < NOZZLE_CLEAN_CIRCLE_FN; i++) @@ -129,10 +142,10 @@ ); // Let's be safe - do_blocking_move_to_xy(start.x, start.y); + do_blocking_move_to_xy(start); #if ENABLED(NOZZLE_CLEAN_GOBACK) - do_blocking_move_to(ix, iy, iz); + do_blocking_move_to(back); #endif } @@ -143,18 +156,27 @@ * @param pattern one of the available patterns * @param argument depends on the cleaning pattern */ - void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects/*=0*/) { - switch (pattern) { - case 1: - zigzag(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT, strokes, objects); - break; + void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const uint8_t cleans) { + xyz_pos_t start = NOZZLE_CLEAN_START_POINT, end = NOZZLE_CLEAN_END_POINT; - case 2: - circle(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_CIRCLE_MIDDLE, strokes, radius); - break; + if (pattern == 2) { + if (!(cleans & (_BV(X_AXIS) | _BV(Y_AXIS)))) { + SERIAL_ECHOLNPGM("Warning : Clean Circle requires XY"); + return; + } + constexpr xyz_pos_t middle NOZZLE_CLEAN_CIRCLE_MIDDLE; + end = middle; + } + else { + if (!TEST(cleans, X_AXIS)) start.x = end.x = current_position.x; + if (!TEST(cleans, Y_AXIS)) start.y = end.y = current_position.y; + } + if (!TEST(cleans, Z_AXIS)) start.z = end.z = current_position.z; - default: - stroke(NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT, strokes); + switch (pattern) { + case 1: zigzag(start, end, strokes, objects); break; + case 2: circle(start, end, strokes, radius); break; + default: stroke(start, end, strokes); } } @@ -162,9 +184,8 @@ #if ENABLED(NOZZLE_PARK_FEATURE) - 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; + void Nozzle::park(const uint8_t z_action, const xyz_pos_t &park/*=NOZZLE_PARK_POINT*/) { + constexpr feedRate_t fr_xy = NOZZLE_PARK_XY_FEEDRATE, fr_z = NOZZLE_PARK_Z_FEEDRATE; switch (z_action) { case 1: // Go to Z-park height @@ -172,14 +193,14 @@ 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 + 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), fr_z); } - do_blocking_move_to_xy(park.x, park.y, fr_xy); + do_blocking_move_to_xy(park, fr_xy); report_current_position(); } diff --git a/Marlin/src/libs/nozzle.h b/Marlin/src/libs/nozzle.h index ad0d8d752d5b..280f8b1a388a 100644 --- a/Marlin/src/libs/nozzle.h +++ b/Marlin/src/libs/nozzle.h @@ -22,7 +22,6 @@ #pragma once #include "../inc/MarlinConfig.h" -#include "point_t.h" /** * @brief Nozzle class @@ -38,32 +37,32 @@ class Nozzle { * @brief Stroke clean pattern * @details Wipes the nozzle back and forth in a linear movement * - * @param start point_t defining the starting point - * @param end point_t defining the ending point + * @param start xyz_pos_t defining the starting point + * @param end xyz_pos_t defining the ending point * @param strokes number of strokes to execute */ - static void stroke(const point_t &start, const point_t &end, const uint8_t &strokes) _Os; + static void stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) _Os; /** * @brief Zig-zag clean pattern * @details Apply a zig-zag cleaning pattern * - * @param start point_t defining the starting point - * @param end point_t defining the ending point + * @param start xyz_pos_t defining the starting point + * @param end xyz_pos_t defining the ending point * @param strokes number of strokes to execute * @param objects number of objects to create */ - static void zigzag(const point_t &start, const point_t &end, const uint8_t &strokes, const uint8_t &objects) _Os; + static void zigzag(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes, const uint8_t &objects) _Os; /** * @brief Circular clean pattern * @details Apply a circular cleaning pattern * - * @param start point_t defining the middle of circle + * @param start xyz_pos_t defining the middle of circle * @param strokes number of strokes to execute * @param radius radius of circle */ - static void circle(const point_t &start, const point_t &middle, const uint8_t &strokes, const float &radius) _Os; + static void circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const float &radius) _Os; #endif // NOZZLE_CLEAN_FEATURE @@ -78,13 +77,15 @@ class Nozzle { * @param pattern one of the available patterns * @param argument depends on the cleaning pattern */ - static void clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects=0) _Os; + static void clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const uint8_t cleans) _Os; #endif // NOZZLE_CLEAN_FEATURE #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 xyz_pos_t &park=NOZZLE_PARK_POINT) _Os; #endif }; + +extern Nozzle nozzle; diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index fabc5b498f1c..6054f877e54f 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -21,6 +21,8 @@ */ #include "numtostr.h" + +#include "../inc/MarlinConfigPre.h" #include "../core/utility.h" char conv[8] = { 0 }; @@ -31,7 +33,7 @@ char conv[8] = { 0 }; #define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-')) // Convert a full-range unsigned 8bit int to a percentage -char* ui8tostr4pct(const uint8_t i) { +const char* ui8tostr4pct(const uint8_t i) { const uint8_t n = ui8_to_percent(i); conv[3] = RJDIGIT(n, 100); conv[4] = RJDIGIT(n, 10); @@ -41,7 +43,7 @@ char* ui8tostr4pct(const uint8_t i) { } // Convert unsigned 8bit int to string 123 format -char* ui8tostr3(const uint8_t i) { +const char* ui8tostr3(const uint8_t i) { conv[4] = RJDIGIT(i, 100); conv[5] = RJDIGIT(i, 10); conv[6] = DIGIMOD(i, 1); @@ -49,7 +51,7 @@ char* ui8tostr3(const uint8_t i) { } // Convert signed 8bit int to rj string with 123 or -12 format -char* i8tostr3(const int8_t x) { +const char* i8tostr3(const int8_t x) { int xx = x; conv[4] = MINUSOR(xx, RJDIGIT(xx, 100)); conv[5] = RJDIGIT(xx, 10); @@ -57,8 +59,36 @@ char* i8tostr3(const int8_t x) { return &conv[4]; } +#if HAS_PRINT_PROGRESS_PERMYRIAD + // Convert unsigned 16-bit permyriad to percent with 100 / 23 / 23.4 / 3.45 format + const char* permyriadtostr4(const uint16_t xx) { + if (xx >= 10000) + return "100"; + else if (xx >= 1000) { + conv[3] = DIGIMOD(xx, 1000); + conv[4] = DIGIMOD(xx, 100); + conv[5] = '.'; + conv[6] = DIGIMOD(xx, 10); + return &conv[3]; + } + else if (xx % 100 == 0) { + conv[4] = ' '; + conv[5] = RJDIGIT(xx, 1000); + conv[6] = DIGIMOD(xx, 100); + return &conv[4]; + } + else { + conv[3] = DIGIMOD(xx, 100); + conv[4] = '.'; + conv[5] = DIGIMOD(xx, 10); + conv[6] = RJDIGIT(xx, 1); + return &conv[3]; + } + } +#endif + // Convert unsigned 16bit int to string 12345 format -char* ui16tostr5(const uint16_t xx) { +const char* ui16tostr5(const uint16_t xx) { conv[2] = RJDIGIT(xx, 10000); conv[3] = RJDIGIT(xx, 1000); conv[4] = RJDIGIT(xx, 100); @@ -68,7 +98,7 @@ char* ui16tostr5(const uint16_t xx) { } // Convert unsigned 16bit int to string 1234 format -char* ui16tostr4(const uint16_t xx) { +const char* ui16tostr4(const uint16_t xx) { conv[3] = RJDIGIT(xx, 1000); conv[4] = RJDIGIT(xx, 100); conv[5] = RJDIGIT(xx, 10); @@ -77,7 +107,7 @@ char* ui16tostr4(const uint16_t xx) { } // Convert unsigned 16bit int to string 123 format -char* ui16tostr3(const uint16_t xx) { +const char* ui16tostr3(const uint16_t xx) { conv[4] = RJDIGIT(xx, 100); conv[5] = RJDIGIT(xx, 10); conv[6] = DIGIMOD(xx, 1); @@ -85,7 +115,7 @@ char* ui16tostr3(const uint16_t xx) { } // Convert signed 16bit int to rj string with 123 or -12 format -char* i16tostr3(const int16_t x) { +const char* i16tostr3(const int16_t x) { int xx = x; conv[4] = MINUSOR(xx, RJDIGIT(xx, 100)); conv[5] = RJDIGIT(xx, 10); @@ -94,7 +124,7 @@ char* i16tostr3(const int16_t x) { } // Convert unsigned 16bit int to lj string with 123 format -char* i16tostr3left(const int16_t i) { +const char* i16tostr3left(const int16_t i) { char *str = &conv[6]; *str = DIGIMOD(i, 1); if (i >= 10) { @@ -106,7 +136,7 @@ char* i16tostr3left(const int16_t i) { } // Convert signed 16bit int to rj string with 1234, _123, -123, _-12, or __-1 format -char* i16tostr4sign(const int16_t i) { +const char* i16tostr4sign(const int16_t i) { const bool neg = i < 0; const int ii = neg ? -i : i; if (i >= 1000) { @@ -135,7 +165,7 @@ char* i16tostr4sign(const int16_t i) { } // Convert unsigned float to string with 1.23 format -char* ftostr12ns(const float &f) { +const char* ftostr12ns(const float &f) { const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10; conv[3] = DIGIMOD(i, 100); conv[4] = '.'; @@ -145,7 +175,7 @@ char* ftostr12ns(const float &f) { } // Convert signed float to fixed-length string with 12.34 / -2.34 format or 123.45 / -23.45 format -char* ftostr42_52(const float &f) { +const char* ftostr42_52(const float &f) { if (f <= -10 || f >= 100) return ftostr52(f); // need more digits long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; conv[2] = (f >= 0 && f < 10) ? ' ' : MINUSOR(i, DIGIMOD(i, 1000)); @@ -157,7 +187,7 @@ char* ftostr42_52(const float &f) { } // Convert signed float to fixed-length string with 023.45 / -23.45 format -char* ftostr52(const float &f) { +const 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); @@ -171,7 +201,7 @@ char* ftostr52(const float &f) { #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 char* ftostr4sign(const float &f) { const int i = (f * 100 + (f < 0 ? -5: 5)) / 10; if (!WITHIN(i, -99, 999)) return i16tostr4sign((int)f); const bool neg = i < 0; @@ -183,10 +213,10 @@ char* ftostr52(const float &f) { return &conv[3]; } -#endif // LCD_DECIMAL_SMALL_XY +#endif // Convert float to fixed-length string with +123.4 / -123.4 format -char* ftostr41sign(const float &f) { +const char* ftostr41sign(const float &f) { int i = (f * 100 + (f < 0 ? -5: 5)) / 10; conv[1] = MINUSOR(i, '+'); conv[2] = DIGIMOD(i, 1000); @@ -198,7 +228,7 @@ char* ftostr41sign(const float &f) { } // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format -char* ftostr43sign(const float &f, char plus/*=' '*/) { +const 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); @@ -210,7 +240,7 @@ char* ftostr43sign(const float &f, char plus/*=' '*/) { } // Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format -char* ftostr54sign(const float &f, char plus/*=' '*/) { +const char* ftostr54sign(const float &f, char plus/*=' '*/) { long i = (f * 100000 + (f < 0 ? -5: 5)) / 10; conv[0] = i ? MINUSOR(i, plus) : ' '; conv[1] = DIGIMOD(i, 10000); @@ -223,13 +253,13 @@ char* ftostr54sign(const float &f, char plus/*=' '*/) { } // Convert unsigned float to rj string with 12345 format -char* ftostr5rj(const float &f) { +const char* ftostr5rj(const float &f) { const long i = ((f < 0 ? -f : f) * 10 + 5) / 10; return ui16tostr5(i); } // Convert signed float to string with +1234.5 format -char* ftostr51sign(const float &f) { +const char* ftostr51sign(const float &f) { long i = (f * 100 + (f < 0 ? -5: 5)) / 10; conv[0] = MINUSOR(i, '+'); conv[1] = DIGIMOD(i, 10000); @@ -242,7 +272,7 @@ char* ftostr51sign(const float &f) { } // Convert signed float to string with +123.45 format -char* ftostr52sign(const float &f) { +const char* ftostr52sign(const float &f) { long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; conv[0] = MINUSOR(i, '+'); conv[1] = DIGIMOD(i, 10000); @@ -255,7 +285,7 @@ char* ftostr52sign(const float &f) { } // Convert unsigned float to string with 1234.5 format omitting trailing zeros -char* ftostr51rj(const float &f) { +const char* ftostr51rj(const float &f) { const long i = ((f < 0 ? -f : f) * 100 + 5) / 10; conv[0] = ' '; conv[1] = RJDIGIT(i, 10000); @@ -268,7 +298,7 @@ char* ftostr51rj(const float &f) { } // Convert signed float to space-padded string with -_23.4_ format -char* ftostr52sp(const float &f) { +const char* ftostr52sp(const float &f) { long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; uint8_t dig; conv[0] = MINUSOR(i, ' '); diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index 1c18fd6edde8..f18df094a3eb 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -21,75 +21,84 @@ */ #pragma once -#include "../inc/MarlinConfigPre.h" +#include // Convert a full-range unsigned 8bit int to a percentage -char* ui8tostr4pct(const uint8_t i); +const char* ui8tostr4pct(const uint8_t i); // Convert uint8_t to string with 123 format -char* ui8tostr3(const uint8_t i); +const char* ui8tostr3(const uint8_t i); // Convert int8_t to string with 123 format -char* i8tostr3(const int8_t x); +const char* i8tostr3(const int8_t x); + +#if HAS_PRINT_PROGRESS_PERMYRIAD + // Convert 16-bit unsigned permyriad value to percent: 100 / 23 / 23.4 / 3.45 + const char* permyriadtostr4(const uint16_t xx); +#endif // Convert uint16_t to string with 12345 format -char* ui16tostr5(const uint16_t x); +const char* ui16tostr5(const uint16_t x); // Convert uint16_t to string with 1234 format -char* ui16tostr4(const uint16_t x); +const char* ui16tostr4(const uint16_t x); // Convert uint16_t to string with 123 format -char* ui16tostr3(const uint16_t x); +const char* ui16tostr3(const uint16_t x); // Convert int16_t to string with 123 format -char* i16tostr3(const int16_t x); +const char* i16tostr3(const int16_t x); // Convert unsigned int to lj string with 123 format -char* i16tostr3left(const int16_t xx); +const char* i16tostr3left(const int16_t xx); // Convert signed int to rj string with _123, -123, _-12, or __-1 format -char* i16tostr4sign(const int16_t x); +const char* i16tostr4sign(const int16_t x); // Convert unsigned float to string with 1.23 format -char* ftostr12ns(const float &x); +const char* ftostr12ns(const float &x); // Convert signed float to fixed-length string with 12.34 / -2.34 or 023.45 / -23.45 format -char* ftostr42_52(const float &x); +const char* ftostr42_52(const float &x); // Convert signed float to fixed-length string with 023.45 / -23.45 format -char* ftostr52(const float &x); +const char* ftostr52(const float &x); // Convert float to fixed-length string with +123.4 / -123.4 format -char* ftostr41sign(const float &x); +const char* ftostr41sign(const float &x); // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format -char* ftostr43sign(const float &x, char plus=' '); +const char* ftostr43sign(const float &x, char plus=' '); // Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format -char* ftostr54sign(const float &x, char plus=' '); +const char* ftostr54sign(const float &x, char plus=' '); // Convert unsigned float to rj string with 12345 format -char* ftostr5rj(const float &x); +const char* ftostr5rj(const float &x); // Convert signed float to string with +1234.5 format -char* ftostr51sign(const float &x); +const char* ftostr51sign(const float &x); // Convert signed float to space-padded string with -_23.4_ format -char* ftostr52sp(const float &x); +const char* ftostr52sp(const float &x); // Convert signed float to string with +123.45 format -char* ftostr52sign(const float &x); +const char* ftostr52sign(const float &x); // Convert unsigned float to string with 1234.5 format omitting trailing zeros -char* ftostr51rj(const float &x); +const char* ftostr51rj(const float &x); + +#include "../core/macros.h" // Convert float to rj string with 123 or -12 format -FORCE_INLINE char* ftostr3(const float &x) { return i16tostr3(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } +FORCE_INLINE const char* ftostr3(const float &x) { return i16tostr3(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } + +#include "../inc/MarlinConfigPre.h" #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); + const 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 i16tostr4sign(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } + FORCE_INLINE const char* ftostr4sign(const float &x) { return i16tostr4sign(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } #endif diff --git a/Marlin/src/libs/point_t.h b/Marlin/src/libs/point_t.h deleted file mode 100644 index 5c7d8feac6c7..000000000000 --- a/Marlin/src/libs/point_t.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -#include - -/** - * @brief Cartesian Point - * @details Represents a three dimensional point on Cartesian coordinate system, - * using an additional fourth dimension for the extrusion length. - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - * @param z The z-coordinate of the point. - */ -struct point_t { - float x, y, z; - - /** - * @brief Three dimensional point constructor - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - * @param z The z-coordinate of the point. - */ - point_t(const float x, const float y, const float z) : x(x), y(y), z(z) {} - - /** - * @brief Two dimensional point constructor - * - * @param x The x-coordinate of the point. - * @param y The y-coordinate of the point. - */ - point_t(const float x, const float y) : point_t(x, y, NAN) {} - -}; diff --git a/Marlin/src/libs/softspi.h b/Marlin/src/libs/softspi.h index 8595a69e81e6..39d56b26f78b 100644 --- a/Marlin/src/libs/softspi.h +++ b/Marlin/src/libs/softspi.h @@ -475,7 +475,7 @@ static constexpr uint8_t digitalPinCount = sizeof(pinMap) / sizeof(pin_map_t); /** generate bad pin number error */ - void badPinNumber(void) + void badPinNumber() __attribute__((error("Pin number is too large or not a constant"))); /** diff --git a/Marlin/src/libs/stopwatch.cpp b/Marlin/src/libs/stopwatch.cpp index 6a6ea03c1b42..b80a1597d5f7 100644 --- a/Marlin/src/libs/stopwatch.cpp +++ b/Marlin/src/libs/stopwatch.cpp @@ -24,6 +24,10 @@ #include "../inc/MarlinConfig.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../lcd/extensible_ui/ui_api.h" +#endif + Stopwatch::State Stopwatch::state; millis_t Stopwatch::accumulator; millis_t Stopwatch::startTimestamp; @@ -35,6 +39,9 @@ bool Stopwatch::stop() { #endif if (isRunning() || isPaused()) { + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onPrintTimerStopped(); + #endif state = STOPPED; stopTimestamp = millis(); return true; @@ -48,6 +55,9 @@ bool Stopwatch::pause() { #endif if (isRunning()) { + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onPrintTimerPaused(); + #endif state = PAUSED; stopTimestamp = millis(); return true; @@ -60,6 +70,10 @@ bool Stopwatch::start() { Stopwatch::debug(PSTR("start")); #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onPrintTimerStarted(); + #endif + if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index 77e9df98b02a..013c243cfe7b 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -25,7 +25,9 @@ //#define DEBUG_STOPWATCH #include "../core/macros.h" // for FORCE_INLINE -#include "../core/millis_t.h" + +#include +typedef uint32_t millis_t; /** * @brief Stopwatch class diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index 9ffc852feb3a..c2bb347dacf1 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -47,78 +47,78 @@ #include -vector_3::vector_3() : x(0), y(0), z(0) { } - -vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { } +/** + * vector_3 + */ vector_3 vector_3::cross(const vector_3 &left, const vector_3 &right) { - return vector_3(left.y * right.z - left.z * right.y, - left.z * right.x - left.x * right.z, - left.x * right.y - left.y * right.x); + const xyz_float_t &lv = left, &rv = right; + return vector_3(lv.y * rv.z - lv.z * rv.y, // YZ cross + lv.z * rv.x - lv.x * rv.z, // ZX cross + lv.x * rv.y - lv.y * rv.x); // XY cross } -vector_3 vector_3::operator+(const vector_3 &v) { return vector_3((x + v.x), (y + v.y), (z + v.z)); } -vector_3 vector_3::operator-(const vector_3 &v) { return vector_3((x - v.x), (y - v.y), (z - v.z)); } - vector_3 vector_3::get_normal() const { - vector_3 normalized = vector_3(x, y, z); + vector_3 normalized = *this; normalized.normalize(); return normalized; } -float vector_3::get_length() const { return SQRT(sq(x) + sq(y) + sq(z)); } - void vector_3::normalize() { - const float inv_length = RSQRT(sq(x) + sq(y) + sq(z)); - x *= inv_length; - y *= inv_length; - z *= inv_length; + *this *= RSQRT(sq(x) + sq(y) + sq(z)); } +// Apply a rotation to the matrix void vector_3::apply_rotation(const matrix_3x3 &matrix) { - const float _x = x, _y = y; - x = _x * matrix.matrix[3 * 0 + 0] + _y * matrix.matrix[3 * 1 + 0] + z * matrix.matrix[3 * 2 + 0]; - y = _x * matrix.matrix[3 * 0 + 1] + _y * matrix.matrix[3 * 1 + 1] + z * matrix.matrix[3 * 2 + 1]; - z = _x * matrix.matrix[3 * 0 + 2] + _y * matrix.matrix[3 * 1 + 2] + z * matrix.matrix[3 * 2 + 2]; + const float _x = x, _y = y, _z = z; + *this = { matrix.vectors[0][0] * _x + matrix.vectors[1][0] * _y + matrix.vectors[2][0] * _z, + matrix.vectors[0][1] * _x + matrix.vectors[1][1] * _y + matrix.vectors[2][1] * _z, + matrix.vectors[0][2] * _x + matrix.vectors[1][2] * _y + matrix.vectors[2][2] * _z }; } +extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[]; + void vector_3::debug(PGM_P const title) { serialprintPGM(title); - SERIAL_ECHOPAIR_F(" x: ", x, 6); - SERIAL_ECHOPAIR_F(" y: ", y, 6); - SERIAL_ECHOLNPAIR_F(" z: ", z, 6); + SERIAL_ECHOPAIR_F_P(SP_X_STR, x, 6); + SERIAL_ECHOPAIR_F_P(SP_Y_STR, y, 6); + SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z, 6); } -void apply_rotation_xyz(const matrix_3x3 &matrix, float &x, float &y, float &z) { - vector_3 vector = vector_3(x, y, z); - vector.apply_rotation(matrix); - x = vector.x; - y = vector.y; - z = vector.z; +/** + * matrix_3x3 + */ + +void apply_rotation_xyz(const matrix_3x3 &matrix, float &_x, float &_y, float &_z) { + vector_3 vec = vector_3(_x, _y, _z); vec.apply_rotation(matrix); + _x = vec.x; _y = vec.y; _z = vec.z; +} + +// Reset to identity. No rotate or translate. +void matrix_3x3::set_to_identity() { + for (uint8_t i = 0; i < 3; i++) + for (uint8_t j = 0; j < 3; j++) + vectors[i][j] = float(i == j); } +// Create a matrix from 3 vector_3 inputs matrix_3x3 matrix_3x3::create_from_rows(const vector_3 &row_0, const vector_3 &row_1, const vector_3 &row_2) { //row_0.debug(PSTR("row_0")); //row_1.debug(PSTR("row_1")); //row_2.debug(PSTR("row_2")); matrix_3x3 new_matrix; - new_matrix.matrix[0] = row_0.x; new_matrix.matrix[1] = row_0.y; new_matrix.matrix[2] = row_0.z; - new_matrix.matrix[3] = row_1.x; new_matrix.matrix[4] = row_1.y; new_matrix.matrix[5] = row_1.z; - new_matrix.matrix[6] = row_2.x; new_matrix.matrix[7] = row_2.y; new_matrix.matrix[8] = row_2.z; + new_matrix.vectors[0] = row_0; + new_matrix.vectors[1] = row_1; + new_matrix.vectors[2] = row_2; //new_matrix.debug(PSTR("new_matrix")); return new_matrix; } -void matrix_3x3::set_to_identity() { - matrix[0] = 1; matrix[1] = 0; matrix[2] = 0; - matrix[3] = 0; matrix[4] = 1; matrix[5] = 0; - matrix[6] = 0; matrix[7] = 0; matrix[8] = 1; -} - +// Create a matrix rotated to point towards a target matrix_3x3 matrix_3x3::create_look_at(const vector_3 &target) { - vector_3 z_row = target.get_normal(), - x_row = vector_3(1, 0, -target.x / target.z).get_normal(), - y_row = vector_3::cross(z_row, x_row).get_normal(); + const vector_3 z_row = target.get_normal(), + x_row = vector_3(1, 0, -target.x / target.z).get_normal(), + y_row = vector_3::cross(z_row, x_row).get_normal(); // x_row.debug(PSTR("x_row")); // y_row.debug(PSTR("y_row")); @@ -131,11 +131,12 @@ matrix_3x3 matrix_3x3::create_look_at(const vector_3 &target) { return rot; } +// Get a transposed copy of the matrix matrix_3x3 matrix_3x3::transpose(const matrix_3x3 &original) { matrix_3x3 new_matrix; - new_matrix.matrix[0] = original.matrix[0]; new_matrix.matrix[1] = original.matrix[3]; new_matrix.matrix[2] = original.matrix[6]; - new_matrix.matrix[3] = original.matrix[1]; new_matrix.matrix[4] = original.matrix[4]; new_matrix.matrix[5] = original.matrix[7]; - new_matrix.matrix[6] = original.matrix[2]; new_matrix.matrix[7] = original.matrix[5]; new_matrix.matrix[8] = original.matrix[8]; + for (uint8_t i = 0; i < 3; i++) + for (uint8_t j = 0; j < 3; j++) + new_matrix.vectors[i][j] = original.vectors[j][i]; return new_matrix; } @@ -144,13 +145,11 @@ void matrix_3x3::debug(PGM_P const title) { serialprintPGM(title); SERIAL_EOL(); } - uint8_t count = 0; for (uint8_t i = 0; i < 3; i++) { for (uint8_t j = 0; j < 3; j++) { - if (matrix[count] >= 0.0) SERIAL_CHAR('+'); - SERIAL_ECHO_F(matrix[count], 6); + if (vectors[i][j] >= 0.0) SERIAL_CHAR('+'); + SERIAL_ECHO_F(vectors[i][j], 6); SERIAL_CHAR(' '); - count++; } SERIAL_EOL(); } diff --git a/Marlin/src/libs/vector_3.h b/Marlin/src/libs/vector_3.h index 0a986374d8c8..e065697f0519 100644 --- a/Marlin/src/libs/vector_3.h +++ b/Marlin/src/libs/vector_3.h @@ -40,31 +40,41 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#pragma once +#include "../core/types.h" class matrix_3x3; -struct vector_3 { - float x, y, z; +struct vector_3 : xyz_float_t { - vector_3(); - vector_3(float x, float y, float z); + vector_3(const float &_x, const float &_y, const float &_z) { set(_x, _y, _z); } + vector_3(const xy_float_t &in) { set(in.x, in.y); } + vector_3(const xyz_float_t &in) { set(in.x, in.y, in.z); } + vector_3(const xyze_float_t &in) { set(in.x, in.y, in.z); } + vector_3() { reset(); } + // Factory method static vector_3 cross(const vector_3 &a, const vector_3 &b); - vector_3 operator+(const vector_3 &v); - vector_3 operator-(const vector_3 &v); + // Modifiers void normalize(); + void apply_rotation(const matrix_3x3 &matrix); + + // Accessors float get_length() const; vector_3 get_normal() const; + // Operators + FORCE_INLINE vector_3 operator+(const vector_3 &v) const { vector_3 o = *this; o += v; return o; } + FORCE_INLINE vector_3 operator-(const vector_3 &v) const { vector_3 o = *this; o -= v; return o; } + FORCE_INLINE vector_3 operator*(const float &v) const { vector_3 o = *this; o *= v; return o; } + void debug(PGM_P const title); - void apply_rotation(const matrix_3x3 &matrix); }; struct matrix_3x3 { - float matrix[9]; + abc_float_t vectors[3]; + // Factory methods static matrix_3x3 create_from_rows(const vector_3 &row_0, const vector_3 &row_1, const vector_3 &row_2); static matrix_3x3 create_look_at(const vector_3 &target); static matrix_3x3 transpose(const matrix_3x3 &original); @@ -74,5 +84,7 @@ struct matrix_3x3 { void debug(PGM_P const title); }; - void apply_rotation_xyz(const matrix_3x3 &rotationMatrix, float &x, float &y, float &z); +FORCE_INLINE void apply_rotation_xyz(const matrix_3x3 &rotationMatrix, xyz_pos_t &pos) { + apply_rotation_xyz(rotationMatrix, pos.x, pos.y, pos.z); +} diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 7ec76ae3d1cd..1a090613f8ca 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -37,7 +37,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V67" +#define EEPROM_VERSION "V74" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -52,7 +52,7 @@ #include "temperature.h" #include "../lcd/ultralcd.h" #include "../core/language.h" -#include "../libs/vector_3.h" +#include "../libs/vector_3.h" // for matrix_3x3 #include "../gcode/gcode.h" #include "../Marlin.h" @@ -60,6 +60,8 @@ #include "../HAL/shared/persistent_store_api.h" #endif +#include "probe.h" + #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" #endif @@ -78,10 +80,6 @@ #define EEPROM_NUM_SERVOS NUM_SERVO_PLUGS #endif -#if HAS_BED_PROBE - #include "probe.h" -#endif - #include "../feature/fwretract.h" #if ENABLED(POWER_LOSS_RECOVERY) @@ -98,10 +96,8 @@ #include "../feature/runout.h" #endif -#include "../lcd/extensible_ui/ui_api.h" - #if ENABLED(EXTRA_LIN_ADVANCE_K) -extern float saved_extruder_advance_K[EXTRUDERS]; + extern float saved_extruder_advance_K[EXTRUDERS]; #endif #if EXTRUDERS > 1 @@ -114,7 +110,7 @@ extern float saved_extruder_advance_K[EXTRUDERS]; #endif #if HAS_TRINAMIC - #include "stepper_indirection.h" + #include "stepper/indirection.h" #include "../feature/tmc_util.h" #endif @@ -122,12 +118,19 @@ extern float saved_extruder_advance_K[EXTRUDERS]; typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t; typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_hybrid_threshold_t; -typedef struct { int16_t X, Y, Z; } tmc_sgt_t; +typedef struct { int16_t X, Y, Z, X2; } tmc_sgt_t; typedef struct { bool X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stealth_enabled_t; // Limit an index to an array size #define ALIM(I,ARR) _MIN(I, COUNT(ARR) - 1) +// Defaults for reset / fill in on load +static const uint32_t _DMA[] PROGMEM = DEFAULT_MAX_ACCELERATION; +static const float _DASU[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT; +static const feedRate_t _DMF[] PROGMEM = DEFAULT_MAX_FEEDRATE; + +extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[]; + /** * Current EEPROM Layout * @@ -145,13 +148,13 @@ typedef struct SettingsDataStruct { planner_settings_t planner_settings; - float planner_max_jerk[XYZE], // M205 XYZE planner.max_jerk[XYZE] - planner_junction_deviation_mm; // M205 J planner.junction_deviation_mm + xyze_float_t planner_max_jerk; // M205 XYZE planner.max_jerk + float planner_junction_deviation_mm; // M205 J planner.junction_deviation_mm - float home_offset[XYZ]; // M206 XYZ / M665 TPZ + xyz_pos_t home_offset; // M206 XYZ / M665 TPZ #if HAS_HOTEND_OFFSET - float hotend_offset[XYZ][HOTENDS - 1]; // M218 XYZ + xyz_pos_t hotend_offset[HOTENDS - 1]; // M218 XYZ #endif // @@ -180,7 +183,7 @@ typedef struct SettingsDataStruct { // HAS_BED_PROBE // - float zprobe_zoffset; + xyz_pos_t probe_offset; // // ABL_PLANAR @@ -191,10 +194,9 @@ typedef struct SettingsDataStruct { // 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 + xy_pos_t bilinear_grid_spacing, bilinear_start; // G29 L F #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; // G29 + bed_mesh_t z_values; // G29 #else float z_values[3][3]; #endif @@ -219,13 +221,12 @@ typedef struct SettingsDataStruct { // DELTA / [XYZ]_DUAL_ENDSTOPS // #if ENABLED(DELTA) - float delta_height, // M666 H - delta_endstop_adj[ABC], // M666 XYZ - delta_radius, // M665 R + float delta_height; // M666 H + abc_float_t delta_endstop_adj; // M666 XYZ + float 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 + delta_segments_per_second; // M665 S + abc_float_t delta_tower_angle_trim; // M665 XYZ #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS float x2_endstop_adj, // M666 X y2_endstop_adj, // M666 Y @@ -243,7 +244,7 @@ typedef struct SettingsDataStruct { // // PIDTEMP // - PIDC_t hotendPID[HOTENDS]; // M301 En PIDC / M303 En U + PIDCF_t hotendPID[HOTENDS]; // M301 En PIDCF / M303 En U int16_t lpq_len; // M301 L // @@ -285,7 +286,7 @@ typedef struct SettingsDataStruct { // tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5 tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5 - tmc_sgt_t tmc_sgt; // M914 X Y Z + tmc_sgt_t tmc_sgt; // M914 X Y Z X2 tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5 // @@ -301,7 +302,7 @@ typedef struct SettingsDataStruct { // // CNC_COORDINATE_SYSTEMS // - float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; // G54-G59.3 + xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS]; // G54-G59.3 // // SKEW_CORRECTION @@ -311,7 +312,9 @@ typedef struct SettingsDataStruct { // // ADVANCED_PAUSE_FEATURE // - fil_change_settings_t fc_settings[EXTRUDERS]; // M603 T U L + #if EXTRUDERS + fil_change_settings_t fc_settings[EXTRUDERS]; // M603 T U L + #endif // // Tool-change settings @@ -323,7 +326,7 @@ typedef struct SettingsDataStruct { // // BACKLASH_COMPENSATION // - float backlash_distance_mm[XYZ]; // M425 X Y Z + xyz_float_t backlash_distance_mm; // M425 X Y Z uint8_t backlash_correction; // M425 F float backlash_smoothing_mm; // M425 S @@ -352,7 +355,7 @@ uint16_t MarlinSettings::datasize() { return sizeof(SettingsData); } #endif void MarlinSettings::postprocess() { - const float oldpos[XYZE] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS] }; + xyze_pos_t oldpos = current_position; // steps per s2 needs to be updated to agree with units per s2 planner.reset_acceleration_rates(); @@ -369,7 +372,7 @@ void MarlinSettings::postprocess() { #if DISABLED(NO_VOLUMETRICS) planner.calculate_volumetric_multipliers(); - #else + #elif EXTRUDERS for (uint8_t i = COUNT(planner.e_factor); i--;) planner.refresh_e_factor(i); #endif @@ -396,7 +399,7 @@ void MarlinSettings::postprocess() { fwretract.refresh_autoretract(); #endif - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) + #if HAS_LINEAR_E_JERK planner.recalculate_max_e_jerk(); #endif @@ -405,7 +408,7 @@ void MarlinSettings::postprocess() { planner.refresh_positioning(); // Various factors can change the current position - if (memcmp(oldpos, current_position, sizeof(oldpos))) + if (oldpos != current_position) report_current_position(); } @@ -444,40 +447,31 @@ void MarlinSettings::postprocess() { #endif // SD_FIRMWARE_UPDATE +#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE + static_assert( + EEPROM_OFFSET + sizeof(SettingsData) < ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE, + "ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE is insufficient to capture all EEPROM data." + ); +#endif + #define DEBUG_OUT ENABLED(EEPROM_CHITCHAT) #include "../core/debug_out.h" #if ENABLED(EEPROM_SETTINGS) - #define WORD_PADDED_EEPROM ENABLED(__STM32F1__, FLASH_EEPROM_EMULATION) - - #if WORD_PADDED_EEPROM && ENABLED(DEBUG_EEPROM_READWRITE) - #define UPDATE_TEST_INDEX(VAR) (text_index += sizeof(VAR)) - #else - #define UPDATE_TEST_INDEX(VAR) NOOP - #endif - #if WORD_PADDED_EEPROM - #define EEPROM_SKIP(VAR) do{ eeprom_index += sizeof(VAR) + (sizeof(VAR) & 1); UPDATE_TEST_INDEX(sizeof(VAR)); }while(0) - #else - #define EEPROM_SKIP(VAR) (eeprom_index += sizeof(VAR)) - #endif - - #define EEPROM_START() int eeprom_index = EEPROM_OFFSET; persistentStore.access_start() + #define EEPROM_START() if (!persistentStore.access_start()) { SERIAL_ECHO_MSG("No EEPROM."); return false; } \ + int eeprom_index = EEPROM_OFFSET #define EEPROM_FINISH() persistentStore.access_finish() - #define EEPROM_WRITE(VAR) do{ persistentStore.write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc); UPDATE_TEST_INDEX(VAR); }while(0) - #define EEPROM_READ(VAR) do{ persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, !validating); UPDATE_TEST_INDEX(VAR); }while(0) - #define EEPROM_READ_ALWAYS(VAR) do{ persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc); UPDATE_TEST_INDEX(VAR); }while(0) + #define EEPROM_SKIP(VAR) (eeprom_index += sizeof(VAR)) + #define EEPROM_WRITE(VAR) do{ persistentStore.write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc); }while(0) + #define EEPROM_READ(VAR) do{ persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, !validating); }while(0) + #define EEPROM_READ_ALWAYS(VAR) do{ persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc); }while(0) #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_MSG(ERR); eeprom_error = true; } }while(0) #if ENABLED(DEBUG_EEPROM_READWRITE) - #if WORD_PADDED_EEPROM - int test_index; - #else - #define test_index eeprom_index - #endif #define _FIELD_TEST(FIELD) \ EEPROM_ASSERT( \ - eeprom_error || test_index == offsetof(SettingsData, FIELD) + EEPROM_OFFSET, \ + eeprom_error || eeprom_index == offsetof(SettingsData, FIELD) + EEPROM_OFFSET, \ "Field " STRINGIFY(FIELD) " mismatch." \ ) #else @@ -530,16 +524,16 @@ void MarlinSettings::postprocess() { #if HAS_CLASSIC_JERK EEPROM_WRITE(planner.max_jerk); - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) + #if HAS_LINEAR_E_JERK dummy = float(DEFAULT_EJERK); EEPROM_WRITE(dummy); #endif #else - const float planner_max_jerk[XYZE] = { float(DEFAULT_EJERK) }; + const xyze_pos_t planner_max_jerk = { 10, 10, 0.4, float(DEFAULT_EJERK) }; EEPROM_WRITE(planner_max_jerk); #endif - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) EEPROM_WRITE(planner.junction_deviation_mm); #else dummy = 0.02f; @@ -557,7 +551,7 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(scara_home_offset); #else #if !HAS_HOME_OFFSET - const float home_offset[XYZ] = { 0 }; + const xyz_pos_t home_offset{0}; #endif EEPROM_WRITE(home_offset); #endif @@ -565,7 +559,7 @@ void MarlinSettings::postprocess() { #if HAS_HOTEND_OFFSET // Skip hotend 0 which must be 0 for (uint8_t e = 1; e < HOTENDS; e++) - LOOP_XYZ(i) EEPROM_WRITE(hotend_offset[i][e]); + EEPROM_WRITE(hotend_offset[e]); #endif } @@ -576,7 +570,7 @@ void MarlinSettings::postprocess() { #if HAS_FILAMENT_SENSOR const bool &runout_sensor_enabled = runout.enabled; #else - const bool runout_sensor_enabled = false; + const bool runout_sensor_enabled = true; #endif #if HAS_FILAMENT_SENSOR && defined(FILAMENT_RUNOUT_DISTANCE_MM) const float &runout_distance_mm = runout.runout_distance(); @@ -628,15 +622,11 @@ void MarlinSettings::postprocess() { } // - // Probe Z Offset + // Probe XYZ Offsets // { - _FIELD_TEST(zprobe_zoffset); - - #if !HAS_BED_PROBE - const float zprobe_zoffset = 0; - #endif - EEPROM_WRITE(zprobe_zoffset); + _FIELD_TEST(probe_offset); + EEPROM_WRITE(probe_offset); } // @@ -670,7 +660,7 @@ void MarlinSettings::postprocess() { #else // 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 }; + const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; dummy = 0; EEPROM_WRITE(grid_max_x); EEPROM_WRITE(grid_max_y); @@ -735,7 +725,6 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(delta_radius); // 1 float EEPROM_WRITE(delta_diagonal_rod); // 1 float EEPROM_WRITE(delta_segments_per_second); // 1 float - EEPROM_WRITE(delta_calibration_radius); // 1 float EEPROM_WRITE(delta_tower_angle_trim); // 3 floats #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS @@ -777,7 +766,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(ui_preheat_hotend_temp); - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU const int16_t (&ui_preheat_hotend_temp)[2] = ui.preheat_hotend_temp, (&ui_preheat_bed_temp)[2] = ui.preheat_bed_temp; const uint8_t (&ui_preheat_fan_speed)[2] = ui.preheat_fan_speed; @@ -798,10 +787,19 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(hotendPID); HOTEND_LOOP() { - PIDC_t pidc = { - PID_PARAM(Kp, e), PID_PARAM(Ki, e), PID_PARAM(Kd, e), PID_PARAM(Kc, e) + PIDCF_t pidcf = { + #if DISABLED(PIDTEMP) + DUMMY_PID_VALUE, DUMMY_PID_VALUE, DUMMY_PID_VALUE, + DUMMY_PID_VALUE, DUMMY_PID_VALUE + #else + PID_PARAM(Kp, e), + unscalePID_i(PID_PARAM(Ki, e)), + unscalePID_d(PID_PARAM(Kd, e)), + PID_PARAM(Kc, e), + PID_PARAM(Kf, e) + #endif }; - EEPROM_WRITE(pidc); + EEPROM_WRITE(pidcf); } _FIELD_TEST(lpq_len); @@ -819,12 +817,17 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(bedPID); - #if DISABLED(PIDTEMPBED) - const PID_t bed_pid = { DUMMY_PID_VALUE, DUMMY_PID_VALUE, DUMMY_PID_VALUE }; - EEPROM_WRITE(bed_pid); - #else - EEPROM_WRITE(thermalManager.temp_bed.pid); - #endif + const PID_t bed_pid = { + #if DISABLED(PIDTEMPBED) + DUMMY_PID_VALUE, DUMMY_PID_VALUE, DUMMY_PID_VALUE + #else + // Store the unscaled PID values + thermalManager.temp_bed.pid.Kp, + unscalePID_i(thermalManager.temp_bed.pid.Ki), + unscalePID_d(thermalManager.temp_bed.pid.Kd) + #endif + }; + EEPROM_WRITE(bed_pid); } // @@ -846,8 +849,10 @@ void MarlinSettings::postprocess() { const int16_t lcd_contrast = #if HAS_LCD_CONTRAST ui.contrast + #elif defined(DEFAULT_LCD_CONTRAST) + DEFAULT_LCD_CONTRAST #else - 32 + 127 #endif ; EEPROM_WRITE(lcd_contrast); @@ -1048,11 +1053,14 @@ void MarlinSettings::postprocess() { // TMC StallGuard threshold // { - tmc_sgt_t tmc_sgt = { 0, 0, 0 }; + tmc_sgt_t tmc_sgt{0}; #if USE_SENSORLESS #if X_SENSORLESS tmc_sgt.X = stepperX.homing_threshold(); #endif + #if X2_SENSORLESS + tmc_sgt.X2 = stepperX2.homing_threshold(); + #endif #if Y_SENSORLESS tmc_sgt.Y = stepperY.homing_threshold(); #endif @@ -1150,8 +1158,8 @@ void MarlinSettings::postprocess() { #if HAS_MOTOR_CURRENT_PWM EEPROM_WRITE(stepper.motor_current_setting); #else - const uint32_t dummyui32[XYZ] = { 0 }; - EEPROM_WRITE(dummyui32); + const xyz_ulong_t no_current{0}; + EEPROM_WRITE(no_current); #endif } @@ -1164,7 +1172,7 @@ void MarlinSettings::postprocess() { #if ENABLED(CNC_COORDINATE_SYSTEMS) EEPROM_WRITE(gcode.coordinate_system); #else - const float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ] = { { 0 } }; + const xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS] = { { 0 } }; EEPROM_WRITE(coordinate_system); #endif @@ -1177,6 +1185,7 @@ void MarlinSettings::postprocess() { // // Advanced Pause filament load & unload lengths // + #if EXTRUDERS { #if DISABLED(ADVANCED_PAUSE_FEATURE) const fil_change_settings_t fc_settings[EXTRUDERS] = { 0, 0 }; @@ -1184,6 +1193,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(fc_settings); EEPROM_WRITE(fc_settings); } + #endif // // Multiple Extruders @@ -1198,25 +1208,20 @@ void MarlinSettings::postprocess() { // Backlash Compensation // { - #ifdef BACKLASH_DISTANCE_MM - const float (&backlash_distance_mm)[XYZ] = backlash.distance_mm; - #else - const float backlash_distance_mm[XYZ] = { 0 }; - #endif - #if ENABLED(BACKLASH_COMPENSATION) + #if ENABLED(BACKLASH_GCODE) + const xyz_float_t &backlash_distance_mm = backlash.distance_mm; const uint8_t &backlash_correction = backlash.correction; #else + const xyz_float_t backlash_distance_mm{0}; const uint8_t backlash_correction = 0; #endif - #ifdef BACKLASH_SMOOTHING_MM + #if ENABLED(BACKLASH_GCODE) && defined(BACKLASH_SMOOTHING_MM) const float &backlash_smoothing_mm = backlash.smoothing_mm; #else const float backlash_smoothing_mm = 3; #endif _FIELD_TEST(backlash_distance_mm); - EEPROM_WRITE(backlash_distance_mm[X_AXIS]); - EEPROM_WRITE(backlash_distance_mm[Y_AXIS]); - EEPROM_WRITE(backlash_distance_mm[Z_AXIS]); + EEPROM_WRITE(backlash_distance_mm); EEPROM_WRITE(backlash_correction); EEPROM_WRITE(backlash_smoothing_mm); } @@ -1309,21 +1314,19 @@ 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[XYZ + esteppers]; + float tmp2[XYZ + esteppers]; + feedRate_t tmp3[XYZ + esteppers]; EEPROM_READ(tmp1); // max_acceleration_mm_per_s2 EEPROM_READ(planner.settings.min_segment_time_us); - - float tmp2[XYZ + esteppers], tmp3[XYZ + esteppers]; EEPROM_READ(tmp2); // axis_steps_per_mm EEPROM_READ(tmp3); // max_feedrate_mm_s + if (!validating) LOOP_XYZE_N(i) { const bool in = (i < esteppers + XYZ); - planner.settings.max_acceleration_mm_per_s2[i] = in ? tmp1[i] : def1[ALIM(i, def1)]; - planner.settings.axis_steps_per_mm[i] = in ? tmp2[i] : def2[ALIM(i, def2)]; - planner.settings.max_feedrate_mm_s[i] = in ? tmp3[i] : def3[ALIM(i, def3)]; + planner.settings.max_acceleration_mm_per_s2[i] = in ? tmp1[i] : pgm_read_dword(&_DMA[ALIM(i, _DMA)]); + planner.settings.axis_steps_per_mm[i] = in ? tmp2[i] : pgm_read_float(&_DASU[ALIM(i, _DASU)]); + planner.settings.max_feedrate_mm_s[i] = in ? tmp3[i] : pgm_read_float(&_DMF[ALIM(i, _DMF)]); } EEPROM_READ(planner.settings.acceleration); @@ -1334,14 +1337,14 @@ void MarlinSettings::postprocess() { #if HAS_CLASSIC_JERK EEPROM_READ(planner.max_jerk); - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) + #if HAS_LINEAR_E_JERK EEPROM_READ(dummy); #endif #else for (uint8_t q = 4; q--;) EEPROM_READ(dummy); #endif - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) EEPROM_READ(planner.junction_deviation_mm); #else EEPROM_READ(dummy); @@ -1358,7 +1361,7 @@ void MarlinSettings::postprocess() { EEPROM_READ(scara_home_offset); #else #if !HAS_HOME_OFFSET - float home_offset[XYZ]; + xyz_pos_t home_offset; #endif EEPROM_READ(home_offset); #endif @@ -1371,7 +1374,7 @@ void MarlinSettings::postprocess() { #if HAS_HOTEND_OFFSET // Skip hotend 0 which must be 0 for (uint8_t e = 1; e < HOTENDS; e++) - LOOP_XYZ(i) EEPROM_READ(hotend_offset[i][e]); + EEPROM_READ(hotend_offset[e]); #endif } @@ -1390,7 +1393,7 @@ void MarlinSettings::postprocess() { float runout_distance_mm; EEPROM_READ(runout_distance_mm); #if HAS_FILAMENT_SENSOR && defined(FILAMENT_RUNOUT_DISTANCE_MM) - runout.set_runout_distance(runout_distance_mm); + if (!validating) runout.set_runout_distance(runout_distance_mm); #endif } @@ -1435,12 +1438,13 @@ void MarlinSettings::postprocess() { // Probe Z Offset // { - _FIELD_TEST(zprobe_zoffset); - - #if !HAS_BED_PROBE - float zprobe_zoffset; + _FIELD_TEST(probe_offset); + #if HAS_BED_PROBE + xyz_pos_t &zpo = probe_offset; + #else + xyz_pos_t zpo; #endif - EEPROM_READ(zprobe_zoffset); + EEPROM_READ(zpo); } // @@ -1472,7 +1476,7 @@ void MarlinSettings::postprocess() { #endif // AUTO_BED_LEVELING_BILINEAR { // Skip past disabled (or stale) Bilinear Grid data - int bgs[2], bs[2]; + xy_pos_t bgs, bs; EEPROM_READ(bgs); EEPROM_READ(bs); for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_READ(dummy); @@ -1536,7 +1540,6 @@ void MarlinSettings::postprocess() { EEPROM_READ(delta_radius); // 1 float EEPROM_READ(delta_diagonal_rod); // 1 float EEPROM_READ(delta_segments_per_second); // 1 float - EEPROM_READ(delta_calibration_radius); // 1 float EEPROM_READ(delta_tower_angle_trim); // 3 floats #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS @@ -1573,7 +1576,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(ui_preheat_hotend_temp); - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU int16_t (&ui_preheat_hotend_temp)[2] = ui.preheat_hotend_temp, (&ui_preheat_bed_temp)[2] = ui.preheat_bed_temp; uint8_t (&ui_preheat_fan_speed)[2] = ui.preheat_fan_speed; @@ -1591,16 +1594,19 @@ void MarlinSettings::postprocess() { // { HOTEND_LOOP() { - PIDC_t pidc; - EEPROM_READ(pidc); + PIDCF_t pidcf; + EEPROM_READ(pidcf); #if ENABLED(PIDTEMP) - if (!validating && pidc.Kp != DUMMY_PID_VALUE) { - // No need to scale PID values since EEPROM values are scaled - PID_PARAM(Kp, e) = pidc.Kp; - PID_PARAM(Ki, e) = pidc.Ki; - PID_PARAM(Kd, e) = pidc.Kd; + if (!validating && pidcf.Kp != DUMMY_PID_VALUE) { + // Scale PID values since EEPROM values are unscaled + PID_PARAM(Kp, e) = pidcf.Kp; + PID_PARAM(Ki, e) = scalePID_i(pidcf.Ki); + PID_PARAM(Kd, e) = scalePID_d(pidcf.Kd); #if ENABLED(PID_EXTRUSION_SCALING) - PID_PARAM(Kc, e) = pidc.Kc; + PID_PARAM(Kc, e) = pidcf.Kc; + #endif + #if ENABLED(PID_FAN_SCALING) + PID_PARAM(Kf, e) = pidcf.Kf; #endif } #endif @@ -1627,8 +1633,12 @@ void MarlinSettings::postprocess() { PID_t pid; EEPROM_READ(pid); #if ENABLED(PIDTEMPBED) - if (!validating && pid.Kp != DUMMY_PID_VALUE) - memcpy(&thermalManager.temp_bed.pid, &pid, sizeof(pid)); + if (!validating && pid.Kp != DUMMY_PID_VALUE) { + // Scale PID values since EEPROM values are unscaled + thermalManager.temp_bed.pid.Kp = pid.Kp; + thermalManager.temp_bed.pid.Ki = scalePID_i(pid.Ki); + thermalManager.temp_bed.pid.Kd = scalePID_d(pid.Kd); + } #endif } @@ -1836,10 +1846,13 @@ void MarlinSettings::postprocess() { #if AXIS_HAS_STALLGUARD(X) stepperX.homing_threshold(tmc_sgt.X); #endif - #if AXIS_HAS_STALLGUARD(X2) + #if AXIS_HAS_STALLGUARD(X2) && !X2_SENSORLESS stepperX2.homing_threshold(tmc_sgt.X); #endif #endif + #if X2_SENSORLESS + stepperX2.homing_threshold(tmc_sgt.X2); + #endif #ifdef Y_STALL_SENSITIVITY #if AXIS_HAS_STALLGUARD(Y) stepperY.homing_threshold(tmc_sgt.Y); @@ -1952,7 +1965,7 @@ void MarlinSettings::postprocess() { if (!validating) (void)gcode.select_coordinate_system(-1); // Go back to machine space EEPROM_READ(gcode.coordinate_system); #else - float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; + xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS]; EEPROM_READ(coordinate_system); #endif } @@ -1978,6 +1991,7 @@ void MarlinSettings::postprocess() { // // Advanced Pause filament load & unload lengths // + #if EXTRUDERS { #if DISABLED(ADVANCED_PAUSE_FEATURE) fil_change_settings_t fc_settings[EXTRUDERS]; @@ -1985,6 +1999,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(fc_settings); EEPROM_READ(fc_settings); } + #endif // // Tool-change settings @@ -1998,25 +2013,20 @@ void MarlinSettings::postprocess() { // Backlash Compensation // { - #ifdef BACKLASH_DISTANCE_MM - float (&backlash_distance_mm)[XYZ] = backlash.distance_mm; - #else - float backlash_distance_mm[XYZ]; - #endif - #if ENABLED(BACKLASH_COMPENSATION) + #if ENABLED(BACKLASH_GCODE) + xyz_float_t &backlash_distance_mm = backlash.distance_mm; uint8_t &backlash_correction = backlash.correction; #else + float backlash_distance_mm[XYZ]; uint8_t backlash_correction; #endif - #ifdef BACKLASH_SMOOTHING_MM + #if ENABLED(BACKLASH_GCODE) && defined(BACKLASH_SMOOTHING_MM) float &backlash_smoothing_mm = backlash.smoothing_mm; #else float backlash_smoothing_mm; #endif _FIELD_TEST(backlash_distance_mm); - EEPROM_READ(backlash_distance_mm[X_AXIS]); - EEPROM_READ(backlash_distance_mm[Y_AXIS]); - EEPROM_READ(backlash_distance_mm[Z_AXIS]); + EEPROM_READ(backlash_distance_mm); EEPROM_READ(backlash_correction); EEPROM_READ(backlash_smoothing_mm); } @@ -2030,8 +2040,7 @@ void MarlinSettings::postprocess() { const char extui_data[ExtUI::eeprom_data_size] = { 0 }; _FIELD_TEST(extui_data); EEPROM_READ(extui_data); - if(!validating) - ExtUI::onLoadSettings(extui_data); + if (!validating) ExtUI::onLoadSettings(extui_data); } #endif @@ -2080,7 +2089,7 @@ void MarlinSettings::postprocess() { } else { ubl.reset(); - DEBUG_ECHOLNPGM("UBL System reset()"); + DEBUG_ECHOLNPGM("UBL reset"); } } #endif @@ -2094,9 +2103,21 @@ void MarlinSettings::postprocess() { return !eeprom_error; } + #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE + extern bool restoreEEPROM(); + #endif + bool MarlinSettings::validate() { validating = true; - const bool success = _load(); + #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE + bool success = _load(); + if (!success && restoreEEPROM()) { + SERIAL_ECHOLNPGM("Recovered backup EEPROM settings from SPI Flash"); + success = _load(); + } + #else + const bool success = _load(); + #endif validating = false; return success; } @@ -2114,7 +2135,7 @@ void MarlinSettings::postprocess() { (void)save(); SERIAL_ECHO_MSG("EEPROM Initialized"); #endif - return true; + return false; } #if ENABLED(AUTO_BED_LEVELING_UBL) @@ -2224,20 +2245,18 @@ void MarlinSettings::postprocess() { * M502 - Reset Configuration */ 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_XYZE_N(i) { - planner.settings.axis_steps_per_mm[i] = pgm_read_float(&tmp1[ALIM(i, tmp1)]); - planner.settings.max_feedrate_mm_s[i] = pgm_read_float(&tmp2[ALIM(i, tmp2)]); - planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword(&tmp3[ALIM(i, tmp3)]); + planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword(&_DMA[ALIM(i, _DMA)]); + planner.settings.axis_steps_per_mm[i] = pgm_read_float(&_DASU[ALIM(i, _DASU)]); + planner.settings.max_feedrate_mm_s[i] = pgm_read_float(&_DMF[ALIM(i, _DMF)]); } planner.settings.min_segment_time_us = DEFAULT_MINSEGMENTTIME; planner.settings.acceleration = DEFAULT_ACCELERATION; planner.settings.retract_acceleration = DEFAULT_RETRACT_ACCELERATION; planner.settings.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION; - planner.settings.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE; - planner.settings.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE; + planner.settings.min_feedrate_mm_s = feedRate_t(DEFAULT_MINIMUMFEEDRATE); + planner.settings.min_travel_feedrate_mm_s = feedRate_t(DEFAULT_MINTRAVELFEEDRATE); #if HAS_CLASSIC_JERK #ifndef DEFAULT_XJERK @@ -2249,22 +2268,20 @@ void MarlinSettings::reset() { #ifndef DEFAULT_ZJERK #define DEFAULT_ZJERK 0 #endif - planner.max_jerk[X_AXIS] = DEFAULT_XJERK; - planner.max_jerk[Y_AXIS] = DEFAULT_YJERK; - planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK; - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) - planner.max_jerk[E_AXIS] = DEFAULT_EJERK; + planner.max_jerk.set(DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK); + #if HAS_CLASSIC_E_JERK + planner.max_jerk.e = DEFAULT_EJERK; #endif #endif - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM); #endif #if HAS_SCARA_OFFSET - ZERO(scara_home_offset); + scara_home_offset.reset(); #elif HAS_HOME_OFFSET - ZERO(home_offset); + home_offset.reset(); #endif #if HAS_HOTEND_OFFSET @@ -2290,23 +2307,21 @@ void MarlinSettings::reset() { #if EXTRUDERS > 1 #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) toolchange_settings.swap_length = TOOLCHANGE_FIL_SWAP_LENGTH; + toolchange_settings.extra_prime = TOOLCHANGE_FIL_EXTRA_PRIME; toolchange_settings.prime_speed = TOOLCHANGE_FIL_SWAP_PRIME_SPEED; toolchange_settings.retract_speed = TOOLCHANGE_FIL_SWAP_RETRACT_SPEED; #endif #if ENABLED(TOOLCHANGE_PARK) - toolchange_settings.change_point = TOOLCHANGE_PARK_XY; + constexpr xyz_pos_t tpxy = TOOLCHANGE_PARK_XY; + toolchange_settings.change_point = tpxy; #endif toolchange_settings.z_raise = TOOLCHANGE_ZRAISE; #endif #if ENABLED(BACKLASH_GCODE) backlash.correction = (BACKLASH_CORRECTION) * 255; - #ifdef BACKLASH_DISTANCE_MM - constexpr float tmp[XYZ] = BACKLASH_DISTANCE_MM; - backlash.distance_mm[X_AXIS] = tmp[X_AXIS]; - backlash.distance_mm[Y_AXIS] = tmp[Y_AXIS]; - backlash.distance_mm[Z_AXIS] = tmp[Z_AXIS]; - #endif + constexpr xyz_float_t tmp = BACKLASH_DISTANCE_MM; + backlash.distance_mm = tmp; #ifdef BACKLASH_SMOOTHING_MM backlash.smoothing_mm = BACKLASH_SMOOTHING_MM; #endif @@ -2337,7 +2352,9 @@ void MarlinSettings::reset() { #endif #if HAS_BED_PROBE - zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; + constexpr float dpo[XYZ] = NOZZLE_TO_PROBE_OFFSET; + static_assert(COUNT(dpo) == 3, "NOZZLE_TO_PROBE_OFFSET must contain offsets for X, Y, and Z."); + LOOP_XYZ(a) probe_offset[a] = dpo[a]; #endif // @@ -2360,14 +2377,13 @@ void MarlinSettings::reset() { // #if ENABLED(DELTA) - const float adj[ABC] = DELTA_ENDSTOP_ADJ, dta[ABC] = DELTA_TOWER_ANGLE_TRIM; + const abc_float_t adj = DELTA_ENDSTOP_ADJ, dta = DELTA_TOWER_ANGLE_TRIM; delta_height = DELTA_HEIGHT; - COPY(delta_endstop_adj, adj); + delta_endstop_adj = adj; delta_radius = DELTA_RADIUS; delta_diagonal_rod = DELTA_DIAGONAL_ROD; delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND; - delta_calibration_radius = DELTA_CALIBRATION_RADIUS; - COPY(delta_tower_angle_trim, dta); + delta_tower_angle_trim = dta; #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS @@ -2420,7 +2436,7 @@ void MarlinSettings::reset() { // Preheat parameters // - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU ui.preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND; ui.preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND; ui.preheat_bed_temp[0] = PREHEAT_1_TEMP_BED; @@ -2441,6 +2457,10 @@ void MarlinSettings::reset() { #if ENABLED(PID_EXTRUSION_SCALING) PID_PARAM(Kc, e) = DEFAULT_Kc; #endif + + #if ENABLED(PID_FAN_SCALING) + PID_PARAM(Kf, e) = DEFAULT_Kf; + #endif } #endif @@ -2595,17 +2615,18 @@ void MarlinSettings::reset() { #if HAS_TRINAMIC inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M906"); } #if HAS_STEALTHCHOP - void say_M569(const char * const etc=nullptr) { + void say_M569(const bool forReplay, const char * const etc=nullptr, const bool newLine = false) { + CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M569 S1"); if (etc) { SERIAL_CHAR(' '); serialprintPGM(etc); - SERIAL_EOL(); } + if (newLine) SERIAL_EOL(); } #endif #if ENABLED(HYBRID_THRESHOLD) - inline void say_M913() { SERIAL_ECHOPGM(" M913"); } + inline void say_M913(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M913"); } #endif #if USE_SENSORLESS inline void say_M914() { SERIAL_ECHOPGM(" M914"); } @@ -2714,40 +2735,40 @@ void MarlinSettings::reset() { CONFIG_ECHO_HEADING("Maximum feedrates (units/s):"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M203 X", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[X_AXIS]) - , " Y", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Y_AXIS]) - , " Z", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Z_AXIS]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M203 X"), LINEAR_UNIT(planner.settings.max_feedrate_mm_s[X_AXIS]) + , SP_Y_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Y_AXIS]) + , SP_Z_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Z_AXIS]) #if DISABLED(DISTINCT_E_FACTORS) - , " E", VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS]) + , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS]) #endif ); #if ENABLED(DISTINCT_E_FACTORS) CONFIG_ECHO_START(); for (uint8_t i = 0; i < E_STEPPERS; i++) { - SERIAL_ECHOLNPAIR( - " M203 T", (int)i - , " E", VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS_N(i)]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M203 T"), (int)i + , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS_N(i)]) ); } #endif CONFIG_ECHO_HEADING("Maximum Acceleration (units/s2):"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M201 X", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[X_AXIS]) - , " Y", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Y_AXIS]) - , " Z", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Z_AXIS]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M201 X"), LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[X_AXIS]) + , SP_Y_STR, LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Y_AXIS]) + , SP_Z_STR, LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Z_AXIS]) #if DISABLED(DISTINCT_E_FACTORS) - , " E", VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS]) + , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS]) #endif ); #if ENABLED(DISTINCT_E_FACTORS) CONFIG_ECHO_START(); for (uint8_t i = 0; i < E_STEPPERS; i++) - SERIAL_ECHOLNPAIR( - " M201 T", (int)i - , " E", VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(i)]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M201 T"), (int)i + , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(i)]) ); #endif @@ -2762,31 +2783,31 @@ void MarlinSettings::reset() { if (!forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM("Advanced: B S T"); - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) SERIAL_ECHOPGM(" J"); #endif #if HAS_CLASSIC_JERK SERIAL_ECHOPGM(" X Y Z"); - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) + #if HAS_CLASSIC_E_JERK SERIAL_ECHOPGM(" E"); #endif #endif SERIAL_EOL(); } CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M205 B", LINEAR_UNIT(planner.settings.min_segment_time_us) - , " S", LINEAR_UNIT(planner.settings.min_feedrate_mm_s) - , " T", LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s) - #if ENABLED(JUNCTION_DEVIATION) - , " J", LINEAR_UNIT(planner.junction_deviation_mm) + SERIAL_ECHOLNPAIR_P( + PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us) + , PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s) + , PSTR(" T"), LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s) + #if DISABLED(CLASSIC_JERK) + , PSTR(" J"), LINEAR_UNIT(planner.junction_deviation_mm) #endif #if HAS_CLASSIC_JERK - , " X", LINEAR_UNIT(planner.max_jerk[X_AXIS]) - , " Y", LINEAR_UNIT(planner.max_jerk[Y_AXIS]) - , " Z", LINEAR_UNIT(planner.max_jerk[Z_AXIS]) - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) - , " E", LINEAR_UNIT(planner.max_jerk[E_AXIS]) + , SP_X_STR, LINEAR_UNIT(planner.max_jerk.x) + , SP_Y_STR, LINEAR_UNIT(planner.max_jerk.y) + , SP_Z_STR, LINEAR_UNIT(planner.max_jerk.z) + #if HAS_CLASSIC_E_JERK + , SP_E_STR, LINEAR_UNIT(planner.max_jerk.e) #endif #endif ); @@ -2794,12 +2815,15 @@ void MarlinSettings::reset() { #if HAS_M206_COMMAND CONFIG_ECHO_HEADING("Home offset:"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M206" + SERIAL_ECHOLNPAIR_P( #if IS_CARTESIAN - " X", LINEAR_UNIT(home_offset[X_AXIS]), - " Y", LINEAR_UNIT(home_offset[Y_AXIS]), + PSTR(" M206 X"), LINEAR_UNIT(home_offset.x) + , SP_Y_STR, LINEAR_UNIT(home_offset.y) + , SP_Z_STR + #else + PSTR(" M206 Z") #endif - " Z", LINEAR_UNIT(home_offset[Z_AXIS]) + , LINEAR_UNIT(home_offset.z) ); #endif @@ -2807,21 +2831,15 @@ void MarlinSettings::reset() { CONFIG_ECHO_HEADING("Hotend offsets:"); CONFIG_ECHO_START(); for (uint8_t e = 1; e < HOTENDS; e++) { - SERIAL_ECHOPAIR( - " M218 T", (int)e - , " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]) - , " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]) + SERIAL_ECHOPAIR_P( + PSTR(" M218 T"), (int)e, + SP_X_STR, LINEAR_UNIT(hotend_offset[e].x), + SP_Y_STR, LINEAR_UNIT(hotend_offset[e].y) ); - SERIAL_ECHOLNPAIR_F(" Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]), 3); + SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(hotend_offset[e].z), 3); } #endif - #if HAS_FILAMENT_SENSOR - CONFIG_ECHO_HEADING("Filament Runout Sensor:"); - CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M412 S", int(runout.enabled)); - #endif - /** * Bed Leveling */ @@ -2846,10 +2864,10 @@ void MarlinSettings::reset() { #endif CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M420 S", planner.leveling_active ? 1 : 0 + SERIAL_ECHOLNPAIR_P( + PSTR(" M420 S"), planner.leveling_active ? 1 : 0 #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - , " Z", LINEAR_UNIT(planner.z_fade_height) + , SP_Z_STR, LINEAR_UNIT(planner.z_fade_height) #endif ); @@ -2859,10 +2877,12 @@ void MarlinSettings::reset() { 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, " Y", (int)py + 1); - SERIAL_ECHOLNPAIR_F(" Z", LINEAR_UNIT(mbl.z_values[px][py]), 5); + SERIAL_ECHOPAIR_P(PSTR(" G29 S3 I"), (int)px, PSTR(" J"), (int)py); + SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(mbl.z_values[px][py]), 5); } } + CONFIG_ECHO_START(); + SERIAL_ECHOLNPAIR_F_P(PSTR(" G29 S4 Z"), LINEAR_UNIT(mbl.z_offset), 5); } #elif ENABLED(AUTO_BED_LEVELING_UBL) @@ -2883,7 +2903,7 @@ void MarlinSettings::reset() { for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { CONFIG_ECHO_START(); SERIAL_ECHOPAIR(" G29 W I", (int)px, " J", (int)py); - SERIAL_ECHOLNPAIR_F(" Z", LINEAR_UNIT(z_values[px][py]), 5); + SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(z_values[px][py]), 5); } } } @@ -2919,34 +2939,33 @@ void MarlinSettings::reset() { CONFIG_ECHO_HEADING("SCARA settings: S P T"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M665 S", delta_segments_per_second - , " P", scara_home_offset[A_AXIS] - , " T", scara_home_offset[B_AXIS] - , " Z", LINEAR_UNIT(scara_home_offset[Z_AXIS]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M665 S"), delta_segments_per_second + , PSTR(" P"), scara_home_offset.a + , PSTR(" T"), scara_home_offset.b + , SP_Z_STR, LINEAR_UNIT(scara_home_offset.z) ); #elif ENABLED(DELTA) CONFIG_ECHO_HEADING("Endstop adjustment:"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M666 X", LINEAR_UNIT(delta_endstop_adj[X_AXIS]) - , " Y", LINEAR_UNIT(delta_endstop_adj[Y_AXIS]) - , " Z", LINEAR_UNIT(delta_endstop_adj[Z_AXIS]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a) + , SP_Y_STR, LINEAR_UNIT(delta_endstop_adj.b) + , SP_Z_STR, LINEAR_UNIT(delta_endstop_adj.c) ); - CONFIG_ECHO_HEADING("Delta settings: L R H S B XYZ"); + CONFIG_ECHO_HEADING("Delta settings: L R H S XYZ"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M665 L", LINEAR_UNIT(delta_diagonal_rod) - , " R", LINEAR_UNIT(delta_radius) - , " H", LINEAR_UNIT(delta_height) - , " S", delta_segments_per_second - , " B", LINEAR_UNIT(delta_calibration_radius) - , " X", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS]) - , " Y", LINEAR_UNIT(delta_tower_angle_trim[B_AXIS]) - , " Z", LINEAR_UNIT(delta_tower_angle_trim[C_AXIS]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod) + , PSTR(" R"), LINEAR_UNIT(delta_radius) + , PSTR(" H"), LINEAR_UNIT(delta_height) + , PSTR(" S"), delta_segments_per_second + , SP_X_STR, LINEAR_UNIT(delta_tower_angle_trim.a) + , SP_Y_STR, LINEAR_UNIT(delta_tower_angle_trim.b) + , SP_Z_STR, LINEAR_UNIT(delta_tower_angle_trim.c) ); #elif EITHER(X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS @@ -2955,23 +2974,23 @@ void MarlinSettings::reset() { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M666"); #if ENABLED(X_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" X", LINEAR_UNIT(endstops.x2_endstop_adj)); + SERIAL_ECHOPAIR_P(SP_X_STR, LINEAR_UNIT(endstops.x2_endstop_adj)); #endif #if ENABLED(Y_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(endstops.y2_endstop_adj)); + SERIAL_ECHOPAIR_P(SP_Y_STR, LINEAR_UNIT(endstops.y2_endstop_adj)); #endif #if ENABLED(Z_TRIPLE_ENDSTOPS) SERIAL_ECHOLNPAIR("S1 Z", LINEAR_UNIT(endstops.z2_endstop_adj)); CONFIG_ECHO_START(); SERIAL_ECHOPAIR(" M666 S2 Z", LINEAR_UNIT(endstops.z3_endstop_adj)); #elif ENABLED(Z_DUAL_ENDSTOPS) - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(endstops.z2_endstop_adj)); + SERIAL_ECHOPAIR_P(SP_Z_STR, LINEAR_UNIT(endstops.z2_endstop_adj)); #endif SERIAL_EOL(); #endif // [XYZ]_DUAL_ENDSTOPS - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU CONFIG_ECHO_HEADING("Material heatup parameters:"); for (uint8_t i = 0; i < COUNT(ui.preheat_hotend_temp); i++) { @@ -2989,38 +3008,29 @@ void MarlinSettings::reset() { #if HAS_PID_HEATING CONFIG_ECHO_HEADING("PID settings:"); + #if ENABLED(PIDTEMP) - #if HOTENDS > 1 - if (forReplay) { - HOTEND_LOOP() { - CONFIG_ECHO_START(); - SERIAL_ECHOPAIR( - " M301 E", e - , " P", PID_PARAM(Kp, e) - , " I", unscalePID_i(PID_PARAM(Ki, e)) - , " 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); - #endif - SERIAL_EOL(); - } - } - else - #endif // HOTENDS > 1 - // !forReplay || HOTENDS == 1 - { + HOTEND_LOOP() { CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M301 P", PID_PARAM(Kp, 0) // for compatibility with hosts, only echo values for E0 - , " I", unscalePID_i(PID_PARAM(Ki, 0)) - , " D", unscalePID_d(PID_PARAM(Kd, 0)) - #if ENABLED(PID_EXTRUSION_SCALING) - , " C", PID_PARAM(Kc, 0) - , " L", thermalManager.lpq_len + SERIAL_ECHOPAIR_P( + #if HOTENDS > 1 && ENABLED(PID_PARAMS_PER_HOTEND) + PSTR(" M301 E"), e, + PSTR(" P") + #else + PSTR(" M301 P") #endif + , PID_PARAM(Kp, e) + , PSTR(" I"), unscalePID_i(PID_PARAM(Ki, e)) + , PSTR(" 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); + #endif + #if ENABLED(PID_FAN_SCALING) + SERIAL_ECHOPAIR(" F", PID_PARAM(Kf, e)); + #endif + SERIAL_EOL(); } #endif // PIDTEMP @@ -3057,11 +3067,11 @@ void MarlinSettings::reset() { CONFIG_ECHO_HEADING("Retract: S F Z"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M207 S", LINEAR_UNIT(fwretract.settings.retract_length) - , " W", LINEAR_UNIT(fwretract.settings.swap_retract_length) - , " F", MMS_TO_MMM(LINEAR_UNIT(fwretract.settings.retract_feedrate_mm_s)) - , " Z", LINEAR_UNIT(fwretract.settings.retract_zraise) + SERIAL_ECHOLNPAIR_P( + PSTR(" M207 S"), LINEAR_UNIT(fwretract.settings.retract_length) + , PSTR(" W"), LINEAR_UNIT(fwretract.settings.swap_retract_length) + , PSTR(" F"), LINEAR_UNIT(MMS_TO_MMM(fwretract.settings.retract_feedrate_mm_s)) + , SP_Z_STR, LINEAR_UNIT(fwretract.settings.retract_zraise) ); CONFIG_ECHO_HEADING("Recover: S F"); @@ -3069,7 +3079,7 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPAIR( " M208 S", LINEAR_UNIT(fwretract.settings.retract_recover_extra) , " W", LINEAR_UNIT(fwretract.settings.swap_retract_recover_extra) - , " F", MMS_TO_MMM(LINEAR_UNIT(fwretract.settings.retract_recover_feedrate_mm_s)) + , " F", LINEAR_UNIT(MMS_TO_MMM(fwretract.settings.retract_recover_feedrate_mm_s)) ); #if ENABLED(FWRETRACT_AUTORETRACT) @@ -3092,7 +3102,9 @@ void MarlinSettings::reset() { say_units(true); } CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M851 Z", LINEAR_UNIT(zprobe_zoffset)); + SERIAL_ECHOLNPAIR_P(PSTR(" M851 X"), LINEAR_UNIT(probe_offset.x), + SP_Y_STR, LINEAR_UNIT(probe_offset.y), + SP_Z_STR, LINEAR_UNIT(probe_offset.z)); #endif /** @@ -3119,33 +3131,31 @@ void MarlinSettings::reset() { #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) say_M906(forReplay); - SERIAL_ECHOLNPAIR( - #if AXIS_IS_TMC(X) - " X", stepperX.getMilliamps(), - #endif - #if AXIS_IS_TMC(Y) - " Y", stepperY.getMilliamps(), - #endif - #if AXIS_IS_TMC(Z) - " Z", stepperZ.getMilliamps() - #endif - ); + #if AXIS_IS_TMC(X) + SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.getMilliamps()); + #endif + #if AXIS_IS_TMC(Y) + SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.getMilliamps()); + #endif + #if AXIS_IS_TMC(Z) + SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.getMilliamps()); + #endif + SERIAL_EOL(); #endif #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) say_M906(forReplay); SERIAL_ECHOPGM(" I1"); - SERIAL_ECHOLNPAIR( - #if AXIS_IS_TMC(X2) - " X", stepperX2.getMilliamps(), - #endif - #if AXIS_IS_TMC(Y2) - " Y", stepperY2.getMilliamps(), - #endif - #if AXIS_IS_TMC(Z2) - " Z", stepperZ2.getMilliamps() - #endif - ); + #if AXIS_IS_TMC(X2) + SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.getMilliamps()); + #endif + #if AXIS_IS_TMC(Y2) + SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.getMilliamps()); + #endif + #if AXIS_IS_TMC(Z2) + SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.getMilliamps()); + #endif + SERIAL_EOL(); #endif #if AXIS_IS_TMC(Z3) @@ -3184,67 +3194,66 @@ void MarlinSettings::reset() { */ #if ENABLED(HYBRID_THRESHOLD) CONFIG_ECHO_HEADING("Hybrid Threshold:"); - CONFIG_ECHO_START(); #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Z) - say_M913(); + say_M913(forReplay); #endif #if AXIS_HAS_STEALTHCHOP(X) - SERIAL_ECHOPAIR(" X", stepperX.get_pwm_thrs()); + SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(Y) - SERIAL_ECHOPAIR(" Y", stepperY.get_pwm_thrs()); + SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(Z) - SERIAL_ECHOPAIR(" Z", stepperZ.get_pwm_thrs()); + SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Z) SERIAL_EOL(); #endif #if AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z2) - say_M913(); + say_M913(forReplay); SERIAL_ECHOPGM(" I1"); #endif #if AXIS_HAS_STEALTHCHOP(X2) - SERIAL_ECHOPAIR(" X", stepperX2.get_pwm_thrs()); + SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(Y2) - SERIAL_ECHOPAIR(" Y", stepperY2.get_pwm_thrs()); + SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(Z2) - SERIAL_ECHOPAIR(" Z", stepperZ2.get_pwm_thrs()); + SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z2) SERIAL_EOL(); #endif #if AXIS_HAS_STEALTHCHOP(Z3) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E0) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T0 E", stepperE0.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E1) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T1 E", stepperE1.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E2) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T2 E", stepperE2.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E3) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T3 E", stepperE3.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E4) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T4 E", stepperE4.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E5) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T5 E", stepperE5.get_pwm_thrs()); #endif SERIAL_EOL(); @@ -3255,41 +3264,39 @@ void MarlinSettings::reset() { */ #if USE_SENSORLESS CONFIG_ECHO_HEADING("StallGuard threshold:"); - CONFIG_ECHO_START(); #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS + CONFIG_ECHO_START(); say_M914(); #if X_SENSORLESS - SERIAL_ECHOPAIR(" X", stepperX.homing_threshold()); + SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.homing_threshold()); #endif #if Y_SENSORLESS - SERIAL_ECHOPAIR(" Y", stepperY.homing_threshold()); + SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.homing_threshold()); #endif #if Z_SENSORLESS - SERIAL_ECHOPAIR(" Z", stepperZ.homing_threshold()); + SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.homing_threshold()); #endif SERIAL_EOL(); #endif - #define HAS_X2_SENSORLESS (defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2)) - #define HAS_Y2_SENSORLESS (defined(Y_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2)) - #define HAS_Z2_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2)) - #define HAS_Z3_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3)) - #if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS + #if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS + CONFIG_ECHO_START(); say_M914(); SERIAL_ECHOPGM(" I1"); - #if HAS_X2_SENSORLESS - SERIAL_ECHOPAIR(" X", stepperX2.homing_threshold()); + #if X2_SENSORLESS + SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.homing_threshold()); #endif - #if HAS_Y2_SENSORLESS - SERIAL_ECHOPAIR(" Y", stepperY2.homing_threshold()); + #if Y2_SENSORLESS + SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.homing_threshold()); #endif - #if HAS_Z2_SENSORLESS - SERIAL_ECHOPAIR(" Z", stepperZ2.homing_threshold()); + #if Z2_SENSORLESS + SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.homing_threshold()); #endif SERIAL_EOL(); #endif - #if HAS_Z3_SENSORLESS + #if Z3_SENSORLESS + CONFIG_ECHO_START(); say_M914(); SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.homing_threshold()); #endif @@ -3301,7 +3308,6 @@ void MarlinSettings::reset() { */ #if HAS_STEALTHCHOP CONFIG_ECHO_HEADING("Driver stepping mode:"); - CONFIG_ECHO_START(); #if AXIS_HAS_STEALTHCHOP(X) const bool chop_x = stepperX.get_stealthChop_status(); #else @@ -3318,11 +3324,13 @@ void MarlinSettings::reset() { constexpr bool chop_z = false; #endif - if (chop_x || chop_y || chop_z) say_M569(); - if (chop_x) SERIAL_ECHOPGM(" X"); - if (chop_y) SERIAL_ECHOPGM(" Y"); - if (chop_z) SERIAL_ECHOPGM(" Z"); - if (chop_x || chop_y || chop_z) SERIAL_EOL(); + if (chop_x || chop_y || chop_z) { + say_M569(forReplay); + if (chop_x) SERIAL_ECHO_P(SP_X_STR); + if (chop_y) SERIAL_ECHO_P(SP_Y_STR); + if (chop_z) SERIAL_ECHO_P(SP_Z_STR); + SERIAL_EOL(); + } #if AXIS_HAS_STEALTHCHOP(X2) const bool chop_x2 = stepperX2.get_stealthChop_status(); @@ -3340,33 +3348,35 @@ void MarlinSettings::reset() { constexpr bool chop_z2 = false; #endif - if (chop_x2 || chop_y2 || chop_z2) say_M569(PSTR("I1")); - if (chop_x2) SERIAL_ECHOPGM(" X"); - if (chop_y2) SERIAL_ECHOPGM(" Y"); - if (chop_z2) SERIAL_ECHOPGM(" Z"); - if (chop_x2 || chop_y2 || chop_z2) SERIAL_EOL(); + if (chop_x2 || chop_y2 || chop_z2) { + say_M569(forReplay, PSTR("I1")); + if (chop_x2) SERIAL_ECHO_P(SP_X_STR); + if (chop_y2) SERIAL_ECHO_P(SP_Y_STR); + if (chop_z2) SERIAL_ECHO_P(SP_Z_STR); + SERIAL_EOL(); + } #if AXIS_HAS_STEALTHCHOP(Z3) - if (stepperZ3.get_stealthChop_status()) { say_M569(PSTR("I2 Z")); } + if (stepperZ3.get_stealthChop_status()) { say_M569(forReplay, PSTR("I2 Z"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E0) - if (stepperE0.get_stealthChop_status()) { say_M569(PSTR("T0 E")); } + if (stepperE0.get_stealthChop_status()) { say_M569(forReplay, PSTR("T0 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E1) - if (stepperE1.get_stealthChop_status()) { say_M569(PSTR("T1 E")); } + if (stepperE1.get_stealthChop_status()) { say_M569(forReplay, PSTR("T1 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E2) - if (stepperE2.get_stealthChop_status()) { say_M569(PSTR("T2 E")); } + if (stepperE2.get_stealthChop_status()) { say_M569(forReplay, PSTR("T2 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E3) - if (stepperE3.get_stealthChop_status()) { say_M569(PSTR("T3 E")); } + if (stepperE3.get_stealthChop_status()) { say_M569(forReplay, PSTR("T3 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E4) - if (stepperE4.get_stealthChop_status()) { say_M569(PSTR("T4 E")); } + if (stepperE4.get_stealthChop_status()) { say_M569(forReplay, PSTR("T4 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E5) - if (stepperE5.get_stealthChop_status()) { say_M569(PSTR("T5 E")); } + if (stepperE5.get_stealthChop_status()) { say_M569(forReplay, PSTR("T5 E"), true); } #endif #endif // HAS_STEALTHCHOP @@ -3390,10 +3400,10 @@ void MarlinSettings::reset() { #if HAS_MOTOR_CURRENT_PWM CONFIG_ECHO_HEADING("Stepper motor currents:"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M907 X", stepper.motor_current_setting[0] - , " Z", stepper.motor_current_setting[1] - , " E", stepper.motor_current_setting[2] + SERIAL_ECHOLNPAIR_P( + PSTR(" M907 X"), stepper.motor_current_setting[0] + , SP_Z_STR, stepper.motor_current_setting[1] + , SP_E_STR, stepper.motor_current_setting[2] ); #endif @@ -3433,13 +3443,13 @@ void MarlinSettings::reset() { #if ENABLED(BACKLASH_GCODE) CONFIG_ECHO_HEADING("Backlash compensation:"); CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR( - " M425 F", backlash.get_correction(), - " X", LINEAR_UNIT(backlash.distance_mm[X_AXIS]), - " Y", LINEAR_UNIT(backlash.distance_mm[Y_AXIS]), - " Z", LINEAR_UNIT(backlash.distance_mm[Z_AXIS]) + SERIAL_ECHOLNPAIR_P( + PSTR(" M425 F"), backlash.get_correction() + , SP_X_STR, LINEAR_UNIT(backlash.distance_mm.x) + , SP_Y_STR, LINEAR_UNIT(backlash.distance_mm.y) + , SP_Z_STR, LINEAR_UNIT(backlash.distance_mm.z) #ifdef BACKLASH_SMOOTHING_MM - , " S", LINEAR_UNIT(backlash.smoothing_mm) + , PSTR(" S"), LINEAR_UNIT(backlash.smoothing_mm) #endif ); #endif diff --git a/Marlin/src/module/configuration_store.h b/Marlin/src/module/configuration_store.h index fc84c4005b95..b8a64c5c68db 100644 --- a/Marlin/src/module/configuration_store.h +++ b/Marlin/src/module/configuration_store.h @@ -29,8 +29,6 @@ class MarlinSettings { public: - MarlinSettings() { } - static uint16_t datasize(); static void reset(); @@ -55,9 +53,15 @@ class MarlinSettings { #endif #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 inline void first_load() { + static bool loaded = false; + if (!loaded && load()) loaded = true; + } + #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(); @@ -73,13 +77,15 @@ class MarlinSettings { #else FORCE_INLINE static bool load() { reset(); report(); return true; } + FORCE_INLINE + static void first_load() { (void)load(); } #endif #if DISABLED(DISABLE_M503) static void report(const bool forReplay=false); #else FORCE_INLINE - static void report(const bool forReplay=false) { UNUSED(forReplay); } + static void report(const bool=false) {} #endif private: diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 466f55227443..38d3d8146de8 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -43,24 +43,22 @@ #if ENABLED(SENSORLESS_HOMING) #include "../feature/tmc_util.h" - #include "stepper_indirection.h" + #include "stepper/indirection.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../core/debug_out.h" // Initialized by settings.load() -float delta_height, - delta_endstop_adj[ABC] = { 0 }, - delta_radius, +float delta_height; +abc_float_t delta_endstop_adj{0}; +float delta_radius, delta_diagonal_rod, - delta_segments_per_second, - delta_calibration_radius, - delta_tower_angle_trim[ABC]; - -float delta_tower[ABC][2], - delta_diagonal_rod_2_tower[ABC], - delta_clip_start_height = Z_MAX_POS; + delta_segments_per_second; +abc_float_t delta_tower_angle_trim; +xy_float_t delta_tower[ABC]; +abc_float_t delta_diagonal_rod_2_tower; +float delta_clip_start_height = Z_MAX_POS; float delta_safe_distance_from_top(); @@ -69,21 +67,39 @@ float delta_safe_distance_from_top(); * settings have been changed (e.g., by M665). */ void recalc_delta_settings() { - const float trt[ABC] = DELTA_RADIUS_TRIM_TOWER, - drt[ABC] = DELTA_DIAGONAL_ROD_TRIM_TOWER; - delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]); // front left tower - delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (delta_radius + trt[A_AXIS]); - delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]); // front right tower - delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + trt[B_AXIS]); - delta_tower[C_AXIS][X_AXIS] = cos(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]); // back middle tower - delta_tower[C_AXIS][Y_AXIS] = sin(RADIANS( 90 + delta_tower_angle_trim[C_AXIS])) * (delta_radius + trt[C_AXIS]); - delta_diagonal_rod_2_tower[A_AXIS] = sq(delta_diagonal_rod + drt[A_AXIS]); - 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]); + constexpr abc_float_t trt = DELTA_RADIUS_TRIM_TOWER, + drt = DELTA_DIAGONAL_ROD_TRIM_TOWER; + delta_tower[A_AXIS].set(cos(RADIANS(210 + delta_tower_angle_trim.a)) * (delta_radius + trt.a), // front left tower + sin(RADIANS(210 + delta_tower_angle_trim.a)) * (delta_radius + trt.a)); + delta_tower[B_AXIS].set(cos(RADIANS(330 + delta_tower_angle_trim.b)) * (delta_radius + trt.b), // front right tower + sin(RADIANS(330 + delta_tower_angle_trim.b)) * (delta_radius + trt.b)); + delta_tower[C_AXIS].set(cos(RADIANS( 90 + delta_tower_angle_trim.c)) * (delta_radius + trt.c), // back middle tower + sin(RADIANS( 90 + delta_tower_angle_trim.c)) * (delta_radius + trt.c)); + delta_diagonal_rod_2_tower.set(sq(delta_diagonal_rod + drt.a), + sq(delta_diagonal_rod + drt.b), + sq(delta_diagonal_rod + drt.c)); update_software_endstops(Z_AXIS); set_all_unhomed(); } +/** + * Get a safe radius for calibration + */ + +#if ENABLED(DELTA_AUTO_CALIBRATION) + float calibration_radius_factor = 1; +#endif + +float delta_calibration_radius() { + return FLOOR((DELTA_PRINTABLE_RADIUS - ( + #if HAS_BED_PROBE + _MAX(HYPOT(probe_offset.x, probe_offset.y), MIN_PROBE_EDGE) + #else + MIN_PROBE_EDGE + #endif + )) * calibration_radius_factor); +} + /** * Delta Inverse Kinematics * @@ -101,22 +117,16 @@ void recalc_delta_settings() { */ #define DELTA_DEBUG(VAR) do { \ - SERIAL_ECHOPAIR("cartesian X:", VAR[X_AXIS]); \ - SERIAL_ECHOPAIR(" Y:", VAR[Y_AXIS]); \ - SERIAL_ECHOLNPAIR(" Z:", VAR[Z_AXIS]); \ - SERIAL_ECHOPAIR("delta A:", delta[A_AXIS]); \ - SERIAL_ECHOPAIR(" B:", delta[B_AXIS]); \ - SERIAL_ECHOLNPAIR(" C:", delta[C_AXIS]); \ + SERIAL_ECHOLNPAIR_P(PSTR("Cartesian X"), VAR.x, SP_Y_STR, VAR.y, SP_Z_STR, VAR.z); \ + SERIAL_ECHOLNPAIR("Delta A", delta.a, " B", delta.b, " C", delta.c); \ }while(0) -void inverse_kinematics(const float (&raw)[XYZ]) { +void inverse_kinematics(const xyz_pos_t &raw) { #if HAS_HOTEND_OFFSET // 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] - }; + xyz_pos_t pos = { raw.x - hotend_offset[active_extruder].x, + raw.y - hotend_offset[active_extruder].y, + raw.z }; DELTA_IK(pos); //DELTA_DEBUG(pos); #else @@ -130,12 +140,12 @@ void inverse_kinematics(const float (&raw)[XYZ]) { * effector has the full range of XY motion. */ float delta_safe_distance_from_top() { - float cartesian[XYZ] = { 0, 0, 0 }; + xyz_pos_t cartesian{0}; inverse_kinematics(cartesian); - float centered_extent = delta[A_AXIS]; - cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS; + const float centered_extent = delta.a; + cartesian.y = DELTA_PRINTABLE_RADIUS; inverse_kinematics(cartesian); - return ABS(centered_extent - delta[A_AXIS]); + return ABS(centered_extent - delta.a); } /** @@ -165,7 +175,7 @@ float delta_safe_distance_from_top() { */ void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) { // Create a vector in old coordinates along x axis of new coordinate - const float p12[3] = { delta_tower[B_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], delta_tower[B_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], z2 - z1 }, + const float p12[3] = { delta_tower[B_AXIS].x - delta_tower[A_AXIS].x, delta_tower[B_AXIS].y - delta_tower[A_AXIS].y, z2 - z1 }, // Get the reciprocal of Magnitude of vector. d2 = sq(p12[0]) + sq(p12[1]) + sq(p12[2]), inv_d = RSQRT(d2), @@ -174,7 +184,7 @@ void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) ex[3] = { p12[0] * inv_d, p12[1] * inv_d, p12[2] * inv_d }, // Get the vector from the origin of the new system to the third point. - p13[3] = { delta_tower[C_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], delta_tower[C_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], z3 - z1 }, + p13[3] = { delta_tower[C_AXIS].x - delta_tower[A_AXIS].x, delta_tower[C_AXIS].y - delta_tower[A_AXIS].y, z3 - z1 }, // Use the dot product to find the component of this vector on the X axis. i = ex[0] * p13[0] + ex[1] * p13[1] + ex[2] * p13[2], @@ -202,16 +212,16 @@ void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) // 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, - Znew = SQRT(delta_diagonal_rod_2_tower[A_AXIS] - HYPOT2(Xnew, Ynew)); + Xnew = (delta_diagonal_rod_2_tower.a - delta_diagonal_rod_2_tower.b + d2) * inv_d * 0.5, + Ynew = ((delta_diagonal_rod_2_tower.a - delta_diagonal_rod_2_tower.c + sq(i) + j2) * 0.5 - i * Xnew) * inv_j, + Znew = SQRT(delta_diagonal_rod_2_tower.a - HYPOT2(Xnew, Ynew)); // Start from the origin of the old coordinates and add vectors in the // old coords that represent the Xnew, Ynew and Znew to find the point // 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.set(delta_tower[A_AXIS].x + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew, + delta_tower[A_AXIS].y + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew, + z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew); } /** @@ -221,25 +231,26 @@ void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3) void home_delta() { if (DEBUGGING(LEVELING)) DEBUG_POS(">>> home_delta", current_position); // Init the current position of all carriages to 0,0,0 - ZERO(current_position); - ZERO(destination); + current_position.reset(); + destination.reset(); sync_plan_position(); // Disable stealthChop if used. Enable diag1 pin on driver. #if ENABLED(SENSORLESS_HOMING) - sensorless_t stealth_states { false, false, false, false, false, false, false }; - stealth_states.x = tmc_enable_stallguard(stepperX); - stealth_states.y = tmc_enable_stallguard(stepperY); - stealth_states.z = tmc_enable_stallguard(stepperZ); + sensorless_t stealth_states { + tmc_enable_stallguard(stepperX), + tmc_enable_stallguard(stepperY), + tmc_enable_stallguard(stepperZ) + }; #endif // Move all carriages together linearly until an endstop is hit. - destination[Z_AXIS] = (delta_height + current_position.z = (delta_height + 10 #if HAS_BED_PROBE - - zprobe_zoffset + - probe_offset.z #endif - + 10); - buffer_line_to_destination(homing_feedrate(X_AXIS)); + ); + line_to_current_position(homing_feedrate(X_AXIS)); planner.synchronize(); // Re-enable stealthChop if used. Disable diag1 pin on driver. diff --git a/Marlin/src/module/delta.h b/Marlin/src/module/delta.h index aa842fb026ff..17cd330686af 100644 --- a/Marlin/src/module/delta.h +++ b/Marlin/src/module/delta.h @@ -25,19 +25,17 @@ * delta.h - Delta-specific functions */ -#pragma once +#include "../core/types.h" -extern float delta_height, - delta_endstop_adj[ABC], - delta_radius, +extern float delta_height; +extern abc_float_t delta_endstop_adj; +extern float delta_radius, delta_diagonal_rod, - delta_segments_per_second, - delta_calibration_radius, - delta_tower_angle_trim[ABC]; - -extern float delta_tower[ABC][2], - delta_diagonal_rod_2_tower[ABC], - delta_clip_start_height; + delta_segments_per_second; +extern abc_float_t delta_tower_angle_trim; +extern xy_float_t delta_tower[ABC]; +extern abc_float_t delta_diagonal_rod_2_tower; +extern float delta_clip_start_height; /** * Recalculate factors used for delta kinematics whenever @@ -45,6 +43,17 @@ extern float delta_tower[ABC][2], */ void recalc_delta_settings(); +/** + * Get a safe radius for calibration + */ +#if ENABLED(DELTA_AUTO_CALIBRATION) + extern float calibration_radius_factor; +#else + constexpr float calibration_radius_factor = 1; +#endif + +float delta_calibration_radius(); + /** * Delta Inverse Kinematics * @@ -65,24 +74,16 @@ void recalc_delta_settings(); */ // 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 + SQRT( \ delta_diagonal_rod_2_tower[T] - HYPOT2( \ - delta_tower[T][X_AXIS] - V[X_AXIS], \ - delta_tower[T][Y_AXIS] - V[Y_AXIS] \ + delta_tower[T].x - V.x, \ + delta_tower[T].y - V.y \ ) \ ) -#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) +#define DELTA_IK(V) delta.set(DELTA_Z(V, A_AXIS), DELTA_Z(V, B_AXIS), DELTA_Z(V, C_AXIS)) -void inverse_kinematics(const float (&raw)[XYZ]); -FORCE_INLINE void inverse_kinematics(const float (&raw)[XYZE]) { - const float raw_xyz[XYZ] = { raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS] }; - inverse_kinematics(raw_xyz); -} +void inverse_kinematics(const xyz_pos_t &raw); /** * Calculate the highest Z position where the @@ -117,8 +118,8 @@ float delta_safe_distance_from_top(); */ void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3); -FORCE_INLINE void forward_kinematics_DELTA(const float (&point)[ABC]) { - forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]); +FORCE_INLINE void forward_kinematics_DELTA(const abc_float_t &point) { + forward_kinematics_DELTA(point.a, point.b, point.c); } void home_delta(); diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 7234bf476978..cbe274a6921a 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -44,6 +44,10 @@ #include "../feature/bltouch.h" #endif +#if ENABLED(JOYSTICK) + #include "../feature/joystick.h" +#endif + Endstops endstops; // private: @@ -76,6 +80,13 @@ Endstops::esbits_t Endstops::live_state = 0; float Endstops::z3_endstop_adj; #endif +#if ENABLED(SPI_ENDSTOPS) + Endstops::tmc_spi_homing_t Endstops::tmc_spi_homing; // = 0 +#endif +#if ENABLED(IMPROVE_HOMING_RELIABILITY) + millis_t sg_guard_period; // = 0 +#endif + /** * Class and Instance Methods */ @@ -232,7 +243,7 @@ void Endstops::init() { #endif #endif - #if USES_Z_MIN_PROBE_ENDSTOP + #if HAS_CUSTOM_PROBE_PIN #if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE) SET_INPUT_PULLUP(Z_MIN_PROBE_PIN); #elif ENABLED(ENDSTOPPULLDOWN_ZMIN_PROBE) @@ -291,7 +302,7 @@ void Endstops::not_homing() { // 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)); + else kill(GET_TEXT(MSG_LCD_HOMING_FAILED)); } #endif @@ -329,8 +340,10 @@ void Endstops::resync() { void Endstops::event_handler() { static uint8_t prev_hit_state; // = 0 - if (hit_state && hit_state != prev_hit_state) { - #if ENABLED(ULTRA_LCD) + if (hit_state == prev_hit_state) return; + prev_hit_state = hit_state; + if (hit_state) { + #if HAS_SPI_LCD char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' '; #define _SET_STOP_CHAR(A,C) (chr## A = C) #else @@ -355,14 +368,14 @@ void Endstops::event_handler() { ENDSTOP_HIT_TEST_Y(); ENDSTOP_HIT_TEST_Z(); - #if USES_Z_MIN_PROBE_ENDSTOP + #if HAS_CUSTOM_PROBE_PIN #define P_AXIS Z_AXIS if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); #endif SERIAL_EOL(); - #if ENABLED(ULTRA_LCD) - ui.status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); + #if HAS_SPI_LCD + ui.status_printf_P(0, PSTR(S_FMT " %c %c %c %c"), GET_TEXT(MSG_LCD_ENDSTOPS), chrX, chrY, chrZ, chrP); #endif #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT) @@ -374,7 +387,6 @@ void Endstops::event_handler() { } #endif } - prev_hit_state = hit_state; } static void print_es_state(const bool is_hit, PGM_P const label=nullptr) { @@ -384,7 +396,7 @@ static void print_es_state(const bool is_hit, PGM_P const label=nullptr) { SERIAL_EOL(); } -void _O2 Endstops::M119() { +void _O2 Endstops::report_states() { #if ENABLED(BLTOUCH) bltouch._set_SW_mode(); #endif @@ -432,7 +444,7 @@ void _O2 Endstops::M119() { #if HAS_Z3_MAX ES_REPORT(Z3_MAX); #endif - #if USES_Z_MIN_PROBE_ENDSTOP + #if HAS_CUSTOM_PROBE_PIN print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(MSG_Z_PROBE)); #endif #if HAS_FILAMENT_SENSOR @@ -467,7 +479,12 @@ void _O2 Endstops::M119() { #if ENABLED(BLTOUCH) bltouch._reset_SW_mode(); #endif -} // Endstops::M119 + + #if ENABLED(JOYSTICK_DEBUG) + joystick.report(); + #endif + +} // Endstops::report_states // The following routines are called from an ISR context. It could be the temperature ISR, the // endstop ISR or the Stepper ISR. @@ -521,61 +538,53 @@ void Endstops::update() { /** * Check and update endstops */ - #if HAS_X_MIN + #if HAS_X_MIN && !X_SPI_SENSORLESS + UPDATE_ENDSTOP_BIT(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 HAS_X_MAX && !X_SPI_SENSORLESS + UPDATE_ENDSTOP_BIT(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 HAS_Y_MIN && !Y_SPI_SENSORLESS + UPDATE_ENDSTOP_BIT(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 HAS_Y_MAX && !Y_SPI_SENSORLESS + UPDATE_ENDSTOP_BIT(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 HAS_Z_MIN && !Z_SPI_SENSORLESS + UPDATE_ENDSTOP_BIT(Z, MIN); #if Z_MULTI_ENDSTOPS - UPDATE_ENDSTOP_BIT(Z, MIN); #if HAS_Z2_MIN UPDATE_ENDSTOP_BIT(Z2, MIN); #else @@ -588,19 +597,15 @@ void Endstops::update() { COPY_LIVE_STATE(Z_MIN, Z3_MIN); #endif #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 USES_Z_MIN_PROBE_ENDSTOP + #if HAS_CUSTOM_PROBE_PIN UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); #endif - #if HAS_Z_MAX + #if HAS_Z_MAX && !Z_SPI_SENSORLESS // Check both Z dual endstops #if Z_MULTI_ENDSTOPS UPDATE_ENDSTOP_BIT(Z, MAX); @@ -616,7 +621,7 @@ void Endstops::update() { COPY_LIVE_STATE(Z_MAX, Z3_MAX); #endif #endif - #elif !USES_Z_MIN_PROBE_ENDSTOP || Z_MAX_PIN != Z_MIN_PROBE_PIN + #elif !HAS_CUSTOM_PROBE_PIN || 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 @@ -699,7 +704,7 @@ void Endstops::update() { // Now, we must signal, after validation, if an endstop limit is pressed or not if (stepper.axis_is_moving(X_AXIS)) { if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction - #if HAS_X_MIN + #if HAS_X_MIN || (X_SPI_SENSORLESS && X_HOME_DIR < 0) #if ENABLED(X_DUAL_ENDSTOPS) PROCESS_DUAL_ENDSTOP(X, X2, MIN); #else @@ -708,7 +713,7 @@ void Endstops::update() { #endif } else { // +direction - #if HAS_X_MAX + #if HAS_X_MAX || (X_SPI_SENSORLESS && X_HOME_DIR > 0) #if ENABLED(X_DUAL_ENDSTOPS) PROCESS_DUAL_ENDSTOP(X, X2, MAX); #else @@ -720,7 +725,7 @@ void Endstops::update() { if (stepper.axis_is_moving(Y_AXIS)) { if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction - #if HAS_Y_MIN + #if HAS_Y_MIN || (Y_SPI_SENSORLESS && Y_HOME_DIR < 0) #if ENABLED(Y_DUAL_ENDSTOPS) PROCESS_DUAL_ENDSTOP(Y, Y2, MIN); #else @@ -729,7 +734,7 @@ void Endstops::update() { #endif } else { // +direction - #if HAS_Y_MAX + #if HAS_Y_MAX || (Y_SPI_SENSORLESS && Y_HOME_DIR > 0) #if ENABLED(Y_DUAL_ENDSTOPS) PROCESS_DUAL_ENDSTOP(Y, Y2, MAX); #else @@ -741,7 +746,7 @@ void Endstops::update() { if (stepper.axis_is_moving(Z_AXIS)) { if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. - #if HAS_Z_MIN + #if HAS_Z_MIN || (Z_SPI_SENSORLESS && Z_HOME_DIR < 0) #if ENABLED(Z_TRIPLE_ENDSTOPS) PROCESS_TRIPLE_ENDSTOP(Z, Z2, Z3, MIN); #elif ENABLED(Z_DUAL_ENDSTOPS) @@ -749,7 +754,7 @@ void Endstops::update() { #else #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); - #elif USES_Z_MIN_PROBE_ENDSTOP + #elif HAS_CUSTOM_PROBE_PIN if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); #else PROCESS_ENDSTOP(Z, MIN); @@ -758,17 +763,17 @@ void Endstops::update() { #endif // When closing the gap check the enabled probe - #if USES_Z_MIN_PROBE_ENDSTOP + #if HAS_CUSTOM_PROBE_PIN if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE); #endif } else { // Z +direction. Gantry up, bed down. - #if HAS_Z_MAX + #if HAS_Z_MAX || (Z_SPI_SENSORLESS && Z_HOME_DIR > 0) #if ENABLED(Z_TRIPLE_ENDSTOPS) PROCESS_TRIPLE_ENDSTOP(Z, Z2, Z3, MAX); #elif ENABLED(Z_DUAL_ENDSTOPS) PROCESS_DUAL_ENDSTOP(Z, Z2, MAX); - #elif !USES_Z_MIN_PROBE_ENDSTOP || Z_MAX_PIN != Z_MIN_PROBE_PIN + #elif !HAS_CUSTOM_PROBE_PIN || 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); @@ -778,19 +783,61 @@ void Endstops::update() { } } // Endstops::update() +#if ENABLED(SPI_ENDSTOPS) + + #define X_STOP (X_HOME_DIR < 0 ? X_MIN : X_MAX) + #define Y_STOP (Y_HOME_DIR < 0 ? Y_MIN : Y_MAX) + #define Z_STOP (Z_HOME_DIR < 0 ? Z_MIN : Z_MAX) + + bool Endstops::tmc_spi_homing_check() { + bool hit = false; + #if X_SPI_SENSORLESS + if (tmc_spi_homing.x && stepperX.test_stall_status()) { + SBI(live_state, X_STOP); + hit = true; + } + #endif + #if Y_SPI_SENSORLESS + if (tmc_spi_homing.y && stepperY.test_stall_status()) { + SBI(live_state, Y_STOP); + hit = true; + } + #endif + #if Z_SPI_SENSORLESS + if (tmc_spi_homing.z && stepperZ.test_stall_status()) { + SBI(live_state, Z_STOP); + hit = true; + } + #endif + return hit; + } + + void Endstops::clear_endstop_state() { + #if X_SPI_SENSORLESS + CBI(live_state, X_STOP); + #endif + #if Y_SPI_SENSORLESS + CBI(live_state, Y_STOP); + #endif + #if Z_SPI_SENSORLESS + CBI(live_state, Z_STOP); + #endif + } + +#endif // SPI_ENDSTOPS + #if ENABLED(PINS_DEBUGGING) bool Endstops::monitor_flag = false; /** - * monitors endstops & Z probe for changes + * Monitor Endstops and Z Probe for changes * * If a change is detected then the LED is toggled and - * a message is sent out the serial port + * 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() { diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index d20e61f702a4..151c428edca9 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -29,27 +29,16 @@ #include 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, - Z3_MIN, - Z3_MAX + 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, + Z3_MIN, Z3_MAX }; class Endstops { - public: - #if HAS_EXTRA_ENDSTOPS typedef uint16_t esbits_t; #if ENABLED(X_DUAL_ENDSTOPS) @@ -135,9 +124,9 @@ class Endstops { static void event_handler(); /** - * Report endstop positions in response to M119 + * Report endstop states in response to M119 */ - static void M119(); + static void report_states(); // Enable / disable endstop checking globally static void enable_globally(const bool onoff=true); @@ -172,6 +161,18 @@ class Endstops { static void monitor(); static void run_monitor(); #endif + + #if ENABLED(SPI_ENDSTOPS) + typedef struct { + union { + bool any; + struct { bool x:1, y:1, z:1; }; + }; + } tmc_spi_homing_t; + static tmc_spi_homing_t tmc_spi_homing; + static void clear_endstop_state(); + static bool tmc_spi_homing_check(); + #endif }; extern Endstops endstops; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 5ba992eea5e2..484d6a077a1d 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -51,7 +51,7 @@ #include "../feature/bltouch.h" #endif -#if EITHER(ULTRA_LCD, EXTENSIBLE_UI) +#if HAS_DISPLAY #include "../lcd/ultralcd.h" #endif @@ -70,7 +70,7 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../core/debug_out.h" -#define XYZ_CONSTS(type, array, CONFIG) const PROGMEM type array##_P[XYZ] = { X_##CONFIG, Y_##CONFIG, Z_##CONFIG } +#define XYZ_CONSTS(T, NAME, OPT) const PROGMEM XYZval NAME##_P = { X_##OPT, Y_##OPT, Z_##OPT } XYZ_CONSTS(float, base_min_pos, MIN_POS); XYZ_CONSTS(float, base_max_pos, MAX_POS); @@ -99,33 +99,38 @@ bool relative_mode; // = false; * Used by 'line_to_current_position' to do a move after changing it. * Used by 'sync_plan_position' to update 'planner.position'. */ -float current_position[XYZE] = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS }; +xyze_pos_t current_position = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS }; /** * Cartesian Destination * The destination for a move, filled in by G-code movement commands, * and expected by functions like 'prepare_move_to_destination'. - * Set with 'get_destination_from_command' or 'set_destination_from_current'. + * G-codes can set destination using 'get_destination_from_command' */ -float destination[XYZE]; // = { 0 } +xyze_pos_t destination; // {0} // The active extruder (tool). Set with T command. #if EXTRUDERS > 1 uint8_t active_extruder; // = 0 #endif +#if ENABLED(LCD_SHOW_E_TOTAL) + float e_move_accumulator; // = 0 +#endif + // Extruder offsets #if HAS_HOTEND_OFFSET - float hotend_offset[XYZ][HOTENDS]; // Initialized by settings.load() + xyz_pos_t hotend_offset[HOTENDS]; // Initialized by settings.load() void reset_hotend_offsets() { constexpr float tmp[XYZ][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y, HOTEND_OFFSET_Z }; static_assert( - tmp[X_AXIS][0] == 0 && tmp[Y_AXIS][0] == 0 && tmp[Z_AXIS][0] == 0, + !tmp[X_AXIS][0] && !tmp[Y_AXIS][0] && !tmp[Z_AXIS][0], "Offsets for the first hotend must be 0.0." ); - LOOP_XYZ(i) HOTEND_LOOP() hotend_offset[i][e] = tmp[i][e]; + // Transpose from [XYZ][HOTENDS] to [HOTENDS][XYZ] + HOTEND_LOOP() LOOP_XYZ(a) hotend_offset[e][a] = tmp[a][e]; #if ENABLED(DUAL_X_CARRIAGE) - hotend_offset[X_AXIS][1] = _MAX(X2_HOME_POS, X2_MAX_POS); + hotend_offset[1].x = _MAX(X2_HOME_POS, X2_MAX_POS); #endif } #endif @@ -134,12 +139,11 @@ float destination[XYZE]; // = { 0 } // no other feedrate is specified. Overridden for special moves. // Set by the last G0 through G5 command's "F" parameter. // Functions that override this for custom moves *must always* restore it! -float feedrate_mm_s = MMM_TO_MMS(1500.0f); - +feedRate_t feedrate_mm_s = MMM_TO_MMS(1500); int16_t feedrate_percentage = 100; // Homing feedrate is const progmem - compare to constexpr in the header -const float homing_feedrate_mm_s[XYZ] PROGMEM = { +const feedRate_t homing_feedrate_mm_s[XYZ] PROGMEM = { #if ENABLED(DELTA) MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z), #else @@ -149,14 +153,14 @@ const float homing_feedrate_mm_s[XYZ] PROGMEM = { }; // Cartesian conversion result goes here: -float cartes[XYZ]; +xyz_pos_t cartes; #if IS_KINEMATIC - float delta[ABC]; + abc_pos_t delta; #if HAS_SCARA_OFFSET - float scara_home_offset[ABC]; + abc_pos_t scara_home_offset; #endif #if HAS_SOFTWARE_ENDSTOPS @@ -177,16 +181,16 @@ float cartes[XYZ]; */ #if HAS_POSITION_SHIFT // The distance that XYZ has been offset by G92. Reset by G28. - float position_shift[XYZ] = { 0 }; + xyz_pos_t position_shift{0}; #endif #if HAS_HOME_OFFSET // This offset is added to the configured home position. // Set by M206, M428, or menu item. Saved to EEPROM. - float home_offset[XYZ] = { 0 }; + xyz_pos_t home_offset{0}; #endif #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT // The above two are combined to save on computes - float workspace_offset[XYZ] = { 0 }; + xyz_pos_t workspace_offset{0}; #endif #if HAS_ABL_NOT_UBL @@ -197,10 +201,8 @@ float cartes[XYZ]; * Output the current position to serial */ void report_current_position() { - SERIAL_ECHOPAIR("X:", LOGICAL_X_POSITION(current_position[X_AXIS])); - SERIAL_ECHOPAIR(" Y:", LOGICAL_Y_POSITION(current_position[Y_AXIS])); - SERIAL_ECHOPAIR(" Z:", LOGICAL_Z_POSITION(current_position[Z_AXIS])); - SERIAL_ECHOPAIR(" E:", current_position[E_AXIS]); + const xyz_pos_t lpos = current_position.asLogical(); + SERIAL_ECHOPAIR("X:", lpos.x, " Y:", lpos.y, " Z:", lpos.z, " E:", current_position.e); stepper.report_positions(); @@ -217,10 +219,10 @@ void report_current_position() { */ void sync_plan_position() { if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position); - planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); + planner.set_position_mm(current_position); } -void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); } +void sync_plan_position_e() { planner.set_e_position_mm(current_position.e); } /** * Get the stepper positions in the cartes[] array. @@ -245,10 +247,9 @@ void get_cartesian_from_steppers() { planner.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.set(planner.get_axis_position_mm(X_AXIS), planner.get_axis_position_mm(Y_AXIS)); #endif - cartes[Z_AXIS] = planner.get_axis_position_mm(Z_AXIS); + cartes.z = planner.get_axis_position_mm(Z_AXIS); #endif } @@ -267,16 +268,16 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { get_cartesian_from_steppers(); #if HAS_POSITION_MODIFIERS - float pos[XYZE] = { cartes[X_AXIS], cartes[Y_AXIS], cartes[Z_AXIS], current_position[E_AXIS] }; + xyze_pos_t pos = { cartes.x, cartes.y, cartes.z, current_position.e }; planner.unapply_modifiers(pos #if HAS_LEVELING , true #endif ); - const float (&cartes)[XYZE] = pos; + xyze_pos_t &cartes = pos; #endif if (axis == ALL_AXES) - COPY(current_position, cartes); + current_position = cartes; else current_position[axis] = cartes[axis]; } @@ -285,52 +286,70 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { * Move the planner to the current position from wherever it last moved * (or from wherever it has been told it is located). */ -void line_to_current_position(const float &fr_mm_s/*=feedrate_mm_s*/) { - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_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. - */ -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); +void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) { + planner.buffer_line(current_position, fr_mm_s, active_extruder); } #if IS_KINEMATIC /** - * Calculate delta, start a line, and set current_position to destination + * Buffer a fast move without interpolation. Set current_position to destination */ - void prepare_uninterpolated_move_to_destination(const float &fr_mm_s/*=0.0*/) { - if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_uninterpolated_move_to_destination", destination); + void prepare_fast_move_to_destination(const feedRate_t &scaled_fr_mm_s/*=MMS_SCALED(feedrate_mm_s)*/) { + if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_fast_move_to_destination", destination); #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)); + // UBL segmented line will do Z-only moves in single segment + ubl.line_to_destination_segmented(scaled_fr_mm_s); #else - 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_AXIS] == destination[E_AXIS] - ) return; + if (current_position == destination) return; - planner.buffer_line(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder); + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder); #endif - set_current_from_destination(); + current_position = destination; } #endif // IS_KINEMATIC +void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/ + #if IS_KINEMATIC + , const bool is_fast/*=false*/ + #endif +) { + const feedRate_t old_feedrate = feedrate_mm_s; + if (fr_mm_s) feedrate_mm_s = fr_mm_s; + + const uint16_t old_pct = feedrate_percentage; + feedrate_percentage = 100; + + #if EXTRUDERS + const float old_fac = planner.e_factor[active_extruder]; + planner.e_factor[active_extruder] = 1.0f; + #endif + + #if IS_KINEMATIC + if (is_fast) + prepare_fast_move_to_destination(); + else + #endif + prepare_move_to_destination(); + + feedrate_mm_s = old_feedrate; + feedrate_percentage = old_pct; + #if EXTRUDERS + planner.e_factor[active_extruder] = old_fac; + #endif +} + /** * Plan a move to (X, Y, Z) and set the current_position */ -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 feedRate_t &fr_mm_s/*=0.0*/) { if (DEBUGGING(LEVELING)) DEBUG_XYZ(">>> do_blocking_move_to", rx, ry, rz); - const float z_feedrate = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS), - xy_feedrate = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S; + const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS), + xy_feedrate = fr_mm_s ?: feedRate_t(XY_PROBE_FEEDRATE_MM_S); #if ENABLED(DELTA) @@ -338,39 +357,36 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f REMEMBER(fr, feedrate_mm_s, xy_feedrate); - set_destination_from_current(); // sync destination at the start + destination = current_position; // sync destination at the start - if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_from_current", destination); + if (DEBUGGING(LEVELING)) DEBUG_POS("destination = current_position", destination); // when in the danger zone - if (current_position[Z_AXIS] > delta_clip_start_height) { + if (current_position.z > delta_clip_start_height) { if (rz > delta_clip_start_height) { // staying in the danger zone - destination[X_AXIS] = rx; // move directly (uninterpolated) - destination[Y_AXIS] = ry; - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(); // set_current_from_destination() + destination.set(rx, ry, rz); // move directly (uninterpolated) + prepare_internal_fast_move_to_destination(); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position); return; } - destination[Z_AXIS] = delta_clip_start_height; - prepare_uninterpolated_move_to_destination(); // set_current_from_destination() + destination.z = delta_clip_start_height; + prepare_internal_fast_move_to_destination(); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position); } - if (rz > current_position[Z_AXIS]) { // raising? - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); // set_current_from_destination() + if (rz > current_position.z) { // raising? + destination.z = rz; + prepare_internal_fast_move_to_destination(z_feedrate); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position); } - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - prepare_move_to_destination(); // set_current_from_destination() + destination.set(rx, ry); + prepare_internal_move_to_destination(); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position); - if (rz < current_position[Z_AXIS]) { // lowering? - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); // set_current_from_destination() + if (rz < current_position.z) { // lowering? + destination.z = rz; + prepare_internal_fast_move_to_destination(z_feedrate); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position); } @@ -378,39 +394,37 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f if (!position_is_reachable(rx, ry)) return; - set_destination_from_current(); + destination = current_position; // If Z needs to raise, do it before moving XY - if (destination[Z_AXIS] < rz) { - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); + if (destination.z < rz) { + destination.z = rz; + prepare_internal_fast_move_to_destination(z_feedrate); } - destination[X_AXIS] = rx; - destination[Y_AXIS] = ry; - prepare_uninterpolated_move_to_destination(xy_feedrate); + destination.set(rx, ry); + prepare_internal_fast_move_to_destination(xy_feedrate); // If Z needs to lower, do it after moving XY - if (destination[Z_AXIS] > rz) { - destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); + if (destination.z > rz) { + destination.z = rz; + prepare_internal_fast_move_to_destination(z_feedrate); } #else // If Z needs to raise, do it before moving XY - if (current_position[Z_AXIS] < rz) { - current_position[Z_AXIS] = rz; + if (current_position.z < rz) { + current_position.z = rz; line_to_current_position(z_feedrate); } - current_position[X_AXIS] = rx; - current_position[Y_AXIS] = ry; + current_position.set(rx, ry); line_to_current_position(xy_feedrate); // If Z needs to lower, do it after moving XY - if (current_position[Z_AXIS] > rz) { - current_position[Z_AXIS] = rz; + if (current_position.z > rz) { + current_position.z = rz; line_to_current_position(z_feedrate); } @@ -420,14 +434,36 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f planner.synchronize(); } -void do_blocking_move_to_x(const float &rx, const float &fr_mm_s/*=0.0*/) { - do_blocking_move_to(rx, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_s); + +void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) { + do_blocking_move_to(raw.x, raw.y, current_position.z, fr_mm_s); } -void do_blocking_move_to_z(const float &rz, const float &fr_mm_s/*=0.0*/) { - do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], rz, fr_mm_s); +void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) { + do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s); } -void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm_s/*=0.0*/) { - do_blocking_move_to(rx, ry, current_position[Z_AXIS], fr_mm_s); +void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) { + do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s); +} + +void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s/*=0.0*/) { + do_blocking_move_to(rx, current_position.y, current_position.z, fr_mm_s); +} +void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) { + do_blocking_move_to(current_position.x, ry, current_position.z, fr_mm_s); +} +void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s/*=0.0*/) { + do_blocking_move_to_xy_z(current_position, rz, fr_mm_s); +} + +void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) { + do_blocking_move_to(rx, ry, current_position.z, fr_mm_s); +} +void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) { + do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s); +} + +void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s/*=0.0f*/) { + do_blocking_move_to(raw.x, raw.y, z, fr_mm_s); } // @@ -436,12 +472,15 @@ void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm // static float saved_feedrate_mm_s; static int16_t saved_feedrate_percentage; -void setup_for_endstop_or_probe_move() { +void remember_feedrate_and_scaling() { saved_feedrate_mm_s = feedrate_mm_s; saved_feedrate_percentage = feedrate_percentage; +} +void remember_feedrate_scaling_off() { + remember_feedrate_and_scaling(); feedrate_percentage = 100; } -void clean_up_after_endstop_or_probe_move() { +void restore_feedrate_and_scaling() { feedrate_mm_s = saved_feedrate_mm_s; feedrate_percentage = saved_feedrate_percentage; } @@ -451,7 +490,10 @@ void clean_up_after_endstop_or_probe_move() { bool soft_endstops_enabled = true; // Software Endstops are based on the configured limits. - axis_limits_t soft_endstop[XYZ] = { { X_MIN_BED, X_MAX_BED }, { Y_MIN_BED, Y_MAX_BED }, { Z_MIN_POS, Z_MAX_POS } }; + axis_limits_t soft_endstop = { + { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, + { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } + }; /** * Software endstops can be used to monitor the open end of @@ -473,33 +515,33 @@ void clean_up_after_endstop_or_probe_move() { 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); + const float dual_max_x = _MAX(hotend_offset[1].x, X2_MAX_POS); if (new_tool_index != 0) { // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger) - soft_endstop[X_AXIS].min = X2_MIN_POS; - soft_endstop[X_AXIS].max = dual_max_x; + soft_endstop.min.x = X2_MIN_POS; + soft_endstop.max.x = dual_max_x; } else if (dxc_is_duplicating()) { // In Duplication Mode, T0 can move as far left as X1_MIN_POS // but not so far to the right that T1 would move past the end - soft_endstop[X_AXIS].min = X1_MIN_POS; - soft_endstop[X_AXIS].max = _MIN(X1_MAX_POS, dual_max_x - duplicate_extruder_x_offset); + soft_endstop.min.x = X1_MIN_POS; + soft_endstop.max.x = _MIN(X1_MAX_POS, dual_max_x - duplicate_extruder_x_offset); } else { // In other modes, T0 can move from X1_MIN_POS to X1_MAX_POS - soft_endstop[X_AXIS].min = X1_MIN_POS; - soft_endstop[X_AXIS].max = X1_MAX_POS; + soft_endstop.min.x = X1_MIN_POS; + soft_endstop.max.x = X1_MAX_POS; } } #elif ENABLED(DELTA) - soft_endstop[axis].min = base_min_pos(axis); - soft_endstop[axis].max = (axis == Z_AXIS ? delta_height + soft_endstop.min[axis] = base_min_pos(axis); + soft_endstop.max[axis] = (axis == Z_AXIS ? delta_height #if HAS_BED_PROBE - - zprobe_zoffset + - probe_offset.z #endif : base_max_pos(axis)); @@ -507,11 +549,11 @@ void clean_up_after_endstop_or_probe_move() { case X_AXIS: case Y_AXIS: // Get a minimum radius for clamping - delta_max_radius = _MIN(ABS(_MAX(soft_endstop[X_AXIS].min, soft_endstop[Y_AXIS].min)), soft_endstop[X_AXIS].max, soft_endstop[Y_AXIS].max); + delta_max_radius = _MIN(ABS(_MAX(soft_endstop.min.x, soft_endstop.min.y)), soft_endstop.max.x, soft_endstop.max.y); delta_max_radius_2 = sq(delta_max_radius); break; case Z_AXIS: - delta_clip_start_height = soft_endstop[axis].max - delta_safe_distance_from_top(); + delta_clip_start_height = soft_endstop.max[axis] - delta_safe_distance_from_top(); default: break; } @@ -521,27 +563,25 @@ void clean_up_after_endstop_or_probe_move() { // the movement limits must be shifted by the tool offset to // retain the same physical limit when other tools are selected. if (old_tool_index != new_tool_index) { - const float offs = hotend_offset[axis][new_tool_index] - hotend_offset[axis][old_tool_index]; - soft_endstop[axis].min += offs; - soft_endstop[axis].max += offs; + const float offs = hotend_offset[new_tool_index][axis] - hotend_offset[old_tool_index][axis]; + soft_endstop.min[axis] += offs; + soft_endstop.max[axis] += offs; } else { - const float offs = hotend_offset[axis][active_extruder]; - soft_endstop[axis].min = base_min_pos(axis) + offs; - soft_endstop[axis].max = base_max_pos(axis) + offs; + const float offs = hotend_offset[active_extruder][axis]; + soft_endstop.min[axis] = base_min_pos(axis) + offs; + soft_endstop.max[axis] = base_max_pos(axis) + offs; } #else - soft_endstop[axis].min = base_min_pos(axis); - soft_endstop[axis].max = base_max_pos(axis); + soft_endstop.min[axis] = base_min_pos(axis); + soft_endstop.max[axis] = base_max_pos(axis); #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) - SERIAL_ECHOLNPAIR("Axis ", axis_codes[axis], " min:", soft_endstop[axis].min, " max:", soft_endstop[axis].max); - #endif + if (DEBUGGING(LEVELING)) + SERIAL_ECHOLNPAIR("Axis ", axis_codes[axis], " min:", soft_endstop.min[axis], " max:", soft_endstop.max[axis]); } /** @@ -550,49 +590,46 @@ void clean_up_after_endstop_or_probe_move() { * For DELTA/SCARA the XY constraint is based on the smallest * radius within the set software endstops. */ - void apply_motion_limits(float target[XYZ]) { + void apply_motion_limits(xyz_pos_t &target) { - if (!soft_endstops_enabled) return; + if (!soft_endstops_enabled || !all_axes_homed()) return; #if IS_KINEMATIC #if HAS_HOTEND_OFFSET && ENABLED(DELTA) // The effector center position will be the target minus the hotend offset. - const float offx = hotend_offset[X_AXIS][active_extruder], offy = hotend_offset[Y_AXIS][active_extruder]; + const xy_pos_t offs = hotend_offset[active_extruder]; #else // SCARA needs to consider the angle of the arm through the entire move, so for now use no tool offset. - constexpr float offx = 0, offy = 0; + constexpr xy_pos_t offs{0}; #endif - const float dist_2 = HYPOT2(target[X_AXIS] - offx, target[Y_AXIS] - offy); - if (dist_2 > delta_max_radius_2) { - const float ratio = (delta_max_radius) / SQRT(dist_2); // 200 / 300 = 0.66 - target[X_AXIS] *= ratio; - target[Y_AXIS] *= ratio; - } + const float dist_2 = HYPOT2(target.x - offs.x, target.y - offs.y); + if (dist_2 > delta_max_radius_2) + target *= delta_max_radius / SQRT(dist_2); // 200 / 300 = 0.66 #else #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_X) - NOLESS(target[X_AXIS], soft_endstop[X_AXIS].min); + NOLESS(target.x, soft_endstop.min.x); #endif #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MAX_SOFTWARE_ENDSTOP_X) - NOMORE(target[X_AXIS], soft_endstop[X_AXIS].max); + NOMORE(target.x, soft_endstop.max.x); #endif #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - NOLESS(target[Y_AXIS], soft_endstop[Y_AXIS].min); + NOLESS(target.y, soft_endstop.min.y); #endif #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - NOMORE(target[Y_AXIS], soft_endstop[Y_AXIS].max); + NOMORE(target.y, soft_endstop.max.y); #endif #endif #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - NOLESS(target[Z_AXIS], soft_endstop[Z_AXIS].min); + NOLESS(target.z, soft_endstop.min.z); #endif #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - NOMORE(target[Z_AXIS], soft_endstop[Z_AXIS].max); + NOMORE(target.z, soft_endstop.max.z); #endif } @@ -625,43 +662,38 @@ void clean_up_after_endstop_or_probe_move() { * small incremental moves for DELTA or SCARA. * * For Unified Bed Leveling (Delta or Segmented Cartesian) - * the ubl.prepare_segmented_line_to method replaces this. + * the ubl.line_to_destination_segmented method replaces this. * * For Auto Bed Leveling (Bilinear) with SEGMENT_LEVELED_MOVES * this is replaced by segmented_line_to_destination below. */ - inline bool prepare_kinematic_move_to(const float (&rtarget)[XYZE]) { + inline bool line_to_destination_kinematic() { // Get the top feedrate of the move in the XY plane - const float _feedrate_mm_s = MMS_SCALED(feedrate_mm_s); + const float scaled_fr_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]; + const xyze_float_t diff = destination - current_position; // If the move is only in Z/E don't split up the move - if (!xdiff && !ydiff) { - planner.buffer_line(rtarget, _feedrate_mm_s, active_extruder); + if (!diff.x && !diff.y) { + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder); return false; // caller will update current_position } // Fail if attempting move outside printable radius - if (!position_is_reachable(rtarget[X_AXIS], rtarget[Y_AXIS])) return true; - - // Remaining cartesian distances - const float zdiff = rtarget[Z_AXIS] - current_position[Z_AXIS], - ediff = rtarget[E_AXIS] - current_position[E_AXIS]; + if (!position_is_reachable(destination)) return true; // Get the linear distance in XYZ - float cartesian_mm = SQRT(sq(xdiff) + sq(ydiff) + sq(zdiff)); + float cartesian_mm = diff.magnitude(); // If the move is very short, check the E move distance - if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(ediff); + if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e); // No E move either? Game over. if (UNEAR_ZERO(cartesian_mm)) return true; // Minimum number of seconds to move the given distance - const float seconds = cartesian_mm / _feedrate_mm_s; + const float seconds = cartesian_mm / scaled_fr_mm_s; // The number of segments-per-second times the duration // gives the number of segments @@ -669,7 +701,7 @@ void clean_up_after_endstop_or_probe_move() { // For SCARA enforce a minimum segment size #if IS_SCARA - NOMORE(segments, cartesian_mm * (1.0f / float(SCARA_MIN_SEGMENT_LENGTH))); + NOMORE(segments, cartesian_mm * RECIPROCAL(SCARA_MIN_SEGMENT_LENGTH)); #endif // At least one segment is required @@ -677,16 +709,11 @@ void clean_up_after_endstop_or_probe_move() { // The approximate length of each segment const float inv_segments = 1.0f / float(segments), - segment_distance[XYZE] = { - xdiff * inv_segments, - ydiff * inv_segments, - zdiff * inv_segments, - ediff * inv_segments - }, cartesian_segment_mm = cartesian_mm * inv_segments; + const xyze_float_t segment_distance = diff * inv_segments; #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = _feedrate_mm_s / cartesian_segment_mm; + const float inv_duration = scaled_fr_mm_s / cartesian_segment_mm; #endif /* @@ -698,8 +725,7 @@ void clean_up_after_endstop_or_probe_move() { //*/ // Get the current position as starting point - float raw[XYZE]; - COPY(raw, current_position); + xyze_pos_t raw = current_position; // Calculate and execute the segments while (--segments) { @@ -711,9 +737,9 @@ void clean_up_after_endstop_or_probe_move() { idle(); } - LOOP_XYZE(i) raw[i] += segment_distance[i]; + raw += segment_distance; - if (!planner.buffer_line(raw, _feedrate_mm_s, active_extruder, cartesian_segment_mm + if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, cartesian_segment_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -722,7 +748,7 @@ void clean_up_after_endstop_or_probe_move() { } // Ensure last segment arrives at target location. - planner.buffer_line(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder, cartesian_segment_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -742,26 +768,21 @@ void clean_up_after_endstop_or_probe_move() { * small incremental moves. This allows the planner to * apply more detailed bed leveling to the full move. */ - inline void segmented_line_to_destination(const float &fr_mm_s, const float segment_size=LEVELED_SEGMENT_LENGTH) { + inline void segmented_line_to_destination(const feedRate_t &fr_mm_s, const float segment_size=LEVELED_SEGMENT_LENGTH) { - const float xdiff = destination[X_AXIS] - current_position[X_AXIS], - ydiff = destination[Y_AXIS] - current_position[Y_AXIS]; + const xyze_float_t diff = destination - current_position; // If the move is only in Z/E don't split up the move - if (!xdiff && !ydiff) { + if (!diff.x && !diff.y) { planner.buffer_line(destination, fr_mm_s, active_extruder); return; } - // Remaining cartesian distances - const float zdiff = destination[Z_AXIS] - current_position[Z_AXIS], - 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); + float cartesian_mm = diff.magnitude(); + if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e); if (UNEAR_ZERO(cartesian_mm)) return; // The length divided by the segment size @@ -771,16 +792,11 @@ void clean_up_after_endstop_or_probe_move() { // The approximate length of each segment const float inv_segments = 1.0f / float(segments), - cartesian_segment_mm = cartesian_mm * inv_segments, - segment_distance[XYZE] = { - xdiff * inv_segments, - ydiff * inv_segments, - zdiff * inv_segments, - ediff * inv_segments - }; + cartesian_segment_mm = cartesian_mm * inv_segments; + const xyze_float_t segment_distance = diff * inv_segments; #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = _feedrate_mm_s / cartesian_segment_mm; + const float inv_duration = scaled_fr_mm_s / cartesian_segment_mm; #endif // SERIAL_ECHOPAIR("mm=", cartesian_mm); @@ -788,8 +804,7 @@ void clean_up_after_endstop_or_probe_move() { // SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm); // Get the raw current position as starting point - float raw[XYZE]; - COPY(raw, current_position); + xyze_pos_t raw = current_position; // Calculate and execute the segments while (--segments) { @@ -799,7 +814,7 @@ void clean_up_after_endstop_or_probe_move() { next_idle_ms = millis() + 200UL; idle(); } - LOOP_XYZE(i) raw[i] += segment_distance[i]; + raw += segment_distance; if (!planner.buffer_line(raw, fr_mm_s, active_extruder, cartesian_segment_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration @@ -825,27 +840,28 @@ void clean_up_after_endstop_or_probe_move() { * When a mesh-based leveling system is active, moves are segmented * according to the configuration of the leveling system. * - * Returns true if current_position[] was set to destination[] + * Return true if 'current_position' was set to 'destination' */ inline bool prepare_move_to_destination_cartesian() { + const float scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); #if HAS_MESH - if (planner.leveling_active && planner.leveling_active_at_z(destination[Z_AXIS])) { + if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) { #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.line_to_destination_cartesian(MMS_SCALED(feedrate_mm_s), active_extruder); // UBL's motion routine needs to know about - return true; // all moves, including Z-only moves. + ubl.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about + return true; // all moves, including Z-only moves. #elif ENABLED(SEGMENT_LEVELED_MOVES) - segmented_line_to_destination(MMS_SCALED(feedrate_mm_s)); + segmented_line_to_destination(scaled_fr_mm_s); return false; // caller will update current_position #else /** * For MBL and ABL-BILINEAR only segment moves when X or Y are involved. * Otherwise fall through to do a direct single move. */ - if (current_position[X_AXIS] != destination[X_AXIS] || current_position[Y_AXIS] != destination[Y_AXIS]) { + if (xy_pos_t(current_position) != xy_pos_t(destination)) { #if ENABLED(MESH_BED_LEVELING) - mbl.line_to_destination(MMS_SCALED(feedrate_mm_s)); + mbl.line_to_destination(scaled_fr_mm_s); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_line_to_destination(MMS_SCALED(feedrate_mm_s)); + bilinear_line_to_destination(scaled_fr_mm_s); #endif return true; } @@ -853,7 +869,7 @@ void clean_up_after_endstop_or_probe_move() { } #endif // HAS_MESH - buffer_line_to_destination(MMS_SCALED(feedrate_mm_s)); + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder); return false; // caller will update current_position } @@ -872,8 +888,8 @@ void clean_up_after_endstop_or_probe_move() { DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; float inactive_extruder_x_pos = X2_MAX_POS, // used in mode 0 & 1 - raised_parked_position[XYZE], // used in mode 1 duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2 + xyz_pos_t raised_parked_position; // used in mode 1 bool active_extruder_parked = false; // used in mode 1 & 2 millis_t delayed_move_time = 0; // used in mode 1 int16_t duplicate_extruder_temp_offset = 0; // used in mode 2 @@ -888,7 +904,7 @@ void clean_up_after_endstop_or_probe_move() { * This allows soft recalibration of the second extruder home position * without firmware reflash (through the M218 command). */ - return hotend_offset[X_AXIS][1] > 0 ? hotend_offset[X_AXIS][1] : X2_HOME_POS; + return hotend_offset[1].x > 0 ? hotend_offset[1].x : X2_HOME_POS; } /** @@ -902,30 +918,30 @@ void clean_up_after_endstop_or_probe_move() { case DXC_FULL_CONTROL_MODE: break; case DXC_AUTO_PARK_MODE: - if (current_position[E_AXIS] == destination[E_AXIS]) { + if (current_position.e == destination.e) { // 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) if (delayed_move_time != 0xFFFFFFFFUL) { - set_current_from_destination(); - NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]); + current_position = destination; + NOLESS(raised_parked_position.z, destination.z); delayed_move_time = millis(); return true; } } // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower - #define CUR_X current_position[X_AXIS] - #define CUR_Y current_position[Y_AXIS] - #define CUR_Z current_position[Z_AXIS] - #define CUR_E current_position[E_AXIS] - #define RAISED_X raised_parked_position[X_AXIS] - #define RAISED_Y raised_parked_position[Y_AXIS] - #define RAISED_Z raised_parked_position[Z_AXIS] + #define CUR_X current_position.x + #define CUR_Y current_position.y + #define CUR_Z current_position.z + #define CUR_E current_position.e + #define RAISED_X raised_parked_position.x + #define RAISED_Y raised_parked_position.y + #define RAISED_Z raised_parked_position.z if ( planner.buffer_line(RAISED_X, RAISED_Y, RAISED_Z, CUR_E, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder)) if (planner.buffer_line( CUR_X, CUR_Y, RAISED_Z, CUR_E, PLANNER_XY_FEEDRATE(), active_extruder)) - planner.buffer_line( CUR_X, CUR_Y, CUR_Z, CUR_E, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); + line_to_current_position(planner.settings.max_feedrate_mm_s[Z_AXIS]); delayed_move_time = 0; active_extruder_parked = false; if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Clear active_extruder_parked"); @@ -933,16 +949,15 @@ void clean_up_after_endstop_or_probe_move() { case DXC_MIRRORED_MODE: case DXC_DUPLICATION_MODE: if (active_extruder == 0) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Set planner X", inactive_extruder_x_pos, " ... Line to X", current_position[X_AXIS] + duplicate_extruder_x_offset); + xyze_pos_t new_pos = current_position; + if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) + new_pos.x += duplicate_extruder_x_offset; + else + new_pos.x = inactive_extruder_x_pos; // move duplicate extruder into correct duplication position. - planner.set_position_mm(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); - - if (!planner.buffer_line( - dual_x_carriage_mode == DXC_DUPLICATION_MODE ? duplicate_extruder_x_offset + current_position[X_AXIS] : inactive_extruder_x_pos, - current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], - planner.settings.max_feedrate_mm_s[X_AXIS], 1 - ) - ) break; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Set planner X", inactive_extruder_x_pos, " ... Line to X", new_pos.x); + planner.set_position_mm(inactive_extruder_x_pos, current_position.y, current_position.z, current_position.e); + if (!planner.buffer_line(new_pos, planner.settings.max_feedrate_mm_s[X_AXIS], 1)) break; planner.synchronize(); sync_plan_position(); extruder_duplication_enabled = true; @@ -965,40 +980,47 @@ void clean_up_after_endstop_or_probe_move() { * This may result in several calls to planner.buffer_line to * do smaller moves for DELTA, SCARA, mesh moves, etc. * - * Make sure current_position[E] and destination[E] are good + * Make sure current_position.e and destination.e are good * before calling or cold/lengthy extrusion may get missed. + * + * Before exit, current_position is set to destination. */ void prepare_move_to_destination() { apply_motion_limits(destination); #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) - if (!DEBUGGING(DRYRUN)) { - if (destination[E_AXIS] != current_position[E_AXIS]) { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.tooColdToExtrude(active_extruder)) { - current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); - } - #endif // PREVENT_COLD_EXTRUSION - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - const float e_delta = ABS(destination[E_AXIS] - current_position[E_AXIS]) * planner.e_factor[active_extruder]; - if (e_delta > (EXTRUDE_MAXLENGTH)) { - #if ENABLED(MIXING_EXTRUDER) - bool ignore_e = false; - float collector[MIXING_STEPPERS]; - mixer.refresh_collector(1.0, mixer.get_current_vtool(), collector); - MIXER_STEPPER_LOOP(e) - if (e_delta * collector[e] > (EXTRUDE_MAXLENGTH)) { ignore_e = true; break; } - #else - constexpr bool ignore_e = true; - #endif - if (ignore_e) { - current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); + if (!DEBUGGING(DRYRUN) && destination.e != current_position.e) { + bool ignore_e = false; + + #if ENABLED(PREVENT_COLD_EXTRUSION) + ignore_e = thermalManager.tooColdToExtrude(active_extruder); + if (ignore_e) SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); + #endif + + #if ENABLED(PREVENT_LENGTHY_EXTRUDE) + const float e_delta = ABS(destination.e - current_position.e) * planner.e_factor[active_extruder]; + if (e_delta > (EXTRUDE_MAXLENGTH)) { + #if ENABLED(MIXING_EXTRUDER) + float collector[MIXING_STEPPERS]; + mixer.refresh_collector(1.0, mixer.get_current_vtool(), collector); + MIXER_STEPPER_LOOP(e) { + if (e_delta * collector[e] > (EXTRUDE_MAXLENGTH)) { + ignore_e = true; + SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); + break; + } } - } - #endif // PREVENT_LENGTHY_EXTRUDE + #else + ignore_e = true; + SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); + #endif + } + #endif + + if (ignore_e) { + current_position.e = destination.e; // Behave as if the E move really took place + planner.set_e_position_mm(destination.e); // Prevent the planner from complaining too } } @@ -1010,42 +1032,47 @@ void prepare_move_to_destination() { if ( #if UBL_SEGMENTED - //ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s)) // This doesn't seem to work correctly on UBL. - #if IS_KINEMATIC // Use Kinematic / Cartesian cases as a workaround for now. - ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s)) + #if IS_KINEMATIC // UBL using Kinematic / Cartesian cases as a workaround for now. + ubl.line_to_destination_segmented(MMS_SCALED(feedrate_mm_s)) #else prepare_move_to_destination_cartesian() #endif #elif IS_KINEMATIC - prepare_kinematic_move_to(destination) + line_to_destination_kinematic() #else prepare_move_to_destination_cartesian() #endif ) return; - set_current_from_destination(); + current_position = destination; } -bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) { +uint8_t axes_need_homing(uint8_t axis_bits/*=0x07*/) { #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); + #define HOMED_FLAGS axis_known_position #else - const bool xx = x && !TEST(axis_homed, X_AXIS), - yy = y && !TEST(axis_homed, Y_AXIS), - zz = z && !TEST(axis_homed, Z_AXIS); + #define HOMED_FLAGS axis_homed #endif - if (xx || yy || zz) { + // Clear test bits that are homed + if (TEST(axis_bits, X_AXIS) && TEST(HOMED_FLAGS, X_AXIS)) CBI(axis_bits, X_AXIS); + if (TEST(axis_bits, Y_AXIS) && TEST(HOMED_FLAGS, Y_AXIS)) CBI(axis_bits, Y_AXIS); + if (TEST(axis_bits, Z_AXIS) && TEST(HOMED_FLAGS, Z_AXIS)) CBI(axis_bits, Z_AXIS); + return axis_bits; +} + +bool axis_unhomed_error(uint8_t axis_bits/*=0x07*/) { + if ((axis_bits = axes_need_homing(axis_bits))) { + PGM_P home_first = GET_TEXT(MSG_HOME_FIRST); + char msg[strlen_P(home_first)+1]; + sprintf_P(msg, home_first, + TEST(axis_bits, X_AXIS) ? "X" : "", + TEST(axis_bits, Y_AXIS) ? "Y" : "", + TEST(axis_bits, Z_AXIS) ? "Z" : "" + ); SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOME " "); - if (xx) SERIAL_CHAR('X'); - if (yy) SERIAL_CHAR('Y'); - if (zz) SERIAL_CHAR('Z'); - SERIAL_ECHOLNPGM(" " MSG_FIRST); - - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - ui.status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : ""); + SERIAL_ECHOLN(msg); + #if HAS_DISPLAY + ui.set_status(msg); #endif return true; } @@ -1055,7 +1082,7 @@ bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool /** * Homing bump feedrate (mm/s) */ -float get_homing_bump_feedrate(const AxisEnum axis) { +feedRate_t 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 @@ -1065,7 +1092,7 @@ float get_homing_bump_feedrate(const AxisEnum axis) { hbd = 10; SERIAL_ECHO_MSG("Warning: Homing Bump Divisor < 1"); } - return homing_feedrate(axis) / hbd; + return homing_feedrate(axis) / float(hbd); } #if ENABLED(SENSORLESS_HOMING) @@ -1073,7 +1100,7 @@ float get_homing_bump_feedrate(const AxisEnum axis) { * Set sensorless homing if the axis has it, accounting for Core Kinematics. */ sensorless_t start_sensorless_homing_per_axis(const AxisEnum axis) { - sensorless_t stealth_states { false, false, false, false, false, false, false }; + sensorless_t stealth_states { false }; switch (axis) { default: break; @@ -1120,6 +1147,26 @@ float get_homing_bump_feedrate(const AxisEnum axis) { break; #endif } + + #if ENABLED(SPI_ENDSTOPS) + switch (axis) { + #if X_SPI_SENSORLESS + case X_AXIS: endstops.tmc_spi_homing.x = true; break; + #endif + #if Y_SPI_SENSORLESS + case Y_AXIS: endstops.tmc_spi_homing.y = true; break; + #endif + #if Z_SPI_SENSORLESS + case Z_AXIS: endstops.tmc_spi_homing.z = true; break; + #endif + default: break; + } + #endif + + #if ENABLED(IMPROVE_HOMING_RELIABILITY) + sg_guard_period = millis() + default_sg_guard_duration; + #endif + return stealth_states; } @@ -1169,6 +1216,21 @@ float get_homing_bump_feedrate(const AxisEnum axis) { break; #endif } + + #if ENABLED(SPI_ENDSTOPS) + switch (axis) { + #if X_SPI_SENSORLESS + case X_AXIS: endstops.tmc_spi_homing.x = false; break; + #endif + #if Y_SPI_SENSORLESS + case Y_AXIS: endstops.tmc_spi_homing.y = false; break; + #endif + #if Z_SPI_SENSORLESS + case Z_AXIS: endstops.tmc_spi_homing.z = false; break; + #endif + default: break; + } + #endif } #endif // SENSORLESS_HOMING @@ -1176,7 +1238,7 @@ float get_homing_bump_feedrate(const AxisEnum axis) { /** * Home an individual linear axis */ -void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm_s=0.0) { +void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t fr_mm_s=0.0) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOPAIR(">>> do_homing_move(", axis_codes[axis], ", ", distance, ", "); @@ -1221,28 +1283,29 @@ void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm #endif } + const feedRate_t real_fr_mm_s = fr_mm_s ?: homing_feedrate(axis); #if IS_SCARA // Tell the planner the axis is at 0 current_position[axis] = 0; sync_plan_position(); current_position[axis] = distance; - planner.buffer_line(current_position, fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); + line_to_current_position(real_fr_mm_s); #else - float target[ABCE] = { 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(E_AXIS) }; + abce_pos_t target = { 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(E_AXIS) }; target[axis] = 0; planner.set_machine_position_mm(target); target[axis] = distance; - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - const float delta_mm_cart[XYZE] = {0, 0, 0, 0}; + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + const xyze_float_t delta_mm_cart{0}; #endif // Set delta/cartesian axes directly planner.buffer_segment(target - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) , delta_mm_cart #endif - , fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder + , real_fr_mm_s, active_extruder ); #endif @@ -1289,14 +1352,9 @@ void set_axis_is_at_home(const AxisEnum axis) { SBI(axis_known_position, axis); SBI(axis_homed, axis); - #if HAS_POSITION_SHIFT - position_shift[axis] = 0; - update_workspace_offset(axis); - #endif - #if ENABLED(DUAL_X_CARRIAGE) if (axis == X_AXIS && (active_extruder == 1 || dual_x_carriage_mode == DXC_DUPLICATION_MODE)) { - current_position[X_AXIS] = x_home_pos(active_extruder); + current_position.x = x_home_pos(active_extruder); return; } #endif @@ -1306,7 +1364,7 @@ void set_axis_is_at_home(const AxisEnum axis) { #elif ENABLED(DELTA) current_position[axis] = (axis == Z_AXIS ? delta_height #if HAS_BED_PROBE - - zprobe_zoffset + - probe_offset.z #endif : base_home_pos(axis)); #else @@ -1320,9 +1378,9 @@ void set_axis_is_at_home(const AxisEnum axis) { if (axis == Z_AXIS) { #if HOMING_Z_WITH_PROBE - current_position[Z_AXIS] -= zprobe_zoffset; + current_position.z -= probe_offset.z; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> zprobe_zoffset = ", zprobe_zoffset); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> probe_offset.z = ", probe_offset.z); #else @@ -1340,6 +1398,11 @@ void set_axis_is_at_home(const AxisEnum axis) { babystep.reset_total(axis); #endif + #if HAS_POSITION_SHIFT + position_shift[axis] = 0; + update_workspace_offset(axis); + #endif + if (DEBUGGING(LEVELING)) { #if HAS_HOME_OFFSET DEBUG_ECHOLNPAIR("> home_offset[", axis_codes[axis], "] = ", home_offset[axis]); @@ -1382,9 +1445,24 @@ void homeaxis(const AxisEnum axis) { // Only Z homing (with probe) is permitted if (axis != Z_AXIS) { BUZZ(100, 880); return; } #else - #define CAN_HOME(A) \ + #define _CAN_HOME(A) \ (axis == _AXIS(A) && ((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; + #if X_SPI_SENSORLESS + #define CAN_HOME_X true + #else + #define CAN_HOME_X _CAN_HOME(X) + #endif + #if Y_SPI_SENSORLESS + #define CAN_HOME_Y true + #else + #define CAN_HOME_Y _CAN_HOME(Y) + #endif + #if Z_SPI_SENSORLESS + #define CAN_HOME_Z true + #else + #define CAN_HOME_Z _CAN_HOME(Z) + #endif + if (!CAN_HOME_X && !CAN_HOME_Y && !CAN_HOME_Z) return; #endif if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(">>> homeaxis(", axis_codes[axis], ")"); @@ -1452,7 +1530,7 @@ void homeaxis(const AxisEnum axis) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move Away:"); do_homing_move(axis, -bump #if HOMING_Z_WITH_PROBE - , axis == Z_AXIS ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : 0.0 + , MMM_TO_MMS(axis == Z_AXIS ? Z_PROBE_SPEED_FAST : 0) #endif ); @@ -1601,6 +1679,26 @@ void homeaxis(const AxisEnum axis) { if (axis == Z_AXIS && STOW_PROBE()) return; #endif + #ifdef HOMING_BACKOFF_MM + constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM; + const float backoff_mm = endstop_backoff[ + #if ENABLED(DELTA) + Z_AXIS + #else + axis + #endif + ]; + if (backoff_mm) { + current_position[axis] -= ABS(backoff_mm) * axis_home_dir; + line_to_current_position( + #if HOMING_Z_WITH_PROBE + (axis == Z_AXIS) ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : + #endif + homing_feedrate(axis) + ); + } + #endif + // Clear retracted status if homing the Z axis #if ENABLED(FWRETRACT) if (axis == Z_AXIS) fwretract.current_hop = 0.0; diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 35819187ae54..2e8ff64f52ec 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -27,10 +27,13 @@ * High-level motion commands to feed the planner * Some of these methods may migrate to the planner class. */ -#pragma once #include "../inc/MarlinConfig.h" +#if HAS_BED_PROBE + #include "probe.h" +#endif + #if IS_SCARA #include "scara.h" #endif @@ -58,15 +61,15 @@ constexpr float slop = 0.0001; extern bool relative_mode; -extern float current_position[XYZE], // High-level current tool position - destination[XYZE]; // Destination for a move +extern xyze_pos_t current_position, // High-level current tool position + destination; // Destination for a move // Scratch space for a cartesian result -extern float cartes[XYZ]; +extern xyz_pos_t cartes; // Until kinematics.cpp is created, declare this here #if IS_KINEMATIC - extern float delta[ABC]; + extern abc_pos_t delta; #endif #if HAS_ABL_NOT_UBL @@ -78,21 +81,24 @@ extern float cartes[XYZ]; #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE() #endif +#if ENABLED(Z_SAFE_HOMING) + constexpr xy_float_t safe_homing_xy = { Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT }; +#endif + /** * Feed rates are often configured with mm/m * but the planner and stepper like mm/s units. */ -extern const float homing_feedrate_mm_s[XYZ]; -FORCE_INLINE float homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } -float get_homing_bump_feedrate(const AxisEnum axis); +extern const feedRate_t homing_feedrate_mm_s[XYZ]; +FORCE_INLINE feedRate_t homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } +feedRate_t get_homing_bump_feedrate(const AxisEnum axis); -extern float feedrate_mm_s; +extern feedRate_t feedrate_mm_s; /** - * Feedrate scaling and conversion + * Feedrate scaling */ extern int16_t feedrate_percentage; -#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01f) // The active extruder (tool). Set with T command. #if EXTRUDERS > 1 @@ -101,13 +107,16 @@ extern int16_t feedrate_percentage; constexpr uint8_t active_extruder = 0; #endif +#if ENABLED(LCD_SHOW_E_TOTAL) + extern float e_move_accumulator; +#endif + FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float(p); } FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte(p); } -#define XYZ_DEFS(type, array, CONFIG) \ - extern const type array##_P[XYZ]; \ - FORCE_INLINE type array(AxisEnum axis) { return pgm_read_any(&array##_P[axis]); } \ - typedef void __void_##CONFIG##__ +#define XYZ_DEFS(T, NAME, OPT) \ + extern const XYZval NAME##_P; \ + FORCE_INLINE T NAME(AxisEnum axis) { return pgm_read_any(&NAME##_P[axis]); } XYZ_DEFS(float, base_min_pos, MIN_POS); XYZ_DEFS(float, base_max_pos, MAX_POS); @@ -123,17 +132,19 @@ XYZ_DEFS(signed char, home_dir, HOME_DIR); #endif #if HAS_HOTEND_OFFSET - extern float hotend_offset[XYZ][HOTENDS]; + extern xyz_pos_t hotend_offset[HOTENDS]; void reset_hotend_offsets(); +#elif HOTENDS + constexpr xyz_pos_t hotend_offset[HOTENDS] = { { 0 } }; #else - constexpr float hotend_offset[XYZ][HOTENDS] = { { 0 }, { 0 }, { 0 } }; + constexpr xyz_pos_t hotend_offset[1] = { { 0 } }; #endif -typedef struct { float min, max; } axis_limits_t; +typedef struct { xyz_pos_t min, max; } axis_limits_t; #if HAS_SOFTWARE_ENDSTOPS extern bool soft_endstops_enabled; - extern axis_limits_t soft_endstop[XYZ]; - void apply_motion_limits(float target[XYZ]); + extern axis_limits_t soft_endstop; + void apply_motion_limits(xyz_pos_t &target); void update_software_endstops(const AxisEnum axis #if HAS_HOTEND_OFFSET , const uint8_t old_tool_index=0, const uint8_t new_tool_index=0 @@ -141,16 +152,15 @@ typedef struct { float min, max; } axis_limits_t; ); #else constexpr bool soft_endstops_enabled = false; - //constexpr axis_limits_t soft_endstop[XYZ] = { { X_MIN_POS, X_MAX_POS }, { Y_MIN_POS, Y_MAX_POS }, { Z_MIN_POS, Z_MAX_POS } }; + //constexpr axis_limits_t soft_endstop = { + // { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }, + // { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } }; #define apply_motion_limits(V) NOOP #define update_software_endstops(...) NOOP #endif void report_current_position(); -inline void set_current_from_destination() { COPY(current_position, destination); } -inline void set_destination_from_current() { COPY(destination, current_position); } - void get_cartesian_from_steppers(); void set_current_from_steppers_for_axis(const AxisEnum axis); @@ -167,44 +177,59 @@ void sync_plan_position_e(); * Move the planner to the current position from wherever it last moved * (or from wherever it has been told it is located). */ -void line_to_current_position(const float &fr_mm_s=feedrate_mm_s); +void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s); -/** - * 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. - */ -void buffer_line_to_destination(const float fr_mm_s); +void prepare_move_to_destination(); + +void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f + #if IS_KINEMATIC + , const bool is_fast=false + #endif +); + +inline void prepare_internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f) { + _internal_move_to_destination(fr_mm_s); +} #if IS_KINEMATIC - void prepare_uninterpolated_move_to_destination(const float &fr_mm_s=0); -#endif + void prepare_fast_move_to_destination(const feedRate_t &scaled_fr_mm_s=MMS_SCALED(feedrate_mm_s)); -void prepare_move_to_destination(); + inline void prepare_internal_fast_move_to_destination(const feedRate_t &fr_mm_s=0.0f) { + _internal_move_to_destination(fr_mm_s, true); + } +#endif /** * 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); +void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f); -FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZ], const float &fr_mm_s=0) { - do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); -} +void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f); -FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZE], const float &fr_mm_s=0) { - do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); -} +void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f); +FORCE_INLINE void do_blocking_move_to_xy(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); } +FORCE_INLINE void do_blocking_move_to_xy(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); } -void setup_for_endstop_or_probe_move(); -void clean_up_after_endstop_or_probe_move(); +void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f); +FORCE_INLINE void do_blocking_move_to_xy_z(const xyz_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); } +FORCE_INLINE void do_blocking_move_to_xy_z(const xyze_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); } + +void remember_feedrate_and_scaling(); +void remember_feedrate_scaling_off(); +void restore_feedrate_and_scaling(); // // Homing // -bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true); +uint8_t axes_need_homing(uint8_t axis_bits=0x07); +bool axis_unhomed_error(uint8_t axis_bits=0x07); #if ENABLED(NO_MOTION_BEFORE_HOMING) #define MOTION_CONDITIONS (IsRunning() && !axis_unhomed_error()) @@ -223,24 +248,36 @@ void homeaxis(const AxisEnum axis); */ #if HAS_HOME_OFFSET || HAS_POSITION_SHIFT #if HAS_HOME_OFFSET - extern float home_offset[XYZ]; + extern xyz_pos_t home_offset; #endif #if HAS_POSITION_SHIFT - extern float position_shift[XYZ]; + extern xyz_pos_t position_shift; #endif #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT - extern float workspace_offset[XYZ]; - #define WORKSPACE_OFFSET(AXIS) workspace_offset[AXIS] + extern xyz_pos_t workspace_offset; + #define _WS workspace_offset #elif HAS_HOME_OFFSET - #define WORKSPACE_OFFSET(AXIS) home_offset[AXIS] + #define _WS home_offset #else - #define WORKSPACE_OFFSET(AXIS) position_shift[AXIS] + #define _WS position_shift #endif - #define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS)) - #define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS)) + #define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + _WS[AXIS]) + #define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - _WS[AXIS]) + FORCE_INLINE void toLogical(xy_pos_t &raw) { raw += _WS; } + FORCE_INLINE void toLogical(xyz_pos_t &raw) { raw += _WS; } + FORCE_INLINE void toLogical(xyze_pos_t &raw) { raw += _WS; } + FORCE_INLINE void toNative(xy_pos_t &raw) { raw -= _WS; } + FORCE_INLINE void toNative(xyz_pos_t &raw) { raw -= _WS; } + FORCE_INLINE void toNative(xyze_pos_t &raw) { raw -= _WS; } #else #define NATIVE_TO_LOGICAL(POS, AXIS) (POS) #define LOGICAL_TO_NATIVE(POS, AXIS) (POS) + FORCE_INLINE void toLogical(xy_pos_t&) {} + FORCE_INLINE void toLogical(xyz_pos_t&) {} + FORCE_INLINE void toLogical(xyze_pos_t&) {} + FORCE_INLINE void toNative(xy_pos_t&) {} + FORCE_INLINE void toNative(xyz_pos_t&) {} + FORCE_INLINE void toNative(xyze_pos_t&) {} #endif #define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS) #define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS) @@ -254,19 +291,14 @@ void homeaxis(const AxisEnum axis); */ #if IS_KINEMATIC // (DELTA or SCARA) - - #if IS_SCARA - extern const float L1, L2; - #endif - #if HAS_SCARA_OFFSET - extern float scara_home_offset[ABC]; // A and B angular offsets, Z mm offset + extern abc_pos_t scara_home_offset; // A and B angular offsets, Z mm offset #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) { #if ENABLED(DELTA) - return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset); + return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset + slop); #elif IS_SCARA const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y); return ( @@ -278,11 +310,15 @@ void homeaxis(const AxisEnum axis); #endif } + inline bool position_is_reachable(const xy_pos_t &pos, const float inset=0) { + return position_is_reachable(pos.x, pos.y, inset); + } + #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)) + return position_is_reachable(rx - probe_offset.x, ry - probe_offset.y) && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE)); } #endif @@ -301,6 +337,7 @@ void homeaxis(const AxisEnum axis); return WITHIN(rx, X_MIN_POS - slop, X_MAX_POS + slop); #endif } + inline bool position_is_reachable(const xy_pos_t &pos) { return position_is_reachable(pos.x, pos.y); } #if HAS_BED_PROBE /** @@ -311,9 +348,9 @@ void homeaxis(const AxisEnum axis); * 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 - slop, MAX_PROBE_X + slop) - && WITHIN(ry, MIN_PROBE_Y - slop, MAX_PROBE_Y + slop); + return position_is_reachable(rx - probe_offset.x, ry - probe_offset.y) + && WITHIN(rx, probe_min_x() - slop, probe_max_x() + slop) + && WITHIN(ry, probe_min_y() - slop, probe_max_y() + slop); } #endif @@ -322,6 +359,7 @@ void homeaxis(const AxisEnum axis); #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 +FORCE_INLINE bool position_is_reachable_by_probe(const xy_pos_t &pos) { return position_is_reachable_by_probe(pos.x, pos.y); } /** * Duplication mode @@ -348,8 +386,8 @@ void homeaxis(const AxisEnum axis); extern DualXMode dual_x_carriage_mode; extern float inactive_extruder_x_pos, // Used in mode 0 & 1 - raised_parked_position[XYZE], // Used in mode 1 duplicate_extruder_x_offset; // Used in mode 2 & 3 + extern xyz_pos_t raised_parked_position; // Used in mode 1 extern bool active_extruder_parked; // Used in mode 1, 2 & 3 extern millis_t delayed_move_time; // Used in mode 1 extern int16_t duplicate_extruder_temp_offset; // Used in mode 2 & 3 diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 561d2b6469c3..50a9beb4d201 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -96,6 +96,18 @@ #include "../feature/backlash.h" #endif +#if ENABLED(CANCEL_OBJECTS) + #include "../feature/cancel_object.h" +#endif + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../feature/power_loss_recovery.h" +#endif + +#if HAS_CUTTER + #include "../feature/spindle_laser.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 @@ -121,7 +133,7 @@ uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step -#if ENABLED(JUNCTION_DEVIATION) +#if DISABLED(CLASSIC_JERK) float Planner::junction_deviation_mm; // (mm) M205 J #if ENABLED(LIN_ADVANCE) #if ENABLED(DISTINCT_E_FACTORS) @@ -132,10 +144,10 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step #endif #endif #if HAS_CLASSIC_JERK - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) - float Planner::max_jerk[XYZ]; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration. + #if HAS_LINEAR_E_JERK + xyz_pos_t Planner::max_jerk; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration. #else - float Planner::max_jerk[XYZE]; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. + xyze_pos_t Planner::max_jerk; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. #endif #endif @@ -147,9 +159,10 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step uint8_t Planner::last_extruder = 0; // Respond to extruder change #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 +#if EXTRUDERS + 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 +#endif #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 @@ -182,12 +195,12 @@ skew_factor_t Planner::skew_factor; // Initialized by settings.load() // private: -int32_t Planner::position[NUM_AXIS] = { 0 }; +xyze_long_t Planner::position{0}; uint32_t Planner::cutoff_long; -float Planner::previous_speed[NUM_AXIS], - Planner::previous_nominal_speed_sqr; +xyze_float_t Planner::previous_speed; +float Planner::previous_nominal_speed_sqr; #if ENABLED(DISABLE_INACTIVE_EXTRUDER) uint8_t Planner::g_uc_extruder_last_move[EXTRUDERS] = { 0 }; @@ -197,7 +210,7 @@ float Planner::previous_speed[NUM_AXIS], // Old direction bits. Used for speed calculations unsigned char Planner::old_direction_bits = 0; // Segment times (in µs). Used for speed calculations - uint32_t Planner::axis_segment_time_us[2][3] = { { MAX_FREQ_TIME_US + 1, 0, 0 }, { MAX_FREQ_TIME_US + 1, 0, 0 } }; + xy_ulong_t Planner::axis_segment_time_us[3] = { { MAX_FREQ_TIME_US + 1, MAX_FREQ_TIME_US + 1 } }; #endif #if ENABLED(LIN_ADVANCE) @@ -205,14 +218,14 @@ float Planner::previous_speed[NUM_AXIS], #endif #if HAS_POSITION_FLOAT - float Planner::position_float[XYZE]; // Needed for accurate maths. Steps cannot be used! + xyze_pos_t Planner::position_float; // Needed for accurate maths. Steps cannot be used! #endif #if IS_KINEMATIC - float Planner::position_cart[XYZE]; + xyze_pos_t Planner::position_cart; #endif -#if ENABLED(ULTRA_LCD) +#if HAS_SPI_LCD volatile uint32_t Planner::block_buffer_runtime_us = 0; #endif @@ -223,14 +236,14 @@ float Planner::previous_speed[NUM_AXIS], Planner::Planner() { init(); } void Planner::init() { - ZERO(position); + position.reset(); #if HAS_POSITION_FLOAT - ZERO(position_float); + position_float.reset(); #endif #if IS_KINEMATIC - ZERO(position_cart); + position_cart.reset(); #endif - ZERO(previous_speed); + previous_speed.reset(); previous_nominal_speed_sqr = 0; #if ABL_PLANAR bed_level_matrix.set_to_identity(); @@ -994,23 +1007,23 @@ void Planner::forward_pass() { // pass will never modify the values at the tail. uint8_t block_index = block_buffer_planned; - block_t *current; + block_t *block; const block_t * previous = nullptr; while (block_index != block_buffer_head) { // Perform the forward pass - current = &block_buffer[block_index]; + block = &block_buffer[block_index]; // Skip SYNC blocks - if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { + if (!TEST(block->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; + forward_pass_kernel(previous, block, block_index); + previous = block; } // Advance to the previous block_index = next_block_index(block_index); @@ -1045,7 +1058,7 @@ void Planner::recalculate_trapezoids() { } // Go from the tail (currently executed block) to the first block, without including it) - block_t *current = nullptr, *next = nullptr; + block_t *block = nullptr, *next = nullptr; float current_entry_speed = 0.0, next_entry_speed = 0.0; while (block_index != head_block_index) { @@ -1055,41 +1068,41 @@ void Planner::recalculate_trapezoids() { if (!TEST(next->flag, BLOCK_BIT_SYNC_POSITION)) { next_entry_speed = SQRT(next->entry_speed_sqr); - if (current) { + if (block) { // Recalculate if current block entry or exit junction speed has changed. - if (TEST(current->flag, BLOCK_BIT_RECALCULATE) || TEST(next->flag, BLOCK_BIT_RECALCULATE)) { + if (TEST(block->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); + SBI(block->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)) { + if (!stepper.is_block_busy(block)) { // 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), + const float current_nominal_speed = SQRT(block->nominal_speed_sqr), nomr = 1.0f / current_nominal_speed; - calculate_trapezoid_for_block(current, current_entry_speed * nomr, next_entry_speed * nomr); + calculate_trapezoid_for_block(block, 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[active_extruder] * settings.axis_steps_per_mm[E_AXIS]; - current->max_adv_steps = current_nominal_speed * comp; - current->final_adv_steps = next_entry_speed * comp; + if (block->use_advance_lead) { + const float comp = block->e_D_ratio * extruder_advance_K[active_extruder] * settings.axis_steps_per_mm[E_AXIS]; + block->max_adv_steps = current_nominal_speed * comp; + block->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); + CBI(block->flag, BLOCK_BIT_RECALCULATE); } } - current = next; + block = next; current_entry_speed = next_entry_speed; } @@ -1107,7 +1120,7 @@ void Planner::recalculate_trapezoids() { // 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)) { + if (!stepper.is_block_busy(block)) { // Block is not BUSY, we won the race against the Stepper ISR: const float next_nominal_speed = SQRT(next->nominal_speed_sqr), @@ -1150,14 +1163,14 @@ 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 (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) { - const float se = (float)block->steps[E_AXIS] / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; + if (block->steps.x || block->steps.y || block->steps.z) { + const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; NOLESS(high, se); } } float t = autotemp_min + high * autotemp_factor; - t = constrain(t, autotemp_min, autotemp_max); + LIMIT(t, autotemp_min, autotemp_max); if (t < oldt) t = t * (1 - float(AUTOTEMP_OLDWEIGHT)) + oldt * float(AUTOTEMP_OLDWEIGHT); oldt = t; thermalManager.setTargetHotend(t, 0); @@ -1169,7 +1182,10 @@ void Planner::recalculate() { * Maintain fans, paste extruder pressure, */ void Planner::check_axes_activity() { - uint8_t axis_active[NUM_AXIS] = { 0 }; + + #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) + xyze_bool_t axis_active = { false }; + #endif #if FAN_COUNT > 0 uint8_t tail_fan_speed[FAN_COUNT]; @@ -1185,10 +1201,9 @@ void Planner::check_axes_activity() { #endif if (has_blocks_queued()) { - block_t* block; #if FAN_COUNT > 0 || ENABLED(BARICUDA) - block = &block_buffer[block_buffer_tail]; + block_t *block = &block_buffer[block_buffer_tail]; #endif #if FAN_COUNT > 0 @@ -1205,12 +1220,19 @@ void Planner::check_axes_activity() { #endif #endif - for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block = &block_buffer[b]; - LOOP_XYZE(i) if (block->steps[i]) axis_active[i]++; - } + #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) + for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { + block_t *block = &block_buffer[b]; + LOOP_XYZE(i) if (block->steps[i]) axis_active[i] = true; + } + #endif } else { + + #if HAS_CUTTER + cutter.refresh(); + #endif + #if FAN_COUNT > 0 FANS_LOOP(i) tail_fan_speed[i] = thermalManager.scaledFanSpeed(i); @@ -1226,19 +1248,25 @@ void Planner::check_axes_activity() { #endif } + // + // Disable inactive axes + // #if ENABLED(DISABLE_X) - if (!axis_active[X_AXIS]) disable_X(); + if (!axis_active.x) disable_X(); #endif #if ENABLED(DISABLE_Y) - if (!axis_active[Y_AXIS]) disable_Y(); + if (!axis_active.y) disable_Y(); #endif #if ENABLED(DISABLE_Z) - if (!axis_active[Z_AXIS]) disable_Z(); + if (!axis_active.z) disable_Z(); #endif #if ENABLED(DISABLE_E) - if (!axis_active[E_AXIS]) disable_e_steppers(); + if (!axis_active.e) disable_e_steppers(); #endif + // + // Update Fan speeds + // #if FAN_COUNT > 0 #if FAN_KICKSTART_TIME > 0 @@ -1257,9 +1285,9 @@ void Planner::check_axes_activity() { #endif #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) + #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? map(tail_fan_speed[f], 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : FAN_OFF_PWM) #else - #define CALC_FAN_SPEED(f) tail_fan_speed[f] + #define CALC_FAN_SPEED(f) (tail_fan_speed[f] ?: FAN_OFF_PWM) #endif #if ENABLED(FAN_SOFT_PWM) @@ -1327,58 +1355,59 @@ void Planner::check_axes_activity() { * into a volumetric multiplier. Conversion differs when using * linear extrusion vs volumetric extrusion. */ - void Planner::calculate_volumetric_for_width_sensor(const int8_t encoded_ratio) { + void Planner::apply_filament_width_sensor(const int8_t encoded_ratio) { // Reconstitute the nominal/measured ratio const float nom_meas_ratio = 1 + 0.01f * 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(filwidth.nominal_mm * 0.5f) // 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 HAS_LEVELING + + constexpr xy_pos_t level_fulcrum = { + #if ENABLED(Z_SAFE_HOMING) + Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT + #else + X_HOME_POS, Y_HOME_POS + #endif + }; + /** * rx, ry, rz - Cartesian positions in mm * Leveled XYZ on completion */ - void Planner::apply_leveling(float &rx, float &ry, float &rz) { + void Planner::apply_leveling(xyz_pos_t &raw) { if (!leveling_active) return; #if ABL_PLANAR - float dx = rx - (X_TILT_FULCRUM), - dy = ry - (Y_TILT_FULCRUM); - - apply_rotation_xyz(bed_level_matrix, dx, dy, rz); - - rx = dx + X_TILT_FULCRUM; - ry = dy + Y_TILT_FULCRUM; + xy_pos_t d = raw - level_fulcrum; + apply_rotation_xyz(bed_level_matrix, d.x, d.y, raw.z); + raw = d + level_fulcrum; #elif HAS_MESH #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(rz); + const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z); #else constexpr float fade_scaling_factor = 1.0; #endif - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - const float raw[XYZ] = { rx, ry, 0 }; - #endif - - rz += ( + raw.z += ( #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(rx, ry + mbl.get_z(raw #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 + fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 #endif @@ -1387,7 +1416,7 @@ void Planner::check_axes_activity() { #endif } - void Planner::unapply_leveling(float raw[XYZ]) { + void Planner::unapply_leveling(xyz_pos_t &raw) { if (leveling_active) { @@ -1395,31 +1424,27 @@ void Planner::check_axes_activity() { matrix_3x3 inverse = matrix_3x3::transpose(bed_level_matrix); - float dx = raw[X_AXIS] - (X_TILT_FULCRUM), - dy = raw[Y_AXIS] - (Y_TILT_FULCRUM); - - apply_rotation_xyz(inverse, dx, dy, raw[Z_AXIS]); - - raw[X_AXIS] = dx + X_TILT_FULCRUM; - raw[Y_AXIS] = dy + Y_TILT_FULCRUM; + xy_pos_t d = raw - level_fulcrum; + apply_rotation_xyz(inverse, d.x, d.y, raw.z); + raw = d + level_fulcrum; #elif HAS_MESH #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(raw[Z_AXIS]); + const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z); #else constexpr float fade_scaling_factor = 1.0; #endif - raw[Z_AXIS] -= ( + raw.z -= ( #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(raw[X_AXIS], raw[Y_AXIS] + mbl.get_z(raw #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 + fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 #endif @@ -1429,7 +1454,7 @@ void Planner::check_axes_activity() { } #if ENABLED(SKEW_CORRECTION) - unskew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); + unskew(raw); #endif } @@ -1469,7 +1494,7 @@ void Planner::quick_stop() { // forced to empty, there's no risk the ISR will touch this. delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD // Clear the accumulated runtime clear_block_buffer_runtime(); #endif @@ -1512,14 +1537,14 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { 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) - ); + const int32_t p1 = stepper.position(CORE_AXIS_1), + p2 = stepper.position(CORE_AXIS_2); if (was_enabled) ENABLE_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 = (axis == CORE_AXIS_2 ? CORESIGN(p1 - p2) : p1 + p2) * 0.5f; } else axis_steps = stepper.position(axis); @@ -1546,22 +1571,22 @@ void Planner::synchronize() { * * Add a new linear movement to the planner queue (in terms of steps). * - * target - target position in steps units - * target_float - target position in direct (mm, degrees) units. optional - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known + * target - target position in steps units + * target_float - target position in direct (mm, degrees) units. optional + * fr_mm_s - (target) speed of the move + * extruder - target extruder + * millimeters - the length of the movement, if known * * Returns true if movement was properly queued, false otherwise */ -bool Planner::_buffer_steps(const int32_t (&target)[XYZE] +bool Planner::_buffer_steps(const xyze_long_t &target #if HAS_POSITION_FLOAT - , const float (&target_float)[ABCE] + , const xyze_pos_t &target_float #endif - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - , const float (&delta_mm_cart)[XYZE] + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + , const xyze_float_t &delta_mm_cart #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters + , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters ) { // If we are cleaning, do not accept queuing of movements @@ -1576,7 +1601,7 @@ bool Planner::_buffer_steps(const int32_t (&target)[XYZE] #if HAS_POSITION_FLOAT , target_float #endif - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) , delta_mm_cart #endif , fr_mm_s, extruder, millimeters @@ -1618,42 +1643,44 @@ bool Planner::_buffer_steps(const int32_t (&target)[XYZE] * Returns true is movement is acceptable, false otherwise */ bool Planner::_populate_block(block_t * const block, bool split_move, - const int32_t (&target)[ABCE] + const abce_long_t &target #if HAS_POSITION_FLOAT - , const float (&target_float)[ABCE] + , const xyze_pos_t &target_float #endif - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - , const float (&delta_mm_cart)[XYZE] + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + , const xyze_float_t &delta_mm_cart #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ + , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ ) { - const int32_t da = target[A_AXIS] - position[A_AXIS], - db = target[B_AXIS] - position[B_AXIS], - dc = target[C_AXIS] - position[C_AXIS]; + const int32_t da = target.a - position.a, + db = target.b - position.b, + dc = target.c - position.c; - int32_t de = target[E_AXIS] - position[E_AXIS]; + #if EXTRUDERS + int32_t de = target.e - position.e; + #else + constexpr int32_t de = 0; + #endif /* <-- add a slash to enable - SERIAL_ECHOPAIR(" _populate_block FR:", fr_mm_s); - SERIAL_ECHOPAIR(" A:", target[A_AXIS]); - SERIAL_ECHOPAIR(" (", da); - SERIAL_ECHOPAIR(" steps) B:", target[B_AXIS]); - SERIAL_ECHOPAIR(" (", db); - SERIAL_ECHOPAIR(" steps) C:", target[C_AXIS]); - SERIAL_ECHOPAIR(" (", dc); - SERIAL_ECHOPAIR(" steps) E:", target[E_AXIS]); - SERIAL_ECHOPAIR(" (", de); - SERIAL_ECHOLNPGM(" steps)"); + SERIAL_ECHOLNPAIR(" _populate_block FR:", fr_mm_s, + " A:", target.a, " (", da, " steps)" + " B:", target.b, " (", db, " steps)" + " C:", target.c, " (", dc, " steps)" + #if EXTRUDERS + " E:", target.e, " (", de, " steps)" + #endif + ); //*/ #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) if (de) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (thermalManager.tooColdToExtrude(extruder)) { - position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part + position.e = target.e; // Behave as if the move really took place, but ignore E part #if HAS_POSITION_FLOAT - position_float[E_AXIS] = target_float[E_AXIS]; + position_float.e = target_float.e; #endif de = 0; // no difference SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); @@ -1673,9 +1700,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, constexpr bool ignore_e = true; #endif if (ignore_e) { - position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part + position.e = target.e; // Behave as if the move really took place, but ignore E part #if HAS_POSITION_FLOAT - position_float[E_AXIS] = target_float[E_AXIS]; + position_float.e = target_float.e; #endif de = 0; // no difference SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); @@ -1712,8 +1739,12 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif if (de < 0) SBI(dm, E_AXIS); - const float esteps_float = de * e_factor[extruder]; - const uint32_t esteps = ABS(esteps_float) + 0.5f; + #if EXTRUDERS + const float esteps_float = de * e_factor[extruder]; + const uint32_t esteps = ABS(esteps_float) + 0.5f; + #else + constexpr uint32_t esteps = 0; + #endif // Clear all flags, including the "busy" bit block->flag = 0x00; @@ -1724,26 +1755,16 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // 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.set(ABS(da + db), ABS(da - db), ABS(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.set(ABS(da + dc), ABS(db), ABS(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); + block->steps.set(ABS(da), ABS(db + dc), ABS(db - dc)); #elif IS_SCARA - block->steps[A_AXIS] = ABS(da); - block->steps[B_AXIS] = ABS(db); - block->steps[Z_AXIS] = ABS(dc); + block->steps.set(ABS(da), ABS(db), ABS(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.set(ABS(da), ABS(db), ABS(dc)); #endif /** @@ -1754,37 +1775,53 @@ bool Planner::_populate_block(block_t * const block, bool split_move, * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head. * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. */ + struct DeltaMM : abce_float_t { + #if IS_CORE + xyz_pos_t head; + #endif + } delta_mm; #if IS_CORE - float delta_mm[Z_HEAD + 1]; #if CORE_IS_XY - delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS]; - delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS]; - delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS]; - delta_mm[A_AXIS] = (da + db) * steps_to_mm[A_AXIS]; - delta_mm[B_AXIS] = CORESIGN(da - db) * steps_to_mm[B_AXIS]; + delta_mm.head.x = da * steps_to_mm[A_AXIS]; + delta_mm.head.y = db * steps_to_mm[B_AXIS]; + delta_mm.z = dc * steps_to_mm[Z_AXIS]; + delta_mm.a = (da + db) * steps_to_mm[A_AXIS]; + delta_mm.b = CORESIGN(da - db) * steps_to_mm[B_AXIS]; #elif CORE_IS_XZ - delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS]; - delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS]; - delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS]; - delta_mm[A_AXIS] = (da + dc) * steps_to_mm[A_AXIS]; - delta_mm[C_AXIS] = CORESIGN(da - dc) * steps_to_mm[C_AXIS]; + delta_mm.head.x = da * steps_to_mm[A_AXIS]; + delta_mm.y = db * steps_to_mm[Y_AXIS]; + delta_mm.head.z = dc * steps_to_mm[C_AXIS]; + delta_mm.a = (da + dc) * steps_to_mm[A_AXIS]; + delta_mm.c = CORESIGN(da - dc) * steps_to_mm[C_AXIS]; #elif CORE_IS_YZ - delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS]; - delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS]; - delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS]; - delta_mm[B_AXIS] = (db + dc) * steps_to_mm[B_AXIS]; - delta_mm[C_AXIS] = CORESIGN(db - dc) * steps_to_mm[C_AXIS]; + delta_mm.x = da * steps_to_mm[X_AXIS]; + delta_mm.head.y = db * steps_to_mm[B_AXIS]; + delta_mm.head.z = dc * steps_to_mm[C_AXIS]; + delta_mm.b = (db + dc) * steps_to_mm[B_AXIS]; + delta_mm.c = CORESIGN(db - dc) * steps_to_mm[C_AXIS]; #endif #else - float delta_mm[ABCE]; - 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]; + delta_mm.a = da * steps_to_mm[A_AXIS]; + delta_mm.b = db * steps_to_mm[B_AXIS]; + delta_mm.c = dc * steps_to_mm[C_AXIS]; + #endif + + #if EXTRUDERS + delta_mm.e = esteps_float * steps_to_mm[E_AXIS_N(extruder)]; + #else + delta_mm.e = 0.0f; + #endif + + #if ENABLED(LCD_SHOW_E_TOTAL) + e_move_accumulator += delta_mm.e; #endif - delta_mm[E_AXIS] = esteps_float * steps_to_mm[E_AXIS_N(extruder)]; - 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) { - block->millimeters = ABS(delta_mm[E_AXIS]); + if (block->steps.a < MIN_STEPS_PER_SEGMENT && block->steps.b < MIN_STEPS_PER_SEGMENT && block->steps.c < MIN_STEPS_PER_SEGMENT) { + block->millimeters = (0 + #if EXTRUDERS + + ABS(delta_mm.e) + #endif + ); } else { if (millimeters) @@ -1792,13 +1829,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, else block->millimeters = SQRT( #if CORE_IS_XY - sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_AXIS]) + sq(delta_mm.head.x) + sq(delta_mm.head.y) + sq(delta_mm.z) #elif CORE_IS_XZ - sq(delta_mm[X_HEAD]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_HEAD]) + sq(delta_mm.head.x) + sq(delta_mm.y) + sq(delta_mm.head.z) #elif CORE_IS_YZ - sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_HEAD]) + sq(delta_mm[Z_HEAD]) + sq(delta_mm.x) + sq(delta_mm.head.y) + sq(delta_mm.head.z) #else - sq(delta_mm[X_AXIS]) + sq(delta_mm[Y_AXIS]) + sq(delta_mm[Z_AXIS]) + sq(delta_mm.x) + sq(delta_mm.y) + sq(delta_mm.z) #endif ); @@ -1816,8 +1853,11 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif } - block->steps[E_AXIS] = esteps; - block->step_event_count = _MAX(block->steps[A_AXIS], block->steps[B_AXIS], block->steps[C_AXIS], esteps); + #if EXTRUDERS + block->steps.e = esteps; + #endif + + block->step_event_count = _MAX(block->steps.a, block->steps.b, block->steps.c, esteps); // Bail if this is a zero-length block if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false; @@ -1826,6 +1866,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move, MIXER_POPULATE_BLOCK(); #endif + #if HAS_CUTTER + block->cutter_power = cutter.power; + #endif + #if FAN_COUNT > 0 FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i]; #endif @@ -1840,163 +1884,76 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif #if ENABLED(AUTO_POWER_CONTROL) - if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) + if (block->steps.x || block->steps.y || block->steps.z) powerManager.power_on(); #endif // Enable active axes #if CORE_IS_XY - if (block->steps[A_AXIS] || block->steps[B_AXIS]) { + if (block->steps.a || block->steps.b) { enable_X(); enable_Y(); } #if DISABLED(Z_LATE_ENABLE) - if (block->steps[Z_AXIS]) enable_Z(); + if (block->steps.z) enable_Z(); #endif #elif CORE_IS_XZ - if (block->steps[A_AXIS] || block->steps[C_AXIS]) { + if (block->steps.a || block->steps.c) { enable_X(); enable_Z(); } - if (block->steps[Y_AXIS]) enable_Y(); + if (block->steps.y) enable_Y(); #elif CORE_IS_YZ - if (block->steps[B_AXIS] || block->steps[C_AXIS]) { + if (block->steps.b || block->steps.c) { enable_Y(); enable_Z(); } - if (block->steps[X_AXIS]) enable_X(); + if (block->steps.x) enable_X(); #else - if (block->steps[X_AXIS]) enable_X(); - if (block->steps[Y_AXIS]) enable_Y(); + if (block->steps.x) enable_X(); + if (block->steps.y) enable_Y(); #if DISABLED(Z_LATE_ENABLE) - if (block->steps[Z_AXIS]) enable_Z(); + if (block->steps.z) enable_Z(); #endif #endif // Enable extruder(s) - if (esteps) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif + #if EXTRUDERS + if (esteps) { + #if ENABLED(AUTO_POWER_CONTROL) + powerManager.power_on(); + #endif - #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder - - #define DISABLE_IDLE_E(N) if (!g_uc_extruder_last_move[N]) disable_E##N(); - - for (uint8_t i = 0; i < EXTRUDERS; i++) - if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--; - - switch (extruder) { - case 0: - #if EXTRUDERS > 1 - DISABLE_IDLE_E(1); - #if EXTRUDERS > 2 - DISABLE_IDLE_E(2); - #if EXTRUDERS > 3 - DISABLE_IDLE_E(3); - #if EXTRUDERS > 4 - DISABLE_IDLE_E(4); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - enable_E0(); - g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2; - #if HAS_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: - DISABLE_IDLE_E(0); - #if EXTRUDERS > 2 - DISABLE_IDLE_E(2); - #if EXTRUDERS > 3 - DISABLE_IDLE_E(3); - #if EXTRUDERS > 4 - DISABLE_IDLE_E(4); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 + #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder + + for (uint8_t i = 0; i < EXTRUDERS; i++) + if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--; + + #if HAS_DUPLICATION_MODE + if (extruder_duplication_enabled && extruder == 0) { enable_E1(); g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; - break; - #if EXTRUDERS > 2 - case 2: - DISABLE_IDLE_E(0); - DISABLE_IDLE_E(1); - #if EXTRUDERS > 3 - DISABLE_IDLE_E(3); - #if EXTRUDERS > 4 - DISABLE_IDLE_E(4); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif - #endif - #endif - enable_E2(); - g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2; - break; - #if EXTRUDERS > 3 - case 3: - DISABLE_IDLE_E(0); - DISABLE_IDLE_E(1); - DISABLE_IDLE_E(2); - #if EXTRUDERS > 4 - DISABLE_IDLE_E(4); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif - #endif - enable_E3(); - g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2; - break; - #if EXTRUDERS > 4 - case 4: - DISABLE_IDLE_E(0); - DISABLE_IDLE_E(1); - DISABLE_IDLE_E(2); - DISABLE_IDLE_E(3); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif - enable_E4(); - g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2; - break; - #if EXTRUDERS > 5 - case 5: - DISABLE_IDLE_E(0); - DISABLE_IDLE_E(1); - DISABLE_IDLE_E(2); - DISABLE_IDLE_E(3); - DISABLE_IDLE_E(4); - enable_E5(); - g_uc_extruder_last_move[5] = (BLOCK_BUFFER_SIZE) * 2; - break; - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - } - #else - enable_E0(); - enable_E1(); - enable_E2(); - enable_E3(); - enable_E4(); - enable_E5(); - #endif - } + } + #endif + + #define ENABLE_ONE_E(N) do{ \ + if (extruder == N) { \ + enable_E##N(); \ + g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \ + } \ + else if (!g_uc_extruder_last_move[N]) \ + disable_E##N(); \ + }while(0); + + #else + + #define ENABLE_ONE_E(N) enable_E##N(); + + #endif + + REPEAT(EXTRUDERS, ENABLE_ONE_E); + } + #endif // EXTRUDERS if (esteps) NOLESS(fr_mm_s, settings.min_feedrate_mm_s); @@ -2024,81 +1981,64 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // 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 * (settings.min_segment_time_us - segment_time_us) / moves_queued); inverse_secs = 1000000.0f / nst; - #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ULTRA_LCD) + #if defined(XY_FREQUENCY_LIMIT) || HAS_SPI_LCD segment_time_us = nst; #endif } } #endif - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_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; + block->segment_time_us = segment_time_us; if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); #endif - block->nominal_speed_sqr = sq(block->millimeters * inverse_secs); // (mm/sec)^2 Always > 0 + block->nominal_speed_sqr = sq(block->millimeters * inverse_secs); // (mm/sec)^2 Always > 0 block->nominal_rate = CEIL(block->step_event_count * inverse_secs); // (step/sec) Always > 0 #if ENABLED(FILAMENT_WIDTH_SENSOR) - static float filwidth_e_count = 0, filwidth_delay_dist = 0; - - //FMM update ring buffer used for delay with filament measurements - if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM && filwidth_delay_index[1] >= 0) { //only for extruder with filament sensor and if ring buffer is initialized - - constexpr int MMD_CM = MAX_MEASUREMENT_DELAY + 1, MMD_MM = MMD_CM * 10; - - // increment counters with next move in e axis - filwidth_e_count += delta_mm[E_AXIS]; - filwidth_delay_dist += delta_mm[E_AXIS]; + if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM) // Only for extruder with filament sensor + filwidth.advance_e(delta_mm.e); + #endif - // Only get new measurements on forward E movement - if (!UNEAR_ZERO(filwidth_e_count)) { + // Calculate and limit speed in mm/sec - // Loop the delay distance counter (modulus by the mm length) - while (filwidth_delay_dist >= MMD_MM) filwidth_delay_dist -= MMD_MM; + xyze_float_t current_speed; + float speed_factor = 1.0f; // factor <1 decreases speed - // Convert into an index into the measurement array - filwidth_delay_index[0] = int8_t(filwidth_delay_dist * 0.1f); + // Linear axes first with less logic + LOOP_XYZ(i) { + current_speed[i] = delta_mm[i] * inverse_secs; + const feedRate_t cs = ABS(current_speed[i]), + max_fr = settings.max_feedrate_mm_s[i]; + if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); + } - // If the index has changed (must have gone forward)... - if (filwidth_delay_index[0] != filwidth_delay_index[1]) { - filwidth_e_count = 0; // Reset the E movement counter - const int8_t meas_sample = thermalManager.widthFil_to_size_ratio(); - do { - filwidth_delay_index[1] = (filwidth_delay_index[1] + 1) % MMD_CM; // The next unused slot - measurement_delay[filwidth_delay_index[1]] = meas_sample; // Store the measurement - } while (filwidth_delay_index[0] != filwidth_delay_index[1]); // More slots to fill? - } - } + // Limit speed on extruders, if any + #if EXTRUDERS + { + current_speed.e = delta_mm.e * inverse_secs; + #if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING) + // Move all mixing extruders at the specified rate + if (mixer.get_current_vtool() == MIXER_AUTORETRACT_TOOL) + current_speed.e *= MIXING_STEPPERS; + #endif + const feedRate_t cs = ABS(current_speed.e), + max_fr = (settings.max_feedrate_mm_s[E_AXIS_N(extruder)] + #if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING) + * MIXING_STEPPERS + #endif + ); + if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); } #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_XYZE(i) { - #if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING) - // In worst case, only one extruder running, no change is needed. - // In best case, all extruders run the same amount, we can divide by MIXING_STEPPERS - float delta_mm_i = 0; - if (i == E_AXIS && mixer.get_current_vtool() == MIXER_AUTORETRACT_TOOL) - delta_mm_i = delta_mm[i] / MIXING_STEPPERS; - else - delta_mm_i = delta_mm[i]; - #else - const float delta_mm_i = delta_mm[i]; - #endif - const float cs = ABS(current_speed[i] = delta_mm_i * inverse_secs); - #if ENABLED(DISTINCT_E_FACTORS) - if (i == E_AXIS) i += extruder; - #endif - if (cs > settings.max_feedrate_mm_s[i]) NOMORE(speed_factor, settings.max_feedrate_mm_s[i] / cs); - } - // Max segment time in µs. #ifdef XY_FREQUENCY_LIMIT @@ -2107,26 +2047,26 @@ bool Planner::_populate_block(block_t * const block, bool split_move, old_direction_bits = block->direction_bits; segment_time_us = LROUND((float)segment_time_us / speed_factor); - uint32_t xs0 = axis_segment_time_us[X_AXIS][0], - xs1 = axis_segment_time_us[X_AXIS][1], - xs2 = axis_segment_time_us[X_AXIS][2], - ys0 = axis_segment_time_us[Y_AXIS][0], - ys1 = axis_segment_time_us[Y_AXIS][1], - ys2 = axis_segment_time_us[Y_AXIS][2]; + uint32_t xs0 = axis_segment_time_us[0].x, + xs1 = axis_segment_time_us[1].x, + xs2 = axis_segment_time_us[2].x, + ys0 = axis_segment_time_us[0].y, + ys1 = axis_segment_time_us[1].y, + ys2 = axis_segment_time_us[2].y; if (TEST(direction_change, X_AXIS)) { - xs2 = axis_segment_time_us[X_AXIS][2] = xs1; - xs1 = axis_segment_time_us[X_AXIS][1] = xs0; + xs2 = axis_segment_time_us[2].x = xs1; + xs1 = axis_segment_time_us[1].x = xs0; xs0 = 0; } - xs0 = axis_segment_time_us[X_AXIS][0] = xs0 + segment_time_us; + xs0 = axis_segment_time_us[0].x = xs0 + segment_time_us; if (TEST(direction_change, Y_AXIS)) { - ys2 = axis_segment_time_us[Y_AXIS][2] = axis_segment_time_us[Y_AXIS][1]; - ys1 = axis_segment_time_us[Y_AXIS][1] = axis_segment_time_us[Y_AXIS][0]; + ys2 = axis_segment_time_us[2].y = axis_segment_time_us[1].y; + ys1 = axis_segment_time_us[1].y = axis_segment_time_us[0].y; ys0 = 0; } - ys0 = axis_segment_time_us[Y_AXIS][0] = ys0 + segment_time_us; + ys0 = axis_segment_time_us[0].y = ys0 + segment_time_us; const uint32_t max_x_segment_time = _MAX(xs0, xs1, xs2), max_y_segment_time = _MAX(ys0, ys1, ys2), @@ -2139,7 +2079,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Correct the speed if (speed_factor < 1.0f) { - LOOP_XYZE(i) current_speed[i] *= speed_factor; + current_speed *= speed_factor; block->nominal_rate *= speed_factor; block->nominal_speed_sqr = block->nominal_speed_sqr * sq(speed_factor); } @@ -2147,7 +2087,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // 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 (!block->steps.a && !block->steps.b && !block->steps.c) { // convert to: acceleration steps/sec^2 accel = CEIL(settings.retract_acceleration * steps_per_mm); #if ENABLED(LIN_ADVANCE) @@ -2174,14 +2114,14 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #if ENABLED(LIN_ADVANCE) - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) #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] + #define MAX_E_JERK max_jerk.e #endif /** @@ -2199,13 +2139,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, && de > 0; if (block->use_advance_lead) { - block->e_D_ratio = (target_float[E_AXIS] - position_float[E_AXIS]) / + block->e_D_ratio = (target_float.e - position_float.e) / #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])) + SQRT(sq(target_float.x - position_float.x) + + sq(target_float.y - position_float.y) + + sq(target_float.z - position_float.z)) #endif ; @@ -2262,7 +2202,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) /** * 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 @@ -2298,25 +2238,18 @@ bool Planner::_populate_block(block_t * const block, bool split_move, already calculated in a different place. */ // Unit vector of previous path line segment - static float previous_unit_vec[XYZE]; - - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - float unit_vec[] = { - delta_mm_cart[X_AXIS] * inverse_millimeters, - delta_mm_cart[Y_AXIS] * inverse_millimeters, - delta_mm_cart[Z_AXIS] * inverse_millimeters, - delta_mm_cart[E_AXIS] * inverse_millimeters - }; - #else - float unit_vec[] = { - delta_mm[X_AXIS] * inverse_millimeters, - delta_mm[Y_AXIS] * inverse_millimeters, - delta_mm[Z_AXIS] * inverse_millimeters, - delta_mm[E_AXIS] * inverse_millimeters - }; - #endif + static xyze_float_t prev_unit_vec; + + xyze_float_t unit_vec = + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + delta_mm_cart + #else + { delta_mm.x, delta_mm.y, delta_mm.z, delta_mm.e } + #endif + ; + unit_vec *= inverse_millimeters; - #if IS_CORE && ENABLED(JUNCTION_DEVIATION) + #if IS_CORE && DISABLED(CLASSIC_JERK) /** * On CoreXY the length of the vector [A,B] is SQRT(2) times the length of the head movement vector [X,Y]. * So taking Z and E into account, we cannot scale to a unit vector with "inverse_millimeters". @@ -2329,11 +2262,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move, if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { // 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] - ; + float junction_cos_theta = (-prev_unit_vec.x * unit_vec.x) + (-prev_unit_vec.y * unit_vec.y) + + (-prev_unit_vec.z * unit_vec.z) + (-prev_unit_vec.e * unit_vec.e); // NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta). if (junction_cos_theta > 0.999999f) { @@ -2344,12 +2274,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, 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] - }; + xyze_float_t junction_unit_vec = unit_vec - prev_unit_vec; normalize_junction_vector(junction_unit_vec); const float junction_acceleration = limit_value_by_axis_maximum(block->acceleration, junction_unit_vec), @@ -2375,8 +2300,16 @@ bool Planner::_populate_block(block_t * const block, bool split_move, 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); + prev_unit_vec = unit_vec; + + #endif + #ifdef USE_CACHED_SQRT + #define CACHED_SQRT(N, V) \ + static float saved_V, N; \ + if (V != saved_V) { N = SQRT(V); saved_V = V; } + #else + #define CACHED_SQRT(N, V) const float N = SQRT(V) #endif #if HAS_CLASSIC_JERK @@ -2385,7 +2318,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, * Adapted from Průša MKS firmware * https://github.com/prusa3d/Prusa-Firmware */ - const float nominal_speed = SQRT(block->nominal_speed_sqr); + CACHED_SQRT(nominal_speed, block->nominal_speed_sqr); // Exit speed limited by a jerk to full halt of a previous last segment static float previous_safe_speed; @@ -2394,7 +2327,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, float safe_speed = nominal_speed; uint8_t limited = 0; - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) + #if HAS_LINEAR_E_JERK LOOP_XYZ(i) #else LOOP_XYZE(i) @@ -2426,12 +2359,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // 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); + CACHED_SQRT(previous_nominal_speed, previous_nominal_speed_sqr); + vmax_junction = _MIN(nominal_speed, previous_nominal_speed); // Now limit the jerk in all axes. const float smaller_speed_factor = vmax_junction / previous_nominal_speed; - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) + #if HAS_LINEAR_E_JERK LOOP_XYZ(axis) #else LOOP_XYZE(axis) @@ -2469,7 +2403,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, previous_safe_speed = safe_speed; - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(vmax_junction)); #else vmax_junction_sqr = sq(vmax_junction); @@ -2498,18 +2432,21 @@ bool Planner::_populate_block(block_t * const block, bool split_move, block->flag |= block->nominal_speed_sqr <= v_allowable_sqr ? BLOCK_FLAG_RECALCULATE | BLOCK_FLAG_NOMINAL_LENGTH : BLOCK_FLAG_RECALCULATE; // Update previous path unit_vector and nominal speed - COPY(previous_speed, current_speed); + previous_speed = current_speed; previous_nominal_speed_sqr = block->nominal_speed_sqr; // Update the position - static_assert(COUNT(target) > 1, "Parameter to _buffer_steps must be (&target)[XYZE]!"); - COPY(position, target); + position = target; #if HAS_POSITION_FLOAT - COPY(position_float, target_float); + position_float = target_float; #endif #if ENABLED(GRADIENT_MIX) - mixer.gradient_control(target_float[Z_AXIS]); + mixer.gradient_control(target_float.z); + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + block->sdpos = recovery.command_sdpos(); #endif // Movement was accepted @@ -2530,10 +2467,7 @@ void Planner::buffer_sync_block() { 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]; - block->position[E_AXIS] = position[E_AXIS]; + block->position = position; // If this is the first added movement, reload the delay, otherwise, cancel it. if (block_buffer_head == block_buffer_tail) { @@ -2563,10 +2497,10 @@ void Planner::buffer_sync_block() { * millimeters - the length of the movement, if known */ bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - , const float (&delta_mm_cart)[XYZE] + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + , const xyze_float_t &delta_mm_cart #endif - , const float &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ + , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ ) { // If we are cleaning, do not accept queuing of movements @@ -2575,29 +2509,33 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con // When changing extruders recalculate steps corresponding to the E position #if ENABLED(DISTINCT_E_FACTORS) if (last_extruder != extruder && settings.axis_steps_per_mm[E_AXIS_N(extruder)] != settings.axis_steps_per_mm[E_AXIS_N(last_extruder)]) { - position[E_AXIS] = LROUND(position[E_AXIS] * settings.axis_steps_per_mm[E_AXIS_N(extruder)] * steps_to_mm[E_AXIS_N(last_extruder)]); + position.e = LROUND(position.e * settings.axis_steps_per_mm[E_AXIS_N(extruder)] * steps_to_mm[E_AXIS_N(last_extruder)]); last_extruder = extruder; } #endif // The target position of the tool in absolute steps // Calculate target position in absolute steps - const int32_t target[ABCE] = { - LROUND(a * settings.axis_steps_per_mm[A_AXIS]), - LROUND(b * settings.axis_steps_per_mm[B_AXIS]), - LROUND(c * settings.axis_steps_per_mm[C_AXIS]), - LROUND(e * settings.axis_steps_per_mm[E_AXIS_N(extruder)]) + const abce_long_t target = { + int32_t(LROUND(a * settings.axis_steps_per_mm[A_AXIS])), + int32_t(LROUND(b * settings.axis_steps_per_mm[B_AXIS])), + int32_t(LROUND(c * settings.axis_steps_per_mm[C_AXIS])), + int32_t(LROUND(e * settings.axis_steps_per_mm[E_AXIS_N(extruder)])) }; #if HAS_POSITION_FLOAT - const float target_float[XYZE] = { a, b, c, e }; + const xyze_pos_t target_float = { a, b, c, e }; #endif // DRYRUN prevents E moves from taking place - if (DEBUGGING(DRYRUN)) { - position[E_AXIS] = target[E_AXIS]; + if (DEBUGGING(DRYRUN) + #if ENABLED(CANCEL_OBJECTS) + || cancelable.skipping + #endif + ) { + position.e = target.e; #if HAS_POSITION_FLOAT - position_float[E_AXIS] = e; + position_float.e = e; #endif } @@ -2605,37 +2543,37 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con SERIAL_ECHOPAIR(" buffer_segment FR:", fr_mm_s); #if IS_KINEMATIC SERIAL_ECHOPAIR(" A:", a); - SERIAL_ECHOPAIR(" (", position[A_AXIS]); - SERIAL_ECHOPAIR("->", target[A_AXIS]); + SERIAL_ECHOPAIR(" (", position.a); + SERIAL_ECHOPAIR("->", target.a); SERIAL_ECHOPAIR(") B:", b); #else SERIAL_ECHOPAIR(" X:", a); - SERIAL_ECHOPAIR(" (", position[X_AXIS]); - SERIAL_ECHOPAIR("->", target[X_AXIS]); + SERIAL_ECHOPAIR(" (", position.x); + SERIAL_ECHOPAIR("->", target.x); SERIAL_ECHOPAIR(") Y:", b); #endif - SERIAL_ECHOPAIR(" (", position[Y_AXIS]); - SERIAL_ECHOPAIR("->", target[Y_AXIS]); + SERIAL_ECHOPAIR(" (", position.y); + SERIAL_ECHOPAIR("->", target.y); #if ENABLED(DELTA) SERIAL_ECHOPAIR(") C:", c); #else SERIAL_ECHOPAIR(") Z:", c); #endif - SERIAL_ECHOPAIR(" (", position[Z_AXIS]); - SERIAL_ECHOPAIR("->", target[Z_AXIS]); + SERIAL_ECHOPAIR(" (", position.z); + SERIAL_ECHOPAIR("->", target.z); SERIAL_ECHOPAIR(") E:", e); - SERIAL_ECHOPAIR(" (", position[E_AXIS]); - SERIAL_ECHOPAIR("->", target[E_AXIS]); + SERIAL_ECHOPAIR(" (", position.e); + SERIAL_ECHOPAIR("->", target.e); SERIAL_ECHOLNPGM(")"); //*/ // Queue the movement - if ( + if ( !_buffer_steps(target #if HAS_POSITION_FLOAT , target_float #endif - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) , delta_mm_cart #endif , fr_mm_s, extruder, millimeters @@ -2648,9 +2586,8 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con /** * Add a new linear movement to the buffer. - * The target is cartesian, it's translated to delta/scara if - * needed. - * + * The target is cartesian. It's translated to + * delta/scara if needed. * * rx,ry,rz,e - target position in mm or degrees * fr_mm_s - (target) speed of the move (mm/s) @@ -2658,56 +2595,56 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con * millimeters - the length of the movement, if known * inv_duration - the reciprocal if the duration of the movement, if known (kinematic only if feeedrate scaling is enabled) */ -bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const float &fr_mm_s, const uint8_t extruder, const float millimeters +bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters #if ENABLED(SCARA_FEEDRATE_SCALING) , const float &inv_duration #endif ) { - float raw[XYZE] = { rx, ry, rz, e }; + xyze_pos_t machine = { rx, ry, rz, e }; #if HAS_POSITION_MODIFIERS - apply_modifiers(raw); + apply_modifiers(machine); #endif #if IS_KINEMATIC - const float delta_mm_cart[] = { - rx - position_cart[X_AXIS], - ry - position_cart[Y_AXIS], - rz - position_cart[Z_AXIS] - #if ENABLED(JUNCTION_DEVIATION) - , e - position_cart[E_AXIS] - #endif - }; + + #if DISABLED(CLASSIC_JERK) + const xyze_pos_t delta_mm_cart = { + rx - position_cart.x, ry - position_cart.y, + rz - position_cart.z, e - position_cart.e + }; + #else + const xyz_pos_t delta_mm_cart = { rx - position_cart.x, ry - position_cart.y, rz - position_cart.z }; + #endif float mm = millimeters; if (mm == 0.0) - mm = (delta_mm_cart[X_AXIS] != 0.0 || delta_mm_cart[Y_AXIS] != 0.0) ? SQRT(sq(delta_mm_cart[X_AXIS]) + sq(delta_mm_cart[Y_AXIS]) + sq(delta_mm_cart[Z_AXIS])) : ABS(delta_mm_cart[Z_AXIS]); + mm = (delta_mm_cart.x != 0.0 || delta_mm_cart.y != 0.0) ? delta_mm_cart.magnitude() : ABS(delta_mm_cart.z); - inverse_kinematics(raw); + // Cartesian XYZ to kinematic ABC, stored in global 'delta' + inverse_kinematics(machine); #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. - const float duration_recip = inv_duration ? inv_duration : fr_mm_s / mm, - feedrate = HYPOT(delta[A_AXIS] - position_float[A_AXIS], delta[B_AXIS] - position_float[B_AXIS]) * duration_recip; + const float duration_recip = inv_duration ?: fr_mm_s / mm; + const xyz_pos_t diff = delta - position_float; + const feedRate_t feedrate = diff.magnitude() * duration_recip; #else - const float feedrate = fr_mm_s; + const feedRate_t feedrate = fr_mm_s; #endif - if (buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS] - #if ENABLED(JUNCTION_DEVIATION) + if (buffer_segment(delta.a, delta.b, delta.c, machine.e + #if DISABLED(CLASSIC_JERK) , delta_mm_cart #endif , feedrate, extruder, mm )) { - position_cart[X_AXIS] = rx; - position_cart[Y_AXIS] = ry; - position_cart[Z_AXIS] = rz; - position_cart[E_AXIS] = e; + position_cart.set(rx, ry, rz, e); return true; } else return false; #else - return buffer_segment(raw, fr_mm_s, extruder, millimeters); + return buffer_segment(machine, fr_mm_s, extruder, millimeters); #endif } // buffer_line() @@ -2722,30 +2659,27 @@ void Planner::set_machine_position_mm(const float &a, const float &b, const floa #if ENABLED(DISTINCT_E_FACTORS) last_extruder = active_extruder; #endif - position[A_AXIS] = LROUND(a * settings.axis_steps_per_mm[A_AXIS]); - position[B_AXIS] = LROUND(b * settings.axis_steps_per_mm[B_AXIS]); - position[C_AXIS] = LROUND(c * settings.axis_steps_per_mm[C_AXIS]); - position[E_AXIS] = LROUND(e * settings.axis_steps_per_mm[E_AXIS_N(active_extruder)]); #if HAS_POSITION_FLOAT - position_float[A_AXIS] = a; - position_float[B_AXIS] = b; - position_float[C_AXIS] = c; - position_float[E_AXIS] = e; + position_float.set(a, b, c, e); #endif + position.set(LROUND(a * settings.axis_steps_per_mm[A_AXIS]), + LROUND(b * settings.axis_steps_per_mm[B_AXIS]), + LROUND(c * settings.axis_steps_per_mm[C_AXIS]), + LROUND(e * settings.axis_steps_per_mm[E_AXIS_N(active_extruder)])); if (has_blocks_queued()) { //previous_nominal_speed_sqr = 0.0; // Reset planner junction speeds. Assume start from rest. - //ZERO(previous_speed); + //previous_speed.reset(); buffer_sync_block(); } else - stepper.set_position(position[A_AXIS], position[B_AXIS], position[C_AXIS], position[E_AXIS]); + stepper.set_position(position); } void Planner::set_position_mm(const float &rx, const float &ry, const float &rz, const float &e) { - float raw[XYZE] = { rx, ry, rz, e }; + xyze_pos_t machine = { rx, ry, rz, e }; #if HAS_POSITION_MODIFIERS { - apply_modifiers(raw + apply_modifiers(machine #if HAS_LEVELING , true #endif @@ -2753,15 +2687,11 @@ void Planner::set_position_mm(const float &rx, const float &ry, const float &rz, } #endif #if IS_KINEMATIC - position_cart[X_AXIS] = rx; - position_cart[Y_AXIS] = ry; - position_cart[Z_AXIS] = rz; - position_cart[E_AXIS] = e; - - inverse_kinematics(raw); - set_machine_position_mm(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS]); + position_cart.set(rx, ry, rz, e); + inverse_kinematics(machine); + set_machine_position_mm(delta.a, delta.b, delta.c, machine.e); #else - set_machine_position_mm(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], raw[E_AXIS]); + set_machine_position_mm(machine); #endif } @@ -2778,17 +2708,17 @@ void Planner::set_e_position_mm(const float &e) { #else const float e_new = e; #endif - position[E_AXIS] = LROUND(settings.axis_steps_per_mm[axis_index] * e_new); + position.e = LROUND(settings.axis_steps_per_mm[axis_index] * e_new); #if HAS_POSITION_FLOAT - position_float[E_AXIS] = e_new; + position_float.e = e_new; #endif #if IS_KINEMATIC - position_cart[E_AXIS] = e; + position_cart.e = e; #endif if (has_blocks_queued()) buffer_sync_block(); else - stepper.set_position(E_AXIS, position[E_AXIS]); + stepper.set_axis_position(E_AXIS, position.e); } // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 @@ -2804,7 +2734,7 @@ void Planner::reset_acceleration_rates() { if (AXIS_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]); } cutoff_long = 4294967295UL / highest_rate; // 0xFFFFFFFFUL - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) + #if HAS_LINEAR_E_JERK recalculate_max_e_jerk(); #endif } @@ -2816,6 +2746,68 @@ void Planner::refresh_positioning() { reset_acceleration_rates(); } +inline void limit_and_warn(float &val, const uint8_t axis, PGM_P const setting_name, const xyze_float_t &max_limit) { + const uint8_t lim_axis = axis > E_AXIS ? E_AXIS : axis; + const float before = val; + LIMIT(val, 1, max_limit[lim_axis]); + if (before != val) { + SERIAL_CHAR(axis_codes[lim_axis]); + SERIAL_ECHOPGM(" Max "); + serialprintPGM(setting_name); + SERIAL_ECHOLNPAIR(" limited to ", val); + } +} + +void Planner::set_max_acceleration(const uint8_t axis, float targetValue) { + #if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #ifdef MAX_ACCEL_EDIT_VALUES + constexpr xyze_float_t max_accel_edit = MAX_ACCEL_EDIT_VALUES; + const xyze_float_t &max_acc_edit_scaled = max_accel_edit; + #else + constexpr xyze_float_t max_accel_edit = DEFAULT_MAX_ACCELERATION, + max_acc_edit_scaled = max_accel_edit * 2; + #endif + limit_and_warn(targetValue, axis, PSTR("Acceleration"), max_acc_edit_scaled); + #endif + settings.max_acceleration_mm_per_s2[axis] = targetValue; + + // Update steps per s2 to agree with the units per s2 (since they are used in the planner) + reset_acceleration_rates(); +} + +void Planner::set_max_feedrate(const uint8_t axis, float targetValue) { + #if ENABLED(LIMITED_MAX_FR_EDITING) + #ifdef MAX_FEEDRATE_EDIT_VALUES + constexpr xyze_float_t max_fr_edit = MAX_FEEDRATE_EDIT_VALUES; + const xyze_float_t &max_fr_edit_scaled = max_fr_edit; + #else + constexpr xyze_float_t max_fr_edit = DEFAULT_MAX_FEEDRATE, + max_fr_edit_scaled = max_fr_edit * 2; + #endif + limit_and_warn(targetValue, axis, PSTR("Feedrate"), max_fr_edit_scaled); + #endif + settings.max_feedrate_mm_s[axis] = targetValue; +} + +void Planner::set_max_jerk(const AxisEnum axis, float targetValue) { + #if HAS_CLASSIC_JERK + #if ENABLED(LIMITED_JERK_EDITING) + constexpr xyze_float_t max_jerk_edit = + #ifdef MAX_JERK_EDIT_VALUES + MAX_JERK_EDIT_VALUES + #else + { (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, + (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 } + #endif + ; + limit_and_warn(targetValue, axis, PSTR("Jerk"), max_jerk_edit); + #endif + max_jerk[axis] = targetValue; + #else + UNUSED(axis); UNUSED(targetValue); + #endif +} + #if ENABLED(AUTOTEMP) void Planner::autotemp_M104_M109() { diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index e1766b566edd..a79c5bfd38e4 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -40,7 +40,7 @@ #endif #if ABL_PLANAR - #include "../libs/vector_3.h" + #include "../libs/vector_3.h" // for matrix_3x3 #endif #if ENABLED(FWRETRACT) @@ -51,6 +51,15 @@ #include "../feature/mixing.h" #endif +#if HAS_CUTTER + #include "../feature/spindle_laser.h" +#endif + +// Feedrate for manual moves +#ifdef MANUAL_FEEDRATE + constexpr xyze_feedrate_t manual_feedrate_mm_m = MANUAL_FEEDRATE; +#endif + enum BlockFlagBit : char { // Recalculate trapezoids on entry junction. For optimization. BLOCK_BIT_RECALCULATE, @@ -95,15 +104,8 @@ typedef struct block_t { 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 - }; + abce_ulong_t steps; // Step count along each axis + abce_long_t position; // New position to force when this sync block is executed }; uint32_t step_event_count; // The number of step events required to complete this block @@ -147,6 +149,10 @@ typedef struct block_t { final_rate, // The minimal rate at exit acceleration_steps_per_s2; // acceleration steps/sec^2 + #if HAS_CUTTER + cutter_power_t cutter_power; // Power level for Spindle, Laser, etc. + #endif + #if FAN_COUNT > 0 uint8_t fan_speed[FAN_COUNT]; #endif @@ -155,24 +161,30 @@ typedef struct block_t { uint8_t valve_pressure, e_to_p_pressure; #endif - uint32_t segment_time_us; + #if HAS_SPI_LCD + uint32_t segment_time_us; + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + uint32_t sdpos; + #endif } block_t; -#define HAS_POSITION_FLOAT ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX) +#define HAS_POSITION_FLOAT ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL) #define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1)) typedef struct { - uint32_t max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE - min_segment_time_us; // (µs) M205 B - float axis_steps_per_mm[XYZE_N], // (steps) M92 XYZE - Steps per millimeter - max_feedrate_mm_s[XYZE_N], // (mm/s) M203 XYZE - Max speeds - 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_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate - min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate + uint32_t max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE + min_segment_time_us; // (µs) M205 B + float axis_steps_per_mm[XYZE_N]; // (steps) M92 XYZE - Steps per millimeter + feedRate_t max_feedrate_mm_s[XYZE_N]; // (mm/s) M203 XYZE - Max speeds + float 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. + feedRate_t min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate + min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate } planner_settings_t; #if DISABLED(SKEW_CORRECTION) @@ -224,9 +236,10 @@ class Planner { static uint8_t last_extruder; // Respond to extruder change #endif - static int16_t flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder - - static float e_factor[EXTRUDERS]; // The flow percentage and volumetric multiplier combine to scale E movement + #if EXTRUDERS + static int16_t flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder + static float e_factor[EXTRUDERS]; // The flow percentage and volumetric multiplier combine to scale E movement + #endif #if DISABLED(NO_VOLUMETRICS) static float filament_size[EXTRUDERS], // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder @@ -240,7 +253,7 @@ class Planner { static uint32_t max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived from mm_per_s2 static float steps_to_mm[XYZE_N]; // Millimeters per step - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) static float junction_deviation_mm; // (mm) M205 J #if ENABLED(LIN_ADVANCE) static float max_e_jerk // Calculated from junction_deviation_mm @@ -252,13 +265,11 @@ class Planner { #endif #if HAS_CLASSIC_JERK - static float max_jerk[ - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) - XYZ // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration. - #else - XYZE // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. - #endif - ]; + #if HAS_LINEAR_E_JERK + static xyz_pos_t max_jerk; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration. + #else + static xyze_pos_t max_jerk; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration. + #endif #endif #if HAS_LEVELING @@ -278,11 +289,11 @@ class Planner { #endif #if HAS_POSITION_FLOAT - static float position_float[XYZE]; + static xyze_pos_t position_float; #endif #if IS_KINEMATIC - static float position_cart[XYZE]; + static xyze_pos_t position_cart; #endif static skew_factor_t skew_factor; @@ -297,12 +308,12 @@ class Planner { * The current position of the tool in absolute steps * Recalculated if any axis_steps_per_mm are changed by gcode */ - static int32_t position[NUM_AXIS]; + static xyze_long_t position; /** * Speed of previous path line segment */ - static float previous_speed[NUM_AXIS]; + static xyze_float_t previous_speed; /** * Nominal speed of previous path line segment (mm/s)^2 @@ -331,10 +342,10 @@ class Planner { // Old direction bits. Used for speed calculations static unsigned char old_direction_bits; // Segment times (in µs). Used for speed calculations - static uint32_t axis_segment_time_us[2][3]; + static xy_ulong_t axis_segment_time_us[3]; #endif - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD volatile static uint32_t block_buffer_runtime_us; //Theoretical block buffer runtime in µs #endif @@ -354,14 +365,20 @@ class Planner { static void reset_acceleration_rates(); static void refresh_positioning(); + static void set_max_acceleration(const uint8_t axis, float targetValue); + static void set_max_feedrate(const uint8_t axis, float targetValue); + static void set_max_jerk(const AxisEnum axis, float targetValue); - FORCE_INLINE static void refresh_e_factor(const uint8_t e) { - e_factor[e] = (flow_percentage[e] * 0.01f - #if DISABLED(NO_VOLUMETRICS) - * volumetric_multiplier[e] - #endif - ); - } + + #if EXTRUDERS + FORCE_INLINE static void refresh_e_factor(const uint8_t e) { + e_factor[e] = (flow_percentage[e] * 0.01f + #if DISABLED(NO_VOLUMETRICS) + * volumetric_multiplier[e] + #endif + ); + } + #endif // Manage fans, paste pressure, etc. static void check_axes_activity(); @@ -370,7 +387,14 @@ class Planner { static void calculate_volumetric_multipliers(); #if ENABLED(FILAMENT_WIDTH_SENSOR) - void calculate_volumetric_for_width_sensor(const int8_t encoded_ratio); + void apply_filament_width_sensor(const int8_t encoded_ratio); + + static inline float volumetric_percent(const bool vol) { + return 100.0f * (vol + ? volumetric_area_nominal / volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] + : volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] + ); + } #endif #if DISABLED(NO_VOLUMETRICS) @@ -395,15 +419,13 @@ class Planner { */ static inline float fade_scaling_factor_for_z(const float &rz) { static float z_fade_factor = 1; - if (z_fade_height) { - if (rz >= z_fade_height) return 0; - if (last_fade_z != rz) { - last_fade_z = rz; - z_fade_factor = 1 - rz * inverse_z_fade_height; - } - return z_fade_factor; + if (!z_fade_height) return 1; + if (rz >= z_fade_height) return 0; + if (last_fade_z != rz) { + last_fade_z = rz; + z_fade_factor = 1 - rz * inverse_z_fade_height; } - return 1; + return z_fade_factor; } FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; } @@ -420,12 +442,9 @@ class Planner { #else - FORCE_INLINE static float fade_scaling_factor_for_z(const float &rz) { - UNUSED(rz); - return 1; - } + FORCE_INLINE static float fade_scaling_factor_for_z(const float&) { return 1; } - FORCE_INLINE static bool leveling_active_at_z(const float &rz) { UNUSED(rz); return true; } + FORCE_INLINE static bool leveling_active_at_z(const float&) { return true; } #endif @@ -440,8 +459,7 @@ class Planner { } } } - FORCE_INLINE static void skew(float (&raw)[XYZ]) { skew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } - FORCE_INLINE static void skew(float (&raw)[XYZE]) { skew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } + FORCE_INLINE static void skew(xyz_pos_t &raw) { skew(raw.x, raw.y, raw.z); } FORCE_INLINE static void unskew(float &cx, float &cy, const float &cz) { if (WITHIN(cx, X_MIN_POS, X_MAX_POS) && WITHIN(cy, Y_MIN_POS, Y_MAX_POS)) { @@ -452,8 +470,7 @@ class Planner { } } } - FORCE_INLINE static void unskew(float (&raw)[XYZ]) { unskew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } - FORCE_INLINE static void unskew(float (&raw)[XYZE]) { unskew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } + FORCE_INLINE static void unskew(xyz_pos_t &raw) { unskew(raw.x, raw.y, raw.z); } #endif // SKEW_CORRECTION @@ -462,22 +479,24 @@ class Planner { * 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]); } - FORCE_INLINE static void apply_leveling(float (&raw)[XYZE]) { apply_leveling(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]); } - - static void unapply_leveling(float raw[XYZ]); + static void apply_leveling(xyz_pos_t &raw); + static void unapply_leveling(xyz_pos_t &raw); + FORCE_INLINE static void force_unapply_leveling(xyz_pos_t &raw) { + leveling_active = true; + unapply_leveling(raw); + leveling_active = false; + } #endif #if ENABLED(FWRETRACT) static void apply_retract(float &rz, float &e); - FORCE_INLINE static void apply_retract(float (&raw)[XYZE]) { apply_retract(raw[Z_AXIS], raw[E_AXIS]); } + FORCE_INLINE static void apply_retract(xyze_pos_t &raw) { apply_retract(raw.z, raw.e); } static void unapply_retract(float &rz, float &e); - FORCE_INLINE static void unapply_retract(float (&raw)[XYZE]) { unapply_retract(raw[Z_AXIS], raw[E_AXIS]); } + FORCE_INLINE static void unapply_retract(xyze_pos_t &raw) { unapply_retract(raw.z, raw.e); } #endif #if HAS_POSITION_MODIFIERS - FORCE_INLINE static void apply_modifiers(float (&pos)[XYZE] + FORCE_INLINE static void apply_modifiers(xyze_pos_t &pos #if HAS_LEVELING , bool leveling = #if PLANNER_LEVELING @@ -491,15 +510,14 @@ class Planner { skew(pos); #endif #if HAS_LEVELING - if (leveling) - apply_leveling(pos); + if (leveling) apply_leveling(pos); #endif #if ENABLED(FWRETRACT) apply_retract(pos); #endif } - FORCE_INLINE static void unapply_modifiers(float (&pos)[XYZE] + FORCE_INLINE static void unapply_modifiers(xyze_pos_t &pos #if HAS_LEVELING , bool leveling = #if PLANNER_LEVELING @@ -513,8 +531,7 @@ class Planner { unapply_retract(pos); #endif #if HAS_LEVELING - if (leveling) - unapply_leveling(pos); + if (leveling) unapply_leveling(pos); #endif #if ENABLED(SKEW_CORRECTION) unskew(pos); @@ -566,14 +583,14 @@ class Planner { * * Returns true if movement was buffered, false otherwise */ - static bool _buffer_steps(const int32_t (&target)[XYZE] + static bool _buffer_steps(const xyze_long_t &target #if HAS_POSITION_FLOAT - , const float (&target_float)[ABCE] + , const xyze_pos_t &target_float #endif - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - , const float (&delta_mm_cart)[XYZE] + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + , const xyze_float_t &delta_mm_cart #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); /** @@ -589,14 +606,14 @@ class Planner { * Returns true is movement is acceptable, false otherwise */ static bool _populate_block(block_t * const block, bool split_move, - const int32_t (&target)[XYZE] + const xyze_long_t &target #if HAS_POSITION_FLOAT - , const float (&target_float)[XYZE] + , const xyze_pos_t &target_float #endif - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - , const float (&delta_mm_cart)[XYZE] + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + , const xyze_float_t &delta_mm_cart #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); /** @@ -609,7 +626,7 @@ class Planner { private: // Allow do_homing_move to access internal functions, such as buffer_segment. - friend void do_homing_move(const AxisEnum, const float, const float); + friend void do_homing_move(const AxisEnum, const float, const feedRate_t); #endif /** @@ -625,20 +642,20 @@ class Planner { * millimeters - the length of the movement, if known */ static bool buffer_segment(const float &a, const float &b, const float &c, const float &e - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - , const float (&delta_mm_cart)[XYZE] + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + , const xyze_float_t &delta_mm_cart #endif - , const float &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); - FORCE_INLINE static bool buffer_segment(const float (&abce)[ABCE] - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) - , const float (&delta_mm_cart)[XYZE] + FORCE_INLINE static bool buffer_segment(abce_pos_t &abce + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) + , const xyze_float_t &delta_mm_cart #endif - , const float &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ) { - return buffer_segment(abce[A_AXIS], abce[B_AXIS], abce[C_AXIS], abce[E_AXIS] - #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) + return buffer_segment(abce.a, abce.b, abce.c, abce.e + #if IS_KINEMATIC && DISABLED(CLASSIC_JERK) , delta_mm_cart #endif , fr_mm_s, extruder, millimeters); @@ -648,9 +665,8 @@ class Planner { /** * Add a new linear movement to the buffer. - * The target is cartesian, it's translated to delta/scara if - * needed. - * + * The target is cartesian. It's translated to + * delta/scara if needed. * * rx,ry,rz,e - target position in mm or degrees * fr_mm_s - (target) speed of the move (mm/s) @@ -658,18 +674,18 @@ class Planner { * millimeters - the length of the movement, if known * inv_duration - the reciprocal if the duration of the movement, if known (kinematic only if feeedrate scaling is enabled) */ - static bool buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const float &fr_mm_s, const uint8_t extruder, const float millimeters=0.0 + static bool buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0 #if ENABLED(SCARA_FEEDRATE_SCALING) , const float &inv_duration=0.0 #endif ); - FORCE_INLINE static bool buffer_line(const float (&cart)[XYZE], const float &fr_mm_s, const uint8_t extruder, const float millimeters=0.0 + FORCE_INLINE static bool buffer_line(const xyze_pos_t &cart, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0 #if ENABLED(SCARA_FEEDRATE_SCALING) , const float &inv_duration=0.0 #endif ) { - return buffer_line(cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder, millimeters + return buffer_line(cart.x, cart.y, cart.z, cart.e, fr_mm_s, extruder, millimeters #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -690,7 +706,7 @@ class Planner { * Clears previous speed values. */ static void set_position_mm(const float &rx, const float &ry, const float &rz, const float &e); - FORCE_INLINE static void set_position_mm(const float (&cart)[XYZE]) { set_position_mm(cart[X_AXIS], cart[Y_AXIS], cart[Z_AXIS], cart[E_AXIS]); } + FORCE_INLINE static void set_position_mm(const xyze_pos_t &cart) { set_position_mm(cart.x, cart.y, cart.z, cart.e); } static void set_e_position_mm(const float &e); /** @@ -700,7 +716,7 @@ class Planner { * conversions are applied. */ static void set_machine_position_mm(const float &a, const float &b, const float &c, const float &e); - FORCE_INLINE static void set_machine_position_mm(const float (&abce)[ABCE]) { set_machine_position_mm(abce[A_AXIS], abce[B_AXIS], abce[C_AXIS], abce[E_AXIS]); } + FORCE_INLINE static void set_machine_position_mm(const abce_pos_t &abce) { set_machine_position_mm(abce.a, abce.b, abce.c, abce.e); } /** * Get an axis position according to stepper position(s) @@ -713,8 +729,8 @@ class Planner { 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) + // Called to force a quick stop of the machine (for example, when + // a Full Shutdown is required, or when endstops are hit) static void quick_stop(); // Called when an endstop is triggered. Causes the machine to stop inmediately @@ -773,7 +789,7 @@ class Planner { // No trapezoid calculated? Don't execute yet. if (TEST(block->flag, BLOCK_BIT_RECALCULATE)) return nullptr; - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_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 @@ -789,7 +805,7 @@ class Planner { } // The queue became empty - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero. #endif @@ -806,7 +822,7 @@ class Planner { block_buffer_tail = next_block_index(block_buffer_tail); } - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD static uint16_t block_buffer_runtime() { #ifdef __AVR__ @@ -857,7 +873,7 @@ class Planner { static void autotemp_M104_M109(); #endif - #if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE) + #if HAS_LINEAR_E_JERK 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(DISTINCT_E_FACTORS) @@ -929,23 +945,22 @@ class Planner { static void recalculate(); - #if ENABLED(JUNCTION_DEVIATION) + #if DISABLED(CLASSIC_JERK) - FORCE_INLINE static void normalize_junction_vector(float (&vector)[XYZE]) { + FORCE_INLINE static void normalize_junction_vector(xyze_float_t &vector) { 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; + vector *= RSQRT(magnitude_sq); } - FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, float (&unit_vec)[XYZE]) { + FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, xyze_float_t &unit_vec) { float limit_value = max_value; LOOP_XYZE(idx) if (unit_vec[idx]) // Avoid divide by zero NOMORE(limit_value, ABS(settings.max_acceleration_mm_per_s2[idx] / unit_vec[idx])); return limit_value; } - #endif // JUNCTION_DEVIATION + #endif // !CLASSIC_JERK }; #define PLANNER_XY_FEEDRATE() (_MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS])) diff --git a/Marlin/src/module/planner_bezier.cpp b/Marlin/src/module/planner_bezier.cpp index 71a99594f5b8..080f4e41a856 100644 --- a/Marlin/src/module/planner_bezier.cpp +++ b/Marlin/src/module/planner_bezier.cpp @@ -107,22 +107,23 @@ static inline float dist1(const float &x1, const float &y1, const float &x2, con * the mitigation offered by MIN_STEP and the small computational * power available on Arduino, I think it is not wise to implement it. */ -void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS], const float offset[4], float fr_mm_s, uint8_t extruder) { +void cubic_b_spline( + const xyze_pos_t &position, // current position + const xyze_pos_t &target, // target position + const xy_pos_t (&offsets)[2], // a pair of offsets + const feedRate_t &scaled_fr_mm_s, // mm/s scaled by feedrate % + const uint8_t extruder +) { // Absolute first and second control points are recovered. - 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; - - float bez_target[4]; - bez_target[X_AXIS] = position[X_AXIS]; - bez_target[Y_AXIS] = position[Y_AXIS]; + const xy_pos_t first = position + offsets[0], second = target + offsets[1]; + + xyze_pos_t bez_target; + bez_target.set(position.x, position.y); float step = MAX_STEP; millis_t next_idle_ms = millis() + 200UL; - while (t < 1) { + for (float t = 0; t < 1;) { thermalManager.manage_heater(); millis_t now = millis(); @@ -136,15 +137,15 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] bool did_reduce = false; float new_t = t + step; NOMORE(new_t, 1); - 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); + float new_pos0 = eval_bezier(position.x, first.x, second.x, target.x, new_t), + new_pos1 = eval_bezier(position.y, first.y, second.y, target.y, new_t); for (;;) { if (new_t - t < (MIN_STEP)) break; const float candidate_t = 0.5f * (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.5f * (bez_target[X_AXIS] + new_pos0), - interp_pos1 = 0.5f * (bez_target[Y_AXIS] + new_pos1); + candidate_pos0 = eval_bezier(position.x, first.x, second.x, target.x, candidate_t), + candidate_pos1 = eval_bezier(position.y, first.y, second.y, target.y, candidate_t), + interp_pos0 = 0.5f * (bez_target.x + new_pos0), + interp_pos1 = 0.5f * (bez_target.y + new_pos1); if (dist1(candidate_pos0, candidate_pos1, interp_pos0, interp_pos1) <= (SIGMA)) break; new_t = candidate_t; new_pos0 = candidate_pos0; @@ -157,10 +158,10 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] 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(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.5f * (bez_target[X_AXIS] + candidate_pos0), - interp_pos1 = 0.5f * (bez_target[Y_AXIS] + candidate_pos1); + const float candidate_pos0 = eval_bezier(position.x, first.x, second.x, target.x, candidate_t), + candidate_pos1 = eval_bezier(position.y, first.y, second.y, target.y, candidate_t), + interp_pos0 = 0.5f * (bez_target.x + candidate_pos0), + interp_pos1 = 0.5f * (bez_target.y + candidate_pos1); if (dist1(new_pos0, new_pos1, interp_pos0, interp_pos1) > (SIGMA)) break; new_t = candidate_t; new_pos0 = candidate_pos0; @@ -182,22 +183,22 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] t = new_t; // Compute and send new position - bez_target[X_AXIS] = new_pos0; - 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(position[Z_AXIS], target[Z_AXIS], t); - bez_target[E_AXIS] = interp(position[E_AXIS], target[E_AXIS], t); - apply_motion_limits(bez_target); + xyze_pos_t new_bez = { + new_pos0, new_pos1, + interp(position.z, target.z, t), // FIXME. These two are wrong, since the parameter t is + interp(position.e, target.e, t) // not linear in the distance. + }; + apply_motion_limits(new_bez); + bez_target = new_bez; #if HAS_LEVELING && !PLANNER_LEVELING - float pos[XYZE] = { bez_target[X_AXIS], bez_target[Y_AXIS], bez_target[Z_AXIS], bez_target[E_AXIS] }; + xyze_pos_t pos = bez_target; planner.apply_leveling(pos); #else - const float (&pos)[XYZE] = bez_target; + const xyze_pos_t &pos = bez_target; #endif - if (!planner.buffer_line(pos, fr_mm_s, active_extruder, step)) + if (!planner.buffer_line(pos, scaled_fr_mm_s, active_extruder, step)) break; } } diff --git a/Marlin/src/module/planner_bezier.h b/Marlin/src/module/planner_bezier.h index 492bf51146aa..d0aa82858cb9 100644 --- a/Marlin/src/module/planner_bezier.h +++ b/Marlin/src/module/planner_bezier.h @@ -28,13 +28,12 @@ * */ -#include -#include "../core/macros.h" +#include "../core/types.h" void cubic_b_spline( - const float position[NUM_AXIS], // current position - const float target[NUM_AXIS], // target position - const float offset[4], // a pair of offsets - float fr_mm_s, - uint8_t extruder - ); + const xyze_pos_t &position, // current position + const xyze_pos_t &target, // target position + const xy_pos_t (&offsets)[2], // a pair of offsets + const feedRate_t &scaled_fr_mm_s, // mm/s scaled by feedrate % + const uint8_t extruder +); diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index 25e8a767ab4e..cef233d9acfd 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -157,6 +157,8 @@ void PrintCounter::loadStats() { #endif #if HAS_BUZZER && SERVICE_WARNING_BUZZES > 0 if (doBuzz) for (int i = 0; i < SERVICE_WARNING_BUZZES; i++) BUZZ(200, 404); + #else + UNUSED(doBuzz); #endif #endif // HAS_SERVICE_INTERVALS } @@ -181,11 +183,9 @@ void PrintCounter::saveStats() { #if HAS_SERVICE_INTERVALS inline void _service_when(char buffer[], const char * const msg, const uint32_t when) { - duration_t elapsed = when; - elapsed.toString(buffer); SERIAL_ECHOPGM(MSG_STATS); serialprintPGM(msg); - SERIAL_ECHOLNPAIR(" in ", buffer); + SERIAL_ECHOLNPAIR(" in ", duration_t(when).toString(buffer)); } #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index dbd14ed5b562..36789251fd24 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -28,9 +28,9 @@ #if HAS_BED_PROBE -#include "../libs/buzzer.h" - #include "probe.h" + +#include "../libs/buzzer.h" #include "motion.h" #include "temperature.h" #include "endstops.h" @@ -38,9 +38,7 @@ #include "../gcode/gcode.h" #include "../lcd/ultralcd.h" -#if ANY(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY, PROBE_TRIGGERED_WHEN_STOWED_TEST) || (QUIET_PROBING && ENABLED(PROBING_STEPPERS_OFF)) - #include "../Marlin.h" // for stop(), disable_e_steppers -#endif +#include "../Marlin.h" // for stop(), disable_e_steppers, wait_for_user #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" @@ -58,12 +56,16 @@ #include "../feature/backlash.h" #endif -float zprobe_zoffset; // Initialized by settings.load() +xyz_pos_t probe_offset; // Initialized by settings.load() #if ENABLED(BLTOUCH) #include "../feature/bltouch.h" #endif +#if ENABLED(HOST_PROMPT_SUPPORT) + #include "../feature/host_actions.h" // for PROMPT_USER_CONTINUE +#endif + #if HAS_Z_SERVO_PROBE #include "servo.h" #endif @@ -74,7 +76,11 @@ float zprobe_zoffset; // Initialized by settings.load() #endif #if QUIET_PROBING - #include "stepper_indirection.h" + #include "stepper/indirection.h" +#endif + +#if ENABLED(EXTENSIBLE_UI) + #include "../lcd/extensible_ui/ui_api.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -108,12 +114,16 @@ float zprobe_zoffset; // Initialized by settings.load() // Move to the magnet to unlock the probe void run_deploy_moves_script() { #ifndef TOUCH_MI_DEPLOY_XPOS - #define TOUCH_MI_DEPLOY_XPOS 0 + #define TOUCH_MI_DEPLOY_XPOS X_MIN_POS #elif TOUCH_MI_DEPLOY_XPOS > X_MAX_BED TemporaryGlobalEndstopsState unlock_x(false); #endif + #if TOUCH_MI_DEPLOY_YPOS > Y_MAX_BED + TemporaryGlobalEndstopsState unlock_y(false); + #endif #if ENABLED(TOUCH_MI_MANUAL_DEPLOY) + const screenFunc_t prev_screen = ui.currentScreen; LCD_MESSAGEPGM(MSG_MANUAL_DEPLOY_TOUCHMI); ui.return_to_status(); @@ -121,188 +131,103 @@ float zprobe_zoffset; // Initialized by settings.load() KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; // LCD click or M108 will clear this #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI probe."), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI probe."), CONTINUE_STR); #endif while (wait_for_user) idle(); ui.reset_status(); ui.goto_screen(prev_screen); - #else + + #elif defined(TOUCH_MI_DEPLOY_XPOS) && defined(TOUCH_MI_DEPLOY_YPOS) + do_blocking_move_to_xy(TOUCH_MI_DEPLOY_XPOS, TOUCH_MI_DEPLOY_YPOS); + #elif defined(TOUCH_MI_DEPLOY_XPOS) do_blocking_move_to_x(TOUCH_MI_DEPLOY_XPOS); + #elif defined(TOUCH_MI_DEPLOY_YPOS) + do_blocking_move_to_y(TOUCH_MI_DEPLOY_YPOS); #endif } // Move down to the bed to stow the probe void run_stow_moves_script() { - const float old_pos[] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; + const xyz_pos_t oldpos = current_position; endstops.enable_z_probe(false); do_blocking_move_to_z(TOUCH_MI_RETRACT_Z, MMM_TO_MMS(HOMING_FEEDRATE_Z)); - do_blocking_move_to(old_pos, MMM_TO_MMS(HOMING_FEEDRATE_Z)); + do_blocking_move_to(oldpos, MMM_TO_MMS(HOMING_FEEDRATE_Z)); } #elif ENABLED(Z_PROBE_ALLEN_KEY) void run_deploy_moves_script() { - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_1 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0 #endif - const float deploy_1[] = { Z_PROBE_ALLEN_KEY_DEPLOY_1_X, Z_PROBE_ALLEN_KEY_DEPLOY_1_Y, Z_PROBE_ALLEN_KEY_DEPLOY_1_Z }; + constexpr xyz_pos_t deploy_1 = Z_PROBE_ALLEN_KEY_DEPLOY_1; do_blocking_move_to(deploy_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_2 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0 #endif - const float deploy_2[] = { Z_PROBE_ALLEN_KEY_DEPLOY_2_X, Z_PROBE_ALLEN_KEY_DEPLOY_2_Y, Z_PROBE_ALLEN_KEY_DEPLOY_2_Z }; + constexpr xyz_pos_t deploy_2 = Z_PROBE_ALLEN_KEY_DEPLOY_2; do_blocking_move_to(deploy_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0 #endif - const float deploy_3[] = { Z_PROBE_ALLEN_KEY_DEPLOY_3_X, Z_PROBE_ALLEN_KEY_DEPLOY_3_Y, Z_PROBE_ALLEN_KEY_DEPLOY_3_Z }; + constexpr xyz_pos_t deploy_3 = Z_PROBE_ALLEN_KEY_DEPLOY_3; do_blocking_move_to(deploy_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_4 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0 #endif - const float deploy_4[] = { Z_PROBE_ALLEN_KEY_DEPLOY_4_X, Z_PROBE_ALLEN_KEY_DEPLOY_4_Y, Z_PROBE_ALLEN_KEY_DEPLOY_4_Z }; + constexpr xyz_pos_t deploy_4 = Z_PROBE_ALLEN_KEY_DEPLOY_4; do_blocking_move_to(deploy_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_5 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0 #endif - const float deploy_5[] = { Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z }; + constexpr xyz_pos_t deploy_5 = Z_PROBE_ALLEN_KEY_DEPLOY_5; do_blocking_move_to(deploy_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE)); #endif } void run_stow_moves_script() { - #if defined(Z_PROBE_ALLEN_KEY_STOW_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_1_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_1_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Z - #define Z_PROBE_ALLEN_KEY_STOW_1_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_1 #ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0 #endif - const float stow_1[] = { Z_PROBE_ALLEN_KEY_STOW_1_X, Z_PROBE_ALLEN_KEY_STOW_1_Y, Z_PROBE_ALLEN_KEY_STOW_1_Z }; + constexpr xyz_pos_t stow_1 = Z_PROBE_ALLEN_KEY_STOW_1; do_blocking_move_to(stow_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_2_X) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_2_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Z - #define Z_PROBE_ALLEN_KEY_STOW_2_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_2 #ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0 #endif - const float stow_2[] = { Z_PROBE_ALLEN_KEY_STOW_2_X, Z_PROBE_ALLEN_KEY_STOW_2_Y, Z_PROBE_ALLEN_KEY_STOW_2_Z }; + constexpr xyz_pos_t stow_2 = Z_PROBE_ALLEN_KEY_STOW_2; do_blocking_move_to(stow_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_3_X) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_X - #define Z_PROBE_ALLEN_KEY_STOW_3_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Z - #define Z_PROBE_ALLEN_KEY_STOW_3_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_3 #ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0 #endif - const float stow_3[] = { Z_PROBE_ALLEN_KEY_STOW_3_X, Z_PROBE_ALLEN_KEY_STOW_3_Y, Z_PROBE_ALLEN_KEY_STOW_3_Z }; + constexpr xyz_pos_t stow_3 = Z_PROBE_ALLEN_KEY_STOW_3; do_blocking_move_to(stow_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_4_X) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_X - #define Z_PROBE_ALLEN_KEY_STOW_4_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Y - #define Z_PROBE_ALLEN_KEY_STOW_4_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Z - #define Z_PROBE_ALLEN_KEY_STOW_4_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_4 #ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0 #endif - const float stow_4[] = { Z_PROBE_ALLEN_KEY_STOW_4_X, Z_PROBE_ALLEN_KEY_STOW_4_Y, Z_PROBE_ALLEN_KEY_STOW_4_Z }; + constexpr xyz_pos_t stow_4 = Z_PROBE_ALLEN_KEY_STOW_4; do_blocking_move_to(stow_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_5_X) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_X - #define Z_PROBE_ALLEN_KEY_STOW_5_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Y - #define Z_PROBE_ALLEN_KEY_STOW_5_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Z - #define Z_PROBE_ALLEN_KEY_STOW_5_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_5 #ifndef Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0 #endif - const float stow_5[] = { Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z }; + constexpr xyz_pos_t stow_5 = Z_PROBE_ALLEN_KEY_STOW_5; do_blocking_move_to(stow_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE)); #endif } @@ -340,11 +265,11 @@ inline void do_probe_raise(const float z_raise) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("do_probe_raise(", z_raise, ")"); float z_dest = z_raise; - if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; + if (probe_offset.z < 0) z_dest -= probe_offset.z; NOMORE(z_dest, Z_MAX_POS); - if (z_dest > current_position[Z_AXIS]) + if (z_dest > current_position.z) do_blocking_move_to_z(z_dest); } @@ -358,7 +283,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { BUZZ(100, 659); BUZZ(100, 698); - PGM_P const ds_str = deploy ? PSTR(MSG_MANUAL_DEPLOY) : PSTR(MSG_MANUAL_STOW); + PGM_P const ds_str = deploy ? GET_TEXT(MSG_MANUAL_DEPLOY) : GET_TEXT(MSG_MANUAL_STOW); ui.return_to_status(); // To display the new status message ui.set_status_P(ds_str, 99); serialprintPGM(ds_str); @@ -367,7 +292,10 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), PSTR("Continue")); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR); + #endif + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe")); #endif while (wait_for_user) idle(); ui.reset_status(); @@ -447,23 +375,21 @@ bool set_probe_deployed(const bool deploy) { do_probe_raise(_MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE)); #if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY) - #if ENABLED(Z_PROBE_SLED) - #define _AUE_ARGS true, false, false - #else - #define _AUE_ARGS - #endif - if (axis_unhomed_error(_AUE_ARGS)) { + if (axis_unhomed_error( + #if ENABLED(Z_PROBE_SLED) + _BV(X_AXIS) + #endif + )) { SERIAL_ERROR_MSG(MSG_STOP_UNHOMED); stop(); return true; } #endif - const float oldXpos = current_position[X_AXIS], - oldYpos = current_position[Y_AXIS]; + const xy_pos_t old_xy = current_position; #if ENABLED(PROBE_TRIGGERED_WHEN_STOWED_TEST) - #if USES_Z_MIN_PROBE_ENDSTOP + #if HAS_CUSTOM_PROBE_PIN #define PROBE_STOWED() (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) #else #define PROBE_STOWED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) @@ -482,7 +408,7 @@ bool set_probe_deployed(const bool deploy) { if (PROBE_STOWED() == deploy) { // Unchanged after deploy/stow action? if (IsRunning()) { SERIAL_ERROR_MSG("Z-Probe failed"); - LCD_ALERTMESSAGEPGM("Err: ZPROBE"); + LCD_ALERTMESSAGEPGM_P(PSTR("Err: ZPROBE")); } stop(); return true; @@ -494,7 +420,7 @@ bool set_probe_deployed(const bool deploy) { #endif - do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy + do_blocking_move_to(old_xy); endstops.enable_z_probe(deploy); return false; } @@ -502,9 +428,9 @@ bool set_probe_deployed(const bool deploy) { #ifdef Z_AFTER_PROBING // After probing move to a preferred Z position void move_z_after_probing() { - if (current_position[Z_AXIS] != Z_AFTER_PROBING) { + if (current_position.z != Z_AFTER_PROBING) { do_blocking_move_to_z(Z_AFTER_PROBING); - current_position[Z_AXIS] = Z_AFTER_PROBING; + current_position.z = Z_AFTER_PROBING; } } #endif @@ -521,7 +447,7 @@ bool set_probe_deployed(const bool deploy) { const char msg_wait_for_bed_heating[25] PROGMEM = "Wait for bed heating...\n"; #endif -static bool do_probe_move(const float z, const float fr_mm_s) { +static bool do_probe_move(const float z, const feedRate_t fr_mm_s) { if (DEBUGGING(LEVELING)) DEBUG_POS(">>> do_probe_move", current_position); #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) @@ -540,7 +466,7 @@ static bool do_probe_move(const float z, const float fr_mm_s) { // Disable stealthChop if used. Enable diag1 pin on driver. #if ENABLED(SENSORLESS_PROBING) - sensorless_t stealth_states { false, false, false, false, false, false, false }; + sensorless_t stealth_states { false }; #if ENABLED(DELTA) stealth_states.x = tmc_enable_stallguard(stepperX); stealth_states.y = tmc_enable_stallguard(stepperY); @@ -606,8 +532,8 @@ static bool do_probe_move(const float z, const float fr_mm_s) { /** * @brief Probe at the current XY (possibly more than once) to find the bed Z. * - * @details Used by probe_pt to get the bed Z height at the current XY. - * Leaves current_position[Z_AXIS] at the height where the probe triggered. + * @details Used by probe_at_point to get the bed Z height at the current XY. + * Leaves current_position.z at the height where the probe triggered. * * @return The Z position of the bed at the current XY or NAN on error. */ @@ -617,7 +543,7 @@ static float run_z_probe() { // 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; + const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -probe_offset.z + Z_PROBE_LOW_POINT : -10.0; // Double-probing does a fast probe followed by a slow probe #if TOTAL_PROBING == 2 @@ -631,22 +557,22 @@ static float run_z_probe() { return NAN; } - const float first_probe_z = current_position[Z_AXIS]; + const float first_probe_z = current_position.z; if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("1st Probe Z:", first_probe_z); // Raise to give the probe clearance - 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 + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); #elif Z_PROBE_SPEED_FAST != Z_PROBE_SPEED_SLOW // If the nozzle is well over the travel height then // move down quickly before doing the slow probe - const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (zprobe_zoffset < 0 ? -zprobe_zoffset : 0); - if (current_position[Z_AXIS] > z) { + const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (probe_offset.z < 0 ? -probe_offset.z : 0); + if (current_position.z > z) { // Probe down fast. If the probe never triggered, raise for probe clearance if (!do_probe_move(z, 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)); + do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST)); } #endif @@ -678,7 +604,7 @@ static float run_z_probe() { backlash.measure_with_probe(); #endif - const float z = current_position[Z_AXIS]; + const float z = current_position.z; #if EXTRA_PROBING // Insert Z measurement into probes[]. Keep it sorted ascending. @@ -725,11 +651,11 @@ static float run_z_probe() { #endif - const float measured_z = probes_total * (1.0f / (MULTIPLE_PROBING)); + const float measured_z = probes_total * RECIPROCAL(MULTIPLE_PROBING); #elif TOTAL_PROBING == 2 - const float z2 = current_position[Z_AXIS]; + const float z2 = current_position.z; if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("2nd Probe Z:", z2, " Discrepancy:", first_probe_z - z2); @@ -739,7 +665,7 @@ static float run_z_probe() { #else // Return the single probe result - const float measured_z = current_position[Z_AXIS]; + const float measured_z = current_position.z; #endif @@ -757,10 +683,10 @@ static float run_z_probe() { * - 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_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOLNPAIR( - ">>> probe_pt(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry), + ">>> probe_at_point(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry), ", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none", ", ", int(verbose_level), ", ", probe_relative ? "probe" : "nozzle", "_relative)" @@ -769,20 +695,19 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/ } // TODO: Adapt for SCARA, where the offset rotates - float nx = rx, ny = ry; + xyz_pos_t npos = { rx, ry }; if (probe_relative) { - if (!position_is_reachable_by_probe(rx, ry)) return NAN; // The given position is in terms of the probe - nx -= (X_PROBE_OFFSET_FROM_EXTRUDER); // Get the nozzle position - ny -= (Y_PROBE_OFFSET_FROM_EXTRUDER); + if (!position_is_reachable_by_probe(npos)) return NAN; // The given position is in terms of the probe + npos -= probe_offset; // Get the nozzle position } - else if (!position_is_reachable(nx, ny)) return NAN; // The given position is in terms of the nozzle + else if (!position_is_reachable(npos)) return NAN; // The given position is in terms of the nozzle - const float nz = + npos.z = #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, delta_clip_start_height) #else - current_position[Z_AXIS] + current_position.z #endif ; @@ -790,15 +715,15 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/ feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S; // Move the probe to the starting XYZ - do_blocking_move_to(nx, ny, nz); + do_blocking_move_to(npos); float measured_z = NAN; if (!DEPLOY_PROBE()) { - measured_z = run_z_probe() + zprobe_zoffset; + measured_z = run_z_probe() + probe_offset.z; 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)); + do_blocking_move_to_z(current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); else if (raise_after == PROBE_PT_STOW) if (STOW_PROBE()) measured_z = NAN; } @@ -813,11 +738,11 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/ if (isnan(measured_z)) { STOW_PROBE(); - LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED); + LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED); SERIAL_ERROR_MSG(MSG_ERR_PROBING_FAILED); } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< probe_pt"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< probe_at_point"); return measured_z; } diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index f08a452e581f..928eb43ab5fa 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -28,7 +28,9 @@ #include "../inc/MarlinConfig.h" #if HAS_BED_PROBE - extern float zprobe_zoffset; + + extern xyz_pos_t probe_offset; + bool set_probe_deployed(const bool deploy); #ifdef Z_AFTER_PROBING void move_z_after_probing(); @@ -39,15 +41,106 @@ 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); + float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true); + inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true) { + return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative); + } #define DEPLOY_PROBE() set_probe_deployed(true) #define STOW_PROBE() set_probe_deployed(false) #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) extern const char msg_wait_for_bed_heating[25]; #endif + #else + + constexpr xyz_pos_t probe_offset{0}; + #define DEPLOY_PROBE() #define STOW_PROBE() + +#endif + +#if HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) + #if IS_KINEMATIC + constexpr float printable_radius = ( + #if ENABLED(DELTA) + DELTA_PRINTABLE_RADIUS + #elif IS_SCARA + SCARA_PRINTABLE_RADIUS + #endif + ); + + inline float probe_radius() { + return printable_radius - ( + #if HAS_BED_PROBE + _MAX(MIN_PROBE_EDGE, HYPOT(probe_offset.x, probe_offset.y)) + #else + MIN_PROBE_EDGE + #endif + ); + } + #endif + + inline float probe_min_x() { + return ( + #if IS_KINEMATIC + (X_CENTER) - probe_radius() + #else + _MAX((X_MIN_BED) + (MIN_PROBE_EDGE_LEFT), (X_MIN_POS) + probe_offset.x) + #endif + ); + } + inline float probe_max_x() { + return ( + #if IS_KINEMATIC + (X_CENTER) + probe_radius() + #else + _MIN((X_MAX_BED) - (MIN_PROBE_EDGE_RIGHT), (X_MAX_POS) + probe_offset.x) + #endif + ); + } + inline float probe_min_y() { + return ( + #if IS_KINEMATIC + (Y_CENTER) - probe_radius() + #else + _MAX((Y_MIN_BED) + (MIN_PROBE_EDGE_FRONT), (Y_MIN_POS) + probe_offset.y) + #endif + ); + } + inline float probe_max_y() { + return ( + #if IS_KINEMATIC + (Y_CENTER) + probe_radius() + #else + _MIN((Y_MAX_BED) - (MIN_PROBE_EDGE_BACK), (Y_MAX_POS) + probe_offset.y) + #endif + ); + } + + #if NEEDS_THREE_PROBE_POINTS + // Retrieve three points to probe the bed. Any type exposing set(X,Y) may be used. + template + inline void get_three_probe_points(T points[3]) { + #if ENABLED(HAS_FIXED_3POINT) + points[0].set(PROBE_PT_1_X, PROBE_PT_1_Y); + points[1].set(PROBE_PT_2_X, PROBE_PT_2_Y); + points[2].set(PROBE_PT_3_X, PROBE_PT_3_Y); + #else + #if IS_KINEMATIC + constexpr float SIN0 = 0.0, SIN120 = 0.866025, SIN240 = -0.866025, + COS0 = 1.0, COS120 = -0.5 , COS240 = -0.5; + points[0].set((X_CENTER) + probe_radius() * COS0, (Y_CENTER) + probe_radius() * SIN0); + points[1].set((X_CENTER) + probe_radius() * COS120, (Y_CENTER) + probe_radius() * SIN120); + points[2].set((X_CENTER) + probe_radius() * COS240, (Y_CENTER) + probe_radius() * SIN240); + #else + points[0].set(probe_min_x(), probe_min_y()); + points[1].set(probe_max_x(), probe_min_y()); + points[2].set((probe_max_x() - probe_min_x()) / 2, probe_max_y()); + #endif + #endif + } + #endif #endif #if HAS_Z_SERVO_PROBE diff --git a/Marlin/src/module/scara.cpp b/Marlin/src/module/scara.cpp index fe98df46bf66..de7880e2d3d9 100644 --- a/Marlin/src/module/scara.cpp +++ b/Marlin/src/module/scara.cpp @@ -36,34 +36,36 @@ float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND; void scara_set_axis_is_at_home(const AxisEnum axis) { if (axis == Z_AXIS) - current_position[Z_AXIS] = Z_HOME_POS; + current_position.z = Z_HOME_POS; else { /** * SCARA homes XY at the same time */ - float homeposition[XYZ]; + xyz_pos_t homeposition; LOOP_XYZ(i) homeposition[i] = base_home_pos((AxisEnum)i); - // SERIAL_ECHOLNPAIR("homeposition X:", homeposition[X_AXIS], " Y:", homeposition[Y_AXIS]); - - /** - * Get Home position SCARA arm angles using inverse kinematics, - * and calculate homing offset using forward kinematics - */ - inverse_kinematics(homeposition); - forward_kinematics_SCARA(delta[A_AXIS], delta[B_AXIS]); - - // SERIAL_ECHOLNPAIR("Cartesian X:", cartes[X_AXIS], " Y:", cartes[Y_AXIS]); - - current_position[axis] = cartes[axis]; - + #if ENABLED(MORGAN_SCARA) + // MORGAN_SCARA uses arm angles for AB home position + // SERIAL_ECHOLNPAIR("homeposition A:", homeposition.a, " B:", homeposition.b); + inverse_kinematics(homeposition); + forward_kinematics_SCARA(delta.a, delta.b); + current_position[axis] = cartes[axis]; + #else + // MP_SCARA uses a Cartesian XY home position + // SERIAL_ECHOLNPAIR("homeposition X:", homeposition.x, " Y:", homeposition.y); + current_position[axis] = homeposition[axis]; + #endif + + // SERIAL_ECHOLNPAIR("Cartesian X:", current_position.x, " Y:", current_position.y); update_software_endstops(axis); } } +static constexpr xy_pos_t scara_offset = { SCARA_OFFSET_X, SCARA_OFFSET_Y }; + /** - * Morgan SCARA Forward Kinematics. Results in cartes[]. + * Morgan SCARA Forward Kinematics. Results in 'cartes'. * Maths and first version by QHARLEY. * Integrated into Marlin and slightly restructured by Joachim Cerny. */ @@ -74,8 +76,8 @@ void forward_kinematics_SCARA(const float &a, const float &b) { b_sin = sin(RADIANS(b)) * L2, b_cos = cos(RADIANS(b)) * L2; - cartes[X_AXIS] = a_cos + b_cos + SCARA_OFFSET_X; //theta - cartes[Y_AXIS] = a_sin + b_sin + SCARA_OFFSET_Y; //theta+phi + cartes.set(a_cos + b_cos + scara_offset.x, // theta + a_sin + b_sin + scara_offset.y); // theta+phi /* SERIAL_ECHOLNPAIR( @@ -86,53 +88,71 @@ void forward_kinematics_SCARA(const float &a, const float &b) { " b_sin=", b_sin, " b_cos=", b_cos ); - SERIAL_ECHOLNPAIR(" cartes (X,Y) = "(cartes[X_AXIS], ", ", cartes[Y_AXIS], ")"); + SERIAL_ECHOLNPAIR(" cartes (X,Y) = "(cartes.x, ", ", cartes.y, ")"); //*/ } -/** - * Morgan SCARA Inverse Kinematics. Results in delta[]. - * - * See http://forums.reprap.org/read.php?185,283327 - * - * Maths and first version by QHARLEY. - * Integrated into Marlin and slightly restructured by Joachim Cerny. - */ -void inverse_kinematics(const float (&raw)[XYZ]) { +void inverse_kinematics(const xyz_pos_t &raw) { + + #if ENABLED(MORGAN_SCARA) - static float C2, S2, SK1, SK2, THETA, PSI; + /** + * Morgan SCARA Inverse Kinematics. Results in 'delta'. + * + * See http://forums.reprap.org/read.php?185,283327 + * + * Maths and first version by QHARLEY. + * Integrated into Marlin and slightly restructured by Joachim Cerny. + */ + float C2, S2, SK1, SK2, THETA, PSI; - float sx = raw[X_AXIS] - SCARA_OFFSET_X, // Translate SCARA to standard X Y - sy = raw[Y_AXIS] - SCARA_OFFSET_Y; // With scaling factor. + // Translate SCARA to standard XY with scaling factor + const xy_pos_t spos = raw - scara_offset; - if (L1 == L2) - C2 = HYPOT2(sx, sy) / L1_2_2 - 1; - else - C2 = (HYPOT2(sx, sy) - (L1_2 + L2_2)) / (2.0 * L1 * L2); + const float H2 = HYPOT2(spos.x, spos.y); + if (L1 == L2) + C2 = H2 / L1_2_2 - 1; + else + C2 = (H2 - (L1_2 + L2_2)) / (2.0f * L1 * L2); - S2 = SQRT(1 - sq(C2)); + S2 = SQRT(1.0f - sq(C2)); - // Unrotated Arm1 plus rotated Arm2 gives the distance from Center to End - SK1 = L1 + L2 * C2; + // Unrotated Arm1 plus rotated Arm2 gives the distance from Center to End + SK1 = L1 + L2 * C2; - // Rotated Arm2 gives the distance from Arm1 to Arm2 - SK2 = L2 * S2; + // Rotated Arm2 gives the distance from Arm1 to Arm2 + SK2 = L2 * S2; - // Angle of Arm1 is the difference between Center-to-End angle and the Center-to-Elbow - THETA = ATAN2(SK1, SK2) - ATAN2(sx, sy); + // Angle of Arm1 is the difference between Center-to-End angle and the Center-to-Elbow + THETA = ATAN2(SK1, SK2) - ATAN2(spos.x, spos.y); - // Angle of Arm2 - PSI = ATAN2(S2, C2); + // Angle of Arm2 + PSI = ATAN2(S2, C2); - delta[A_AXIS] = DEGREES(THETA); // theta is support arm angle - delta[B_AXIS] = DEGREES(THETA + PSI); // equal to sub arm angle (inverted motor) - delta[C_AXIS] = raw[Z_AXIS]; + delta.set(DEGREES(THETA), DEGREES(THETA + PSI), raw.z); - /* - DEBUG_POS("SCARA IK", raw); - DEBUG_POS("SCARA IK", delta); - SERIAL_ECHOLNPAIR(" SCARA (x,y) ", sx, ",", sy, " C2=", C2, " S2=", S2, " Theta=", THETA, " Phi=", PHI); - //*/ + /* + DEBUG_POS("SCARA IK", raw); + DEBUG_POS("SCARA IK", delta); + SERIAL_ECHOLNPAIR(" SCARA (x,y) ", sx, ",", sy, " C2=", C2, " S2=", S2, " Theta=", THETA, " Phi=", PHI); + //*/ + + #else // MP_SCARA + + const float x = raw.x, y = raw.y, c = HYPOT(x, y), + THETA3 = ATAN2(y, x), + THETA1 = THETA3 + ACOS((sq(c) + sq(L1) - sq(L2)) / (2.0f * c * L1)), + THETA2 = THETA3 - ACOS((sq(c) + sq(L2) - sq(L1)) / (2.0f * c * L2)); + + delta.set(DEGREES(THETA1), DEGREES(THETA2), raw.z); + + /* + DEBUG_POS("SCARA IK", raw); + DEBUG_POS("SCARA IK", delta); + SERIAL_ECHOLNPAIR(" SCARA (x,y) ", x, ",", y," Theta1=", THETA1, " Theta2=", THETA2); + //*/ + + #endif // MP_SCARA } void scara_report_positions() { diff --git a/Marlin/src/module/scara.h b/Marlin/src/module/scara.h index 44f07026e3cf..cde1d1bcd684 100644 --- a/Marlin/src/module/scara.h +++ b/Marlin/src/module/scara.h @@ -25,8 +25,6 @@ * scara.h - SCARA-specific functions */ -#pragma once - #include "../core/macros.h" extern float delta_segments_per_second; @@ -38,11 +36,7 @@ float constexpr L1 = SCARA_LINKAGE_1, L2 = SCARA_LINKAGE_2, void scara_set_axis_is_at_home(const AxisEnum axis); -void inverse_kinematics(const float (&raw)[XYZ]); -FORCE_INLINE void inverse_kinematics(const float (&raw)[XYZE]) { - const float raw_xyz[XYZ] = { raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS] }; - inverse_kinematics(raw_xyz); -} +void inverse_kinematics(const xyz_pos_t &raw); void forward_kinematics_SCARA(const float &a, const float &b); void scara_report_positions(); diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 3d2c34e6d339..f59b7a42a39b 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -121,6 +121,10 @@ Stepper stepper; // Singleton #include "../libs/L6470/L6470_Marlin.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../feature/power_loss_recovery.h" +#endif + // public: #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) @@ -165,13 +169,13 @@ uint8_t Stepper::steps_per_isr; #endif uint8_t Stepper::oversampling_factor; -int32_t Stepper::delta_error[XYZE] = { 0 }; +xyze_long_t Stepper::delta_error{0}; -uint32_t Stepper::advance_dividend[XYZE] = { 0 }, - Stepper::advance_divisor = 0, +xyze_ulong_t Stepper::advance_dividend{0}; +uint32_t 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::accelerate_until, // The count at which to stop accelerating + Stepper::decelerate_after, // The count at which to start decelerating Stepper::step_event_count; // The total event count for the current block #if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) @@ -214,10 +218,9 @@ int32_t Stepper::ticks_nominal = -1; uint32_t Stepper::acc_step_rate; // needed for deceleration start point #endif -volatile int32_t Stepper::endstops_trigsteps[XYZ]; - -volatile int32_t Stepper::count_position[NUM_AXIS] = { 0 }; -int8_t Stepper::count_direction[NUM_AXIS] = { 0, 0, 0, 0 }; +xyz_long_t Stepper::endstops_trigsteps; +xyze_long_t Stepper::count_position{0}; +xyze_int8_t Stepper::count_direction{0}; #define DUAL_ENDSTOP_APPLY_STEP(A,V) \ if (separate_multi_axis) { \ @@ -354,6 +357,10 @@ void Stepper::set_directions() { uint8_t L6470_buf[MAX_L6470 + 1]; // chip command sequence - element 0 not used #endif + #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); + #endif + #define SET_STEP_DIR(A) \ if (motor_direction(_AXIS(A))) { \ A##_APPLY_DIR(INVERT_## A##_DIR, false); \ @@ -382,20 +389,20 @@ void Stepper::set_directions() { // what e-steppers will step. Likely all. Set all. if (motor_direction(E_AXIS)) { MIXER_STEPPER_LOOP(j) REV_E_DIR(j); - count_direction[E_AXIS] = -1; + count_direction.e = -1; } else { MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); - count_direction[E_AXIS] = 1; + count_direction.e = 1; } #else if (motor_direction(E_AXIS)) { REV_E_DIR(stepper_extruder); - count_direction[E_AXIS] = -1; + count_direction.e = -1; } else { NORM_E_DIR(stepper_extruder); - count_direction[E_AXIS] = 1; + count_direction.e = 1; } #endif #endif // !LIN_ADVANCE @@ -422,8 +429,8 @@ void Stepper::set_directions() { #endif // A small delay may be needed after changing direction - #if MINIMUM_STEPPER_DIR_DELAY > 0 - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); + #if MINIMUM_STEPPER_POST_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); #endif } @@ -1451,15 +1458,15 @@ void Stepper::stepper_pulse_phase_isr() { // Pulse Extruders // Tick the E axis, correct error term and update position #if EITHER(LIN_ADVANCE, MIXING_EXTRUDER) - delta_error[E_AXIS] += advance_dividend[E_AXIS]; - if (delta_error[E_AXIS] >= 0) { - count_position[E_AXIS] += count_direction[E_AXIS]; + delta_error.e += advance_dividend.e; + if (delta_error.e >= 0) { + count_position.e += count_direction.e; #if ENABLED(LIN_ADVANCE) - delta_error[E_AXIS] -= advance_divisor; + delta_error.e -= advance_divisor; // Don't step E here - But remember the number of steps to perform motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; #else // !LIN_ADVANCE && MIXING_EXTRUDER - // Don't adjust delta_error[E_AXIS] here! + // Don't adjust delta_error.e here! // Being positive is the criteria for ending the pulse. E_STEP_WRITE(mixer.get_next_stepper(), !INVERT_E_STEP_PIN); #endif @@ -1496,8 +1503,8 @@ void Stepper::stepper_pulse_phase_isr() { #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) - if (delta_error[E_AXIS] >= 0) { - delta_error[E_AXIS] -= advance_divisor; + if (delta_error.e >= 0) { + delta_error.e -= advance_divisor; E_STEP_WRITE(mixer.get_stepper(), INVERT_E_STEP_PIN); } #else // !MIXING_EXTRUDER @@ -1530,7 +1537,7 @@ void Stepper::stepper_pulse_phase_isr() { 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); + uint32_t interval = (STEPPER_TIMER_RATE) / 1000; // If there is a current block if (current_block) { @@ -1652,10 +1659,7 @@ uint32_t Stepper::stepper_block_phase_isr() { // 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], current_block->position[E_AXIS] - ); + _set_position(current_block->position); planner.discard_current_block(); // Try to get a new block @@ -1663,6 +1667,14 @@ uint32_t Stepper::stepper_block_phase_isr() { return interval; // No more queued movements! } + #if HAS_CUTTER + cutter.apply_power(current_block->cutter_power); + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.info.sdpos = current_block->sdpos; + #endif + // Flag all moving axes for proper endstop handling #if IS_CORE @@ -1686,7 +1698,7 @@ uint32_t Stepper::stepper_block_phase_isr() { #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] + #define X_MOVE_TEST !!current_block->steps.a #endif #if CORE_IS_XY || CORE_IS_YZ @@ -1704,7 +1716,7 @@ uint32_t Stepper::stepper_block_phase_isr() { #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] + #define Y_MOVE_TEST !!current_block->steps.b #endif #if CORE_IS_XZ || CORE_IS_YZ @@ -1722,17 +1734,17 @@ uint32_t Stepper::stepper_block_phase_isr() { #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] + #define Z_MOVE_TEST !!current_block->steps.c #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); + //if (!!current_block->steps.e) SBI(axis_bits, E_AXIS); + //if (!!current_block->steps.a) SBI(axis_bits, X_HEAD); + //if (!!current_block->steps.b) SBI(axis_bits, Y_HEAD); + //if (!!current_block->steps.c) SBI(axis_bits, Z_HEAD); axis_did_move = axis_bits; // No acceleration / deceleration time elapsed so far @@ -1755,15 +1767,10 @@ uint32_t Stepper::stepper_block_phase_isr() { step_event_count = current_block->step_event_count << oversampling; // Initialize Bresenham delta errors to 1/2 - delta_error[X_AXIS] = delta_error[Y_AXIS] = delta_error[Z_AXIS] = delta_error[E_AXIS] = -int32_t(step_event_count); + delta_error = -int32_t(step_event_count); - // Calculate Bresenham dividends - 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; - advance_dividend[E_AXIS] = current_block->steps[E_AXIS] << 1; - - // Calculate Bresenham divisor + // Calculate Bresenham dividends and divisors + advance_dividend = current_block->steps << 1; advance_divisor = step_event_count << 1; // No step events completed so far @@ -1828,7 +1835,7 @@ uint32_t Stepper::stepper_block_phase_isr() { // 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(); + if (current_block->steps.z) enable_Z(); #endif // Mark the time_nominal as not calculated yet @@ -1879,19 +1886,28 @@ uint32_t Stepper::stepper_block_phase_isr() { else interval = LA_ADV_NEVER; - #if ENABLED(MIXING_EXTRUDER) - // We don't know which steppers will be stepped because LA loop follows, - // with potentially multiple steps. Set all. - if (LA_steps >= 0) - MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); - else - MIXER_STEPPER_LOOP(j) REV_E_DIR(j); - #else - if (LA_steps >= 0) - NORM_E_DIR(stepper_extruder); - else - REV_E_DIR(stepper_extruder); - #endif + #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); + #endif + + #if ENABLED(MIXING_EXTRUDER) + // We don't know which steppers will be stepped because LA loop follows, + // with potentially multiple steps. Set all. + if (LA_steps >= 0) + MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); + else + MIXER_STEPPER_LOOP(j) REV_E_DIR(j); + #else + if (LA_steps >= 0) + NORM_E_DIR(stepper_extruder); + else + REV_E_DIR(stepper_extruder); + #endif + + // A small delay may be needed after changing direction + #if MINIMUM_STEPPER_POST_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); + #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); @@ -2174,26 +2190,18 @@ void Stepper::_set_position(const int32_t &a, const int32_t &b, const int32_t &c #if CORE_IS_XY // corexy positioning // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html - count_position[A_AXIS] = a + b; - count_position[B_AXIS] = CORESIGN(a - b); - count_position[Z_AXIS] = c; + count_position.set(a + b, CORESIGN(a - b), c); #elif CORE_IS_XZ // corexz planning - count_position[A_AXIS] = a + c; - count_position[Y_AXIS] = b; - count_position[C_AXIS] = CORESIGN(a - c); + count_position.set(a + c, b, CORESIGN(a - c)); #elif CORE_IS_YZ // coreyz planning - count_position[X_AXIS] = a; - count_position[B_AXIS] = b + c; - count_position[C_AXIS] = CORESIGN(b - c); + count_position.set(a, b + c, CORESIGN(b - c)); #else // default non-h-bot planning - count_position[X_AXIS] = a; - count_position[Y_AXIS] = b; - count_position[Z_AXIS] = c; + count_position.set(a, b, c); #endif - count_position[E_AXIS] = e; + count_position.e = e; } /** @@ -2221,24 +2229,21 @@ int32_t Stepper::position(const AxisEnum axis) { // 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 +// is properly canceled void Stepper::endstop_triggered(const AxisEnum axis) { const bool was_enabled = STEPPER_ISR_ENABLED(); if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - #if IS_CORE - - endstops_trigsteps[axis] = 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] - ); - - #else // !COREXY && !COREXZ && !COREYZ - - endstops_trigsteps[axis] = count_position[axis]; - - #endif // !COREXY && !COREXZ && !COREYZ + endstops_trigsteps[axis] = ( + #if IS_CORE + (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] + ) * 0.5f + #else // !IS_CORE + count_position[axis] + #endif + ); // Discard the rest of the move if there is a current block quick_stop(); @@ -2266,38 +2271,28 @@ int32_t Stepper::triggered_position(const AxisEnum axis) { void Stepper::report_positions() { - // 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], - zpos = count_position[Z_AXIS]; + #ifdef __AVR__ + // Protect the access to the position. + const bool was_enabled = STEPPER_ISR_ENABLED(); + if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); + #endif - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + const xyz_long_t pos = count_position; - #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA - SERIAL_ECHOPGM(MSG_COUNT_A); - #else - SERIAL_ECHOPGM(MSG_COUNT_X); + #ifdef __AVR__ + if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); #endif - SERIAL_ECHO(xpos); - #if CORE_IS_XY || CORE_IS_YZ || ENABLED(DELTA) || IS_SCARA - SERIAL_ECHOPGM(" B:"); + #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA + SERIAL_ECHOPAIR(MSG_COUNT_A, pos.x, " B:", pos.y); #else - SERIAL_ECHOPGM(" Y:"); + SERIAL_ECHOPAIR(MSG_COUNT_X, pos.x, " Y:", pos.y); #endif - SERIAL_ECHO(ypos); - #if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA) - SERIAL_ECHOPGM(" C:"); + SERIAL_ECHOLNPAIR(" C:", pos.z); #else - SERIAL_ECHOPGM(" Z:"); + SERIAL_ECHOLNPAIR(" Z:", pos.z); #endif - SERIAL_ECHO(zpos); - - SERIAL_EOL(); } #if ENABLED(BABYSTEPPING) @@ -2316,7 +2311,7 @@ void Stepper::report_positions() { #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP)) #define _ENABLE(AXIS) enable_## AXIS() - #define _READ_DIR(AXIS) AXIS ##_DIR_READ + #define _READ_DIR(AXIS) AXIS ##_DIR_READ() #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) @@ -2339,8 +2334,9 @@ void Stepper::report_positions() { #define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \ const uint8_t old_dir = _READ_DIR(AXIS); \ _ENABLE(AXIS); \ + DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); \ _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); \ + DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); \ _SAVE_START; \ _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ _PULSE_WAIT; \ @@ -2404,16 +2400,20 @@ void Stepper::report_positions() { enable_Y(); enable_Z(); - const uint8_t old_x_dir_pin = X_DIR_READ, - old_y_dir_pin = Y_DIR_READ, - old_z_dir_pin = Z_DIR_READ; + #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); + #endif + + const uint8_t old_x_dir_pin = X_DIR_READ(), + old_y_dir_pin = Y_DIR_READ(), + old_z_dir_pin = Z_DIR_READ(); X_DIR_WRITE(INVERT_X_DIR ^ z_direction); 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); + #if MINIMUM_STEPPER_POST_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); #endif _SAVE_START; @@ -2584,9 +2584,9 @@ void Stepper::report_positions() { #endif -#else +#else // PRINTRBOARD_G2 - #include "../HAL/HAL_DUE/G2_PWM.h" + #include HAL_PATH(../HAL, fastio/G2_PWM.h) #endif diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index eca4a75c1757..1ab455bd06dc 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -43,6 +43,12 @@ #include "../inc/MarlinConfig.h" +#include "planner.h" +#include "stepper/indirection.h" +#ifdef __AVR__ + #include "speed_lookuptable.h" +#endif + // Disable multiple steps per ISR //#define DISABLE_MULTI_STEPPING @@ -164,7 +170,7 @@ // 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 -#if HAS_DRIVER(LV8729) +#if HAS_DRIVER(LV8729) && MINIMUM_STEPPER_PULSE == 0 #define MIN_PULSE_TICKS ((((PULSE_TIMER_TICKS_PER_US) + 1) / 2) + ((MIN_ISR_START_LOOP_CYCLES) / uint32_t(PULSE_TIMER_PRESCALE))) #else #define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * uint32_t(MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / uint32_t(PULSE_TIMER_PRESCALE))) @@ -217,16 +223,6 @@ // // Stepper class definition // - -#include "stepper_indirection.h" - -#ifdef __AVR__ - #include "speed_lookuptable.h" -#endif - -#include "planner.h" -#include "../core/language.h" - class Stepper { public: @@ -282,9 +278,9 @@ class Stepper { #endif // Delta error variables for the Bresenham line tracer - static int32_t delta_error[XYZE]; - static uint32_t advance_dividend[XYZE], - advance_divisor, + static xyze_long_t delta_error; + static xyze_ulong_t advance_dividend; + static uint32_t 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 @@ -321,24 +317,27 @@ class Stepper { static uint32_t acc_step_rate; // needed for deceleration start point #endif - static volatile int32_t endstops_trigsteps[XYZ]; + // + // Exact steps at which an endstop was triggered + // + static xyz_long_t endstops_trigsteps; // // Positions of stepper motors, in step units // - static volatile int32_t count_position[NUM_AXIS]; + static xyze_long_t count_position; // // Current direction of stepper motors (+1 or -1) // - static int8_t count_direction[NUM_AXIS]; + static xyze_int8_t count_direction; public: // // Constructor / initializer // - Stepper() { }; + Stepper() {}; // Initialize stepper hardware static void init(); @@ -383,13 +382,11 @@ class Stepper { // The extruder associated to the last movement FORCE_INLINE static uint8_t movement_extruder() { - return - #if ENABLED(MIXING_EXTRUDER) || EXTRUDERS < 2 - 0 - #else - last_moved_extruder + return (0 + #if EXTRUDERS > 1 && DISABLED(MIXING_EXTRUDER) + + last_moved_extruder #endif - ; + ); } // Handle a triggered endstop @@ -444,8 +441,9 @@ class Stepper { _set_position(a, b, c, e); if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); } + static inline void set_position(const xyze_long_t &abce) { set_position(abce.a, abce.b, abce.c, abce.e); } - static inline void set_position(const AxisEnum a, const int32_t &v) { + static inline void set_axis_position(const AxisEnum a, const int32_t &v) { planner.synchronize(); #ifdef __AVR__ @@ -470,6 +468,7 @@ class Stepper { // Set the current position in steps static void _set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e); + FORCE_INLINE static void _set_position(const abce_long_t &spos) { _set_position(spos.a, spos.b, spos.c, spos.e); } FORCE_INLINE static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t scale, uint8_t* loops) { uint32_t timer; diff --git a/Marlin/src/module/stepper/L6470.cpp b/Marlin/src/module/stepper/L6470.cpp new file mode 100644 index 000000000000..d682193aa985 --- /dev/null +++ b/Marlin/src/module/stepper/L6470.cpp @@ -0,0 +1,143 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * stepper/L6470.cpp + * Stepper driver indirection for L6470 drivers + */ + +#include "../../inc/MarlinConfig.h" + +#if HAS_DRIVER(L6470) + +#include "L6470.h" + +#define _L6470_DEFINE(ST) L6470 stepper##ST((const int)L6470_CHAIN_SS_PIN) + +// L6470 Stepper objects +#if AXIS_DRIVER_TYPE_X(L6470) + _L6470_DEFINE(X); +#endif +#if AXIS_DRIVER_TYPE_X2(L6470) + _L6470_DEFINE(X2); +#endif +#if AXIS_DRIVER_TYPE_Y(L6470) + _L6470_DEFINE(Y); +#endif +#if AXIS_DRIVER_TYPE_Y2(L6470) + _L6470_DEFINE(Y2); +#endif +#if AXIS_DRIVER_TYPE_Z(L6470) + _L6470_DEFINE(Z); +#endif +#if AXIS_DRIVER_TYPE_Z2(L6470) + _L6470_DEFINE(Z2); +#endif +#if AXIS_DRIVER_TYPE_Z3(L6470) + _L6470_DEFINE(Z3); +#endif +#if AXIS_DRIVER_TYPE_E0(L6470) + _L6470_DEFINE(E0); +#endif +#if AXIS_DRIVER_TYPE_E1(L6470) + _L6470_DEFINE(E1); +#endif +#if AXIS_DRIVER_TYPE_E2(L6470) + _L6470_DEFINE(E2); +#endif +#if AXIS_DRIVER_TYPE_E3(L6470) + _L6470_DEFINE(E3); +#endif +#if AXIS_DRIVER_TYPE_E4(L6470) + _L6470_DEFINE(E4); +#endif +#if AXIS_DRIVER_TYPE_E5(L6470) + _L6470_DEFINE(E5); +#endif + +// not using L6470 library's init command because it +// briefly sends power to the steppers + +#define _L6470_INIT_CHIP(Q) do{ \ + stepper##Q.resetDev(); \ + stepper##Q.softFree(); \ + stepper##Q.SetParam(L6470_CONFIG, CONFIG_PWM_DIV_1 \ + | CONFIG_PWM_MUL_2 \ + | CONFIG_SR_290V_us \ + | CONFIG_OC_SD_DISABLE \ + | CONFIG_VS_COMP_DISABLE \ + | CONFIG_SW_HARD_STOP \ + | CONFIG_INT_16MHZ); \ + stepper##Q.SetParam(L6470_KVAL_RUN, 0xFF); \ + stepper##Q.SetParam(L6470_KVAL_ACC, 0xFF); \ + stepper##Q.SetParam(L6470_KVAL_DEC, 0xFF); \ + stepper##Q.setMicroSteps(Q##_MICROSTEPS); \ + stepper##Q.setOverCurrent(Q##_OVERCURRENT); \ + stepper##Q.setStallCurrent(Q##_STALLCURRENT); \ + stepper##Q.SetParam(L6470_KVAL_HOLD, Q##_MAX_VOLTAGE); \ + stepper##Q.SetParam(L6470_ABS_POS, 0); \ + stepper##Q.getStatus(); \ +}while(0) + +void L6470_Marlin::init_to_defaults() { + #if AXIS_DRIVER_TYPE_X(L6470) + _L6470_INIT_CHIP(X); + #endif + #if AXIS_DRIVER_TYPE_X2(L6470) + _L6470_INIT_CHIP(X2); + #endif + #if AXIS_DRIVER_TYPE_Y(L6470) + _L6470_INIT_CHIP(Y); + #endif + #if AXIS_DRIVER_TYPE_Y2(L6470) + _L6470_INIT_CHIP(Y2); + #endif + #if AXIS_DRIVER_TYPE_Z(L6470) + _L6470_INIT_CHIP(Z); + #endif + #if AXIS_DRIVER_TYPE_Z2(L6470) + _L6470_INIT_CHIP(Z2); + #endif + #if AXIS_DRIVER_TYPE_Z3(L6470) + _L6470_INIT_CHIP(Z3); + #endif + #if AXIS_DRIVER_TYPE_E0(L6470) + _L6470_INIT_CHIP(E0); + #endif + #if AXIS_DRIVER_TYPE_E1(L6470) + _L6470_INIT_CHIP(E1); + #endif + #if AXIS_DRIVER_TYPE_E2(L6470) + _L6470_INIT_CHIP(E2); + #endif + #if AXIS_DRIVER_TYPE_E3(L6470) + _L6470_INIT_CHIP(E3); + #endif + #if AXIS_DRIVER_TYPE_E4(L6470) + _L6470_INIT_CHIP(E4); + #endif + #if AXIS_DRIVER_TYPE_E5(L6470) + _L6470_INIT_CHIP(E5); + #endif +} + +#endif // L6470 diff --git a/Marlin/src/module/stepper/L6470.h b/Marlin/src/module/stepper/L6470.h new file mode 100644 index 000000000000..8c731a80424a --- /dev/null +++ b/Marlin/src/module/stepper/L6470.h @@ -0,0 +1,176 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * stepper/L6470.h + * Stepper driver indirection for L6470 drivers + */ + +#include "../../inc/MarlinConfig.h" +#include "../../libs/L6470/L6470_Marlin.h" + +// L6470 has STEP on normal pins, but DIR/ENABLE via SPI +#define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L6470_dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) + +// X Stepper +#if AXIS_DRIVER_TYPE_X(L6470) + extern L6470 stepperX; + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) NOOP + #define X_ENABLE_READ() (stepperX.getStatus() & STATUS_HIZ) + #define X_DIR_INIT NOOP + #define X_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X) + #define X_DIR_READ() (stepperX.getStatus() & STATUS_DIR) +#endif + +// Y Stepper +#if AXIS_DRIVER_TYPE_Y(L6470) + extern L6470 stepperY; + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) NOOP + #define Y_ENABLE_READ() (stepperY.getStatus() & STATUS_HIZ) + #define Y_DIR_INIT NOOP + #define Y_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y) + #define Y_DIR_READ() (stepperY.getStatus() & STATUS_DIR) +#endif + +// Z Stepper +#if AXIS_DRIVER_TYPE_Z(L6470) + extern L6470 stepperZ; + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) NOOP + #define Z_ENABLE_READ() (stepperZ.getStatus() & STATUS_HIZ) + #define Z_DIR_INIT NOOP + #define Z_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z) + #define Z_DIR_READ() (stepperZ.getStatus() & STATUS_DIR) +#endif + +// X2 Stepper +#if HAS_X2_ENABLE && AXIS_DRIVER_TYPE_X2(L6470) + extern L6470 stepperX2; + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) NOOP + #define X2_ENABLE_READ() (stepperX2.getStatus() & STATUS_HIZ) + #define X2_DIR_INIT NOOP + #define X2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X2) + #define X2_DIR_READ() (stepperX2.getStatus() & STATUS_DIR) +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE && AXIS_DRIVER_TYPE_Y2(L6470) + extern L6470 stepperY2; + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) NOOP + #define Y2_ENABLE_READ() (stepperY2.getStatus() & STATUS_HIZ) + #define Y2_DIR_INIT NOOP + #define Y2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y2) + #define Y2_DIR_READ() (stepperY2.getStatus() & STATUS_DIR) +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE && AXIS_DRIVER_TYPE_Z2(L6470) + extern L6470 stepperZ2; + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) NOOP + #define Z2_ENABLE_READ() (stepperZ2.getStatus() & STATUS_HIZ) + #define Z2_DIR_INIT NOOP + #define Z2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z2) + #define Z2_DIR_READ() (stepperZ2.getStatus() & STATUS_DIR) +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE && AXIS_DRIVER_TYPE_Z3(L6470) + extern L6470 stepperZ3; + #define Z3_ENABLE_INIT NOOP + #define Z3_ENABLE_WRITE(STATE) NOOP + #define Z3_ENABLE_READ() (stepperZ3.getStatus() & STATUS_HIZ) + #define Z3_DIR_INIT NOOP + #define Z3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z3) + #define Z3_DIR_READ() (stepperZ3.getStatus() & STATUS_DIR) +#endif + +// E0 Stepper +#if AXIS_DRIVER_TYPE_E0(L6470) + extern L6470 stepperE0; + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) NOOP + #define E0_ENABLE_READ() (stepperE0.getStatus() & STATUS_HIZ) + #define E0_DIR_INIT NOOP + #define E0_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E0) + #define E0_DIR_READ() (stepperE0.getStatus() & STATUS_DIR) +#endif + +// E1 Stepper +#if AXIS_DRIVER_TYPE_E1(L6470) + extern L6470 stepperE1; + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) NOOP + #define E1_ENABLE_READ() (stepperE1.getStatus() & STATUS_HIZ) + #define E1_DIR_INIT NOOP + #define E1_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E1) + #define E1_DIR_READ() (stepperE1.getStatus() & STATUS_DIR) +#endif + +// E2 Stepper +#if AXIS_DRIVER_TYPE_E2(L6470) + extern L6470 stepperE2; + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) NOOP + #define E2_ENABLE_READ() (stepperE2.getStatus() & STATUS_HIZ) + #define E2_DIR_INIT NOOP + #define E2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E2) + #define E2_DIR_READ() (stepperE2.getStatus() & STATUS_DIR) +#endif + +// E3 Stepper +#if AXIS_DRIVER_TYPE_E3(L6470) + extern L6470 stepperE3; + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) NOOP + #define E3_ENABLE_READ() (stepperE3.getStatus() & STATUS_HIZ) + #define E3_DIR_INIT NOOP + #define E3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E3) + #define E3_DIR_READ() (stepperE3.getStatus() & STATUS_DIR) +#endif + +// E4 Stepper +#if AXIS_DRIVER_TYPE_E4(L6470) + extern L6470 stepperE4; + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) NOOP + #define E4_ENABLE_READ() (stepperE4.getStatus() & STATUS_HIZ) + #define E4_DIR_INIT NOOP + #define E4_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E4) + #define E4_DIR_READ() (stepperE4.getStatus() & STATUS_DIR) +#endif + +// E5 Stepper +#if AXIS_DRIVER_TYPE_E5(L6470) + extern L6470 stepperE5; + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) NOOP + #define E5_ENABLE_READ() (stepperE5.getStatus() & STATUS_HIZ) + #define E5_DIR_INIT NOOP + #define E5_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E5) + #define E5_DIR_READ() (stepperE5.getStatus() & STATUS_DIR) +#endif diff --git a/Marlin/src/module/stepper/TMC26X.cpp b/Marlin/src/module/stepper/TMC26X.cpp new file mode 100644 index 000000000000..8acb735c9db6 --- /dev/null +++ b/Marlin/src/module/stepper/TMC26X.cpp @@ -0,0 +1,126 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * stepper/TMC26X.cpp + * Stepper driver indirection for TMC26X drivers + */ + +#include "../../inc/MarlinConfig.h" + +// +// TMC26X Driver objects and inits +// +#if HAS_DRIVER(TMC26X) + +#include "TMC26X.h" + +#define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR) + +#if AXIS_DRIVER_TYPE_X(TMC26X) + _TMC26X_DEFINE(X); +#endif +#if AXIS_DRIVER_TYPE_X2(TMC26X) + _TMC26X_DEFINE(X2); +#endif +#if AXIS_DRIVER_TYPE_Y(TMC26X) + _TMC26X_DEFINE(Y); +#endif +#if AXIS_DRIVER_TYPE_Y2(TMC26X) + _TMC26X_DEFINE(Y2); +#endif +#if AXIS_DRIVER_TYPE_Z(TMC26X) + _TMC26X_DEFINE(Z); +#endif +#if AXIS_DRIVER_TYPE_Z2(TMC26X) + _TMC26X_DEFINE(Z2); +#endif +#if AXIS_DRIVER_TYPE_Z3(TMC26X) + _TMC26X_DEFINE(Z3); +#endif +#if AXIS_DRIVER_TYPE_E0(TMC26X) + _TMC26X_DEFINE(E0); +#endif +#if AXIS_DRIVER_TYPE_E1(TMC26X) + _TMC26X_DEFINE(E1); +#endif +#if AXIS_DRIVER_TYPE_E2(TMC26X) + _TMC26X_DEFINE(E2); +#endif +#if AXIS_DRIVER_TYPE_E3(TMC26X) + _TMC26X_DEFINE(E3); +#endif +#if AXIS_DRIVER_TYPE_E4(TMC26X) + _TMC26X_DEFINE(E4); +#endif +#if AXIS_DRIVER_TYPE_E5(TMC26X) + _TMC26X_DEFINE(E5); +#endif + +#define _TMC26X_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); + #endif + #if AXIS_DRIVER_TYPE_X2(TMC26X) + _TMC26X_INIT(X2); + #endif + #if AXIS_DRIVER_TYPE_Y(TMC26X) + _TMC26X_INIT(Y); + #endif + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + _TMC26X_INIT(Y2); + #endif + #if AXIS_DRIVER_TYPE_Z(TMC26X) + _TMC26X_INIT(Z); + #endif + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + _TMC26X_INIT(Z2); + #endif + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + _TMC26X_INIT(Z3); + #endif + #if AXIS_DRIVER_TYPE_E0(TMC26X) + _TMC26X_INIT(E0); + #endif + #if AXIS_DRIVER_TYPE_E1(TMC26X) + _TMC26X_INIT(E1); + #endif + #if AXIS_DRIVER_TYPE_E2(TMC26X) + _TMC26X_INIT(E2); + #endif + #if AXIS_DRIVER_TYPE_E3(TMC26X) + _TMC26X_INIT(E3); + #endif + #if AXIS_DRIVER_TYPE_E4(TMC26X) + _TMC26X_INIT(E4); + #endif + #if AXIS_DRIVER_TYPE_E5(TMC26X) + _TMC26X_INIT(E5); + #endif +} + +#endif // TMC26X diff --git a/Marlin/src/module/stepper/TMC26X.h b/Marlin/src/module/stepper/TMC26X.h new file mode 100644 index 000000000000..a1c270482320 --- /dev/null +++ b/Marlin/src/module/stepper/TMC26X.h @@ -0,0 +1,144 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * stepper/TMC26X.h + * Stepper driver indirection for TMC26X drivers + */ + +#include "../../inc/MarlinConfig.h" + +// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI + +#include +#if defined(STM32GENERIC) && defined(STM32F7) + #include "../../HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h" +#else + #include +#endif + +void tmc26x_init_to_defaults(); + +// X Stepper +#if AXIS_DRIVER_TYPE_X(TMC26X) + extern TMC26XStepper stepperX; + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) + #define X_ENABLE_READ() stepperX.isEnabled() +#endif + +// Y Stepper +#if AXIS_DRIVER_TYPE_Y(TMC26X) + extern TMC26XStepper stepperY; + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) + #define Y_ENABLE_READ() stepperY.isEnabled() +#endif + +// Z Stepper +#if AXIS_DRIVER_TYPE_Z(TMC26X) + extern TMC26XStepper stepperZ; + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) + #define Z_ENABLE_READ() stepperZ.isEnabled() +#endif + +// X2 Stepper +#if HAS_X2_ENABLE && AXIS_DRIVER_TYPE_X2(TMC26X) + extern TMC26XStepper stepperX2; + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) + #define X2_ENABLE_READ() stepperX2.isEnabled() +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE && AXIS_DRIVER_TYPE_Y2(TMC26X) + extern TMC26XStepper stepperY2; + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) + #define Y2_ENABLE_READ() stepperY2.isEnabled() +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE && AXIS_DRIVER_TYPE_Z2(TMC26X) + extern TMC26XStepper stepperZ2; + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) + #define Z2_ENABLE_READ() stepperZ2.isEnabled() +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE && ENABLED(Z3_IS_TMC26X) + extern TMC26XStepper stepperZ3; + #define Z3_ENABLE_INIT NOOP + #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE) + #define Z3_ENABLE_READ() stepperZ3.isEnabled() +#endif + +// E0 Stepper +#if AXIS_DRIVER_TYPE_E0(TMC26X) + extern TMC26XStepper stepperE0; + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) + #define E0_ENABLE_READ() stepperE0.isEnabled() +#endif + +// E1 Stepper +#if AXIS_DRIVER_TYPE_E1(TMC26X) + extern TMC26XStepper stepperE1; + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) + #define E1_ENABLE_READ() stepperE1.isEnabled() +#endif + +// E2 Stepper +#if AXIS_DRIVER_TYPE_E2(TMC26X) + extern TMC26XStepper stepperE2; + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) + #define E2_ENABLE_READ() stepperE2.isEnabled() +#endif + +// E3 Stepper +#if AXIS_DRIVER_TYPE_E3(TMC26X) + extern TMC26XStepper stepperE3; + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) + #define E3_ENABLE_READ() stepperE3.isEnabled() +#endif + +// E4 Stepper +#if AXIS_DRIVER_TYPE_E4(TMC26X) + extern TMC26XStepper stepperE4; + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) + #define E4_ENABLE_READ() stepperE4.isEnabled() +#endif + +// E5 Stepper +#if AXIS_DRIVER_TYPE_E5(TMC26X) + extern TMC26XStepper stepperE5; + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE) + #define E5_ENABLE_READ() stepperE5.isEnabled() +#endif diff --git a/Marlin/src/module/stepper/indirection.cpp b/Marlin/src/module/stepper/indirection.cpp new file mode 100644 index 000000000000..2037c1b84e16 --- /dev/null +++ b/Marlin/src/module/stepper/indirection.cpp @@ -0,0 +1,53 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * stepper/indirection.cpp + * + * Stepper motor driver indirection to allow some stepper functions to + * be done via SPI/I2c instead of direct pin manipulation. + * + * Copyright (c) 2015 Dominik Wenger + */ + +#include "../../inc/MarlinConfig.h" +#include "indirection.h" + +void restore_stepper_drivers() { + #if HAS_TRINAMIC + restore_trinamic_drivers(); + #endif +} + +void reset_stepper_drivers() { + #if HAS_DRIVER(TMC26X) + tmc26x_init_to_defaults(); + #endif + + #if HAS_DRIVER(L6470) + L6470.init_to_defaults(); + #endif + + #if HAS_TRINAMIC + reset_trinamic_drivers(); + #endif +} diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h new file mode 100644 index 000000000000..ed87fde83cb8 --- /dev/null +++ b/Marlin/src/module/stepper/indirection.h @@ -0,0 +1,399 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * stepper/indirection.h + * + * Stepper motor driver indirection to allow some stepper functions to + * be done via SPI/I2c instead of direct pin manipulation. + * + * Copyright (c) 2015 Dominik Wenger + */ + +#include "../../inc/MarlinConfig.h" + +#if HAS_DRIVER(L6470) + #include "L6470.h" +#endif + +#if HAS_DRIVER(TMC26X) + #include "TMC26X.h" +#endif + +#if HAS_TRINAMIC + #include "trinamic.h" +#endif + +void restore_stepper_drivers(); // Called by PSU_ON +void reset_stepper_drivers(); // Called by settings.load / settings.reset + +// X Stepper +#ifndef X_ENABLE_INIT + #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN) + #define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE) + #define X_ENABLE_READ() READ(X_ENABLE_PIN) +#endif +#ifndef X_DIR_INIT + #define X_DIR_INIT SET_OUTPUT(X_DIR_PIN) + #define X_DIR_WRITE(STATE) WRITE(X_DIR_PIN,STATE) + #define X_DIR_READ() READ(X_DIR_PIN) +#endif +#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN) +#ifndef X_STEP_WRITE + #define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE) +#endif +#define X_STEP_READ READ(X_STEP_PIN) + +// Y Stepper +#ifndef Y_ENABLE_INIT + #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN) + #define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE) + #define Y_ENABLE_READ() READ(Y_ENABLE_PIN) +#endif +#ifndef Y_DIR_INIT + #define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN) + #define Y_DIR_WRITE(STATE) WRITE(Y_DIR_PIN,STATE) + #define Y_DIR_READ() READ(Y_DIR_PIN) +#endif +#define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN) +#ifndef Y_STEP_WRITE + #define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE) +#endif +#define Y_STEP_READ READ(Y_STEP_PIN) + +// Z Stepper +#ifndef Z_ENABLE_INIT + #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN) + #define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE) + #define Z_ENABLE_READ() READ(Z_ENABLE_PIN) +#endif +#ifndef Z_DIR_INIT + #define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN) + #define Z_DIR_WRITE(STATE) WRITE(Z_DIR_PIN,STATE) + #define Z_DIR_READ() READ(Z_DIR_PIN) +#endif +#define Z_STEP_INIT SET_OUTPUT(Z_STEP_PIN) +#ifndef Z_STEP_WRITE + #define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE) +#endif +#define Z_STEP_READ READ(Z_STEP_PIN) + +// X2 Stepper +#if HAS_X2_ENABLE + #ifndef X2_ENABLE_INIT + #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) + #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE) + #define X2_ENABLE_READ() READ(X2_ENABLE_PIN) + #endif + #ifndef X2_DIR_INIT + #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN) + #define X2_DIR_WRITE(STATE) WRITE(X2_DIR_PIN,STATE) + #define X2_DIR_READ() READ(X2_DIR_PIN) + #endif + #define X2_STEP_INIT SET_OUTPUT(X2_STEP_PIN) + #ifndef X2_STEP_WRITE + #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE) + #endif + #define X2_STEP_READ READ(X2_STEP_PIN) +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE + #ifndef Y2_ENABLE_INIT + #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN) + #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE) + #define Y2_ENABLE_READ() READ(Y2_ENABLE_PIN) + #endif + #ifndef Y2_DIR_INIT + #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN) + #define Y2_DIR_WRITE(STATE) WRITE(Y2_DIR_PIN,STATE) + #define Y2_DIR_READ() READ(Y2_DIR_PIN) + #endif + #define Y2_STEP_INIT SET_OUTPUT(Y2_STEP_PIN) + #ifndef Y2_STEP_WRITE + #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE) + #endif + #define Y2_STEP_READ READ(Y2_STEP_PIN) +#else + #define Y2_DIR_WRITE(STATE) NOOP +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE + #ifndef Z2_ENABLE_INIT + #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN) + #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE) + #define Z2_ENABLE_READ() READ(Z2_ENABLE_PIN) + #endif + #ifndef Z2_DIR_INIT + #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN) + #define Z2_DIR_WRITE(STATE) WRITE(Z2_DIR_PIN,STATE) + #define Z2_DIR_READ() READ(Z2_DIR_PIN) + #endif + #define Z2_STEP_INIT SET_OUTPUT(Z2_STEP_PIN) + #ifndef Z2_STEP_WRITE + #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE) + #endif + #define Z2_STEP_READ READ(Z2_STEP_PIN) +#else + #define Z2_DIR_WRITE(STATE) NOOP +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE + #ifndef Z3_ENABLE_INIT + #define Z3_ENABLE_INIT SET_OUTPUT(Z3_ENABLE_PIN) + #define Z3_ENABLE_WRITE(STATE) WRITE(Z3_ENABLE_PIN,STATE) + #define Z3_ENABLE_READ() READ(Z3_ENABLE_PIN) + #endif + #ifndef Z3_DIR_INIT + #define Z3_DIR_INIT SET_OUTPUT(Z3_DIR_PIN) + #define Z3_DIR_WRITE(STATE) WRITE(Z3_DIR_PIN,STATE) + #define Z3_DIR_READ() READ(Z3_DIR_PIN) + #endif + #define Z3_STEP_INIT SET_OUTPUT(Z3_STEP_PIN) + #ifndef Z3_STEP_WRITE + #define Z3_STEP_WRITE(STATE) WRITE(Z3_STEP_PIN,STATE) + #endif + #define Z3_STEP_READ READ(Z3_STEP_PIN) +#else + #define Z3_DIR_WRITE(STATE) NOOP +#endif + +// E0 Stepper +#ifndef E0_ENABLE_INIT + #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) + #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE) + #define E0_ENABLE_READ() READ(E0_ENABLE_PIN) +#endif +#ifndef E0_DIR_INIT + #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) + #define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE) + #define E0_DIR_READ() READ(E0_DIR_PIN) +#endif +#define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN) +#ifndef E0_STEP_WRITE + #define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) +#endif +#define E0_STEP_READ READ(E0_STEP_PIN) + +// E1 Stepper +#ifndef E1_ENABLE_INIT + #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) + #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE) + #define E1_ENABLE_READ() READ(E1_ENABLE_PIN) +#endif +#ifndef E1_DIR_INIT + #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) + #define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE) + #define E1_DIR_READ() READ(E1_DIR_PIN) +#endif +#define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN) +#ifndef E1_STEP_WRITE + #define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) +#endif +#define E1_STEP_READ READ(E1_STEP_PIN) + +// E2 Stepper +#ifndef E2_ENABLE_INIT + #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) + #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE) + #define E2_ENABLE_READ() READ(E2_ENABLE_PIN) +#endif +#ifndef E2_DIR_INIT + #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) + #define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE) + #define E2_DIR_READ() READ(E2_DIR_PIN) +#endif +#define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN) +#ifndef E2_STEP_WRITE + #define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) +#endif +#define E2_STEP_READ READ(E2_STEP_PIN) + +// E3 Stepper +#ifndef E3_ENABLE_INIT + #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) + #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) + #define E3_ENABLE_READ() READ(E3_ENABLE_PIN) +#endif +#ifndef E3_DIR_INIT + #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) + #define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE) + #define E3_DIR_READ() READ(E3_DIR_PIN) +#endif +#define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN) +#ifndef E3_STEP_WRITE + #define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) +#endif +#define E3_STEP_READ READ(E3_STEP_PIN) + +// E4 Stepper +#ifndef E4_ENABLE_INIT + #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN) + #define E4_ENABLE_WRITE(STATE) WRITE(E4_ENABLE_PIN,STATE) + #define E4_ENABLE_READ() READ(E4_ENABLE_PIN) +#endif +#ifndef E4_DIR_INIT + #define E4_DIR_INIT SET_OUTPUT(E4_DIR_PIN) + #define E4_DIR_WRITE(STATE) WRITE(E4_DIR_PIN,STATE) + #define E4_DIR_READ() READ(E4_DIR_PIN) +#endif +#define E4_STEP_INIT SET_OUTPUT(E4_STEP_PIN) +#ifndef E4_STEP_WRITE + #define E4_STEP_WRITE(STATE) WRITE(E4_STEP_PIN,STATE) +#endif +#define E4_STEP_READ READ(E4_STEP_PIN) + +// E5 Stepper +#ifndef E5_ENABLE_INIT + #define E5_ENABLE_INIT SET_OUTPUT(E5_ENABLE_PIN) + #define E5_ENABLE_WRITE(STATE) WRITE(E5_ENABLE_PIN,STATE) + #define E5_ENABLE_READ() READ(E5_ENABLE_PIN) +#endif +#ifndef E5_DIR_INIT + #define E5_DIR_INIT SET_OUTPUT(E5_DIR_PIN) + #define E5_DIR_WRITE(STATE) WRITE(E5_DIR_PIN,STATE) + #define E5_DIR_READ() READ(E5_DIR_PIN) +#endif +#define E5_STEP_INIT SET_OUTPUT(E5_STEP_PIN) +#ifndef E5_STEP_WRITE + #define E5_STEP_WRITE(STATE) WRITE(E5_STEP_PIN,STATE) +#endif +#define E5_STEP_READ READ(E5_STEP_PIN) + +/** + * Extruder indirection for the single E axis + */ +#if ENABLED(SWITCHING_EXTRUDER) // One stepper driver per two extruders, reversed on odd index + #if EXTRUDERS > 5 + #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); case 5: 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); case 5: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) + #elif 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) + #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) + #endif +#elif ENABLED(PRUSA_MMU2) + #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) + +#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 > 1 + + #if E_STEPPERS > 5 + #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); case 5: E5_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); case 5: E5_DIR_WRITE(!INVERT_E5_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); case 5: E5_DIR_WRITE( INVERT_E5_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) + #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) + #endif + + #if HAS_DUPLICATION_MODE + + #if ENABLED(MULTI_NOZZLE_DUPLICATION) + #define _DUPE(N,T,V) do{ if (TEST(duplication_e_mask, N)) E##N##_##T##_WRITE(V); }while(0) + #else + #define _DUPE(N,T,V) E##N##_##T##_WRITE(V) + #endif + + #define NDIR(N) _DUPE(N,DIR,!INVERT_E##N##_DIR) + #define RDIR(N) _DUPE(N,DIR, INVERT_E##N##_DIR) + + #define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { DUPE(STEP,V); } else _E_STEP_WRITE(E,V); }while(0) + + #if E_STEPPERS > 2 + #if E_STEPPERS > 5 + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); _DUPE(5,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); NDIR(5); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); RDIR(5); } else _REV_E_DIR(E); }while(0) + #elif E_STEPPERS > 4 + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); } else _REV_E_DIR(E); }while(0) + #elif E_STEPPERS > 3 + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); } else _REV_E_DIR(E); }while(0) + #else + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); } else _REV_E_DIR(E); }while(0) + #endif + #else + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); } else _REV_E_DIR(E); }while(0) + #endif + + #else + + #define E_STEP_WRITE(E,V) _E_STEP_WRITE(E,V) + #define NORM_E_DIR(E) _NORM_E_DIR(E) + #define REV_E_DIR(E) _REV_E_DIR(E) + + #endif + +#elif E_STEPPERS + #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) + +#else + #define E_STEP_WRITE(E,V) NOOP + #define NORM_E_DIR(E) NOOP + #define REV_E_DIR(E) NOOP + +#endif diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper/trinamic.cpp similarity index 59% rename from Marlin/src/module/stepper_indirection.cpp rename to Marlin/src/module/stepper/trinamic.cpp index 362ed01ba90e..24e3d8cce325 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -21,204 +21,94 @@ */ /** - * stepper_indirection.cpp - * - * Stepper motor driver indirection to allow some stepper functions to - * be done via SPI/I2c instead of direct pin manipulation. - * - * Copyright (c) 2015 Dominik Wenger + * stepper/trinamic.cpp + * Stepper driver indirection for Trinamic */ -#include "stepper_indirection.h" - -#include "../inc/MarlinConfig.h" - -#include "stepper.h" - -#if HAS_DRIVER(L6470) - #include "L6470/L6470_Marlin.h" -#endif - -// -// TMC26X Driver objects and inits -// -#if HAS_DRIVER(TMC26X) - #include - - #ifdef STM32F7 - #include "../HAL/HAL_STM32F7/TMC2660.h" - #else - #include - #endif - - #define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR) - - #if AXIS_DRIVER_TYPE_X(TMC26X) - _TMC26X_DEFINE(X); - #endif - #if AXIS_DRIVER_TYPE_X2(TMC26X) - _TMC26X_DEFINE(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(TMC26X) - _TMC26X_DEFINE(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(TMC26X) - _TMC26X_DEFINE(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(TMC26X) - _TMC26X_DEFINE(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(TMC26X) - _TMC26X_DEFINE(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(TMC26X) - _TMC26X_DEFINE(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(TMC26X) - _TMC26X_DEFINE(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(TMC26X) - _TMC26X_DEFINE(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(TMC26X) - _TMC26X_DEFINE(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(TMC26X) - _TMC26X_DEFINE(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(TMC26X) - _TMC26X_DEFINE(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(TMC26X) - _TMC26X_DEFINE(E5); - #endif +#include "../../inc/MarlinConfig.h" - #define _TMC26X_INIT(A) do{ \ - stepper##A.setMicrosteps(A##_MICROSTEPS); \ - stepper##A.start(); \ - }while(0) +#if HAS_TRINAMIC - void tmc26x_init_to_defaults() { - #if AXIS_DRIVER_TYPE_X(TMC26X) - _TMC26X_INIT(X); - #endif - #if AXIS_DRIVER_TYPE_X2(TMC26X) - _TMC26X_INIT(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(TMC26X) - _TMC26X_INIT(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(TMC26X) - _TMC26X_INIT(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(TMC26X) - _TMC26X_INIT(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(TMC26X) - _TMC26X_INIT(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(TMC26X) - _TMC26X_INIT(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(TMC26X) - _TMC26X_INIT(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(TMC26X) - _TMC26X_INIT(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(TMC26X) - _TMC26X_INIT(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(TMC26X) - _TMC26X_INIT(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(TMC26X) - _TMC26X_INIT(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(TMC26X) - _TMC26X_INIT(E5); - #endif - } -#endif // TMC26X +#include "trinamic.h" +#include "../stepper.h" -#if HAS_TRINAMIC - #include - #include - #include "planner.h" - #include "../core/enum.h" +#include +#include - enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; - #define _TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX]) +enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; +#define _TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX]) - // IC = TMC model number - // ST = Stepper object letter - // L = Label characters - // AI = Axis Enum Index - // SWHW = SW/SH UART selection - #if ENABLED(TMC_USE_SW_SPI) - #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK) - #else - #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE) - #endif +// IC = TMC model number +// ST = Stepper object letter +// L = Label characters +// AI = Axis Enum Index +// SWHW = SW/SH UART selection +#if ENABLED(TMC_USE_SW_SPI) + #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK, ST##_CHAIN_POS) +#else + #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE, ST##_CHAIN_POS) +#endif - #define TMC_UART_HW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(&ST##_HARDWARE_SERIAL, ST##_RSENSE, ST##_SLAVE_ADDRESS) - #define TMC_UART_SW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN, ST##_RSENSE, ST##_SLAVE_ADDRESS, ST##_SERIAL_RX_PIN > -1) +#define TMC_UART_HW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(&ST##_HARDWARE_SERIAL, ST##_RSENSE, ST##_SLAVE_ADDRESS) +#define TMC_UART_SW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN, ST##_RSENSE, ST##_SLAVE_ADDRESS, ST##_SERIAL_RX_PIN > -1) - #define _TMC_SPI_DEFINE(IC, ST, AI) __TMC_SPI_DEFINE(IC, ST, TMC_##ST##_LABEL, AI) - #define TMC_SPI_DEFINE(ST, AI) _TMC_SPI_DEFINE(ST##_DRIVER_TYPE, ST, AI##_AXIS) +#define _TMC_SPI_DEFINE(IC, ST, AI) __TMC_SPI_DEFINE(IC, ST, TMC_##ST##_LABEL, AI) +#define TMC_SPI_DEFINE(ST, AI) _TMC_SPI_DEFINE(ST##_DRIVER_TYPE, ST, AI##_AXIS) - #define _TMC_UART_DEFINE(SWHW, IC, ST, AI) TMC_UART_##SWHW##_DEFINE(IC, ST, TMC_##ST##_LABEL, AI) - #define TMC_UART_DEFINE(SWHW, ST, AI) _TMC_UART_DEFINE(SWHW, ST##_DRIVER_TYPE, ST, AI##_AXIS) +#define _TMC_UART_DEFINE(SWHW, IC, ST, AI) TMC_UART_##SWHW##_DEFINE(IC, ST, TMC_##ST##_LABEL, AI) +#define TMC_UART_DEFINE(SWHW, ST, AI) _TMC_UART_DEFINE(SWHW, ST##_DRIVER_TYPE, ST, AI##_AXIS) - #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 - #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E##AI) - #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E##AI) - #else - #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E) - #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E) - #endif +#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 + #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E##AI) + #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E##AI) +#else + #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E) + #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E) +#endif - // Stepper objects of TMC2130/TMC2160/TMC2660/TMC5130/TMC5160 steppers used - #if AXIS_HAS_SPI(X) - TMC_SPI_DEFINE(X, X); - #endif - #if AXIS_HAS_SPI(X2) - TMC_SPI_DEFINE(X2, X); - #endif - #if AXIS_HAS_SPI(Y) - TMC_SPI_DEFINE(Y, Y); - #endif - #if AXIS_HAS_SPI(Y2) - TMC_SPI_DEFINE(Y2, Y); - #endif - #if AXIS_HAS_SPI(Z) - TMC_SPI_DEFINE(Z, Z); - #endif - #if AXIS_HAS_SPI(Z2) - TMC_SPI_DEFINE(Z2, Z); - #endif - #if AXIS_HAS_SPI(Z3) - TMC_SPI_DEFINE(Z3, Z); - #endif - #if AXIS_HAS_SPI(E0) - TMC_SPI_DEFINE_E(0); - #endif - #if AXIS_HAS_SPI(E1) - TMC_SPI_DEFINE_E(1); - #endif - #if AXIS_HAS_SPI(E2) - TMC_SPI_DEFINE_E(2); - #endif - #if AXIS_HAS_SPI(E3) - TMC_SPI_DEFINE_E(3); - #endif - #if AXIS_HAS_SPI(E4) - TMC_SPI_DEFINE_E(4); - #endif - #if AXIS_HAS_SPI(E5) - TMC_SPI_DEFINE_E(5); - #endif +// Stepper objects of TMC2130/TMC2160/TMC2660/TMC5130/TMC5160 steppers used +#if AXIS_HAS_SPI(X) + TMC_SPI_DEFINE(X, X); +#endif +#if AXIS_HAS_SPI(X2) + TMC_SPI_DEFINE(X2, X); +#endif +#if AXIS_HAS_SPI(Y) + TMC_SPI_DEFINE(Y, Y); +#endif +#if AXIS_HAS_SPI(Y2) + TMC_SPI_DEFINE(Y2, Y); +#endif +#if AXIS_HAS_SPI(Z) + TMC_SPI_DEFINE(Z, Z); +#endif +#if AXIS_HAS_SPI(Z2) + TMC_SPI_DEFINE(Z2, Z); +#endif +#if AXIS_HAS_SPI(Z3) + TMC_SPI_DEFINE(Z3, Z); +#endif +#if AXIS_HAS_SPI(E0) + TMC_SPI_DEFINE_E(0); +#endif +#if AXIS_HAS_SPI(E1) + TMC_SPI_DEFINE_E(1); +#endif +#if AXIS_HAS_SPI(E2) + TMC_SPI_DEFINE_E(2); +#endif +#if AXIS_HAS_SPI(E3) + TMC_SPI_DEFINE_E(3); +#endif +#if AXIS_HAS_SPI(E4) + TMC_SPI_DEFINE_E(4); +#endif +#if AXIS_HAS_SPI(E5) + TMC_SPI_DEFINE_E(5); +#endif +#ifndef TMC_BAUD_RATE + #define TMC_BAUD_RATE 115200 #endif #if HAS_DRIVER(TMC2130) @@ -309,7 +199,7 @@ // // TMC2208/2209 Driver objects and inits // -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) +#if HAS_TMC220x #if AXIS_HAS_UART(X) #ifdef X_HARDWARE_SERIAL TMC_UART_DEFINE(HW, X, X); @@ -405,93 +295,93 @@ void tmc_serial_begin() { #if AXIS_HAS_UART(X) #ifdef X_HARDWARE_SERIAL - X_HARDWARE_SERIAL.begin(115200); + X_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperX.beginSerial(115200); + stepperX.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(X2) #ifdef X2_HARDWARE_SERIAL - X2_HARDWARE_SERIAL.begin(115200); + X2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperX2.beginSerial(115200); + stepperX2.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Y) #ifdef Y_HARDWARE_SERIAL - Y_HARDWARE_SERIAL.begin(115200); + Y_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperY.beginSerial(115200); + stepperY.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Y2) #ifdef Y2_HARDWARE_SERIAL - Y2_HARDWARE_SERIAL.begin(115200); + Y2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperY2.beginSerial(115200); + stepperY2.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Z) #ifdef Z_HARDWARE_SERIAL - Z_HARDWARE_SERIAL.begin(115200); + Z_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperZ.beginSerial(115200); + stepperZ.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Z2) #ifdef Z2_HARDWARE_SERIAL - Z2_HARDWARE_SERIAL.begin(115200); + Z2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperZ2.beginSerial(115200); + stepperZ2.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(Z3) #ifdef Z3_HARDWARE_SERIAL - Z3_HARDWARE_SERIAL.begin(115200); + Z3_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperZ3.beginSerial(115200); + stepperZ3.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E0) #ifdef E0_HARDWARE_SERIAL - E0_HARDWARE_SERIAL.begin(115200); + E0_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperE0.beginSerial(115200); + stepperE0.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E1) #ifdef E1_HARDWARE_SERIAL - E1_HARDWARE_SERIAL.begin(115200); + E1_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperE1.beginSerial(115200); + stepperE1.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E2) #ifdef E2_HARDWARE_SERIAL - E2_HARDWARE_SERIAL.begin(115200); + E2_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperE2.beginSerial(115200); + stepperE2.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E3) #ifdef E3_HARDWARE_SERIAL - E3_HARDWARE_SERIAL.begin(115200); + E3_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperE3.beginSerial(115200); + stepperE3.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E4) #ifdef E4_HARDWARE_SERIAL - E4_HARDWARE_SERIAL.begin(115200); + E4_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperE4.beginSerial(115200); + stepperE4.beginSerial(TMC_BAUD_RATE); #endif #endif #if AXIS_HAS_UART(E5) #ifdef E5_HARDWARE_SERIAL - E5_HARDWARE_SERIAL.begin(115200); + E5_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); #else - stepperE5.beginSerial(115200); + stepperE5.beginSerial(TMC_BAUD_RATE); #endif #endif } @@ -704,7 +594,7 @@ } #endif // TMC5160 -void restore_stepper_drivers() { +void restore_trinamic_drivers() { #if AXIS_IS_TMC(X) stepperX.push(); #endif @@ -746,37 +636,26 @@ void restore_stepper_drivers() { #endif } -void reset_stepper_drivers() { - - #if HAS_DRIVER(TMC26X) - tmc26x_init_to_defaults(); - #endif - - #if HAS_DRIVER(L6470) - L6470.init_to_defaults(); - #endif - - #if HAS_TRINAMIC - static constexpr bool stealthchop_by_axis[] = { - #if ENABLED(STEALTHCHOP_XY) - true - #else - false - #endif - , - #if ENABLED(STEALTHCHOP_Z) - true - #else - false - #endif - , - #if ENABLED(STEALTHCHOP_E) - true - #else - false - #endif - }; - #endif +void reset_trinamic_drivers() { + static constexpr bool stealthchop_by_axis[] = { + #if ENABLED(STEALTHCHOP_XY) + true + #else + false + #endif + , + #if ENABLED(STEALTHCHOP_Z) + true + #else + false + #endif + , + #if ENABLED(STEALTHCHOP_E) + true + #else + false + #endif + }; #if AXIS_IS_TMC(X) _TMC_INIT(X, STEALTH_AXIS_XY); @@ -823,10 +702,13 @@ void reset_stepper_drivers() { #if AXIS_HAS_STALLGUARD(X) stepperX.homing_threshold(X_STALL_SENSITIVITY); #endif - #if AXIS_HAS_STALLGUARD(X2) + #if AXIS_HAS_STALLGUARD(X2) && !X2_SENSORLESS stepperX2.homing_threshold(X_STALL_SENSITIVITY); #endif #endif + #if X2_SENSORLESS + stepperX2.homing_threshold(X2_STALL_SENSITIVITY); + #endif #if Y_SENSORLESS #if AXIS_HAS_STALLGUARD(Y) stepperY.homing_threshold(Y_STALL_SENSITIVITY); @@ -852,125 +734,7 @@ void reset_stepper_drivers() { TMC_ADV() #endif - #if HAS_TRINAMIC - stepper.set_directions(); - #endif + stepper.set_directions(); } -// -// L6470 Driver objects and inits -// -#if HAS_DRIVER(L6470) - - // create stepper objects - - #define _L6470_DEFINE(ST) L6470 stepper##ST((const int)L6470_CHAIN_SS_PIN) - - // L6470 Stepper objects - #if AXIS_DRIVER_TYPE_X(L6470) - _L6470_DEFINE(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_DEFINE(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_DEFINE(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_DEFINE(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_DEFINE(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_DEFINE(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_DEFINE(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_DEFINE(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_DEFINE(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_DEFINE(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_DEFINE(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_DEFINE(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_DEFINE(E5); - #endif - - // not using L6470 library's init command because it - // briefly sends power to the steppers - - #define _L6470_INIT_CHIP(Q) do{ \ - stepper##Q.resetDev(); \ - stepper##Q.softFree(); \ - stepper##Q.SetParam(L6470_CONFIG, CONFIG_PWM_DIV_1 \ - | CONFIG_PWM_MUL_2 \ - | CONFIG_SR_290V_us \ - | CONFIG_OC_SD_DISABLE \ - | CONFIG_VS_COMP_DISABLE \ - | CONFIG_SW_HARD_STOP \ - | CONFIG_INT_16MHZ); \ - stepper##Q.SetParam(L6470_KVAL_RUN, 0xFF); \ - stepper##Q.SetParam(L6470_KVAL_ACC, 0xFF); \ - stepper##Q.SetParam(L6470_KVAL_DEC, 0xFF); \ - stepper##Q.setMicroSteps(Q##_MICROSTEPS); \ - stepper##Q.setOverCurrent(Q##_OVERCURRENT); \ - stepper##Q.setStallCurrent(Q##_STALLCURRENT); \ - stepper##Q.SetParam(L6470_KVAL_HOLD, Q##_MAX_VOLTAGE); \ - stepper##Q.SetParam(L6470_ABS_POS, 0); \ - stepper##Q.getStatus(); \ - }while(0) - - void L6470_Marlin::init_to_defaults() { - #if AXIS_DRIVER_TYPE_X(L6470) - _L6470_INIT_CHIP(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_INIT_CHIP(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_INIT_CHIP(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_INIT_CHIP(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_INIT_CHIP(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_INIT_CHIP(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_INIT_CHIP(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_INIT_CHIP(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_INIT_CHIP(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_INIT_CHIP(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_INIT_CHIP(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_INIT_CHIP(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_INIT_CHIP(E5); - #endif - } - -#endif // L6470 +#endif // HAS_TRINAMIC diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h new file mode 100644 index 000000000000..8c6e9c21aa05 --- /dev/null +++ b/Marlin/src/module/stepper/trinamic.h @@ -0,0 +1,232 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * stepper/trinamic.h + * Stepper driver indirection for Trinamic + */ + +#include +#if TMCSTEPPER_VERSION < 0x000500 + #error "Update TMCStepper library to 0.5.0 or newer." +#endif + +#include "../../inc/MarlinConfig.h" +#include "../../feature/tmc_util.h" + +#define ____TMC_CLASS(MODEL, A, I, E) TMCMarlin +#define ___TMC_CLASS(MODEL, A, I, E) ____TMC_CLASS(MODEL, A, I, E) +#define __TMC_CLASS(MODEL, A, I, E) ___TMC_CLASS(_##MODEL, A, I, E) +#define _TMC_CLASS(MODEL, L, E) __TMC_CLASS(MODEL, L, E) +#define TMC_CLASS(ST, A) _TMC_CLASS(ST##_DRIVER_TYPE, TMC_##ST##_LABEL, A##_AXIS) +#if ENABLED(DISTINCT_E_FACTORS) + #define TMC_CLASS_E(I) TMC_CLASS(E##I, E##I) +#else + #define TMC_CLASS_E(I) TMC_CLASS(E##I, E) +#endif + +typedef struct { + uint8_t toff; + int8_t hend; + uint8_t hstrt; +} chopper_timing_t; + +static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING; + +#if HAS_TMC220x + void tmc_serial_begin(); +#endif + +void restore_trinamic_drivers(); +void reset_trinamic_drivers(); + +#define AXIS_HAS_SQUARE_WAVE(A) (AXIS_IS_TMC(A) && ENABLED(SQUARE_WAVE_STEPPING)) + +// X Stepper +#if AXIS_IS_TMC(X) + extern TMC_CLASS(X, X) stepperX; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) + #define X_ENABLE_READ() stepperX.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(X) + #define X_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X_STEP_PIN); }while(0) + #endif +#endif + +// Y Stepper +#if AXIS_IS_TMC(Y) + extern TMC_CLASS(Y, Y) stepperY; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) + #define Y_ENABLE_READ() stepperY.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Y) + #define Y_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y_STEP_PIN); }while(0) + #endif +#endif + +// Z Stepper +#if AXIS_IS_TMC(Z) + extern TMC_CLASS(Z, Z) stepperZ; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z_ENABLE_READ() stepperZ.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Z) + #define Z_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z_STEP_PIN); }while(0) + #endif +#endif + +// X2 Stepper +#if HAS_X2_ENABLE && AXIS_IS_TMC(X2) + extern TMC_CLASS(X2, X) stepperX2; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) + #define X2_ENABLE_READ() stepperX2.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(X2) + #define X2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X2_STEP_PIN); }while(0) + #endif +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE && AXIS_IS_TMC(Y2) + extern TMC_CLASS(Y2, Y) stepperY2; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) + #define Y2_ENABLE_READ() stepperY2.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Y2) + #define Y2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Y2_STEP_PIN); }while(0) + #endif +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE && AXIS_IS_TMC(Z2) + extern TMC_CLASS(Z2, Z) stepperZ2; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2) + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z2_ENABLE_READ() stepperZ2.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Z2) + #define Z2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z2_STEP_PIN); }while(0) + #endif +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE && AXIS_IS_TMC(Z3) + extern TMC_CLASS(Z3, Z) stepperZ3; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define Z3_ENABLE_INIT NOOP + #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z3_ENABLE_READ() stepperZ3.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Z3) + #define Z3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z3_STEP_PIN); }while(0) + #endif +#endif + +// E0 Stepper +#if AXIS_IS_TMC(E0) + extern TMC_CLASS_E(0) stepperE0; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0) + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E0_ENABLE_READ() stepperE0.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E0) + #define E0_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E0_STEP_PIN); }while(0) + #endif +#endif + +// E1 Stepper +#if AXIS_IS_TMC(E1) + extern TMC_CLASS_E(1) stepperE1; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1) + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E1_ENABLE_READ() stepperE1.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E1) + #define E1_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E1_STEP_PIN); }while(0) + #endif +#endif + +// E2 Stepper +#if AXIS_IS_TMC(E2) + extern TMC_CLASS_E(2) stepperE2; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2) + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E2_ENABLE_READ() stepperE2.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E2) + #define E2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E2_STEP_PIN); }while(0) + #endif +#endif + +// E3 Stepper +#if AXIS_IS_TMC(E3) + extern TMC_CLASS_E(3) stepperE3; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3) + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E3_ENABLE_READ() stepperE3.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E3) + #define E3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E3_STEP_PIN); }while(0) + #endif +#endif + +// E4 Stepper +#if AXIS_IS_TMC(E4) + extern TMC_CLASS_E(4) stepperE4; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4) + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E4_ENABLE_READ() stepperE4.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E4) + #define E4_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E4_STEP_PIN); }while(0) + #endif +#endif + +// E5 Stepper +#if AXIS_IS_TMC(E5) + extern TMC_CLASS_E(5) stepperE5; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5) + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E5_ENABLE_READ() stepperE5.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E5) + #define E5_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E5_STEP_PIN); }while(0) + #endif +#endif diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h deleted file mode 100644 index 0e9c188adc85..000000000000 --- a/Marlin/src/module/stepper_indirection.h +++ /dev/null @@ -1,727 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -/** - * stepper_indirection.h - * - * Stepper motor driver indirection to allow some stepper functions to - * be done via SPI/I2c instead of direct pin manipulation. - * - * Copyright (c) 2015 Dominik Wenger - */ - -#include "../inc/MarlinConfig.h" - -// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI -#if HAS_DRIVER(TMC26X) - #include - #ifdef STM32F7 - #include "../HAL/HAL_STM32F7/TMC2660.h" - #else - #include - #endif - void tmc26x_init_to_defaults(); -#endif - -#if HAS_TRINAMIC - #include - #include "../feature/tmc_util.h" - #if TMCSTEPPER_VERSION < 0x000405 - #error "Update TMCStepper library to 0.4.5 or newer." - #endif - - #define ____TMC_CLASS(MODEL, A, I, E) TMCMarlin - #define ___TMC_CLASS(MODEL, A, I, E) ____TMC_CLASS(MODEL, A, I, E) - #define __TMC_CLASS(MODEL, A, I, E) ___TMC_CLASS(_##MODEL, A, I, E) - #define _TMC_CLASS(MODEL, L, E) __TMC_CLASS(MODEL, L, E) - #define TMC_CLASS(ST, A) _TMC_CLASS(ST##_DRIVER_TYPE, TMC_##ST##_LABEL, A##_AXIS) - #if ENABLED(DISTINCT_E_FACTORS) - #define TMC_CLASS_E(I) TMC_CLASS(E##I, E##I) - #else - #define TMC_CLASS_E(I) TMC_CLASS(E##I, E) - #endif - - typedef struct { - uint8_t toff; - int8_t hend; - uint8_t hstrt; - } chopper_timing_t; - - static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING; - - #if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) - void tmc_serial_begin(); - #endif -#endif - -// L6470 has STEP on normal pins, but DIR/ENABLE via SPI -#if HAS_DRIVER(L6470) - #include "L6470/L6470_Marlin.h" - #define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L6470_dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) -#endif - -void restore_stepper_drivers(); // Called by PSU_ON -void reset_stepper_drivers(); // Called by settings.load / settings.reset - -#define AXIS_HAS_SQUARE_WAVE(A) (AXIS_IS_TMC(A) && ENABLED(SQUARE_WAVE_STEPPING)) - -// X Stepper -#if AXIS_DRIVER_TYPE_X(L6470) - extern L6470 stepperX; - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) NOOP - #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ) - #define X_DIR_INIT NOOP - #define X_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X) - #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(X) - extern TMC_CLASS(X, X) stepperX; - #endif - #if AXIS_DRIVER_TYPE_X(TMC26X) - extern TMC26XStepper stepperX; - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) - #define X_ENABLE_READ stepperX.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X) - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) - #define X_ENABLE_READ stepperX.isEnabled() - #else - #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN) - #define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE) - #define X_ENABLE_READ READ(X_ENABLE_PIN) - #endif - #define X_DIR_INIT SET_OUTPUT(X_DIR_PIN) - #define X_DIR_WRITE(STATE) WRITE(X_DIR_PIN,STATE) - #define X_DIR_READ READ(X_DIR_PIN) -#endif -#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(X) - #define X_STEP_WRITE(STATE) do { if(STATE) TOGGLE(X_STEP_PIN); } while(0) -#else - #define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE) -#endif -#define X_STEP_READ READ(X_STEP_PIN) - -// Y Stepper -#if AXIS_DRIVER_TYPE_Y(L6470) - extern L6470 stepperY; - #define Y_ENABLE_INIT NOOP - #define Y_ENABLE_WRITE(STATE) NOOP - #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ) - #define Y_DIR_INIT NOOP - #define Y_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y) - #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(Y) - extern TMC_CLASS(Y, Y) stepperY; - #endif - #if AXIS_DRIVER_TYPE_Y(TMC26X) - extern TMC26XStepper stepperY; - #define Y_ENABLE_INIT NOOP - #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) - #define Y_ENABLE_READ stepperY.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y) - #define Y_ENABLE_INIT NOOP - #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) - #define Y_ENABLE_READ stepperY.isEnabled() - #else - #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN) - #define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE) - #define Y_ENABLE_READ READ(Y_ENABLE_PIN) - #endif - #define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN) - #define Y_DIR_WRITE(STATE) WRITE(Y_DIR_PIN,STATE) - #define Y_DIR_READ READ(Y_DIR_PIN) -#endif -#define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(Y) - #define Y_STEP_WRITE(STATE) do { if (STATE) TOGGLE(Y_STEP_PIN); } while(0) -#else - #define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE) -#endif -#define Y_STEP_READ READ(Y_STEP_PIN) - -// Z Stepper -#if AXIS_DRIVER_TYPE_Z(L6470) - extern L6470 stepperZ; - #define Z_ENABLE_INIT NOOP - #define Z_ENABLE_WRITE(STATE) NOOP - #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ) - #define Z_DIR_INIT NOOP - #define Z_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z) - #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(Z) - extern TMC_CLASS(Z, Z) stepperZ; - #endif - #if AXIS_DRIVER_TYPE_Z(TMC26X) - extern TMC26XStepper stepperZ; - #define Z_ENABLE_INIT NOOP - #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) - #define Z_ENABLE_READ stepperZ.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z) - #define Z_ENABLE_INIT NOOP - #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) - #define Z_ENABLE_READ stepperZ.isEnabled() - #else - #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN) - #define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE) - #define Z_ENABLE_READ READ(Z_ENABLE_PIN) - #endif - #define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN) - #define Z_DIR_WRITE(STATE) WRITE(Z_DIR_PIN,STATE) - #define Z_DIR_READ READ(Z_DIR_PIN) -#endif -#define Z_STEP_INIT SET_OUTPUT(Z_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(Z) - #define Z_STEP_WRITE(STATE) do { if(STATE) TOGGLE(Z_STEP_PIN); } while(0) -#else - #define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE) -#endif -#define Z_STEP_READ READ(Z_STEP_PIN) - -// X2 Stepper -#if HAS_X2_ENABLE - #if AXIS_DRIVER_TYPE_X2(L6470) - extern L6470 stepperX2; - #define X2_ENABLE_INIT NOOP - #define X2_ENABLE_WRITE(STATE) NOOP - #define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ) - #define X2_DIR_INIT NOOP - #define X2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X2) - #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) - #else - #if AXIS_IS_TMC(X2) - extern TMC_CLASS(X2, X) stepperX2; - #endif - #if AXIS_DRIVER_TYPE_X2(TMC26X) - extern TMC26XStepper stepperX2; - #define X2_ENABLE_INIT NOOP - #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) - #define X2_ENABLE_READ stepperX2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2) - #define X2_ENABLE_INIT NOOP - #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) - #define X2_ENABLE_READ stepperX2.isEnabled() - #else - #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) - #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE) - #define X2_ENABLE_READ READ(X2_ENABLE_PIN) - #endif - #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN) - #define X2_DIR_WRITE(STATE) WRITE(X2_DIR_PIN,STATE) - #define X2_DIR_READ READ(X2_DIR_PIN) - #endif - #define X2_STEP_INIT SET_OUTPUT(X2_STEP_PIN) - #if AXIS_HAS_SQUARE_WAVE(X2) - #define X2_STEP_WRITE(STATE) do { if(STATE) TOGGLE(X2_STEP_PIN); } while(0) - #else - #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE) - #endif - - #define X2_STEP_READ READ(X2_STEP_PIN) -#endif - -// Y2 Stepper -#if HAS_Y2_ENABLE - #if AXIS_DRIVER_TYPE_Y2(L6470) - extern L6470 stepperY2; - #define Y2_ENABLE_INIT NOOP - #define Y2_ENABLE_WRITE(STATE) NOOP - #define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ) - #define Y2_DIR_INIT NOOP - #define Y2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y2) - #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) - #else - #if AXIS_IS_TMC(Y2) - extern TMC_CLASS(Y2, Y) stepperY2; - #endif - #if AXIS_DRIVER_TYPE_Y2(TMC26X) - extern TMC26XStepper stepperY2; - #define Y2_ENABLE_INIT NOOP - #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) - #define Y2_ENABLE_READ stepperY2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2) - #define Y2_ENABLE_INIT NOOP - #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) - #define Y2_ENABLE_READ stepperY2.isEnabled() - #else - #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN) - #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE) - #define Y2_ENABLE_READ READ(Y2_ENABLE_PIN) - #endif - #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN) - #define Y2_DIR_WRITE(STATE) WRITE(Y2_DIR_PIN,STATE) - #define Y2_DIR_READ READ(Y2_DIR_PIN) - #endif - #define Y2_STEP_INIT SET_OUTPUT(Y2_STEP_PIN) - #if AXIS_HAS_SQUARE_WAVE(Y2) - #define Y2_STEP_WRITE(STATE) do { if(STATE) TOGGLE(Y2_STEP_PIN); } while(0) - #else - #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE) - #endif - - #define Y2_STEP_READ READ(Y2_STEP_PIN) -#else - #define Y2_DIR_WRITE(STATE) NOOP -#endif - -// Z2 Stepper -#if HAS_Z2_ENABLE - #if AXIS_DRIVER_TYPE_Z2(L6470) - extern L6470 stepperZ2; - #define Z2_ENABLE_INIT NOOP - #define Z2_ENABLE_WRITE(STATE) NOOP - #define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ) - #define Z2_DIR_INIT NOOP - #define Z2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z2) - #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) - #else - #if AXIS_IS_TMC(Z2) - extern TMC_CLASS(Z2, Z) stepperZ2; - #endif - #if AXIS_DRIVER_TYPE_Z2(TMC26X) - extern TMC26XStepper stepperZ2; - #define Z2_ENABLE_INIT NOOP - #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) - #define Z2_ENABLE_READ stepperZ2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2) - #define Z2_ENABLE_INIT NOOP - #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) - #define Z2_ENABLE_READ stepperZ2.isEnabled() - #else - #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN) - #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE) - #define Z2_ENABLE_READ READ(Z2_ENABLE_PIN) - #endif - #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN) - #define Z2_DIR_WRITE(STATE) WRITE(Z2_DIR_PIN,STATE) - #define Z2_DIR_READ READ(Z2_DIR_PIN) - #endif - #define Z2_STEP_INIT SET_OUTPUT(Z2_STEP_PIN) - #if AXIS_HAS_SQUARE_WAVE(Z2) - #define Z2_STEP_WRITE(STATE) do { if(STATE) TOGGLE(Z2_STEP_PIN); } while(0) - #else - #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE) - #endif - - #define Z2_STEP_READ READ(Z2_STEP_PIN) -#else - #define Z2_DIR_WRITE(STATE) NOOP -#endif - -// Z3 Stepper -#if HAS_Z3_ENABLE - #if AXIS_DRIVER_TYPE_Z3(L6470) - extern L6470 stepperZ3; - #define Z3_ENABLE_INIT NOOP - #define Z3_ENABLE_WRITE(STATE) NOOP - #define Z3_ENABLE_READ (stepperZ3.getStatus() & STATUS_HIZ) - #define Z3_DIR_INIT NOOP - #define Z3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z3) - #define Z3_DIR_READ (stepperZ3.getStatus() & STATUS_DIR) - #else - #if AXIS_IS_TMC(Z3) - extern TMC_CLASS(Z3, Z) stepperZ3; - #endif - #if ENABLED(Z3_IS_TMC26X) - extern TMC26XStepper stepperZ3; - #define Z3_ENABLE_INIT NOOP - #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE) - #define Z3_ENABLE_READ stepperZ3.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3) - #define Z3_ENABLE_INIT NOOP - #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) - #define Z3_ENABLE_READ stepperZ3.isEnabled() - #else - #define Z3_ENABLE_INIT SET_OUTPUT(Z3_ENABLE_PIN) - #define Z3_ENABLE_WRITE(STATE) WRITE(Z3_ENABLE_PIN,STATE) - #define Z3_ENABLE_READ READ(Z3_ENABLE_PIN) - #endif - #define Z3_DIR_INIT SET_OUTPUT(Z3_DIR_PIN) - #define Z3_DIR_WRITE(STATE) WRITE(Z3_DIR_PIN,STATE) - #define Z3_DIR_READ READ(Z3_DIR_PIN) - #endif - #define Z3_STEP_INIT SET_OUTPUT(Z3_STEP_PIN) - #if AXIS_HAS_SQUARE_WAVE(Z3) - #define Z3_STEP_WRITE(STATE) do { if(STATE) TOGGLE(Z3_STEP_PIN); } while(0) - #else - #define Z3_STEP_WRITE(STATE) WRITE(Z3_STEP_PIN,STATE) - #endif - - #define Z3_STEP_READ READ(Z3_STEP_PIN) -#else - #define Z3_DIR_WRITE(STATE) NOOP -#endif - -// E0 Stepper -#if AXIS_DRIVER_TYPE_E0(L6470) - extern L6470 stepperE0; - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) NOOP - #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) - #define E0_DIR_INIT NOOP - #define E0_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E0) - #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E0) - extern TMC_CLASS_E(0) stepperE0; - #endif - #if AXIS_DRIVER_TYPE_E0(TMC26X) - extern TMC26XStepper stepperE0; - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) - #define E0_ENABLE_READ stepperE0.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0) - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E0_ENABLE_READ stepperE0.isEnabled() - #else - #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) - #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE) - #define E0_ENABLE_READ READ(E0_ENABLE_PIN) - #endif - #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) - #define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE) - #define E0_DIR_READ READ(E0_DIR_PIN) -#endif -#define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E0) - #define E0_STEP_WRITE(STATE) do { if(STATE) TOGGLE(E0_STEP_PIN); } while(0) -#else - #define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) -#endif -#define E0_STEP_READ READ(E0_STEP_PIN) - -// E1 Stepper -#if AXIS_DRIVER_TYPE_E1(L6470) - extern L6470 stepperE1; - #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) NOOP - #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) - #define E1_DIR_INIT NOOP - #define E1_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E1) - #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E1) - extern TMC_CLASS_E(1) stepperE1; - #endif - #if AXIS_DRIVER_TYPE_E1(TMC26X) - extern TMC26XStepper stepperE1; - #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) - #define E1_ENABLE_READ stepperE1.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1) - #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E1_ENABLE_READ stepperE1.isEnabled() - #else - #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) - #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE) - #define E1_ENABLE_READ READ(E1_ENABLE_PIN) - #endif - #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) - #define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE) - #define E1_DIR_READ READ(E1_DIR_PIN) -#endif -#define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E1) - #define E1_STEP_WRITE(STATE) do { if(STATE) TOGGLE(E1_STEP_PIN); } while(0) -#else - #define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) -#endif -#define E1_STEP_READ READ(E1_STEP_PIN) - -// E2 Stepper -#if AXIS_DRIVER_TYPE_E2(L6470) - extern L6470 stepperE2; - #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) NOOP - #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) - #define E2_DIR_INIT NOOP - #define E2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E2) - #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E2) - extern TMC_CLASS_E(2) stepperE2; - #endif - #if AXIS_DRIVER_TYPE_E2(TMC26X) - extern TMC26XStepper stepperE2; - #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) - #define E2_ENABLE_READ stepperE2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2) - #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E2_ENABLE_READ stepperE2.isEnabled() - #else - #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) - #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE) - #define E2_ENABLE_READ READ(E2_ENABLE_PIN) - #endif - #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) - #define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE) - #define E2_DIR_READ READ(E2_DIR_PIN) -#endif -#define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E2) - #define E2_STEP_WRITE(STATE) do { if(STATE) TOGGLE(E2_STEP_PIN); } while(0) -#else - #define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) -#endif -#define E2_STEP_READ READ(E2_STEP_PIN) - -// E3 Stepper -#if AXIS_DRIVER_TYPE_E3(L6470) - extern L6470 stepperE3; - #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) NOOP - #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) - #define E3_DIR_INIT NOOP - #define E3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E3) - #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E3) - extern TMC_CLASS_E(3) stepperE3; - #endif - #if AXIS_DRIVER_TYPE_E3(TMC26X) - extern TMC26XStepper stepperE3; - #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) - #define E3_ENABLE_READ stepperE3.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3) - #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E3_ENABLE_READ stepperE3.isEnabled() - #else - #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) - #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) - #define E3_ENABLE_READ READ(E3_ENABLE_PIN) - #endif - #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) - #define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE) - #define E3_DIR_READ READ(E3_DIR_PIN) -#endif -#define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E3) - #define E3_STEP_WRITE(STATE) do { if(STATE) TOGGLE(E3_STEP_PIN); } while(0) -#else - #define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) -#endif -#define E3_STEP_READ READ(E3_STEP_PIN) - -// E4 Stepper -#if AXIS_DRIVER_TYPE_E4(L6470) - extern L6470 stepperE4; - #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) NOOP - #define E4_ENABLE_READ (stepperE4.getStatus() & STATUS_HIZ) - #define E4_DIR_INIT NOOP - #define E4_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E4) - #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E4) - extern TMC_CLASS_E(4) stepperE4; - #endif - #if AXIS_DRIVER_TYPE_E4(TMC26X) - extern TMC26XStepper stepperE4; - #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) - #define E4_ENABLE_READ stepperE4.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4) - #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E4_ENABLE_READ stepperE4.isEnabled() - #else - #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN) - #define E4_ENABLE_WRITE(STATE) WRITE(E4_ENABLE_PIN,STATE) - #define E4_ENABLE_READ READ(E4_ENABLE_PIN) - #endif - #define E4_DIR_INIT SET_OUTPUT(E4_DIR_PIN) - #define E4_DIR_WRITE(STATE) WRITE(E4_DIR_PIN,STATE) - #define E4_DIR_READ READ(E4_DIR_PIN) -#endif -#define E4_STEP_INIT SET_OUTPUT(E4_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E4) - #define E4_STEP_WRITE(STATE) do { if(STATE) TOGGLE(E4_STEP_PIN); } while(0) -#else - #define E4_STEP_WRITE(STATE) WRITE(E4_STEP_PIN,STATE) -#endif -#define E4_STEP_READ READ(E4_STEP_PIN) - -// E5 Stepper -#if AXIS_DRIVER_TYPE_E5(L6470) - extern L6470 stepperE5; - #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) NOOP - #define E5_ENABLE_READ (stepperE5.getStatus() & STATUS_HIZ) - #define E5_DIR_INIT NOOP - #define E5_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E5) - #define E5_DIR_READ (stepperE5.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E5) - extern TMC_CLASS_E(5) stepperE5; - #endif - #if AXIS_DRIVER_TYPE_E5(TMC26X) - extern TMC26XStepper stepperE5; - #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE) - #define E5_ENABLE_READ stepperE5.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5) - #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E5_ENABLE_READ stepperE5.isEnabled() - #else - #define E5_ENABLE_INIT SET_OUTPUT(E5_ENABLE_PIN) - #define E5_ENABLE_WRITE(STATE) WRITE(E5_ENABLE_PIN,STATE) - #define E5_ENABLE_READ READ(E5_ENABLE_PIN) - #endif - #define E5_DIR_INIT SET_OUTPUT(E5_DIR_PIN) - #define E5_DIR_WRITE(STATE) WRITE(E5_DIR_PIN,STATE) - #define E5_DIR_READ READ(E5_DIR_PIN) -#endif -#define E5_STEP_INIT SET_OUTPUT(E5_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E5) - #define E5_STEP_WRITE(STATE) do { if(STATE) TOGGLE(E5_STEP_PIN); } while(0) -#else - #define E5_STEP_WRITE(STATE) WRITE(E5_STEP_PIN,STATE) -#endif -#define E5_STEP_READ READ(E5_STEP_PIN) - -/** - * Extruder indirection for the single E axis - */ -#if ENABLED(SWITCHING_EXTRUDER) // One stepper driver per two extruders, reversed on odd index - #if EXTRUDERS > 5 - #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); case 5: 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); case 5: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) - #elif 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) - #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) - #endif -#elif ENABLED(PRUSA_MMU2) - #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) - -#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 > 1 - - #if E_STEPPERS > 5 - #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); case 5: E5_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); case 5: E5_DIR_WRITE(!INVERT_E5_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); case 5: E5_DIR_WRITE( INVERT_E5_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) - #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) - #endif - - #if HAS_DUPLICATION_MODE - - #if ENABLED(MULTI_NOZZLE_DUPLICATION) - #define _DUPE(N,T,V) do{ if (TEST(duplication_e_mask, N)) E##N##_##T##_WRITE(V); }while(0) - #else - #define _DUPE(N,T,V) E##N##_##T##_WRITE(V) - #endif - - #define NDIR(N) _DUPE(N,DIR,!INVERT_E##N##_DIR) - #define RDIR(N) _DUPE(N,DIR, INVERT_E##N##_DIR) - - #define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { DUPE(STEP,V); } else _E_STEP_WRITE(E,V); }while(0) - - #if E_STEPPERS > 2 - #if E_STEPPERS > 5 - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); _DUPE(5,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); NDIR(5); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); RDIR(5); } else _REV_E_DIR(E); }while(0) - #elif E_STEPPERS > 4 - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); } else _REV_E_DIR(E); }while(0) - #elif E_STEPPERS > 3 - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); } else _REV_E_DIR(E); }while(0) - #else - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); } else _REV_E_DIR(E); }while(0) - #endif - #else - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); } while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); } else _REV_E_DIR(E); }while(0) - #endif - - #else - - #define E_STEP_WRITE(E,V) _E_STEP_WRITE(E,V) - #define NORM_E_DIR(E) _NORM_E_DIR(E) - #define REV_E_DIR(E) _REV_E_DIR(E) - - #endif - -#elif E_STEPPERS - #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) - -#else - #define E_STEP_WRITE(E,V) NOOP - #define NORM_E_DIR(E) NOOP - #define REV_E_DIR(E) NOOP - -#endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index f98f76c8d83f..daaa008bf926 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -33,7 +33,30 @@ #include "../core/language.h" #include "../HAL/shared/Delay.h" -#define MAX6675_SEPARATE_SPI EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PIN_EXISTS(MAX6675_SCK, MAX6675_DO) +#if ENABLED(MAX6675_IS_MAX31865) + #include "Adafruit_MAX31865.h" + #ifndef MAX31865_CS_PIN + #define MAX31865_CS_PIN MAX6675_SS_PIN // HW:49 SW:65 for example + #endif + #ifndef MAX31865_MOSI_PIN + #define MAX31865_MOSI_PIN MOSI_PIN // 63 + #endif + #ifndef MAX31865_MISO_PIN + #define MAX31865_MISO_PIN MAX6675_DO_PIN // 42 + #endif + #ifndef MAX31865_SCK_PIN + #define MAX31865_SCK_PIN MAX6675_SCK_PIN // 40 + #endif + Adafruit_MAX31865 max31865 = Adafruit_MAX31865(MAX31865_CS_PIN + #if MAX31865_CS_PIN != MAX6675_SS_PIN + , MAX31865_MOSI_PIN // For software SPI also set MOSI/MISO/SCK + , MAX31865_MISO_PIN + , MAX31865_SCK_PIN + #endif + ); +#endif + +#define MAX6675_SEPARATE_SPI (EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PIN_EXISTS(MAX6675_SCK, MAX6675_DO)) #if MAX6675_SEPARATE_SPI #include "../libs/private_spi.h" @@ -64,11 +87,15 @@ #include "../feature/leds/printer_event_leds.h" #endif +#if ENABLED(JOYSTICK) + #include "../feature/joystick.h" +#endif + #if ENABLED(SINGLENOZZLE) #include "tool_change.h" #endif -#if HAS_BUZZER +#if USE_BEEPER #include "../libs/buzzer.h" #endif @@ -82,10 +109,6 @@ #endif #endif -#ifndef THERMAL_PROTECTION_GRACE_PERIOD - #define THERMAL_PROTECTION_GRACE_PERIOD 0 // No grace period needed on well-behaved boards -#endif - Temperature thermalManager; /** @@ -94,17 +117,17 @@ Temperature thermalManager; */ #if HAS_HEATED_BED - #define _BED_PSTR(M,E) (E) == H_BED ? PSTR(M) : + #define _BED_PSTR(h) (h) == H_BED ? GET_TEXT(MSG_BED) : #else - #define _BED_PSTR(M,E) + #define _BED_PSTR(h) #endif #if HAS_HEATED_CHAMBER - #define _CHAMBER_PSTR(M,E) (E) == H_CHAMBER ? PSTR(M) : + #define _CHAMBER_PSTR(h) (h) == H_CHAMBER ? GET_TEXT(MSG_CHAMBER) : #else - #define _CHAMBER_PSTR(M,E) + #define _CHAMBER_PSTR(h) #endif -#define _E_PSTR(M,E,N) ((HOTENDS) >= (N) && (E) == (N)-1) ? PSTR(MSG_E##N " " M) : -#define TEMP_ERR_PSTR(M,E) _BED_PSTR(M##_BED,E) _CHAMBER_PSTR(M##_CHAMBER,E) _E_PSTR(M,E,2) _E_PSTR(M,E,3) _E_PSTR(M,E,4) _E_PSTR(M,E,5) _E_PSTR(M,E,6) PSTR(MSG_E1 " " M) +#define _E_PSTR(h,N) ((HOTENDS) > N && (h) == N) ? PSTR(LCD_STR_E##N) : +#define HEATER_PSTR(h) _BED_PSTR(h) _CHAMBER_PSTR(h) _E_PSTR(h,1) _E_PSTR(h,2) _E_PSTR(h,3) _E_PSTR(h,4) _E_PSTR(h,5) PSTR(LCD_STR_E0) // public: @@ -112,11 +135,9 @@ Temperature thermalManager; bool Temperature::adaptive_fan_slowing = true; #endif -hotend_info_t Temperature::temp_hotend[HOTENDS - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - + 1 - #endif -]; // = { 0 } +#if HOTENDS + hotend_info_t Temperature::temp_hotend[HOTEND_TEMPS]; // = { 0 } +#endif #if ENABLED(AUTO_POWER_E_FANS) uint8_t Temperature::autofan_speed[HOTENDS]; // = { 0 } @@ -159,18 +180,6 @@ hotend_info_t Temperature::temp_hotend[HOTENDS uint8_t Temperature::fan_speed_scaler[FAN_COUNT] = ARRAY_N(FAN_COUNT, 128, 128, 128, 128, 128, 128); #endif - #if HAS_LCD_MENU - - uint8_t Temperature::lcd_tmpfan_speed[ - #if ENABLED(SINGLENOZZLE) - _MAX(EXTRUDERS, FAN_COUNT) - #else - FAN_COUNT - #endif - ]; // = { 0 } - - #endif - /** * Set the print fan speed for a target extruder */ @@ -189,9 +198,6 @@ hotend_info_t Temperature::temp_hotend[HOTENDS if (target >= FAN_COUNT) return; fan_speed[target] = speed; - #if HAS_LCD_MENU - lcd_tmpfan_speed[target] = speed; - #endif } #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) @@ -247,7 +253,7 @@ hotend_info_t Temperature::temp_hotend[HOTENDS int16_t Temperature::maxtemp_raw_CHAMBER = HEATER_CHAMBER_RAW_HI_TEMP; #endif #if WATCH_CHAMBER - heater_watch_t Temperature::watch_chamber = { 0 }; + heater_watch_t Temperature::watch_chamber{0}; #endif millis_t Temperature::next_chamber_check_ms; #endif // HAS_HEATED_CHAMBER @@ -283,15 +289,17 @@ volatile bool Temperature::temp_meas_ready = false; #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) < (HEATER_##N##_RAW_HI_TEMP) ? 1 : -1) -// Init mintemp and maxtemp with extreme values to prevent false errors during startup -constexpr temp_range_t sensor_heater_0 { HEATER_0_RAW_LO_TEMP, HEATER_0_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_1 { HEATER_1_RAW_LO_TEMP, HEATER_1_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_2 { HEATER_2_RAW_LO_TEMP, HEATER_2_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_3 { HEATER_3_RAW_LO_TEMP, HEATER_3_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_4 { HEATER_4_RAW_LO_TEMP, HEATER_4_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_5 { HEATER_5_RAW_LO_TEMP, HEATER_5_RAW_HI_TEMP, 0, 16383 }; +#if HOTENDS + // Init mintemp and maxtemp with extreme values to prevent false errors during startup + constexpr temp_range_t sensor_heater_0 { HEATER_0_RAW_LO_TEMP, HEATER_0_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_1 { HEATER_1_RAW_LO_TEMP, HEATER_1_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_2 { HEATER_2_RAW_LO_TEMP, HEATER_2_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_3 { HEATER_3_RAW_LO_TEMP, HEATER_3_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_4 { HEATER_4_RAW_LO_TEMP, HEATER_4_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_5 { HEATER_5_RAW_LO_TEMP, HEATER_5_RAW_HI_TEMP, 0, 16383 }; -temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0, sensor_heater_1, sensor_heater_2, sensor_heater_3, sensor_heater_4, sensor_heater_5); + temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0, sensor_heater_1, sensor_heater_2, sensor_heater_3, sensor_heater_4, sensor_heater_5); +#endif #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED uint8_t Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 }; @@ -301,10 +309,6 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 millis_t Temperature::preheat_end_time[HOTENDS] = { 0 }; #endif -#if ENABLED(FILAMENT_WIDTH_SENSOR) - int8_t Temperature::meas_shift_index; // Index of a delayed sample in buffer -#endif - #if HAS_AUTO_FAN millis_t Temperature::next_auto_fan_check_ms = 0; #endif @@ -314,10 +318,6 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 Temperature::soft_pwm_count_fan[FAN_COUNT]; #endif -#if ENABLED(FILAMENT_WIDTH_SENSOR) - uint16_t Temperature::current_raw_filwidth = 0; // Measured filament diameter - one extruder only -#endif - #if ENABLED(PROBING_HEATERS_OFF) bool Temperature::paused; #endif @@ -325,7 +325,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 // public: #if HAS_ADC_BUTTONS - uint32_t Temperature::current_ADCKey_raw = 1024; + uint32_t Temperature::current_ADCKey_raw = HAL_ADC_RANGE; uint8_t Temperature::ADCKey_count = 0; #endif @@ -346,7 +346,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 * temperature to succeed. */ void Temperature::PID_autotune(const float &target, const heater_ind_t heater, const int8_t ncycles, const bool set_result/*=false*/) { - float current = 0.0; + float current_temp = 0.0; int cycles = 0; bool heating = true; @@ -355,7 +355,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 long bias, d; PID_t tune_pid = { 0, 0, 0 }; - float max = 0, min = 10000; + float maxT = 0, minT = 10000; const bool isbed = (heater == H_BED); @@ -397,7 +397,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 next_auto_fan_check_ms = next_temp_ms + 2500UL; #endif - if (target > GHV(BED_MAXTEMP, temp_range[heater].maxtemp) - 15) { + if (target > GHV(BED_MAXTEMP - 10, temp_range[heater].maxtemp - 15)) { SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH); return; } @@ -410,7 +410,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 wait_for_heatup = true; // Can be interrupted with M108 #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = GHV(temp_bed.current, temp_hotend[heater].current); + const float start_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius); LEDColor color = ONHEATINGSTART(); #endif @@ -427,12 +427,12 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 updateTemperaturesFromRawValues(); // Get the current temperature and constrain it - current = GHV(temp_bed.current, temp_hotend[heater].current); - NOLESS(max, current); - NOMORE(min, current); + current_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius); + NOLESS(maxT, current_temp); + NOMORE(minT, current_temp); #if ENABLED(PRINTER_EVENT_LEDS) - ONHEATING(start_temp, current, target); + ONHEATING(start_temp, current_temp, target); #endif #if HAS_AUTO_FAN @@ -442,17 +442,17 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 } #endif - if (heating && current > target) { + if (heating && current_temp > target) { if (ELAPSED(ms, t2 + 5000UL)) { heating = false; SHV((bias - d) >> 1, (bias - d) >> 1); t1 = ms; t_high = t1 - t2; - max = target; + maxT = target; } } - if (!heating && current < target) { + if (!heating && current_temp < target) { if (ELAPSED(ms, t1 + 5000UL)) { heating = true; t2 = ms; @@ -460,21 +460,32 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 if (cycles > 0) { const long max_pow = GHV(MAX_BED_POWER, PID_MAX); bias += (d * (t_high - t_low)) / (t_low + t_high); - bias = constrain(bias, 20, max_pow - 20); + LIMIT(bias, 20, max_pow - 20); d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias; - SERIAL_ECHOPAIR(MSG_BIAS, bias, MSG_D, d, MSG_T_MIN, min, MSG_T_MAX, max); + SERIAL_ECHOPAIR(MSG_BIAS, bias, MSG_D, d, MSG_T_MIN, minT, MSG_T_MAX, maxT); if (cycles > 2) { - const float Ku = (4.0f * d) / (float(M_PI) * (max - min) * 0.5f), + const float Ku = (4.0f * d) / (float(M_PI) * (maxT - minT) * 0.5f), Tu = float(t_low + t_high) * 0.001f, pf = isbed ? 0.2f : 0.6f, df = isbed ? 1.0f / 3.0f : 1.0f / 8.0f; - tune_pid.Kp = Ku * pf; - tune_pid.Kd = tune_pid.Kp * Tu * df; - tune_pid.Ki = 2 * tune_pid.Kp / Tu; + SERIAL_ECHOPAIR(MSG_KU, Ku, MSG_TU, Tu); - SERIAL_ECHOLNPGM("\n" MSG_CLASSIC_PID); - SERIAL_ECHOLNPAIR(MSG_KP, tune_pid.Kp, MSG_KI, tune_pid.Ki, MSG_KD, tune_pid.Kd); + if (isbed) { // Do not remove this otherwise PID autotune won't work right for the bed! + tune_pid.Kp = Ku * 0.2f; + tune_pid.Ki = 2 * tune_pid.Kp / Tu; + tune_pid.Kd = tune_pid.Kp * Tu / 3; + SERIAL_ECHOLNPGM("\n" " No overshoot"); // Works far better for the bed. Classic and some have bad ringing. + SERIAL_ECHOLNPAIR(MSG_KP, tune_pid.Kp, MSG_KI, tune_pid.Ki, MSG_KD, tune_pid.Kd); + } + else { + tune_pid.Kp = Ku * pf; + tune_pid.Kd = tune_pid.Kp * Tu * df; + tune_pid.Ki = 2 * tune_pid.Kp / Tu; + SERIAL_ECHOLNPGM("\n" MSG_CLASSIC_PID); + SERIAL_ECHOLNPAIR(MSG_KP, tune_pid.Kp, MSG_KI, tune_pid.Ki, MSG_KD, tune_pid.Kd); + } + /** tune_pid.Kp = 0.33 * Ku; tune_pid.Ki = tune_pid.Kp / Tu; @@ -490,16 +501,16 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 } SHV((bias + d) >> 1, (bias + d) >> 1); cycles++; - min = target; + minT = target; } } } // Did the temperature overshoot very far? #ifndef MAX_OVERSHOOT_PID_AUTOTUNE - #define MAX_OVERSHOOT_PID_AUTOTUNE 20 + #define MAX_OVERSHOOT_PID_AUTOTUNE 30 #endif - if (current > target + MAX_OVERSHOOT_PID_AUTOTUNE) { + if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH); break; } @@ -524,16 +535,16 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_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 + if (current_temp > next_watch_temp) { // Over the watch temp? + next_watch_temp = current_temp + 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 + if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached } else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired - _temp_error(heater, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, heater)); + _temp_error(heater, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); } - else if (current < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? - _temp_error(heater, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, heater)); + else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? + _temp_error(heater, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); } #endif } // every 2 seconds @@ -551,7 +562,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_FINISHED); #if HAS_PID_FOR_BOTH - const char * const estring = GHV(PSTR("bed"), PSTR("")); + const char * const estring = GHV(PSTR("bed"), NUL_STR); say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp); say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki); say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd); @@ -616,76 +627,61 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 * Class and Instance Methods */ -Temperature::Temperature() { } - int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { switch (heater_id) { - default: return temp_hotend[heater_id].soft_pwm_amount; #if HAS_HEATED_BED case H_BED: return temp_bed.soft_pwm_amount; #endif #if HAS_HEATED_CHAMBER case H_CHAMBER: return temp_chamber.soft_pwm_amount; #endif + default: + #if HOTENDS + return temp_hotend[heater_id].soft_pwm_amount; + #else + return 0; + #endif } } +#define _EFANOVERLAP(A,B) _FANOVERLAP(E##A,B) + #if HAS_AUTO_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_5_IS_0 (E5_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) - #define AUTO_5_IS_1 (E5_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) - #define AUTO_5_IS_2 (E5_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) - #define AUTO_5_IS_3 (E5_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) - #define AUTO_5_IS_4 (E5_AUTO_FAN_PIN == E4_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) - #define AUTO_CHAMBER_IS_5 (CHAMBER_AUTO_FAN_PIN == E5_AUTO_FAN_PIN) - #define AUTO_CHAMBER_IS_E (AUTO_CHAMBER_IS_0 || AUTO_CHAMBER_IS_1 || AUTO_CHAMBER_IS_2 || AUTO_CHAMBER_IS_3 || AUTO_CHAMBER_IS_4 || AUTO_CHAMBER_IS_5) #define CHAMBER_FAN_INDEX HOTENDS void Temperature::checkExtruderAutoFans() { + #define _EFAN(B,A) _EFANOVERLAP(A,B) ? B : static const uint8_t fanBit[] PROGMEM = { 0 #if HOTENDS > 1 - , AUTO_1_IS_0 ? 0 : 1 - #endif - #if HOTENDS > 2 - , AUTO_2_IS_0 ? 0 : AUTO_2_IS_1 ? 1 : 2 - #endif - #if HOTENDS > 3 - , AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 : 3, - #endif - #if HOTENDS > 4 - , AUTO_4_IS_0 ? 0 : AUTO_4_IS_1 ? 1 : AUTO_4_IS_2 ? 2 : AUTO_4_IS_3 ? 3 : 4, - #endif - #if HOTENDS > 5 - , AUTO_5_IS_0 ? 0 : AUTO_5_IS_1 ? 1 : AUTO_5_IS_2 ? 2 : AUTO_5_IS_3 ? 3 : AUTO_5_IS_4 ? 4 : 5 + , REPEAT2(1,_EFAN,1) 1 + #if HOTENDS > 2 + , REPEAT2(2,_EFAN,2) 2 + #if HOTENDS > 3 + , REPEAT2(3,_EFAN,3) 3 + #if HOTENDS > 4 + , REPEAT2(4,_EFAN,4) 4 + #if HOTENDS > 5 + , REPEAT2(5,_EFAN,5) 5 + #endif + #endif + #endif + #endif #endif #if HAS_AUTO_CHAMBER_FAN - , 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 : AUTO_CHAMBER_IS_5 ? 5 : 6 + #define _CFAN(B) _FANOVERLAP(CHAMBER,B) ? B : + , REPEAT(HOTENDS,_CFAN) (HOTENDS) #endif }; - uint8_t fanState = 0; + uint8_t fanState = 0; HOTEND_LOOP() - if (temp_hotend[e].current >= EXTRUDER_AUTO_FAN_TEMPERATURE) + if (temp_hotend[e].celsius >= EXTRUDER_AUTO_FAN_TEMPERATURE) SBI(fanState, pgm_read_byte(&fanBit[e])); #if HAS_AUTO_CHAMBER_FAN - if (temp_chamber.current >= CHAMBER_AUTO_FAN_TEMPERATURE) + if (temp_chamber.celsius >= CHAMBER_AUTO_FAN_TEMPERATURE) SBI(fanState, pgm_read_byte(&fanBit[CHAMBER_FAN_INDEX])); #endif @@ -702,7 +698,7 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { if (TEST(fanDone, realFan)) continue; const bool fan_on = TEST(fanState, realFan); switch (f) { - #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_E + #if ENABLED(AUTO_POWER_CHAMBER_FAN) case CHAMBER_FAN_INDEX: chamberfan_speed = fan_on ? CHAMBER_AUTO_FAN_SPEED : 0; break; @@ -746,9 +742,28 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { // // Temperature Error Handlers // + +inline void loud_kill(PGM_P const lcd_msg, const heater_ind_t heater) { + Running = false; + #if USE_BEEPER + for (uint8_t i = 20; i--;) { + WRITE(BEEPER_PIN, HIGH); delay(25); + WRITE(BEEPER_PIN, LOW); delay(80); + } + WRITE(BEEPER_PIN, HIGH); + #endif + kill(lcd_msg, HEATER_PSTR(heater)); +} + void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, PGM_P const lcd_msg) { - static bool killed = false; - if (IsRunning()) { + + static uint8_t killed = 0; + + if (IsRunning() + #if BOGUS_TEMPERATURE_GRACE_PERIOD + && killed == 2 + #endif + ) { SERIAL_ERROR_START(); serialprintPGM(serial_msg); SERIAL_ECHOPGM(MSG_STOPPED_HEATER); @@ -760,144 +775,161 @@ void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, SERIAL_EOL(); } - #if DISABLED(BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE) - if (!killed) { - Running = false; - killed = true; - - disable_all_heaters(); - - #if HAS_BUZZER && PIN_EXISTS(BEEPER) - for (uint8_t i = 20; i--;) { - WRITE(BEEPER_PIN, HIGH); delay(25); - WRITE(BEEPER_PIN, LOW); delay(80); - } - WRITE(BEEPER_PIN, HIGH); - #endif + disable_all_heaters(); // always disable (even for bogus temp) - kill(lcd_msg); + #if BOGUS_TEMPERATURE_GRACE_PERIOD + const millis_t ms = millis(); + static millis_t expire_ms; + switch (killed) { + case 0: + expire_ms = ms + BOGUS_TEMPERATURE_GRACE_PERIOD; + ++killed; + break; + case 1: + if (ELAPSED(ms, expire_ms)) ++killed; + break; + case 2: + loud_kill(lcd_msg, heater); + ++killed; + break; } - else - disable_all_heaters(); // paranoia - #else + #elif defined(BOGUS_TEMPERATURE_GRACE_PERIOD) UNUSED(killed); + #else + if (!killed) { killed = 1; loud_kill(lcd_msg, heater); } #endif } void Temperature::max_temp_error(const heater_ind_t heater) { - _temp_error(heater, PSTR(MSG_T_MAXTEMP), TEMP_ERR_PSTR(MSG_ERR_MAXTEMP, heater)); + _temp_error(heater, PSTR(MSG_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP)); } void Temperature::min_temp_error(const heater_ind_t heater) { - _temp_error(heater, PSTR(MSG_T_MINTEMP), TEMP_ERR_PSTR(MSG_ERR_MINTEMP, heater)); + _temp_error(heater, PSTR(MSG_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP)); } -float Temperature::get_pid_output_hotend(const uint8_t e) { - #if HOTENDS == 1 - #define _HOTEND_TEST true - #else - #define _HOTEND_TEST (e == active_extruder) - #endif - E_UNUSED(); - const uint8_t ee = HOTEND_INDEX; - float pid_output; - #if ENABLED(PIDTEMP) - #if DISABLED(PID_OPENLOOP) - static hotend_pid_t work_pid[HOTENDS]; - static float temp_iState[HOTENDS] = { 0 }, - temp_dState[HOTENDS] = { 0 }; - static bool pid_reset[HOTENDS] = { false }; - const float pid_error = temp_hotend[ee].target - temp_hotend[ee].current; - - if (temp_hotend[ee].target == 0 - || pid_error < -(PID_FUNCTIONAL_RANGE) - #if HEATER_IDLE_HANDLER - || hotend_idle[ee].timed_out - #endif - ) { - pid_output = 0; - pid_reset[ee] = true; - } - else if (pid_error > PID_FUNCTIONAL_RANGE) { - pid_output = BANG_MAX; - pid_reset[ee] = true; - } - else { - if (pid_reset[ee]) { - temp_iState[ee] = 0.0; - work_pid[ee].Kd = 0.0; - pid_reset[ee] = false; - } - - work_pid[ee].Kd = work_pid[ee].Kd + PID_K2 * (PID_PARAM(Kd, ee) * (temp_dState[ee] - temp_hotend[ee].current) - work_pid[ee].Kd); - const float max_power_over_i_gain = (float)PID_MAX / PID_PARAM(Ki, ee); - temp_iState[ee] = constrain(temp_iState[ee] + pid_error, 0, max_power_over_i_gain); - work_pid[ee].Kp = PID_PARAM(Kp, ee) * pid_error; - work_pid[ee].Ki = PID_PARAM(Ki, ee) * temp_iState[ee]; - - pid_output = work_pid[ee].Kp + work_pid[ee].Ki + work_pid[ee].Kd; - - #if ENABLED(PID_EXTRUSION_SCALING) - work_pid[ee].Kc = 0; - if (_HOTEND_TEST) { - const 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 - lpq[lpq_ptr] = 0; +#if HOTENDS - if (++lpq_ptr >= lpq_len) lpq_ptr = 0; - work_pid[ee].Kc = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, ee); - pid_output += work_pid[ee].Kc; + float Temperature::get_pid_output_hotend(const uint8_t E_NAME) { + const uint8_t ee = HOTEND_INDEX; + #if ENABLED(PIDTEMP) + #if DISABLED(PID_OPENLOOP) + static hotend_pid_t work_pid[HOTENDS]; + static float temp_iState[HOTENDS] = { 0 }, + temp_dState[HOTENDS] = { 0 }; + static bool pid_reset[HOTENDS] = { false }; + const float pid_error = temp_hotend[ee].target - temp_hotend[ee].celsius; + + float pid_output; + + if (temp_hotend[ee].target == 0 + || pid_error < -(PID_FUNCTIONAL_RANGE) + #if HEATER_IDLE_HANDLER + || hotend_idle[ee].timed_out + #endif + ) { + pid_output = 0; + pid_reset[ee] = true; + } + else if (pid_error > PID_FUNCTIONAL_RANGE) { + pid_output = BANG_MAX; + pid_reset[ee] = true; + } + else { + if (pid_reset[ee]) { + temp_iState[ee] = 0.0; + work_pid[ee].Kd = 0.0; + pid_reset[ee] = false; } - #endif // PID_EXTRUSION_SCALING - pid_output = constrain(pid_output, 0, PID_MAX); - } - temp_dState[ee] = temp_hotend[ee].current; + work_pid[ee].Kd = work_pid[ee].Kd + PID_K2 * (PID_PARAM(Kd, ee) * (temp_dState[ee] - temp_hotend[ee].celsius) - work_pid[ee].Kd); + const float max_power_over_i_gain = float(PID_MAX) / PID_PARAM(Ki, ee) - float(MIN_POWER); + temp_iState[ee] = constrain(temp_iState[ee] + pid_error, 0, max_power_over_i_gain); + work_pid[ee].Kp = PID_PARAM(Kp, ee) * pid_error; + work_pid[ee].Ki = PID_PARAM(Ki, ee) * temp_iState[ee]; - #else // PID_OPENLOOP + pid_output = work_pid[ee].Kp + work_pid[ee].Ki + work_pid[ee].Kd + float(MIN_POWER); - const float pid_output = constrain(temp_hotend[ee].target, 0, PID_MAX); + #if ENABLED(PID_EXTRUSION_SCALING) + #if HOTENDS == 1 + constexpr bool this_hotend = true; + #else + const bool this_hotend = (ee == active_extruder); + #endif + work_pid[ee].Kc = 0; + if (this_hotend) { + const 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 + lpq[lpq_ptr] = 0; - #endif // PID_OPENLOOP + if (++lpq_ptr >= lpq_len) lpq_ptr = 0; + work_pid[ee].Kc = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, ee); + pid_output += work_pid[ee].Kc; + } + #endif // PID_EXTRUSION_SCALING - #if ENABLED(PID_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR( - MSG_PID_DEBUG, ee, - MSG_PID_DEBUG_INPUT, temp_hotend[ee].current, - MSG_PID_DEBUG_OUTPUT, pid_output - ); - #if DISABLED(PID_OPENLOOP) - SERIAL_ECHOPAIR( - MSG_PID_DEBUG_PTERM, work_pid[ee].Kp, - MSG_PID_DEBUG_ITERM, work_pid[ee].Ki, - MSG_PID_DEBUG_DTERM, work_pid[ee].Kd - #if ENABLED(PID_EXTRUSION_SCALING) - , MSG_PID_DEBUG_CTERM, work_pid[ee].Kc + #if ENABLED(PID_FAN_SCALING) + if (thermalManager.fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) { + work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * thermalManager.fan_speed[active_extruder]; + pid_output += work_pid[ee].Kf; + } + //pid_output -= work_pid[ee].Ki; + //pid_output += work_pid[ee].Ki * work_pid[ee].Kf + #endif // PID_FAN_SCALING + + LIMIT(pid_output, 0, PID_MAX); + } + temp_dState[ee] = temp_hotend[ee].celsius; + + #else // PID_OPENLOOP + + const float pid_output = constrain(temp_hotend[ee].target, 0, PID_MAX); + + #endif // PID_OPENLOOP + + #if ENABLED(PID_DEBUG) + if (ee == active_extruder) { + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR( + MSG_PID_DEBUG, ee, + MSG_PID_DEBUG_INPUT, temp_hotend[ee].celsius, + MSG_PID_DEBUG_OUTPUT, pid_output + ); + #if DISABLED(PID_OPENLOOP) + { + SERIAL_ECHOPAIR( + MSG_PID_DEBUG_PTERM, work_pid[ee].Kp, + MSG_PID_DEBUG_ITERM, work_pid[ee].Ki, + MSG_PID_DEBUG_DTERM, work_pid[ee].Kd + #if ENABLED(PID_EXTRUSION_SCALING) + , MSG_PID_DEBUG_CTERM, work_pid[ee].Kc + #endif + ); + } #endif - ); - #endif - SERIAL_EOL(); - #endif // PID_DEBUG + SERIAL_EOL(); + } + #endif // PID_DEBUG - #else // No PID enabled + #else // No PID enabled + + #if HEATER_IDLE_HANDLER + const bool is_idling = hotend_idle[ee].timed_out; + #else + constexpr bool is_idling = false; + #endif + const float pid_output = (!is_idling && temp_hotend[ee].celsius < temp_hotend[ee].target) ? BANG_MAX : 0; - #if HEATER_IDLE_HANDLER - #define _TIMED_OUT_TEST hotend_idle[ee].timed_out - #else - #define _TIMED_OUT_TEST false #endif - pid_output = (!_TIMED_OUT_TEST && temp_hotend[ee].current < temp_hotend[ee].target) ? BANG_MAX : 0; - #undef _TIMED_OUT_TEST - #endif + return pid_output; + } - return pid_output; -} +#endif // HOTENDS #if ENABLED(PIDTEMPBED) @@ -905,21 +937,38 @@ float Temperature::get_pid_output_hotend(const uint8_t e) { #if DISABLED(PID_OPENLOOP) - static PID_t work_pid = { 0 }; + static PID_t work_pid{0}; static float temp_iState = 0, temp_dState = 0; + static bool pid_reset = true; + float pid_output = 0; + const float max_power_over_i_gain = float(MAX_BED_POWER) / temp_bed.pid.Ki - float(MIN_BED_POWER), + pid_error = temp_bed.target - temp_bed.celsius; - const float max_power_over_i_gain = (float)MAX_BED_POWER / temp_bed.pid.Ki, - pid_error = temp_bed.target - temp_bed.current; + if (!temp_bed.target || pid_error < -(PID_FUNCTIONAL_RANGE)) { + pid_output = 0; + pid_reset = true; + } + else if (pid_error > PID_FUNCTIONAL_RANGE) { + pid_output = MAX_BED_POWER; + pid_reset = true; + } + else { + if (pid_reset) { + temp_iState = 0.0; + work_pid.Kd = 0.0; + pid_reset = false; + } - temp_iState = constrain(temp_iState + pid_error, 0, max_power_over_i_gain); + temp_iState = constrain(temp_iState + pid_error, 0, max_power_over_i_gain); - work_pid.Kp = temp_bed.pid.Kp * pid_error; - work_pid.Ki = temp_bed.pid.Ki * temp_iState; - work_pid.Kd = work_pid.Kd + PID_K2 * (temp_bed.pid.Kd * (temp_dState - temp_bed.current) - work_pid.Kd); + work_pid.Kp = temp_bed.pid.Kp * pid_error; + work_pid.Ki = temp_bed.pid.Ki * temp_iState; + work_pid.Kd = work_pid.Kd + PID_K2 * (temp_bed.pid.Kd * (temp_dState - temp_bed.celsius) - work_pid.Kd); - temp_dState = temp_bed.current; + temp_dState = temp_bed.celsius; - const float pid_output = constrain(work_pid.Kp + work_pid.Ki + work_pid.Kd, 0, MAX_BED_POWER); + pid_output = constrain(work_pid.Kp + work_pid.Ki + work_pid.Kd + float(MIN_BED_POWER), 0, MAX_BED_POWER); + } #else // PID_OPENLOOP @@ -928,15 +977,17 @@ float Temperature::get_pid_output_hotend(const uint8_t e) { #endif // PID_OPENLOOP #if ENABLED(PID_BED_DEBUG) + { SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR( - " PID_BED_DEBUG : Input ", temp_bed.current, " Output ", pid_output, + " PID_BED_DEBUG : Input ", temp_bed.celsius, " Output ", pid_output, #if DISABLED(PID_OPENLOOP) MSG_PID_DEBUG_PTERM, work_pid.Kp, MSG_PID_DEBUG_ITERM, work_pid.Ki, MSG_PID_DEBUG_DTERM, work_pid.Kd, #endif ); + } #endif return pid_output; @@ -957,10 +1008,7 @@ void Temperature::manage_heater() { #if EARLY_WATCHDOG // If thermal manager is still not running, make sure to at least reset the watchdog! - if (!inited) { - watchdog_reset(); - return; - } + if (!inited) return watchdog_refresh(); #endif #if BOTH(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING) @@ -976,64 +1024,55 @@ void Temperature::manage_heater() { updateTemperaturesFromRawValues(); // also resets the watchdog #if ENABLED(HEATER_0_USES_MAX6675) - if (temp_hotend[0].current > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0); - if (temp_hotend[0].current < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0); + if (temp_hotend[0].celsius > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0); + if (temp_hotend[0].celsius < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0); #endif #if ENABLED(HEATER_1_USES_MAX6675) - if (temp_hotend[1].current > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1); - if (temp_hotend[1].current < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1); + if (temp_hotend[1].celsius > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1); + if (temp_hotend[1].celsius < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1); #endif - #define HAS_THERMAL_PROTECTION (ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED || ENABLED(THERMAL_PROTECTION_CHAMBER)) + millis_t ms = millis(); - #if HAS_THERMAL_PROTECTION || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER - millis_t ms = millis(); - #endif + #if HOTENDS - #if HAS_THERMAL_PROTECTION - #if THERMAL_PROTECTION_GRACE_PERIOD > 0 - static millis_t grace_period = ms + THERMAL_PROTECTION_GRACE_PERIOD; - if (ELAPSED(ms, grace_period)) grace_period = 0UL; - #else - static constexpr millis_t grace_period = 0UL; - #endif - #endif + HOTEND_LOOP() { + #if ENABLED(THERMAL_PROTECTION_HOTENDS) + if (degHotend(e) > temp_range[e].maxtemp) + _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); + #endif - HOTEND_LOOP() { - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - if (!grace_period && degHotend(e) > temp_range[e].maxtemp) - _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, e)); - #endif + #if HEATER_IDLE_HANDLER + hotend_idle[e].update(ms); + #endif - #if HEATER_IDLE_HANDLER - hotend_idle[e].update(ms); - #endif + #if ENABLED(THERMAL_PROTECTION_HOTENDS) + // Check for thermal runaway + thermal_runaway_protection(tr_state_machine[e], temp_hotend[e].celsius, temp_hotend[e].target, (heater_ind_t)e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); + #endif - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - // Check for thermal runaway - thermal_runaway_protection(tr_state_machine[e], temp_hotend[e].current, temp_hotend[e].target, (heater_ind_t)e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); - #endif + temp_hotend[e].soft_pwm_amount = (temp_hotend[e].celsius > temp_range[e].mintemp || is_preheating(e)) && temp_hotend[e].celsius < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0; - temp_hotend[e].soft_pwm_amount = (temp_hotend[e].current > temp_range[e].mintemp || is_preheating(e)) && temp_hotend[e].current < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0; + #if WATCH_HOTENDS + // Make sure temperature is increasing + if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) { // Time to check this extruder? + if (degHotend(e) < watch_hotend[e].target) // Failed to increase enough? + _temp_error((heater_ind_t)e, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); + else // Start again if the target is still far off + start_watching_hotend(e); + } + #endif - #if WATCH_HOTENDS - // Make sure temperature is increasing - if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) { // Time to check this extruder? - if (degHotend(e) < watch_hotend[e].target) // Failed to increase enough? - _temp_error((heater_ind_t)e, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, e)); - else // Start again if the target is still far off - start_watching_hotend(e); - } - #endif + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + // Make sure measured temperatures are close together + if (ABS(temp_hotend[0].celsius - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) + _temp_error(H_E0, PSTR(MSG_REDUNDANCY), GET_TEXT(MSG_ERR_REDUNDANT_TEMP)); + #endif - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - // Make sure measured temperatures are close together - if (ABS(temp_hotend[0].current - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) - _temp_error(H_E0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP)); - #endif + } // HOTEND_LOOP - } // HOTEND_LOOP + #endif // HOTENDS #if HAS_AUTO_FAN if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently @@ -1044,29 +1083,24 @@ void Temperature::manage_heater() { #if ENABLED(FILAMENT_WIDTH_SENSOR) /** - * Filament Width Sensor dynamically sets the volumetric multiplier - * based on a delayed measurement of the filament diameter. + * Dynamically set the volumetric multiplier based + * on the delayed Filament Width measurement. */ - if (filament_sensor) { - meas_shift_index = filwidth_delay_index[0] - meas_delay_cm; - if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1; //loop around buffer if needed - meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY); - planner.calculate_volumetric_for_width_sensor(measurement_delay[meas_shift_index]); - } - #endif // FILAMENT_WIDTH_SENSOR + filwidth.update_volumetric(); + #endif #if HAS_HEATED_BED #if ENABLED(THERMAL_PROTECTION_BED) - if (!grace_period && degBed() > BED_MAXTEMP) - _temp_error(H_BED, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_BED)); + if (degBed() > BED_MAXTEMP) + _temp_error(H_BED, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); #endif #if WATCH_BED // Make sure temperature is increasing if (watch_bed.elapsed(ms)) { // Time to check the bed? if (degBed() < watch_bed.target) // Failed to increase enough? - _temp_error(H_BED, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, H_BED)); + _temp_error(H_BED, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); else // Start again if the target is still far off start_watching_bed(); } @@ -1091,7 +1125,7 @@ void Temperature::manage_heater() { #endif #if HAS_THERMALLY_PROTECTED_BED - thermal_runaway_protection(tr_state_machine_bed, temp_bed.current, temp_bed.target, H_BED, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS); + thermal_runaway_protection(tr_state_machine_bed, temp_bed.celsius, temp_bed.target, H_BED, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS); #endif #if HEATER_IDLE_HANDLER @@ -1105,17 +1139,17 @@ void Temperature::manage_heater() { #endif { #if ENABLED(PIDTEMPBED) - temp_bed.soft_pwm_amount = WITHIN(temp_bed.current, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; + temp_bed.soft_pwm_amount = WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; #else // Check if temperature is within the correct band - if (WITHIN(temp_bed.current, BED_MINTEMP, BED_MAXTEMP)) { + if (WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP)) { #if ENABLED(BED_LIMIT_SWITCHING) - if (temp_bed.current >= temp_bed.target + BED_HYSTERESIS) + if (temp_bed.celsius >= temp_bed.target + BED_HYSTERESIS) temp_bed.soft_pwm_amount = 0; - else if (temp_bed.current <= temp_bed.target - (BED_HYSTERESIS)) + else if (temp_bed.celsius <= temp_bed.target - (BED_HYSTERESIS)) temp_bed.soft_pwm_amount = MAX_BED_POWER >> 1; #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING - temp_bed.soft_pwm_amount = temp_bed.current < temp_bed.target ? MAX_BED_POWER >> 1 : 0; + temp_bed.soft_pwm_amount = temp_bed.celsius < temp_bed.target ? MAX_BED_POWER >> 1 : 0; #endif } else { @@ -1136,15 +1170,15 @@ void Temperature::manage_heater() { #endif #if ENABLED(THERMAL_PROTECTION_CHAMBER) - if (!grace_period && degChamber() > CHAMBER_MAXTEMP) - _temp_error(H_CHAMBER, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_CHAMBER)); + if (degChamber() > CHAMBER_MAXTEMP) + _temp_error(H_CHAMBER, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); #endif #if WATCH_CHAMBER // Make sure temperature is increasing if (watch_chamber.elapsed(ms)) { // Time to check the chamber? if (degChamber() < watch_chamber.target) // Failed to increase enough? - _temp_error(H_CHAMBER, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, H_CHAMBER)); + _temp_error(H_CHAMBER, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); else start_watching_chamber(); // Start again if the target is still far off } @@ -1153,14 +1187,14 @@ void Temperature::manage_heater() { if (ELAPSED(ms, next_chamber_check_ms)) { next_chamber_check_ms = ms + CHAMBER_CHECK_INTERVAL; - if (WITHIN(temp_chamber.current, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) { + if (WITHIN(temp_chamber.celsius, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) { #if ENABLED(CHAMBER_LIMIT_SWITCHING) - if (temp_chamber.current >= temp_chamber.target + TEMP_CHAMBER_HYSTERESIS) + if (temp_chamber.celsius >= temp_chamber.target + TEMP_CHAMBER_HYSTERESIS) temp_chamber.soft_pwm_amount = 0; - else if (temp_chamber.current <= temp_chamber.target - (TEMP_CHAMBER_HYSTERESIS)) + else if (temp_chamber.celsius <= temp_chamber.target - (TEMP_CHAMBER_HYSTERESIS)) temp_chamber.soft_pwm_amount = MAX_CHAMBER_POWER >> 1; #else - temp_chamber.soft_pwm_amount = temp_chamber.current < temp_chamber.target ? MAX_CHAMBER_POWER >> 1 : 0; + temp_chamber.soft_pwm_amount = temp_chamber.celsius < temp_chamber.target ? MAX_CHAMBER_POWER >> 1 : 0; #endif } else { @@ -1169,14 +1203,16 @@ void Temperature::manage_heater() { } #if ENABLED(THERMAL_PROTECTION_CHAMBER) - thermal_runaway_protection(tr_state_machine_chamber, temp_chamber.current, temp_chamber.target, H_CHAMBER, THERMAL_PROTECTION_CHAMBER_PERIOD, THERMAL_PROTECTION_CHAMBER_HYSTERESIS); + thermal_runaway_protection(tr_state_machine_chamber, temp_chamber.celsius, temp_chamber.target, H_CHAMBER, THERMAL_PROTECTION_CHAMBER_PERIOD, THERMAL_PROTECTION_CHAMBER_HYSTERESIS); #endif } // TODO: Implement true PID pwm - //temp_bed.soft_pwm_amount = WITHIN(temp_chamber.current, CHAMBER_MINTEMP, CHAMBER_MAXTEMP) ? (int)get_pid_output_chamber() >> 1 : 0; + //temp_bed.soft_pwm_amount = WITHIN(temp_chamber.celsius, CHAMBER_MINTEMP, CHAMBER_MAXTEMP) ? (int)get_pid_output_chamber() >> 1 : 0; #endif // HAS_HEATED_CHAMBER + + UNUSED(ms); } #define TEMP_AD595(RAW) ((RAW) * 5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET) @@ -1293,27 +1329,28 @@ void Temperature::manage_heater() { if (!WITHIN(t_index, 0, COUNT(user_thermistor) - 1)) return 25; - if (user_thermistor[t_index].pre_calc) { - // pre-calculate some variables - user_thermistor[t_index].pre_calc = false; - user_thermistor[t_index].res_25_recip = 1.0f / user_thermistor[t_index].res_25; - user_thermistor[t_index].res_25_log = logf(user_thermistor[t_index].res_25); - user_thermistor[t_index].beta_recip = 1.0f / user_thermistor[t_index].beta; - user_thermistor[t_index].sh_alpha = (1.0f / (THERMISTOR_RESISTANCE_NOMINAL_C - THERMISTOR_ABS_ZERO_C)) - (user_thermistor[t_index].beta_recip * user_thermistor[t_index].res_25_log) - (user_thermistor[t_index].sh_c_coeff * user_thermistor[t_index].res_25_log * user_thermistor[t_index].res_25_log * user_thermistor[t_index].res_25_log); + user_thermistor_t &t = user_thermistor[t_index]; + if (t.pre_calc) { // pre-calculate some variables + t.pre_calc = false; + t.res_25_recip = 1.0f / t.res_25; + t.res_25_log = logf(t.res_25); + t.beta_recip = 1.0f / t.beta; + t.sh_alpha = RECIPROCAL(THERMISTOR_RESISTANCE_NOMINAL_C - (THERMISTOR_ABS_ZERO_C)) + - (t.beta_recip * t.res_25_log) - (t.sh_c_coeff * cu(t.res_25_log)); } // maximum adc value .. take into account the over sampling - const int adc_max = (THERMISTOR_ADC_RESOLUTION * OVERSAMPLENR) - 1, + const int adc_max = MAX_RAW_THERMISTOR_VALUE, adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero const float adc_inverse = (adc_max - adc_raw) - 0.5f, - resistance = user_thermistor[t_index].series_res * (adc_raw + 0.5f) / adc_inverse, + resistance = t.series_res * (adc_raw + 0.5f) / adc_inverse, log_resistance = logf(resistance); - float value = user_thermistor[t_index].sh_alpha; - value += log_resistance * user_thermistor[t_index].beta_recip; - if (user_thermistor[t_index].sh_c_coeff != 0) - value += user_thermistor[t_index].sh_c_coeff * log_resistance * log_resistance * log_resistance; + float value = t.sh_alpha; + value += log_resistance * t.beta_recip; + if (t.sh_c_coeff != 0) + value += t.sh_c_coeff * cu(log_resistance); value = 1.0f / value; //#if (MOTHERBOARD == BOARD_RAMPS_14_EFB) @@ -1329,98 +1366,106 @@ void Temperature::manage_heater() { } #endif -// Derived from RepRap FiveD extruder::getTemperature() -// For hot end temperature measurement. -float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) { - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - if (e > HOTENDS) - #else - if (e >= HOTENDS) - #endif - { - SERIAL_ERROR_START(); - SERIAL_ECHO((int)e); - SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER_NUM); - kill(); - return 0.0; - } +#if HOTENDS + // Derived from RepRap FiveD extruder::getTemperature() + // For hot end temperature measurement. + float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) { + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + if (e > HOTENDS) + #else + if (e >= HOTENDS) + #endif + { + SERIAL_ERROR_START(); + SERIAL_ECHO((int)e); + SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER_NUM); + kill(); + return 0.0; + } - switch (e) { - case 0: - #if ENABLED(HEATER_0_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_0, raw); - #elif 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_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_1, raw); - #elif ENABLED(HEATER_1_USES_MAX6675) - return raw * 0.25; - #elif 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_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_2, raw); - #elif 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_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_3, raw); - #elif 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_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_4, raw); - #elif ENABLED(HEATER_4_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_4_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 5: - #if ENABLED(HEATER_5_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_5, raw); - #elif ENABLED(HEATER_5_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_5_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - default: break; - } + switch (e) { + case 0: + #if ENABLED(HEATER_0_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_0, raw); + #elif ENABLED(HEATER_0_USES_MAX6675) + return ( + #if ENABLED(MAX6675_IS_MAX31865) + max31865.temperature(100, 400) // 100 ohms = PT100 resistance. 400 ohms = calibration resistor + #else + raw * 0.25 + #endif + ); + #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_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_1, raw); + #elif ENABLED(HEATER_1_USES_MAX6675) + return raw * 0.25; + #elif 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_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_2, raw); + #elif 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_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_3, raw); + #elif 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_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_4, raw); + #elif ENABLED(HEATER_4_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_4_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif + case 5: + #if ENABLED(HEATER_5_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_5, raw); + #elif ENABLED(HEATER_5_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_5_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]); - #endif + #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]); + #endif - return 0; -} + return 0; + } +#endif // HOTENDS #if HAS_HEATED_BED // Derived from RepRap FiveD extruder::getTemperature() @@ -1471,58 +1516,38 @@ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(HEATER_1_USES_MAX6675) temp_hotend[1].raw = READ_MAX6675(1); #endif - HOTEND_LOOP() temp_hotend[e].current = analog_to_celsius_hotend(temp_hotend[e].raw, e); + #if HOTENDS + HOTEND_LOOP() temp_hotend[e].celsius = analog_to_celsius_hotend(temp_hotend[e].raw, e); + #endif #if HAS_HEATED_BED - temp_bed.current = analog_to_celsius_bed(temp_bed.raw); + temp_bed.celsius = analog_to_celsius_bed(temp_bed.raw); #endif #if HAS_TEMP_CHAMBER - temp_chamber.current = analog_to_celsius_chamber(temp_chamber.raw); + temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.raw); #endif #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature = analog_to_celsius_hotend(redundant_temperature_raw, 1); #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - filament_width_meas = analog_to_mm_fil_width(); + filwidth.update_measured_mm(); #endif - #if ENABLED(USE_WATCHDOG) - // Reset the watchdog after we know we have a temperature measurement. - watchdog_reset(); - #endif + // Reset the watchdog on good temperature measurement + watchdog_refresh(); temp_meas_ready = false; } - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - - // Convert raw Filament Width to millimeters - float Temperature::analog_to_mm_fil_width() { - return current_raw_filwidth * 5.0f * (1.0f / 16383.0f); - } - - /** - * Convert Filament Width (mm) to a simple ratio - * and reduce to an 8 bit value. - * - * A nominal width of 1.75 and measured width of 1.73 - * gives (100 * 1.75 / 1.73) for a ratio of 101 and - * 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; - return 0; - } - -#endif - #if MAX6675_SEPARATE_SPI SPIclass max6675_spi; #endif // Init fans according to whether they're native PWM or Software PWM -#define _INIT_SOFT_FAN(P) OUT_WRITE(P, FAN_INVERTING ? LOW : HIGH) +#ifdef ALFAWISE_UX0 + #define _INIT_SOFT_FAN(P) OUT_WRITE_OD(P, FAN_INVERTING ? LOW : HIGH) +#else + #define _INIT_SOFT_FAN(P) OUT_WRITE(P, FAN_INVERTING ? LOW : HIGH) +#endif #if ENABLED(FAN_SOFT_PWM) #define _INIT_FAN_PIN(P) _INIT_SOFT_FAN(P) #else @@ -1545,13 +1570,16 @@ void Temperature::updateTemperaturesFromRawValues() { #define INIT_CHAMBER_AUTO_FAN_PIN(P) SET_OUTPUT(P) #endif - /** * Initialize the temperature manager * The manager is implemented by periodic calls to manage_heater() */ void Temperature::init() { + #if ENABLED(MAX6675_IS_MAX31865) + max31865.begin(MAX31865_2WIRE); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE + #endif + #if EARLY_WATCHDOG // Flag that the thermalManager should be running if (inited) return; @@ -1572,8 +1600,13 @@ void Temperature::init() { #endif #if HAS_HEATER_0 - OUT_WRITE(HEATER_0_PIN, HEATER_0_INVERTING); + #ifdef ALFAWISE_UX0 + OUT_WRITE_OD(HEATER_0_PIN, HEATER_0_INVERTING); + #else + OUT_WRITE(HEATER_0_PIN, HEATER_0_INVERTING); + #endif #endif + #if HAS_HEATER_1 OUT_WRITE(HEATER_1_PIN, HEATER_1_INVERTING); #endif @@ -1589,9 +1622,15 @@ void Temperature::init() { #if HAS_HEATER_5 OUT_WRITE(HEATER_5_PIN, HEATER_5_INVERTING); #endif + #if HAS_HEATED_BED - OUT_WRITE(HEATER_BED_PIN, HEATER_BED_INVERTING); + #ifdef ALFAWISE_UX0 + OUT_WRITE_OD(HEATER_BED_PIN, HEATER_BED_INVERTING); + #else + OUT_WRITE(HEATER_BED_PIN, HEATER_BED_INVERTING); + #endif #endif + #if HAS_HEATED_CHAMBER OUT_WRITE(HEATER_CHAMBER_PIN, HEATER_CHAMBER_INVERTING); #endif @@ -1646,6 +1685,18 @@ void Temperature::init() { #if HAS_TEMP_ADC_5 HAL_ANALOG_SELECT(TEMP_5_PIN); #endif + #if HAS_JOY_ADC_X + HAL_ANALOG_SELECT(JOY_X_PIN); + #endif + #if HAS_JOY_ADC_Y + HAL_ANALOG_SELECT(JOY_Y_PIN); + #endif + #if HAS_JOY_ADC_Z + HAL_ANALOG_SELECT(JOY_Z_PIN); + #endif + #if HAS_JOY_ADC_EN + SET_INPUT_PULLUP(JOY_EN_PIN); + #endif #if HAS_HEATED_BED HAL_ANALOG_SELECT(TEMP_BED_PIN); #endif @@ -1655,6 +1706,9 @@ void Temperature::init() { #if ENABLED(FILAMENT_WIDTH_SENSOR) HAL_ANALOG_SELECT(FILWIDTH_PIN); #endif + #if HAS_ADC_BUTTONS + HAL_ANALOG_SELECT(ADC_KEYPAD_PIN); + #endif HAL_timer_start(TEMP_TIMER_NUM, TEMP_TIMER_FREQUENCY); ENABLE_TEMPERATURE_INTERRUPT(); @@ -1662,19 +1716,19 @@ void Temperature::init() { #if HAS_AUTO_FAN_0 INIT_E_AUTO_FAN_PIN(E0_AUTO_FAN_PIN); #endif - #if HAS_AUTO_FAN_1 && !AUTO_1_IS_0 + #if HAS_AUTO_FAN_1 && !_EFANOVERLAP(1,0) INIT_E_AUTO_FAN_PIN(E1_AUTO_FAN_PIN); #endif - #if HAS_AUTO_FAN_2 && !(AUTO_2_IS_0 || AUTO_2_IS_1) + #if HAS_AUTO_FAN_2 && !(_EFANOVERLAP(2,0) || _EFANOVERLAP(2,1)) INIT_E_AUTO_FAN_PIN(E2_AUTO_FAN_PIN); #endif - #if HAS_AUTO_FAN_3 && !(AUTO_3_IS_0 || AUTO_3_IS_1 || AUTO_3_IS_2) + #if HAS_AUTO_FAN_3 && !(_EFANOVERLAP(3,0) || _EFANOVERLAP(3,1) || _EFANOVERLAP(3,2)) INIT_E_AUTO_FAN_PIN(E3_AUTO_FAN_PIN); #endif - #if HAS_AUTO_FAN_4 && !(AUTO_4_IS_0 || AUTO_4_IS_1 || AUTO_4_IS_2 || AUTO_4_IS_3) + #if HAS_AUTO_FAN_4 && !(_EFANOVERLAP(4,0) || _EFANOVERLAP(4,1) || _EFANOVERLAP(4,2) || _EFANOVERLAP(4,3)) INIT_E_AUTO_FAN_PIN(E4_AUTO_FAN_PIN); #endif - #if HAS_AUTO_FAN_5 && !(AUTO_5_IS_0 || AUTO_5_IS_1 || AUTO_5_IS_2 || AUTO_5_IS_3 || AUTO_5_IS_4) + #if HAS_AUTO_FAN_5 && !(_EFANOVERLAP(5,0) || _EFANOVERLAP(5,1) || _EFANOVERLAP(5,2) || _EFANOVERLAP(5,3) || _EFANOVERLAP(5,4)) INIT_E_AUTO_FAN_PIN(E5_AUTO_FAN_PIN); #endif #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_E @@ -1744,7 +1798,7 @@ void Temperature::init() { #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #endif // HOTENDS > 1 + #endif // HOTENDS #if HAS_HEATED_BED #ifdef BED_MINTEMP @@ -1775,8 +1829,7 @@ void Temperature::init() { * their target temperature by a configurable margin. * This is called when the temperature is set. (M104, M109) */ - void Temperature::start_watching_hotend(const uint8_t e) { - E_UNUSED(); + void Temperature::start_watching_hotend(const uint8_t E_NAME) { const uint8_t ee = HOTEND_INDEX; if (degTargetHotend(ee) && degHotend(ee) < degTargetHotend(ee) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { watch_hotend[ee].target = degHotend(ee) + WATCH_TEMP_INCREASE; @@ -1906,11 +1959,11 @@ void Temperature::init() { sm.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), GET_TEXT(MSG_THERMAL_RUNAWAY)); } } -#endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED || ENABLED(THERMAL_PROTECTION_CHAMBER) +#endif // HAS_THERMAL_PROTECTION void Temperature::disable_all_heaters() { @@ -1918,7 +1971,9 @@ void Temperature::disable_all_heaters() { planner.autotemp_enabled = false; #endif - HOTEND_LOOP() setTargetHotend(0, e); + #if HOTENDS + HOTEND_LOOP() setTargetHotend(0, e); + #endif #if HAS_HEATED_BED setTargetBed(0); @@ -1940,22 +1995,7 @@ void Temperature::disable_all_heaters() { } #if HAS_TEMP_HOTEND - DISABLE_HEATER(0); - #if HOTENDS > 1 - DISABLE_HEATER(1); - #if HOTENDS > 2 - DISABLE_HEATER(2); - #if HOTENDS > 3 - DISABLE_HEATER(3); - #if HOTENDS > 4 - DISABLE_HEATER(4); - #if HOTENDS > 5 - DISABLE_HEATER(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + REPEAT(HOTENDS, DISABLE_HEATER); #endif #if HAS_HEATED_BED @@ -2035,6 +2075,10 @@ void Temperature::disable_all_heaters() { next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL; + #if ENABLED(MAX6675_IS_MAX31865) + max6675_temp = int(max31865.temperature(100, 400)); // 100 ohms = PT100 resistance. 400 ohms = calibration resistor + #endif + // // TODO: spiBegin, spiRec and spiInit doesn't work when soft spi is used. // @@ -2122,23 +2166,23 @@ void Temperature::disable_all_heaters() { void Temperature::set_current_temp_raw() { #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) - temp_hotend[0].raw = temp_hotend[0].acc; + temp_hotend[0].update(); #endif #if HAS_TEMP_ADC_1 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature_raw = temp_hotend[1].acc; #elif DISABLED(HEATER_1_USES_MAX6675) - temp_hotend[1].raw = temp_hotend[1].acc; + temp_hotend[1].update(); #endif #if HAS_TEMP_ADC_2 - temp_hotend[2].raw = temp_hotend[2].acc; + temp_hotend[2].update(); #if HAS_TEMP_ADC_3 - temp_hotend[3].raw = temp_hotend[3].acc; + temp_hotend[3].update(); #if HAS_TEMP_ADC_4 - temp_hotend[4].raw = temp_hotend[4].acc; + temp_hotend[4].update(); #if HAS_TEMP_ADC_5 - temp_hotend[5].raw = temp_hotend[5].acc; + temp_hotend[5].update(); #endif // HAS_TEMP_ADC_5 #endif // HAS_TEMP_ADC_4 #endif // HAS_TEMP_ADC_3 @@ -2146,100 +2190,106 @@ void Temperature::set_current_temp_raw() { #endif // HAS_TEMP_ADC_1 #if HAS_HEATED_BED - temp_bed.raw = temp_bed.acc; + temp_bed.update(); #endif #if HAS_TEMP_CHAMBER - temp_chamber.raw = temp_chamber.acc; + temp_chamber.update(); + #endif + + #if HAS_JOY_ADC_X + joystick.x.update(); + #endif + #if HAS_JOY_ADC_Y + joystick.y.update(); + #endif + #if HAS_JOY_ADC_Z + joystick.z.update(); #endif temp_meas_ready = true; } -#if ENABLED(FILAMENT_WIDTH_SENSOR) - uint32_t raw_filwidth_value; // = 0 -#endif - void Temperature::readings_ready() { - #if THERMAL_PROTECTION_GRACE_PERIOD > 0 - const millis_t ms = millis(); - static millis_t grace_period = ms + THERMAL_PROTECTION_GRACE_PERIOD; // NOTE: millis() == 0 on reset - if (ELAPSED(ms, grace_period)) grace_period = 0; - #else - static constexpr millis_t grace_period = 0; - #endif - // 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 + filwidth.reading_ready(); #endif - HOTEND_LOOP() temp_hotend[e].acc = 0; + #if HOTENDS + HOTEND_LOOP() temp_hotend[e].reset(); + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + temp_hotend[1].reset(); + #endif + #endif #if HAS_HEATED_BED - temp_bed.acc = 0; + temp_bed.reset(); #endif #if HAS_TEMP_CHAMBER - temp_chamber.acc = 0; + temp_chamber.reset(); #endif - static constexpr int8_t temp_dir[] = { - #if ENABLED(HEATER_0_USES_MAX6675) - 0 - #else - TEMPDIR(0) - #endif - #if HOTENDS > 1 - #if ENABLED(HEATER_1_USES_MAX6675) - , 0 + #if HAS_JOY_ADC_X + joystick.x.reset(); + #endif + #if HAS_JOY_ADC_Y + joystick.y.reset(); + #endif + #if HAS_JOY_ADC_Z + joystick.z.reset(); + #endif + + #if HOTENDS + + static constexpr int8_t temp_dir[] = { + #if ENABLED(HEATER_0_USES_MAX6675) + 0 #else - , TEMPDIR(1) + TEMPDIR(0) #endif - #if HOTENDS > 2 - , TEMPDIR(2) - #if HOTENDS > 3 - , TEMPDIR(3) - #if HOTENDS > 4 - , TEMPDIR(4) - #if HOTENDS > 5 - , TEMPDIR(5) - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - }; - - // Give ADC temperature readings time to settle at boot-up before testing - if (grace_period) return; - - for (uint8_t e = 0; e < COUNT(temp_dir); e++) { - const int8_t tdir = temp_dir[e]; - if (tdir) { - const int16_t rawtemp = temp_hotend[e].raw * tdir; // normal direction, +rawtemp, else -rawtemp - const bool heater_on = (temp_hotend[e].target > 0 - #if ENABLED(PIDTEMP) - || temp_hotend[e].soft_pwm_amount > 0 + #if HOTENDS > 1 + #define _TEMPDIR(N) , TEMPDIR(N) + #if ENABLED(HEATER_1_USES_MAX6675) + , 0 + #else + _TEMPDIR(1) #endif - ); - if (rawtemp > temp_range[e].raw_max * tdir) max_temp_error((heater_ind_t)e); - if (heater_on && rawtemp < temp_range[e].raw_min * tdir && !is_preheating(e)) { + #if HOTENDS > 2 + REPEAT_S(2, HOTENDS, _TEMPDIR) + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + }; + + for (uint8_t e = 0; e < COUNT(temp_dir); e++) { + const int8_t tdir = temp_dir[e]; + if (tdir) { + const int16_t rawtemp = temp_hotend[e].raw * tdir; // normal direction, +rawtemp, else -rawtemp + const bool heater_on = (temp_hotend[e].target > 0 + #if ENABLED(PIDTEMP) + || temp_hotend[e].soft_pwm_amount > 0 + #endif + ); + if (rawtemp > temp_range[e].raw_max * tdir) max_temp_error((heater_ind_t)e); + if (heater_on && rawtemp < temp_range[e].raw_min * tdir && !is_preheating(e)) { + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + #endif + min_temp_error((heater_ind_t)e); + } #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + else + consecutive_low_temperature_error[e] = 0; #endif - min_temp_error((heater_ind_t)e); } - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - else - consecutive_low_temperature_error[e] = 0; - #endif } - } + + #endif // HOTENDS #if HAS_HEATED_BED #if TEMPDIR(BED) < 0 @@ -2286,7 +2336,7 @@ void Temperature::readings_ready() { HAL_TEMP_TIMER_ISR() { HAL_timer_isr_prologue(TEMP_TIMER_NUM); - Temperature::isr(); + Temperature::tick(); HAL_timer_isr_epilogue(TEMP_TIMER_NUM); } @@ -2316,11 +2366,21 @@ class SoftPWM { #endif }; -void Temperature::isr() { +/** + * Handle various ~1KHz tasks associated with temperature + * - Heater PWM (~1KHz with scaler) + * - LCD Button polling (~500Hz) + * - Start / Read one ADC sensor + * - Advance Babysteps + * - Endstop polling + * - Planner clean buffer + */ +void Temperature::tick() { static int8_t temp_count = -1; static ADCSensorState adc_sensor_state = StartupDelay; static uint8_t pwm_count = _BV(SOFT_PWM_SCALE); + // avoid multiple loads of pwm_count uint8_t pwm_count_tmp = pwm_count; @@ -2329,12 +2389,10 @@ void Temperature::isr() { static bool ADCKey_pressed = false; #endif - #if ENABLED(SLOW_PWM_HEATERS) - static uint8_t slow_pwm_count = 0; + #if HOTENDS + static SoftPWM soft_pwm_hotend[HOTENDS]; #endif - static SoftPWM soft_pwm_hotend[HOTENDS]; - #if HAS_HEATED_BED static SoftPWM soft_pwm_bed; #endif @@ -2344,40 +2402,31 @@ void Temperature::isr() { #endif #if DISABLED(SLOW_PWM_HEATERS) - constexpr uint8_t pwm_mask = - #if ENABLED(SOFT_PWM_DITHER) - _BV(SOFT_PWM_SCALE) - 1 - #else - 0 - #endif - ; + + #if HOTENDS || HAS_HEATED_BED || HAS_HEATED_CHAMBER + constexpr uint8_t pwm_mask = + #if ENABLED(SOFT_PWM_DITHER) + _BV(SOFT_PWM_SCALE) - 1 + #else + 0 + #endif + ; + #define _PWM_MOD(N,S,T) do{ \ + const bool on = S.add(pwm_mask, T.soft_pwm_amount); \ + WRITE_HEATER_##N(on); \ + }while(0) + #endif /** * Standard heater PWM modulation */ if (pwm_count_tmp >= 127) { pwm_count_tmp -= 127; - #define _PWM_MOD(N,S,T) do{ \ - const bool on = S.add(pwm_mask, T.soft_pwm_amount); \ - WRITE_HEATER_##N(on); \ - }while(0) - #define _PWM_MOD_E(N) _PWM_MOD(N,soft_pwm_hotend[N],temp_hotend[N]) - _PWM_MOD_E(0); - #if HOTENDS > 1 - _PWM_MOD_E(1); - #if HOTENDS > 2 - _PWM_MOD_E(2); - #if HOTENDS > 3 - _PWM_MOD_E(3); - #if HOTENDS > 4 - _PWM_MOD_E(4); - #if HOTENDS > 5 - _PWM_MOD_E(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + + #if HOTENDS + #define _PWM_MOD_E(N) _PWM_MOD(N,soft_pwm_hotend[N],temp_hotend[N]); + REPEAT(HOTENDS, _PWM_MOD_E); + #endif #if HAS_HEATED_BED _PWM_MOD(BED,soft_pwm_bed,temp_bed); @@ -2407,24 +2456,9 @@ void Temperature::isr() { else { #define _PWM_LOW(N,S) do{ if (S.count <= pwm_count_tmp) WRITE_HEATER_##N(LOW); }while(0) #if HOTENDS - #define _PWM_LOW_E(N) _PWM_LOW(N, soft_pwm_hotend[N]) - _PWM_LOW_E(0); - #if HOTENDS > 1 - _PWM_LOW_E(1); - #if HOTENDS > 2 - _PWM_LOW_E(2); - #if HOTENDS > 3 - _PWM_LOW_E(3); - #if HOTENDS > 4 - _PWM_LOW_E(4); - #if HOTENDS > 5 - _PWM_LOW_E(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // HOTENDS + #define _PWM_LOW_E(N) _PWM_LOW(N, soft_pwm_hotend[N]); + REPEAT(HOTENDS, _PWM_LOW_E); + #endif #if HAS_HEATED_BED _PWM_LOW(BED, soft_pwm_bed); @@ -2468,27 +2502,14 @@ void Temperature::isr() { #define _SLOW_PWM(NR,PWM,SRC) do{ PWM.count = SRC.soft_pwm_amount; _SLOW_SET(NR,PWM,(PWM.count > 0)); }while(0) #define _PWM_OFF(NR,PWM) do{ if (PWM.count < slow_pwm_count) _SLOW_SET(NR,PWM,0); }while(0) + static uint8_t slow_pwm_count = 0; + if (slow_pwm_count == 0) { #if HOTENDS - #define _SLOW_PWM_E(N) _SLOW_PWM(N, soft_pwm_hotend[N], temp_hotend[N]) - _SLOW_PWM_E(0); - #if HOTENDS > 1 - _SLOW_PWM_E(1); - #if HOTENDS > 2 - _SLOW_PWM_E(2); - #if HOTENDS > 3 - _SLOW_PWM_E(3); - #if HOTENDS > 4 - _SLOW_PWM_E(4); - #if HOTENDS > 5 - _SLOW_PWM_E(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // HOTENDS + #define _SLOW_PWM_E(N) _SLOW_PWM(N, soft_pwm_hotend[N], temp_hotend[N]); + REPEAT(HOTENDS, _SLOW_PWM_E); + #endif #if HAS_HEATED_BED _SLOW_PWM(BED, soft_pwm_bed, temp_bed); @@ -2498,23 +2519,8 @@ void Temperature::isr() { #if HOTENDS #define _PWM_OFF_E(N) _PWM_OFF(N, soft_pwm_hotend[N]); - _PWM_OFF_E(0); - #if HOTENDS > 1 - _PWM_OFF_E(1); - #if HOTENDS > 2 - _PWM_OFF_E(2); - #if HOTENDS > 3 - _PWM_OFF_E(3); - #if HOTENDS > 4 - _PWM_OFF_E(4); - #if HOTENDS > 5 - _PWM_OFF_E(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // HOTENDS + REPEAT(HOTENDS, _PWM_OFF_E); + #endif #if HAS_HEATED_BED _PWM_OFF(BED, soft_pwm_bed); @@ -2564,22 +2570,9 @@ void Temperature::isr() { slow_pwm_count++; slow_pwm_count &= 0x7F; - soft_pwm_hotend[0].dec(); - #if HOTENDS > 1 - soft_pwm_hotend[1].dec(); - #if HOTENDS > 2 - soft_pwm_hotend[2].dec(); - #if HOTENDS > 3 - soft_pwm_hotend[3].dec(); - #if HOTENDS > 4 - soft_pwm_hotend[4].dec(); - #if HOTENDS > 5 - soft_pwm_hotend[5].dec(); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + #if HOTENDS + HOTEND_LOOP() soft_pwm_hotend[e].dec(); + #endif #if HAS_HEATED_BED soft_pwm_bed.dec(); #endif @@ -2604,7 +2597,7 @@ void Temperature::isr() { */ #define ACCUMULATE_ADC(obj) do{ \ if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \ - else obj.acc += HAL_READ_ADC(); \ + else obj.sample(HAL_READ_ADC()); \ }while(0) ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling; @@ -2636,101 +2629,78 @@ void Temperature::isr() { break; #if HAS_TEMP_ADC_0 - case PrepareTemp_0: - HAL_START_ADC(TEMP_0_PIN); - break; - case MeasureTemp_0: - ACCUMULATE_ADC(temp_hotend[0]); - break; + case PrepareTemp_0: HAL_START_ADC(TEMP_0_PIN); break; + case MeasureTemp_0: ACCUMULATE_ADC(temp_hotend[0]); break; #endif #if HAS_HEATED_BED - case PrepareTemp_BED: - HAL_START_ADC(TEMP_BED_PIN); - break; - case MeasureTemp_BED: - ACCUMULATE_ADC(temp_bed); - break; + case PrepareTemp_BED: HAL_START_ADC(TEMP_BED_PIN); break; + case MeasureTemp_BED: ACCUMULATE_ADC(temp_bed); break; #endif #if HAS_TEMP_CHAMBER - case PrepareTemp_CHAMBER: - HAL_START_ADC(TEMP_CHAMBER_PIN); - break; - case MeasureTemp_CHAMBER: - ACCUMULATE_ADC(temp_chamber); - break; + case PrepareTemp_CHAMBER: HAL_START_ADC(TEMP_CHAMBER_PIN); break; + case MeasureTemp_CHAMBER: ACCUMULATE_ADC(temp_chamber); break; #endif #if HAS_TEMP_ADC_1 - case PrepareTemp_1: - HAL_START_ADC(TEMP_1_PIN); - break; - case MeasureTemp_1: - ACCUMULATE_ADC(temp_hotend[1]); - break; + case PrepareTemp_1: HAL_START_ADC(TEMP_1_PIN); break; + case MeasureTemp_1: ACCUMULATE_ADC(temp_hotend[1]); break; #endif #if HAS_TEMP_ADC_2 - case PrepareTemp_2: - HAL_START_ADC(TEMP_2_PIN); - break; - case MeasureTemp_2: - ACCUMULATE_ADC(temp_hotend[2]); - break; + case PrepareTemp_2: HAL_START_ADC(TEMP_2_PIN); break; + case MeasureTemp_2: ACCUMULATE_ADC(temp_hotend[2]); break; #endif #if HAS_TEMP_ADC_3 - case PrepareTemp_3: - HAL_START_ADC(TEMP_3_PIN); - break; - case MeasureTemp_3: - ACCUMULATE_ADC(temp_hotend[3]); - break; + case PrepareTemp_3: HAL_START_ADC(TEMP_3_PIN); break; + case MeasureTemp_3: ACCUMULATE_ADC(temp_hotend[3]); break; #endif #if HAS_TEMP_ADC_4 - case PrepareTemp_4: - HAL_START_ADC(TEMP_4_PIN); - break; - case MeasureTemp_4: - ACCUMULATE_ADC(temp_hotend[4]); - break; + case PrepareTemp_4: HAL_START_ADC(TEMP_4_PIN); break; + case MeasureTemp_4: ACCUMULATE_ADC(temp_hotend[4]); break; #endif #if HAS_TEMP_ADC_5 - case PrepareTemp_5: - HAL_START_ADC(TEMP_5_PIN); - break; - case MeasureTemp_5: - ACCUMULATE_ADC(temp_hotend[5]); - break; + case PrepareTemp_5: HAL_START_ADC(TEMP_5_PIN); break; + case MeasureTemp_5: ACCUMULATE_ADC(temp_hotend[5]); break; #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - case Prepare_FILWIDTH: - HAL_START_ADC(FILWIDTH_PIN); - break; + case Prepare_FILWIDTH: HAL_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 - } + else + filwidth.accumulate(HAL_READ_ADC()); break; #endif + #if HAS_JOY_ADC_X + case PrepareJoy_X: HAL_START_ADC(JOY_X_PIN); break; + case MeasureJoy_X: ACCUMULATE_ADC(joystick.x); break; + #endif + + #if HAS_JOY_ADC_Y + case PrepareJoy_Y: HAL_START_ADC(JOY_Y_PIN); break; + case MeasureJoy_Y: ACCUMULATE_ADC(joystick.y); break; + #endif + + #if HAS_JOY_ADC_Z + case PrepareJoy_Z: HAL_START_ADC(JOY_Z_PIN); break; + case MeasureJoy_Z: ACCUMULATE_ADC(joystick.z); break; + #endif + #if HAS_ADC_BUTTONS - case Prepare_ADC_KEY: - HAL_START_ADC(ADC_KEYPAD_PIN); - break; + case Prepare_ADC_KEY: HAL_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 (raw_ADCKey_value <= 900) { + if (raw_ADCKey_value <= 900UL * HAL_ADC_RANGE / 1024UL) { NOMORE(current_ADCKey_raw, raw_ADCKey_value); ADCKey_count++; } @@ -2738,7 +2708,7 @@ void Temperature::isr() { if (ADCKey_count > 0) ADCKey_count++; else ADCKey_pressed = false; if (ADCKey_pressed) { ADCKey_count = 0; - current_ADCKey_raw = 1024; + current_ADCKey_raw = HAL_ADC_RANGE; } } } @@ -2891,14 +2861,17 @@ void Temperature::isr() { #endif // AUTO_REPORT_TEMPERATURES - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + #if HOTENDS && HAS_DISPLAY void Temperature::set_heating_message(const uint8_t e) { const bool heating = isHeatingHotend(e); - #if HOTENDS > 1 - ui.status_printf_P(0, heating ? PSTR("E%c " MSG_HEATING) : PSTR("E%c " MSG_COOLING), '1' + e); - #else - ui.set_status_P(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING)); - #endif + ui.status_printf_P(0, + #if HOTENDS > 1 + PSTR("E%c " S_FMT), '1' + e + #else + PSTR("E " S_FMT) + #endif + , heating ? GET_TEXT(MSG_HEATING) : GET_TEXT(MSG_COOLING) + ); } #endif @@ -3145,7 +3118,7 @@ void Temperature::isr() { #endif // HAS_HEATED_BED - #if 0 && HAS_HEATED_CHAMBER + #if HAS_HEATED_CHAMBER #ifndef MIN_COOLING_SLOPE_DEG_CHAMBER #define MIN_COOLING_SLOPE_DEG_CHAMBER 1.50 diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index f19b1a4f1706..4eff4e4f621e 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -39,10 +39,10 @@ #if HOTENDS <= 1 #define HOTEND_INDEX 0 - #define E_UNUSED() UNUSED(e) + #define E_NAME #else #define HOTEND_INDEX e - #define E_UNUSED() + #define E_NAME e #endif // Identifiers for other heaters @@ -55,15 +55,23 @@ typedef enum : int8_t { // PID storage typedef struct { float Kp, Ki, Kd; } PID_t; typedef struct { float Kp, Ki, Kd, Kc; } PIDC_t; -#if ENABLED(PID_EXTRUSION_SCALING) - typedef PIDC_t hotend_pid_t; - #if LPQ_MAX_LEN > 255 - typedef uint16_t lpq_ptr_t; +typedef struct { float Kp, Ki, Kd, Kf; } PIDF_t; +typedef struct { float Kp, Ki, Kd, Kc, Kf; } PIDCF_t; + +typedef + #if BOTH(PID_EXTRUSION_SCALING, PID_FAN_SCALING) + PIDCF_t + #elif ENABLED(PID_EXTRUSION_SCALING) + PIDC_t + #elif ENABLED(PID_FAN_SCALING) + PIDF_t #else - typedef uint8_t lpq_ptr_t; + PID_t #endif -#else - typedef PID_t hotend_pid_t; +hotend_pid_t; + +#if ENABLED(PID_EXTRUSION_SCALING) + typedef IF<(LPQ_MAX_LEN > 255), uint16_t, uint8_t>::type lpq_ptr_t; #endif #define DUMMY_PID_VALUE 3000.0f @@ -77,6 +85,12 @@ typedef struct { float Kp, Ki, Kd, Kc; } PIDC_t; #else #define _PID_Kc(H) 1 #endif + + #if ENABLED(PID_FAN_SCALING) + #define _PID_Kf(H) Temperature::temp_hotend[H].pid.Kf + #else + #define _PID_Kf(H) 0 + #endif #else #define _PID_Kp(H) DUMMY_PID_VALUE #define _PID_Ki(H) DUMMY_PID_VALUE @@ -92,44 +106,43 @@ typedef struct { float Kp, Ki, Kd, Kc; } PIDC_t; enum ADCSensorState : char { StartSampling, #if HAS_TEMP_ADC_0 - PrepareTemp_0, - MeasureTemp_0, + PrepareTemp_0, MeasureTemp_0, #endif #if HAS_HEATED_BED - PrepareTemp_BED, - MeasureTemp_BED, + PrepareTemp_BED, MeasureTemp_BED, #endif #if HAS_TEMP_CHAMBER - PrepareTemp_CHAMBER, - MeasureTemp_CHAMBER, + PrepareTemp_CHAMBER, MeasureTemp_CHAMBER, #endif #if HAS_TEMP_ADC_1 - PrepareTemp_1, - MeasureTemp_1, + PrepareTemp_1, MeasureTemp_1, #endif #if HAS_TEMP_ADC_2 - PrepareTemp_2, - MeasureTemp_2, + PrepareTemp_2, MeasureTemp_2, #endif #if HAS_TEMP_ADC_3 - PrepareTemp_3, - MeasureTemp_3, + PrepareTemp_3, MeasureTemp_3, #endif #if HAS_TEMP_ADC_4 - PrepareTemp_4, - MeasureTemp_4, + PrepareTemp_4, MeasureTemp_4, #endif #if HAS_TEMP_ADC_5 - PrepareTemp_5, - MeasureTemp_5, + PrepareTemp_5, MeasureTemp_5, + #endif + #if HAS_JOY_ADC_X + PrepareJoy_X, MeasureJoy_X, + #endif + #if HAS_JOY_ADC_Y + PrepareJoy_Y, MeasureJoy_Y, + #endif + #if HAS_JOY_ADC_Z + PrepareJoy_Z, MeasureJoy_Z, #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - Prepare_FILWIDTH, - Measure_FILWIDTH, + Prepare_FILWIDTH, Measure_FILWIDTH, #endif #if HAS_ADC_BUTTONS - Prepare_ADC_KEY, - Measure_ADC_KEY, + Prepare_ADC_KEY, Measure_ADC_KEY, #endif SensorsReady, // Temperatures ready. Delay the next round of readings to let ADC pins settle. StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle @@ -159,7 +172,10 @@ enum ADCSensorState : char { typedef struct TempInfo { uint16_t acc; int16_t raw; - float current; + float celsius; + inline void reset() { acc = 0; } + inline void sample(const uint16_t s) { acc += s; } + inline void update() { raw = acc; } } temp_info_t; // A PWM heater with temperature sensor @@ -215,9 +231,8 @@ typedef struct { int16_t raw_min, raw_max; } raw_range_t; typedef struct { int16_t mintemp, maxtemp; } celsius_range_t; typedef struct { int16_t raw_min, raw_max, mintemp, maxtemp; } temp_range_t; -#define THERMISTOR_ADC_RESOLUTION 1024 // 10-bit ADC .. shame to waste 12-bits of resolution on 32-bit -#define THERMISTOR_ABS_ZERO_C -273.15f // bbbbrrrrr cold ! -#define THERMISTOR_RESISTANCE_NOMINAL_C 25.0f // mmmmm comfortable +#define THERMISTOR_ABS_ZERO_C -273.15f // bbbbrrrrr cold ! +#define THERMISTOR_RESISTANCE_NOMINAL_C 25.0f // mmmmm comfortable #if HAS_USER_THERMISTORS @@ -266,9 +281,14 @@ class Temperature { public: - static volatile bool in_temp_isr; - - static hotend_info_t temp_hotend[HOTENDS]; + #if HOTENDS + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + #define HOTEND_TEMPS (HOTENDS + 1) + #else + #define HOTEND_TEMPS HOTENDS + #endif + static hotend_info_t temp_hotend[HOTEND_TEMPS]; + #endif #if HAS_HEATED_BED static bed_info_t temp_bed; @@ -295,17 +315,15 @@ class Temperature { 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) { - E_UNUSED(); + FORCE_INLINE static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(degHotend(HOTEND_INDEX)); } - FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t e) { - E_UNUSED(); + FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t E_NAME) { 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; } + FORCE_INLINE static bool tooColdToExtrude(const uint8_t) { return false; } + FORCE_INLINE static bool targetTooColdToExtrude(const uint8_t) { return false; } #endif FORCE_INLINE static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } @@ -343,7 +361,9 @@ class Temperature { static lpq_ptr_t lpq_ptr; #endif - static temp_range_t temp_range[HOTENDS]; + #if HOTENDS + static temp_range_t temp_range[HOTENDS]; + #endif #if HAS_HEATED_BED #if WATCH_BED @@ -381,18 +401,10 @@ class Temperature { static millis_t preheat_end_time[HOTENDS]; #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static int8_t meas_shift_index; // Index of a delayed sample in buffer - #endif - #if HAS_AUTO_FAN static millis_t next_auto_fan_check_ms; #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static uint16_t current_raw_filwidth; // Measured filament diameter - one extruder only - #endif - #if ENABLED(PROBING_HEATERS_OFF) static bool paused; #endif @@ -411,8 +423,6 @@ class Temperature { * Instance Methods */ - Temperature(); - void init(); /** @@ -450,7 +460,9 @@ class Temperature { } #endif - static float analog_to_celsius_hotend(const int raw, const uint8_t e); + #if HOTENDS + static float analog_to_celsius_hotend(const int raw, const uint8_t e); + #endif #if HAS_HEATED_BED static float analog_to_celsius_bed(const int raw); @@ -475,12 +487,17 @@ class Temperature { #if ENABLED(ADAPTIVE_FAN_SLOWING) static uint8_t fan_speed_scaler[FAN_COUNT]; - #else - static constexpr uint8_t fan_speed_scaler[FAN_COUNT] = ARRAY_N(FAN_COUNT, 128, 128, 128, 128, 128, 128); #endif static inline uint8_t scaledFanSpeed(const uint8_t target, const uint8_t fs) { - return (fs * uint16_t(fan_speed_scaler[target])) >> 7; + UNUSED(target); // Potentially unused! + return (fs * uint16_t( + #if ENABLED(ADAPTIVE_FAN_SLOWING) + fan_speed_scaler[target] + #else + 128 + #endif + )) >> 7; } static inline uint8_t scaledFanSpeed(const uint8_t target) { @@ -492,30 +509,6 @@ class Temperature { static void set_temp_fan_speed(const uint8_t fan, const uint16_t tmp_temp); #endif - #if HAS_LCD_MENU - - static uint8_t lcd_tmpfan_speed[ - #if ENABLED(SINGLENOZZLE) - _MAX(EXTRUDERS, FAN_COUNT) - #else - FAN_COUNT - #endif - ]; - - static inline void lcd_setFanSpeed(const uint8_t target) { set_fan_speed(target, lcd_tmpfan_speed[target]); } - - #if HAS_FAN0 - FORCE_INLINE static void lcd_setFanSpeed0() { lcd_setFanSpeed(0); } - #endif - #if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1) - FORCE_INLINE static void lcd_setFanSpeed1() { lcd_setFanSpeed(1); } - #endif - #if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2) - FORCE_INLINE static void lcd_setFanSpeed2() { lcd_setFanSpeed(2); } - #endif - - #endif // HAS_LCD_MENU - #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) void set_fans_paused(const bool p); #endif @@ -532,7 +525,7 @@ class Temperature { * Called from the Temperature ISR */ static void readings_ready(); - static void isr(); + static void tick(); /** * Call periodically to manage heaters @@ -543,126 +536,103 @@ class Temperature { * Preheating hotends */ #ifdef MILLISECONDS_PREHEAT_TIME - static bool is_preheating(const uint8_t e) { - E_UNUSED(); + static bool is_preheating(const uint8_t E_NAME) { return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]); } - static void start_preheat_time(const uint8_t e) { - E_UNUSED(); + static void start_preheat_time(const uint8_t E_NAME) { preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME; } - static void reset_preheat_time(const uint8_t e) { - E_UNUSED(); + static void reset_preheat_time(const uint8_t E_NAME) { preheat_end_time[HOTEND_INDEX] = 0; } #else #define is_preheating(n) (false) #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static float analog_to_mm_fil_width(); // Convert raw Filament Width to millimeters - static int8_t widthFil_to_size_ratio(); // Convert Filament Width (mm) to an extrusion ratio - #endif - - //high level conversion routines, for use outside of temperature.cpp //inline so that there is no performance decrease. //deg=degreeCelsius - FORCE_INLINE static float degHotend(const uint8_t e) { - E_UNUSED(); - return temp_hotend[HOTEND_INDEX].current; + FORCE_INLINE static float degHotend(const uint8_t E_NAME) { + return (0 + #if HOTENDS + + temp_hotend[HOTEND_INDEX].celsius + #endif + ); } #if ENABLED(SHOW_TEMP_ADC_VALUES) - FORCE_INLINE static int16_t rawHotendTemp(const uint8_t e) { - E_UNUSED(); - return temp_hotend[HOTEND_INDEX].raw; + FORCE_INLINE static int16_t rawHotendTemp(const uint8_t E_NAME) { + return (0 + #if HOTENDS + + temp_hotend[HOTEND_INDEX].raw + #endif + ); } #endif - FORCE_INLINE static int16_t degTargetHotend(const uint8_t e) { - E_UNUSED(); - return temp_hotend[HOTEND_INDEX].target; + FORCE_INLINE static int16_t degTargetHotend(const uint8_t E_NAME) { + return (0 + #if HOTENDS + + temp_hotend[HOTEND_INDEX].target + #endif + ); } #if WATCH_HOTENDS static void start_watching_hotend(const uint8_t e=0); #else - static inline void start_watching_hotend(const uint8_t e=0) { UNUSED(e); } - #endif - - #if HAS_LCD_MENU - static inline void start_watching_E0() { start_watching_hotend(0); } - static inline void start_watching_E1() { start_watching_hotend(1); } - static inline void start_watching_E2() { start_watching_hotend(2); } - static inline void start_watching_E3() { start_watching_hotend(3); } - static inline void start_watching_E4() { start_watching_hotend(4); } - static inline void start_watching_E5() { start_watching_hotend(5); } - #endif - - static void setTargetHotend(const int16_t celsius, const uint8_t e) { - E_UNUSED(); - const uint8_t ee = HOTEND_INDEX; - #ifdef MILLISECONDS_PREHEAT_TIME - if (celsius == 0) - reset_preheat_time(ee); - else if (temp_hotend[ee].target == 0) - start_preheat_time(ee); - #endif - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - temp_hotend[ee].target = _MIN(celsius, temp_range[ee].maxtemp - 15); - start_watching_hotend(ee); - } - - #if WATCH_CHAMBER - static void start_watching_chamber(); - #else - static inline void start_watching_chamber() {} + static inline void start_watching_hotend(const uint8_t=0) {} #endif - #if HAS_HEATED_CHAMBER - static void setTargetChamber(const int16_t celsius) { - temp_chamber.target = - #ifdef CHAMBER_MAXTEMP - _MIN(celsius, CHAMBER_MAXTEMP) - #else - celsius - #endif - ; - start_watching_chamber(); + #if HOTENDS + + static void setTargetHotend(const int16_t celsius, const uint8_t E_NAME) { + const uint8_t ee = HOTEND_INDEX; + #ifdef MILLISECONDS_PREHEAT_TIME + if (celsius == 0) + reset_preheat_time(ee); + else if (temp_hotend[ee].target == 0) + start_preheat_time(ee); + #endif + #if ENABLED(AUTO_POWER_CONTROL) + powerManager.power_on(); + #endif + temp_hotend[ee].target = _MIN(celsius, temp_range[ee].maxtemp - 15); + start_watching_hotend(ee); } - #endif // HAS_HEATED_CHAMBER - FORCE_INLINE static bool isHeatingHotend(const uint8_t e) { - E_UNUSED(); - return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].current; - } + FORCE_INLINE static bool isHeatingHotend(const uint8_t E_NAME) { + return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].celsius; + } - FORCE_INLINE static bool isCoolingHotend(const uint8_t e) { - E_UNUSED(); - return temp_hotend[HOTEND_INDEX].target < temp_hotend[HOTEND_INDEX].current; - } + FORCE_INLINE static bool isCoolingHotend(const uint8_t E_NAME) { + return temp_hotend[HOTEND_INDEX].target < temp_hotend[HOTEND_INDEX].celsius; + } - #if HAS_TEMP_HOTEND - static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true - #if G26_CLICK_CAN_CANCEL - , const bool click_to_cancel=false - #endif - ); - #endif + #if HAS_TEMP_HOTEND + static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true + #if G26_CLICK_CAN_CANCEL + , const bool click_to_cancel=false + #endif + ); + #endif + + FORCE_INLINE static bool still_heating(const uint8_t e) { + return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; + } + + #endif // HOTENDS #if HAS_HEATED_BED #if ENABLED(SHOW_TEMP_ADC_VALUES) FORCE_INLINE static int16_t rawBedTemp() { return temp_bed.raw; } #endif - FORCE_INLINE static float degBed() { return temp_bed.current; } + FORCE_INLINE static float degBed() { return temp_bed.celsius; } FORCE_INLINE static int16_t degTargetBed() { return temp_bed.target; } - FORCE_INLINE static bool isHeatingBed() { return temp_bed.target > temp_bed.current; } - FORCE_INLINE static bool isCoolingBed() { return temp_bed.target < temp_bed.current; } + FORCE_INLINE static bool isHeatingBed() { return temp_bed.target > temp_bed.celsius; } + FORCE_INLINE static bool isCoolingBed() { return temp_bed.target < temp_bed.celsius; } #if WATCH_BED static void start_watching_bed(); @@ -696,19 +666,34 @@ class Temperature { #if ENABLED(SHOW_TEMP_ADC_VALUES) FORCE_INLINE static int16_t rawChamberTemp() { return temp_chamber.raw; } #endif - FORCE_INLINE static float degChamber() { return temp_chamber.current; } + FORCE_INLINE static float degChamber() { return temp_chamber.celsius; } #if HAS_HEATED_CHAMBER FORCE_INLINE static int16_t degTargetChamber() { return temp_chamber.target; } - FORCE_INLINE static bool isHeatingChamber() { return temp_chamber.target > temp_chamber.current; } - FORCE_INLINE static bool isCoolingChamber() { return temp_chamber.target < temp_chamber.current; } + FORCE_INLINE static bool isHeatingChamber() { return temp_chamber.target > temp_chamber.celsius; } + FORCE_INLINE static bool isCoolingChamber() { return temp_chamber.target < temp_chamber.celsius; } static bool wait_for_chamber(const bool no_wait_for_cooling=true); #endif #endif // HAS_TEMP_CHAMBER - FORCE_INLINE static bool still_heating(const uint8_t e) { - return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; - } + #if WATCH_CHAMBER + static void start_watching_chamber(); + #else + static inline void start_watching_chamber() {} + #endif + + #if HAS_HEATED_CHAMBER + static void setTargetChamber(const int16_t celsius) { + temp_chamber.target = + #ifdef CHAMBER_MAXTEMP + _MIN(celsius, CHAMBER_MAXTEMP) + #else + celsius + #endif + ; + start_watching_chamber(); + } + #endif // HAS_HEATED_CHAMBER /** * The software PWM power for a heater @@ -752,8 +737,7 @@ class Temperature { #if HEATER_IDLE_HANDLER - static void reset_heater_idle_timer(const uint8_t e) { - E_UNUSED(); + static void reset_heater_idle_timer(const uint8_t E_NAME) { hotend_idle[HOTEND_INDEX].reset(); start_watching_hotend(HOTEND_INDEX); } @@ -776,7 +760,7 @@ class Temperature { #if ENABLED(AUTO_REPORT_TEMPERATURES) static uint8_t auto_report_temp_interval; static millis_t next_temp_report_ms; - static void auto_report_temperatures(void); + static void auto_report_temperatures(); static inline void set_auto_report_interval(uint8_t v) { NOMORE(v, 60); auto_report_temp_interval = v; @@ -785,7 +769,7 @@ class Temperature { #endif #endif - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + #if HAS_DISPLAY static void set_heating_message(const uint8_t e); #endif @@ -828,7 +812,9 @@ class Temperature { static void min_temp_error(const heater_ind_t e); static void max_temp_error(const heater_ind_t e); - #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED || ENABLED(THERMAL_PROTECTION_CHAMBER) + #define HAS_THERMAL_PROTECTION (EITHER(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER) || HAS_THERMALLY_PROTECTED_BED) + + #if HAS_THERMAL_PROTECTION enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway }; @@ -849,7 +835,7 @@ class Temperature { static void thermal_runaway_protection(tr_state_machine_t &state, const float ¤t, const float &target, const heater_ind_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc); - #endif // THERMAL_PROTECTION + #endif // HAS_THERMAL_PROTECTION }; extern Temperature thermalManager; diff --git a/Marlin/src/module/thermistor/thermistor_20.h b/Marlin/src/module/thermistor/thermistor_20.h index fc01858f4bb9..44c6a946c93e 100644 --- a/Marlin/src/module/thermistor/thermistor_20.h +++ b/Marlin/src/module/thermistor/thermistor_20.h @@ -21,41 +21,9 @@ */ #pragma once -// PT100 with INA826 amp on Ultimaker v2.0 electronics -// The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature. -// This does not match the normal thermistor behavior so we need to set the following defines -#if THERMISTOR_HEATER_0 == 20 - #define HEATER_0_RAW_HI_TEMP 16383 - #define HEATER_0_RAW_LO_TEMP 0 -#endif -#if THERMISTOR_HEATER_1 == 20 - #define HEATER_1_RAW_HI_TEMP 16383 - #define HEATER_1_RAW_LO_TEMP 0 -#endif -#if THERMISTOR_HEATER_2 == 20 - #define HEATER_2_RAW_HI_TEMP 16383 - #define HEATER_2_RAW_LO_TEMP 0 -#endif -#if THERMISTOR_HEATER_3 == 20 - #define HEATER_3_RAW_HI_TEMP 16383 - #define HEATER_3_RAW_LO_TEMP 0 -#endif -#if THERMISTOR_HEATER_4 == 20 - #define HEATER_4_RAW_HI_TEMP 16383 - #define HEATER_4_RAW_LO_TEMP 0 -#endif -#if THERMISTOR_HEATER_5 == 20 - #define HEATER_5_RAW_HI_TEMP 16383 - #define HEATER_5_RAW_LO_TEMP 0 -#endif -#if THERMISTORBED == 20 - #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 +#define REVERSE_TEMP_SENSOR_RANGE + +// Pt100 with INA826 amp on Ultimaker v2.0 electronics const short temptable_20[][2] PROGMEM = { { OV( 0), 0 }, { OV(227), 1 }, diff --git a/Marlin/src/module/thermistor/thermistor_201.h b/Marlin/src/module/thermistor/thermistor_201.h new file mode 100644 index 000000000000..21f0e92a41ec --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_201.h @@ -0,0 +1,57 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#define REVERSE_TEMP_SENSOR_RANGE + +// Pt100 with LMV324 amp on Overlord v1.1 electronics +const short temptable_201[][2] PROGMEM = { + { OV( 0), 0 }, + { OV( 8), 1 }, + { OV( 23), 6 }, + { OV( 41), 15 }, + { OV( 51), 20 }, + { OV( 68), 28 }, + { OV( 74), 30 }, + { OV( 88), 35 }, + { OV( 99), 40 }, + { OV( 123), 50 }, + { OV( 148), 60 }, + { OV( 173), 70 }, + { OV( 198), 80 }, + { OV( 221), 90 }, + { OV( 245), 100 }, + { OV( 269), 110 }, + { OV( 294), 120 }, + { OV( 316), 130 }, + { OV( 342), 140 }, + { OV( 364), 150 }, + { OV( 387), 160 }, + { OV( 412), 170 }, + { OV( 433), 180 }, + { OV( 456), 190 }, + { OV( 480), 200 }, + { OV( 500), 210 }, + { OV( 548), 224 }, + { OV( 572), 233 }, + { OV(1155), 490 } +}; diff --git a/Marlin/src/module/thermistor/thermistor_331.h b/Marlin/src/module/thermistor/thermistor_331.h new file mode 100644 index 000000000000..8f98d0752345 --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_331.h @@ -0,0 +1,92 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#define OVM(V) OV((V)*(0.327/0.5)) + +// R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor +const short temptable_331[][2] PROGMEM = { + { OVM( 23), 300 }, + { OVM( 25), 295 }, + { OVM( 27), 290 }, + { OVM( 28), 285 }, + { OVM( 31), 280 }, + { OVM( 33), 275 }, + { OVM( 35), 270 }, + { OVM( 38), 265 }, + { OVM( 41), 260 }, + { OVM( 44), 255 }, + { OVM( 48), 250 }, + { OVM( 52), 245 }, + { OVM( 56), 240 }, + { OVM( 61), 235 }, + { OVM( 66), 230 }, + { OVM( 71), 225 }, + { OVM( 78), 220 }, + { OVM( 84), 215 }, + { OVM( 92), 210 }, + { OVM( 100), 205 }, + { OVM( 109), 200 }, + { OVM( 120), 195 }, + { OVM( 131), 190 }, + { OVM( 143), 185 }, + { OVM( 156), 180 }, + { OVM( 171), 175 }, + { OVM( 187), 170 }, + { OVM( 205), 165 }, + { OVM( 224), 160 }, + { OVM( 245), 155 }, + { OVM( 268), 150 }, + { OVM( 293), 145 }, + { OVM( 320), 140 }, + { OVM( 348), 135 }, + { OVM( 379), 130 }, + { OVM( 411), 125 }, + { OVM( 445), 120 }, + { OVM( 480), 115 }, + { OVM( 516), 110 }, + { OVM( 553), 105 }, + { OVM( 591), 100 }, + { OVM( 628), 95 }, + { OVM( 665), 90 }, + { OVM( 702), 85 }, + { OVM( 737), 80 }, + { OVM( 770), 75 }, + { OVM( 801), 70 }, + { OVM( 830), 65 }, + { OVM( 857), 60 }, + { OVM( 881), 55 }, + { OVM( 903), 50 }, + { OVM( 922), 45 }, + { OVM( 939), 40 }, + { OVM( 954), 35 }, + { OVM( 966), 30 }, + { OVM( 977), 25 }, + { OVM( 985), 20 }, + { OVM( 993), 15 }, + { OVM( 999), 10 }, + { OVM(1004), 5 }, + { OVM(1008), 0 }, + { OVM(1012), -5 }, + { OVM(1016), -10 }, + { OVM(1020), -15 } +}; diff --git a/Marlin/src/module/thermistor/thermistor_501.h b/Marlin/src/module/thermistor/thermistor_501.h index 6e551641f933..cb178321aa34 100644 --- a/Marlin/src/module/thermistor/thermistor_501.h +++ b/Marlin/src/module/thermistor/thermistor_501.h @@ -23,36 +23,36 @@ // 100k Zonestar thermistor. Adjusted By Hally const short temptable_501[][2] PROGMEM = { - {OV( 1), 713}, - {OV( 14), 300}, // Top rating 300C - {OV( 16), 290}, - {OV( 19), 280}, - {OV( 23), 270}, - {OV( 27), 260}, - {OV( 31), 250}, - {OV( 37), 240}, - {OV( 47), 230}, - {OV( 57), 220}, - {OV( 68), 210}, - {OV( 84), 200}, - {OV( 100), 190}, - {OV( 128), 180}, - {OV( 155), 170}, - {OV( 189), 160}, - {OV( 230), 150}, - {OV( 278), 140}, - {OV( 336), 130}, - {OV( 402), 120}, - {OV( 476), 110}, - {OV( 554), 100}, - {OV( 635), 90}, - {OV( 713), 80}, - {OV( 784), 70}, - {OV( 846), 60}, - {OV( 897), 50}, - {OV( 937), 40}, - {OV( 966), 30}, - {OV( 986), 20}, - {OV(1000), 10}, - {OV(1010), 0} + { OV( 1), 713 }, + { OV( 14), 300 }, // Top rating 300C + { OV( 16), 290 }, + { OV( 19), 280 }, + { OV( 23), 270 }, + { OV( 27), 260 }, + { OV( 31), 250 }, + { OV( 37), 240 }, + { OV( 47), 230 }, + { OV( 57), 220 }, + { OV( 68), 210 }, + { OV( 84), 200 }, + { OV( 100), 190 }, + { OV( 128), 180 }, + { OV( 155), 170 }, + { OV( 189), 160 }, + { OV( 230), 150 }, + { OV( 278), 140 }, + { OV( 336), 130 }, + { OV( 402), 120 }, + { OV( 476), 110 }, + { OV( 554), 100 }, + { OV( 635), 90 }, + { OV( 713), 80 }, + { OV( 784), 70 }, + { OV( 846), 60 }, + { OV( 897), 50 }, + { OV( 937), 40 }, + { OV( 966), 30 }, + { OV( 986), 20 }, + { OV(1000), 10 }, + { OV(1010), 0 } }; diff --git a/Marlin/src/module/thermistor/thermistor_512.h b/Marlin/src/module/thermistor/thermistor_512.h new file mode 100644 index 000000000000..aa9e9e57f960 --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_512.h @@ -0,0 +1,87 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +// 100k thermistor supplied with RPW-Ultra hotend, 4.7k pullup + +const short temptable_512[][2] PROGMEM = { + { OV(26), 300 }, + { OV(28), 295 }, + { OV(30), 290 }, + { OV(32), 285 }, + { OV(34), 280 }, + { OV(37), 275 }, + { OV(39), 270 }, + { OV(42), 265 }, + { OV(46), 260 }, + { OV(49), 255 }, + { OV(53), 250 }, // 256.5 + { OV(57), 245 }, + { OV(62), 240 }, + { OV(67), 235 }, + { OV(73), 230 }, + { OV(79), 225 }, + { OV(86), 220 }, + { OV(94), 215 }, + { OV(103), 210 }, + { OV(112), 205 }, + { OV(123), 200 }, + { OV(135), 195 }, + { OV(148), 190 }, + { OV(162), 185 }, + { OV(178), 180 }, + { OV(195), 175 }, + { OV(215), 170 }, + { OV(235), 165 }, + { OV(258), 160 }, + { OV(283), 155 }, + { OV(310), 150 }, // 2040.6 + { OV(338), 145 }, + { OV(369), 140 }, + { OV(401), 135 }, + { OV(435), 130 }, + { OV(470), 125 }, + { OV(505), 120 }, + { OV(542), 115 }, + { OV(579), 110 }, + { OV(615), 105 }, + { OV(651), 100 }, + { OV(686), 95 }, + { OV(720), 90 }, + { OV(751), 85 }, + { OV(781), 80 }, + { OV(809), 75 }, + { OV(835), 70 }, + { OV(858), 65 }, + { OV(880), 60 }, + { OV(899), 55 }, + { OV(915), 50 }, + { OV(930), 45 }, + { OV(944), 40 }, + { OV(955), 35 }, + { OV(965), 30 }, // 78279.3 + { OV(974), 25 }, + { OV(981), 20 }, + { OV(988), 15 }, + { OV(993), 10 }, + { OV(998), 5 }, + { OV(1002), 0 }, +}; diff --git a/Marlin/src/module/thermistor/thermistor_666.h b/Marlin/src/module/thermistor/thermistor_666.h old mode 100755 new mode 100644 diff --git a/Marlin/src/module/thermistor/thermistor_75.h b/Marlin/src/module/thermistor/thermistor_75.h index a43e1f0b4b5b..fcc4c60375e3 100644 --- a/Marlin/src/module/thermistor/thermistor_75.h +++ b/Marlin/src/module/thermistor/thermistor_75.h @@ -51,30 +51,30 @@ const short temptable_75[][2] PROGMEM = { // Generic Silicon Heat Pad with NTC 1 { OV(300.92), 145 }, // v=1.469 r=1956.004 res=0.189 degC/coun #endif - { OV(328.32), 140 }, // v=1.603 r=2218.081 res=0.176 degC/count - { OV(388.65), 130 }, // v=1.898 r=2874.980 res=0.156 degC/count - { OV(421.39), 125 }, // v=2.058 r=3286.644 res=0.149 degC/count - { OV(455.65), 120 }, // v=2.225 r=3768.002 res=0.143 degC/count - { OV(491.17), 115 }, // v=2.398 r=4332.590 res=0.139 degC/count - { OV(527.68), 110 }, // v=2.577 r=4996.905 res=0.136 degC/count - { OV(564.81), 105 }, // v=2.758 r=5781.120 res=0.134 degC/count - { OV(602.19), 100 }, // v=2.940 r=6710.000 res=0.134 degC/count - { OV(676.03), 90 }, // v=3.301 r=9131.018 res=0.138 degC/count - { OV(745.85), 80 }, // v=3.642 r=12602.693 res=0.150 degC/count - { OV(778.31), 75 }, // v=3.800 r=14889.001 res=0.159 degC/count - { OV(808.75), 70 }, // v=3.949 r=17658.700 res=0.171 degC/count - { OV(836.94), 65 }, // v=4.087 r=21028.040 res=0.185 degC/count - { OV(862.74), 60 }, // v=4.213 r=25144.568 res=0.204 degC/count - { OV(886.08), 55 }, // v=4.327 r=30196.449 res=0.227 degC/count - { OV(906.97), 50 }, // v=4.429 r=36424.838 res=0.255 degC/count - { OV(941.65), 40 }, // v=4.598 r=53745.337 res=0.333 degC/count - { OV(967.76), 30 }, // v=4.725 r=80880.630 res=0.452 degC/count - { OV(978.03), 25 }, // v=4.776 r=100000.000 res=0.535 degC/count - { OV(981.68), 23 }, // v=4.793 r=109024.395 res=0.573 degC/count - { OV(983.41), 22 }, // v=4.802 r=113875.430 res=0.594 degC/count - { OV(985.08), 21 }, // v=4.810 r=118968.955 res=0.616 degC/count - { OV(986.70), 20 }, // v=4.818 r=124318.354 res=0.638 degC/count - { OV(993.94), 15 }, // v=4.853 r=155431.302 res=0.768 degC/count - { OV(999.96), 10 }, // v=4.883 r=195480.023 res=0.934 degC/count - { OV(008.95), 0 } // v=4.926 r=314997.575 res=1.418 degC/count + { OV( 328.32), 140 }, // v=1.603 r=2218.081 res=0.176 degC/count + { OV( 388.65), 130 }, // v=1.898 r=2874.980 res=0.156 degC/count + { OV( 421.39), 125 }, // v=2.058 r=3286.644 res=0.149 degC/count + { OV( 455.65), 120 }, // v=2.225 r=3768.002 res=0.143 degC/count + { OV( 491.17), 115 }, // v=2.398 r=4332.590 res=0.139 degC/count + { OV( 527.68), 110 }, // v=2.577 r=4996.905 res=0.136 degC/count + { OV( 564.81), 105 }, // v=2.758 r=5781.120 res=0.134 degC/count + { OV( 602.19), 100 }, // v=2.940 r=6710.000 res=0.134 degC/count + { OV( 676.03), 90 }, // v=3.301 r=9131.018 res=0.138 degC/count + { OV( 745.85), 80 }, // v=3.642 r=12602.693 res=0.150 degC/count + { OV( 778.31), 75 }, // v=3.800 r=14889.001 res=0.159 degC/count + { OV( 808.75), 70 }, // v=3.949 r=17658.700 res=0.171 degC/count + { OV( 836.94), 65 }, // v=4.087 r=21028.040 res=0.185 degC/count + { OV( 862.74), 60 }, // v=4.213 r=25144.568 res=0.204 degC/count + { OV( 886.08), 55 }, // v=4.327 r=30196.449 res=0.227 degC/count + { OV( 906.97), 50 }, // v=4.429 r=36424.838 res=0.255 degC/count + { OV( 941.65), 40 }, // v=4.598 r=53745.337 res=0.333 degC/count + { OV( 967.76), 30 }, // v=4.725 r=80880.630 res=0.452 degC/count + { OV( 978.03), 25 }, // v=4.776 r=100000.000 res=0.535 degC/count + { OV( 981.68), 23 }, // v=4.793 r=109024.395 res=0.573 degC/count + { OV( 983.41), 22 }, // v=4.802 r=113875.430 res=0.594 degC/count + { OV( 985.08), 21 }, // v=4.810 r=118968.955 res=0.616 degC/count + { OV( 986.70), 20 }, // v=4.818 r=124318.354 res=0.638 degC/count + { OV( 993.94), 15 }, // v=4.853 r=155431.302 res=0.768 degC/count + { OV( 999.96), 10 }, // v=4.883 r=195480.023 res=0.934 degC/count + { OV(1008.95), 0 } // v=4.926 r=314997.575 res=1.418 degC/count }; diff --git a/Marlin/src/module/thermistor/thermistor_99.h b/Marlin/src/module/thermistor/thermistor_99.h new file mode 100644 index 000000000000..b6183e54e413 --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_99.h @@ -0,0 +1,64 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +#pragma once + +// 100k bed thermistor with a 10K pull-up resistor - made by $ buildroot/share/scripts/createTemperatureLookupMarlin.py --rp=10000 + +const short temptable_99[][2] PROGMEM = { + { OV( 5.81), 350 }, // v=0.028 r= 57.081 res=13.433 degC/count + { OV( 6.54), 340 }, // v=0.032 r= 64.248 res=11.711 degC/count + { OV( 7.38), 330 }, // v=0.036 r= 72.588 res=10.161 degC/count + { OV( 8.36), 320 }, // v=0.041 r= 82.336 res= 8.772 degC/count + { OV( 9.51), 310 }, // v=0.046 r= 93.780 res= 7.535 degC/count + { OV( 10.87), 300 }, // v=0.053 r= 107.281 res= 6.439 degC/count + { OV( 12.47), 290 }, // v=0.061 r= 123.286 res= 5.473 degC/count + { OV( 14.37), 280 }, // v=0.070 r= 142.360 res= 4.627 degC/count + { OV( 16.64), 270 }, // v=0.081 r= 165.215 res= 3.891 degC/count + { OV( 19.37), 260 }, // v=0.095 r= 192.758 res= 3.253 degC/count + { OV( 22.65), 250 }, // v=0.111 r= 226.150 res= 2.705 degC/count + { OV( 26.62), 240 }, // v=0.130 r= 266.891 res= 2.236 degC/count + { OV( 31.46), 230 }, // v=0.154 r= 316.931 res= 1.839 degC/count + { OV( 37.38), 220 }, // v=0.182 r= 378.822 res= 1.504 degC/count + { OV( 44.65), 210 }, // v=0.218 r= 455.939 res= 1.224 degC/count + { OV( 53.64), 200 }, // v=0.262 r= 552.778 res= 0.991 degC/count + { OV( 64.78), 190 }, // v=0.316 r= 675.386 res= 0.799 degC/count + { OV( 78.65), 180 }, // v=0.384 r= 831.973 res= 0.643 degC/count + { OV( 95.94), 170 }, // v=0.468 r= 1033.801 res= 0.516 degC/count + { OV(117.52), 160 }, // v=0.574 r= 1296.481 res= 0.414 degC/count + { OV(144.42), 150 }, // v=0.705 r= 1641.900 res= 0.333 degC/count + { OV(177.80), 140 }, // v=0.868 r= 2101.110 res= 0.269 degC/count + { OV(218.89), 130 }, // v=1.069 r= 2718.725 res= 0.220 degC/count + { OV(268.82), 120 }, // v=1.313 r= 3559.702 res= 0.183 degC/count + { OV(328.35), 110 }, // v=1.603 r= 4719.968 res= 0.155 degC/count + { OV(397.44), 100 }, // v=1.941 r= 6343.323 res= 0.136 degC/count + { OV(474.90), 90 }, // v=2.319 r= 8648.807 res= 0.124 degC/count + { OV(558.03), 80 }, // v=2.725 r= 11975.779 res= 0.118 degC/count + { OV(642.76), 70 }, // v=3.138 r= 16859.622 res= 0.119 degC/count + { OV(724.25), 60 }, // v=3.536 r= 24161.472 res= 0.128 degC/count + { OV(797.93), 50 }, // v=3.896 r= 35295.361 res= 0.146 degC/count + { OV(860.51), 40 }, // v=4.202 r= 52635.209 res= 0.178 degC/count + { OV(910.55), 30 }, // v=4.446 r= 80262.251 res= 0.229 degC/count + { OV(948.36), 20 }, // v=4.631 r=125374.433 res= 0.313 degC/count + { OV(975.47), 10 }, // v=4.763 r=201020.458 res= 0.449 degC/count + { OV(994.02), 0 } // v=4.854 r=331567.870 res= 0.676 degC/count +}; diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 21fd10526dd6..8dac7e2aeee8 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -23,8 +23,21 @@ #include "../../inc/MarlinConfig.h" -#define OVERSAMPLENR 16 -#define OV(N) int16_t((N) * (OVERSAMPLENR)) +#define THERMISTOR_TABLE_ADC_RESOLUTION 1024 +#define THERMISTOR_TABLE_SCALE (HAL_ADC_RANGE / (THERMISTOR_TABLE_ADC_RESOLUTION)) +#if ENABLED(HAL_ADC_FILTERED) + #define OVERSAMPLENR 1 +#else + #define OVERSAMPLENR 16 +#endif +#define MAX_RAW_THERMISTOR_VALUE (HAL_ADC_RANGE * (OVERSAMPLENR) - 1) + +// Currently Marlin stores all oversampled ADC values as int16_t, make sure the HAL settings do not overflow 15bit +#if MAX_RAW_THERMISTOR_VALUE > ((1 << 15) - 1) + #error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION." +#endif + +#define OV(N) int16_t((N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE)) #define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTORBED == n || THERMISTORCHAMBER == n) @@ -56,6 +69,9 @@ #if ANY_THERMISTOR_IS(501) // 100K Zonestar thermistor #include "thermistor_501.h" #endif +#if ANY_THERMISTOR_IS(512) // 100k thermistor in RPW-Ultra hotend, Pull-up = 4.7 kOhm, "unknown model" + #include "thermistor_512.h" +#endif #if ANY_THERMISTOR_IS(6) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 8.2 kOhm, "EPCOS ?" #include "thermistor_6.h" #endif @@ -86,7 +102,7 @@ #if ANY_THERMISTOR_IS(18) // ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 #include "thermistor_18.h" #endif -#if ANY_THERMISTOR_IS(20) // PT100 with INA826 amp on Ultimaker v2.0 electronics +#if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics #include "thermistor_20.h" #endif #if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS" @@ -119,12 +135,21 @@ #if ANY_THERMISTOR_IS(75) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "MGB18-104F39050L32 thermistor" #include "thermistor_75.h" #endif +#if ANY_THERMISTOR_IS(99) // 100k bed thermistor with a 10K pull-up resistor (on some Wanhao i3 models) + #include "thermistor_99.h" +#endif #if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup #include "thermistor_110.h" #endif #if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup #include "thermistor_147.h" #endif +#if ANY_THERMISTOR_IS(201) // Pt100 with LMV324 Overlord + #include "thermistor_201.h" +#endif +#if ANY_THERMISTOR_IS(331) // Like table 1, but with 3V3 as input voltage + #include "thermistor_331.h" +#endif #if ANY_THERMISTOR_IS(666) // beta25 = UNK, R25 = 200K, Pull-up = 10 kOhm, "Unidentified 200K NTC thermistor (Einstart S)" #include "thermistor_666.h" #endif @@ -238,74 +263,76 @@ static_assert( // For thermistors the highest temperature results in the lowest ADC value // For thermocouples the highest temperature results in the highest ADC value #ifndef HEATER_0_RAW_HI_TEMP - #ifdef HEATER_0_USES_THERMISTOR - #define HEATER_0_RAW_HI_TEMP 0 - #define HEATER_0_RAW_LO_TEMP 16383 - #else - #define HEATER_0_RAW_HI_TEMP 16383 + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_0_USES_THERMISTOR) + #define HEATER_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_0_RAW_LO_TEMP 0 + #else + #define HEATER_0_RAW_HI_TEMP 0 + #define HEATER_0_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif #ifndef HEATER_1_RAW_HI_TEMP - #ifdef HEATER_1_USES_THERMISTOR - #define HEATER_1_RAW_HI_TEMP 0 - #define HEATER_1_RAW_LO_TEMP 16383 - #else - #define HEATER_1_RAW_HI_TEMP 16383 + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_1_USES_THERMISTOR) + #define HEATER_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_1_RAW_LO_TEMP 0 + #else + #define HEATER_1_RAW_HI_TEMP 0 + #define HEATER_1_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif #ifndef HEATER_2_RAW_HI_TEMP - #ifdef HEATER_2_USES_THERMISTOR - #define HEATER_2_RAW_HI_TEMP 0 - #define HEATER_2_RAW_LO_TEMP 16383 - #else - #define HEATER_2_RAW_HI_TEMP 16383 + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_2_USES_THERMISTOR) + #define HEATER_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_2_RAW_LO_TEMP 0 + #else + #define HEATER_2_RAW_HI_TEMP 0 + #define HEATER_2_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif #ifndef HEATER_3_RAW_HI_TEMP - #ifdef HEATER_3_USES_THERMISTOR - #define HEATER_3_RAW_HI_TEMP 0 - #define HEATER_3_RAW_LO_TEMP 16383 - #else - #define HEATER_3_RAW_HI_TEMP 16383 + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_3_USES_THERMISTOR) + #define HEATER_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_3_RAW_LO_TEMP 0 + #else + #define HEATER_3_RAW_HI_TEMP 0 + #define HEATER_3_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif #ifndef HEATER_4_RAW_HI_TEMP - #ifdef HEATER_4_USES_THERMISTOR - #define HEATER_4_RAW_HI_TEMP 0 - #define HEATER_4_RAW_LO_TEMP 16383 - #else - #define HEATER_4_RAW_HI_TEMP 16383 + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_4_USES_THERMISTOR) + #define HEATER_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_4_RAW_LO_TEMP 0 + #else + #define HEATER_4_RAW_HI_TEMP 0 + #define HEATER_4_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif #ifndef HEATER_5_RAW_HI_TEMP - #ifdef HEATER_5_USES_THERMISTOR - #define HEATER_5_RAW_HI_TEMP 0 - #define HEATER_5_RAW_LO_TEMP 16383 - #else - #define HEATER_5_RAW_HI_TEMP 16383 + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_5_USES_THERMISTOR) + #define HEATER_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_5_RAW_LO_TEMP 0 + #else + #define HEATER_5_RAW_HI_TEMP 0 + #define HEATER_5_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif #ifndef HEATER_BED_RAW_HI_TEMP - #ifdef HEATER_BED_USES_THERMISTOR - #define HEATER_BED_RAW_HI_TEMP 0 - #define HEATER_BED_RAW_LO_TEMP 16383 - #else - #define HEATER_BED_RAW_HI_TEMP 16383 + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_BED_USES_THERMISTOR) + #define HEATER_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_BED_RAW_LO_TEMP 0 + #else + #define HEATER_BED_RAW_HI_TEMP 0 + #define HEATER_BED_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #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 + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_CHAMBER_USES_THERMISTOR) + #define HEATER_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define HEATER_CHAMBER_RAW_LO_TEMP 0 + #else + #define HEATER_CHAMBER_RAW_HI_TEMP 0 + #define HEATER_CHAMBER_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif + +#undef REVERSE_TEMP_SENSOR_RANGE diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index f32ca32e9510..b392e751d5d1 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -81,6 +81,10 @@ #include "../lcd/ultralcd.h" #endif +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #include "../feature/pause.h" +#endif + #if DO_SWITCH_EXTRUDER #if EXTRUDERS > 3 @@ -129,32 +133,32 @@ #endif // SWITCHING_NOZZLE -inline void fast_line_to_current(const AxisEnum fr_axis) { - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[fr_axis], active_extruder); +inline void _line_to_current(const AxisEnum fr_axis, const float fscale=1) { + line_to_current_position(planner.settings.max_feedrate_mm_s[fr_axis] * fscale); } +inline void slow_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.5f); } +inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis); } #if ENABLED(MAGNETIC_PARKING_EXTRUDER) - float parkingposx[2] , // M951 R L - parkinggrabdistance , // M951 I - parkingslowspeed, // M951 J - parkinghighspeed , // M951 H - parkingtraveldistance, // M951 D + float parkingposx[2], // M951 R L + parkinggrabdistance, // M951 I + parkingslowspeed, // M951 J + parkinghighspeed, // M951 H + parkingtraveldistance, // M951 D compensationmultiplier; - inline void magnetic_parking_extruder_tool_change(const uint8_t tmp_extruder) { + inline void magnetic_parking_extruder_tool_change(const uint8_t new_tool) { - const float oldx = current_position[X_AXIS], - grabpos = mpe_settings.parking_xpos[tmp_extruder] + (tmp_extruder ? mpe_settings.grab_distance : -mpe_settings.grab_distance), - offsetcompensation = + const float oldx = current_position.x, + grabpos = mpe_settings.parking_xpos[new_tool] + (new_tool ? mpe_settings.grab_distance : -mpe_settings.grab_distance), + offsetcompensation = (0 #if HAS_HOTEND_OFFSET - hotend_offset[X_AXIS][active_extruder] * mpe_settings.compensation_factor - #else - 0 + + hotend_offset[active_extruder].x * mpe_settings.compensation_factor #endif - ; + ); - if (axis_unhomed_error(true, false, false)) return; + if (axis_unhomed_error(_BV(X_AXIS))) return; /** * Z Lift and Nozzle Offset shift ar defined in caller method to work equal with any Multi Hotend realization @@ -170,26 +174,26 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { // STEP 1 - current_position[X_AXIS] = mpe_settings.parking_xpos[tmp_extruder] + offsetcompensation; + current_position.x = mpe_settings.parking_xpos[new_tool] + offsetcompensation; if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(1) Move extruder ", int(tmp_extruder)); + DEBUG_ECHOPAIR("(1) Move extruder ", int(new_tool)); DEBUG_POS(" to new extruder ParkPos", current_position); } - planner.buffer_line(current_position, mpe_settings.fast_feedrate, tmp_extruder); + planner.buffer_line(current_position, mpe_settings.fast_feedrate, new_tool); planner.synchronize(); // STEP 2 - current_position[X_AXIS] = grabpos + offsetcompensation; + current_position.x = grabpos + offsetcompensation; if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(2) Couple extruder ", int(tmp_extruder)); + DEBUG_ECHOPAIR("(2) Couple extruder ", int(new_tool)); DEBUG_POS(" to new extruder GrabPos", current_position); } - planner.buffer_line(current_position, mpe_settings.slow_feedrate, tmp_extruder); + planner.buffer_line(current_position, mpe_settings.slow_feedrate, new_tool); planner.synchronize(); // Delay before moving tool, to allow magnetic coupling @@ -197,48 +201,48 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { // STEP 3 - current_position[X_AXIS] = mpe_settings.parking_xpos[tmp_extruder] + offsetcompensation; + current_position.x = mpe_settings.parking_xpos[new_tool] + offsetcompensation; if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(3) Move extruder ", int(tmp_extruder)); + DEBUG_ECHOPAIR("(3) Move extruder ", int(new_tool)); DEBUG_POS(" back to new extruder ParkPos", current_position); } - planner.buffer_line(current_position, mpe_settings.slow_feedrate, tmp_extruder); + planner.buffer_line(current_position, mpe_settings.slow_feedrate, new_tool); planner.synchronize(); // STEP 4 - current_position[X_AXIS] = mpe_settings.parking_xpos[active_extruder] + (active_extruder == 0 ? MPE_TRAVEL_DISTANCE : -MPE_TRAVEL_DISTANCE) + offsetcompensation; + current_position.x = mpe_settings.parking_xpos[active_extruder] + (active_extruder == 0 ? MPE_TRAVEL_DISTANCE : -MPE_TRAVEL_DISTANCE) + offsetcompensation; if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(4) Move extruder ", int(tmp_extruder)); + DEBUG_ECHOPAIR("(4) Move extruder ", int(new_tool)); DEBUG_POS(" close to old extruder ParkPos", current_position); } - planner.buffer_line(current_position, mpe_settings.fast_feedrate, tmp_extruder); + planner.buffer_line(current_position, mpe_settings.fast_feedrate, new_tool); planner.synchronize(); // STEP 5 - current_position[X_AXIS] = mpe_settings.parking_xpos[active_extruder] + offsetcompensation; + current_position.x = mpe_settings.parking_xpos[active_extruder] + offsetcompensation; if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(5) Park extruder ", int(tmp_extruder)); + DEBUG_ECHOPAIR("(5) Park extruder ", int(new_tool)); DEBUG_POS(" at old extruder ParkPos", current_position); } - planner.buffer_line(current_position, mpe_settings.slow_feedrate, tmp_extruder); + planner.buffer_line(current_position, mpe_settings.slow_feedrate, new_tool); planner.synchronize(); // STEP 6 - current_position[X_AXIS] = oldx; + current_position.x = oldx; if (DEBUGGING(LEVELING)) { - DEBUG_ECHOPAIR("(6) Move extruder ", int(tmp_extruder)); + DEBUG_ECHOPAIR("(6) Move extruder ", int(new_tool)); DEBUG_POS(" to starting position", current_position); } - planner.buffer_line(current_position, mpe_settings.fast_feedrate, tmp_extruder); + planner.buffer_line(current_position, mpe_settings.fast_feedrate, new_tool); planner.synchronize(); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Autopark done."); @@ -265,19 +269,19 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { #endif } - inline void parking_extruder_tool_change(const uint8_t tmp_extruder, bool no_move) { + inline void parking_extruder_tool_change(const uint8_t new_tool, bool no_move) { if (!no_move) { constexpr float parkingposx[] = PARKING_EXTRUDER_PARKING_X; #if HAS_HOTEND_OFFSET - const float x_offset = hotend_offset[X_AXIS][active_extruder]; + const float x_offset = hotend_offset[active_extruder].x; #else constexpr float x_offset = 0; #endif - const float midpos = (parkingposx[0] + parkingposx[1]) * 0.5 + x_offset, - grabpos = parkingposx[tmp_extruder] + (tmp_extruder ? PARKING_EXTRUDER_GRAB_DISTANCE : -(PARKING_EXTRUDER_GRAB_DISTANCE)) + x_offset; + const float midpos = (parkingposx[0] + parkingposx[1]) * 0.5f + x_offset, + grabpos = parkingposx[new_tool] + (new_tool ? PARKING_EXTRUDER_GRAB_DISTANCE : -(PARKING_EXTRUDER_GRAB_DISTANCE)) + x_offset; /** * 1. Move to park position of old extruder @@ -290,71 +294,70 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { // STEP 1 - if (DEBUGGING(LEVELING)) DEBUG_POS("Start Autopark", current_position); - - current_position[X_AXIS] = parkingposx[active_extruder] + x_offset; + if (DEBUGGING(LEVELING)) DEBUG_POS("Start PE Tool-Change", current_position); + current_position.x = parkingposx[active_extruder] + x_offset; if (DEBUGGING(LEVELING)) { DEBUG_ECHOLNPAIR("(1) Park extruder ", int(active_extruder)); DEBUG_POS("Moving ParkPos", current_position); } - fast_line_to_current(X_AXIS); - planner.synchronize(); // STEP 2 - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(2) Disengage magnet "); - + planner.synchronize(); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(2) Disengage magnet"); pe_deactivate_solenoid(active_extruder); // STEP 3 - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(3) Move near new extruder"); - - current_position[X_AXIS] += active_extruder ? -10 : 10; // move 10mm away from parked extruder - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move away from parked extruder", current_position); - + current_position.x += active_extruder ? -10 : 10; // move 10mm away from parked extruder + if (DEBUGGING(LEVELING)) { + DEBUG_ECHOLNPGM("(3) Move near new extruder"); + DEBUG_POS("Move away from parked extruder", current_position); + } fast_line_to_current(X_AXIS); - planner.synchronize(); // STEP 4 - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(4) Engage magnetic field"); + planner.synchronize(); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(4) Engage magnetic field"); #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) - pe_activate_solenoid(active_extruder); //just save power for inverted magnets + pe_activate_solenoid(active_extruder); // Just save power for inverted magnets #endif - - pe_activate_solenoid(tmp_extruder); + pe_activate_solenoid(new_tool); // STEP 5 - current_position[X_AXIS] = grabpos + (tmp_extruder ? -10 : 10); + current_position.x = grabpos + (new_tool ? -10 : 10); fast_line_to_current(X_AXIS); - current_position[X_AXIS] = grabpos; - if (DEBUGGING(LEVELING)) DEBUG_POS("(5) Unpark extruder", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.5, active_extruder); - planner.synchronize(); + + current_position.x = grabpos; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("(5) Unpark extruder", current_position); + } + slow_line_to_current(X_AXIS); // STEP 6 - current_position[X_AXIS] = midpos + current_position.x = midpos #if HAS_HOTEND_OFFSET - - hotend_offset[X_AXIS][tmp_extruder] + - hotend_offset[new_tool].x #endif ; - - if (DEBUGGING(LEVELING)) DEBUG_POS("(6) Move midway between hotends", current_position); - + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("(6) Move midway between hotends", current_position); + } fast_line_to_current(X_AXIS); - planner.synchronize(); + planner.synchronize(); // Always sync the final move - DEBUG_ECHOLNPGM("Autopark done."); + if (DEBUGGING(LEVELING)) DEBUG_POS("PE Tool-Change done.", current_position); } else { // nomove == true // Only engage magnetic field for new extruder - pe_activate_solenoid(tmp_extruder); + pe_activate_solenoid(new_tool); #if ENABLED(PARKING_EXTRUDER_SOLENOIDS_INVERT) pe_activate_solenoid(active_extruder); // Just save power for inverted magnets #endif @@ -365,14 +368,14 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { #if ENABLED(SWITCHING_TOOLHEAD) - inline void switching_toolhead_tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { + inline void switching_toolhead_tool_change(const uint8_t new_tool, bool no_move/*=false*/) { if (no_move) return; constexpr uint16_t angles[2] = SWITCHING_TOOLHEAD_SERVO_ANGLES; constexpr float toolheadposx[] = SWITCHING_TOOLHEAD_X_POS; const float placexpos = toolheadposx[active_extruder], - grabxpos = toolheadposx[tmp_extruder]; + grabxpos = toolheadposx[new_tool]; /** * 1. Move to switch position of current toolhead @@ -383,96 +386,94 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { // 1. Move to switch position of current toolhead - if (DEBUGGING(LEVELING)) DEBUG_POS("Starting Toolhead change", current_position); - - current_position[X_AXIS] = placexpos; + if (DEBUGGING(LEVELING)) DEBUG_POS("Start ST Tool-Change", current_position); + current_position.x = placexpos; if (DEBUGGING(LEVELING)) { DEBUG_ECHOLNPAIR("(1) Place old tool ", int(active_extruder)); DEBUG_POS("Move X SwitchPos", current_position); } - fast_line_to_current(X_AXIS); - planner.synchronize(); - - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS - SWITCHING_TOOLHEAD_Y_SECURITY; - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos + Security", current_position); + current_position.y = SWITCHING_TOOLHEAD_Y_POS - (SWITCHING_TOOLHEAD_Y_SECURITY); + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("Move Y SwitchPos + Security", current_position); + } fast_line_to_current(Y_AXIS); - planner.synchronize(); // 2. Unlock tool and drop it in the dock + planner.synchronize(); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(2) Unlock and Place Toolhead"); - MOVE_SERVO(SWITCHING_TOOLHEAD_SERVO_NR, angles[1]); safe_delay(500); - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS; - + current_position.y = SWITCHING_TOOLHEAD_Y_POS; if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos", current_position); + slow_line_to_current(Y_AXIS); - planner.buffer_line(current_position,(planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5), active_extruder); + // Wait for move to complete, then another 0.2s planner.synchronize(); safe_delay(200); - current_position[Y_AXIS] -= SWITCHING_TOOLHEAD_Y_CLEAR; + current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); - fast_line_to_current(Y_AXIS); // move away from docked toolhead - planner.synchronize(); // 3. Move to the new toolhead - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(3) Move to new toolhead position"); - - current_position[X_AXIS] = grabxpos; - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X", current_position); - + current_position.x = grabxpos; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_ECHOLNPGM("(3) Move to new toolhead position"); + DEBUG_POS("Move to new toolhead X", current_position); + } fast_line_to_current(X_AXIS); - planner.synchronize(); - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS - SWITCHING_TOOLHEAD_Y_SECURITY; - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos + Security", current_position); + current_position.y = SWITCHING_TOOLHEAD_Y_POS - (SWITCHING_TOOLHEAD_Y_SECURITY); + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("Move Y SwitchPos + Security", current_position); + } fast_line_to_current(Y_AXIS); - planner.synchronize(); // 4. Grab and lock the new toolhead - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(4) Grab and lock new toolhead "); - - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS; - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos", current_position); + current_position.y = SWITCHING_TOOLHEAD_Y_POS; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_ECHOLNPGM("(4) Grab and lock new toolhead"); + DEBUG_POS("Move Y SwitchPos", current_position); + } + slow_line_to_current(Y_AXIS); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5, active_extruder); + // Wait for move to finish, pause 0.2s, move servo, pause 0.5s planner.synchronize(); - safe_delay(200); MOVE_SERVO(SWITCHING_TOOLHEAD_SERVO_NR, angles[0]); safe_delay(500); - current_position[Y_AXIS] -= SWITCHING_TOOLHEAD_Y_CLEAR; - + current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); + fast_line_to_current(Y_AXIS); // Move away from docked toolhead + planner.synchronize(); // Always sync the final move - fast_line_to_current(Y_AXIS); // move away from docked toolhead - planner.synchronize(); - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Toolhead change done."); + if (DEBUGGING(LEVELING)) DEBUG_POS("ST Tool-Change done.", current_position); } #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) - inline void magnetic_switching_toolhead_tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { + inline void magnetic_switching_toolhead_tool_change(const uint8_t new_tool, bool no_move/*=false*/) { if (no_move) return; - constexpr float toolheadposx[] = SWITCHING_TOOLHEAD_X_POS; + constexpr float toolheadposx[] = SWITCHING_TOOLHEAD_X_POS, + toolheadclearx[] = SWITCHING_TOOLHEAD_X_SECURITY; + const float placexpos = toolheadposx[active_extruder], - grabxpos = toolheadposx[tmp_extruder]; + placexclear = toolheadclearx[active_extruder], + grabxpos = toolheadposx[new_tool], + grabxclear = toolheadclearx[new_tool]; /** * 1. Move to switch position of current toolhead @@ -481,103 +482,111 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { * 4. Grab the new toolhead and move to security position */ - if (DEBUGGING(LEVELING)) DEBUG_POS("Starting Toolhead change", current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("Start MST Tool-Change", current_position); // 1. Move to switch position current toolhead - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR; - + current_position.y = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR; if (DEBUGGING(LEVELING)) { SERIAL_ECHOLNPAIR("(1) Place old tool ", int(active_extruder)); DEBUG_POS("Move Y SwitchPos + Security", current_position); } + fast_line_to_current(Y_AXIS); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); - planner.synchronize(); - - current_position[X_AXIS] = placexpos + SWITCHING_TOOLHEAD_X_SECURITY; - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move X SwitchPos + Security", current_position); - - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); - - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS; - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos", current_position); - - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); - planner.synchronize(); - - current_position[X_AXIS] = placexpos; + current_position.x = placexclear; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("Move X SwitchPos + Security", current_position); + } + fast_line_to_current(X_AXIS); - if (DEBUGGING(LEVELING)) DEBUG_POS("Move X SwitchPos", current_position); + current_position.y = SWITCHING_TOOLHEAD_Y_POS; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("Move Y SwitchPos", current_position); + } + fast_line_to_current(Y_AXIS); - planner.buffer_line(current_position, (planner.settings.max_feedrate_mm_s[X_AXIS] * 0.25), active_extruder); - planner.synchronize(); + current_position.x = placexpos; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("Move X SwitchPos", current_position); + } + line_to_current_position(planner.settings.max_feedrate_mm_s[X_AXIS] * 0.25f); // 2. Release and place toolhead in the dock - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(2) Release and Place Toolhead"); - - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_RELEASE; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_ECHOLNPGM("(2) Release and Place Toolhead"); + } + current_position.y = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_RELEASE; if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos + Release", current_position); + line_to_current_position(planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.1f); - planner.buffer_line(current_position, (planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.1), active_extruder); - planner.synchronize(); - - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_SECURITY; - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos + Security", current_position); - - planner.buffer_line(current_position, (planner.settings.max_feedrate_mm_s[Y_AXIS]), active_extruder); - planner.synchronize(); + current_position.y = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_SECURITY; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("Move Y SwitchPos + Security", current_position); + } + line_to_current_position(planner.settings.max_feedrate_mm_s[Y_AXIS]); // 3. Move to new toolhead position - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(3) Move to new toolhead position"); - - current_position[X_AXIS] = grabxpos; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_ECHOLNPGM("(3) Move to new toolhead position"); + } + current_position.x = grabxpos; if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X", current_position); - - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); - planner.synchronize(); + fast_line_to_current(X_AXIS); // 4. Grab the new toolhead and move to security position - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(4) Grab new toolhead and move to security position"); - - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_RELEASE; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_ECHOLNPGM("(4) Grab new toolhead, move to security position"); + } + current_position.y = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_RELEASE; if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos + Release", current_position); + line_to_current_position(planner.settings.max_feedrate_mm_s[Y_AXIS]); - planner.buffer_line(current_position, (planner.settings.max_feedrate_mm_s[Y_AXIS]), active_extruder); - planner.synchronize(); - - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS; - - if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos", current_position); - - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.2, active_extruder); - planner.synchronize(); - safe_delay(100); + current_position.y = SWITCHING_TOOLHEAD_Y_POS; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_POS("Move Y SwitchPos", current_position); + } + _line_to_current(Y_AXIS, 0.2f); - current_position[X_AXIS] = grabxpos + SWITCHING_TOOLHEAD_X_SECURITY; + #if ENABLED(PRIME_BEFORE_REMOVE) && (SWITCHING_TOOLHEAD_PRIME_MM || SWITCHING_TOOLHEAD_RETRACT_MM) + #if SWITCHING_TOOLHEAD_PRIME_MM + current_position.e += SWITCHING_TOOLHEAD_PRIME_MM; + planner.buffer_line(current_position, MMM_TO_MMS(SWITCHING_TOOLHEAD_PRIME_FEEDRATE), new_tool); + #endif + #if SWITCHING_TOOLHEAD_RETRACT_MM + current_position.e -= SWITCHING_TOOLHEAD_RETRACT_MM; + planner.buffer_line(current_position, MMM_TO_MMS(SWITCHING_TOOLHEAD_RETRACT_FEEDRATE), new_tool); + #endif + #else + planner.synchronize(); + safe_delay(100); // Give switch time to settle + #endif + current_position.x = grabxclear; if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X + Security", current_position); - - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.1, active_extruder); + _line_to_current(X_AXIS, 0.1f); planner.synchronize(); - safe_delay(100); - - current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; + safe_delay(100); // Give switch time to settle + current_position.y += SWITCHING_TOOLHEAD_Y_CLEAR; if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); + fast_line_to_current(Y_AXIS); // move away from docked toolhead + planner.synchronize(); // Always sync last tool-change move - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); // move away from docked toolhead - planner.synchronize(); + if (DEBUGGING(LEVELING)) DEBUG_POS("MST Tool-Change done.", current_position); } #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) @@ -586,12 +595,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { inline void est_deactivate_solenoid() { OUT_WRITE(SOL0_PIN, LOW); } void est_init() { est_activate_solenoid(); } - inline void electromagnetic_switching_toolhead(const uint8_t tmp_extruder, bool no_move) { + inline void em_switching_toolhead_tool_change(const uint8_t new_tool, bool no_move) { if (no_move) return; constexpr float toolheadposx[] = SWITCHING_TOOLHEAD_X_POS; const float placexpos = toolheadposx[active_extruder], - grabxpos = toolheadposx[tmp_extruder]; + grabxpos = toolheadposx[new_tool]; + const xyz_pos_t &hoffs = hotend_offset[active_extruder]; /** * 1. Raise Z-Axis to give enough clearance @@ -605,123 +615,98 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { * 9. Apply Z hotend offset to current position */ - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("Starting Autopark", current_position); - #endif + if (DEBUGGING(LEVELING)) DEBUG_POS("Start EMST Tool-Change", current_position); // 1. Raise Z-Axis to give enough clearance - current_position[Z_AXIS] += SWITCHING_TOOLHEAD_Z_HOP; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("(1) Raise Z-Axis ", current_position); - #endif - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); + current_position.z += SWITCHING_TOOLHEAD_Z_HOP; + if (DEBUGGING(LEVELING)) DEBUG_POS("(1) Raise Z-Axis ", current_position); + fast_line_to_current(Z_AXIS); // 2. Move to position near active extruder parking - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - SERIAL_ECHOLNPAIR("(2) Move near active extruder parking", active_extruder); - DEBUG_POS("Moving ParkPos", current_position); - } - #endif - current_position[X_AXIS] = placexpos + hotend_offset[X_AXIS][active_extruder]; - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR + hotend_offset[Y_AXIS][active_extruder]; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + SERIAL_ECHOLNPAIR("(2) Move near active extruder parking", active_extruder); + DEBUG_POS("Moving ParkPos", current_position); + } + current_position.set(hoffs.x + placexpos, + hoffs.y + SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR); + fast_line_to_current(X_AXIS); // 3. Move gently to park position of active extruder - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - SERIAL_ECHOLNPAIR("(3) Move gently to park position of active extruder", active_extruder); - DEBUG_POS("Moving ParkPos", current_position); - } - #endif + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + SERIAL_ECHOLNPAIR("(3) Move gently to park position of active extruder", active_extruder); + DEBUG_POS("Moving ParkPos", current_position); + } - current_position[Y_AXIS] -= SWITCHING_TOOLHEAD_Y_CLEAR; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5, active_extruder); + current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; + slow_line_to_current(Y_AXIS); // 4. Disengage magnetic field, wait for delay - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(4) Disengage magnet"); - #endif - planner.synchronize(); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(4) Disengage magnet"); est_deactivate_solenoid(); // 5. Leave extruder and move to position near new extruder parking - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOLNPGM("(5) Move near new extruder parking"); - DEBUG_POS("Moving ParkPos", current_position); - } - #endif - - current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5f, active_extruder); + if (DEBUGGING(LEVELING)) { + DEBUG_ECHOLNPGM("(5) Move near new extruder parking"); + DEBUG_POS("Moving ParkPos", current_position); + } - current_position[X_AXIS] = grabxpos + hotend_offset[X_AXIS][active_extruder]; - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR + hotend_offset[Y_AXIS][active_extruder]; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + current_position.y += SWITCHING_TOOLHEAD_Y_CLEAR; + slow_line_to_current(Y_AXIS); + current_position.set(hoffs.x + grabxpos, + hoffs.y + SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR); + fast_line_to_current(X_AXIS); // 6. Move gently to park position of new extruder - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - SERIAL_ECHOLNPGM("(6) Move near new extruder"); - } - #endif - - current_position[Y_AXIS] -= SWITCHING_TOOLHEAD_Y_CLEAR; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5f, active_extruder); + current_position.y -= SWITCHING_TOOLHEAD_Y_CLEAR; + if (DEBUGGING(LEVELING)) { + planner.synchronize(); + DEBUG_ECHOLNPGM("(6) Move near new extruder"); + } + slow_line_to_current(Y_AXIS); // 7. Engage magnetic field for new extruder parking - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(7) Engage magnetic field"); - #endif - planner.synchronize(); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(7) Engage magnetic field"); est_activate_solenoid(); // 8. Unpark extruder - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("(8) Unpark extruder"); - #endif - - current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; - - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.5f, active_extruder); + current_position.y += SWITCHING_TOOLHEAD_Y_CLEAR; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(8) Unpark extruder"); + slow_line_to_current(X_AXIS); + planner.synchronize(); // Always sync the final move // 9. Apply Z hotend offset to current position - current_position[Z_AXIS] += hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; + if (DEBUGGING(LEVELING)) DEBUG_POS("(9) Applying Z-offset", current_position); + current_position.z += hoffs.z - hotend_offset[new_tool].z; - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - planner.synchronize(); - DEBUG_POS("(9) Applying Z-offset", current_position); - } - #endif + if (DEBUGGING(LEVELING)) DEBUG_POS("EMST Tool-Change done.", current_position); } #endif // ELECTROMAGNETIC_SWITCHING_TOOLHEAD -inline void invalid_extruder_error(const uint8_t e) { - SERIAL_ECHO_START(); - SERIAL_CHAR('T'); SERIAL_ECHO(int(e)); - SERIAL_CHAR(' '); SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); -} +#if EXTRUDERS + inline void invalid_extruder_error(const uint8_t e) { + SERIAL_ECHO_START(); + SERIAL_CHAR('T'); SERIAL_ECHO(int(e)); + SERIAL_CHAR(' '); SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); + } +#endif #if ENABLED(DUAL_X_CARRIAGE) - inline void dualx_tool_change(const uint8_t tmp_extruder, bool &no_move) { + inline void dualx_tool_change(const uint8_t new_tool, bool &no_move) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM("Dual X Carriage Mode "); switch (dual_x_carriage_mode) { @@ -734,19 +719,20 @@ inline void invalid_extruder_error(const uint8_t e) { 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) && ! no_move + && IsRunning() && !no_move + && (delayed_move_time || current_position.x != xhome) ) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("MoveX to ", xhome); // Park old head - planner.buffer_line(xhome, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + current_position.x = xhome; + line_to_current_position(planner.settings.max_feedrate_mm_s[X_AXIS]); planner.synchronize(); } // Activate the new extruder ahead of calling set_axis_is_at_home! - active_extruder = tmp_extruder; + active_extruder = new_tool; // This function resets the max/min values - the current position may be overwritten below. set_axis_is_at_home(X_AXIS); @@ -756,13 +742,13 @@ inline void invalid_extruder_error(const uint8_t e) { 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; + current_position.x = inactive_extruder_x_pos; // Save the inactive extruder's position (from the old current_position) - inactive_extruder_x_pos = destination[X_AXIS]; + inactive_extruder_x_pos = destination.x; break; case DXC_AUTO_PARK_MODE: // record current raised toolhead position for use by unpark - COPY(raised_parked_position, current_position); + raised_parked_position = current_position; active_extruder_parked = true; delayed_move_time = 0; break; @@ -782,35 +768,40 @@ inline void invalid_extruder_error(const uint8_t e) { * 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, bool no_move/*=false*/) { +void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #if ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) - if (tmp_extruder == active_extruder) return; + if (new_tool == active_extruder) return; #endif #if ENABLED(MIXING_EXTRUDER) UNUSED(no_move); - if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) - return invalid_extruder_error(tmp_extruder); + if (new_tool >= MIXING_VIRTUAL_TOOLS) + return invalid_extruder_error(new_tool); #if MIXING_VIRTUAL_TOOLS > 1 // T0-Tnnn: Switch virtual tool by changing the index to the mix - mixer.T(tmp_extruder); + mixer.T(new_tool); #endif #elif ENABLED(PRUSA_MMU2) UNUSED(no_move); - mmu2.tool_change(tmp_extruder); + mmu2.tool_change(new_tool); + + #elif EXTRUDERS == 0 + + // Nothing to do + UNUSED(new_tool); UNUSED(no_move); #elif EXTRUDERS < 2 UNUSED(no_move); - if (tmp_extruder) invalid_extruder_error(tmp_extruder); + if (new_tool) invalid_extruder_error(new_tool); return; #else // EXTRUDERS > 1 @@ -818,18 +809,12 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { planner.synchronize(); #if ENABLED(DUAL_X_CARRIAGE) // Only T0 allowed if the Printer is in DXC_DUPLICATION_MODE or DXC_MIRRORED_MODE - if (tmp_extruder != 0 && dxc_is_duplicating()) - return invalid_extruder_error(tmp_extruder); - #endif - - #if HAS_LEVELING - // Set current position to the physical position - const bool leveling_was_active = planner.leveling_active; - set_bed_leveling_enabled(false); + if (new_tool != 0 && dxc_is_duplicating()) + return invalid_extruder_error(new_tool); #endif - if (tmp_extruder >= EXTRUDERS) - return invalid_extruder_error(tmp_extruder); + if (new_tool >= EXTRUDERS) + return invalid_extruder_error(new_tool); if (!no_move && !all_axes_homed()) { no_move = true; @@ -846,12 +831,13 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { constexpr bool idex_full_control = false; #endif + const uint8_t old_tool = active_extruder; const bool can_move_away = !no_move && !idex_full_control; #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) const bool should_swap = can_move_away && toolchange_settings.swap_length; #if ENABLED(PREVENT_COLD_EXTRUSION) - const bool too_cold = !DEBUGGING(DRYRUN) && (thermalManager.targetTooColdToExtrude(active_extruder) || thermalManager.targetTooColdToExtrude(tmp_extruder)); + const bool too_cold = !DEBUGGING(DRYRUN) && (thermalManager.targetTooColdToExtrude(old_tool) || thermalManager.targetTooColdToExtrude(new_tool)); #else constexpr bool too_cold = false; #endif @@ -859,7 +845,7 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { if (too_cold) { SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD); #if ENABLED(SINGLENOZZLE) - active_extruder = tmp_extruder; + active_extruder = new_tool; return; #endif } @@ -867,25 +853,30 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { #if ENABLED(ADVANCED_PAUSE_FEATURE) do_pause_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed)); #else - current_position[E_AXIS] -= toolchange_settings.swap_length / planner.e_factor[active_extruder]; - planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.retract_speed), active_extruder); + current_position.e -= toolchange_settings.swap_length / planner.e_factor[old_tool]; + planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.retract_speed), old_tool); planner.synchronize(); #endif } } #endif // TOOLCHANGE_FILAMENT_SWAP - if (tmp_extruder != active_extruder) { + #if HAS_LEVELING + // Set current position to the physical position + TEMPORARY_BED_LEVELING_STATE(false); + #endif + + if (new_tool != old_tool) { #if SWITCHING_NOZZLE_TWO_SERVOS - raise_nozzle(active_extruder); + raise_nozzle(old_tool); #endif REMEMBER(fr, feedrate_mm_s, XY_PROBE_FEEDRATE_MM_S); #if HAS_SOFTWARE_ENDSTOPS #if HAS_HOTEND_OFFSET - #define _EXT_ARGS , active_extruder, tmp_extruder + #define _EXT_ARGS , old_tool, new_tool #else #define _EXT_ARGS #endif @@ -896,76 +887,70 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { #endif #endif - set_destination_from_current(); + destination = current_position; #if DISABLED(SWITCHING_NOZZLE) if (can_move_away) { // Do a small lift to avoid the workpiece in the move back (below) - current_position[Z_AXIS] += toolchange_settings.z_raise; + current_position.z += toolchange_settings.z_raise; #if HAS_SOFTWARE_ENDSTOPS - NOMORE(current_position[Z_AXIS], soft_endstop[Z_AXIS].max); + NOMORE(current_position.z, soft_endstop.max.z); #endif fast_line_to_current(Z_AXIS); #if ENABLED(TOOLCHANGE_PARK) - current_position[X_AXIS] = toolchange_settings.change_point.x; - current_position[Y_AXIS] = toolchange_settings.change_point.y; + current_position = toolchange_settings.change_point; #endif - planner.buffer_line(current_position, feedrate_mm_s, active_extruder); + planner.buffer_line(current_position, feedrate_mm_s, old_tool); planner.synchronize(); } #endif #if HAS_HOTEND_OFFSET + xyz_pos_t diff = hotend_offset[new_tool] - hotend_offset[old_tool]; #if ENABLED(DUAL_X_CARRIAGE) - constexpr float xdiff = 0; - #else - const float xdiff = hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder]; + diff.x = 0; #endif - const float ydiff = hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder], - zdiff = hotend_offset[Z_AXIS][tmp_extruder] - hotend_offset[Z_AXIS][active_extruder]; #else - constexpr float xdiff = 0, ydiff = 0, zdiff = 0; + constexpr xyz_pos_t diff{0}; #endif #if ENABLED(DUAL_X_CARRIAGE) - dualx_tool_change(tmp_extruder, no_move); + dualx_tool_change(new_tool, no_move); #elif ENABLED(PARKING_EXTRUDER) // Dual Parking extruder - parking_extruder_tool_change(tmp_extruder, no_move); + parking_extruder_tool_change(new_tool, no_move); #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) // Magnetic Parking extruder - magnetic_parking_extruder_tool_change(tmp_extruder); + magnetic_parking_extruder_tool_change(new_tool); #elif ENABLED(SWITCHING_TOOLHEAD) // Switching Toolhead - switching_toolhead_tool_change(tmp_extruder, no_move); + switching_toolhead_tool_change(new_tool, no_move); #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) // Magnetic Switching Toolhead - magnetic_switching_toolhead_tool_change(tmp_extruder, no_move); + magnetic_switching_toolhead_tool_change(new_tool, no_move); #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) // Magnetic Switching ToolChanger - electromagnetic_switching_toolhead(tmp_extruder, no_move); + em_switching_toolhead_tool_change(new_tool, no_move); #elif ENABLED(SWITCHING_NOZZLE) && !SWITCHING_NOZZLE_TWO_SERVOS // Switching Nozzle (single servo) // Raise by a configured distance to avoid workpiece, except with // SWITCHING_NOZZLE_TWO_SERVOS, as both nozzles will lift instead. - current_position[Z_AXIS] += _MAX(-zdiff, 0.0) + toolchange_settings.z_raise; + current_position.z += _MAX(-diff.z, 0.0) + toolchange_settings.z_raise; #if HAS_SOFTWARE_ENDSTOPS - NOMORE(current_position[Z_AXIS], soft_endstop[Z_AXIS].max); + NOMORE(current_position.z, soft_endstop.max.z); #endif if (!no_move) fast_line_to_current(Z_AXIS); - move_nozzle_servo(tmp_extruder); + move_nozzle_servo(new_tool); #endif - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Offset Tool XY by { ", xdiff, ", ", ydiff, ", ", zdiff, " }"); - - // The newly-selected extruder XY is actually at... - current_position[X_AXIS] += xdiff; - current_position[Y_AXIS] += ydiff; - current_position[Z_AXIS] += zdiff; + #if DISABLED(DUAL_X_CARRIAGE) + active_extruder = new_tool; // Set the new active extruder + #endif - // Set the new active extruder if not already done in tool specific function above - active_extruder = tmp_extruder; + // The newly-selected extruder XYZ is actually at... + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Offset Tool XY by { ", diff.x, ", ", diff.y, ", ", diff.z, " }"); + current_position += diff; // Tell the planner the new "current position" sync_plan_position(); #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; + const bool safe_to_move = current_position.z < delta_clip_start_height - 1; #else constexpr bool safe_to_move = true; #endif @@ -975,43 +960,42 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { #if ENABLED(SINGLENOZZLE) #if FAN_COUNT > 0 - singlenozzle_fan_speed[active_extruder] = thermalManager.fan_speed[0]; - thermalManager.fan_speed[0] = singlenozzle_fan_speed[tmp_extruder]; + singlenozzle_fan_speed[old_tool] = thermalManager.fan_speed[0]; + thermalManager.fan_speed[0] = singlenozzle_fan_speed[new_tool]; #endif - singlenozzle_temp[active_extruder] = thermalManager.temp_hotend[0].target; - if (singlenozzle_temp[tmp_extruder] && singlenozzle_temp[tmp_extruder] != singlenozzle_temp[active_extruder]) { - thermalManager.setTargetHotend(singlenozzle_temp[tmp_extruder], 0); - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + singlenozzle_temp[old_tool] = thermalManager.temp_hotend[0].target; + if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) { + thermalManager.setTargetHotend(singlenozzle_temp[new_tool], 0); + #if HAS_DISPLAY thermalManager.set_heating_message(0); #endif (void)thermalManager.wait_for_hotend(0, false); // Wait for heating or cooling } - active_extruder = tmp_extruder; #endif #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) if (should_swap && !too_cold) { #if ENABLED(ADVANCED_PAUSE_FEATURE) - do_pause_e_move(toolchange_settings.swap_length + TOOLCHANGE_FIL_EXTRA_PRIME, MMM_TO_MMS(toolchange_settings.prime_speed)); + do_pause_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed)); + do_pause_e_move(toolchange_settings.extra_prime, ADVANCED_PAUSE_PURGE_FEEDRATE); #else - current_position[E_AXIS] += (toolchange_settings.swap_length + TOOLCHANGE_FIL_EXTRA_PRIME) / planner.e_factor[tmp_extruder]; - planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.prime_speed), tmp_extruder); + current_position.e += toolchange_settings.swap_length / planner.e_factor[new_tool]; + planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.prime_speed), new_tool); + current_position.e += toolchange_settings.extra_prime / planner.e_factor[new_tool]; + planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.prime_speed * 0.2f), new_tool); #endif planner.synchronize(); - - #if TOOLCHANGE_FIL_EXTRA_PRIME - planner.set_e_position_mm((destination[E_AXIS] = current_position[E_AXIS] = current_position[E_AXIS] - (TOOLCHANGE_FIL_EXTRA_PRIME))); - #endif + planner.set_e_position_mm((destination.e = current_position.e = current_position.e - (TOOLCHANGE_FIL_EXTRA_PRIME))); } #endif // Prevent a move outside physical bounds #if ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) // If the original position is within tool store area, go to X origin at once - if (destination[Y_AXIS] < SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR) { - current_position[X_AXIS] = 0; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + if (destination.y < SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR) { + current_position.x = 0; + planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], new_tool); planner.synchronize(); } #else @@ -1023,7 +1007,7 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { #if ENABLED(TOOLCHANGE_NO_RETURN) // Just move back down if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move back Z only"); - do_blocking_move_to_z(destination[Z_AXIS], planner.settings.max_feedrate_mm_s[Z_AXIS]); + do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); #else // Move back to the original (or adjusted) position if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); @@ -1039,19 +1023,19 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { #if ENABLED(SWITCHING_NOZZLE) else { // Move back down. (Including when the new tool is higher.) - do_blocking_move_to_z(destination[Z_AXIS], planner.settings.max_feedrate_mm_s[Z_AXIS]); + do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); } #endif #if ENABLED(PRUSA_MMU2) - mmu2.tool_change(tmp_extruder); + mmu2.tool_change(new_tool); #endif #if SWITCHING_NOZZLE_TWO_SERVOS - lower_nozzle(active_extruder); + lower_nozzle(new_tool); #endif - } // (tmp_extruder != active_extruder) + } // (new_tool != old_tool) planner.synchronize(); @@ -1061,8 +1045,8 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { #endif #if ENABLED(MK2_MULTIPLEXER) - if (tmp_extruder >= E_STEPPERS) return invalid_extruder_error(tmp_extruder); - select_multiplexed_stepper(tmp_extruder); + if (new_tool >= E_STEPPERS) return invalid_extruder_error(new_tool); + select_multiplexed_stepper(new_tool); #endif #if DO_SWITCH_EXTRUDER @@ -1074,11 +1058,6 @@ void tool_change(const uint8_t tmp_extruder, bool no_move/*=false*/) { 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)); diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index 87be78b3a7b1..613cb1612cbf 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -22,16 +22,17 @@ #pragma once #include "../inc/MarlinConfigPre.h" +#include "../core/types.h" #if EXTRUDERS > 1 typedef struct { #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - float swap_length; + float swap_length, extra_prime; int16_t prime_speed, retract_speed; #endif #if ENABLED(TOOLCHANGE_PARK) - struct { float x, y; } change_point; + xy_pos_t change_point; #endif float z_raise; } toolchange_settings_t; @@ -71,12 +72,12 @@ #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) typedef struct MPESettings { - float parking_xpos[2], // M951 L R - grab_distance, // M951 I - slow_feedrate, // M951 J - fast_feedrate, // M951 H - travel_distance, // M951 D - compensation_factor; // M951 C + float parking_xpos[2], // M951 L R + grab_distance; // M951 I + feedRate_t slow_feedrate, // M951 J + fast_feedrate; // M951 H + float travel_distance, // M951 D + compensation_factor; // M951 C } mpe_settings_t; extern mpe_settings_t mpe_settings; diff --git a/Marlin/src/pins/pins_ESP32.h b/Marlin/src/pins/esp32/pins_ESP32.h similarity index 98% rename from Marlin/src/pins/pins_ESP32.h rename to Marlin/src/pins/esp32/pins_ESP32.h index 35e8e1ee0742..0831746f0d19 100644 --- a/Marlin/src/pins/pins_ESP32.h +++ b/Marlin/src/pins/esp32/pins_ESP32.h @@ -29,7 +29,7 @@ "Oops! Select an ESP32 board in 'Tools > Board.'" #endif -#define BOARD_NAME "Espressif ESP32" +#define BOARD_INFO_NAME "Espressif ESP32" // // I2S (steppers & other output-only pins) diff --git a/Marlin/src/pins/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h similarity index 83% rename from Marlin/src/pins/pins_RAMPS_LINUX.h rename to Marlin/src/pins/linux/pins_RAMPS_LINUX.h index 0176ead97e2b..48cdb1dd62b3 100644 --- a/Marlin/src/pins/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -45,10 +45,12 @@ * 7 | 11 */ -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.4" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "RAMPS 1.4" #endif +#define E2END 0xFFF // 4KB + #define IS_RAMPS_EFB // @@ -131,9 +133,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS_PIN 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_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // @@ -219,10 +221,10 @@ #endif #if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN) - #if NUM_SERVOS <= 1 // try to use servo connector first - #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM - #elif !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) // try to use AUX 2 - #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM + #if NUM_SERVOS <= 1 // Prefer the servo connector + #define CASE_LIGHT_PIN 6 // Hardware PWM + #elif HAS_FREE_AUX2_PINS // try to use AUX 2 + #define CASE_LIGHT_PIN 44 // Hardware PWM #endif #endif @@ -230,13 +232,13 @@ // M3/M4/M5 - Spindle/Laser Control // #if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) - #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first - #define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM + #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // Prefer the servo connector + #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM #define SPINDLE_DIR_PIN 5 - #elif !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) // try to use AUX 2 - #define SPINDLE_LASER_ENA_PIN 40 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM + #elif HAS_FREE_AUX2_PINS // try to use AUX 2 + #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM #define SPINDLE_DIR_PIN 65 #endif #endif @@ -269,7 +271,7 @@ #endif #endif -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) +#if HAS_TMC220x /** * TMC2208/TMC2209 stepper drivers * @@ -292,31 +294,75 @@ * Software serial */ - #define X_SERIAL_TX_PIN 40 - #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 Y2_SERIAL_TX_PIN -1 - #define Y2_SERIAL_RX_PIN -1 - - #define Z_SERIAL_TX_PIN 42 - #define Z_SERIAL_RX_PIN 65 - #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 E1_SERIAL_TX_PIN -1 - #define E1_SERIAL_RX_PIN -1 - #define E2_SERIAL_TX_PIN -1 - #define E2_SERIAL_RX_PIN -1 - #define E3_SERIAL_TX_PIN -1 - #define E3_SERIAL_RX_PIN -1 - #define E4_SERIAL_TX_PIN -1 - #define E4_SERIAL_RX_PIN -1 + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN 40 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN 63 + #endif + #ifndef X2_SERIAL_TX_PIN + #define X2_SERIAL_TX_PIN -1 + #endif + #ifndef X2_SERIAL_RX_PIN + #define X2_SERIAL_RX_PIN -1 + #endif + + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN 59 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN 64 + #endif + #ifndef Y2_SERIAL_TX_PIN + #define Y2_SERIAL_TX_PIN -1 + #endif + #ifndef Y2_SERIAL_RX_PIN + #define Y2_SERIAL_RX_PIN -1 + #endif + + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN 42 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN 65 + #endif + #ifndef Z2_SERIAL_TX_PIN + #define Z2_SERIAL_TX_PIN -1 + #endif + #ifndef Z2_SERIAL_RX_PIN + #define Z2_SERIAL_RX_PIN -1 + #endif + + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN 44 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN 66 + #endif + #ifndef E1_SERIAL_TX_PIN + #define E1_SERIAL_TX_PIN -1 + #endif + #ifndef E1_SERIAL_RX_PIN + #define E1_SERIAL_RX_PIN -1 + #endif + #ifndef E2_SERIAL_TX_PIN + #define E2_SERIAL_TX_PIN -1 + #endif + #ifndef E2_SERIAL_RX_PIN + #define E2_SERIAL_RX_PIN -1 + #endif + #ifndef E3_SERIAL_TX_PIN + #define E3_SERIAL_TX_PIN -1 + #endif + #ifndef E3_SERIAL_RX_PIN + #define E3_SERIAL_RX_PIN -1 + #endif + #ifndef E4_SERIAL_TX_PIN + #define E4_SERIAL_TX_PIN -1 + #endif + #ifndef E4_SERIAL_RX_PIN + #define E4_SERIAL_RX_PIN -1 + #endif #endif ////////////////////////// @@ -391,7 +437,7 @@ #endif #if DISABLED(NEWPANEL) - // Buttons are attached to a shift register + // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 //#define SHIFT_LD 42 @@ -540,7 +586,7 @@ // Beeper on AUX-4 #define BEEPER_PIN 33 - // Buttons are directly attached using AUX-2 + // Buttons are directly attached to AUX-2 #if ENABLED(REPRAPWORLD_KEYPAD) #define SHIFT_OUT 40 #define SHIFT_CLK 44 diff --git a/Marlin/src/pins/pins_AZSMZ_MINI.h b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h similarity index 95% rename from Marlin/src/pins/pins_AZSMZ_MINI.h rename to Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h index dddec6b0cd8d..65d3fe73ee81 100644 --- a/Marlin/src/pins/pins_AZSMZ_MINI.h +++ b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h @@ -25,11 +25,11 @@ * AZSMZ MINI pin assignments */ -#ifndef TARGET_LPC1768 +#ifndef MCU_LPC1768 #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#define BOARD_NAME "AZSMZ MINI" +#define BOARD_INFO_NAME "AZSMZ MINI" // // Servos @@ -71,9 +71,9 @@ // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 0 // A0 (TH1) -#define TEMP_BED_PIN 1 // A1 (TH2) -#define TEMP_1_PIN 2 // A2 (TH3) +#define TEMP_0_PIN P0_23_A0 // A0 (TH1) +#define TEMP_BED_PIN P0_24_A1 // A1 (TH2) +#define TEMP_1_PIN P0_25_A2 // A2 (TH3) // // Heaters / Fans diff --git a/Marlin/src/pins/pins_BIQU_B300_V1.0.h b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h similarity index 90% rename from Marlin/src/pins/pins_BIQU_B300_V1.0.h rename to Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h index a05ebd99f0ac..823bdba0d359 100644 --- a/Marlin/src/pins/pins_BIQU_B300_V1.0.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h @@ -30,12 +30,12 @@ * */ -#ifndef TARGET_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." +#ifndef MCU_LPC1768 + #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "BIQU Thunder B300 V1.0" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "BIQU Thunder B300 V1.0" #endif // @@ -83,17 +83,23 @@ // Software SPI pins for TMC2130 stepper drivers // #if ENABLED(TMC_USE_SW_SPI) - #define TMC_SW_MOSI P0_18 // ETH - #define TMC_SW_MISO P0_17 // ETH - #define TMC_SW_SCK P0_15 // ETH + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI P0_18 // ETH + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO P0_17 // ETH + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK P0_15 // ETH + #endif #endif // // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 1 // A0 (T0) -#define TEMP_BED_PIN 0 // A1 (T1) +#define TEMP_0_PIN P0_24_A1 // A0 (T0) +#define TEMP_BED_PIN P0_23_A0 // A1 (T1) // // Heaters / Fans diff --git a/Marlin/src/pins/pins_BIQU_BQ111_A4.h b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h similarity index 96% rename from Marlin/src/pins/pins_BIQU_BQ111_A4.h rename to Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h index 8095d86ab36c..a20659f0f5e2 100644 --- a/Marlin/src/pins/pins_BIQU_BQ111_A4.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h @@ -30,11 +30,11 @@ * */ -#ifndef TARGET_LPC1768 +#ifndef MCU_LPC1768 #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#define BOARD_NAME "BIQU BQ111-A4" +#define BOARD_INFO_NAME "BIQU BQ111-A4" // // Limit Switches @@ -71,8 +71,8 @@ // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 0 // A0 (T0) -#define TEMP_BED_PIN 1 // A1 (T1) +#define TEMP_0_PIN P0_23_A0 // A0 (T0) +#define TEMP_BED_PIN P0_24_A1 // A1 (T1) // diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR.h new file mode 100644 index 000000000000..ba6bfbca5764 --- /dev/null +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR.h @@ -0,0 +1,94 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#ifndef MCU_LPC1768 + #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." +#endif + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// +// Steppers +// + +#define E1_STEP_PIN P0_01 +#define E1_DIR_PIN P0_00 +#define E1_ENABLE_PIN P0_10 + +// +// Temperature Sensors +// 3.3V max when defined as an analog input +// +#define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN +#define TEMP_0_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_0_PIN +#define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN + +// +// Heaters / Fans +// +#ifndef HEATER_0_PIN + #define HEATER_0_PIN P2_07 +#endif +#if HOTENDS == 1 + #ifndef FAN1_PIN + #define FAN1_PIN P2_04 + #endif +#else + #ifndef HEATER_1_PIN + #define HEATER_1_PIN P2_04 + #endif +#endif +#ifndef FAN_PIN + #define FAN_PIN P2_03 +#endif +#ifndef HEATER_BED_PIN + #define HEATER_BED_PIN P2_05 +#endif + +// +// LCD / Controller +// +#if HAS_SPI_LCD + #define BEEPER_PIN P1_30 // (37) not 5V tolerant +#endif + +// +// SD Support +// +#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card + +#if SD_CONNECTION_IS(LCD) + #define SCK_PIN P0_15 + #define MISO_PIN P0_17 + #define MOSI_PIN P0_18 +#elif SD_CONNECTION_IS(ONBOARD) + #undef SD_DETECT_PIN + #define SD_DETECT_PIN P0_27 + #define SCK_PIN P0_07 + #define MISO_PIN P0_08 + #define MOSI_PIN P0_09 + #define SS_PIN ONBOARD_SD_CS_PIN +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "No custom SD drive cable defined for this board." +#endif diff --git a/Marlin/src/pins/pins_BIQU_SKR_V1.1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h similarity index 86% rename from Marlin/src/pins/pins_BIQU_SKR_V1.1.h rename to Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index 4dbd0e6c12a6..afcae1cad1a4 100644 --- a/Marlin/src/pins/pins_BIQU_SKR_V1.1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -21,17 +21,12 @@ */ #pragma once -#ifndef TARGET_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." -#endif - -#ifndef BOARD_NAME - #define BOARD_NAME "BIQU SKR V1.1" -#endif +#define BOARD_INFO_NAME "BIGTREE SKR 1.1" // // Limit Switches // + #define X_MIN_PIN P1_29 #define X_MAX_PIN P1_28 #define Y_MIN_PIN P1_27 @@ -58,30 +53,6 @@ #define E0_DIR_PIN P2_13 #define E0_ENABLE_PIN P2_12 -#define E1_STEP_PIN P0_01 -#define E1_DIR_PIN P0_00 -#define E1_ENABLE_PIN P0_10 - -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_BED_PIN 0 // Analog Input -#define TEMP_0_PIN 1 // Analog Input -#define TEMP_1_PIN 2 // Analog Input - -// -// Heaters / Fans -// -#define HEATER_0_PIN P2_07 -#if HOTENDS == 1 - #define FAN1_PIN P2_04 -#else - #define HEATER_1_PIN P2_04 -#endif -#define FAN_PIN P2_03 -#define HEATER_BED_PIN P2_05 - /** * LCD / Controller * @@ -96,7 +67,6 @@ */ #if HAS_SPI_LCD - #define BEEPER_PIN P1_30 #define BTN_EN1 P3_26 #define BTN_EN2 P3_25 #define BTN_ENC P2_11 @@ -127,22 +97,8 @@ #endif #endif -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - #if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 #define SS_PIN P1_23 -#elif SD_CONNECTION_IS(ONBOARD) - #undef SD_DETECT_PIN - #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#elif SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." #endif // Trinamic driver support @@ -272,3 +228,6 @@ #endif // SOFTWARE_DRIVER_ENABLE #endif + +// Include common SKR pins +#include "pins_BTT_SKR.h" diff --git a/Marlin/src/pins/pins_BIGTREE_SKR_V1.3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h similarity index 56% rename from Marlin/src/pins/pins_BIGTREE_SKR_V1.3.h rename to Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 4f491623094a..1971bb901b6e 100644 --- a/Marlin/src/pins/pins_BIGTREE_SKR_V1.3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -21,31 +21,46 @@ */ #pragma once -#ifndef TARGET_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." +#define BOARD_INFO_NAME "BIGTREE SKR 1.3" + +/** + * Limit Switches + * + * For Stallguard homing to max swap the min / max pins so + * the MAX physical connectors can be used for other things. + */ +#if X_HOME_DIR == -1 || !X_STALL_SENSITIVITY + #define X_MIN_PIN P1_29 // X_MIN + #define X_MAX_PIN P1_28 // X_MAX +#else + #define X_MIN_PIN P1_28 // X_MAX + #define X_MAX_PIN P1_29 // X_MIN +#endif + +#if Y_HOME_DIR == -1 || !Y_STALL_SENSITIVITY + #define Y_MIN_PIN P1_27 // Y_MIN + #define Y_MAX_PIN P1_26 // Y_MAX +#else + #define Y_MIN_PIN P1_26 // Y_MAX + #define Y_MAX_PIN P1_27 // Y_MIN #endif -#ifndef BOARD_NAME - #define BOARD_NAME "BIGTREE SKR V1.3" +#if Z_HOME_DIR == -1 || !Z_STALL_SENSITIVITY + #define Z_MIN_PIN P1_25 // Z_MIN + #define Z_MAX_PIN P1_24 // Z_MAX +#else + #define Z_MIN_PIN P1_24 // Z_MAX + #define Z_MAX_PIN P1_25 // Z_MIN #endif -// Ignore temp readings during develpment. -//#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +#define ONBOARD_ENDSTOPPULLUPS // Board has built-in pullups // // Servos // -#define SERVO0_PIN P2_00 - -// -// Limit Switches -// -#define X_MIN_PIN P1_29 -#define X_MAX_PIN P1_28 -#define Y_MIN_PIN P1_27 -#define Y_MAX_PIN P1_26 -#define Z_MIN_PIN P1_25 -#define Z_MAX_PIN P1_24 +#ifndef SERVO0_PIN + #define SERVO0_PIN P2_00 +#endif // // Z Probe (when not Z_MIN_PIN) @@ -92,9 +107,6 @@ #define E0_CS_PIN P1_08 #endif -#define E1_STEP_PIN P0_01 -#define E1_DIR_PIN P0_00 -#define E1_ENABLE_PIN P0_10 #ifndef E1_CS_PIN #define E1_CS_PIN P1_01 #endif @@ -103,13 +115,19 @@ // Software SPI pins for TMC2130 stepper drivers // #if ENABLED(TMC_USE_SW_SPI) - #define TMC_SW_MOSI P4_28 - #define TMC_SW_MISO P0_05 - #define TMC_SW_SCK P0_04 + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI P4_28 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO P0_05 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK P0_04 + #endif #endif -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) - /** +#if HAS_TMC220x + /** * TMC2208/TMC2209 stepper drivers * * Hardware serial communication ports. @@ -148,47 +166,63 @@ #define Z2_SERIAL_TX_PIN P1_04 #define Z2_SERIAL_RX_PIN P1_01 + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 #endif -// -// Temperature Sensors -// 3.3V max when defined as an analog input -// -#define TEMP_BED_PIN 0 // A0 (T0) - (67) - TEMP_BED_PIN -#define TEMP_0_PIN 1 // A1 (T1) - (68) - TEMP_0_PIN -#define TEMP_1_PIN 2 // A2 (T2) - (69) - TEMP_1_PIN - -// -// Heaters / Fans -// -#define HEATER_0_PIN P2_07 -#if HOTENDS == 1 - #define FAN1_PIN P2_04 -#else - #define HEATER_1_PIN P2_04 -#endif -#define FAN_PIN P2_03 -#define HEATER_BED_PIN P2_05 - /** - * _____ _____ - * NC | · · | GND 5V | · · | GND - * RESET | · · | 1.31(SD_DETECT) (LCD_D7) 1.23 | · · | 1.22 (LCD_D6) - * (MOSI)0.18 | · · | 3.25(BTN_EN2) (LCD_D5) 1.21 | · · | 1.20 (LCD_D4) - * (SD_SS)0.16 | · · | 3.26(BTN_EN1) (LCD_RS) 1.19 | · · | 1.18 (LCD_EN) - * (SCK)0.15 | · · | 0.17(MISO) (BTN_ENC) 0.28 | · · | 1.30 (BEEPER) - * ----- ----- - * EXP2 EXP1 + * _____ _____ + * NC | · · | GND 5V | · · | GND + * RESET | · · | 1.31 (SD_DETECT) (LCD_D7) 1.23 | · · | 1.22 (LCD_D6) + * (MOSI) 0.18 | · · | 3.25 (BTN_EN2) (LCD_D5) 1.21 | · · | 1.20 (LCD_D4) + * (SD_SS) 0.16 | · · | 3.26 (BTN_EN1) (LCD_RS) 1.19 | · · | 1.18 (LCD_EN) + * (SCK) 0.15 | · · | 0.17 (MISO) (BTN_ENC) 0.28 | · · | 1.30 (BEEPER) + * ----- ----- + * EXP2 EXP1 */ #if HAS_SPI_LCD - #define BEEPER_PIN P1_30 // (37) not 5V tolerant - #define BTN_ENC P0_28 // (58) open-drain - #if ENABLED(CR10_STOCKDISPLAY) + #if ENABLED(ANET_FULL_GRAPHICS_LCD) + + #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. Comment out this line to continue." + + /** + * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. + * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) + * 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because this pin is open drain.) + * 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board. + * + * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!! + * + * The ANET_FULL_GRAPHICS_LCD connector plug: + * + * BEFORE AFTER + * _____ _____ + * GND 1 | · · | 2 5V 5V 1 | · · | 2 GND + * CS 3 | · · | 4 BTN_EN2 CS 3 | · · | 4 BTN_EN2 + * SID 5 | · · | 6 BTN_EN1 SID 5 | · · | 6 BTN_EN1 + * open 7 | · · | 8 BTN_ENC CLK 7 | · · | 8 BTN_ENC + * CLK 9 | · · | 10 Beeper open 9 | · · | 10 Beeper + * ----- ----- + * LCD LCD + */ + + #define LCD_PINS_RS P1_23 + + #define BTN_EN1 P1_20 + #define BTN_EN2 P1_22 + #define BTN_ENC P1_18 + + #define LCD_PINS_ENABLE P1_21 + #define LCD_PINS_D4 P1_19 + + #elif ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS P1_22 #define BTN_EN1 P1_18 #define BTN_EN2 P1_20 + #define BTN_ENC P0_28 // (58) open-drain #define LCD_PINS_ENABLE P1_23 #define LCD_PINS_D4 P1_21 @@ -202,6 +236,7 @@ #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 + #define BTN_ENC P0_28 // (58) open-drain #define LCD_PINS_ENABLE P1_18 #define LCD_PINS_D4 P1_20 @@ -214,7 +249,6 @@ #define DOGLCD_A0 P1_19 #define DOGLCD_SCK P0_15 #define DOGLCD_MOSI P0_18 - #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 @@ -240,8 +274,11 @@ #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS P1_21 - #define DOGLCD_A0 P1_22 + #define DOGLCD_CS P1_21 + #define DOGLCD_A0 P1_22 + #define DOGLCD_SCK P0_15 + #define DOGLCD_MOSI P0_18 + #define FORCE_SOFT_SPI #endif #if ENABLED(ULTIPANEL) @@ -252,7 +289,7 @@ #endif // !FYSETC_MINI_12864 - #endif + #endif // !CR10_STOCKDISPLAY #endif // HAS_SPI_LCD @@ -264,22 +301,8 @@ #define SDCARD_CONNECTION LCD #endif -#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card - #if SD_CONNECTION_IS(LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 #define SS_PIN P0_16 -#elif SD_CONNECTION_IS(ONBOARD) - #undef SD_DETECT_PIN - #define SD_DETECT_PIN P0_27 - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN ONBOARD_SD_CS_PIN -#elif SD_CONNECTION_IS(CUSTOM_CABLE) - #error "No custom SD drive cable defined for this board." #endif /** @@ -289,3 +312,6 @@ * P0_27 (57) (Open collector) * P0_28 (58) (Open collector) */ + +// Include common SKR pins +#include "pins_BTT_SKR.h" diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h new file mode 100644 index 000000000000..6e45a49a9eef --- /dev/null +++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h @@ -0,0 +1,163 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#ifndef MCU_LPC1768 + #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." +#endif + +#define BOARD_INFO_NAME "GMARSH X6 REV1" + +// Ignore temp readings during develpment. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// +// Enable 12MHz clock output on P1.27 pin to sync TMC2208 chip clocks +// +#define LPC1768_ENABLE_CLKOUT_12M + +// +// Servos +// +#define SERVO0_PIN P1_26 // PWM1[6] +#define SERVO1_PIN P1_18 // PWM1[1] + +// +// Limit Switches +// +#define X_MIN_PIN P0_00 +#define X_MAX_PIN P0_01 +#define Y_MIN_PIN P0_10 +#define Y_MAX_PIN P0_21 +#define Z_MIN_PIN P2_13 +#define Z_MAX_PIN P2_22 + +// +// Steppers +// + +#define X_STEP_PIN P1_01 +#define X_DIR_PIN P1_04 +#define X_ENABLE_PIN P0_26 + +#define Y_STEP_PIN P1_10 +#define Y_DIR_PIN P1_14 +#define Y_ENABLE_PIN P1_08 + +#define Z_STEP_PIN P1_17 +#define Z_DIR_PIN P4_29 +#define Z_ENABLE_PIN P1_15 + +#define E0_STEP_PIN P0_05 +#define E0_DIR_PIN P2_00 +#define E0_ENABLE_PIN P4_28 + +#define E1_STEP_PIN P2_03 +#define E1_DIR_PIN P2_04 +#define E1_ENABLE_PIN P2_01 + +#define E2_STEP_PIN P2_07 +#define E2_DIR_PIN P2_08 +#define E2_ENABLE_PIN P2_05 + +// +// TMC2208 UART pins +// +#if HAS_DRIVER(TMC2208) + #define X_SERIAL_TX_PIN P1_00 + #define X_SERIAL_RX_PIN P1_00 + #define Y_SERIAL_TX_PIN P1_09 + #define Y_SERIAL_RX_PIN P1_09 + #define Z_SERIAL_TX_PIN P1_16 + #define Z_SERIAL_RX_PIN P1_16 + #define E0_SERIAL_TX_PIN P0_04 + #define E0_SERIAL_RX_PIN P0_04 + #define E1_SERIAL_TX_PIN P2_02 + #define E1_SERIAL_RX_PIN P2_02 + #define E2_SERIAL_TX_PIN P2_06 + #define E2_SERIAL_RX_PIN P2_06 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#else + #error "TMC2208 UART configuration is required for GMarsh X6." +#endif + +// +// Temperature Sensors +// 3.3V max when defined as an analog input +// +#define TEMP_0_PIN P0_24_A1 // AD0[0] on P0_23 +#define TEMP_BED_PIN P0_23_A0 // AD0[1] on P0_24 + +// +// Heaters / Fans +// +#define HEATER_BED_PIN P1_19 // Not a PWM pin, software PWM required +#define HEATER_0_PIN P3_26 // PWM1[3] +#define FAN_PIN P3_25 // Part cooling fan - connected to PWM1[2] +#define E0_AUTO_FAN_PIN P0_27 // Extruder cooling fan + +// +// Misc. Functions +// +#define LED_PIN P1_31 + +// +// LCD +// +#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + #define BEEPER_PIN P0_19 + #define BTN_EN1 P1_23 + #define BTN_EN2 P1_24 + #define BTN_ENC P1_25 + #define LCD_PINS_RS P0_20 + #define LCD_PINS_ENABLE P0_21 + #define LCD_PINS_D4 P2_11 + #define LCD_PINS_D5 P0_22 + #define LCD_PINS_D6 P1_29 + #define LCD_PINS_D7 P1_28 +#endif + +// +// SD Support +// + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION LCD +#endif + +#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card + +#if SD_CONNECTION_IS(LCD) + #define SCK_PIN P0_15 + #define MISO_PIN P0_17 + #define MOSI_PIN P0_18 + #define SS_PIN P0_16 +#elif SD_CONNECTION_IS(ONBOARD) + #undef SD_DETECT_PIN + #define SD_DETECT_PIN P0_27 + #define SCK_PIN P0_07 + #define MISO_PIN P0_08 + #define MOSI_PIN P0_09 + #define SS_PIN ONBOARD_SD_CS_PIN +#endif diff --git a/Marlin/src/pins/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h similarity index 87% rename from Marlin/src/pins/pins_MKS_SBASE.h rename to Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 2d37f7274e4f..fd87dbe1e2ca 100644 --- a/Marlin/src/pins/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -25,15 +25,15 @@ * MKS SBASE pin assignments */ -#ifndef TARGET_LPC1768 +#ifndef MCU_LPC1768 #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "MKS SBASE" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS SBASE" #endif #ifndef BOARD_WEBSITE_URL - #define BOARD_WEBSITE_URL "https://github.com/makerbase-mks/MKS-SBASE" + #define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SBASE" #endif #define LED_PIN P1_18 // Used as a status indicator @@ -42,7 +42,7 @@ #define LED4_PIN P1_21 // -// Servo pin +// Servos // #define SERVO0_PIN P1_23 // J8-3 (low jitter) #define SERVO1_PIN P2_12 // J8-4 @@ -90,10 +90,10 @@ // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_BED_PIN 0 // A0 (TH1) -#define TEMP_0_PIN 1 // A1 (TH2) -#define TEMP_1_PIN 2 // A2 (TH3) -#define TEMP_2_PIN 3 // A3 (TH4) +#define TEMP_BED_PIN P0_23_A0 // A0 (TH1) +#define TEMP_0_PIN P0_24_A1 // A1 (TH2) +#define TEMP_1_PIN P0_25_A2 // A2 (TH3) +#define TEMP_2_PIN P0_26_A3 // A3 (TH4) // // Heaters / Fans @@ -231,36 +231,36 @@ #if ENABLED(FYSETC_MINI_12864) /** - * The Fysetc display can NOT use the SCK and MOSI pins on EXP2, so a + * The FYSETC display can NOT use the SCK and MOSI pins on EXP2, so a * special cable is needed to go between EXP2 on the FYSETC and the * controller board's EXP2 and J8. It also means that a software SPI * is needed to drive those pins. * - * The Fysetc requires mode 3 SPI interface. + * The FYSETC requires mode 3 SPI interface. * * Pins 6, 7 & 8 on EXP2 are no connects. That means a second special * cable will be needed if the RGB LEDs are to be active. */ - #define DOGLCD_CS LCD_PINS_ENABLE // EXP1.3 (LCD_EN on Fysetc schematic) - #define DOGLCD_A0 LCD_PINS_RS // EXP1.4 (LCD_A0 on Fysetc schematic) - #define DOGLCD_SCK P2_11 // J8-5 (SCK on Fysetc schematic) - #define DOGLCD_MOSI P4_28 // J8-6 (MOSI on Fysetc schematic) + #define DOGLCD_CS LCD_PINS_ENABLE // EXP1.3 (LCD_EN on FYSETC schematic) + #define DOGLCD_A0 LCD_PINS_RS // EXP1.4 (LCD_A0 on FYSETC schematic) + #define DOGLCD_SCK P2_11 // J8-5 (SCK on FYSETC schematic) + #define DOGLCD_MOSI P4_28 // J8-6 (MOSI on FYSETC schematic) //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P2_12 // J8-4 (LCD_D6 on Fysetc schematic) + #define RGB_LED_R_PIN P2_12 // J8-4 (LCD_D6 on FYSETC schematic) #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_23 // J8-3 (LCD_D5 on Fysetc schematic) + #define RGB_LED_G_PIN P1_23 // J8-3 (LCD_D5 on FYSETC schematic) #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_22 // J8-2 (LCD_D7 on Fysetc schematic) + #define RGB_LED_B_PIN P1_22 // J8-2 (LCD_D7 on FYSETC schematic) #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P2_12 + #define NEOPIXEL_PIN P2_12 #endif #elif ENABLED(MINIPANEL) @@ -303,10 +303,15 @@ #endif #endif -#if MB(MKS_SBASE) && (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)) - // The shortage of pins becomes apparent. - // Worst case you may have to give up the LCD - // RX pins need to be interrupt capable +#if MB(MKS_SBASE) && HAS_TMC220x + + /** + * TMC2208/TMC2209 stepper drivers + * + * The shortage of pins becomes apparent. + * Worst case you may have to give up the LCD + * RX pins need to be interrupt capable + */ #define X_SERIAL_TX_PIN P1_22 // J8-2 #define X_SERIAL_RX_PIN P2_12 // J8-4 Interrupt Capable #define Y_SERIAL_TX_PIN P1_23 // J8-3 @@ -315,6 +320,9 @@ #define Z_SERIAL_RX_PIN P0_25 // TH3 #define E0_SERIAL_TX_PIN P4_28 // J8-6 #define E0_SERIAL_RX_PIN P0_26 // TH4 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 #endif // UNUSED @@ -344,26 +352,26 @@ * PWM1.6 P2_05 RAMPS_D10_PIN */ - /** - * Special pins - * P1_30 - not 5V tolerant - EXP1 - * P1_31 - not 5V tolerant - EXP1 - * P0_27 - open collector - EXP2 - * P0_28 - open collector - EXP2 - * - */ - - /** - * Serial Ports - * P0_00 - Port 3 - * P0_01 - SD Card (Onboard) - * P0_10 - Port 2 - * P0_11 - Y_EN/Y_DIR - * P0_15 - Port 1 - * P0_16 - EXP1 - * P0_02 - Port 0 - * P0_03 - AUX1 - * P0_29 - Port -1 - * P0_30 - USB - * - */ +/** + * Special pins + * P1_30 - not 5V tolerant - EXP1 + * P1_31 - not 5V tolerant - EXP1 + * P0_27 - open collector - EXP2 + * P0_28 - open collector - EXP2 + * + */ + +/** + * Serial Ports + * P0_00 - Port 3 + * P0_01 - SD Card (Onboard) + * P0_10 - Port 2 + * P0_11 - Y_EN/Y_DIR + * P0_15 - Port 1 + * P0_16 - EXP1 + * P0_02 - Port 0 + * P0_03 - AUX1 + * P0_29 - Port -1 + * P0_30 - USB + * + */ diff --git a/Marlin/src/pins/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h similarity index 70% rename from Marlin/src/pins/pins_MKS_SGEN_L.h rename to Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index d0ff839a07b4..8d4adca34bdb 100644 --- a/Marlin/src/pins/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -25,15 +25,15 @@ * MKS SGEN-L pin assignments */ -#ifndef TARGET_LPC1768 +#ifndef MCU_LPC1768 #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#define BOARD_NAME "MKS SGEN-L" -#define BOARD_WEBSITE_URL "https://github.com/makerbase-mks/MKS-SGEN_L" +#define BOARD_INFO_NAME "MKS SGen-L" +#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN_L" // -// Servo pin +// Servos // #define SERVO0_PIN P1_23 // SERVO P1.23 #define SERVO1_PIN P2_00 // SERVO P2.0 @@ -97,14 +97,20 @@ // Software SPI pins for TMC2130 stepper drivers // #if ENABLED(TMC_USE_SW_SPI) - #define TMC_SW_MOSI P4_28 - #define TMC_SW_MISO P0_05 - #define TMC_SW_SCK P0_04 + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI P4_28 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO P0_05 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK P0_04 + #endif #endif -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) +#if HAS_TMC220x /** - * TMC2208 stepper drivers + * TMC2208/TMC2209 stepper drivers * * Hardware serial communication ports. * If undefined software serial is used according to the pins below @@ -143,15 +149,17 @@ #define Z2_SERIAL_TX_PIN P4_29 #define Z2_SERIAL_RX_PIN P1_17 + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 #endif // TMC2208 || TMC2209 // // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 0 // Analog Input A0 (TH1) -#define TEMP_BED_PIN 1 // Analog Input A1 (TB) -#define TEMP_1_PIN 2 // Analog Input A2 (TH2) +#define TEMP_0_PIN P0_23_A0 // Analog Input A0 (TH1) +#define TEMP_BED_PIN P0_24_A1 // Analog Input A1 (TB) +#define TEMP_1_PIN P0_25_A2 // Analog Input A2 (TH2) // // Heaters / Fans @@ -186,7 +194,7 @@ #define BTN_ENC P1_30 #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS P1_0 + #define LCD_PINS_RS P1_00 #define BTN_EN1 P0_18 #define BTN_EN2 P0_15 @@ -195,61 +203,78 @@ #define LCD_PINS_D4 P0_17 #else - #define LCD_PINS_RS P0_16 #define BTN_EN1 P3_25 #define BTN_EN2 P3_26 - #define LCD_PINS_ENABLE P0_18 - #define LCD_PINS_D4 P0_15 - #define LCD_SDSS P0_28 #define SD_DETECT_PIN P0_27 - #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS P0_18 - #define DOGLCD_A0 P0_16 - #define DOGLCD_SCK P0_7 - #define DOGLCD_MOSI P1_20 - #define FORCE_SOFT_SPI + #if ENABLED(MKS_12864OLED_SSD1306) - #define LCD_BACKLIGHT_PIN -1 + #define LCD_PINS_DC P0_17 + #define DOGLCD_CS P0_16 + #define DOGLCD_A0 LCD_PINS_DC + #define DOGLCD_SCK P0_15 + #define DOGLCD_MOSI P0_18 - #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems - // results in LCD soft SPI mode 3, SD soft SPI mode 0 + #define LCD_PINS_RS P1_00 + #define LCD_PINS_D7 P1_22 + #define KILL_PIN -1 // NC - #define LCD_RESET_PIN P0_15 // Must be high or open for LCD to operate normally. + #else // !MKS_12864OLED_SSD1306 - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P0_17 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_0 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_22 + #define LCD_PINS_RS P0_16 + + #define LCD_PINS_ENABLE P0_18 + #define LCD_PINS_D4 P0_15 + + #if ENABLED(FYSETC_MINI_12864) + + #define DOGLCD_CS P0_18 + #define DOGLCD_A0 P0_16 + #define DOGLCD_SCK P0_07 + #define DOGLCD_MOSI P1_20 + + #define LCD_BACKLIGHT_PIN -1 + + #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems + // results in LCD soft SPI mode 3, SD soft SPI mode 0 + + #define LCD_RESET_PIN P0_15 // Must be high or open for LCD to operate normally. + + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN P0_17 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN P1_00 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN P1_22 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN P0_17 #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P0_17 - #endif - #else // !FYSETC_MINI_12864 + #else // !FYSETC_MINI_12864 - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS P0_17 - #define DOGLCD_A0 P1_0 - #endif + #if ENABLED(MKS_MINI_12864) + #define DOGLCD_CS P0_17 + #define DOGLCD_A0 P1_00 + #endif + + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 P0_17 + #define LCD_PINS_D6 P1_00 + #define LCD_PINS_D7 P1_22 + #endif - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 P0_17 - #define LCD_PINS_D6 P1_0 - #define LCD_PINS_D7 P1_22 - #endif + #endif // !FYSETC_MINI_12864 - #endif // !FYSETC_MINI_12864 + #endif // !MKS_12864OLED_SSD1306 - #endif + #endif // !CR10_STOCKDISPLAY #endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h similarity index 83% rename from Marlin/src/pins/pins_RAMPS_RE_ARM.h rename to Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index 4181e3b64e8d..af08e0a5882e 100644 --- a/Marlin/src/pins/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -36,11 +36,11 @@ // Numbers in parentheses () are the corresponding mega2560 pin numbers -#ifndef TARGET_LPC1768 +#ifndef MCU_LPC1768 #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#define BOARD_NAME "Re-ARM RAMPS 1.4" +#define BOARD_INFO_NAME "Re-ARM RAMPS 1.4" // // Servos @@ -59,6 +59,7 @@ #define Y_MAX_PIN P1_27 // (15) 10k pullup to 3.3V, 1K series #define Z_MIN_PIN P1_29 // (18) 10k pullup to 3.3V, 1K series #define Z_MAX_PIN P1_28 // (19) 10k pullup to 3.3V, 1K series +#define ONBOARD_ENDSTOPPULLUPS // Board has built-in pullups // // Steppers @@ -102,12 +103,18 @@ // Software SPI pins for TMC2130 stepper drivers // #if ENABLED(TMC_USE_SW_SPI) - #define TMC_SW_MOSI P1_00 // ETH - #define TMC_SW_MISO P1_08 // ETH - #define TMC_SW_SCK P1_09 // ETH + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI P1_00 // ETH + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO P1_08 // ETH + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK P1_09 // ETH + #endif #endif -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) +#if HAS_TMC220x /** * TMC2208/TMC2209 stepper drivers * @@ -115,39 +122,57 @@ * If undefined software serial is used according to the pins below */ - /** - * Software serial - */ + // + // Software serial + // - // P2_08 E1-Step - // P2_13 E1-Dir + // P2_08 E1-Step + // P2_13 E1-Dir - #define X_SERIAL_TX_PIN P2_13 - #define X_SERIAL_RX_PIN P2_13 + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN P0_01 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN P0_01 + #endif - #define Y_SERIAL_TX_PIN P0_00 - #define Y_SERIAL_RX_PIN P0_00 + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN P0_00 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN P0_00 + #endif - #define Z_SERIAL_TX_PIN P0_01 - #define Z_SERIAL_RX_PIN P0_01 + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN P2_13 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN P2_13 + #endif - #define E0_SERIAL_TX_PIN P2_08 - #define E0_SERIAL_RX_PIN P2_08 + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN P2_08 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN P2_08 + #endif + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 #endif // // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 0 // A0 (T0) - (67) - TEMP_0_PIN -#define TEMP_BED_PIN 1 // A1 (T1) - (68) - TEMP_BED_PIN -#define TEMP_1_PIN 2 // A2 (T2) - (69) - TEMP_1_PIN -#define TEMP_2_PIN 3 // A3 - (63) - J5-3 & AUX-2 -#define TEMP_3_PIN 4 // A4 - (37) - BUZZER_PIN -//#define TEMP_4_PIN 5 // A5 - (49) - SD_DETECT_PIN -//#define ?? 6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1 -#define FILWIDTH_PIN 7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1 +#define TEMP_0_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_0_PIN +#define TEMP_BED_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_BED_PIN +#define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN +#define TEMP_2_PIN P0_26_A3 // A3 - (63) - J5-3 & AUX-2 +#define TEMP_3_PIN P1_30_A4 // A4 - (37) - BUZZER_PIN +//#define TEMP_4_PIN P1_31_A5 // A5 - (49) - SD_DETECT_PIN +//#define ?? P0_03_A6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1 +#define FILWIDTH_PIN P0_02_A7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1 // // Augmentation for auto-assigning RAMPS plugs @@ -219,9 +244,9 @@ // #define LED_PIN P4_28 // (13) -// define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector +// define digital pin 5 for the filament runout sensor. Use the RAMPS 1.4 digital input 5 on the servos connector #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN P1_18 // (4) + #define FIL_RUNOUT_PIN P1_19 // (5) #endif #define PS_ON_PIN P2_12 // (12) @@ -248,9 +273,9 @@ #error "LASER_FEATURE requires 3 free servo pins." #endif #endif - #define SPINDLE_LASER_ENA_PIN SERVO1_PIN // (6) Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN SERVO3_PIN // (4) MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN SERVO2_PIN // (5) + #define SPINDLE_LASER_ENA_PIN SERVO1_PIN // (6) Pin should have a pullup/pulldown! + #define SPINDLE_LASER_PWM_PIN SERVO3_PIN // (4) MUST BE HARDWARE PWM + #define SPINDLE_DIR_PIN SERVO2_PIN // (5) #endif // @@ -303,10 +328,10 @@ #elif HAS_SPI_LCD - //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 - //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 - //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 - //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) + //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 + //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 + //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 + //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) #if ENABLED(FYSETC_MINI_12864) #define BEEPER_PIN P1_01 @@ -331,10 +356,10 @@ #define SHIFT_LD P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) #endif #else - //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 - //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 - //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 - //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4 + //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 + //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 + //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 + //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4 #endif #if ANY(VIKI2, miniVIKI) @@ -359,7 +384,7 @@ //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN P0_16 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN P0_16 // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN @@ -372,7 +397,7 @@ #define RGB_LED_B_PIN P1_08 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P1_00 + #define NEOPIXEL_PIN P1_00 #endif #else #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 diff --git a/Marlin/src/pins/pins_SELENA_COMPACT.h b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h similarity index 90% rename from Marlin/src/pins/pins_SELENA_COMPACT.h rename to Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h index 3baa441d9c43..4bc3c86882d9 100644 --- a/Marlin/src/pins/pins_SELENA_COMPACT.h +++ b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h @@ -25,17 +25,21 @@ * Selena Compact pin assignments */ -#ifndef TARGET_LPC1768 +#ifndef MCU_LPC1768 #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#define BOARD_NAME "Selena Compact" -#define BOARD_WEBSITE_URL "https://github.com/Ales2-k/Selena" +#define BOARD_INFO_NAME "Selena Compact" +#define BOARD_WEBSITE_URL "github.com/Ales2-k/Selena" // -// Limit Switches +// Servos // +#define SERVO0_PIN P1_23 +// +// Limit Switches +// #define X_MIN_PIN P1_28 #define X_MAX_PIN P1_25 #define Y_MIN_PIN P2_11 @@ -71,9 +75,9 @@ // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_BED_PIN 0 // A0 (TH1) -#define TEMP_0_PIN 1 // A1 (TH2) -#define TEMP_1_PIN 2 // A2 (TH3) +#define TEMP_BED_PIN P0_23_A0 // A0 (TH1) +#define TEMP_0_PIN P0_24_A1 // A1 (TH2) +#define TEMP_1_PIN P0_25_A2 // A2 (TH3) // @@ -108,8 +112,3 @@ #define SD_DETECT_PIN -1 #endif // REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER - -// -// Servo -// -#define SERVO0_PIN P1_23 diff --git a/Marlin/src/pins/pins_AZTEEG_X5_GT.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h old mode 100755 new mode 100644 similarity index 88% rename from Marlin/src/pins/pins_AZTEEG_X5_GT.h rename to Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h index 11dd45a6a579..0ae4393caca9 --- a/Marlin/src/pins/pins_AZTEEG_X5_GT.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h @@ -25,23 +25,21 @@ * Azteeg X5 GT pin assignments */ -#ifndef LPC1769 +#ifndef MCU_LPC1769 #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#define BOARD_NAME "Azteeg X5 GT" -#define BOARD_WEBSITE_URL "https://www.panucatt.com/azteeg_X5_GT_reprap_3d_printer_controller_p/ax5gt.htm" +#define BOARD_INFO_NAME "Azteeg X5 GT" +#define BOARD_WEBSITE_URL "tinyurl.com/yx8tdqa3" // -// Set CPU +// Servos // -#undef F_CPU -#define F_CPU 120000000 +#define SERVO0_PIN P1_23 // // Limit Switches // - #define X_MIN_PIN P1_24 #define X_MAX_PIN P1_27 #define Y_MIN_PIN P1_25 @@ -92,9 +90,9 @@ // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_BED_PIN 0 // A0 (TH1) -#define TEMP_0_PIN 1 // A1 (TH2) -#define TEMP_1_PIN 2 // A2 (TH3) +#define TEMP_BED_PIN P0_23_A0 // A0 (TH1) +#define TEMP_0_PIN P0_24_A1 // A1 (TH2) +#define TEMP_1_PIN P0_25_A2 // A2 (TH3) // @@ -128,8 +126,3 @@ #define STAT_LED_RED_PIN P1_19 #define STAT_LED_BLUE_PIN P1_20 #endif - -// -// Servo -// -#define SERVO0_PIN P1_23 diff --git a/Marlin/src/pins/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h similarity index 94% rename from Marlin/src/pins/pins_AZTEEG_X5_MINI.h rename to Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index 41936bd6d049..5cc4d52d3062 100644 --- a/Marlin/src/pins/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -25,14 +25,14 @@ * Azteeg X5 MINI pin assignments */ -#ifndef LPC1769 +#ifndef MCU_LPC1769 #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Azteeg X5 MINI" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Azteeg X5 MINI" #endif -#define BOARD_WEBSITE_URL "http://www.panucatt.com/azteeg_X5_mini_reprap_3d_printer_controller_p/ax5mini.htm" +#define BOARD_WEBSITE_URL "tiny.cc/x5_mini" // // LED @@ -56,7 +56,7 @@ #endif #ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 2 // Analog Input (P0_25) + #define FILWIDTH_PIN P0_25_A2 // Analog Input (P0_25) #endif // @@ -93,8 +93,8 @@ // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_BED_PIN 0 // A0 (TH1) -#define TEMP_0_PIN 1 // A1 (TH2) +#define TEMP_BED_PIN P0_23_A0 // A0 (TH1) +#define TEMP_0_PIN P0_24_A1 // A1 (TH2) // // Heaters / Fans diff --git a/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h similarity index 95% rename from Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h rename to Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h index 03005ecb4f5e..3c2a40b4038f 100644 --- a/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h @@ -25,11 +25,11 @@ * Azteeg X5 MINI pin assignments */ -#ifndef LPC1769 +#ifndef MCU_LPC1769 #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#define BOARD_NAME "Azteeg X5 MINI WIFI" +#define BOARD_INFO_NAME "Azteeg X5 MINI WIFI" // // DIGIPOT slave addresses diff --git a/Marlin/src/pins/pins_COHESION3D_MINI.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h similarity index 96% rename from Marlin/src/pins/pins_COHESION3D_MINI.h rename to Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h index 29ad150b2889..7ab8b5bb4a65 100644 --- a/Marlin/src/pins/pins_COHESION3D_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h @@ -25,11 +25,11 @@ * Cohesion3D Mini pin assignments */ -#ifndef LPC1769 +#ifndef MCU_LPC1769 #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#define BOARD_NAME "Cohesion3D Mini" +#define BOARD_INFO_NAME "Cohesion3D Mini" // // Servos @@ -88,8 +88,8 @@ // Analog Inputs // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 0 // P0_23 -#define TEMP_BED_PIN 1 // P0_24 +#define TEMP_0_PIN P0_23_A0 // P0_23 +#define TEMP_BED_PIN P0_24_A1 // P0_24 // // Heaters / Fans diff --git a/Marlin/src/pins/pins_COHESION3D_REMIX.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h similarity index 97% rename from Marlin/src/pins/pins_COHESION3D_REMIX.h rename to Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h index 5adec936ae4f..77cbb197805b 100644 --- a/Marlin/src/pins/pins_COHESION3D_REMIX.h +++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h @@ -25,11 +25,11 @@ * Cohesion3D ReMix pin assignments */ -#ifndef LPC1769 +#ifndef MCU_LPC1769 #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#define BOARD_NAME "Cohesion3D ReMix" +#define BOARD_INFO_NAME "Cohesion3D ReMix" // // Servos @@ -98,13 +98,13 @@ // Analog Inputs // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 0 // P0_23 -#define TEMP_BED_PIN 1 // P0_24 -#define TEMP_1_PIN 2 // P0_25 +#define TEMP_0_PIN P0_23_A0 +#define TEMP_BED_PIN P0_24_A1 +#define TEMP_1_PIN P0_25_A2 #if ENABLED(FILAMENT_WIDTH_SENSOR) - #define FILWIDTH_PIN 3 // P0_26 + #define FILWIDTH_PIN P0_26_A3 #else - #define TEMP_2_PIN 3 // P0_26 + #define TEMP_2_PIN P0_26_A3 #endif // diff --git a/Marlin/src/pins/pins_MKS_SGEN.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h similarity index 72% rename from Marlin/src/pins/pins_MKS_SGEN.h rename to Marlin/src/pins/lpc1769/pins_MKS_SGEN.h index 921ec60c3664..30172e19edea 100644 --- a/Marlin/src/pins/pins_MKS_SGEN.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h @@ -25,14 +25,14 @@ * MKS SGen pin assignments */ -#ifndef LPC1769 +#ifndef MCU_LPC1769 #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#define BOARD_NAME "MKS SGEN" -#define BOARD_WEBSITE_URL "https://github.com/makerbase-mks/MKS-SGEN" +#define BOARD_INFO_NAME "MKS SGen" +#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN" -#include "pins_MKS_SBASE.h" +#include "../lpc1768/pins_MKS_SBASE.h" #undef E1_STEP_PIN #undef E1_DIR_PIN @@ -40,13 +40,17 @@ //#undef BTN_EN1 //#undef BTN_EN2 -//#define BTN_EN1 P1_23 // EXP2.5 -//#define BTN_EN2 P1_22 // EXP2.3 +//#define BTN_EN1 P1_23 // EXP2.5 +//#define BTN_EN2 P1_22 // EXP2.3 -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) - // The shortage of pins becomes apparent. - // In the worst case you may have to give up the LCD. - // RX pins must be interrupt-capable. +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * The shortage of pins becomes apparent. + * In the worst case you may have to give up the LCD. + * RX pins must be interrupt-capable. + */ #define X_SERIAL_TX_PIN P4_29 // J8-2 #define X_SERIAL_RX_PIN P4_29 // J8-2 @@ -57,4 +61,7 @@ #define Z_SERIAL_RX_PIN P2_11 // J8-4 #define E0_SERIAL_TX_PIN P2_13 // J8-5 #define E0_SERIAL_RX_PIN P2_13 // J8-5 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 #endif diff --git a/Marlin/src/pins/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h similarity index 88% rename from Marlin/src/pins/pins_SMOOTHIEBOARD.h rename to Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index ace87a8ca4d1..1096ddc629ae 100644 --- a/Marlin/src/pins/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -25,15 +25,12 @@ * Smoothieboard pin assignments */ -#ifndef LPC1769 +#ifndef MCU_LPC1769 #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#define BOARD_NAME "Smoothieboard" -#define BOARD_WEBSITE_URL "http://smoothieware.org/smoothieboard" - -#undef F_CPU -#define F_CPU 120000000 +#define BOARD_INFO_NAME "Smoothieboard" +#define BOARD_WEBSITE_URL "smoothieware.org/smoothieboard" // // Servos @@ -77,10 +74,10 @@ // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 0 // P0.23 (T1) -#define TEMP_BED_PIN 1 // P0.24 (T2) -#define TEMP_1_PIN 2 // P0.25 (T3) -#define TEMP_2_PIN 3 // P0.26 (T4) +#define TEMP_0_PIN P0_23_A0 // (T1) +#define TEMP_BED_PIN P0_24_A1 // (T2) +#define TEMP_1_PIN P0_25_A2 // (T3) +#define TEMP_2_PIN P0_26_A3 // (T4) // // Heaters / Fans diff --git a/Marlin/src/pins/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h old mode 100755 new mode 100644 similarity index 82% rename from Marlin/src/pins/pins_TH3D_EZBOARD.h rename to Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index 509fdd3aec3b..c2d7d478f1db --- a/Marlin/src/pins/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -25,12 +25,12 @@ * TH3D EZBoard pin assignments */ -#ifndef TARGET_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." +#ifndef MCU_LPC1769 + #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#define BOARD_NAME "TH3D EZBoard" -#define BOARD_WEBSITE_URL "https://www.th3dstudio.com/product/ezboard-lite/" +#define BOARD_INFO_NAME "TH3D EZBoard" +#define BOARD_WEBSITE_URL "th3dstudio.com" // // Servos @@ -87,19 +87,28 @@ #define Z_SERIAL_RX_PIN P0_20 #define E0_SERIAL_TX_PIN P0_22 #define E0_SERIAL_RX_PIN P0_21 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 #endif // // Temp Sensors // 3.3V max when defined as an Analog Input! // -#define TEMP_0_PIN 0 // Analog Input P0_23 -#define TEMP_BED_PIN 1 // Analog Input P0_24 -#define TEMP_1_PIN 2 // Analog Input P0_25 +#if TEMP_SENSOR_0 == 20 // PT100 Adapter + #define TEMP_0_PIN P0_02_A7 // Analog Input +#else + #define TEMP_0_PIN P0_23_A0 // Analog Input P0_23 +#endif + +#define TEMP_BED_PIN P0_24_A1 // Analog Input P0_24 +#define TEMP_1_PIN P0_25_A2 // Analog Input P0_25 + #if ENABLED(FILAMENT_WIDTH_SENSOR) - #define FILWIDTH_PIN 3 // Analog Input P0_26 + #define FILWIDTH_PIN P0_26_A3 // Analog Input P0_26 #else - #define TEMP_2_PIN 3 // Analog Input P0_26 + #define TEMP_2_PIN P0_26_A3 // Analog Input P0_26 #endif // @@ -163,4 +172,6 @@ #define LCD_PINS_ENABLE P0_18 #define LCD_PINS_D4 P0_15 #define KILL_PIN P2_11 +#elif HAS_SPI_LCD + #error "Only the CR10_STOCKDISPLAY is supported with TH3D EZBoard." #endif diff --git a/Marlin/src/pins/pins_CHEAPTRONIC.h b/Marlin/src/pins/mega/pins_CHEAPTRONIC.h similarity index 97% rename from Marlin/src/pins/pins_CHEAPTRONIC.h rename to Marlin/src/pins/mega/pins_CHEAPTRONIC.h index 36cfb3143542..e49207a42acb 100644 --- a/Marlin/src/pins/pins_CHEAPTRONIC.h +++ b/Marlin/src/pins/mega/pins_CHEAPTRONIC.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Cheaptronic v1.0" +#define BOARD_INFO_NAME "Cheaptronic v1.0" // // Limit Switches // diff --git a/Marlin/src/pins/pins_CHEAPTRONICv2.h b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h similarity index 98% rename from Marlin/src/pins/pins_CHEAPTRONICv2.h rename to Marlin/src/pins/mega/pins_CHEAPTRONICv2.h index 111d76cd200d..f2df6e1ecb31 100644 --- a/Marlin/src/pins/pins_CHEAPTRONICv2.h +++ b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h @@ -31,7 +31,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Cheaptronic v2.0" +#define BOARD_INFO_NAME "Cheaptronic v2.0" // // Limit Switches @@ -125,7 +125,6 @@ #define BEEPER_PIN 44 #if ENABLED(SDSUPPORT) - #define SDPOWER -1 #define SDSS 53 #define SD_DETECT_PIN 49 #endif diff --git a/Marlin/src/pins/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h similarity index 95% rename from Marlin/src/pins/pins_CNCONTROLS_11.h rename to Marlin/src/pins/mega/pins_CNCONTROLS_11.h index 91bafb9e0e2a..3915c1cfede1 100644 --- a/Marlin/src/pins/pins_CNCONTROLS_11.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h @@ -6,7 +6,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "CN Controls V11" +#define BOARD_INFO_NAME "CN Controls V11" // // Limit Switches @@ -54,7 +54,10 @@ #define TEMP_2_PIN 2 // Analog Input. 9 for tool3 -> 2 for chambertemp #define TEMP_3_PIN 11 // Analog Input. 11 for tool4 -> 2 for chambertemp #define TEMP_BED_PIN 1 // Analog Input -//#define TEMP_CHAMBER_PIN 2 // Analog Input + +#ifndef TEMP_CHAMBER_PIN + //#define TEMP_CHAMBER_PIN 2 // Analog Input +#endif // // Heaters / Fans diff --git a/Marlin/src/pins/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h similarity index 96% rename from Marlin/src/pins/pins_CNCONTROLS_12.h rename to Marlin/src/pins/mega/pins_CNCONTROLS_12.h index a7fcb181621f..b9a96c410b00 100644 --- a/Marlin/src/pins/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h @@ -6,7 +6,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "CN Controls V12" +#define BOARD_INFO_NAME "CN Controls V12" // // Limit Switches @@ -54,7 +54,10 @@ #define TEMP_2_PIN 13 // Analog Input. 10 for tool3 -> 13 for chambertemp #define TEMP_3_PIN 11 // Analog Input. 11 for tool4 -> 13 for chambertemp #define TEMP_BED_PIN 14 // Analog Input -//#define TEMP_CHAMBER_PIN 13 // Analog Input + +#ifndef TEMP_CHAMBER_PIN + //#define TEMP_CHAMBER_PIN 13 // Analog Input +#endif // // Heaters / Fans diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_15.h b/Marlin/src/pins/mega/pins_CNCONTROLS_15.h new file mode 100644 index 000000000000..2fad8d576e84 --- /dev/null +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_15.h @@ -0,0 +1,89 @@ +/** + * CNControls V15 for HMS434 pin assignments + */ + +#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "CN Controls V15" + +// +// Servos +// +#define SERVO0_PIN 6 + +// +// Limit Switches +// +#define X_STOP_PIN 34 +#define Y_STOP_PIN 39 +#define Z_STOP_PIN 62 + +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 49 +#endif + +// +// Steppers +// +#define X_STEP_PIN 14 +#define X_DIR_PIN 25 +#define X_ENABLE_PIN 26 + +#define Y_STEP_PIN 11 +#define Y_DIR_PIN 12 +#define Y_ENABLE_PIN 15 + +#define Z_STEP_PIN 24 +#define Z_DIR_PIN 27 +#define Z_ENABLE_PIN 28 + +#define E0_STEP_PIN 64 +#define E0_DIR_PIN 65 +#define E0_ENABLE_PIN 63 + +// +// Temperature Sensors +// Analog Inputs +// +#define TEMP_0_PIN 2 // Analog Input +#define TEMP_BED_PIN 4 // Analog Input + +#ifndef TEMP_CHAMBER_PIN + #define TEMP_CHAMBER_PIN 5 // Analog Input +#endif + +// +// Heaters +// +#define HEATER_0_PIN 4 +#define HEATER_BED_PIN 32 +#define HEATER_CHAMBER_PIN 33 + +// +// Fans +// +#define FAN0_PIN 8 +#define ORIG_E0_AUTO_FAN_PIN 30 +#define ORIG_E1_AUTO_FAN_PIN 30 +#define ORIG_E2_AUTO_FAN_PIN 30 +#define ORIG_E3_AUTO_FAN_PIN 30 +//#define ORIG_CHAMBER_AUTO_FAN_PIN 10 + +// +// Misc. Functions +// +#define SDSS 53 +#define SD_DETECT_PIN 40 + +// Common I/O + +#define FIL_RUNOUT_PIN 9 +//#define FIL_RUNOUT_PIN 29 // encoder sensor +//#define PWM_1_PIN 12 +//#define PWM_2_PIN 13 +//#define SPARE_IO 17 +#define BEEPER_PIN 13 +#define STAT_LED_BLUE_PIN -1 +#define STAT_LED_RED_PIN 10 // 31 diff --git a/Marlin/src/pins/pins_EINSTART-S.h b/Marlin/src/pins/mega/pins_EINSTART-S.h old mode 100755 new mode 100644 similarity index 83% rename from Marlin/src/pins/pins_EINSTART-S.h rename to Marlin/src/pins/mega/pins_EINSTART-S.h index 89e69dda5dca..fae1d2e94d79 --- a/Marlin/src/pins/pins_EINSTART-S.h +++ b/Marlin/src/pins/mega/pins_EINSTART-S.h @@ -26,19 +26,11 @@ * PCB Silkscreen: 3DPrinterCon_v3.5 */ -#if ENABLED(TARGET_LPC1768) - #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768." -#elif defined(__STM32F1__) - #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1." +#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#if NONE(IS_RAMPS_SMART, IS_RAMPS_DUO, IS_RAMPS4DUE, TARGET_LPC1768) - #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" - #endif -#endif - -#define BOARD_NAME "Einstart-S" +#define BOARD_INFO_NAME "Einstart-S" // // Limit Switches diff --git a/Marlin/src/pins/pins_ELEFU_3.h b/Marlin/src/pins/mega/pins_ELEFU_3.h similarity index 99% rename from Marlin/src/pins/pins_ELEFU_3.h rename to Marlin/src/pins/mega/pins_ELEFU_3.h index ae87e8ce7b09..5b43acab10b6 100644 --- a/Marlin/src/pins/pins_ELEFU_3.h +++ b/Marlin/src/pins/mega/pins_ELEFU_3.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Elefu Ra v3" +#define BOARD_INFO_NAME "Elefu Ra v3" // // Limit Switches diff --git a/Marlin/src/pins/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h similarity index 97% rename from Marlin/src/pins/pins_GT2560_REV_A.h rename to Marlin/src/pins/mega/pins_GT2560_REV_A.h index ba4f4830ac5b..16bd5688df53 100644 --- a/Marlin/src/pins/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -31,8 +31,8 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "GT2560 Rev.A" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "GT2560 Rev.A" #endif #define DEFAULT_MACHINE_NAME "Prusa i3 Pro B" @@ -89,7 +89,6 @@ // // Misc. Functions // -#define SDPOWER -1 #define SDSS 53 #define LED_PIN 13 #define PS_ON_PIN 12 diff --git a/Marlin/src/pins/pins_GT2560_REV_A_PLUS.h b/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h similarity index 96% rename from Marlin/src/pins/pins_GT2560_REV_A_PLUS.h rename to Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h index 8becf9bcfe93..c5c894810b32 100644 --- a/Marlin/src/pins/pins_GT2560_REV_A_PLUS.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h @@ -25,7 +25,7 @@ * Geeetech GT2560 Revision A+ board pin assignments */ -#define BOARD_NAME "GT2560 Rev.A+" +#define BOARD_INFO_NAME "GT2560 Rev.A+" #include "pins_GT2560_REV_A.h" diff --git a/Marlin/src/pins/pins_GT2560_V3.h b/Marlin/src/pins/mega/pins_GT2560_V3.h similarity index 83% rename from Marlin/src/pins/pins_GT2560_V3.h rename to Marlin/src/pins/mega/pins_GT2560_V3.h index 4f0667d0b72f..0534ba062079 100644 --- a/Marlin/src/pins/pins_GT2560_V3.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3.h @@ -29,8 +29,8 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "GT2560 V3.0" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "GT2560 V3.0" #endif // @@ -112,6 +112,10 @@ #define E1_DIR_PIN 47 #define E1_ENABLE_PIN 48 +#define E2_STEP_PIN 43 +#define E2_DIR_PIN 45 +#define E2_ENABLE_PIN 41 + // // Temperature Sensors // @@ -149,15 +153,33 @@ // #define BEEPER_PIN 18 -#define LCD_PINS_RS 20 -#define LCD_PINS_ENABLE 17 -#define LCD_PINS_D4 16 -#define LCD_PINS_D5 21 -#define LCD_PINS_D6 5 -#define LCD_PINS_D7 36 +#ifndef LCD_PINS_RS + #define LCD_PINS_RS 20 +#endif +#ifndef LCD_PINS_ENABLE + #define LCD_PINS_ENABLE 17 +#endif +#ifndef LCD_PINS_D4 + #define LCD_PINS_D4 16 +#endif +#ifndef LCD_PINS_D5 + #define LCD_PINS_D5 21 +#endif +#ifndef LCD_PINS_D6 + #define LCD_PINS_D6 5 +#endif +#ifndef LCD_PINS_D7 + #define LCD_PINS_D7 36 +#endif #if ENABLED(NEWPANEL) - #define BTN_EN1 42 - #define BTN_EN2 40 - #define BTN_ENC 19 + #ifndef BTN_EN1 + #define BTN_EN1 42 + #endif + #ifndef BTN_EN2 + #define BTN_EN2 40 + #endif + #ifndef BTN_ENC + #define BTN_ENC 19 + #endif #endif diff --git a/Marlin/src/pins/pins_GT2560_V3_A20.h b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h similarity index 89% rename from Marlin/src/pins/pins_GT2560_V3_A20.h rename to Marlin/src/pins/mega/pins_GT2560_V3_A20.h index 5565ac62cd0e..e3b6895af108 100644 --- a/Marlin/src/pins/pins_GT2560_V3_A20.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h @@ -25,22 +25,15 @@ * Geeetech A20M pin assignment */ -#include "pins_GT2560_V3.h" - -#undef LCD_PINS_RS -#undef LCD_PINS_ENABLE -#undef LCD_PINS_D4 -#undef LCD_PINS_D7 #define LCD_PINS_RS 5 #define LCD_PINS_ENABLE 36 #define LCD_PINS_D4 21 #define LCD_PINS_D7 6 #if ENABLED(NEWPANEL) - #undef BTN_EN1 - #undef BTN_EN2 - #undef BTN_ENC #define BTN_EN1 16 #define BTN_EN2 17 #define BTN_ENC 19 #endif + +#include "pins_GT2560_V3.h" diff --git a/Marlin/src/pins/pins_GT2560_V3_MC2.h b/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h similarity index 96% rename from Marlin/src/pins/pins_GT2560_V3_MC2.h rename to Marlin/src/pins/mega/pins_GT2560_V3_MC2.h index 7abee9cd606e..afdcad34352a 100644 --- a/Marlin/src/pins/pins_GT2560_V3_MC2.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h @@ -25,7 +25,7 @@ * GT2560 V3.0 pin assignment (for Mecreator 2) *****************************************************************/ -#define BOARD_NAME "GT2560 V3.0 (MC2)" +#define BOARD_INFO_NAME "GT2560 V3.0 (MC2)" #define X_MIN_PIN 22 #define X_MAX_PIN 24 diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h new file mode 100644 index 000000000000..a39162ddedcd --- /dev/null +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -0,0 +1,170 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * HJC2560-C Rev2.x pin assignments + */ + +#ifndef __AVR_ATmega2560__ + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#endif + +#define DEFAULT_MACHINE_NAME "ADIMLab Gantry v2" +#define BOARD_INFO_NAME "HJC2560-C" + +// +// Servos +// +//#ifndef SERVO0_PIN +// #define SERVO0_PIN 11 +//#endif + +// +// Limit Switches +// +#define X_STOP_PIN 22 +#define Y_STOP_PIN 26 +#define Z_STOP_PIN 29 +//#define EXP_STOP_PIN 28 + +// +// Steppers +// +#define X_STEP_PIN 25 +#define X_DIR_PIN 23 +#define X_ENABLE_PIN 27 + +#define Y_STEP_PIN 32 +#define Y_DIR_PIN 33 +#define Y_ENABLE_PIN 31 + +#define Z_STEP_PIN 35 +#define Z_DIR_PIN 36 +#define Z_ENABLE_PIN 34 + +#define E0_STEP_PIN 42 +#define E0_DIR_PIN 43 +#define E0_ENABLE_PIN 37 + +#define E1_STEP_PIN 49 +#define E1_DIR_PIN 47 +#define E1_ENABLE_PIN 48 + +#define MOTOR_CURRENT_PWM_XY_PIN 44 +#define MOTOR_CURRENT_PWM_Z_PIN 45 +#define MOTOR_CURRENT_PWM_E_PIN 46 +// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range +#ifndef MOTOR_CURRENT_PWM_RANGE + #define MOTOR_CURRENT_PWM_RANGE 2000 +#endif +#define DEFAULT_PWM_MOTOR_CURRENT { 1300, 1300, 1250 } + +// +// Temperature Sensors +// +#define TEMP_0_PIN 8 // Analog Input +#define TEMP_1_PIN 9 // Analog Input +#define TEMP_BED_PIN 10 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 2 +#define HEATER_1_PIN 3 +#define HEATER_BED_PIN 4 + +#ifndef FAN_PIN + #define FAN_PIN 7 //默认不使用PWM_FAN冷却喷嘴,如果需要,则取消注释 +#endif + +// +// Misc. Functions +// +#define SDSS 53 +#define SD_DETECT_PIN 39 +//#define LED_PIN 8 +#define CASE_LIGHT_PIN 8 // 8 默认挤出机风扇作为Case LED,如果需要PWM FAN,则需要将FAN_PIN置为7,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. + +// +// M3/M4/M5 - Spindle/Laser Control +// +#if ENABLED(SPINDLE_LASER_ENABLE) + #define SPINDLE_DIR_PIN 16 + #define SPINDLE_LASER_ENABLE_PIN 17 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM +#endif + +// +// LCD / Controller +// +#if HAS_SPI_LCD + + #define BEEPER_PIN 18 + + #if ENABLED(NEWPANEL) + + #define LCD_PINS_RS 20 // LCD_CS + #define LCD_PINS_ENABLE 15 // LCD_SDA + #define LCD_PINS_D4 14 // LCD_SCK + + #if ENABLED(HJC_LCD_SMART_CONTROLLER) + #define LCD_BACKLIGHT_PIN 5 // LCD_Backlight + //#ifndef LCD_CONTRAST_PIN + // #define LCD_CONTRAST_PIN 5 // LCD_Contrast + //#endif + #ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 24 // Filament runout + #endif + #else + #define LCD_PINS_D5 21 + #define LCD_PINS_D6 5 + #define LCD_PINS_D7 6 + #endif + + #define BTN_EN1 41 + #define BTN_EN2 40 + #define BTN_ENC 19 + + #define SD_DETECT_PIN 39 + + #else + + // Buttons attached to a shift register + #define SHIFT_CLK 38 + #define SHIFT_LD 42 + #define SHIFT_OUT 40 + #define SHIFT_EN 17 + + #define LCD_PINS_RS 16 + #define LCD_PINS_ENABLE 5 + #define LCD_PINS_D4 6 + #define LCD_PINS_D5 21 + #define LCD_PINS_D6 20 + #define LCD_PINS_D7 19 + + #endif // !NEWPANEL + +#endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/pins_LEAPFROG.h b/Marlin/src/pins/mega/pins_LEAPFROG.h similarity index 98% rename from Marlin/src/pins/pins_LEAPFROG.h rename to Marlin/src/pins/mega/pins_LEAPFROG.h index 8d4f31a70f9a..56eec5e97e14 100644 --- a/Marlin/src/pins/pins_LEAPFROG.h +++ b/Marlin/src/pins/mega/pins_LEAPFROG.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Mega 1280' or 'Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Leapfrog" +#define BOARD_INFO_NAME "Leapfrog" // // Limit Switches diff --git a/Marlin/src/pins/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h similarity index 94% rename from Marlin/src/pins/pins_MEGACONTROLLER.h rename to Marlin/src/pins/mega/pins_MEGACONTROLLER.h index 14fec34ec69a..473e79b2765a 100644 --- a/Marlin/src/pins/pins_MEGACONTROLLER.h +++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h @@ -27,13 +27,11 @@ #ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 +#elif HOTENDS > 2 || E_STEPPERS > 2 #error "Mega Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "Mega Controller" +#define BOARD_INFO_NAME "Mega Controller" // // Servos @@ -161,6 +159,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 7 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 7 // Pullup! #define SPINDLE_DIR_PIN 8 diff --git a/Marlin/src/pins/pins_MEGATRONICS.h b/Marlin/src/pins/mega/pins_MEGATRONICS.h similarity index 93% rename from Marlin/src/pins/pins_MEGATRONICS.h rename to Marlin/src/pins/mega/pins_MEGATRONICS.h index 44a487cbbc8b..64337578677d 100644 --- a/Marlin/src/pins/pins_MEGATRONICS.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Megatronics" +#define BOARD_INFO_NAME "Megatronics" // // Limit Switches // @@ -114,7 +114,7 @@ #define LCD_PINS_D6 27 #define LCD_PINS_D7 29 - // Buttons directly attached using AUX-2 + // Buttons directly attached to AUX-2 #define BTN_EN1 59 #define BTN_EN2 64 #define BTN_ENC 43 @@ -126,6 +126,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 3 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 4 // Pullup! #define SPINDLE_DIR_PIN 11 diff --git a/Marlin/src/pins/pins_MEGATRONICS_2.h b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h similarity index 79% rename from Marlin/src/pins/pins_MEGATRONICS_2.h rename to Marlin/src/pins/mega/pins_MEGATRONICS_2.h index fa154555f7cc..4cd5999604e8 100644 --- a/Marlin/src/pins/pins_MEGATRONICS_2.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Megatronics v2.0" +#define BOARD_INFO_NAME "Megatronics v2.0" // // Limit Switches // @@ -116,31 +116,37 @@ #define CASE_LIGHT_PIN 2 // -// LCD / Controller +// M3/M4/M5 - Spindle/Laser Control // -#define BEEPER_PIN 64 - -#define LCD_PINS_RS 14 -#define LCD_PINS_ENABLE 15 -#define LCD_PINS_D4 30 -#define LCD_PINS_D5 31 -#define LCD_PINS_D6 32 -#define LCD_PINS_D7 33 - -// Buttons are directly attached using keypad -#define BTN_EN1 61 -#define BTN_EN2 59 -#define BTN_ENC 43 - -// Buttons that are attached using shift register of reprapworld keypad v1.1 -#define SHIFT_CLK 63 -#define SHIFT_LD 42 -#define SHIFT_OUT 17 -#define SHIFT_EN 17 +#define SPINDLE_LASER_PWM_PIN 3 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 16 // Pullup! +#define SPINDLE_DIR_PIN 11 // -// M3/M4/M5 - Spindle/Laser Control +// LCD / Controller // -#define SPINDLE_LASER_PWM_PIN 3 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 16 // Pin should have a pullup! -#define SPINDLE_DIR_PIN 11 +#define BEEPER_PIN 64 + +#if HAS_SPI_LCD + + #define LCD_PINS_RS 14 + #define LCD_PINS_ENABLE 15 + #define LCD_PINS_D4 30 + #define LCD_PINS_D5 31 + #define LCD_PINS_D6 32 + #define LCD_PINS_D7 33 + + #if ENABLED(NEWPANEL) + // Buttons are directly attached using keypad + #define BTN_EN1 61 + #define BTN_EN2 59 + #define BTN_ENC 43 + #else + // Buttons attached to shift register of reprapworld keypad v1.1 + #define SHIFT_CLK 63 + #define SHIFT_LD 42 + #define SHIFT_OUT 17 + #define SHIFT_EN 17 + #endif + +#endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/pins_MEGATRONICS_3.h b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h similarity index 87% rename from Marlin/src/pins/pins_MEGATRONICS_3.h rename to Marlin/src/pins/mega/pins_MEGATRONICS_3.h index 863680637ffd..a33b2ecfc515 100644 --- a/Marlin/src/pins/pins_MEGATRONICS_3.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h @@ -30,11 +30,11 @@ #endif #if MB(MEGATRONICS_32) - #define BOARD_NAME "Megatronics v3.2" + #define BOARD_INFO_NAME "Megatronics v3.2" #elif MB(MEGATRONICS_31) - #define BOARD_NAME "Megatronics v3.1" + #define BOARD_INFO_NAME "Megatronics v3.1" #else - #define BOARD_NAME "Megatronics v3.0" + #define BOARD_INFO_NAME "Megatronics v3.0" #endif // @@ -48,12 +48,12 @@ // // Limit Switches // -#define X_MIN_PIN 37 -#define X_MAX_PIN 40 -#define Y_MIN_PIN 41 -#define Y_MAX_PIN 38 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 +#define X_MIN_PIN 37 // No INT +#define X_MAX_PIN 40 // No INT +#define Y_MIN_PIN 41 // No INT +#define Y_MAX_PIN 38 // No INT +#define Z_MIN_PIN 18 // No INT +#define Z_MAX_PIN 19 // No INT // // Z Probe (when not Z_MIN_PIN) @@ -164,7 +164,7 @@ #define SHIFT_OUT 34 #define SHIFT_EN 44 - #if MB(MEGATRONICS_31) || MB(MEGATRONICS_32) + #if MB(MEGATRONICS_31, MEGATRONICS_32) #define SD_DETECT_PIN 56 #endif @@ -174,8 +174,8 @@ // 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_ENA_PIN 43 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN 43 // 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 @@ -189,7 +189,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_ENA_PIN 17 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN 17 // Pullup! #define SPINDLE_DIR_PIN 5 #endif diff --git a/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h similarity index 98% rename from Marlin/src/pins/pins_MIGHTYBOARD_REVE.h rename to Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index 4cb493525204..703d5caae0a1 100644 --- a/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -41,8 +41,8 @@ #error "Oops! Select 'Mega 1280' or 'Mega 2560' in 'Tools > Board.'" #endif -#define DEFAULT_MACHINE_NAME "MB Replicator" -#define BOARD_NAME "Mightyboard" +#define BOARD_INFO_NAME "Mightyboard" +#define DEFAULT_MACHINE_NAME "MB Replicator" // // Servos diff --git a/Marlin/src/pins/pins_MINITRONICS.h b/Marlin/src/pins/mega/pins_MINITRONICS.h similarity index 97% rename from Marlin/src/pins/pins_MINITRONICS.h rename to Marlin/src/pins/mega/pins_MINITRONICS.h index a76682a896d0..16fad0067f35 100644 --- a/Marlin/src/pins/pins_MINITRONICS.h +++ b/Marlin/src/pins/mega/pins_MINITRONICS.h @@ -34,13 +34,11 @@ #ifndef __AVR_ATmega1281__ #error "Oops! Select 'Minitronics' in 'Tools > Board.'" -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 +#elif HOTENDS > 2 || E_STEPPERS > 2 #error "Minitronics supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "Minitronics v1.0/1.1" +#define BOARD_INFO_NAME "Minitronics v1.0/1.1" // // Limit Switches // diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h new file mode 100644 index 000000000000..b6043c018c50 --- /dev/null +++ b/Marlin/src/pins/mega/pins_OVERLORD.h @@ -0,0 +1,144 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Dreammaker Overlord v1.1 pin assignments + */ + +#ifndef __AVR_ATmega2560__ + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Overlord Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "OVERLORD" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// +// Limit Switches +// +#define X_STOP_PIN 24 +#define Y_STOP_PIN 28 +#define Z_MIN_PIN 46 +#define Z_MAX_PIN 32 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 46 // JP4, Tfeed1 +#endif + +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define FIL_RUNOUT_PIN 44 // JP3, Tfeed2 +#endif + +// +// Steppers +// +#define X_STEP_PIN 25 +#define X_DIR_PIN 23 +#define X_ENABLE_PIN 27 + +#define Y_STEP_PIN 31 +#define Y_DIR_PIN 33 +#define Y_ENABLE_PIN 29 + +#define Z_STEP_PIN 37 +#define Z_DIR_PIN 39 +#define Z_ENABLE_PIN 35 + +#define E0_STEP_PIN 43 +#define E0_DIR_PIN 45 +#define E0_ENABLE_PIN 41 + +#define E1_STEP_PIN 49 +#define E1_DIR_PIN 47 +#define E1_ENABLE_PIN 48 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 8 // Analog Input +#define TEMP_1_PIN 9 // Analog Input - Redundant temp sensor +#define TEMP_2_PIN 12 // Analog Input +#define TEMP_3_PIN 14 // Analog Input +#define TEMP_BED_PIN 10 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 2 +#define HEATER_1_PIN 3 +#define HEATER_BED_PIN 4 + +#define FAN_PIN 7 // material cooling fan + +// +// SD Card +// +#define SDSS 53 +#define SD_DETECT_PIN 38 + +// +// Misc. Functions +// +#define LED_PIN 13 // On PCB status led +#define PS_ON_PIN 12 // For stepper/heater/fan power. Active HIGH. +#define POWER_LOSS_PIN 34 // Power check - whether hotends/steppers/fans have power + +#if ENABLED(BATTERY_STATUS_AVAILABLE) + #undef BATTERY_STATUS_PIN + #define BATTERY_STATUS_PIN 26 // Status of power loss battery, whether it is charged (low) or charging (high) +#endif +#if ENABLED(INPUT_VOLTAGE_AVAILABLE) + #undef VOLTAGE_DETECTION_PIN + #define VOLTAGE_DETECTION_PIN 11 // Analog Input - ADC Voltage level of main input +#endif + +// +// LCD / Controller +// +#if HAS_GRAPHICAL_LCD + // OVERLORD OLED pins + #define LCD_PINS_RS 20 + #define LCD_PINS_D5 21 + #define LCD_PINS_ENABLE 15 + #define LCD_PINS_D4 14 + #define LCD_PINS_D6 5 + #define LCD_PINS_D7 6 + #ifndef LCD_RESET_PIN + #define LCD_RESET_PIN 5 // LCD_PINS_D6 + #endif +#endif + +#if ENABLED(NEWPANEL) + #define BTN_ENC 16 // Enter Pin + #define BTN_UP 19 // Button UP Pin + #define BTN_DWN 17 // Button DOWN Pin +#endif + +// Additional connectors/pins on the Overlord V1.X board +#define PCB_VERSION_PIN 22 +#define APPROACH_PIN 11 // JP7, Tpd +#define GATE_PIN 36 // Threshold, JP6, Tg diff --git a/Marlin/src/pins/pins_SILVER_GATE.h b/Marlin/src/pins/mega/pins_SILVER_GATE.h similarity index 98% rename from Marlin/src/pins/pins_SILVER_GATE.h rename to Marlin/src/pins/mega/pins_SILVER_GATE.h index 2d1bb12a970c..2ea2b09f5aac 100644 --- a/Marlin/src/pins/pins_SILVER_GATE.h +++ b/Marlin/src/pins/mega/pins_SILVER_GATE.h @@ -25,7 +25,7 @@ #error "Oops! Select 'Silvergate' in 'Tools > Board.'" #endif -#define BOARD_NAME "Silver Gate" +#define BOARD_INFO_NAME "Silver Gate" #define X_STEP_PIN 43 #define X_DIR_PIN 44 diff --git a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h new file mode 100644 index 000000000000..1cceef8dab21 --- /dev/null +++ b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h @@ -0,0 +1,111 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Wanhao 0ne+ pin assignments + */ + +#ifndef __AVR_ATmega2560__ + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "Wanhao i3 Mini 0ne+" +#define DEFAULT_MACHINE_NAME "i3 Mini" +#define BOARD_WEBSITE_URL "https://tinyurl.com/yyxw7se7" + +// +// Limit Switches +// +#define X_STOP_PIN 19 +#define Y_STOP_PIN 18 +#define Z_STOP_PIN 38 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 38 +#endif + +// +// Steppers +// +#define X_STEP_PIN 22 +#define X_DIR_PIN 23 +#define X_ENABLE_PIN 57 + +#define Y_STEP_PIN 25 +#define Y_DIR_PIN 26 +#define Y_ENABLE_PIN 24 + +#define Z_STEP_PIN 29 +#define Z_DIR_PIN 39 +#define Z_ENABLE_PIN 28 + +#define E0_STEP_PIN 55 +#define E0_DIR_PIN 56 +#define E0_ENABLE_PIN 54 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 13 +#define TEMP_BED_PIN 14 + +// +// Heaters / Fans +// +#define HEATER_0_PIN 4 +#define HEATER_BED_PIN 44 +#define FAN_PIN 12 // IO pin. Buffer needed + +// +// SD Card +// +#define SD_DETECT_PIN -1 +#define SDSS 53 + +// +// Misc. Functions +// +#define BEEPER_PIN 37 +#define KILL_PIN 64 + +// +// LCD / Controller (Integrated MINIPANEL) +// +#if ENABLED(MINIPANEL) + #define DOGLCD_A0 40 + #define DOGLCD_CS 41 + #define LCD_BACKLIGHT_PIN 65 // Backlight LED on A11/D65 + #define LCD_RESET_PIN 27 + + #define BTN_EN1 2 + #define BTN_EN2 3 + #define BTN_ENC 5 + + // This display has adjustable contrast + #define LCD_CONTRAST_MIN 0 + #define LCD_CONTRAST_MAX 255 + #define LCD_CONTRAST_INIT LCD_CONTRAST_MAX +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 4651faec450f..810db46415e7 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -21,6 +21,8 @@ */ #pragma once +#include "../core/boards.h" + /** * Include pins definitions * @@ -35,461 +37,527 @@ #define MAX_EXTRUDERS 6 -#if MB(RAMPS_13_EFB) || MB(RAMPS_14_EFB) || MB(RAMPS_PLUS_EFB) || MB(RAMPS_14_RE_ARM_EFB) || MB(RAMPS_SMART_EFB) || MB(RAMPS_DUO_EFB) || MB(RAMPS4DUE_EFB) +#if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB) #define IS_RAMPS_EFB -#elif MB(RAMPS_13_EEB) || MB(RAMPS_14_EEB) || MB(RAMPS_PLUS_EEB) || MB(RAMPS_14_RE_ARM_EEB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_DUO_EEB) || MB(RAMPS4DUE_EEB) +#elif MB(RAMPS_13_EEB, RAMPS_14_EEB, RAMPS_PLUS_EEB, RAMPS_14_RE_ARM_EEB, RAMPS_SMART_EEB, RAMPS_DUO_EEB, RAMPS4DUE_EEB) #define IS_RAMPS_EEB -#elif MB(RAMPS_13_EFF) || MB(RAMPS_14_EFF) || MB(RAMPS_PLUS_EFF) || MB(RAMPS_14_RE_ARM_EFF) || MB(RAMPS_SMART_EFF) || MB(RAMPS_DUO_EFF) || MB(RAMPS4DUE_EFF) +#elif MB(RAMPS_13_EFF, RAMPS_14_EFF, RAMPS_PLUS_EFF, RAMPS_14_RE_ARM_EFF, RAMPS_SMART_EFF, RAMPS_DUO_EFF, RAMPS4DUE_EFF) #define IS_RAMPS_EFF -#elif MB(RAMPS_13_EEF) || MB(RAMPS_14_EEF) || MB(RAMPS_PLUS_EEF) || MB(RAMPS_14_RE_ARM_EEF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_DUO_EEF) || MB(RAMPS4DUE_EEF) +#elif MB(RAMPS_13_EEF, RAMPS_14_EEF, RAMPS_PLUS_EEF, RAMPS_14_RE_ARM_EEF, RAMPS_SMART_EEF, RAMPS_DUO_EEF, RAMPS4DUE_EEF) #define IS_RAMPS_EEF -#elif MB(RAMPS_13_SF) || MB(RAMPS_14_SF) || MB(RAMPS_PLUS_SF) || MB(RAMPS_14_RE_ARM_SF) || MB(RAMPS_SMART_SF) || MB(RAMPS_DUO_SF) || MB(RAMPS4DUE_SF) +#elif MB(RAMPS_13_SF, RAMPS_14_SF, RAMPS_PLUS_SF, RAMPS_14_RE_ARM_SF, RAMPS_SMART_SF, RAMPS_DUO_SF, RAMPS4DUE_SF) #define IS_RAMPS_SF #endif +#define HAS_FREE_AUX2_PINS !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) + // // RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560 // #if MB(RAMPS_OLD) - #include "pins_RAMPS_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_13_EFB) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_13_EEB) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_13_EFF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_13_EEF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_13_SF) - #include "pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_14_EFB) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_14_EEB) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_14_EFF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_14_EEF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_14_SF) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_PLUS_EFB) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_PLUS_EEB) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_PLUS_EFF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_PLUS_EEF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RAMPS_PLUS_SF) - #include "pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 // // RAMPS Derivatives - ATmega1280, ATmega2560 // #elif MB(3DRAG) - #include "pins_3DRAG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_3DRAG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(K8200) - #include "pins_K8200.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) + #include "ramps/pins_K8200.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) #elif MB(K8400) - #include "pins_K8400.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) + #include "ramps/pins_K8400.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) #elif MB(K8800) - #include "pins_K8800.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) + #include "ramps/pins_K8800.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (3DRAG) #elif MB(BAM_DICE) - #include "pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RAMPS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(BAM_DICE_DUE) - #include "pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(MKS_BASE) - #include "pins_MKS_BASE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_MKS_BASE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(MKS_BASE_14) - #include "pins_MKS_BASE_14.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_MKS_BASE_14.h" // ATmega2560 env:megaatmega2560 #elif MB(MKS_BASE_15) - #include "pins_MKS_BASE_15.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/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 + #include "ramps/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 "ramps/pins_MKS_GEN_13.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(MKS_GEN_L) - #include "pins_MKS_GEN_L.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_MKS_GEN_L.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(KFB_2) - #include "pins_BIQU_KFB_2.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_BIQU_KFB_2.h" // ATmega2560 env:megaatmega2560 #elif MB(ZRIB_V20) - #include "pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (MKS_GEN_13) + #include "ramps/pins_ZRIB_V20.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 (MKS_GEN_13) #elif MB(FELIX2) - #include "pins_FELIX2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_FELIX2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RIGIDBOARD) - #include "pins_RIGIDBOARD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RIGIDBOARD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(RIGIDBOARD_V2) - #include "pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(SAINSMART_2IN1) - #include "pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(ULTIMAKER) - #include "pins_ULTIMAKER.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_ULTIMAKER.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(ULTIMAKER_OLD) - #include "pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "ramps/pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(AZTEEG_X3) - #include "pins_AZTEEG_X3.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_AZTEEG_X3.h" // ATmega2560 env:megaatmega2560 #elif MB(AZTEEG_X3_PRO) - #include "pins_AZTEEG_X3_PRO.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_AZTEEG_X3_PRO.h" // ATmega2560 env:megaatmega2560 #elif MB(ULTIMAIN_2) - #include "pins_ULTIMAIN_2.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_ULTIMAIN_2.h" // ATmega2560 env:megaatmega2560 #elif MB(FORMBOT_RAPTOR) - #include "pins_FORMBOT_RAPTOR.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_FORMBOT_RAPTOR.h" // ATmega2560 env:megaatmega2560 #elif MB(FORMBOT_RAPTOR2) - #include "pins_FORMBOT_RAPTOR2.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_FORMBOT_RAPTOR2.h" // ATmega2560 env:megaatmega2560 #elif MB(FORMBOT_TREX2PLUS) - #include "pins_FORMBOT_TREX2PLUS.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_FORMBOT_TREX2PLUS.h" // ATmega2560 env:megaatmega2560 #elif MB(FORMBOT_TREX3) - #include "pins_FORMBOT_TREX3.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_FORMBOT_TREX3.h" // ATmega2560 env:megaatmega2560 #elif MB(RUMBA) - #include "pins_RUMBA.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_RUMBA.h" // ATmega2560 env:megaatmega2560 #elif MB(RUMBA_RAISE3D) - #include "pins_RUMBA_RAISE3D.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_RUMBA_RAISE3D.h" // ATmega2560 env:megaatmega2560 #elif MB(RL200) - #include "pins_RL200.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_RL200.h" // ATmega2560 env:megaatmega2560 #elif MB(BQ_ZUM_MEGA_3D) - #include "pins_BQ_ZUM_MEGA_3D.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_BQ_ZUM_MEGA_3D.h" // ATmega2560 env:megaatmega2560 #elif MB(MAKEBOARD_MINI) - #include "pins_MAKEBOARD_MINI.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_MAKEBOARD_MINI.h" // ATmega2560 env:megaatmega2560 #elif MB(TRIGORILLA_13) - #include "pins_TRIGORILLA_13.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_TRIGORILLA_13.h" // ATmega2560 env:megaatmega2560 #elif MB(TRIGORILLA_14) - #include "pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 #elif MB(TRIGORILLA_14_11) - #include "pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 #elif MB(RAMPS_ENDER_4) - #include "pins_RAMPS_ENDER_4.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_RAMPS_ENDER_4.h" // ATmega2560 env:megaatmega2560 #elif MB(RAMPS_CREALITY) - #include "pins_RAMPS_CREALITY.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_RAMPS_CREALITY.h" // ATmega2560 env:megaatmega2560 #elif MB(RAMPS_DAGOMA) - #include "pins_RAMPS_DAGOMA.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_RAMPS_DAGOMA.h" // ATmega2560 env:megaatmega2560 #elif MB(FYSETC_F6_13) - #include "pins_FYSETC_F6_13.h" // ATmega2560 env:fysetc_f6_13 + #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6_13 #elif MB(DUPLICATOR_I3_PLUS) - #include "pins_DUPLICATOR_I3_PLUS.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_DUPLICATOR_I3_PLUS.h" // ATmega2560 env:megaatmega2560 #elif MB(VORON) - #include "pins_VORON.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_VORON.h" // ATmega2560 env:megaatmega2560 #elif MB(TRONXY_V3_1_0) - #include "pins_TRONXY_V3_1_0.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_TRONXY_V3_1_0.h" // ATmega2560 env:megaatmega2560 #elif MB(Z_BOLT_X_SERIES) - #include "pins_Z_BOLT_X_SERIES.h" // ATmega2560 env:megaatmega2560 + #include "ramps/pins_Z_BOLT_X_SERIES.h" // ATmega2560 env:megaatmega2560 +#elif MB(TT_OSCAR) + #include "ramps/pins_TT_OSCAR.h" // ATmega2560 env:megaatmega2560 +#elif MB(TANGO) + #include "ramps/pins_TANGO.h" // ATmega2560 env:megaatmega2560 +#elif MB(MKS_GEN_L_V2) + #include "ramps/pins_MKS_GEN_L_V2.h" // ATmega2560 env:megaatmega2560 + + +// +// RAMBo and derivatives +// + +#elif MB(RAMBO) + #include "rambo/pins_RAMBO.h" // ATmega2560 env:rambo +#elif MB(MINIRAMBO, MINIRAMBO_10A) + #include "rambo/pins_MINIRAMBO.h" // ATmega2560 env:rambo +#elif MB(EINSY_RAMBO) + #include "rambo/pins_EINSY_RAMBO.h" // ATmega2560 env:rambo +#elif MB(EINSY_RETRO) + #include "rambo/pins_EINSY_RETRO.h" // ATmega2560 env:rambo +#elif MB(SCOOVO_X9H) + #include "rambo/pins_SCOOVO_X9H.h" // ATmega2560 env:rambo // // Other ATmega1280, ATmega2560 // #elif MB(CNCONTROLS_11) - #include "pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "mega/pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(CNCONTROLS_12) - #include "pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "mega/pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 +#elif MB(CNCONTROLS_15) + #include "mega/pins_CNCONTROLS_15.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(MIGHTYBOARD_REVE) - #include "pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "mega/pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(CHEAPTRONIC) - #include "pins_CHEAPTRONIC.h" // ATmega2560 env:megaatmega2560 + #include "mega/pins_CHEAPTRONIC.h" // ATmega2560 env:megaatmega2560 #elif MB(CHEAPTRONIC_V2) - #include "pins_CHEAPTRONICv2.h" // ATmega2560 env:megaatmega2560 + #include "mega/pins_CHEAPTRONICv2.h" // ATmega2560 env:megaatmega2560 #elif MB(MEGATRONICS) - #include "pins_MEGATRONICS.h" // ATmega2560 env:megaatmega2560 + #include "mega/pins_MEGATRONICS.h" // ATmega2560 env:megaatmega2560 #elif MB(MEGATRONICS_2) - #include "pins_MEGATRONICS_2.h" // ATmega2560 env:megaatmega2560 -#elif MB(MEGATRONICS_3) || MB(MEGATRONICS_31) || MB(MEGATRONICS_32) - #include "pins_MEGATRONICS_3.h" // ATmega2560 env:megaatmega2560 -#elif MB(RAMBO) - #include "pins_RAMBO.h" // ATmega2560 env:rambo -#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 "mega/pins_MEGATRONICS_2.h" // ATmega2560 env:megaatmega2560 +#elif MB(MEGATRONICS_3, MEGATRONICS_31, MEGATRONICS_32) + #include "mega/pins_MEGATRONICS_3.h" // ATmega2560 env:megaatmega2560 #elif MB(ELEFU_3) - #include "pins_ELEFU_3.h" // ATmega2560 env:megaatmega2560 + #include "mega/pins_ELEFU_3.h" // ATmega2560 env:megaatmega2560 #elif MB(LEAPFROG) - #include "pins_LEAPFROG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "mega/pins_LEAPFROG.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(MEGACONTROLLER) - #include "pins_MEGACONTROLLER.h" // ATmega2560 env:megaatmega2560 -#elif MB(SCOOVO_X9H) - #include "pins_SCOOVO_X9H.h" // ATmega2560 env:rambo + #include "mega/pins_MEGACONTROLLER.h" // ATmega2560 env:megaatmega2560 #elif MB(GT2560_REV_A) - #include "pins_GT2560_REV_A.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "mega/pins_GT2560_REV_A.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(GT2560_REV_A_PLUS) - #include "pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "mega/pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 #elif MB(GT2560_V3) - #include "pins_GT2560_V3.h" // ATmega2560 env:megaatmega2560 + #include "mega/pins_GT2560_V3.h" // ATmega2560 env:megaatmega2560 #elif MB(GT2560_V3_MC2) - #include "pins_GT2560_V3_MC2.h" // ATmega2560 env:megaatmega2560 + #include "mega/pins_GT2560_V3_MC2.h" // ATmega2560 env:megaatmega2560 #elif MB(GT2560_V3_A20) - #include "pins_GT2560_V3_A20.h" // ATmega2560 env:megaatmega2560 + #include "mega/pins_GT2560_V3_A20.h" // ATmega2560 env:megaatmega2560 #elif MB(EINSTART_S) - #include "pins_EINSTART-S.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 + #include "mega/pins_EINSTART-S.h" // ATmega1280, ATmega2560 env:megaatmega1280 env:megaatmega2560 +#elif MB(WANHAO_ONEPLUS) + #include "mega/pins_WANHAO_ONEPLUS.h" // ATmega2560 env:megaatmega2560 +#elif MB(OVERLORD) + #include "mega/pins_OVERLORD.h" // ATmega2560 env:megaatmega2560 +#elif MB(HJC2560C_REV2) + #include "mega/pins_HJC2560C_REV2.h" // ATmega2560 env:megaatmega2560 // // ATmega1281, ATmega2561 // #elif MB(MINITRONICS) - #include "pins_MINITRONICS.h" // ATmega1281 env:megaatmega1280 + #include "mega/pins_MINITRONICS.h" // ATmega1281 env:megaatmega1280 #elif MB(SILVER_GATE) - #include "pins_SILVER_GATE.h" // ATmega2561 env:megaatmega2560 + #include "mega/pins_SILVER_GATE.h" // ATmega2561 env:megaatmega2560 // // Sanguinololu and Derivatives - ATmega644P, ATmega1284P // #elif MB(SANGUINOLOLU_11) - #include "pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(SANGUINOLOLU_12) - #include "pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(MELZI) - #include "pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_MELZI.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(MELZI_MAKR3D) - #include "pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(MELZI_CREALITY) - #include "pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/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 + #include "sanguino/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 "sanguino/pins_MELZI_TRONXY.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(STB_11) - #include "pins_STB_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_STB_11.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(AZTEEG_X1) - #include "pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p // // Other ATmega644P, ATmega644, ATmega1284P // #elif MB(GEN3_MONOLITHIC) - #include "pins_GEN3_MONOLITHIC.h" // ATmega644P env:sanguino_atmega644p + #include "sanguino/pins_GEN3_MONOLITHIC.h" // ATmega644P env:sanguino_atmega644p #elif MB(GEN3_PLUS) - #include "pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(GEN6) - #include "pins_GEN6.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_GEN6.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(GEN6_DELUXE) - #include "pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(GEN7_CUSTOM) - #include "pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(GEN7_12) - #include "pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(GEN7_13) - #include "pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(GEN7_14) - #include "pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p #elif MB(OMCA_A) - #include "pins_OMCA_A.h" // ATmega644 env:sanguino_atmega644p + #include "sanguino/pins_OMCA_A.h" // ATmega644 env:sanguino_atmega644p #elif MB(OMCA) - #include "pins_OMCA.h" // ATmega644P, ATmega644 env:sanguino_atmega644p + #include "sanguino/pins_OMCA.h" // ATmega644P, ATmega644 env:sanguino_atmega644p #elif MB(ANET_10) - #include "pins_ANET_10.h" // ATmega1284P env:sanguino_atmega1284p + #include "sanguino/pins_ANET_10.h" // ATmega1284P env:sanguino_atmega1284p #elif MB(SETHI) - #include "pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p + #include "sanguino/pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P env:sanguino_atmega644p env:sanguino_atmega1284p // // Teensyduino - AT90USB1286, AT90USB1286P // #elif MB(TEENSYLU) - #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P env:at90usb1286_cdc + #include "teensy2/pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P env:at90usb1286_cdc #elif MB(PRINTRBOARD) - #include "pins_PRINTRBOARD.h" // AT90USB1286 env:at90usb1286_dfu + #include "teensy2/pins_PRINTRBOARD.h" // AT90USB1286 env:at90usb1286_dfu #elif MB(PRINTRBOARD_REVF) - #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286 env:at90usb1286_dfu + #include "teensy2/pins_PRINTRBOARD_REVF.h" // AT90USB1286 env:at90usb1286_dfu #elif MB(BRAINWAVE) - #include "pins_BRAINWAVE.h" // AT90USB646 env:at90usb1286_cdc + #include "teensy2/pins_BRAINWAVE.h" // AT90USB646 env:at90usb1286_cdc #elif MB(BRAINWAVE_PRO) - #include "pins_BRAINWAVE_PRO.h" // AT90USB1286 env:at90usb1286_cdc + #include "teensy2/pins_BRAINWAVE_PRO.h" // AT90USB1286 env:at90usb1286_cdc #elif MB(SAV_MKI) - #include "pins_SAV_MKI.h" // AT90USB1286 env:at90usb1286_cdc + #include "teensy2/pins_SAV_MKI.h" // AT90USB1286 env:at90usb1286_cdc #elif MB(TEENSY2) - #include "pins_TEENSY2.h" // AT90USB1286 env:teensy20 + #include "teensy2/pins_TEENSY2.h" // AT90USB1286 env:teensy20 #elif MB(5DPRINT) - #include "pins_5DPRINT.h" // AT90USB1286 env:at90usb1286_dfu + #include "teensy2/pins_5DPRINT.h" // AT90USB1286 env:at90usb1286_dfu // // LPC1768 ARM Cortex M3 // #elif MB(RAMPS_14_RE_ARM_EFB) - #include "pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 + #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 #elif MB(RAMPS_14_RE_ARM_EEB) - #include "pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 + #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 #elif MB(RAMPS_14_RE_ARM_EFF) - #include "pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 + #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 #elif MB(RAMPS_14_RE_ARM_EEF) - #include "pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 + #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 #elif MB(RAMPS_14_RE_ARM_SF) - #include "pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 + #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 #elif MB(MKS_SBASE) - #include "pins_MKS_SBASE.h" // LPC1768 env:LPC1768 -#elif MB(MKS_SGEN) - #include "pins_MKS_SGEN.h" // LPC1769 env:LPC1769 + #include "lpc1768/pins_MKS_SBASE.h" // LPC1768 env:LPC1768 #elif MB(MKS_SGEN_L) - #include "pins_MKS_SGEN_L.h" // LPC1768 env:LPC1768 + #include "lpc1768/pins_MKS_SGEN_L.h" // LPC1768 env:LPC1768 #elif MB(AZSMZ_MINI) - #include "pins_AZSMZ_MINI.h" // LPC1768 env:LPC1768 + #include "lpc1768/pins_AZSMZ_MINI.h" // LPC1768 env:LPC1768 +#elif MB(BIQU_BQ111_A4) + #include "lpc1768/pins_BIQU_BQ111_A4.h" // LPC1768 env:LPC1768 +#elif MB(SELENA_COMPACT) + #include "lpc1768/pins_SELENA_COMPACT.h" // LPC1768 env:LPC1768 +#elif MB(BIGTREE_SKR_V1_1) + #include "lpc1768/pins_BTT_SKR_V1_1.h" // LPC1768 env:LPC1768 +#elif MB(BIQU_B300_V1_0) + #include "lpc1768/pins_BIQU_B300_V1.0.h" // LPC1768 env:LPC1768 +#elif MB(BIGTREE_SKR_V1_3) + #include "lpc1768/pins_BTT_SKR_V1_3.h" // LPC1768 env:LPC1768 +#elif MB(GMARSH_X6_REV1) + #include "lpc1768/pins_GMARSH_X6_REV1.h" // LPC1768 env:LPC1768 + +// +// LPC1769 ARM Cortex M3 +// + +#elif MB(MKS_SGEN) + #include "lpc1769/pins_MKS_SGEN.h" // LPC1769 env:LPC1769 #elif MB(AZTEEG_X5_GT) - #include "pins_AZTEEG_X5_GT.h" // LPC1769 env:LPC1769 + #include "lpc1769/pins_AZTEEG_X5_GT.h" // LPC1769 env:LPC1769 #elif MB(AZTEEG_X5_MINI) - #include "pins_AZTEEG_X5_MINI.h" // LPC1769 env:LPC1769 + #include "lpc1769/pins_AZTEEG_X5_MINI.h" // LPC1769 env:LPC1769 #elif MB(AZTEEG_X5_MINI_WIFI) - #include "pins_AZTEEG_X5_MINI_WIFI.h" // LPC1769 env:LPC1769 -#elif MB(BIQU_BQ111_A4) - #include "pins_BIQU_BQ111_A4.h" // LPC1768 env:LPC1768 -#elif MB(SELENA_COMPACT) - #include "pins_SELENA_COMPACT.h" // LPC1768 env:LPC1768 + #include "lpc1769/pins_AZTEEG_X5_MINI_WIFI.h" // LPC1769 env:LPC1769 #elif MB(COHESION3D_REMIX) - #include "pins_COHESION3D_REMIX.h" // LPC1769 env:LPC1769 + #include "lpc1769/pins_COHESION3D_REMIX.h" // LPC1769 env:LPC1769 #elif MB(COHESION3D_MINI) - #include "pins_COHESION3D_MINI.h" // LPC1769 env:LPC1769 + #include "lpc1769/pins_COHESION3D_MINI.h" // LPC1769 env:LPC1769 #elif MB(SMOOTHIEBOARD) - #include "pins_SMOOTHIEBOARD.h" // LPC1769 env:LPC1769 -#elif MB(BIQU_SKR_V1_1) - #include "pins_BIQU_SKR_V1.1.h" // LPC1768 env:LPC1768 -#elif MB(BIQU_B300_V1_0) - #include "pins_BIQU_B300_V1.0.h" // LPC1768 env:LPC1768 -#elif MB(BIGTREE_SKR_V1_3) - #include "pins_BIGTREE_SKR_V1.3.h" // LPC1768 env:LPC1768 + #include "lpc1769/pins_SMOOTHIEBOARD.h" // LPC1769 env:LPC1769 #elif MB(TH3D_EZBOARD) - #include "pins_TH3D_EZBOARD.h" // LPC1768 env:LPC1768 + #include "lpc1769/pins_TH3D_EZBOARD.h" // LPC1769 env:LPC1769 // -// Other 32-bit Boards +// Due (ATSAM) boards // #elif MB(DUE3DOM) - #include "pins_DUE3DOM.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_DUE3DOM.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(DUE3DOM_MINI) - #include "pins_DUE3DOM_MINI.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_DUE3DOM_MINI.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RADDS) - #include "pins_RADDS.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RADDS.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RURAMPS4D_11) - #include "pins_RURAMPS4D_11.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RURAMPS4D_11.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RURAMPS4D_13) - #include "pins_RURAMPS4D_13.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RURAMPS4D_13.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_FD_V1) - #include "pins_RAMPS_FD_V1.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_FD_V1.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_FD_V2) - #include "pins_RAMPS_FD_V2.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_FD_V2.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_SMART_EFB) - #include "pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_SMART_EEB) - #include "pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_SMART_EFF) - #include "pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_SMART_EEF) - #include "pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_SMART_SF) - #include "pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_DUO_EFB) - #include "pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_DUO_EEB) - #include "pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_DUO_EFF) - #include "pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_DUO_EEF) - #include "pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS_DUO_SF) - #include "pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS4DUE_EFB) - #include "pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS4DUE_EEB) - #include "pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS4DUE_EFF) - #include "pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS4DUE_EEF) - #include "pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(RAMPS4DUE_SF) - #include "pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug + #include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(ULTRATRONICS_PRO) - #include "pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE env:DUE_debug + #include "sam/pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(ARCHIM1) - #include "pins_ARCHIM1.h" // SAM3X8E env:DUE env:DUE_debug + #include "sam/pins_ARCHIM1.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(ARCHIM2) - #include "pins_ARCHIM2.h" // SAM3X8E env:DUE env:DUE_debug + #include "sam/pins_ARCHIM2.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(ALLIGATOR) - #include "pins_ALLIGATOR_R2.h" // SAM3X8E env:DUE env:DUE_debug + #include "sam/pins_ALLIGATOR_R2.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(ADSK) - #include "pins_ADSK.h" // SAM3X8E env:DUE env:DUE_debug + #include "sam/pins_ADSK.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(PRINTRBOARD_G2) - #include "pins_PRINTRBOARD_G2.h" // SAM3X8C env:DUE_USB + #include "sam/pins_PRINTRBOARD_G2.h" // SAM3X8C env:DUE_USB // // STM32 ARM Cortex-M3 // -#elif MB(STM32F1R) - #include "pins_STM32F1R.h" // STM32F1 env:STM32F1 -#elif MB(STM3R_MINI) - #include "pins_STM3R_MINI.h" // STM32F1 env:STM32F1 -#elif MB(BIGTREE_SKR_MINI_V1_1) - #include "pins_BIGTREE_SKR_MINI_V1_1.h" // STM32F1 env:BIGTREE_SKR_MINI -#elif MB(BIGTREE_SKR_MINI_E3) - #include "pins_BIGTREE_SKR_MINI_E3.h" // STM32F1 env:BIGTREE_SKR_MINI +#elif MB(STM32F103RE) + #include "stm32/pins_STM32F1R.h" // STM32F1 env:STM32F103RE #elif MB(MALYAN_M200) - #include "pins_MALYAN_M200.h" // STM32F1 env:malyanm200 -#elif MB(CHITU3D) - #include "pins_CHITU3D.h" // STM32F1 env:STM32F1 + #include "stm32/pins_MALYAN_M200.h" // STM32F1 env:STM32F103CB_malyan +#elif MB(STM3R_MINI) + #include "stm32/pins_STM3R_MINI.h" // STM32F1 env:STM32F103RE #elif MB(GTM32_PRO_VB) - #include "pins_GTM32_PRO_VB.h" // STM32F1 env:STM32F1 + #include "stm32/pins_GTM32_PRO_VB.h" // STM32F1 env:STM32F103RE +#elif MB(GTM32_MINI_A30) + #include "stm32/pins_GTM32_MINI_A30.h" // STM32F1 env:STM32F103RE +#elif MB(GTM32_MINI) + #include "stm32/pins_GTM32_MINI.h" // STM32F1 env:STM32F103RE +#elif MB(GTM32_REV_B) + #include "stm32/pins_GTM32_REV_B.h" // STM32F1 env:STM32F103RE #elif MB(MORPHEUS) - #include "pins_MORPHEUS.h" // STM32F1 env:STM32F1 + #include "stm32/pins_MORPHEUS.h" // STM32F1 env:STM32F103RE +#elif MB(CHITU3D) + #include "stm32/pins_CHITU3D.h" // STM32F1 env:STM32F103RE #elif MB(MKS_ROBIN) - #include "pins_MKS_ROBIN.h" // STM32F1 env:mks_robin + #include "stm32/pins_MKS_ROBIN.h" // STM32F1 env:mks_robin #elif MB(MKS_ROBIN_MINI) - #include "pins_MKS_ROBIN_MINI.h" // STM32F1 env:mks_robin_mini + #include "stm32/pins_MKS_ROBIN_MINI.h" // STM32F1 env:mks_robin_mini #elif MB(MKS_ROBIN_NANO) - #include "pins_MKS_ROBIN_NANO.h" // STM32F1 env:mks_robin_nano + #include "stm32/pins_MKS_ROBIN_NANO.h" // STM32F1 env:mks_robin_nano +#elif MB(MKS_ROBIN_LITE) + #include "stm32/pins_MKS_ROBIN_LITE.h" // STM32F1 env:mks_robin_lite +#elif MB(BIGTREE_SKR_MINI_V1_1) + #include "stm32/pins_BTT_SKR_MINI_V1_1.h" // STM32F1 env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_USB env:STM32F103RC_bigtree_512K_USB +#elif MB(BTT_SKR_MINI_E3_V1_0) + #include "stm32/pins_BTT_SKR_MINI_E3_V1_0.h" // STM32F1 env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_USB env:STM32F103RC_bigtree_512K_USB +#elif MB(BTT_SKR_MINI_E3_V1_2) + #include "stm32/pins_BTT_SKR_MINI_E3_V1_2.h" // STM32F1 env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_USB env:STM32F103RC_bigtree_512K_USB +#elif MB(BIGTREE_SKR_E3_DIP) + #include "stm32/pins_BTT_SKR_E3_DIP.h" // STM32F1 env:STM32F103RE_bigtree env:STM32F103RE_bigtree_USB env:STM32F103RC_bigtree env:STM32F103RC_bigtree_512K env:STM32F103RC_bigtree_USB env:STM32F103RC_bigtree_512K_USB #elif MB(JGAURORA_A5S_A1) - #include "pins_JGAURORA_A5S_A1.h" // STM32F1 env:JGAURORA_A5S_A1 + #include "stm32/pins_JGAURORA_A5S_A1.h" // STM32F1 env:jgaurora_a5s_a1 #elif MB(FYSETC_AIO_II) - #include "pins_FYSETC_AIO_II.h" // STM32F1 env:fysetc_STM32F1 + #include "stm32/pins_FYSETC_AIO_II.h" // STM32F1 env:STM32F103RC_fysetc #elif MB(FYSETC_CHEETAH) - #include "pins_FYSETC_CHEETAH.h" // STM32F1 env:fysetc_STM32F1 + #include "stm32/pins_FYSETC_CHEETAH.h" // STM32F1 env:STM32F103RC_fysetc +#elif MB(FYSETC_CHEETAH_V12) + #include "stm32/pins_FYSETC_CHEETAH_V12.h" // STM32F1 env:STM32F103RC_fysetc +#elif MB(LONGER3D_LK) + #include "stm32/pins_LONGER3D_LK.h" // STM32F1 env:STM32F103VE_longer +#elif MB(MKS_ROBIN_LITE3) + #include "stm32/pins_MKS_ROBIN_LITE3.h" // STM32F1 env:mks_robin_lite3 +#elif MB(MKS_ROBIN_PRO) + #include "stm32/pins_MKS_ROBIN_PRO.h" // STM32F1 env:mks_robin_pro // -// STM32 ARM Cortex-M4F +// ARM Cortex-M4F // #elif MB(TEENSY31_32) - #include "pins_TEENSY31_32.h" // TEENSY31_32 env:teensy31 + #include "teensy3/pins_TEENSY31_32.h" // TEENSY31_32 env:teensy31 #elif MB(TEENSY35_36) - #include "pins_TEENSY35_36.h" // TEENSY35_36 env:teensy35 + #include "teensy3/pins_TEENSY35_36.h" // TEENSY35_36 env:teensy35 + +// +// STM32 ARM Cortex-M4F +// + #elif MB(BEAST) - #include "pins_BEAST.h" // STM32F4 env:STM32F4 -#elif MB(STM32F4) - #include "pins_STM32F4.h" // STM32F4 env:STM32F4 + #include "stm32/pins_BEAST.h" // STM32F4 env:STM32F4 +#elif MB(GENERIC_STM32F4) + #include "stm32/pins_GENERIC_STM32F4.h" // STM32F4 env:STM32F4 #elif MB(ARMED) - #include "pins_ARMED.h" // STM32F4 env:ARMED + #include "stm32/pins_ARMED.h" // STM32F4 env:ARMED #elif MB(RUMBA32) - #include "pins_RUMBA32.h" // STM32F4 env:RUMBA32 + #include "stm32/pins_RUMBA32.h" // STM32F4 env:RUMBA32 #elif MB(BLACK_STM32F407VE) - #include "pins_BLACK_STM32F407VE.h" // STM32F4 env:black_stm32f407ve + #include "stm32/pins_BLACK_STM32F407VE.h" // STM32F4 env:STM32F407VE_black #elif MB(STEVAL) - #include "pins_STEVAL.h" // STM32F4 env:STM32F4 - + #include "stm32/pins_STEVAL.h" // STM32F4 env:STM32F4 +#elif MB(BIGTREE_SKR_PRO_V1_1) + #include "stm32/pins_BTT_SKR_PRO_V1_1.h" // STM32F4 env:BIGTREE_SKR_PRO +#elif MB(BIGTREE_BTT002_V1_0) + #include "stm32/pins_BTT_BTT002_V1_0.h" // STM32F4 env:BIGTREE_BTT002 +#elif MB(LERDGE_K) + #include "stm32/pins_LERDGE_K.h" // STM32F4 env:STM32F4 +#elif MB(LERDGE_X) + #include "stm32/pins_LERDGE_X.h" // STM32F4 env:STM32F4 +#elif MB(VAKE403D) + #include "stm32/pins_VAKE403D.h" // STM32F4 env:STM32F4 +#elif MB(FYSETC_S6) + #include "stm32/pins_FYSETC_S6.h" // STM32F4 env:FYSETC_S6 // // ARM Cortex M7 // #elif MB(THE_BORG) - #include "pins_THE_BORG.h" // STM32F7 env:STM32F7 + #include "stm32/pins_THE_BORG.h" // STM32F7 env:STM32F7 #elif MB(REMRAM_V1) - #include "pins_REMRAM_V1.h" // STM32F7 env:STM32F7xx + #include "stm32/pins_REMRAM_V1.h" // STM32F7 env:STM32F7 // // Espressif ESP32 // -#elif MB(ESP32) - #include "pins_ESP32.h" // ESP32 env:esp32 +#elif MB(ESPRESSIF_ESP32) + + #include "esp32/pins_ESP32.h" // ESP32 env:esp32 // // Linux Native Debug board // #elif MB(LINUX_RAMPS) - #include "pins_RAMPS_LINUX.h" // Linux env:linux_native + #include "linux/pins_RAMPS_LINUX.h" // Linux env:linux_native #else #error "Unknown MOTHERBOARD value set in Configuration.h" @@ -732,8 +800,8 @@ #ifndef SD_DETECT_PIN #define SD_DETECT_PIN -1 #endif -#ifndef SDPOWER - #define SDPOWER -1 +#ifndef SDPOWER_PIN + #define SDPOWER_PIN -1 #endif #ifndef SDSS #define SDSS -1 @@ -751,6 +819,9 @@ #ifndef SUICIDE_PIN #define SUICIDE_PIN -1 #endif +#ifndef SUICIDE_PIN_INVERTING + #define SUICIDE_PIN_INVERTING false +#endif #ifndef NUM_SERVO_PLUGS #define NUM_SERVO_PLUGS 4 @@ -857,7 +928,7 @@ // // Disable unused endstop / probe pins // -#if !USES_Z_MIN_PROBE_ENDSTOP +#if !HAS_CUSTOM_PROBE_PIN #undef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN -1 #endif @@ -896,7 +967,7 @@ #define LCD_PINS_D4 -1 #endif -#if HAS_CHARACTER_LCD +#if HAS_CHARACTER_LCD || TOUCH_UI_ULTIPANEL #ifndef LCD_PINS_D5 #define LCD_PINS_D5 -1 #endif @@ -906,10 +977,6 @@ #ifndef LCD_PINS_D7 #define LCD_PINS_D7 -1 #endif -#else - #undef LCD_PINS_D5 - #undef LCD_PINS_D6 - #undef LCD_PINS_D7 #endif /** @@ -933,9 +1000,6 @@ #error "No E stepper plug left for X2!" #endif #endif - #ifndef X2_CS_PIN - #define X2_CS_PIN _EPIN(E_STEPPERS, CS) - #endif #ifndef X2_MS1_PIN #define X2_MS1_PIN _EPIN(E_STEPPERS, MS1) #endif @@ -945,11 +1009,35 @@ #ifndef X2_MS3_PIN #define X2_MS3_PIN _EPIN(E_STEPPERS, MS3) #endif + #if AXIS_HAS_SPI(X2) && !defined(X2_CS_PIN) + #define X2_CS_PIN _EPIN(E_STEPPERS, CS) + #endif + #if AXIS_HAS_UART(X2) + #ifndef X2_SERIAL_TX_PIN + #define X2_SERIAL_TX_PIN _EPIN(E_STEPPERS, SERIAL_TX) + #endif + #ifndef X2_SERIAL_RX_PIN + #define X2_SERIAL_RX_PIN _EPIN(E_STEPPERS, SERIAL_RX) + #endif + #endif #define Y2_E_INDEX INCREMENT(E_STEPPERS) #else #define Y2_E_INDEX E_STEPPERS #endif +#ifndef X2_CS_PIN + #define X2_CS_PIN -1 +#endif +#ifndef X2_MS1_PIN + #define X2_MS1_PIN -1 +#endif +#ifndef X2_MS2_PIN + #define X2_MS2_PIN -1 +#endif +#ifndef X2_MS3_PIN + #define X2_MS3_PIN -1 +#endif + // The Y2 axis, if any, should be the next open extruder port #if ENABLED(Y_DUAL_STEPPER_DRIVERS) #ifndef Y2_STEP_PIN @@ -960,9 +1048,6 @@ #error "No E stepper plug left for Y2!" #endif #endif - #ifndef Y2_CS_PIN - #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) - #endif #ifndef Y2_MS1_PIN #define Y2_MS1_PIN _EPIN(Y2_E_INDEX, MS1) #endif @@ -972,11 +1057,35 @@ #ifndef Y2_MS3_PIN #define Y2_MS3_PIN _EPIN(Y2_E_INDEX, MS3) #endif + #if AXIS_HAS_SPI(Y2) && !defined(Y2_CS_PIN) + #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) + #endif + #if AXIS_HAS_UART(Y2) + #ifndef Y2_SERIAL_TX_PIN + #define Y2_SERIAL_TX_PIN _EPIN(Y2_E_INDEX, SERIAL_TX) + #endif + #ifndef Y2_SERIAL_RX_PIN + #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX) + #endif + #endif #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) #else #define Z2_E_INDEX Y2_E_INDEX #endif +#ifndef Y2_CS_PIN + #define Y2_CS_PIN -1 +#endif +#ifndef Y2_MS1_PIN + #define Y2_MS1_PIN -1 +#endif +#ifndef Y2_MS2_PIN + #define Y2_MS2_PIN -1 +#endif +#ifndef Y2_MS3_PIN + #define Y2_MS3_PIN -1 +#endif + // The Z2 axis, if any, should be the next open extruder port #if Z_MULTI_STEPPER_DRIVERS #ifndef Z2_STEP_PIN @@ -987,9 +1096,6 @@ #error "No E stepper plug left for Z2!" #endif #endif - #ifndef Z2_CS_PIN - #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) - #endif #ifndef Z2_MS1_PIN #define Z2_MS1_PIN _EPIN(Z2_E_INDEX, MS1) #endif @@ -999,11 +1105,35 @@ #ifndef Z2_MS3_PIN #define Z2_MS3_PIN _EPIN(Z2_E_INDEX, MS3) #endif + #if AXIS_HAS_SPI(Z2) && !defined(Z2_CS_PIN) + #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) + #endif + #if AXIS_HAS_UART(Z2) + #ifndef Z2_SERIAL_TX_PIN + #define Z2_SERIAL_TX_PIN _EPIN(Z2_E_INDEX, SERIAL_TX) + #endif + #ifndef Z2_SERIAL_RX_PIN + #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX) + #endif + #endif #define Z3_E_INDEX INCREMENT(Z2_E_INDEX) #else #define Z3_E_INDEX Z2_E_INDEX #endif +#ifndef Z2_CS_PIN + #define Z2_CS_PIN -1 +#endif +#ifndef Z2_MS1_PIN + #define Z2_MS1_PIN -1 +#endif +#ifndef Z2_MS2_PIN + #define Z2_MS2_PIN -1 +#endif +#ifndef Z2_MS3_PIN + #define Z2_MS3_PIN -1 +#endif + #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) #ifndef Z3_STEP_PIN #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) @@ -1013,8 +1143,10 @@ #error "No E stepper plug left for Z3!" #endif #endif - #ifndef Z3_CS_PIN - #define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS) + #if AXIS_HAS_SPI(Z3) + #ifndef Z3_CS_PIN + #define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS) + #endif #endif #ifndef Z3_MS1_PIN #define Z3_MS1_PIN _EPIN(Z3_E_INDEX, MS1) @@ -1025,4 +1157,43 @@ #ifndef Z3_MS3_PIN #define Z3_MS3_PIN _EPIN(Z3_E_INDEX, MS3) #endif + #if AXIS_HAS_UART(Z3) + #ifndef Z3_SERIAL_TX_PIN + #define Z3_SERIAL_TX_PIN _EPIN(Z3_E_INDEX, SERIAL_TX) + #endif + #ifndef Z3_SERIAL_RX_PIN + #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX) + #endif + #endif #endif + +#ifndef Z3_CS_PIN + #define Z3_CS_PIN -1 +#endif +#ifndef Z3_MS1_PIN + #define Z3_MS1_PIN -1 +#endif +#ifndef Z3_MS2_PIN + #define Z3_MS2_PIN -1 +#endif +#ifndef Z3_MS3_PIN + #define Z3_MS3_PIN -1 +#endif + +#if HAS_GRAPHICAL_LCD + #if !defined(ST7920_DELAY_1) && defined(BOARD_ST7920_DELAY_1) + #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 + #endif + #if !defined(ST7920_DELAY_2) && defined(BOARD_ST7920_DELAY_2) + #define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 + #endif + #if !defined(ST7920_DELAY_3) && defined(BOARD_ST7920_DELAY_3) + #define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 + #endif +#else + #undef ST7920_DELAY_1 + #undef ST7920_DELAY_2 + #undef ST7920_DELAY_3 +#endif + +#undef HAS_FREE_AUX2_PINS diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index 37a2e868122a..23a1abe8b773 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -17,6 +17,8 @@ * */ +#include "../inc/MarlinConfig.h" + #define MAX_NAME_LENGTH 39 // one place to specify the format of all the sources of names // "-" left justify, "39" minimum width of name, pad with blanks @@ -40,7 +42,7 @@ #define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER) #include "pinsDebug_list.h" -#line 47 +#line 46 // manually add pins that have names that are macros which don't play well with these macros #if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY || defined(ARDUINO_ARCH_SAM)) @@ -92,11 +94,10 @@ const PinInfo pin_array[] PROGMEM = { #endif #include "pinsDebug_list.h" - #line 99 + #line 98 }; - #include HAL_PATH(../HAL, pinsDebug.h) // get the correct support file for this CPU #ifndef M43_NEVER_TOUCH @@ -116,12 +117,12 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa if (GET_ARRAY_PIN(x) == pin) { if (found) multi_name_pin = true; found = true; - if (!multi_name_pin) { // report digitial and analog pin number only on the first time through + if (!multi_name_pin) { // report digital and analog pin number only on the first time through sprintf_P(buffer, PSTR("%sPIN: "), start_string); // digital pin number SERIAL_ECHO(buffer); PRINT_PIN(pin); PRINT_PORT(pin); - if (IS_ANALOG(pin)) { + if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) { sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); // analog pin number SERIAL_ECHO(buffer); } @@ -158,7 +159,7 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa if (!GET_PINMODE(pin)) { //pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - stopped doing this // because this could interfere with inductive/capacitive - // sensors (high impedance voltage divider) and with PT100 amplifier + // sensors (high impedance voltage divider) and with Pt100 amplifier print_input_or_output(false); SERIAL_ECHO(digitalRead_mod(pin)); } @@ -183,7 +184,7 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa SERIAL_ECHO(buffer); PRINT_PIN(pin); PRINT_PORT(pin); - if (IS_ANALOG(pin)) { + if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) { sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); // analog pin number SERIAL_ECHO(buffer); } @@ -206,7 +207,10 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa else #endif { - if (GET_PINMODE(pin)) { + if (pwm_status(pin)) { + // do nothing + } + else if (GET_PINMODE(pin)) { SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16); print_input_or_output(true); SERIAL_ECHO(digitalRead_mod(pin)); @@ -224,7 +228,10 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa SERIAL_ECHO(digitalRead_mod(pin)); } //if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin - if (extended) pwm_details(pin); // report PWM capabilities only if doing an extended report + if (extended) { + SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16); + pwm_details(pin); // report PWM capabilities only if doing an extended report + } } } SERIAL_EOL(); diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index cf6dcc098f5b..993c23b5c04d 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -24,7 +24,284 @@ // Pin lists 1.1.x and 2.0.x synchronized 2018-02-17 -#line 31 // set __LINE__ to a known value for both passes +#line 28 // set __LINE__ to a known value for both passes + +// Undefine pins to suppress warnings +#if !PIN_EXISTS(X_MS1) + #undef X_MS1_PIN +#endif +#if !PIN_EXISTS(X_MS2) + #undef X_MS2_PIN +#endif +#if !PIN_EXISTS(X_MS3) + #undef X_MS3_PIN +#endif +#if !PIN_EXISTS(X2_MS1) + #undef X2_MS1_PIN +#endif +#if !PIN_EXISTS(X2_MS2) + #undef X2_MS2_PIN +#endif +#if !PIN_EXISTS(X2_MS3) + #undef X2_MS3_PIN +#endif +#if !PIN_EXISTS(Y_MS1) + #undef Y_MS1_PIN +#endif +#if !PIN_EXISTS(Y_MS2) + #undef Y_MS2_PIN +#endif +#if !PIN_EXISTS(Y_MS3) + #undef Y_MS3_PIN +#endif +#if !PIN_EXISTS(Y2_MS1) + #undef Y2_MS1_PIN +#endif +#if !PIN_EXISTS(Y2_MS2) + #undef Y2_MS2_PIN +#endif +#if !PIN_EXISTS(Y2_MS3) + #undef Y2_MS3_PIN +#endif +#if !PIN_EXISTS(Z_MS1) + #undef Z_MS1_PIN +#endif +#if !PIN_EXISTS(Z_MS2) + #undef Z_MS2_PIN +#endif +#if !PIN_EXISTS(Z_MS3) + #undef Z_MS3_PIN +#endif +#if !PIN_EXISTS(Z2_MS1) + #undef Z2_MS1_PIN +#endif +#if !PIN_EXISTS(Z2_MS2) + #undef Z2_MS2_PIN +#endif +#if !PIN_EXISTS(Z2_MS3) + #undef Z2_MS3_PIN +#endif +#if !PIN_EXISTS(Z3_MS1) + #undef Z3_MS1_PIN +#endif +#if !PIN_EXISTS(Z3_MS2) + #undef Z3_MS2_PIN +#endif +#if !PIN_EXISTS(Z3_MS3) + #undef Z3_MS3_PIN +#endif +#if !PIN_EXISTS(E0_MS1) + #undef E0_MS1_PIN +#endif +#if !PIN_EXISTS(E0_MS2) + #undef E0_MS2_PIN +#endif +#if !PIN_EXISTS(E0_MS3) + #undef E0_MS3_PIN +#endif +#if !PIN_EXISTS(E1_MS1) + #undef E1_MS1_PIN +#endif +#if !PIN_EXISTS(E1_MS2) + #undef E1_MS2_PIN +#endif +#if !PIN_EXISTS(E1_MS3) + #undef E1_MS3_PIN +#endif +#if !PIN_EXISTS(E2_MS1) + #undef E2_MS1_PIN +#endif +#if !PIN_EXISTS(E2_MS2) + #undef E2_MS2_PIN +#endif +#if !PIN_EXISTS(E2_MS3) + #undef E2_MS3_PIN +#endif +#if !PIN_EXISTS(E3_MS1) + #undef E3_MS1_PIN +#endif +#if !PIN_EXISTS(E3_MS2) + #undef E3_MS2_PIN +#endif +#if !PIN_EXISTS(E3_MS3) + #undef E3_MS3_PIN +#endif +#if !PIN_EXISTS(E4_MS1) + #undef E4_MS1_PIN +#endif +#if !PIN_EXISTS(E4_MS2) + #undef E4_MS2_PIN +#endif +#if !PIN_EXISTS(E4_MS3) + #undef E4_MS3_PIN +#endif +#if !PIN_EXISTS(E5_MS1) + #undef E5_MS1_PIN +#endif +#if !PIN_EXISTS(E5_MS2) + #undef E5_MS2_PIN +#endif +#if !PIN_EXISTS(E5_MS3) + #undef E5_MS3_PIN +#endif + +#if !PIN_EXISTS(E0_STEP) + #undef E0_STEP_PIN +#endif +#if !PIN_EXISTS(E0_DIR) + #undef E0_DIR_PIN +#endif +#if !PIN_EXISTS(E0_ENABLE) + #undef E0_ENABLE_PIN +#endif +#if !PIN_EXISTS(E1_STEP) + #undef E1_STEP_PIN +#endif +#if !PIN_EXISTS(E1_DIR) + #undef E1_DIR_PIN +#endif +#if !PIN_EXISTS(E1_ENABLE) + #undef E1_ENABLE_PIN +#endif +#if !PIN_EXISTS(E2_STEP) + #undef E2_STEP_PIN +#endif +#if !PIN_EXISTS(E2_DIR) + #undef E2_DIR_PIN +#endif +#if !PIN_EXISTS(E2_ENABLE) + #undef E2_ENABLE_PIN +#endif +#if !PIN_EXISTS(E3_STEP) + #undef E3_STEP_PIN +#endif +#if !PIN_EXISTS(E3_DIR) + #undef E3_DIR_PIN +#endif +#if !PIN_EXISTS(E3_ENABLE) + #undef E3_ENABLE_PIN +#endif +#if !PIN_EXISTS(E4_STEP) + #undef E4_STEP_PIN +#endif +#if !PIN_EXISTS(E4_DIR) + #undef E4_DIR_PIN +#endif +#if !PIN_EXISTS(E4_ENABLE) + #undef E4_ENABLE_PIN +#endif +#if !PIN_EXISTS(E5_STEP) + #undef E5_STEP_PIN +#endif +#if !PIN_EXISTS(E5_DIR) + #undef E5_DIR_PIN +#endif +#if !PIN_EXISTS(E5_ENABLE) + #undef E5_ENABLE_PIN +#endif + +#if !PIN_EXISTS(X_CS) + #undef X_CS_PIN +#endif +#if !PIN_EXISTS(Y_CS) + #undef Y_CS_PIN +#endif +#if !PIN_EXISTS(Z_CS) + #undef Z_CS_PIN +#endif +#if !PIN_EXISTS(E0_CS) + #undef E0_CS_PIN +#endif +#if !PIN_EXISTS(E1_CS) + #undef E1_CS_PIN +#endif +#if !PIN_EXISTS(E2_CS) + #undef E2_CS_PIN +#endif +#if !PIN_EXISTS(E3_CS) + #undef E3_CS_PIN +#endif +#if !PIN_EXISTS(E4_CS) + #undef E4_CS_PIN +#endif +#if !PIN_EXISTS(E5_CS) + #undef E5_CS_PIN +#endif + +#if !PIN_EXISTS(FAN) + #undef FAN_PIN +#endif +#define FAN0_PIN FAN_PIN +#if !PIN_EXISTS(FAN1) + #undef FAN1_PIN +#endif +#if !PIN_EXISTS(FAN2) + #undef FAN2_PIN +#endif +#if !PIN_EXISTS(CONTROLLER_FAN) + #undef CONTROLLER_FAN_PIN +#endif + +#if !PIN_EXISTS(FANMUX0) + #undef FANMUX0_PIN +#endif +#if !PIN_EXISTS(FANMUX1) + #undef FANMUX1_PIN +#endif +#if !PIN_EXISTS(FANMUX2) + #undef FANMUX2_PIN +#endif + +#if !PIN_EXISTS(HEATER_0) + #undef HEATER_0_PIN +#endif +#if !PIN_EXISTS(HEATER_1) + #undef HEATER_1_PIN +#endif +#if !PIN_EXISTS(HEATER_2) + #undef HEATER_2_PIN +#endif +#if !PIN_EXISTS(HEATER_3) + #undef HEATER_3_PIN +#endif +#if !PIN_EXISTS(HEATER_4) + #undef HEATER_4_PIN +#endif +#if !PIN_EXISTS(HEATER_5) + #undef HEATER_5_PIN +#endif +#if !PIN_EXISTS(HEATER_BED) + #undef HEATER_BED_PIN +#endif + +#if !PIN_EXISTS(TEMP_0) + #undef TEMP_0_PIN +#endif +#if !PIN_EXISTS(TEMP_1) + #undef TEMP_1_PIN +#endif +#if !PIN_EXISTS(TEMP_2) + #undef TEMP_2_PIN +#endif +#if !PIN_EXISTS(TEMP_3) + #undef TEMP_3_PIN +#endif +#if !PIN_EXISTS(TEMP_4) + #undef TEMP_4_PIN +#endif +#if !PIN_EXISTS(TEMP_5) + #undef TEMP_5_PIN +#endif +#if !PIN_EXISTS(TEMP_BED) + #undef TEMP_BED_PIN +#endif + +#if !PIN_EXISTS(SD_DETECT) + #undef SD_DETECT_PIN +#endif +#if !PIN_EXISTS(SDPOWER) + #undef SDPOWER_PIN +#endif // // Analog Pin Assignments @@ -51,7 +328,7 @@ #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(ARDUINO_ARCH_SAM) && !defined(ARDUINO_ARCH_SAMD) //TC1 & TC2 are macros in the SAM/SAMD tool chain #if defined(TC1) && TC1 >= 0 && TC1 < NUM_ANALOG_INPUTS REPORT_NAME_ANALOG(__LINE__, TC1) #endif @@ -707,8 +984,8 @@ // #if defined(SDA) && SDA >= 0 // REPORT_NAME_DIGITAL(__LINE__, SDA) // #endif -#if defined(SDPOWER) && SDPOWER >= 0 - REPORT_NAME_DIGITAL(__LINE__, SDPOWER) +#if PIN_EXISTS(SDPOWER) + REPORT_NAME_DIGITAL(__LINE__, SDPOWER_PIN) #endif #if defined(SDSS) && SDSS >= 0 REPORT_NAME_DIGITAL(__LINE__, SDSS) @@ -1160,3 +1437,18 @@ #if PIN_EXISTS(FET_SAFETY) REPORT_NAME_DIGITAL(__LINE__, FET_SAFETY_PIN) #endif +#if PIN_EXISTS(TOUCH_MISO) + REPORT_NAME_DIGITAL(__LINE__, TOUCH_MISO_PIN) +#endif +#if PIN_EXISTS(TOUCH_MOSI) + REPORT_NAME_DIGITAL(__LINE__, TOUCH_MOSI_PIN) +#endif +#if PIN_EXISTS(TOUCH_SCK) + REPORT_NAME_DIGITAL(__LINE__, TOUCH_SCK_PIN) +#endif +#if PIN_EXISTS(TOUCH_CS) + REPORT_NAME_DIGITAL(__LINE__, TOUCH_CS_PIN) +#endif +#if PIN_EXISTS(TOUCH_INT) + REPORT_NAME_DIGITAL(__LINE__, TOUCH_INT_PIN) +#endif diff --git a/Marlin/src/pins/pins_GTM32_PRO_VB.h b/Marlin/src/pins/pins_GTM32_PRO_VB.h deleted file mode 100644 index 87b32bf38a70..000000000000 --- a/Marlin/src/pins/pins_GTM32_PRO_VB.h +++ /dev/null @@ -1,195 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -/** - * 24 May 2018 - @chepo for STM32F103VET6 - * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf - */ - -#ifndef __STM32F1__ - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#define DEFAULT_MACHINE_NAME "STM32F103VET6" -#define BOARD_NAME "GTM32 Pro VB" - -//#define DISABLE_DEBUG -#define DISABLE_JTAG -//#define DISABLE_JTAGSWD - -// Ignore temp readings during development. -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE - -// -// Limit Switches -// -#define X_MIN_PIN PE5 -#define X_MAX_PIN PE4 -#define Y_MIN_PIN PE3 -#define Y_MAX_PIN PE2 -#define Z_MIN_PIN PE1 -#define Z_MAX_PIN PE0 - -// -// Steppers -// -#define X_STEP_PIN PC6 -#define X_DIR_PIN PD13 -#define X_ENABLE_PIN PA8 - -#define Y_STEP_PIN PA12 -#define Y_DIR_PIN PA11 -#define Y_ENABLE_PIN PA15 - -#define Z_STEP_PIN PD6 -#define Z_DIR_PIN PD3 -#define Z_ENABLE_PIN PB3 - -#define E0_STEP_PIN PB2 -#define E0_DIR_PIN PB11 -#define E0_ENABLE_PIN PC4 - -#define E1_STEP_PIN PA0 -#define E1_DIR_PIN PB6 -#define E1_ENABLE_PIN PA1 - -#define E2_STEP_PIN PC14 -#define E2_DIR_PIN PC13 -#define E2_ENABLE_PIN PC15 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PB0 -#define HEATER_1_PIN PB5 -#define HEATER_2_PIN PB4 -#define HEATER_BED_PIN PB1 - -#define FAN_PIN PB7 // TODO: Add functionality -#define FAN1_PIN PB8 // TODO: Add functionality -#define FAN2_PIN PB9 // TODO: Add functionality - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC2 // PORT NUMBERING -#define TEMP_1_PIN PC1 // PORT NUMBERING -#define TEMP_2_PIN PC0 // PORT NUMBERING -#define TEMP_BED_PIN PC3 // PORT NUMBERING - -// -// Misc. Functions -// -#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector -//#define RESET_PIN NRST -#define T_PEN PE6 - -#define BEEPER_PIN PB10 - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE PE14 // SID (MOSI) - #define LCD_PINS_D4 PD8 // SCK (CLK) clock - #define LCD_PINS_D5 PD9 - #define LCD_PINS_D6 PD10 - #define LCD_PINS_D7 PE15 - - #define BTN_EN1 PE8 - #define BTN_EN2 PE9 - #define BTN_ENC PE13 - - #define SD_DETECT_PIN PC7 - #define KILL_PIN -1 - #endif - - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(715) - #endif - - // - // UART LCD Pins, if used - // - //#define LCD_PINS_D14 PD9 // RXD3 - //#define LCD_PINS_D13 PD8 // TXD3 - -#endif // HAS_SPI_LCD - -// -// SPI2 on LCD conn -// -#define SPI2_MOSI PB15 -#define SPI2_MISO PB14 -#define SPI2_SCK PB13 -#define SPI2_NSS PB12 - -// -// SD Card on LCD -// -#define SD_CD PC7 -#define SD_DATA0 PC8 -#define SD_DATA1 PC9 -#define SD_DATA2 PC10 -#define SD_DATA3 PC11 -#define SD_CMD PD2 -#define SD_CLK PC12 - -// -// SPI Flash (on board Card Socket) -// -#define SPI1_NSS PA4 -#define SPI1_SCK PA5 -#define SPI1_MISO PA6 -#define SPI1_MOSI PA7 - -// -// Debug -// -//#define SDA PA13 -//#define SCL PA14 - -// -// Wifi -// -#define USART2_RX PA3 // Default alternate function -#define USART2_TX PA2 // Default alternate function - -// -// For future use -// -//#undef USB_DM -//#undef CAN_TX -//#undef USB_DP -//#undef CAN_RX -//#undef BOARD_JTDI_PIN -//#define BOOT0 BOOT0 diff --git a/Marlin/src/pins/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h similarity index 93% rename from Marlin/src/pins/pins_EINSY_RAMBO.h rename to Marlin/src/pins/rambo/pins_EINSY_RAMBO.h index c40bc079cb27..d667032c9c58 100644 --- a/Marlin/src/pins/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'" #endif -#define BOARD_NAME "Einsy Rambo" +#define BOARD_INFO_NAME "Einsy Rambo" // // TMC2130 Configuration_adv defaults for EinsyRambo @@ -135,8 +135,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_ENA_PIN 18 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 18 // Pullup! #define SPINDLE_DIR_PIN 19 // @@ -149,11 +149,11 @@ // // LCD / Controller // -#if HAS_SPI_LCD +#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL #define KILL_PIN 32 - #if ENABLED(NEWPANEL) + #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL #if ENABLED(CR10_STOCKDISPLAY) #define LCD_PINS_RS 85 @@ -176,5 +176,5 @@ #define BEEPER_PIN 84 // AUX-4 #define SD_DETECT_PIN 15 - #endif // NEWPANEL + #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h similarity index 93% rename from Marlin/src/pins/pins_EINSY_RETRO.h rename to Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 220619147429..9ca51ac86f38 100644 --- a/Marlin/src/pins/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'" #endif -#define BOARD_NAME "Einsy Retro" +#define BOARD_INFO_NAME "Einsy Retro" // // TMC2130 Configuration_adv defaults for EinsyRetro @@ -149,8 +149,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_ENA_PIN 18 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 18 // Pullup! #define SPINDLE_DIR_PIN 19 // @@ -163,11 +163,11 @@ // // LCD / Controller // -#if HAS_SPI_LCD +#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL || ENABLED(TOUCH_UI_FTDI_EVE) #define KILL_PIN 32 - #if ENABLED(NEWPANEL) + #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL || ENABLED(TOUCH_UI_FTDI_EVE) #if ENABLED(CR10_STOCKDISPLAY) #define LCD_PINS_RS 85 @@ -188,7 +188,8 @@ #define BTN_ENC 9 // AUX-2 #define BEEPER_PIN 84 // AUX-4 + #define SD_DETECT_PIN 15 - #endif // NEWPANEL + #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h similarity index 92% rename from Marlin/src/pins/pins_MINIRAMBO.h rename to Marlin/src/pins/rambo/pins_MINIRAMBO.h index f81627b655b1..51c5fab892b2 100644 --- a/Marlin/src/pins/pins_MINIRAMBO.h +++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h @@ -30,9 +30,9 @@ #endif #if MB(MINIRAMBO_10A) - #define BOARD_NAME "Mini RAMBo 1.0a" + #define BOARD_INFO_NAME "Mini RAMBo 1.0a" #else - #define BOARD_NAME "Mini RAMBo" + #define BOARD_INFO_NAME "Mini RAMBo" #endif // @@ -125,8 +125,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_ENA_PIN 18 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 18 // Pullup! #define SPINDLE_DIR_PIN 19 // @@ -141,13 +141,13 @@ // // LCD / Controller // -#if HAS_SPI_LCD +#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL #if !MB(MINIRAMBO_10A) #define KILL_PIN 32 #endif - #if ENABLED(NEWPANEL) + #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL #if MB(MINIRAMBO_10A) @@ -187,6 +187,6 @@ #endif // !MINIRAMBO_10A - #endif // NEWPANEL + #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h similarity index 95% rename from Marlin/src/pins/pins_RAMBO.h rename to Marlin/src/pins/rambo/pins_RAMBO.h index 1eb29a66a45a..1094e0687e01 100644 --- a/Marlin/src/pins/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -45,7 +45,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Rambo" +#define BOARD_INFO_NAME "Rambo" // // Servos @@ -149,8 +149,8 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 31 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 45 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 31 // Pullup! #define SPINDLE_DIR_PIN 32 // @@ -169,11 +169,11 @@ // // LCD / Controller // -#if HAS_SPI_LCD +#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL #define KILL_PIN 80 - #if ENABLED(NEWPANEL) + #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL #define LCD_PINS_RS 70 #define LCD_PINS_ENABLE 71 @@ -219,7 +219,7 @@ // No Beeper added #define BEEPER_PIN 33 - // buttons are attached to a shift register + // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 //#define SHIFT_LD 42 diff --git a/Marlin/src/pins/pins_SCOOVO_X9H.h b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h similarity index 99% rename from Marlin/src/pins/pins_SCOOVO_X9H.h rename to Marlin/src/pins/rambo/pins_SCOOVO_X9H.h index c9affcba6a19..e8c9b2ebc0de 100644 --- a/Marlin/src/pins/pins_SCOOVO_X9H.h +++ b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Scoovo X9H" +#define BOARD_INFO_NAME "Scoovo X9H" // // Servos diff --git a/Marlin/src/pins/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h similarity index 90% rename from Marlin/src/pins/pins_3DRAG.h rename to Marlin/src/pins/ramps/pins_3DRAG.h index a7e686eef009..e6c3bdc2eae0 100644 --- a/Marlin/src/pins/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -25,12 +25,12 @@ * 3DRAG (and K8200 / K8400) Arduino Mega with RAMPS v1.4 pin assignments */ -#ifndef BOARD_NAME - #define BOARD_NAME "3Drag" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "3Drag" #endif #ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME "3Drag" + #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #endif #ifndef DEFAULT_SOURCE_CODE_URL @@ -44,7 +44,7 @@ #define RAMPS_D9_PIN 8 #define MOSFET_D_PIN 12 -#define CASE_LIGHT_PIN -1 // MUST BE HARDWARE PWM but one is not available on expansion header +#define CASE_LIGHT_PIN -1 // Hardware PWM but one is not available on expansion header #include "pins_RAMPS.h" @@ -152,11 +152,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_ENA_PIN 62 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN 62 // Pullup! #define SPINDLE_DIR_PIN 48 #elif !BOTH(ULTRA_LCD, NEWPANEL) // use expansion header if no LCD in use - #define SPINDLE_LASER_ENA_PIN 16 // Pin should have a pullup/pulldown! + #define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown! #define SPINDLE_DIR_PIN 17 #endif #endif diff --git a/Marlin/src/pins/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h similarity index 92% rename from Marlin/src/pins/pins_AZTEEG_X3.h rename to Marlin/src/pins/ramps/pins_AZTEEG_X3.h index 4686d9e7267a..692d4f8a6ef5 100644 --- a/Marlin/src/pins/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h @@ -27,16 +27,14 @@ #ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 +#elif HOTENDS > 2 || E_STEPPERS > 2 #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 #endif -#define BOARD_NAME "Azteeg X3" +#define BOARD_INFO_NAME "Azteeg X3" // // Servos @@ -92,7 +90,7 @@ #undef SERVO0_PIN #define SERVO0_PIN 11 #endif - #define SPINDLE_LASER_PWM_PIN 7 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENA_PIN 20 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 7 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN 20 // Pullup! #define SPINDLE_DIR_PIN 21 #endif diff --git a/Marlin/src/pins/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h similarity index 92% rename from Marlin/src/pins/pins_AZTEEG_X3_PRO.h rename to Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h index 25282f1eefdb..62014217fff4 100644 --- a/Marlin/src/pins/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h @@ -27,13 +27,11 @@ #ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#if HOTENDS > 5 || E_STEPPERS > 5 +#elif HOTENDS > 5 || E_STEPPERS > 5 #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "Azteeg X3 Pro" +#define BOARD_INFO_NAME "Azteeg X3 Pro" // // RAMPS pins overrides @@ -160,10 +158,9 @@ #if HAS_CUTTER // EXP2 header #if ANY(VIKI2, miniVIKI) - #undef BTN_EN2 - #define BTN_EN2 31 // need 7 for the spindle speed PWM + #define BTN_EN2 31 // Pin 7 needed for Spindle PWM #endif - #define SPINDLE_LASER_PWM_PIN 7 // must have a hardware PWM - #define SPINDLE_LASER_ENA_PIN 20 // Pin should have a pullup! - #define SPINDLE_DIR_PIN 21 + #define SPINDLE_LASER_PWM_PIN 7 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN 20 // Pullup! + #define SPINDLE_DIR_PIN 21 #endif diff --git a/Marlin/src/pins/pins_BAM_DICE_DUE.h b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h similarity index 88% rename from Marlin/src/pins/pins_BAM_DICE_DUE.h rename to Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h index 7872d66b310f..4cadf481f3f5 100644 --- a/Marlin/src/pins/pins_BAM_DICE_DUE.h +++ b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h @@ -29,14 +29,14 @@ #error "2PrintBeta Due supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "2PrintBeta Due" +#define BOARD_INFO_NAME "2PrintBeta Due" // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENA_PIN 66 // Pin should have a pullup/pulldown! +#define SPINDLE_LASER_ENA_PIN 66 // Pullup or pulldown! #define SPINDLE_DIR_PIN 67 -#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_BIQU_KFB_2.h b/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h similarity index 97% rename from Marlin/src/pins/pins_BIQU_KFB_2.h rename to Marlin/src/pins/ramps/pins_BIQU_KFB_2.h index 2c370efdf7da..7f27df6eb4a7 100644 --- a/Marlin/src/pins/pins_BIQU_KFB_2.h +++ b/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h @@ -29,7 +29,7 @@ #error "KFB 2.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "KFB 2.0" +#define BOARD_INFO_NAME "KFB 2.0" // // Heaters / Fans diff --git a/Marlin/src/pins/pins_BQ_ZUM_MEGA_3D.h b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h similarity index 92% rename from Marlin/src/pins/pins_BQ_ZUM_MEGA_3D.h rename to Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h index 9290e6c3b120..14013d874c69 100644 --- a/Marlin/src/pins/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "ZUM Mega 3D" +#define BOARD_INFO_NAME "ZUM Mega 3D" // // Heaters / Fans @@ -50,8 +50,8 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENA_PIN 40 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! +#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM #define SPINDLE_DIR_PIN 42 // @@ -94,7 +94,7 @@ #undef PS_ON_PIN // 12 #define PS_ON_PIN 81 // External Power Supply -#define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM +#define CASE_LIGHT_PIN 44 // Hardware PWM // This board has headers for Z-min, Z-max and IND_S_5V *but* as the bq team diff --git a/Marlin/src/pins/pins_DUPLICATOR_I3_PLUS.h b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h similarity index 99% rename from Marlin/src/pins/pins_DUPLICATOR_I3_PLUS.h rename to Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h index 94585715e23c..0ffc70aa73b4 100644 --- a/Marlin/src/pins/pins_DUPLICATOR_I3_PLUS.h +++ b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Duplicator i3 Plus" +#define BOARD_INFO_NAME "Duplicator i3 Plus" // // Limit Switches diff --git a/Marlin/src/pins/pins_FELIX2.h b/Marlin/src/pins/ramps/pins_FELIX2.h similarity index 95% rename from Marlin/src/pins/pins_FELIX2.h rename to Marlin/src/pins/ramps/pins_FELIX2.h index ec02cc22cea1..c2c2b4bbf442 100644 --- a/Marlin/src/pins/pins_FELIX2.h +++ b/Marlin/src/pins/ramps/pins_FELIX2.h @@ -29,7 +29,7 @@ #error "Felix 2.0+ supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "Felix 2.0+" +#define BOARD_INFO_NAME "Felix 2.0+" // // Heaters / Fans @@ -42,8 +42,7 @@ // // Misc. Functions // -#undef SDPOWER -#define SDPOWER 1 +#define SDPOWER_PIN 1 #define PS_ON_PIN 12 diff --git a/Marlin/src/pins/pins_FORMBOT_RAPTOR.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h similarity index 90% rename from Marlin/src/pins/pins_FORMBOT_RAPTOR.h rename to Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h index 1c121cc3f4cd..0ff0ec57ba70 100644 --- a/Marlin/src/pins/pins_FORMBOT_RAPTOR.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h @@ -27,17 +27,15 @@ #ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "Formbot supports up to 3 hotends / E-steppers. Comment out this line to continue." #endif -#if HOTENDS > 3 || E_STEPPERS > 3 - #error "Formbot supports up to 3 hotends / E-steppers. Comment this line to keep going." +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Formbot Raptor" #endif - #ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME "Formbot Raptor" -#endif -#ifndef BOARD_NAME - #define BOARD_NAME "Formbot Raptor" + #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #endif // @@ -117,9 +115,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS_PIN 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_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h similarity index 78% rename from Marlin/src/pins/pins_FORMBOT_RAPTOR2.h rename to Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h index e89167e987da..431d4370ba0b 100644 --- a/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h @@ -25,8 +25,8 @@ * Formbot Raptor 2 pin assignments */ -#define DEFAULT_MACHINE_NAME "Formbot Raptor2" -#define BOARD_NAME "Formbot Raptor2" +#define BOARD_INFO_NAME "Formbot Raptor2" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #define FAN_PIN 6 @@ -43,21 +43,21 @@ // #if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) #if !NUM_SERVOS // Try to use servo connector first - #define SPINDLE_LASER_ENA_PIN 6 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENA_PIN 6 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM #define SPINDLE_DIR_PIN 5 #elif !GREEDY_PANEL // Try to use AUX2 - #define SPINDLE_LASER_ENA_PIN 40 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM #define SPINDLE_DIR_PIN 65 #endif #endif #if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) #if NUM_SERVOS <= 1 // Try to use servo connector first - #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 6 // Hardware PWM #elif !GREEDY_PANEL // Try to use AUX2 - #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 44 // Hardware PWM #endif #endif diff --git a/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h similarity index 88% rename from Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h rename to Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h index f1dfd31889d8..665462c01238 100644 --- a/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h @@ -27,14 +27,12 @@ #ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Formbot supports up to 2 hotends / E-steppers. Comment this line to keep going." -#endif - -#define DEFAULT_MACHINE_NAME "Formbot" -#define BOARD_NAME "Formbot" +#define BOARD_INFO_NAME "Formbot" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME // // Servos @@ -114,9 +112,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS_PIN 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_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // @@ -183,9 +181,12 @@ #define BTN_EN2 33 #define BTN_ENC 35 #define SD_DETECT_PIN 49 - #ifndef KILL_PIN + + // Allow MAX7219 to steal the KILL pin + #if !defined(KILL_PIN) && MAX7219_CLK_PIN != 41 && MAX7219_DIN_PIN != 41 && MAX7219_LOAD_PIN != 41 #define KILL_PIN 41 #endif + #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 17 #define LCD_PINS_D4 23 diff --git a/Marlin/src/pins/pins_FORMBOT_TREX3.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h similarity index 87% rename from Marlin/src/pins/pins_FORMBOT_TREX3.h rename to Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h index 4ca2556d803d..a96585eb693c 100644 --- a/Marlin/src/pins/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h @@ -27,14 +27,12 @@ #ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Formbot supports up to 2 hotends / E-steppers. Comment this line to keep going." -#endif - -#define DEFAULT_MACHINE_NAME "Formbot" -#define BOARD_NAME "Formbot" +#define BOARD_INFO_NAME "Formbot" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME // // Servos @@ -114,9 +112,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS_PIN 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_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif @@ -144,8 +142,8 @@ #define LED_PIN 13 #endif -#define SPINDLE_LASER_PWM_PIN -1 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN -1 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 4 // Pullup! // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector #define FILWIDTH_PIN 5 // Analog Input diff --git a/Marlin/src/pins/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h similarity index 96% rename from Marlin/src/pins/pins_FYSETC_F6_13.h rename to Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index e41cca85cded..1168948d9369 100644 --- a/Marlin/src/pins/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -22,7 +22,7 @@ #pragma once // -// Fysetc F6 pin assignments +// FYSETC F6 pin assignments // #ifndef __AVR_ATmega2560__ @@ -33,7 +33,7 @@ //#error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board." #endif -#define BOARD_NAME "FYSETC F6 1.3" +#define BOARD_INFO_NAME "FYSETC F6 1.3" #define RESET_PIN 30 #define SPI_FLASH_CS 83 @@ -117,9 +117,13 @@ // the jumper next to the limit switch socket when using sensorless homing. // -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) - // Software serial - // At the moment, F6 rx pins are not pc interrupt pins +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Software serial communication pins. + * At the moment, F6 rx pins are not pc interrupt pins + */ #define X_SERIAL_RX_PIN -1 // 71 #define X_SERIAL_TX_PIN 72 #define Y_SERIAL_RX_PIN -1 // 73 diff --git a/Marlin/src/pins/pins_K8200.h b/Marlin/src/pins/ramps/pins_K8200.h similarity index 95% rename from Marlin/src/pins/pins_K8200.h rename to Marlin/src/pins/ramps/pins_K8200.h index c134585daa77..41cc4dfbf83b 100644 --- a/Marlin/src/pins/pins_K8200.h +++ b/Marlin/src/pins/ramps/pins_K8200.h @@ -26,7 +26,7 @@ * Identical to 3DRAG */ -#define BOARD_NAME "Velleman K8200" +#define BOARD_INFO_NAME "Velleman K8200" #define DEFAULT_MACHINE_NAME "K8200" #define DEFAULT_SOURCE_CODE_URL "https://github.com/CONSULitAS/Marlin-K8200" diff --git a/Marlin/src/pins/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h similarity index 97% rename from Marlin/src/pins/pins_K8400.h rename to Marlin/src/pins/ramps/pins_K8400.h index c3dd647d6460..a47d21c91462 100644 --- a/Marlin/src/pins/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -32,8 +32,8 @@ * - Second heater has moved pin */ +#define BOARD_INFO_NAME "K8400" #define DEFAULT_MACHINE_NAME "Vertex" -#define BOARD_NAME "K8400" #include "pins_3DRAG.h" diff --git a/Marlin/src/pins/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h similarity index 98% rename from Marlin/src/pins/pins_K8800.h rename to Marlin/src/pins/ramps/pins_K8800.h index 98fcde5bcd26..bfc61d0182e3 100644 --- a/Marlin/src/pins/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -29,8 +29,8 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif +#define BOARD_INFO_NAME "K8800" #define DEFAULT_MACHINE_NAME "Vertex Delta" -#define BOARD_NAME "K8800" //#define LCD_SCREEN_ROT_180 diff --git a/Marlin/src/pins/pins_MAKEBOARD_MINI.h b/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h similarity index 86% rename from Marlin/src/pins/pins_MAKEBOARD_MINI.h rename to Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h index 30807d2a1896..66dddbef4508 100644 --- a/Marlin/src/pins/pins_MAKEBOARD_MINI.h +++ b/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h @@ -21,20 +21,13 @@ */ #pragma once -#include "pins_RAMPS.h" - -#undef BOARD_NAME -#define BOARD_NAME "MAKEBOARD_MINI" +#define BOARD_INFO_NAME "MAKEboard Mini" // // Only 3 Limit Switch plugs on Micromake C1 // -#undef X_MIN_PIN -#undef Y_MIN_PIN -#undef Z_MIN_PIN -#undef X_MAX_PIN -#undef Y_MAX_PIN -#undef Z_MAX_PIN #define X_STOP_PIN 2 #define Y_STOP_PIN 15 #define Z_STOP_PIN 19 + +#include "pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_MKS_BASE.h b/Marlin/src/pins/ramps/pins_MKS_BASE.h similarity index 89% rename from Marlin/src/pins/pins_MKS_BASE.h rename to Marlin/src/pins/ramps/pins_MKS_BASE.h index 07519a5696be..75c7eb284845 100644 --- a/Marlin/src/pins/pins_MKS_BASE.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE.h @@ -31,7 +31,7 @@ #error "MKS BASE 1.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "MKS BASE 1.0" +#define BOARD_INFO_NAME "MKS BASE 1.0" // // Heaters / Fans @@ -44,8 +44,8 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 2 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 15 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 2 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 15 // Pullup! #define SPINDLE_DIR_PIN 19 #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_MKS_BASE_14.h b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h similarity index 99% rename from Marlin/src/pins/pins_MKS_BASE_14.h rename to Marlin/src/pins/ramps/pins_MKS_BASE_14.h index 7681f6cd9b90..700e2a410c14 100644 --- a/Marlin/src/pins/pins_MKS_BASE_14.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h @@ -29,7 +29,7 @@ #error "MKS BASE 1.4 only supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "MKS BASE 1.4" +#define BOARD_INFO_NAME "MKS BASE 1.4" // // Heaters / Fans diff --git a/Marlin/src/pins/pins_MKS_BASE_15.h b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h similarity index 100% rename from Marlin/src/pins/pins_MKS_BASE_15.h rename to Marlin/src/pins/ramps/pins_MKS_BASE_15.h diff --git a/Marlin/src/pins/pins_MKS_BASE_HEROIC.h b/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h similarity index 100% rename from Marlin/src/pins/pins_MKS_BASE_HEROIC.h rename to Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h diff --git a/Marlin/src/pins/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h similarity index 97% rename from Marlin/src/pins/pins_MKS_GEN_13.h rename to Marlin/src/pins/ramps/pins_MKS_GEN_13.h index 3d777d83835f..9596214cb206 100644 --- a/Marlin/src/pins/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -34,7 +34,7 @@ #error "MKS GEN 1.3/1.4 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "MKS GEN >= v1.3" +#define BOARD_INFO_NAME "MKS GEN >= v1.3" // // Heaters / Fans @@ -96,6 +96,8 @@ #undef SD_DETECT_PIN #undef BEEPER_PIN #undef KILL_PIN + #undef STAT_LED_RED_PIN + #undef STAT_LED_BLUE_PIN // // VIKI2 12-wire lead diff --git a/Marlin/src/pins/pins_MKS_GEN_L.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h similarity index 97% rename from Marlin/src/pins/pins_MKS_GEN_L.h rename to Marlin/src/pins/ramps/pins_MKS_GEN_L.h index 7b6ea178c7d0..88973baa1a56 100644 --- a/Marlin/src/pins/pins_MKS_GEN_L.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h @@ -29,7 +29,7 @@ #error "MKS GEN L supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "MKS GEN L" +#define BOARD_INFO_NAME "MKS GEN L" // // Heaters / Fans diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h new file mode 100644 index 000000000000..ff1314b2bf41 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h @@ -0,0 +1,89 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * MKS GEN L V2 – Arduino Mega2560 with RAMPS v1.4 pin assignments + */ + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS GEN L V2 supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "MKS GEN L V2" + +// +// Heaters / Fans +// +// 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 63 +#endif + +#ifndef Y_CS_PIN + #define Y_CS_PIN 64 +#endif + +#ifndef Z_CS_PIN + #define Z_CS_PIN 65 +#endif + +#ifndef E0_CS_PIN + #define E0_CS_PIN 66 +#endif + +#ifndef E1_CS_PIN + #define E1_CS_PIN 21 +#endif + +// TMC2130 Diag Pins (currently just for reference) +#define X_DIAG_PIN 3 +#define Y_DIAG_PIN 14 +#define Z_DIAG_PIN 18 +#define E0_DIAG_PIN 2 +#define E1_DIAG_PIN 15 + +#ifndef SERVO1_PIN + #define SERVO1_PIN 12 +#endif +#ifndef SERVO2_PIN + #define SERVO2_PIN 39 +#endif +#ifndef SERVO3_PIN + #define SERVO3_PIN 32 +#endif + +#ifndef E1_SERIAL_TX_PIN + #define E1_SERIAL_TX_PIN 20 +#endif +#ifndef E1_SERIAL_RX_PIN + #define E1_SERIAL_RX_PIN 21 +#endif + +#include "pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h similarity index 83% rename from Marlin/src/pins/pins_RAMPS.h rename to Marlin/src/pins/ramps/pins_RAMPS.h index e79247fcef61..676197b84d0c 100644 --- a/Marlin/src/pins/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -45,7 +45,7 @@ * 7 | 11 */ -#if ENABLED(TARGET_LPC1768) +#ifdef TARGET_LPC1768 #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768." #elif defined(__STM32F1__) #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1." @@ -57,8 +57,8 @@ #endif #endif -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.4" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "RAMPS 1.4" #endif // @@ -66,7 +66,7 @@ // #ifndef SERVO0_PIN #ifdef IS_RAMPS_13 - #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI + #define SERVO0_PIN 7 #else #define SERVO0_PIN 11 #endif @@ -157,15 +157,21 @@ // // Temperature Sensors // -#define TEMP_0_PIN 13 // Analog Input -#define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 14 // Analog Input +#ifndef TEMP_0_PIN + #define TEMP_0_PIN 13 // Analog Input +#endif +#ifndef TEMP_1_PIN + #define TEMP_1_PIN 15 // Analog Input +#endif +#ifndef TEMP_BED_PIN + #define TEMP_BED_PIN 14 // Analog Input +#endif // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS_PIN 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_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // @@ -252,13 +258,11 @@ #define PS_ON_PIN 12 #endif -#define AUX2_PINS_FREE !( BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD) ) - #if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN) - #if NUM_SERVOS <= 1 // try to use servo connector first - #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM - #elif AUX2_PINS_FREE - #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM + #if NUM_SERVOS <= 1 // Prefer the servo connector + #define CASE_LIGHT_PIN 6 // Hardware PWM + #elif HAS_FREE_AUX2_PINS + #define CASE_LIGHT_PIN 44 // Hardware PWM #endif #endif @@ -267,20 +271,18 @@ // #if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN) #if !NUM_SERVOS // Use servo connector if possible - #define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM #define SPINDLE_DIR_PIN 5 - #elif AUX2_PINS_FREE - #define SPINDLE_LASER_ENA_PIN 40 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM + #elif HAS_FREE_AUX2_PINS + #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM #define SPINDLE_DIR_PIN 65 #else #error "No auto-assignable Spindle/Laser pins available." #endif #endif -#undef AUX2_PINS_FREE - // // TMC software SPI // @@ -296,7 +298,7 @@ #endif #endif -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) +#if HAS_TMC220x /** * TMC2208/TMC2209 stepper drivers * @@ -319,31 +321,75 @@ // Software serial // - #define X_SERIAL_TX_PIN 40 - #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 Y2_SERIAL_TX_PIN -1 - #define Y2_SERIAL_RX_PIN -1 - - #define Z_SERIAL_TX_PIN 42 - #define Z_SERIAL_RX_PIN 65 - #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 E1_SERIAL_TX_PIN -1 - #define E1_SERIAL_RX_PIN -1 - #define E2_SERIAL_TX_PIN -1 - #define E2_SERIAL_RX_PIN -1 - #define E3_SERIAL_TX_PIN -1 - #define E3_SERIAL_RX_PIN -1 - #define E4_SERIAL_TX_PIN -1 - #define E4_SERIAL_RX_PIN -1 + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN 40 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN 63 + #endif + #ifndef X2_SERIAL_TX_PIN + #define X2_SERIAL_TX_PIN -1 + #endif + #ifndef X2_SERIAL_RX_PIN + #define X2_SERIAL_RX_PIN -1 + #endif + + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN 59 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN 64 + #endif + #ifndef Y2_SERIAL_TX_PIN + #define Y2_SERIAL_TX_PIN -1 + #endif + #ifndef Y2_SERIAL_RX_PIN + #define Y2_SERIAL_RX_PIN -1 + #endif + + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN 42 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN 65 + #endif + #ifndef Z2_SERIAL_TX_PIN + #define Z2_SERIAL_TX_PIN -1 + #endif + #ifndef Z2_SERIAL_RX_PIN + #define Z2_SERIAL_RX_PIN -1 + #endif + + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN 44 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN 66 + #endif + #ifndef E1_SERIAL_TX_PIN + #define E1_SERIAL_TX_PIN -1 + #endif + #ifndef E1_SERIAL_RX_PIN + #define E1_SERIAL_RX_PIN -1 + #endif + #ifndef E2_SERIAL_TX_PIN + #define E2_SERIAL_TX_PIN -1 + #endif + #ifndef E2_SERIAL_RX_PIN + #define E2_SERIAL_RX_PIN -1 + #endif + #ifndef E3_SERIAL_TX_PIN + #define E3_SERIAL_TX_PIN -1 + #endif + #ifndef E3_SERIAL_RX_PIN + #define E3_SERIAL_RX_PIN -1 + #endif + #ifndef E4_SERIAL_TX_PIN + #define E4_SERIAL_TX_PIN -1 + #endif + #ifndef E4_SERIAL_RX_PIN + #define E4_SERIAL_RX_PIN -1 + #endif #endif // @@ -431,7 +477,7 @@ #endif #if DISABLED(NEWPANEL) - // Buttons are attached to a shift register + // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 //#define SHIFT_LD 42 @@ -485,8 +531,8 @@ #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 40 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + #define BTN_EN2 42 #define BTN_ENC -1 #define LCD_SDSS SDSS @@ -506,7 +552,7 @@ #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 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) @@ -530,7 +576,10 @@ #define BEEPER_PIN 37 #define BTN_ENC 35 #define SD_DETECT_PIN 49 - #define KILL_PIN 41 + + #ifndef KILL_PIN + #define KILL_PIN 41 + #endif #if ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6 @@ -544,7 +593,7 @@ //#define LCD_SCREEN_ROT_270 // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 + #define LCD_BACKLIGHT_PIN -1 // 65 (MKS mini12864 can't adjust backlight by software!) #define BTN_EN1 31 #define BTN_EN2 33 @@ -615,7 +664,7 @@ // Beeper on AUX-4 #define BEEPER_PIN 33 - // Buttons are directly attached using AUX-2 + // Buttons are directly attached to AUX-2 #if ENABLED(REPRAPWORLD_KEYPAD) #define SHIFT_OUT 40 #define SHIFT_CLK 44 diff --git a/Marlin/src/pins/pins_RAMPS_13.h b/Marlin/src/pins/ramps/pins_RAMPS_13.h similarity index 95% rename from Marlin/src/pins/pins_RAMPS_13.h rename to Marlin/src/pins/ramps/pins_RAMPS_13.h index 70bfd51d5478..508064e66fd4 100644 --- a/Marlin/src/pins/pins_RAMPS_13.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_13.h @@ -34,8 +34,8 @@ * */ -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.3" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "RAMPS 1.3" #endif #define IS_RAMPS_13 diff --git a/Marlin/src/pins/pins_RAMPS_CREALITY.h b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h similarity index 57% rename from Marlin/src/pins/pins_RAMPS_CREALITY.h rename to Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h index 2e5471a5bb79..1328354b7dcd 100644 --- a/Marlin/src/pins/pins_RAMPS_CREALITY.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h @@ -25,7 +25,7 @@ #error "Creality3D RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "Creality3D RAMPS" +#define BOARD_INFO_NAME "Creality3D RAMPS" // // Heaters / Fans @@ -35,10 +35,28 @@ #define MOSFET_D_PIN 7 #define FIL_RUNOUT_PIN 2 +#if NUM_RUNOUT_SENSORS > 1 + #define FIL_RUNOUT2_PIN 15 // Creality CR-X can use dual runout sensors +#endif + +#define SD_DETECT_PIN 49 // Always define onboard SD detect + +#define PS_ON_PIN 40 // Used by CR2020 Industrial series + +#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) + #define CASE_LIGHT_PIN 65 +#endif #include "pins_RAMPS.h" -#define EXP1_PIN 65 // A11 -#define EXP2_PIN 66 // A12 -#define EXP3_PIN 11 // SERVO0_PIN -#define EXP4_PIN 12 // PS_ON_PIN +#ifndef BEEPER_PIN + #define BEEPER_PIN 37 // Always define beeper pin so Play Tone works with ExtUI +#endif + +#define EXP1_PIN 65 // A11 - Used by CR2020 Industrial series for case +#define EXP2_PIN 66 // A12 +#define EXP3_PIN 11 // SERVO0_PIN +#define EXP4_PIN 12 // PS_ON_PIN + +#define SUICIDE_PIN 12 // Used by CR2020 Industrial series +#define SUICIDE_PIN_INVERTING true // Used by CR2020 Industrial series diff --git a/Marlin/src/pins/pins_RAMPS_DAGOMA.h b/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h similarity index 96% rename from Marlin/src/pins/pins_RAMPS_DAGOMA.h rename to Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h index cacdb83819ec..43937e213706 100644 --- a/Marlin/src/pins/pins_RAMPS_DAGOMA.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h @@ -25,7 +25,7 @@ #error "Dagoma3D F5 RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "Dagoma3D F5 RAMPS" +#define BOARD_INFO_NAME "Dagoma3D F5 RAMPS" #define X_STOP_PIN 2 #define Y_STOP_PIN 3 diff --git a/Marlin/src/pins/pins_RAMPS_ENDER_4.h b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h old mode 100755 new mode 100644 similarity index 97% rename from Marlin/src/pins/pins_RAMPS_ENDER_4.h rename to Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h index 3a452f9862ab..0eb3035c1d19 --- a/Marlin/src/pins/pins_RAMPS_ENDER_4.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h @@ -25,7 +25,7 @@ #error "Ender-4 supports only 1 hotend / E-stepper. Comment out this line to continue." #endif -#define BOARD_NAME "Ender-4" +#define BOARD_INFO_NAME "Ender-4" #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_RAMPS_OLD.h b/Marlin/src/pins/ramps/pins_RAMPS_OLD.h similarity index 82% rename from Marlin/src/pins/pins_RAMPS_OLD.h rename to Marlin/src/pins/ramps/pins_RAMPS_OLD.h index f0deec3b04af..a55348fec116 100644 --- a/Marlin/src/pins/pins_RAMPS_OLD.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_OLD.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "RAMPS <1.2" +#define BOARD_INFO_NAME "RAMPS <1.2" // Uncomment the following line for RAMPS v1.0 //#define RAMPS_V_1_0 @@ -78,9 +78,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Don't use 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS_PIN 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_PIN 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // @@ -103,14 +103,14 @@ // // Misc. Functions // -#define SDPOWER 48 +#define SDPOWER_PIN 48 #define SDSS 53 #define LED_PIN 13 -#define CASE_LIGHT_PIN 45 // MUST BE HARDWARE PWM +#define CASE_LIGHT_PIN 45 // Hardware PWM // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENA_PIN 41 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENA_PIN 41 // Pullup or pulldown! +#define SPINDLE_LASER_PWM_PIN 45 // Hardware PWM #define SPINDLE_DIR_PIN 43 diff --git a/Marlin/src/pins/pins_RAMPS_PLUS.h b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h similarity index 98% rename from Marlin/src/pins/pins_RAMPS_PLUS.h rename to Marlin/src/pins/ramps/pins_RAMPS_PLUS.h index 77b5ee6f5cf5..02193a5a0374 100644 --- a/Marlin/src/pins/pins_RAMPS_PLUS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h @@ -42,7 +42,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "RAMPS 1.4 Plus" +#define BOARD_INFO_NAME "RAMPS 1.4 Plus" #define RAMPS_D8_PIN 10 #define RAMPS_D10_PIN 8 diff --git a/Marlin/src/pins/pins_RIGIDBOARD.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h similarity index 97% rename from Marlin/src/pins/pins_RIGIDBOARD.h rename to Marlin/src/pins/ramps/pins_RIGIDBOARD.h index 4b472b652d75..c69843c62101 100644 --- a/Marlin/src/pins/pins_RIGIDBOARD.h +++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h @@ -25,7 +25,9 @@ * RIGIDBOARD Arduino Mega with RAMPS v1.4 pin assignments */ -#define BOARD_NAME "RigidBoard" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "RigidBoard" +#endif // // Z Probe (when not Z_MIN_PIN) diff --git a/Marlin/src/pins/pins_RIGIDBOARD_V2.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h similarity index 97% rename from Marlin/src/pins/pins_RIGIDBOARD_V2.h rename to Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h index 419726883e04..01ccb5927aaf 100644 --- a/Marlin/src/pins/pins_RIGIDBOARD_V2.h +++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h @@ -25,10 +25,9 @@ * RIGIDBOARD V2 Arduino Mega with RAMPS v1.4 pin assignments */ -#include "pins_RIGIDBOARD.h" +#define BOARD_INFO_NAME "RigidBoard V2" -#undef BOARD_NAME -#define BOARD_NAME "RigidBoard V2" +#include "pins_RIGIDBOARD.h" // // Steppers diff --git a/Marlin/src/pins/pins_RL200.h b/Marlin/src/pins/ramps/pins_RL200.h similarity index 98% rename from Marlin/src/pins/pins_RL200.h rename to Marlin/src/pins/ramps/pins_RL200.h index af03ee8c4a09..1202638d1c7b 100644 --- a/Marlin/src/pins/pins_RL200.h +++ b/Marlin/src/pins/ramps/pins_RL200.h @@ -26,8 +26,8 @@ * extruder motors due to dual Z motors. Pinout therefore based on pins_RUMBA.h. */ +#define BOARD_INFO_NAME "RL200" #define DEFAULT_MACHINE_NAME "Rapide Lite 200" -#define BOARD_NAME "RL200" #if HOTENDS > 2 || E_STEPPERS > 2 #error "RL200v1 supports up to 2 hotends / E-steppers. Comment out this line to continue." diff --git a/Marlin/src/pins/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h similarity index 93% rename from Marlin/src/pins/pins_RUMBA.h rename to Marlin/src/pins/ramps/pins_RUMBA.h index db3dff3c7431..cf3bfe226c49 100644 --- a/Marlin/src/pins/pins_RUMBA.h +++ b/Marlin/src/pins/ramps/pins_RUMBA.h @@ -27,17 +27,15 @@ #ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#if HOTENDS > 3 || E_STEPPERS > 3 +#elif HOTENDS > 3 || E_STEPPERS > 3 #error "RUMBA supports up to 3 hotends / E-steppers. Comment out this line to continue." #endif -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME "Rumba" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Rumba" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Rumba" +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #endif // @@ -122,7 +120,10 @@ // 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) + +#ifndef TEMP_CHAMBER_PIN + //#define TEMP_CHAMBER_PIN 12 // Analog Input (default connector for thermistor *T3* on rumba board is used) +#endif #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) @@ -142,7 +143,9 @@ #ifndef FAN_PIN #define FAN_PIN 7 #endif -#define FAN1_PIN 8 +#ifndef FAN1_PIN + #define FAN1_PIN 8 +#endif // // Misc. Functions @@ -156,10 +159,10 @@ // 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? + #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM. Pin 4 interrupts OC0* and OC1* always in use? #endif #ifndef SPINDLE_LASER_ENA_PIN - #define SPINDLE_LASER_ENA_PIN 14 // Pin should have a pullup! + #define SPINDLE_LASER_ENA_PIN 14 // Pullup! #endif #ifndef SPINDLE_DIR_PIN #define SPINDLE_DIR_PIN 15 @@ -217,7 +220,6 @@ #define BEEPER_PIN 44 #if ENABLED(SDSUPPORT) - #define SDPOWER -1 #define SDSS 53 #define SD_DETECT_PIN 49 #endif diff --git a/Marlin/src/pins/pins_RUMBA_RAISE3D.h b/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h similarity index 96% rename from Marlin/src/pins/pins_RUMBA_RAISE3D.h rename to Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h index 8d5297c1b89a..0cc4ebb3baef 100644 --- a/Marlin/src/pins/pins_RUMBA_RAISE3D.h +++ b/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h @@ -21,8 +21,8 @@ */ #pragma once +#define BOARD_INFO_NAME "Raise3D Rumba" #define DEFAULT_MACHINE_NAME "Raise3D N Series" -#define BOARD_NAME "Raise3D Rumba" // Raise3D uses thermocouples on the standard input pins #define TEMP_0_PIN 15 // Analog Input diff --git a/Marlin/src/pins/pins_SAINSMART_2IN1.h b/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h similarity index 97% rename from Marlin/src/pins/pins_SAINSMART_2IN1.h rename to Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h index a3d24017d569..27c746ad252a 100644 --- a/Marlin/src/pins/pins_SAINSMART_2IN1.h +++ b/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h @@ -29,7 +29,7 @@ #error "Sainsmart 2-in-1 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "Sainsmart" +#define BOARD_INFO_NAME "Sainsmart" // // Heaters / Fans diff --git a/Marlin/src/HAL/HAL_STM32F4/SanityCheck.h b/Marlin/src/pins/ramps/pins_TANGO.h similarity index 55% rename from Marlin/src/HAL/HAL_STM32F4/SanityCheck.h rename to Marlin/src/pins/ramps/pins_TANGO.h index e9eb8fa8262c..2cc8565db2a7 100644 --- a/Marlin/src/HAL/HAL_STM32F4/SanityCheck.h +++ b/Marlin/src/pins/ramps/pins_TANGO.h @@ -22,16 +22,30 @@ #pragma once /** - * Test STM32F4-specific configuration values for errors at compile-time. + * BIQU Tango pin assignments */ -//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) -// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" -//#endif -#if ENABLED(EMERGENCY_PARSER) - #error "EMERGENCY_PARSER is not yet implemented for STM32F4. Disable EMERGENCY_PARSER to continue." +#define BOARD_INFO_NAME "Tango" + +#define FAN_PIN 8 +#define FAN1_PIN -1 + +#define ORIG_E0_AUTO_FAN_PIN 7 + +#ifndef TEMP_0_PIN + #if TEMP_SENSOR_0 == -1 + #define TEMP_0_PIN 10 // Analog Input (connector *K1* on Tango thermocouple ADD ON is used) + #else + #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) + #endif #endif -#if ENABLED(FAST_PWM_FAN) - #error "FAST_PWM_FAN is not yet implemented for this platform." +#ifndef TEMP_1_PIN + #if TEMP_SENSOR_1 == -1 + #define TEMP_1_PIN 9 // Analog Input (connector *K2* on Tango thermocouple ADD ON is used) + #else + #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) + #endif #endif + +#include "pins_RUMBA.h" diff --git a/Marlin/src/pins/pins_TRIGORILLA_13.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h similarity index 96% rename from Marlin/src/pins/pins_TRIGORILLA_13.h rename to Marlin/src/pins/ramps/pins_TRIGORILLA_13.h index 77e0bdf04c53..fd0b67c88aac 100644 --- a/Marlin/src/pins/pins_TRIGORILLA_13.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h @@ -25,7 +25,7 @@ * Arduino Mega with RAMPS v1.3 for Anycubic */ -#define BOARD_NAME "Anycubic RAMPS 1.3" +#define BOARD_INFO_NAME "Anycubic RAMPS 1.3" #define IS_RAMPS_EFB #define RAMPS_D9_PIN 44 diff --git a/Marlin/src/pins/pins_TRIGORILLA_14.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h similarity index 98% rename from Marlin/src/pins/pins_TRIGORILLA_14.h rename to Marlin/src/pins/ramps/pins_TRIGORILLA_14.h index c5c3ac0ac729..031ab8e16bcb 100644 --- a/Marlin/src/pins/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h @@ -25,7 +25,7 @@ * Arduino Mega with RAMPS v1.4 for Anycubic */ -#define BOARD_NAME "Anycubic RAMPS 1.4" +#define BOARD_INFO_NAME "Anycubic RAMPS 1.4" // // Servos diff --git a/Marlin/src/pins/pins_TRONXY_V3_1_0.h b/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h similarity index 99% rename from Marlin/src/pins/pins_TRONXY_V3_1_0.h rename to Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h index aaf276da787e..48b510d8c2bd 100644 --- a/Marlin/src/pins/pins_TRONXY_V3_1_0.h +++ b/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h @@ -27,13 +27,11 @@ #ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 +#elif HOTENDS > 2 || E_STEPPERS > 2 #error "TRONXY-V3-1.0 supports only 2 hotends/E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "TRONXY-V3-1.0" +#define BOARD_INFO_NAME "TRONXY-V3-1.0" // // Servos diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h new file mode 100644 index 000000000000..1c40729a8788 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -0,0 +1,512 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#endif + +#if HOTENDS > 5 || E_STEPPERS > 5 + #error "TTOSCAR supports up to 5 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "TT OSCAR" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// +// Servos +// +#define SERVO0_PIN 11 +#define SERVO1_PIN 12 +#define SERVO2_PIN 5 +#define SERVO3_PIN 4 + +// +// Limit Switches +// +#define X_MIN_PIN 3 +#define X_MAX_PIN 2 +#define Y_MIN_PIN 14 +#define Y_MAX_PIN 15 +#define Z_MIN_PIN 18 +#define Z_MAX_PIN 19 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN SERVO3_PIN +#endif + +// +// Steppers +// +#define X_STEP_PIN 54 +#define X_DIR_PIN 55 +#define X_ENABLE_PIN 38 +#define X_CS_PIN 57 + +#define Y_STEP_PIN 60 +#define Y_DIR_PIN 61 +#define Y_ENABLE_PIN 56 +#define Y_CS_PIN 58 + +#define Z_STEP_PIN 46 +#define Z_DIR_PIN 48 +#define Z_ENABLE_PIN 62 +#define Z_CS_PIN 53 + +#define E0_STEP_PIN 26 +#define E0_DIR_PIN 28 +#define E0_ENABLE_PIN 24 +#define E0_CS_PIN 49 + +#define E1_STEP_PIN 36 +#define E1_DIR_PIN 34 +#define E1_ENABLE_PIN 30 +#define E1_CS_PIN E0_CS_PIN + +#define E2_STEP_PIN 63 +#define E2_DIR_PIN 22 +#define E2_ENABLE_PIN 59 +#define E2_CS_PIN E0_CS_PIN + +#define E3_STEP_PIN 32 +#define E3_DIR_PIN 40 +#define E3_ENABLE_PIN 39 +#define E3_CS_PIN E0_CS_PIN + +#define E4_STEP_PIN 43 +#define E4_DIR_PIN 42 +#define E4_ENABLE_PIN 47 +#define E4_CS_PIN E0_CS_PIN + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + + #define X_SERIAL_TX_PIN -1 // 59 + #define X_SERIAL_RX_PIN -1 // 63 + #define X2_SERIAL_TX_PIN -1 + #define X2_SERIAL_RX_PIN -1 + + #define Y_SERIAL_TX_PIN -1 // 64 + #define Y_SERIAL_RX_PIN -1 // 40 + #define Y2_SERIAL_TX_PIN -1 + #define Y2_SERIAL_RX_PIN -1 + + #define Z_SERIAL_TX_PIN -1 // 44 + #define Z_SERIAL_RX_PIN -1 // 42 + #define Z2_SERIAL_TX_PIN -1 + #define Z2_SERIAL_RX_PIN -1 + + #define E0_SERIAL_TX_PIN -1 // 66 + #define E0_SERIAL_RX_PIN -1 // 65 + #define E1_SERIAL_TX_PIN -1 + #define E1_SERIAL_RX_PIN -1 + #define E2_SERIAL_TX_PIN -1 + #define E2_SERIAL_RX_PIN -1 + #define E3_SERIAL_TX_PIN -1 + #define E3_SERIAL_RX_PIN -1 + #define E4_SERIAL_TX_PIN -1 + #define E4_SERIAL_RX_PIN -1 +#endif + +// +// 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 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 13 +#define TEMP_1_PIN 15 +#define TEMP_2_PIN 10 +#define TEMP_3_PIN 11 +#define TEMP_BED_PIN 14 + +#if TEMP_SENSOR_CHAMBER > 0 + #define TEMP_CHAMBER_PIN 12 +#else + #define TEMP_4_PIN 12 +#endif + +// SPI for Max6675 or Max31855 Thermocouple +//#if DISABLED(SDSUPPORT) +// #define MAX6675_SS 66 // Don't use 53 if there is even the remote possibility of using Display/SD card +//#else +// #define MAX6675_SS 66 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present +//#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN 10 +#define HEATER_1_PIN 7 +#define HEATER_2_PIN 44 +#define HEATER_BED_PIN 8 + +#define FAN_PIN 9 + +#if EXTRUDERS >= 5 + #define HEATER_4_PIN 6 +#else + #define FAN1_PIN 6 +#endif + +#if EXTRUDERS >= 4 + #define HEATER_3_PIN 45 +#else + #define FAN2_PIN 45 +#endif + +// +// Misc. Functions +// +#define SDSS 53 +#define LED_PIN 13 + +//#ifndef FILWIDTH_PIN +// #define FILWIDTH_PIN 5 // Analog Input +//#endif + +// DIO 4 (Servos plug) for the runout sensor. +//#define FIL_RUNOUT_PIN SERVO3_PIN + +#ifndef PS_ON_PIN + #define PS_ON_PIN 12 +#endif + +// +// Case Light +// +#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN) + #if !NUM_SERVOS // Prefer the servo connector + #define CASE_LIGHT_PIN 6 // Hardware PWM + #elif HAS_FREE_AUX2_PINS // Try to use AUX 2 + #define CASE_LIGHT_PIN 44 // Hardware PWM + #endif +#endif + +// +// M3/M4/M5 - Spindle/Laser Control +// +#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE) + #if !NUM_SERVOS // Prefer the servo connector + #define SPINDLE_LASER_ENABLE_PIN 4 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM + #define SPINDLE_DIR_PIN 5 + #elif HAS_FREE_AUX2_PINS // Try to use AUX 2 + #define SPINDLE_LASER_ENABLE_PIN 40 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM + #define SPINDLE_DIR_PIN 65 + #endif +#endif + +// +// Průša i3 MK2 Multiplexer Support +// +//#ifndef E_MUX0_PIN +// #define E_MUX0_PIN 58 // Y_CS_PIN +//#endif +//#ifndef E_MUX1_PIN +// #define E_MUX1_PIN 53 // Z_CS_PIN +//#endif +//#ifndef E_MUX2_PIN +// #define E_MUX2_PIN 49 // En_CS_PIN +//#endif + +////////////////////////// +// LCDs and Controllers // +////////////////////////// + +#if HAS_SPI_LCD + + // + // LCD Display output pins + // + #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + #define LCD_PINS_RS 49 // CS chip select /SS chip slave select + #define LCD_PINS_ENABLE 51 // SID (MOSI) + #define LCD_PINS_D4 52 // SCK (CLK) clock + + #elif BOTH(NEWPANEL, PANEL_ONE) + + #define LCD_PINS_RS 40 + #define LCD_PINS_ENABLE 42 + #define LCD_PINS_D4 65 + #define LCD_PINS_D5 66 + #define LCD_PINS_D6 44 + #define LCD_PINS_D7 64 + + #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 + #define ADC_KEYPAD_PIN 12 + + #else + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS 27 + #define LCD_PINS_ENABLE 29 + #define LCD_PINS_D4 25 + + #if DISABLED(NEWPANEL) + #define BEEPER_PIN 37 + #endif + + #else + + #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) + #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 + #define DOGLCD_SCK 23 + #define DOGLCD_A0 LCD_PINS_DC + #else + #define LCD_PINS_RS 16 + #define LCD_PINS_ENABLE 17 + #define LCD_PINS_D4 23 + #define LCD_PINS_D5 25 + #define LCD_PINS_D6 27 + #endif + + #define LCD_PINS_D7 29 + + #if DISABLED(NEWPANEL) + #define BEEPER_PIN 33 + #endif + + #endif + + #if DISABLED(NEWPANEL) + // Buttons attached to a shift register + // Not wired yet + //#define SHIFT_CLK 38 + //#define SHIFT_LD 42 + //#define SHIFT_OUT 40 + //#define SHIFT_EN 17 + #endif + + #endif + + // + // LCD Display input pins + // + #if ENABLED(NEWPANEL) + + #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + + #define BEEPER_PIN 37 + + #if ENABLED(CR10_STOCKDISPLAY) + #define BTN_EN1 17 + #define BTN_EN2 23 + #else + #define BTN_EN1 31 + #define BTN_EN2 33 + #endif + + #define BTN_ENC 35 + #define SD_DETECT_PIN 49 + //#define KILL_PIN 41 + + #if ENABLED(BQ_LCD_SMART_CONTROLLER) + #define LCD_BACKLIGHT_PIN 39 + #endif + + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + #define BTN_EN1 64 + #define BTN_EN2 59 + #define BTN_ENC 63 + #define SD_DETECT_PIN 42 + + #elif ENABLED(LCD_I2C_PANELOLU2) + + #define BTN_EN1 47 + #define BTN_EN2 43 + #define BTN_ENC 32 + #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_ENC -1 + + #define LCD_SDSS 53 + #define SD_DETECT_PIN 49 + + #elif EITHER(VIKI2, miniVIKI) + + #define DOGLCD_CS 45 + #define DOGLCD_A0 44 + #define LCD_SCREEN_ROT_180 + + #define BEEPER_PIN 33 + #define STAT_LED_RED_PIN 32 + #define STAT_LED_BLUE_PIN 35 + + #define BTN_EN1 22 + #define BTN_EN2 7 + #define BTN_ENC 39 + + #define SDSS 53 + #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board + //#define KILL_PIN 31 + + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + + #define DOGLCD_CS 29 + #define DOGLCD_A0 27 + + #define BEEPER_PIN 23 + #define LCD_BACKLIGHT_PIN 33 + + #define BTN_EN1 35 + #define BTN_EN2 37 + #define BTN_ENC 31 + + #define LCD_SDSS 53 + #define SD_DETECT_PIN 49 + //#define KILL_PIN 41 + + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 27 + #define DOGLCD_CS 25 + + // GLCD features + //#define LCD_CONTRAST_INIT 190 + // Uncomment screen orientation + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 + + #define BEEPER_PIN 37 + + #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 + + #elif ENABLED(MINIPANEL) + + #define BEEPER_PIN 42 + // not connected to a pin + #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 + + #define DOGLCD_A0 44 + #define DOGLCD_CS 66 + + // GLCD features + //#define LCD_CONTRAST_INIT 190 + // Uncomment screen orientation + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 + + #define BTN_EN1 40 + #define BTN_EN2 63 + #define BTN_ENC 59 + + #define SDSS 53 + #define SD_DETECT_PIN 49 + //#define KILL_PIN 64 + + #else + + // Beeper on AUX-4 + #define BEEPER_PIN 33 + + // Buttons are directly attached to AUX-2 + #if ENABLED(REPRAPWORLD_KEYPAD) + #define SHIFT_OUT 40 + #define SHIFT_CLK 44 + #define SHIFT_LD 42 + #define BTN_EN1 64 + #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 + #else + #define BTN_EN1 37 + #define BTN_EN2 35 + #define BTN_ENC 31 + #endif + + #if ENABLED(G3D_PANEL) + #define SD_DETECT_PIN 49 + //#define KILL_PIN 41 + #endif + + #endif + + #endif // NEWPANEL + +#endif diff --git a/Marlin/src/pins/pins_ULTIMAIN_2.h b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h similarity index 95% rename from Marlin/src/pins/pins_ULTIMAIN_2.h rename to Marlin/src/pins/ramps/pins_ULTIMAIN_2.h index f61f16c2f42a..c182aa96f046 100644 --- a/Marlin/src/pins/pins_ULTIMAIN_2.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h @@ -37,9 +37,9 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif +#define BOARD_INFO_NAME "Ultimaker 2.x" #define DEFAULT_MACHINE_NAME "Ultimaker" #define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker 2.x" // // Limit Switches @@ -132,8 +132,8 @@ #if HAS_CUTTER // use the LED_PIN for spindle speed control or case light #undef LED_PIN #define SPINDLE_DIR_PIN 16 - #define SPINDLE_LASER_ENA_PIN 17 // Pin should have a pullup! - #define SPINDLE_LASER_PWM_PIN 8 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENA_PIN 17 // Pullup! + #define SPINDLE_LASER_PWM_PIN 8 // Hardware PWM #else #undef LED_PIN #define CASE_LIGHT_PIN 8 diff --git a/Marlin/src/pins/pins_ULTIMAKER.h b/Marlin/src/pins/ramps/pins_ULTIMAKER.h similarity index 92% rename from Marlin/src/pins/pins_ULTIMAKER.h rename to Marlin/src/pins/ramps/pins_ULTIMAKER.h index d895058989f3..b2594acebced 100644 --- a/Marlin/src/pins/pins_ULTIMAKER.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER.h @@ -37,9 +37,9 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define DEFAULT_MACHINE_NAME "Ultimaker" +#define BOARD_INFO_NAME "Ultimaker" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker" // // Servos @@ -129,7 +129,7 @@ #define LCD_PINS_D6 5 #define LCD_PINS_D7 6 - // buttons are directly attached + // Buttons directly attached #define BTN_EN1 40 #define BTN_EN2 42 #define BTN_ENC 19 @@ -138,7 +138,7 @@ #else // !NEWPANEL - Old style panel with shift register - // buttons are attached to a shift register + // Buttons attached to a shift register #define SHIFT_CLK 38 #define SHIFT_LD 42 #define SHIFT_OUT 40 @@ -160,6 +160,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_PWM_PIN 9 // MUST BE HARDWARE PWM -#define SPINDLE_LASER_ENA_PIN 10 // Pin should have a pullup! +#define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM +#define SPINDLE_LASER_ENA_PIN 10 // Pullup! #define SPINDLE_DIR_PIN 11 // use the EXP3 PWM header diff --git a/Marlin/src/pins/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h similarity index 92% rename from Marlin/src/pins/pins_ULTIMAKER_OLD.h rename to Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index f0c048f5ab3d..dd9aaf1292ab 100644 --- a/Marlin/src/pins/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h @@ -36,7 +36,7 @@ * the revisions provided inconsistent information. * * As best I can determine: - * 1.5.3 boards should use the pins_ULTIMAKER.h file which means the BOARD_NAME + * 1.5.3 boards should use the pins_ULTIMAKER.h file which means the BOARD_INFO_NAME * define in this file should say 1.5.3 rather than 1.5.4 * This file is meant for 1.1 - 1.3 boards. * The endstops for the 1.0 boards use different definitions than on the 1.1 - 1.3 @@ -64,9 +64,17 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif +#ifdef BOARD_REV_1_1_TO_1_3 + #define BOARD_INFO_NAME "Ultimaker 1.1-1.3" +#elif defined(BOARD_REV_1_0) + #define BOARD_INFO_NAME "Ultimaker 1.0" +#elif defined(BOARD_REV_1_5) + #define BOARD_INFO_NAME "Ultimaker 1.5" +#else + #define BOARD_INFO_NAME "Ultimaker 1.5.4+" +#endif #define DEFAULT_MACHINE_NAME "Ultimaker" #define DEFAULT_SOURCE_CODE_URL "https://github.com/Ultimaker/Marlin" -#define BOARD_NAME "Ultimaker <1.5.4" // // Limit Switches @@ -179,7 +187,7 @@ #define LCD_PINS_D6 5 #define LCD_PINS_D7 6 - // buttons are directly attached + // Buttons directly attached #define BTN_EN1 40 #define BTN_EN2 42 #define BTN_ENC 19 @@ -188,7 +196,7 @@ #else // !NEWPANEL - Old style panel with shift register - // buttons are attached to a shift register + // Buttons attached to a shift register #define SHIFT_CLK 38 #define SHIFT_LD 42 #define SHIFT_OUT 40 @@ -234,13 +242,13 @@ */ #if EXTRUDERS == 1 #define SPINDLE_DIR_PIN 43 - #define SPINDLE_LASER_PWM_PIN 45 // MUST BE HARDWARE PWM - #define SPINDLE_LASER_ENA_PIN 41 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 45 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN 41 // 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_ENA_PIN 40 // Pin should have a pullup! (Probably pin 6 on the 10-pin + #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM - Special precautions usually needed. + #define SPINDLE_LASER_ENA_PIN 40 // Pullup! (Probably pin 6 on the 10-pin // connector closest to the E0 socket) #endif #endif diff --git a/Marlin/src/pins/pins_VORON.h b/Marlin/src/pins/ramps/pins_VORON.h similarity index 97% rename from Marlin/src/pins/pins_VORON.h rename to Marlin/src/pins/ramps/pins_VORON.h index 13c93e1879a0..43c33171644d 100644 --- a/Marlin/src/pins/pins_VORON.h +++ b/Marlin/src/pins/ramps/pins_VORON.h @@ -26,7 +26,7 @@ * See https://github.com/mzbotreprap/VORON/blob/master/Firmware/Marlin/pins_RAMPS_VORON.h */ -#define BOARD_NAME "VORON Design v2" +#define BOARD_INFO_NAME "VORON Design v2" #define RAMPS_D8_PIN 11 diff --git a/Marlin/src/pins/pins_ZRIB_V20.h b/Marlin/src/pins/ramps/pins_ZRIB_V20.h similarity index 100% rename from Marlin/src/pins/pins_ZRIB_V20.h rename to Marlin/src/pins/ramps/pins_ZRIB_V20.h diff --git a/Marlin/src/pins/pins_Z_BOLT_X_SERIES.h b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h similarity index 67% rename from Marlin/src/pins/pins_Z_BOLT_X_SERIES.h rename to Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h index fa25b83ebd01..8545dc488acf 100644 --- a/Marlin/src/pins/pins_Z_BOLT_X_SERIES.h +++ b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h @@ -25,23 +25,13 @@ * Z-Bolt X Series board – based on Arduino Mega2560 */ -#if HOTENDS > 4 || E_STEPPERS > 4 +#ifndef __AVR_ATmega2560__ + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#elif HOTENDS > 4 || E_STEPPERS > 4 #error "Z-Bolt X Series board supports up to 4 hotends / E-steppers." #endif -#define BOARD_NAME "Z-Bolt X Series" - -#if ENABLED(TARGET_LPC1768) - #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768." -#elif defined(__STM32F1__) - #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1." -#endif - -#if NONE(IS_RAMPS_SMART, IS_RAMPS_DUO, IS_RAMPS4DUE, TARGET_LPC1768) - #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) - #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" - #endif -#endif +#define BOARD_INFO_NAME "Z-Bolt X Series" // // Servos @@ -165,13 +155,11 @@ #define PS_ON_PIN 12 #endif -#define AUX2_PINS_FREE !( BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD) ) - #if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN) - #if NUM_SERVOS <= 1 // try to use servo connector first - #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM - #elif AUX2_PINS_FREE - #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM + #if NUM_SERVOS <= 1 // Prefer the servo connector + #define CASE_LIGHT_PIN 6 // Hardware PWM + #elif HAS_FREE_AUX2_PINS + #define CASE_LIGHT_PIN 44 // Hardware PWM #endif #endif @@ -179,19 +167,17 @@ // M3/M4/M5 - Spindle/Laser Control // #if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) - #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first - #define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM + #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // Prefer the servo connector + #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM #define SPINDLE_DIR_PIN 5 - #elif AUX2_PINS_FREE - #define SPINDLE_LASER_ENA_PIN 40 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM + #elif HAS_FREE_AUX2_PINS + #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM #define SPINDLE_DIR_PIN 65 #endif #endif -#undef AUX2_PINS_FREE - // // TMC software SPI // @@ -230,29 +216,73 @@ // Software serial // - #define X_SERIAL_TX_PIN 40 - #define X_SERIAL_RX_PIN 63 - #define X2_SERIAL_TX_PIN -1 - #define X2_SERIAL_RX_PIN -1 + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN 40 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN 63 + #endif + #ifndef X2_SERIAL_TX_PIN + #define X2_SERIAL_TX_PIN -1 + #endif + #ifndef X2_SERIAL_RX_PIN + #define X2_SERIAL_RX_PIN -1 + #endif - #define Y_SERIAL_TX_PIN 59 - #define Y_SERIAL_RX_PIN 64 - #define Y2_SERIAL_TX_PIN -1 - #define Y2_SERIAL_RX_PIN -1 + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN 59 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN 64 + #endif + #ifndef Y2_SERIAL_TX_PIN + #define Y2_SERIAL_TX_PIN -1 + #endif + #ifndef Y2_SERIAL_RX_PIN + #define Y2_SERIAL_RX_PIN -1 + #endif - #define Z_SERIAL_TX_PIN 42 - #define Z_SERIAL_RX_PIN 65 - #define Z2_SERIAL_TX_PIN -1 - #define Z2_SERIAL_RX_PIN -1 + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN 42 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN 65 + #endif + #ifndef Z2_SERIAL_TX_PIN + #define Z2_SERIAL_TX_PIN -1 + #endif + #ifndef Z2_SERIAL_RX_PIN + #define Z2_SERIAL_RX_PIN -1 + #endif - #define E0_SERIAL_TX_PIN 44 - #define E0_SERIAL_RX_PIN 66 - #define E1_SERIAL_TX_PIN -1 - #define E1_SERIAL_RX_PIN -1 - #define E2_SERIAL_TX_PIN -1 - #define E2_SERIAL_RX_PIN -1 - #define E3_SERIAL_TX_PIN -1 - #define E3_SERIAL_RX_PIN -1 - #define E4_SERIAL_TX_PIN -1 - #define E4_SERIAL_RX_PIN -1 + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN 44 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN 66 + #endif + #ifndef E1_SERIAL_TX_PIN + #define E1_SERIAL_TX_PIN -1 + #endif + #ifndef E1_SERIAL_RX_PIN + #define E1_SERIAL_RX_PIN -1 + #endif + #ifndef E2_SERIAL_TX_PIN + #define E2_SERIAL_TX_PIN -1 + #endif + #ifndef E2_SERIAL_RX_PIN + #define E2_SERIAL_RX_PIN -1 + #endif + #ifndef E3_SERIAL_TX_PIN + #define E3_SERIAL_TX_PIN -1 + #endif + #ifndef E3_SERIAL_RX_PIN + #define E3_SERIAL_RX_PIN -1 + #endif + #ifndef E4_SERIAL_TX_PIN + #define E4_SERIAL_TX_PIN -1 + #endif + #ifndef E4_SERIAL_RX_PIN + #define E4_SERIAL_RX_PIN -1 + #endif #endif diff --git a/Marlin/src/pins/pins_ADSK.h b/Marlin/src/pins/sam/pins_ADSK.h similarity index 99% rename from Marlin/src/pins/pins_ADSK.h rename to Marlin/src/pins/sam/pins_ADSK.h index e18a14dedc02..c502f076718b 100644 --- a/Marlin/src/pins/pins_ADSK.h +++ b/Marlin/src/pins/sam/pins_ADSK.h @@ -25,7 +25,7 @@ * Arduino DUE Shield Kit (ADSK) pin assignments */ -#define BOARD_NAME "ADSK" +#define BOARD_INFO_NAME "ADSK" #if !defined(__SAM3X8E__) && !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) #error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'" diff --git a/Marlin/src/pins/pins_ALLIGATOR_R2.h b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h similarity index 98% rename from Marlin/src/pins/pins_ALLIGATOR_R2.h rename to Marlin/src/pins/sam/pins_ALLIGATOR_R2.h index 538f4b4f506c..75dd0046480f 100644 --- a/Marlin/src/pins/pins_ALLIGATOR_R2.h +++ b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h @@ -30,7 +30,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "Alligator Board R2" +#define BOARD_INFO_NAME "Alligator Board R2" // // Servos diff --git a/Marlin/src/pins/pins_ARCHIM1.h b/Marlin/src/pins/sam/pins_ARCHIM1.h similarity index 97% rename from Marlin/src/pins/pins_ARCHIM1.h rename to Marlin/src/pins/sam/pins_ARCHIM1.h index 73f78ba1e509..83a68e776fd4 100644 --- a/Marlin/src/pins/pins_ARCHIM1.h +++ b/Marlin/src/pins/sam/pins_ARCHIM1.h @@ -41,7 +41,13 @@ #error "Oops! Select 'Archim' in 'Tools > Board.'" #endif -#define BOARD_NAME "Archim 1.0" +#define BOARD_INFO_NAME "Archim 1.0" + +// +// Timers +// +#define STEP_TIMER_NUM 3 +#define HAL_STEP_TIMER_ISR() void TC3_Handler() // // Items marked * have been altered from Archim v1.0 diff --git a/Marlin/src/pins/pins_ARCHIM2.h b/Marlin/src/pins/sam/pins_ARCHIM2.h similarity index 93% rename from Marlin/src/pins/pins_ARCHIM2.h rename to Marlin/src/pins/sam/pins_ARCHIM2.h index 69ea78715d5e..504e937f9fe4 100644 --- a/Marlin/src/pins/pins_ARCHIM2.h +++ b/Marlin/src/pins/sam/pins_ARCHIM2.h @@ -43,7 +43,7 @@ #error "Archim2 requires Software SPI. Enable TMC_USE_SW_SPI in Configuration_adv.h." #endif -#define BOARD_NAME "Archim 2.0" +#define BOARD_INFO_NAME "Archim 2.0" // // Items marked * have been altered from Archim v1.0 @@ -149,9 +149,15 @@ // Required for the Archim2 board. // #if ENABLED(TMC_USE_SW_SPI) - #define TMC_SW_MOSI 28 // PD3 - #define TMC_SW_MISO 26 // PD1 - #define TMC_SW_SCK 27 // PD2 + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI 28 // PD3 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO 26 // PD1 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK 27 // PD2 + #endif #endif // @@ -208,6 +214,10 @@ #define GPIO_PA18_J20_21 71 // D71 PA17 (Header J20 21) #define GPIO_PA17_J20_22 70 // D70 PA17 (Header J20 22) +// Case Light + +#define CASE_LIGHT_PIN GPIO_PB1_J20_5 + // 2MB SPI Flash #define SPI_FLASH_SS 52 // D52 PB21 @@ -225,7 +235,7 @@ // // LCD / Controller // -#if HAS_SPI_LCD +#if HAS_SPI_LCD || TOUCH_UI_ULTIPANEL || ENABLED(TOUCH_UI_FTDI_EVE) #define BEEPER_PIN 23 // D24 PA15_CTS1 #define LCD_PINS_RS 17 // D17 PA12_RXD1 #define LCD_PINS_ENABLE 24 // D23 PA14_RTS1 @@ -236,10 +246,10 @@ #define SD_DETECT_PIN 2 // D2 PB25_TIOA0 - #if ENABLED(NEWPANEL) + #if ENABLED(ULTIPANEL) || TOUCH_UI_ULTIPANEL || ENABLED(TOUCH_UI_FTDI_EVE) // Buttons on AUX-2 #define BTN_EN1 60 // D60 PA3_TIOB1 #define BTN_EN2 13 // D13 PB27_TIOB0 #define BTN_ENC 16 // D16 PA13_TXD1 // the click - #endif // NEWPANEL + #endif // ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/pins_DUE3DOM.h b/Marlin/src/pins/sam/pins_DUE3DOM.h similarity index 99% rename from Marlin/src/pins/pins_DUE3DOM.h rename to Marlin/src/pins/sam/pins_DUE3DOM.h index 2eb79c9dceb3..731e31defad6 100644 --- a/Marlin/src/pins/pins_DUE3DOM.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "DUE3DOM" +#define BOARD_INFO_NAME "DUE3DOM" // // Servos diff --git a/Marlin/src/pins/pins_DUE3DOM_MINI.h b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h similarity index 99% rename from Marlin/src/pins/pins_DUE3DOM_MINI.h rename to Marlin/src/pins/sam/pins_DUE3DOM_MINI.h index 3783b7612d56..ed9781388a5b 100644 --- a/Marlin/src/pins/pins_DUE3DOM_MINI.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "DUE3DOM MINI" +#define BOARD_INFO_NAME "DUE3DOM MINI" // // Servos diff --git a/Marlin/src/pins/pins_PRINTRBOARD_G2.h b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h similarity index 97% rename from Marlin/src/pins/pins_PRINTRBOARD_G2.h rename to Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h index b23c1af084c2..d5cc3bed6a5f 100644 --- a/Marlin/src/pins/pins_PRINTRBOARD_G2.h +++ b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h @@ -29,8 +29,8 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "PRINTRBOARD_G2" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "PRINTRBOARD_G2" #endif // @@ -126,7 +126,7 @@ #define MOTOR_CURRENT_PWM_Y_PIN 64 // PB19 MOTOR 3 #define MOTOR_CURRENT_PWM_E_PIN 61 // PA2 MOTOR 4 -//#define DEFAULT_PWM_MOTOR_CURRENT { 300, 400, 1000} // XY Z E0, 1000 = 1000mAh +#define DEFAULT_PWM_MOTOR_CURRENT { 300, 400, 1000} // XY Z E0, 1000 = 1000mAh // // Temperature Sensors diff --git a/Marlin/src/pins/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h similarity index 98% rename from Marlin/src/pins/pins_RADDS.h rename to Marlin/src/pins/sam/pins_RADDS.h index 66b06c2c43bd..85db7492e32d 100644 --- a/Marlin/src/pins/pins_RADDS.h +++ b/Marlin/src/pins/sam/pins_RADDS.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "RADDS" +#define BOARD_INFO_NAME "RADDS" // // Servos @@ -201,9 +201,8 @@ #define FIL_RUNOUT_PIN 39 // SERVO2_PIN #endif -// I2C EEPROM with 8K of space #define I2C_EEPROM -#define E2END 0x1FFF +#define E2END 0x1FFF // 8KB // // LCD / Controller diff --git a/Marlin/src/pins/pins_RAMPS4DUE.h b/Marlin/src/pins/sam/pins_RAMPS4DUE.h similarity index 93% rename from Marlin/src/pins/pins_RAMPS4DUE.h rename to Marlin/src/pins/sam/pins_RAMPS4DUE.h index a4ed62bb0744..36c0717bce8c 100644 --- a/Marlin/src/pins/pins_RAMPS4DUE.h +++ b/Marlin/src/pins/sam/pins_RAMPS4DUE.h @@ -43,19 +43,14 @@ #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "RAMPS4DUE" - +#define BOARD_INFO_NAME "RAMPS4DUE" #define IS_RAMPS4DUE -#include "pins_RAMPS.h" // // Temperature Sensors // -#undef TEMP_0_PIN #define TEMP_0_PIN 9 // Analog Input - -#undef TEMP_1_PIN #define TEMP_1_PIN -1 // Analog Input - -#undef TEMP_BED_PIN #define TEMP_BED_PIN 10 // Analog Input + +#include "../ramps/pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_RAMPS_DUO.h b/Marlin/src/pins/sam/pins_RAMPS_DUO.h similarity index 90% rename from Marlin/src/pins/pins_RAMPS_DUO.h rename to Marlin/src/pins/sam/pins_RAMPS_DUO.h index 95a4daa5bcdb..d63d9a32a812 100644 --- a/Marlin/src/pins/pins_RAMPS_DUO.h +++ b/Marlin/src/pins/sam/pins_RAMPS_DUO.h @@ -47,10 +47,10 @@ #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "RAMPS Duo" +#define BOARD_INFO_NAME "RAMPS Duo" #define IS_RAMPS_DUO -#include "pins_RAMPS.h" +#include "../ramps/pins_RAMPS.h" // // Temperature Sensors @@ -67,9 +67,9 @@ // SPI for Max6675 or Max31855 Thermocouple #undef MAX6675_SS_PIN #if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 69 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 69 // Don't use 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS_PIN 69 // 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_PIN 69 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h similarity index 97% rename from Marlin/src/pins/pins_RAMPS_FD_V1.h rename to Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index 684489403a48..5add612cc1ea 100644 --- a/Marlin/src/pins/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -32,8 +32,8 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS-FD v1" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "RAMPS-FD v1" #endif #define INVERTED_HEATER_PINS @@ -205,7 +205,7 @@ #endif // HAS_SPI_LCD -#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) +#if HAS_TMC220x /** * TMC2208/TMC2209 stepper drivers * @@ -230,6 +230,6 @@ // #if HOTENDS < 3 && HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) #define SPINDLE_LASER_ENA_PIN 45 // Use E2 ENA - #define SPINDLE_LASER_PWM_PIN 12 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_PWM_PIN 12 // Hardware PWM #define SPINDLE_DIR_PIN 47 // Use E2 DIR #endif diff --git a/Marlin/src/pins/pins_RAMPS_FD_V2.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h similarity index 97% rename from Marlin/src/pins/pins_RAMPS_FD_V2.h rename to Marlin/src/pins/sam/pins_RAMPS_FD_V2.h index d4f25af16de1..22fdafd68ec7 100644 --- a/Marlin/src/pins/pins_RAMPS_FD_V2.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V2.h @@ -28,7 +28,7 @@ * Use 1k thermistor tables */ -#define BOARD_NAME "RAMPS-FD v2" +#define BOARD_INFO_NAME "RAMPS-FD v2" #ifndef E0_CS_PIN #define E0_CS_PIN 69 // moved from A13 to A15 on v2.2, if not earlier diff --git a/Marlin/src/pins/pins_RAMPS_SMART.h b/Marlin/src/pins/sam/pins_RAMPS_SMART.h similarity index 91% rename from Marlin/src/pins/pins_RAMPS_SMART.h rename to Marlin/src/pins/sam/pins_RAMPS_SMART.h index cd65aef627af..619b2d594daf 100644 --- a/Marlin/src/pins/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/sam/pins_RAMPS_SMART.h @@ -64,10 +64,10 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "RAMPS-SMART" +#define BOARD_INFO_NAME "RAMPS-SMART" #define IS_RAMPS_SMART -#include "pins_RAMPS.h" +#include "../ramps/pins_RAMPS.h" // I2C EEPROM with 4K of space #define I2C_EEPROM @@ -90,9 +90,9 @@ // SPI for Max6675 or Max31855 Thermocouple #undef MAX6675_SS_PIN #if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 67 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 67 // Don't use 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS_PIN 67 // 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_PIN 67 // Don't use 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h similarity index 99% rename from Marlin/src/pins/pins_RURAMPS4D_11.h rename to Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 85dc9eaea601..45540e8dad5a 100644 --- a/Marlin/src/pins/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -36,7 +36,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "RuRAMPS4Due v1.1" +#define BOARD_INFO_NAME "RuRAMPS4Due v1.1" // // Servos @@ -118,7 +118,7 @@ //#define E3_MS2_PIN ? //#define E3_MS3_PIN ? -#if USES_Z_MIN_PROBE_ENDSTOP +#if HAS_CUSTOM_PROBE_PIN #define Z_MIN_PROBE_PIN 49 #endif diff --git a/Marlin/src/pins/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h similarity index 98% rename from Marlin/src/pins/pins_RURAMPS4D_13.h rename to Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 1c22f8f5a0ba..c8ff71673bf3 100644 --- a/Marlin/src/pins/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -36,7 +36,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "RuRAMPS4Due v1.3" +#define BOARD_INFO_NAME "RuRAMPS4Due v1.3" // // Servos @@ -106,7 +106,7 @@ #define E2_CS_PIN 61 #endif -#if USES_Z_MIN_PROBE_ENDSTOP +#if HAS_CUSTOM_PROBE_PIN #define Z_MIN_PROBE_PIN 49 #endif diff --git a/Marlin/src/pins/pins_ULTRATRONICS_PRO.h b/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h similarity index 98% rename from Marlin/src/pins/pins_ULTRATRONICS_PRO.h rename to Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h index b77469b0d890..94fb7cddc107 100644 --- a/Marlin/src/pins/pins_ULTRATRONICS_PRO.h +++ b/Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "Ultratronics v1.0" +#define BOARD_INFO_NAME "Ultratronics v1.0" // // Servos diff --git a/Marlin/src/pins/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h similarity index 97% rename from Marlin/src/pins/pins_ANET_10.h rename to Marlin/src/pins/sanguino/pins_ANET_10.h index b10a7cfa08a6..6e49bad6161e 100644 --- a/Marlin/src/pins/pins_ANET_10.h +++ b/Marlin/src/pins/sanguino/pins_ANET_10.h @@ -93,7 +93,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Board' and 'ATmega1284P' in 'Tools > Processor.' (For PlatformIO, use 'melzi' or 'melzi_optiboot.')" #endif -#define BOARD_NAME "Anet 1.0" +#define BOARD_INFO_NAME "Anet 1.0" // // Limit Switches @@ -175,15 +175,9 @@ #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 BOARD_ST7920_DELAY_1 DELAY_NS(0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(63) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #define STD_ENCODER_PULSES_PER_STEP 4 #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 #endif diff --git a/Marlin/src/pins/pins_AZTEEG_X1.h b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h similarity index 96% rename from Marlin/src/pins/pins_AZTEEG_X1.h rename to Marlin/src/pins/sanguino/pins_AZTEEG_X1.h index 8c10bc8fbfc6..4140dc4b950c 100644 --- a/Marlin/src/pins/pins_AZTEEG_X1.h +++ b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h @@ -25,6 +25,6 @@ * Azteeg X1 pin assignments */ -#define BOARD_NAME "Azteeg X1" +#define BOARD_INFO_NAME "Azteeg X1" #include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/src/pins/pins_GEN3_MONOLITHIC.h b/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h similarity index 98% rename from Marlin/src/pins/pins_GEN3_MONOLITHIC.h rename to Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h index e48b340e1f05..3059f6c898b4 100644 --- a/Marlin/src/pins/pins_GEN3_MONOLITHIC.h +++ b/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h @@ -54,7 +54,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Board.'" #endif -#define BOARD_NAME "Gen3 Monolithic" +#define BOARD_INFO_NAME "Gen3 Monolithic" #define DEBUG_PIN 0 // diff --git a/Marlin/src/pins/pins_GEN3_PLUS.h b/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h similarity index 98% rename from Marlin/src/pins/pins_GEN3_PLUS.h rename to Marlin/src/pins/sanguino/pins_GEN3_PLUS.h index 9b5f42caa6be..e370a888f375 100644 --- a/Marlin/src/pins/pins_GEN3_PLUS.h +++ b/Marlin/src/pins/sanguino/pins_GEN3_PLUS.h @@ -55,7 +55,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'" #endif -#define BOARD_NAME "Gen3+" +#define BOARD_INFO_NAME "Gen3+" // // Limit Switches diff --git a/Marlin/src/pins/pins_GEN6.h b/Marlin/src/pins/sanguino/pins_GEN6.h similarity index 92% rename from Marlin/src/pins/pins_GEN6.h rename to Marlin/src/pins/sanguino/pins_GEN6.h index 42abd001376f..294b4df2f5c7 100644 --- a/Marlin/src/pins/pins_GEN6.h +++ b/Marlin/src/pins/sanguino/pins_GEN6.h @@ -56,8 +56,8 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Gen6" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Gen6" #endif // @@ -106,7 +106,7 @@ // #define SDSS 17 #define DEBUG_PIN 0 -#define CASE_LIGHT_PIN 16 // MUST BE HARDWARE PWM +#define CASE_LIGHT_PIN 16 // Hardware PWM // RS485 pins #define TX_ENABLE_PIN 12 @@ -115,6 +115,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENA_PIN 5 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENA_PIN 5 // Pullup or pulldown! +#define SPINDLE_LASER_PWM_PIN 16 // Hardware PWM #define SPINDLE_DIR_PIN 6 diff --git a/Marlin/src/pins/pins_GEN6_DELUXE.h b/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h similarity index 97% rename from Marlin/src/pins/pins_GEN6_DELUXE.h rename to Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h index 359f4e64ac36..fc4d8b6e10bd 100644 --- a/Marlin/src/pins/pins_GEN6_DELUXE.h +++ b/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h @@ -51,6 +51,6 @@ */ -#define BOARD_NAME "Gen6 Deluxe" +#define BOARD_INFO_NAME "Gen6 Deluxe" #include "pins_GEN6.h" diff --git a/Marlin/src/pins/pins_GEN7_12.h b/Marlin/src/pins/sanguino/pins_GEN7_12.h similarity index 89% rename from Marlin/src/pins/pins_GEN7_12.h rename to Marlin/src/pins/sanguino/pins_GEN7_12.h index 2b9411feb3e1..53e4e04df86e 100644 --- a/Marlin/src/pins/pins_GEN7_12.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_12.h @@ -56,8 +56,8 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Gen7 v1.1 / 1.2" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Gen7 v1.1 / 1.2" #endif #ifndef GEN7_VERSION @@ -123,14 +123,14 @@ #define PS_ON_PIN 15 #if GEN7_VERSION < 13 - #define CASE_LIGHT_PIN 16 // MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 16 // 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 // Hardware PWM #endif // All these generations of Gen7 supply thermistor power // via PS_ON, so ignore bad thermistor readings -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 #define DEBUG_PIN 0 @@ -141,10 +141,10 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENA_PIN 10 // Pin should have a pullup/pulldown! +#define SPINDLE_LASER_ENA_PIN 10 // Pullup or 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 // 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 // Hardware PWM #endif diff --git a/Marlin/src/pins/pins_GEN7_13.h b/Marlin/src/pins/sanguino/pins_GEN7_13.h similarity index 97% rename from Marlin/src/pins/pins_GEN7_13.h rename to Marlin/src/pins/sanguino/pins_GEN7_13.h index d3802552434f..7f66ac1a9ab9 100644 --- a/Marlin/src/pins/pins_GEN7_13.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_13.h @@ -50,7 +50,7 @@ * */ -#define BOARD_NAME "Gen7 v1.3" +#define BOARD_INFO_NAME "Gen7 v1.3" #define GEN7_VERSION 13 // v1.3 #include "pins_GEN7_12.h" diff --git a/Marlin/src/pins/pins_GEN7_14.h b/Marlin/src/pins/sanguino/pins_GEN7_14.h similarity index 92% rename from Marlin/src/pins/pins_GEN7_14.h rename to Marlin/src/pins/sanguino/pins_GEN7_14.h index 6228db7ac406..df18f6e7812e 100644 --- a/Marlin/src/pins/pins_GEN7_14.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_14.h @@ -56,7 +56,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" #endif -#define BOARD_NAME "Gen7 v1.4" +#define BOARD_INFO_NAME "Gen7 v1.4" #define GEN7_VERSION 14 // v1.4 @@ -102,7 +102,7 @@ // Misc. Functions // #define PS_ON_PIN 15 -#define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM +#define CASE_LIGHT_PIN 15 // Hardware PWM // A pin for debugging #define DEBUG_PIN 0 @@ -114,6 +114,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENA_PIN 20 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENA_PIN 20 // Pullup or pulldown! +#define SPINDLE_LASER_PWM_PIN 16 // Hardware PWM #define SPINDLE_DIR_PIN 21 diff --git a/Marlin/src/pins/pins_GEN7_CUSTOM.h b/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h similarity index 94% rename from Marlin/src/pins/pins_GEN7_CUSTOM.h rename to Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h index 04689b2ca8a6..8605f0d4691b 100644 --- a/Marlin/src/pins/pins_GEN7_CUSTOM.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_CUSTOM.h @@ -59,7 +59,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" #endif -#define BOARD_NAME "Gen7 Custom" +#define BOARD_INFO_NAME "Gen7 Custom" // // Limit Switches @@ -104,7 +104,7 @@ // #define SDSS 31 // SCL pin of I2C header || CS Pin for SD Card support #define PS_ON_PIN 19 -#define CASE_LIGHT_PIN 15 // MUST BE HARDWARE PWM +#define CASE_LIGHT_PIN 15 // Hardware PWM // A pin for debugging #define DEBUG_PIN -1 @@ -134,6 +134,6 @@ // // M3/M4/M5 - Spindle/Laser Control // -#define SPINDLE_LASER_ENA_PIN 5 // Pin should have a pullup/pulldown! -#define SPINDLE_LASER_PWM_PIN 16 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENA_PIN 5 // Pullup or pulldown! +#define SPINDLE_LASER_PWM_PIN 16 // Hardware PWM #define SPINDLE_DIR_PIN 6 diff --git a/Marlin/src/pins/pins_MELZI.h b/Marlin/src/pins/sanguino/pins_MELZI.h similarity index 93% rename from Marlin/src/pins/pins_MELZI.h rename to Marlin/src/pins/sanguino/pins_MELZI.h index e4dcc427775e..ad0a58509b4f 100644 --- a/Marlin/src/pins/pins_MELZI.h +++ b/Marlin/src/pins/sanguino/pins_MELZI.h @@ -25,9 +25,8 @@ * Melzi pin assignments */ -#ifndef BOARD_NAME - #define BOARD_NAME "Melzi" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Melzi" #endif -#define IS_MELZI #include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/src/pins/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h similarity index 94% rename from Marlin/src/pins/pins_MELZI_CREALITY.h rename to Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index 2d08dbc551b9..66fbd4789009 100644 --- a/Marlin/src/pins/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -31,7 +31,7 @@ * See http://www.instructables.com/id/Burn-Arduino-Bootloader-with-Arduino-MEGA/ */ -#define BOARD_NAME "Melzi (Creality)" +#define BOARD_INFO_NAME "Melzi (Creality)" #include "pins_MELZI.h" @@ -53,19 +53,16 @@ #define LCD_PINS_ENABLE 17 // ST9720 DAT #define LCD_PINS_D4 30 // ST9720 CLK -#if DISABLED(SPEAKER) && ENABLED(BLTOUCH) +#if ENABLED(BLTOUCH) #define SERVO0_PIN 27 + #undef BEEPER_PIN #endif // 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) +#if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif #if ENABLED(MINIPANEL) diff --git a/Marlin/src/pins/pins_MELZI_MAKR3D.h b/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h similarity index 95% rename from Marlin/src/pins/pins_MELZI_MAKR3D.h rename to Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h index a9124245c35e..ef1f1332c1c9 100644 --- a/Marlin/src/pins/pins_MELZI_MAKR3D.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h @@ -25,5 +25,5 @@ * Melzi with ATmega1284 (MaKr3d version) pin assignments */ -#define BOARD_NAME "Melzi (ATmega1284)" +#define BOARD_INFO_NAME "Melzi (ATmega1284)" #include "pins_MELZI.h" diff --git a/Marlin/src/pins/pins_MELZI_MALYAN.h b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h similarity index 85% rename from Marlin/src/pins/pins_MELZI_MALYAN.h rename to Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h index 99671d671df1..fd3f482c06a9 100644 --- a/Marlin/src/pins/pins_MELZI_MALYAN.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h @@ -25,7 +25,7 @@ * Melzi (Malyan M150) pin assignments */ -#define BOARD_NAME "Melzi (Malyan)" +#define BOARD_INFO_NAME "Melzi (Malyan)" #include "pins_MELZI.h" #undef LCD_SDSS @@ -44,12 +44,8 @@ #define BTN_ENC 28 // 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) +#if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif diff --git a/Marlin/src/pins/pins_MELZI_TRONXY.h b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h similarity index 85% rename from Marlin/src/pins/pins_MELZI_TRONXY.h rename to Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h index bb8e2e32445b..d4b05e316e31 100644 --- a/Marlin/src/pins/pins_MELZI_TRONXY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h @@ -25,7 +25,7 @@ * Melzi pin assignments */ -#define BOARD_NAME "Melzi (Tronxy)" +#define BOARD_INFO_NAME "Melzi (Tronxy)" #include "pins_MELZI.h" #undef Z_ENABLE_PIN @@ -51,12 +51,8 @@ #define BTN_EN2 11 #define BTN_ENC 26 -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(0) +#if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(0) #endif diff --git a/Marlin/src/pins/pins_OMCA.h b/Marlin/src/pins/sanguino/pins_OMCA.h similarity index 99% rename from Marlin/src/pins/pins_OMCA.h rename to Marlin/src/pins/sanguino/pins_OMCA.h index b4b23b79062b..8c50483574e4 100644 --- a/Marlin/src/pins/pins_OMCA.h +++ b/Marlin/src/pins/sanguino/pins_OMCA.h @@ -81,7 +81,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Board' and 'ATmega644' or 'ATmega644P' in 'Tools > Processor.'" #endif -#define BOARD_NAME "Final OMCA" +#define BOARD_INFO_NAME "Final OMCA" // // Limit Switches diff --git a/Marlin/src/pins/pins_OMCA_A.h b/Marlin/src/pins/sanguino/pins_OMCA_A.h similarity index 99% rename from Marlin/src/pins/pins_OMCA_A.h rename to Marlin/src/pins/sanguino/pins_OMCA_A.h index 63eb362620f1..94a186241b5c 100644 --- a/Marlin/src/pins/pins_OMCA_A.h +++ b/Marlin/src/pins/sanguino/pins_OMCA_A.h @@ -80,7 +80,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Board' and ATmega644 in 'Tools > Processor.'" #endif -#define BOARD_NAME "Alpha OMCA" +#define BOARD_INFO_NAME "Alpha OMCA" // // Limit Switches diff --git a/Marlin/src/pins/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h similarity index 90% rename from Marlin/src/pins/pins_SANGUINOLOLU_11.h rename to Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index f94d7a03e987..9fc7d6f1a2f6 100644 --- a/Marlin/src/pins/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -56,8 +56,8 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Sanguinololu <1.2" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Sanguinololu <1.2" #endif // @@ -115,7 +115,7 @@ #endif -#if !defined(FAN_PIN) && (MB(AZTEEG_X1) || MB(STB_11) || ENABLED(IS_MELZI)) +#if !defined(FAN_PIN) && (MB(AZTEEG_X1, STB_11) || IS_MELZI) #define FAN_PIN 4 // Works for Panelolu2 too #endif @@ -132,14 +132,14 @@ //#define SDSS 24 #define SDSS 31 -#if ENABLED(IS_MELZI) +#if IS_MELZI #define LED_PIN 27 #elif MB(STB_11) #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED #endif #if NONE(SPINDLE_FEATURE, LASER_FEATURE) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, 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 // Hardware PWM - see if IO Header is available #endif /** @@ -160,7 +160,7 @@ #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 - #if ENABLED(IS_MELZI) + #if 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 @@ -187,7 +187,7 @@ #define DOGLCD_CS 17 #define LCD_BACKLIGHT_PIN 28 // PA3 - #elif ENABLED(IS_MELZI) + #elif IS_MELZI #define BEEPER_PIN 27 #define DOGLCD_CS 28 @@ -219,7 +219,7 @@ #if ENABLED(LCD_I2C_PANELOLU2) - #if ENABLED(IS_MELZI) + #if IS_MELZI #define BTN_ENC 29 #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi #else @@ -235,15 +235,9 @@ #define BTN_EN1 29 #define BTN_EN2 30 - #ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(188) - #endif - #ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(0) - #endif + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(188) + #define BOARD_ST7920_DELAY_3 DELAY_NS(0) #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards @@ -280,8 +274,8 @@ #if HAS_CUTTER #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, NEWPANEL) // try to use IO Header - #define SPINDLE_LASER_ENA_PIN 10 // Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM + #define SPINDLE_LASER_ENA_PIN 10 // Pullup or pulldown! + #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM #define SPINDLE_DIR_PIN 11 #elif !MB(MELZI) // use X stepper motor socket @@ -319,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_ENA_PIN 21 // Pin should have a pullup! + #define SPINDLE_LASER_PWM_PIN 15 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN 21 // Pullup! #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin #endif #endif diff --git a/Marlin/src/pins/pins_SANGUINOLOLU_12.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h similarity index 94% rename from Marlin/src/pins/pins_SANGUINOLOLU_12.h rename to Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h index 3ef9e1c95d20..f4b05e4f6ef1 100644 --- a/Marlin/src/pins/pins_SANGUINOLOLU_12.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h @@ -34,8 +34,8 @@ * STB_11 */ -#ifndef BOARD_NAME - #define BOARD_NAME "Sanguinololu 1.2" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Sanguinololu 1.2" #endif #define SANGUINOLOLU_V_1_2 diff --git a/Marlin/src/pins/pins_SETHI.h b/Marlin/src/pins/sanguino/pins_SETHI.h similarity index 97% rename from Marlin/src/pins/pins_SETHI.h rename to Marlin/src/pins/sanguino/pins_SETHI.h index 049526a8f1e0..79c3209b4bb9 100644 --- a/Marlin/src/pins/pins_SETHI.h +++ b/Marlin/src/pins/sanguino/pins_SETHI.h @@ -54,7 +54,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" #endif -#define BOARD_NAME "Sethi 3D_1" +#define BOARD_INFO_NAME "Sethi 3D_1" #ifndef GEN7_VERSION #define GEN7_VERSION 12 // v1.x @@ -115,7 +115,7 @@ // All these generations of Gen7 supply thermistor power // via PS_ON, so ignore bad thermistor readings -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 // our pin for debugging. #define DEBUG_PIN 0 diff --git a/Marlin/src/pins/pins_STB_11.h b/Marlin/src/pins/sanguino/pins_STB_11.h similarity index 96% rename from Marlin/src/pins/pins_STB_11.h rename to Marlin/src/pins/sanguino/pins_STB_11.h index 9f14f1b42117..9a79853467d8 100644 --- a/Marlin/src/pins/pins_STB_11.h +++ b/Marlin/src/pins/sanguino/pins_STB_11.h @@ -25,5 +25,6 @@ * STB V1.1 pin assignments */ -#define BOARD_NAME "STB V1.1" +#define BOARD_INFO_NAME "STB V1.1" + #include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/src/pins/sensitive_pins.h b/Marlin/src/pins/sensitive_pins.h index fc3a486c37ee..b0ec52b45c6b 100644 --- a/Marlin/src/pins/sensitive_pins.h +++ b/Marlin/src/pins/sensitive_pins.h @@ -360,7 +360,11 @@ #endif // HOTENDS > 1 #endif // HOTENDS -#define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN), +#define _BED_PINS +#if PIN_EXISTS(HEATER_BED) && PIN_EXISTS(TEMP_BED) + #undef _BED_PINS + #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN), +#endif // // Dual X, Dual Y, Multi-Z diff --git a/Marlin/src/pins/pins_ARMED.h b/Marlin/src/pins/stm32/pins_ARMED.h similarity index 61% rename from Marlin/src/pins/pins_ARMED.h rename to Marlin/src/pins/stm32/pins_ARMED.h index 396495ea8f03..495654a82cbf 100644 --- a/Marlin/src/pins/pins_ARMED.h +++ b/Marlin/src/pins/stm32/pins_ARMED.h @@ -23,42 +23,43 @@ #ifndef STM32F4 #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Arm'ed supports up to 2 hotends / E-steppers." #endif #ifndef ARMED_V1_0 #define ARMED_V1_1 #endif -#define DEFAULT_MACHINE_NAME "Arm'ed" - -#undef BOARD_NAME -#define BOARD_NAME "Arm'ed" +#undef BOARD_INFO_NAME // Defined on the command line by Arduino Core STM32 +#define BOARD_INFO_NAME "Arm'ed" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #define I2C_EEPROM -#undef E2END -#define E2END 0xFFF // EEPROM end address (4kB) - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Arm'ed supports up to 2 hotends / E-steppers." -#endif +#undef E2END // Defined in Arduino Core STM32 to be used with EEPROM emulation. This board uses a real EEPROM. +#define E2END 0xFFF // 4KB // // Limit Switches // -#define X_MIN_PIN PE0 -#define X_MAX_PIN -1 -#define Y_MIN_PIN PE1 -#define Y_MAX_PIN -1 -#define Z_MIN_PIN PE14 -#define Z_MAX_PIN -1 +#define X_STOP_PIN PE0 +#define Y_STOP_PIN PE1 +#define Z_STOP_PIN PE14 // // Z Probe (when not Z_MIN_PIN) // -// #ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN PA4 -// #endif +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PA4 +//#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA3 +#endif // // Steppers @@ -88,13 +89,12 @@ #define E0_STEP_PIN PB5 #define E0_DIR_PIN PB6 -#define E0_CS_PIN PB4 - -#ifdef ARMED_V1_0 - #define E0_ENABLE_PIN PB3 -#else +#ifdef ARMED_V1_1 #define E0_ENABLE_PIN PC12 +#else + #define E0_ENABLE_PIN PB3 #endif +#define E0_CS_PIN PB4 #ifdef ARMED_SWAP_X_E1 #define E1_STEP_PIN PD3 @@ -118,13 +118,13 @@ // // Heaters / Fans // -#define HEATER_0_PIN PA1 // PWM pin -#define HEATER_1_PIN PA2 // PWM pin -#define HEATER_BED_PIN PA0 // PWM pin +#define HEATER_0_PIN PA1 // Hardware PWM +#define HEATER_1_PIN PA2 // Hardware PWM +#define HEATER_BED_PIN PA0 // Hardware PWM -#define FAN_PIN PC6 // PWM pin, Part cooling fan -#define FAN1_PIN PC7 // PWM pin, Extruder fan -#define FAN2_PIN PC8 // PWM pin, Controller fan +#define FAN_PIN PC6 // Hardware PWM, Part cooling fan +#define FAN1_PIN PC7 // Hardware PWM, Extruder fan +#define FAN2_PIN PC8 // Hardware PWM, Controller fan // // Misc functions @@ -140,21 +140,49 @@ // #define SD_DETECT_PIN PA15 #define BEEPER_PIN PC9 -#define LCD_PINS_RS PE9 -#define LCD_PINS_ENABLE PE8 -#define LCD_PINS_D4 PB12 -#define LCD_PINS_D5 PB13 -#define LCD_PINS_D6 PB14 -#define LCD_PINS_D7 PB15 + +#if ENABLED(FYSETC_MINI_12864) + // + // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // + #define DOGLCD_A0 PE9 + #define DOGLCD_CS PE8 + + #define LCD_BACKLIGHT_PIN -1 + + #define LCD_RESET_PIN PB12 // Must be high or open for LCD to operate normally. + + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB13 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB14 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB15 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PB13 + #endif +#else + #define LCD_PINS_RS PE9 + #define LCD_PINS_ENABLE PE8 + #define LCD_PINS_D4 PB12 + #define LCD_PINS_D5 PB13 + #define LCD_PINS_D6 PB14 + #define LCD_PINS_D7 PB15 + + #if ENABLED(MKS_MINI_12864) + #define DOGLCD_CS PB13 + #define DOGLCD_A0 PB14 + #endif +#endif + #define BTN_EN1 PC4 #define BTN_EN2 PC5 #define BTN_ENC PC3 -// -// Filament runout detection -// -#define FIL_RUNOUT_PIN PA3 - // // Extension pins // diff --git a/Marlin/src/pins/pins_BEAST.h b/Marlin/src/pins/stm32/pins_BEAST.h similarity index 95% rename from Marlin/src/pins/pins_BEAST.h rename to Marlin/src/pins/stm32/pins_BEAST.h index 57efda845a28..7b1f61d918f0 100644 --- a/Marlin/src/pins/pins_BEAST.h +++ b/Marlin/src/pins/stm32/pins_BEAST.h @@ -29,14 +29,14 @@ * 21017 Victor Perez Marlin for stm32f1 test */ +#define BOARD_INFO_NAME "Beast STM32" #define DEFAULT_MACHINE_NAME "STM32F103RET6" -#define BOARD_NAME "Marlin for STM32" // Enable I2C_EEPROM for testing #define I2C_EEPROM -// Ignore temp readings during develpment. -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 // // Steppers @@ -86,7 +86,6 @@ // // Misc. Functions // -#define SDPOWER -1 #define SDSS PA15 #define LED_PIN PB2 @@ -143,7 +142,7 @@ #define LCD_PINS_D7 PB15 #if DISABLED(NEWPANEL) #define BEEPER_PIN 33 - // Buttons are attached to a shift register + // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 //#define SHIFT_LD 42 @@ -255,7 +254,7 @@ // Beeper on AUX-4 #define BEEPER_PIN 33 - // buttons are directly attached using AUX-2 + // Buttons directly attached to AUX-2 #if ENABLED(REPRAPWORLD_KEYPAD) #define BTN_EN1 64 #define BTN_EN2 59 @@ -284,7 +283,3 @@ #endif // NEWPANEL #endif // HAS_SPI_LCD - -#define U_MIN_PIN -1 -#define V_MIN_PIN -1 -#define W_MIN_PIN -1 diff --git a/Marlin/src/pins/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h similarity index 93% rename from Marlin/src/pins/pins_BLACK_STM32F407VE.h rename to Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h index 026648589e12..74a715a8d228 100644 --- a/Marlin/src/pins/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h @@ -27,22 +27,21 @@ * Shield - https://github.com/jmz52/Hardware */ -#pragma once - #if !defined(STM32F4) && !defined(STM32F4xx) #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "Black STM32F4VET6 supports up to 2 hotends / E-steppers." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Black STM32F4VET6" #endif #define DEFAULT_MACHINE_NAME "STM32F407VET6" -//#define BOARD_NAME "Black STM32F4VET6" //#define I2C_EEPROM -//#define E2END 0x1FFF // EEPROM end address (8kB) -#define EEPROM_EMULATED_WITH_SRAM - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "Black STM32F4VET6 supports up to 2 hotends / E-steppers." -#endif +//#define E2END 0x1FFF // 8KB +#define SRAM_EEPROM_EMULATION // // Servos @@ -89,7 +88,10 @@ #define TEMP_0_PIN PC0 // T0 #define TEMP_1_PIN PC1 // T1 #define TEMP_BED_PIN PC2 // TB -#define TEMP_CHAMBER_PIN PC3 // TC + +#ifndef TEMP_CHAMBER_PIN + #define TEMP_CHAMBER_PIN PC3 // TC +#endif // // Heaters / Fans diff --git a/Marlin/src/pins/stm32/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32/pins_BTT_BTT002_V1_0.h new file mode 100644 index 000000000000..7b275a7be68a --- /dev/null +++ b/Marlin/src/pins/stm32/pins_BTT_BTT002_V1_0.h @@ -0,0 +1,251 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#ifndef TARGET_STM32F4 + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "BIGTREE SKR Pro V1.1 supports up to 3 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "BIGTREE Btt002 1.0" + +#define SRAM_EEPROM_EMULATION + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// +// Servos +// +#define SERVO0_PIN PC3 + +// +// Limit Switches +// +#define X_MIN_PIN PD3 +#define X_MAX_PIN PD3 +#define Y_MIN_PIN PD2 +#define Y_MAX_PIN PD2 +#define Z_MIN_PIN PD1 +#define Z_MAX_PIN PD1 + +// +// Z Probe must be this pins ## +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PD1 +#endif + +// +// Steppers +// +#define X_STEP_PIN PA9 +#define X_DIR_PIN PA10 +#define X_ENABLE_PIN PA8 +#ifndef X_CS_PIN + #define X_CS_PIN PE2 +#endif + +#define Y_STEP_PIN PC8 +#define Y_DIR_PIN PC9 +#define Y_ENABLE_PIN PC7 + #ifndef Y_CS_PIN + #define Y_CS_PIN PE3 +#endif + +#define Z_STEP_PIN PD15 +#define Z_DIR_PIN PC6 +#define Z_ENABLE_PIN PD14 +#ifndef Z_CS_PIN + #define Z_CS_PIN PE4 +#endif + +#define E0_STEP_PIN PD12 +#define E0_DIR_PIN PD13 +#define E0_ENABLE_PIN PD11 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD7 +#endif + +/* +//SKR_PRO_V1.1 +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PE7 +#define E1_ENABLE_PIN PA3 +#ifndef E1_CS_PIN + #define E1_CS_PIN PG15 +#endif + +#define E2_STEP_PIN PD13 +#define E2_DIR_PIN PG9 +#define E2_ENABLE_PIN PF0 +#ifndef E2_CS_PIN + #define E2_CS_PIN PG12 +#endif +*/ +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PB15 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB14 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB13 + #endif +#endif + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial ## + // + #define X_SERIAL_TX_PIN PE2 + #define X_SERIAL_RX_PIN PE2 + + #define Y_SERIAL_TX_PIN PE3 + #define Y_SERIAL_RX_PIN PE3 + + #define Z_SERIAL_TX_PIN PE4 + #define Z_SERIAL_RX_PIN PE4 + + #define E0_SERIAL_TX_PIN PD7 + #define E0_SERIAL_RX_PIN PD7 + + //#define E1_SERIAL_TX_PIN PD1 + //#define E1_SERIAL_RX_PIN PD1 + + //#define E2_SERIAL_TX_PIN PD6 + //#define E2_SERIAL_RX_PIN PD6 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA2 // T1 <-> E0 +#define TEMP_1_PIN PA0 // T2 <-> E1 +//#define TEMP_2_PIN PC2 // T3 <-> E2 SKR_PRO +#define TEMP_BED_PIN PA1 // T0 <-> Bed + +// +// Heaters / Fans +// +#define HEATER_0_PIN PE6 // Heater0 +//#define HEATER_1_PIN PD14 // Heater1 +//#define HEATER_2_PIN PB0 // Heater1 +#define HEATER_BED_PIN PE5 // Hotbed +#define FAN_PIN PB9 // Fan0 +#define FAN1_PIN PB8 // Fan1 +//#define FAN2_PIN PE6 // Fan2 + +// HAL SPI pins group +#define SCK_PIN PA5 // SPI SCLK +#define MYSSEL PA4 // SPI SSEL +#define MISO_PIN PA6 // SPI MISO +#define MOSI_PIN PA7 // SPI MOSI + +// +// Misc. Functions +// +#define SDSS PA4 + +/** + * -------------------------------------SKR_MK3----------------------------------------------- + * _____ _____ | + * PA3 | · · | GND 5V | · · | GND | + * NRESET | · · | PC4(SD_DET) (LCD_D7) PE13 | · · | PE12 (LCD_D6) | + * (MOSI)PA7 | · · | PB0(BTN_EN2) (LCD_D5) PE11 | · · | PE10 (LCD_D4) | + * (SD_SS)PA4 | · · | PC5(BTN_EN1) (LCD_RS) PE8 | · · | PE9 (LCD_EN) | + * (SCK)PA5 | · · | PA6(MISO) (BTN_ENC) PB1 | · · | PE7 (BEEPER) | + *  ̄ ̄  ̄ ̄ | + * EXP2 EXP1 | + * --------------------------------------------------------------------------------------------- + */ +// +// LCDs and Controllers +// +#if HAS_SPI_LCD + #define BEEPER_PIN PE7 + #define BTN_ENC PB1 + + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PE12 + + #define BTN_EN1 PE9 + #define BTN_EN2 PE10 + + #define LCD_PINS_ENABLE PE13 + #define LCD_PINS_D4 PE11 + + #else + + #define LCD_PINS_RS PE8 + + #define BTN_EN1 PC5 + #define BTN_EN2 PB0 + #define SD_DETECT_PIN PC4 + + #define LCD_SDSS PA4 + + #define LCD_PINS_ENABLE PE9 + #define LCD_PINS_D4 PE10 + + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PE11 + #define LCD_PINS_D6 PE12 + #define LCD_PINS_D7 PE13 + #endif + + #endif + + // Alter timing for graphical display + #if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #endif + +#endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h new file mode 100644 index 000000000000..2618e3462e7a --- /dev/null +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h @@ -0,0 +1,226 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#ifndef TARGET_STM32F1 + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "BIGTREE SKR E3 DIP V1.0" + +// Release PB3/PB4 (TMC_SW Pins) from JTAG pins +#define DISABLE_JTAG + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +#define FLASH_EEPROM_EMULATION +#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB +#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) +#undef E2END +#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB + +// +// Servos +// +#define SERVO0_PIN PA1 + +// +// Limit Switches +// +#define X_STOP_PIN PC1 +#define Y_STOP_PIN PC0 +#define Z_STOP_PIN PC15 + +// +// Z Probe must be this pin +// +#define Z_MIN_PROBE_PIN PC14 + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PC2 +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PC7 +#define X_STEP_PIN PC6 +#define X_DIR_PIN PB15 +#ifndef X_CS_PIN + #define X_CS_PIN PC10 +#endif + +#define Y_ENABLE_PIN PB14 +#define Y_STEP_PIN PB13 +#define Y_DIR_PIN PB12 +#ifndef Y_CS_PIN + #define Y_CS_PIN PC11 +#endif + +#define Z_ENABLE_PIN PB11 +#define Z_STEP_PIN PB10 +#define Z_DIR_PIN PB2 +#ifndef Z_CS_PIN + #define Z_CS_PIN PC12 +#endif + +#define E0_ENABLE_PIN PB1 +#define E0_STEP_PIN PB0 +#define E0_DIR_PIN PC5 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD2 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PB5 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB4 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB3 + #endif +#endif + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PC10 + #define X_SERIAL_RX_PIN PC10 + + #define Y_SERIAL_TX_PIN PC11 + #define Y_SERIAL_RX_PIN PC11 + + #define Z_SERIAL_TX_PIN PC12 + #define Z_SERIAL_RX_PIN PC12 + + #define E0_SERIAL_TX_PIN PD2 + #define E0_SERIAL_RX_PIN PD2 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA0 // Analog Input +#define TEMP_BED_PIN PC3 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC8 // EXTRUDER +#define HEATER_BED_PIN PC9 // BED +#define FAN_PIN PA8 + +// +// USB connect control +// +#define USB_CONNECT_PIN PC13 +#define USB_CONNECT_INVERTING false + +#define SD_DETECT_PIN PC4 + +/** + * _____ + * 5V | · · | GND + * (LCD_EN) PB7 | · · | PB8 (LCD_RS) + * (LCD_D4) PB9 | · · | PA10 (BTN_EN2) + * RESET | · · | PA9 (BTN_EN1) + * (BTN_ENC) PB6 | · · | PA15 (BEEPER) + * ----- + * EXP1 + */ +#if HAS_SPI_LCD + #define BEEPER_PIN PA15 + #define BTN_ENC PB6 + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS PB8 + + #define BTN_EN1 PA9 + #define BTN_EN2 PA10 + + #define LCD_PINS_ENABLE PB7 + #define LCD_PINS_D4 PB9 + + #elif ENABLED(MKS_MINI_12864) + + /** Creality Ender-2 display pinout + * _____ + * 5V | · · | GND + * (MOSI) PB7 | · · | PB8 (LCD_RS) + * (LCD_A0) PB9 | · · | PA10 (BTN_EN2) + * RESET | · · | PA9 (BTN_EN1) + * (BTN_ENC) PB6 | · · | PA15 (SCK) + * ----- + * EXP1 + */ + + #define BTN_EN1 PA9 + #define BTN_EN2 PA10 + #define DOGLCD_CS PB8 + #define DOGLCD_A0 PB9 + #define DOGLCD_SCK PA15 + #define DOGLCD_MOSI PB7 + #define FORCE_SOFT_SPI + #define LCD_BACKLIGHT_PIN -1 + + #else + #error "Only CR10_STOCKDISPLAY and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_E3_DIP." + #endif + +#endif // HAS_SPI_LCD + +// +// SD Support +// +#define HAS_ONBOARD_SD + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#define ON_BOARD_SPI_DEVICE 1 //SPI1 +#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card diff --git a/Marlin/src/pins/pins_BIGTREE_SKR_MINI_E3.h b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h similarity index 54% rename from Marlin/src/pins/pins_BIGTREE_SKR_MINI_E3.h rename to Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h index 34f686ef689a..abb9e9a91208 100644 --- a/Marlin/src/pins/pins_BIGTREE_SKR_MINI_E3.h +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 @@ -19,20 +19,23 @@ * along with this program. If not, see . * */ +#pragma once #ifndef TARGET_STM32F1 #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "BIGTREE SKR MINI E3" -#endif - // Release PB3/PB4 (E0 STP/DIR) from JTAG pins #define DISABLE_JTAG -// Ignore temp readings during develpment. -//#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +#define FLASH_EEPROM_EMULATION +#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB +#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) +#undef E2END +#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB // // Servos @@ -55,7 +58,7 @@ // Filament Runout Sensor // #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PC15 + #define FIL_RUNOUT_PIN PC15 // "E0-STOP" #endif // @@ -77,17 +80,6 @@ #define E0_STEP_PIN PB3 #define E0_DIR_PIN PB4 -#if HAS_DRIVER(TMC2209) - /** - * TMC2209 stepper drivers - * Hardware serial communication ports. - */ - #define X_HARDWARE_SERIAL Serial4 - #define Y_HARDWARE_SERIAL Serial4 - #define Z_HARDWARE_SERIAL Serial4 - #define E0_HARDWARE_SERIAL Serial4 -#endif - // // Temperature Sensors // @@ -104,7 +96,7 @@ // // USB connect control // -#define USB_CONNECT PC13 +#define USB_CONNECT_PIN PC13 #define USB_CONNECT_INVERTING false #define SD_DETECT_PIN PC4 @@ -120,10 +112,12 @@ * EXP1 */ #if HAS_SPI_LCD - #define BEEPER_PIN PB5 - #define BTN_ENC PB6 #if ENABLED(CR10_STOCKDISPLAY) + + #define BEEPER_PIN PB5 + #define BTN_ENC PB6 + #define LCD_PINS_RS PB8 #define BTN_EN1 PA9 @@ -132,8 +126,55 @@ #define LCD_PINS_ENABLE PB7 #define LCD_PINS_D4 PB9 + #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! + + #define LCD_PINS_RS PB9 + #define LCD_PINS_ENABLE PB6 + #define LCD_PINS_D4 PB8 + #define LCD_PINS_D5 PA10 + #define LCD_PINS_D6 PA9 + #define LCD_PINS_D7 PB5 + #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! + + #elif ENABLED(MKS_MINI_12864) + + /** Creality Ender-2 display pinout + * _____ + * 5V | · · | GND + * (MOSI) PB7 | · · | PB8 (LCD_RS) + * (LCD_A0) PB9 | · · | PA10 (BTN_EN2) + * RESET | · · | PA9 (BTN_EN1) + * (BTN_ENC) PB6 | · · | PB5 (SCK) + * ----- + * EXP1 + */ + #define BTN_EN1 PA9 + #define BTN_EN2 PA10 + #define BTN_ENC PB6 + + #define DOGLCD_CS PB8 + #define DOGLCD_A0 PB9 + #define DOGLCD_SCK PB5 + #define DOGLCD_MOSI PB7 + #define FORCE_SOFT_SPI + #define LCD_BACKLIGHT_PIN -1 + #else - #error "Only CR10_STOCKDISPLAY is currently supported on the BIGTREE_SKR_MINI_E3." + + #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_MINI_E3." + #endif #endif // HAS_SPI_LCD + +// +// SD Support +// +#define HAS_ONBOARD_SD + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#define ON_BOARD_SPI_DEVICE 1 // SPI1 +#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card diff --git a/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_0.h b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_0.h new file mode 100644 index 000000000000..bd2078e5d98e --- /dev/null +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_0.h @@ -0,0 +1,37 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#include "pins_BTT_SKR_MINI_E3.h" + +#define BOARD_INFO_NAME "BIGTREE SKR Mini E3" + +/** + * TMC2209 stepper drivers + * Hardware serial communication ports. + */ +#if HAS_DRIVER(TMC2209) + #define X_HARDWARE_SERIAL Serial4 + #define Y_HARDWARE_SERIAL Serial4 + #define Z_HARDWARE_SERIAL Serial4 + #define E0_HARDWARE_SERIAL Serial4 +#endif diff --git a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_2.h similarity index 61% rename from Marlin/src/HAL/HAL_LPC1768/SanityCheck.h rename to Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_2.h index 6223e006df45..67da8571fb16 100644 --- a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_2.h @@ -21,14 +21,31 @@ */ #pragma once +#include "pins_BTT_SKR_MINI_E3.h" + +#define BOARD_INFO_NAME "BIGTREE SKR Mini E3 V1.2" + +#define NEOPIXEL_PIN PC7 // LED driving pin + /** - * Test LPC176x-specific configuration values for errors at compile-time. + * TMC2208/TMC2209 stepper drivers */ +#if HAS_TMC220x + // + // Software serial + // + #define X_SERIAL_TX_PIN PB15 + #define X_SERIAL_RX_PIN PB15 + + #define Y_SERIAL_TX_PIN PC6 + #define Y_SERIAL_RX_PIN PC6 + + #define Z_SERIAL_TX_PIN PC10 + #define Z_SERIAL_RX_PIN PC10 -//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) -// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" -//#endif + #define E0_SERIAL_TX_PIN PC11 + #define E0_SERIAL_RX_PIN PC11 -#if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) - #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI" + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 #endif diff --git a/Marlin/src/pins/pins_BIGTREE_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_V1_1.h similarity index 59% rename from Marlin/src/pins/pins_BIGTREE_SKR_MINI_V1_1.h rename to Marlin/src/pins/stm32/pins_BTT_SKR_MINI_V1_1.h index 35544950e1e6..3c6b673b6e4d 100644 --- a/Marlin/src/pins/pins_BIGTREE_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_V1_1.h @@ -25,15 +25,18 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "BIGTREE SKR mini V1.1" -#endif +#define BOARD_INFO_NAME "BIGTREE SKR Mini 1.1" //#define DISABLE_DEBUG #define DISABLE_JTAG -// Ignore temp readings during develpment. -//#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +#define FLASH_EEPROM_EMULATION +#define EEPROM_PAGE_SIZE (0x800) // 2KB +#define EEPROM_START_ADDRESS uint32(0x8000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) +#define E2END (EEPROM_PAGE_SIZE - 1) // // Limit Switches @@ -66,9 +69,15 @@ #define E0_ENABLE_PIN PC4 #if ENABLED(TMC_USE_SW_SPI) - #define TMC_SW_SCK PB3 - #define TMC_SW_MISO PB4 - #define TMC_SW_MOSI PB5 + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB3 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB4 + #endif + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PB5 + #endif #endif // @@ -102,43 +111,55 @@ #if HAS_SPI_LCD #define BEEPER_PIN PC10 #define BTN_ENC PC11 - #define LCD_PINS_RS PC12 - #define BTN_EN1 PD2 - #define BTN_EN2 PB8 + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PC15 + + #define BTN_EN1 PB6 + #define BTN_EN2 PC13 + + #define LCD_PINS_ENABLE PC14 + #define LCD_PINS_D4 PB7 + + #else + + #define LCD_PINS_RS PC12 + + #define BTN_EN1 PD2 + #define BTN_EN2 PB8 - #define LCD_PINS_ENABLE PB6 + #define LCD_PINS_ENABLE PB6 - #if ENABLED(FYSETC_MINI_12864) + #if ENABLED(FYSETC_MINI_12864) - #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PC13 - #define DOGLCD_A0 PC12 - #define DOGLCD_CS PB6 - #define DOGLCD_SCK PB3 - #define DOGLCD_MOSI PB5 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PC13 + #define DOGLCD_A0 PC12 + #define DOGLCD_CS PB6 + #define DOGLCD_SCK PB3 + #define DOGLCD_MOSI PB5 - #define FORCE_SOFT_SPI // SPI MODE3 + #define FORCE_SOFT_SPI // SPI MODE3 - #define LED_PIN PB7 // red pwm - //#define LED_PIN PC15 // green - //#define LED_PIN PC14 // blue + #define LED_PIN PB7 // red pwm + //#define LED_PIN PC15 // green + //#define LED_PIN PC14 // blue - //#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - // #ifndef RGB_LED_R_PIN - // #define RGB_LED_R_PIN PB7 - // #endif - // #ifndef RGB_LED_G_PIN - // #define RGB_LED_G_PIN PC15 - // #endif - // #ifndef RGB_LED_B_PIN - // #define RGB_LED_B_PIN PC14 - // #endif - //#elif ENABLED(FYSETC_MINI_12864_2_1) - // #define NEOPIXEL_PIN PB7 - //#endif + //#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + // #ifndef RGB_LED_R_PIN + // #define RGB_LED_R_PIN PB7 + // #endif + // #ifndef RGB_LED_G_PIN + // #define RGB_LED_G_PIN PC15 + // #endif + // #ifndef RGB_LED_B_PIN + // #define RGB_LED_B_PIN PC14 + // #endif + //#elif ENABLED(FYSETC_MINI_12864_2_1) + // #define NEOPIXEL_PIN PB7 + //#endif - #else // !FYSETC_MINI_12864 + #else // !FYSETC_MINI_12864 #define LCD_PINS_D4 PC13 #if ENABLED(ULTIPANEL) @@ -147,7 +168,9 @@ #define LCD_PINS_D7 PC14 #endif - #endif // !FYSETC_MINI_12864 + #endif // !FYSETC_MINI_12864 + + #endif #endif // HAS_SPI_LCD @@ -156,20 +179,20 @@ // // By default the onboard SD is enabled. -// To disable it and use an external SD (connected to LCD) -// enable STM32_SD_LCD. - -//#define STM32_SD_LCD +// set SDCARD_CONNECTION form 'ONBOARD' to 'LCD' and use an external SD (connected to LCD) +#define HAS_ONBOARD_SD +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif -#if ENABLED(STM32_SD_LCD) +#if SD_CONNECTION_IS(LCD) #define ENABLE_SPI3 #define SD_DETECT_PIN PB9 #define SCK_PIN PB3 #define MISO_PIN PB4 #define MOSI_PIN PB5 #define SS_PIN PA15 -#else - #define SDCARD_CONNECTION ONBOARD +#elif SD_CONNECTION_IS(ONBOARD) #define ENABLE_SPI1 #define SD_DETECT_PIN PA3 #define SCK_PIN PA5 @@ -177,13 +200,11 @@ #define MOSI_PIN PA7 #define SS_PIN PA4 #endif +#define ON_BOARD_SPI_DEVICE 1 //SPI1 +#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card -#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 HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif diff --git a/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h b/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h new file mode 100644 index 000000000000..dad46716fd1d --- /dev/null +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h @@ -0,0 +1,268 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#ifndef TARGET_STM32F4 + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "BIGTREE SKR Pro V1.1 supports up to 3 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "BIGTREE SKR Pro 1.1" // redefined? + +// Use one of these or SDCard-based Emulation will be used +//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation +//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation + +// +// Servos +// +#define SERVO0_PIN PA1 + +// +// Limit Switches +// +#define X_MIN_PIN PB10 +#define X_MAX_PIN PE15 +#define Y_MIN_PIN PE12 +#define Y_MAX_PIN PE10 +#define Z_MIN_PIN PG8 +#define Z_MAX_PIN PG5 + +// +// Z Probe must be this pins +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PA2 +#endif + +// +// Steppers +// +#define X_STEP_PIN PE9 +#define X_DIR_PIN PF1 +#define X_ENABLE_PIN PF2 +#ifndef X_CS_PIN + #define X_CS_PIN PA15 +#endif + +#define Y_STEP_PIN PE11 +#define Y_DIR_PIN PE8 +#define Y_ENABLE_PIN PD7 + #ifndef Y_CS_PIN + #define Y_CS_PIN PB8 +#endif + +#define Z_STEP_PIN PE13 +#define Z_DIR_PIN PC2 +#define Z_ENABLE_PIN PC0 +#ifndef Z_CS_PIN + #define Z_CS_PIN PB9 +#endif + +#define E0_STEP_PIN PE14 +#define E0_DIR_PIN PA0 +#define E0_ENABLE_PIN PC3 +#ifndef E0_CS_PIN + #define E0_CS_PIN PB3 +#endif + +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PE7 +#define E1_ENABLE_PIN PA3 +#ifndef E1_CS_PIN + #define E1_CS_PIN PG15 +#endif + +#define E2_STEP_PIN PD13 +#define E2_DIR_PIN PG9 +#define E2_ENABLE_PIN PF0 +#ifndef E2_CS_PIN + #define E2_CS_PIN PG12 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PC12 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PC11 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PC10 + #endif +#endif + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PC13 + #define X_SERIAL_RX_PIN PC13 + + #define Y_SERIAL_TX_PIN PE3 + #define Y_SERIAL_RX_PIN PE3 + + #define Z_SERIAL_TX_PIN PE1 + #define Z_SERIAL_RX_PIN PE1 + + #define E0_SERIAL_TX_PIN PD4 + #define E0_SERIAL_RX_PIN PD4 + + #define E1_SERIAL_TX_PIN PD1 + #define E1_SERIAL_RX_PIN PD1 + + #define E2_SERIAL_TX_PIN PD6 + #define E2_SERIAL_RX_PIN PD6 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PF4 // T1 <-> E0 +#define TEMP_1_PIN PF5 // T2 <-> E1 +#define TEMP_2_PIN PF6 // T3 <-> E2 +#define TEMP_BED_PIN PF3 // T0 <-> Bed + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB1 // Heater0 +#define HEATER_1_PIN PD14 // Heater1 +#define HEATER_2_PIN PB0 // Heater1 +#define HEATER_BED_PIN PD12 // Hotbed +#define FAN_PIN PC8 // Fan0 +#define FAN1_PIN PE5 // Fan1 +#define FAN2_PIN PE6 // Fan2 + +// +// Misc. Functions +// +#define SDSS PB12 + +/** + * _____ _____ + * NC | · · | GND 5V | · · | GND + * RESET | · · | PF12(SD_DETECT) (LCD_D7) PG7 | · · | PG6 (LCD_D6) + * (MOSI)PB15 | · · | PF11(BTN_EN2) (LCD_D5) PG3 | · · | PG2 (LCD_D4) + * (SD_SS)PB12 | · · | PG10(BTN_EN1) (LCD_RS) PD10 | · · | PD11 (LCD_EN) + * (SCK)PB13 | · · | PB14(MISO) (BTN_ENC) PA8 | · · | PG4 (BEEPER) + *  ̄ ̄  ̄ ̄ + * EXP2 EXP1 + */ + +// +// LCDs and Controllers +// +#if HAS_SPI_LCD + #define BEEPER_PIN PG4 + #define BTN_ENC PA8 + + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PG6 + + #define BTN_EN1 PD11 + #define BTN_EN2 PG2 + + #define LCD_PINS_ENABLE PG7 + #define LCD_PINS_D4 PG3 + + // CR10_Stock Display needs a different delay setting on SKR PRO v1.1, so undef it here. + // It will be defined again at the #HAS_GRAPHICAL_LCD section below. + #undef ST7920_DELAY_1 + #undef ST7920_DELAY_2 + #undef ST7920_DELAY_3 + + + #else + + #define LCD_PINS_RS PD10 + + #define BTN_EN1 PG10 + #define BTN_EN2 PF11 + #define SD_DETECT_PIN PF12 + + #define LCD_SDSS PB12 + + #define LCD_PINS_ENABLE PD11 + #define LCD_PINS_D4 PG2 + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS PD11 + #define DOGLCD_A0 PD10 + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PG2 // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PG3 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PG6 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PG7 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PG3 + #endif + #endif // !FYSETC_MINI_12864 + + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PG3 + #define LCD_PINS_D6 PG6 + #define LCD_PINS_D7 PG7 + #endif + + #endif + + // Alter timing for graphical display + #if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #endif + +#endif // HAS_SPI_LCD diff --git a/Marlin/src/pins/pins_CHITU3D.h b/Marlin/src/pins/stm32/pins_CHITU3D.h similarity index 94% rename from Marlin/src/pins/pins_CHITU3D.h rename to Marlin/src/pins/stm32/pins_CHITU3D.h index 59f6b66bb79a..48b57b35020b 100644 --- a/Marlin/src/pins/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32/pins_CHITU3D.h @@ -29,14 +29,14 @@ * 2017 Victor Perez Marlin for stm32f1 test */ +#define BOARD_INFO_NAME "Chitu3D" #define DEFAULT_MACHINE_NAME "STM32F103RET6" -#define BOARD_NAME "Chitu3d Marlin" // Enable I2C_EEPROM for testing //#define I2C_EEPROM -// Ignore temp readings during develpment. -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 // // Steppers @@ -84,7 +84,6 @@ // // Misc. Functions // -#define SDPOWER -1 #define SDSS -1 #define LED_PIN -1 #define CASE_LIGHT_PIN 8 @@ -142,12 +141,12 @@ #define LCD_PINS_D7 PB15 #if DISABLED(NEWPANEL) #define BEEPER_PIN 33 - // Buttons are attached to a shift register + // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + //#define SHIFT_CLK 38 + //#define SHIFT_LD 42 + //#define SHIFT_OUT 40 + //#define SHIFT_EN 17 #endif #endif @@ -253,7 +252,7 @@ // Beeper on AUX-4 #define BEEPER_PIN 33 - // buttons are directly attached using AUX-2 + // Buttons directly attached to AUX-2 #if ENABLED(REPRAPWORLD_KEYPAD) #define BTN_EN1 64 #define BTN_EN2 59 @@ -282,7 +281,3 @@ #endif // NEWPANEL #endif // HAS_SPI_LCD - -#define U_MIN_PIN -1 -#define V_MIN_PIN -1 -#define W_MIN_PIN -1 diff --git a/Marlin/src/pins/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h similarity index 85% rename from Marlin/src/pins/pins_FYSETC_AIO_II.h rename to Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h index 49879ba50d3e..d55bdcc150d0 100644 --- a/Marlin/src/pins/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h @@ -25,14 +25,24 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif -#define BOARD_NAME "FYSETC AIO II" -#define BOARD_WEBSITE_URL "https://fysetc.com" +#define BOARD_INFO_NAME "FYSETC AIO II" +#define BOARD_WEBSITE_URL "fysetc.com" + +#define DISABLE_JTAG #define pins_v2_20190128 // geo-f:add for new pins define -// Ignore temp readings during develpment. -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 +// +// Flash EEPROM Emulation +// +#define FLASH_EEPROM_EMULATION +#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB +#define EEPROM_START_ADDRESS uint32(0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) +#undef E2END +#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB // // Limit Switches // @@ -77,11 +87,11 @@ // // X:PA2 Y:PA3 Z:PB12 E:PB13 // changed for test -#define MOTOR_CURRENT_PWM_XY_PIN PA3 -#define MOTOR_CURRENT_PWM_Z_PIN PA2 // PB12 +//#define MOTOR_CURRENT_PWM_XY_PIN PA3 +//#define MOTOR_CURRENT_PWM_Z_PIN PA2 // PB12 //#define MOTOR_CURRENT_PWM_XY_PIN PB6 //#define MOTOR_CURRENT_PWM_Z_PIN PB7 // PB12 -#define MOTOR_CURRENT_PWM_E_PIN -1 // PB13 +//#define MOTOR_CURRENT_PWM_E_PIN -1 // PB13 // Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range #ifndef MOTOR_CURRENT_PWM_RANGE #define MOTOR_CURRENT_PWM_RANGE 1500 // geo-f:old 2000 @@ -135,7 +145,7 @@ #define DOGLCD_CS PB7 #endif - //#define LCD_CONTRAST 190 + //#define LCD_CONTRAST_INIT 190 //#define LCD_SCREEN_ROT_90 //#define LCD_SCREEN_ROT_180 //#define LCD_SCREEN_ROT_270 diff --git a/Marlin/src/pins/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h similarity index 84% rename from Marlin/src/pins/pins_FYSETC_CHEETAH.h rename to Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h index c3be9431a2a8..28b37cc8418b 100644 --- a/Marlin/src/pins/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h @@ -27,11 +27,19 @@ #define DEFAULT_MACHINE_NAME "3D Printer" -#define BOARD_NAME "FYSETC CHEETAH" -#define BOARD_WEBSITE_URL "https://fysetc.com" +#define BOARD_INFO_NAME "FYSETC Cheetah" +#define BOARD_WEBSITE_URL "fysetc.com" -// Ignore temp readings during develpment. -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +#define DISABLE_JTAG + +#define FLASH_EEPROM_EMULATION +#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB +#define EEPROM_START_ADDRESS uint32(0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) +#undef E2END +#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB // // Servos @@ -69,7 +77,7 @@ #define E0_DIR_PIN PC14 #define E0_ENABLE_PIN PC13 -#define X_HARDWARE_SERIAL MSerial2 // Port correct? +#define X_HARDWARE_SERIAL MSerial2 #define Y_HARDWARE_SERIAL MSerial2 #define Z_HARDWARE_SERIAL MSerial2 #define E0_HARDWARE_SERIAL MSerial2 @@ -110,7 +118,7 @@ //#define LCD_SCREEN_ROT_180 //#define LCD_SCREEN_ROT_270 - #if ENABLED(FYSETC_MINI_12864) || ENABLED(U8GLIB_ST7920) + #if EITHER(FYSETC_MINI_12864, U8GLIB_ST7920) #define FORCE_SOFT_SPI #endif #endif @@ -132,7 +140,7 @@ #define RGB_LED_B_PIN PB6 #endif - //#define LCD_CONTRAST 190 + //#define LCD_CONTRAST_INIT 190 #if ENABLED(NEWPANEL) #define BTN_EN1 PC11 diff --git a/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH_V12.h b/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH_V12.h new file mode 100644 index 000000000000..236bb17f6194 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH_V12.h @@ -0,0 +1,64 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#include "pins_FYSETC_CHEETAH.h" + +#undef X_HARDWARE_SERIAL +#undef Y_HARDWARE_SERIAL +#undef Z_HARDWARE_SERIAL +#undef E0_HARDWARE_SERIAL + +#undef RGB_LED_R_PIN +#undef RGB_LED_G_PIN +#undef RGB_LED_B_PIN + +#define FAN1_PIN PB0 // Fan1 + +#if HAS_TMC220x + + /** + * TMC2208/TMC2209 stepper drivers + */ + + // + // Software serial + // + #define X_SERIAL_TX_PIN PA11 + #define X_SERIAL_RX_PIN PA12 + + #define Y_SERIAL_TX_PIN PB6 + #define Y_SERIAL_RX_PIN PB7 + + #define Z_SERIAL_TX_PIN PB10 + #define Z_SERIAL_RX_PIN PB11 + + #define E0_SERIAL_TX_PIN PA2 + #define E0_SERIAL_RX_PIN PA3 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif diff --git a/Marlin/src/pins/stm32/pins_FYSETC_S6.h b/Marlin/src/pins/stm32/pins_FYSETC_S6.h new file mode 100644 index 000000000000..227fe4cd559e --- /dev/null +++ b/Marlin/src/pins/stm32/pins_FYSETC_S6.h @@ -0,0 +1,238 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#ifndef STM32F4 + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "RUMBA32 supports up to 3 hotends / E-steppers." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "FYSETC_S6" +#endif +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +#endif + +// change the prio to 3 , 2 is for software serial +//#define TEMP_TIMER_IRQ_PRIO 3 + +// +// EEPROM Emulation +// +#define FLASH_EEPROM_EMULATION +//#define SRAM_EEPROM_EMULATION + +// +// Limit Switches +// +#define X_MIN_PIN PB14 +#define X_MAX_PIN PA1 +#define Y_MIN_PIN PB13 +#define Y_MAX_PIN PA2 +#define Z_MIN_PIN PA0 +#define Z_MAX_PIN PA3 + +// +// Servos +// share with Z_MAX_PIN +// +#define SERVO0_PIN PA3 + +// +// Steppers +// +#define X_STEP_PIN PE11 +#define X_DIR_PIN PE10 +#define X_ENABLE_PIN PE12 +#define X_CS_PIN PE7 + +#define Y_STEP_PIN PD8 +#define Y_DIR_PIN PB12 +#define Y_ENABLE_PIN PD9 +#define Y_CS_PIN PE15 + +#define Z_STEP_PIN PD14 +#define Z_DIR_PIN PD13 +#define Z_ENABLE_PIN PD15 +#define Z_CS_PIN PD10 + +#define E0_STEP_PIN PD5 +#define E0_DIR_PIN PD6 +#define E0_ENABLE_PIN PD4 +#define E0_CS_PIN PD7 + +#define E1_STEP_PIN PE6 +#define E1_DIR_PIN PC13 +#define E1_ENABLE_PIN PE5 +#define E1_CS_PIN PC14 + +#define E2_STEP_PIN PE2 +#define E2_DIR_PIN PE4 +#define E2_ENABLE_PIN PE3 +#define E2_CS_PIN PC15 + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + */ + + // + // Software serial + // + #define X_SERIAL_TX_PIN PE9 + #define X_SERIAL_RX_PIN PE8 + + #define Y_SERIAL_TX_PIN PE14 + #define Y_SERIAL_RX_PIN PE13 + + #define Z_SERIAL_TX_PIN PD11 + #define Z_SERIAL_RX_PIN PD12 + + #define E0_SERIAL_TX_PIN PD3 + #define E0_SERIAL_RX_PIN PA15 + + #define E1_SERIAL_TX_PIN PC4 + #define E1_SERIAL_RX_PIN PC5 + + #define E2_SERIAL_TX_PIN PE1 + #define E2_SERIAL_RX_PIN PE0 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 +#define TEMP_1_PIN PC1 +#define TEMP_2_PIN PC2 +#define TEMP_BED_PIN PC3 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB3 +#define HEATER_1_PIN PB4 +#define HEATER_2_PIN PB15 +#define HEATER_BED_PIN PC8 + +#define FAN_PIN PB0 +#define FAN1_PIN PB1 +#define FAN2_PIN PB2 + +// +// SPI +// +#define SCK_PIN PA5 +#define MISO_PIN PA6 +#define MOSI_PIN PA7 + +// +// Misc. Functions +// +//#define LED_PIN PB14 +//#define BTN_PIN PC10 +//#define PS_ON_PIN PE11 +//#define KILL_PIN PC5 + +#define SDSS PA4 + +// +// LCD / Controller +// + +#define BEEPER_PIN PC9 +#define SD_DETECT_PIN PB10 + +#if ENABLED(FYSETC_MINI_12864) + // + // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // + #define DOGLCD_A0 PD2 + #define DOGLCD_CS PC11 + + //#define LCD_BACKLIGHT_PIN -1 + //#define KILL_PIN -1 + + #define LCD_RESET_PIN PC10 // Must be high or open for LCD to operate normally. + // Seems to work best if left open. + + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PC12 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PD0 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PD1 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PC12 + #endif + +#elif HAS_GRAPHICAL_LCD + #define LCD_PINS_RS PD2 + #define LCD_PINS_ENABLE PC11 + #define LCD_PINS_D4 PC10 + #define LCD_PINS_D5 PC12 + #define LCD_PINS_D6 PD0 + #define LCD_PINS_D7 PD1 + + #if ENABLED(MKS_MINI_12864) + #define DOGLCD_CS PC12 + #define DOGLCD_A0 PD0 + #endif + +#endif + +#if ENABLED(NEWPANEL) + #define BTN_EN1 PC6 + #define BTN_EN2 PC7 + #define BTN_ENC PA8 +#endif + +// Alter timing for graphical display +#if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(103) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(51) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(642) + #endif +#endif + +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB6 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB5 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB7 +#endif +#ifndef RGB_LED_W_PIN + #define RGB_LED_W_PIN -1 +#endif diff --git a/Marlin/src/pins/pins_STM32F4.h b/Marlin/src/pins/stm32/pins_GENERIC_STM32F4.h similarity index 88% rename from Marlin/src/pins/pins_STM32F4.h rename to Marlin/src/pins/stm32/pins_GENERIC_STM32F4.h index 7ce1d2d6c5fc..a55bd34bcb33 100644 --- a/Marlin/src/pins/pins_STM32F4.h +++ b/Marlin/src/pins/stm32/pins_GENERIC_STM32F4.h @@ -21,24 +21,28 @@ */ #pragma once +/** + * To build with Arduino IDE use "Discovery F407VG" + * To build with PlatformIO use environment "STM32F4" + */ #if !defined(STM32F4) && !defined(STM32F4xx) #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "STM32F4 supports up to 2 hotends / E-steppers." #endif +#define BOARD_INFO_NAME "Misc. STM32F4" #define DEFAULT_MACHINE_NAME "STM32F407VET6" -#define BOARD_NAME "STM32F4 Board" //#define I2C_EEPROM -#define E2END 0xFFF // EEPROM end address (4kB) - -// Ignore temp readings during develpment. -//#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE - -#if HOTENDS > 2 || E_STEPPERS > 2 - #error "STM32F4 supports up to 2 hotends / E-steppers." +#ifndef E2END + #define E2END 0xFFF // 4KB #endif +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + // // Limit Switches // @@ -179,14 +183,8 @@ // // ST7920 Delays // -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(96) -#endif - -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(48) -#endif - -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(715) +#if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif diff --git a/Marlin/src/pins/stm32/pins_GTM32_MINI.h b/Marlin/src/pins/stm32/pins_GTM32_MINI.h new file mode 100644 index 000000000000..36d7377ffae6 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_GTM32_MINI.h @@ -0,0 +1,230 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 24 May 2018 - @chepo for STM32F103VET6 + * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "GTM32 Pro VB" +#define DEFAULT_MACHINE_NAME "STM32F103VET6" + +//#define DISABLE_DEBUG + +// +// It is required to disable JTAG function because its pins are +// used as GPIO to drive the Y axis stepper. +// DO NOT ENABLE! +// +#define DISABLE_JTAG + +// +// If you don't need the SWDIO functionality (any more), you may +// disable SWD here to regain PA13/PA14 pins for other use. +// +//#define DISABLE_JTAGSWD + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// Enable EEPROM Emulation for this board as it doesn't have EEPROM +#define FLASH_EEPROM_EMULATION +#define E2END 0xFFF // 4KB + +// +// Limit Switches +// +#define X_MIN_PIN PE5 // ENDSTOPS 15,17 +#define X_MAX_PIN PE4 // ENDSTOPS 16,18 +#define Y_MIN_PIN PE3 // ENDSTOPS 9,11 +#define Y_MAX_PIN PE2 // ENDSTOPS 10,12 +#define Z_MIN_PIN PE1 // ENDSTOPS 3,5 +#define Z_MAX_PIN PE0 // ENDSTOPS 4,6 + +// +// Steppers +// +#define X_STEP_PIN PC6 +#define X_DIR_PIN PD13 +#define X_ENABLE_PIN PA8 + +#define Y_STEP_PIN PA12 +#define Y_DIR_PIN PA11 +#define Y_ENABLE_PIN PA15 + +#define Z_STEP_PIN PD6 +#define Z_DIR_PIN PD3 +#define Z_ENABLE_PIN PB3 + +// Extruder stepper pins +// NOTE: Numbering here is made according to EXT connector numbers, +// the FANx_PWM line numbering in the schematics is reverse. +// That is, E0_*_PIN are the E2_* lines connected to E2_A1 step +// stick that drives the EXT0 output on the board. +// +#define E0_STEP_PIN PC14 +#define E0_DIR_PIN PC13 +#define E0_ENABLE_PIN PC15 + +#define E1_STEP_PIN PA0 +#define E1_DIR_PIN PB6 +#define E1_ENABLE_PIN PA1 + +#define E2_STEP_PIN PB2 +#define E2_DIR_PIN PB11 +#define E2_ENABLE_PIN PC4 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB0 // EXT0 port +#define HEATER_1_PIN PB5 // EXT1 port +#define HEATER_2_PIN PB4 // EXT2 port +#define HEATER_BED_PIN PB1 // CON2X3 hotbed port + +// +// These are FAN PWM pins on EXT0..EXT2 connectors. +// +//#define FAN_PIN PB9 // EXT0 port +#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan +#define FAN1_PIN PB8 // EXT1 port +#define FAN2_PIN PB7 // EXT2 port + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC2 // EXT0 port +#define TEMP_1_PIN PC1 // EXT1 port +#define TEMP_2_PIN PC0 // EXT2 port +#define TEMP_BED_PIN PC3 // CON2X3 hotbed port + +// +// Misc. Functions +// +#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector + +// +// LCD / Controller +// +#if HAS_SPI_LCD + + #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + // + // LCD display on J2 FFC40 + // Geeetech's LCD2004A Control Panel is very much like + // RepRapDiscount Smart Controller, but adds an FFC40 connector + // + #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select + #define LCD_PINS_ENABLE PE14 // SID (MOSI) + #define LCD_PINS_D4 PD8 // SCK (CLK) clock + #define LCD_PINS_D5 PD9 + #define LCD_PINS_D6 PD10 + #define LCD_PINS_D7 PE15 + + #else + // + // Serial LCDs can be implemented in ExtUI + // + //#define LCD_UART_TX PD8 + //#define LCD_UART_RX PD9 + #endif + + #if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) + #endif + +#endif // HAS_SPI_LCD + +#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + // + // Geeetech's LCD2004A Control Panel is very much like + // RepRapDiscount Smart Controller, but adds an FFC40 connector + // connected with a flat wire to J2 connector on the board. + // + #define BTN_EN1 PE8 + #define BTN_EN2 PE9 + #define BTN_ENC PE13 + + #define GTM32_PRO_VB_USE_LCD_BEEPER + #define GTM32_PRO_VB_USE_EXT_SDCARD +#endif + +// +// Beeper +// +#ifdef GTM32_PRO_VB_USE_LCD_BEEPER + // This is pin 32 on J2 FFC40 and pin, goes to the beeper + // on Geeetech's version of RepRapDiscount Smart Controller + // (e.g. on Rostock 301) + #define BEEPER_PIN PE12 +#else + // This is the beeper on the board itself + #define BEEPER_PIN PB10 +#endif + +/** + * The on-board TF_CARD_SOCKET microSD card socket has no SD Detect pin wired. + * + * The FFC10 (SD_CARD) connector has the same pins as those routed to the FFC40 (J2) + * connector, which usually go to the SD Card slot on the Geeetech version of the + * RepRapDiscount Smart Controller. Both connectors have the card detect signal. + * + * The on-board SD card and the external card (on either SD_CARD or J2) are two + * separate devices and can work simultaneously. Unfortunately, Marlin only supports + * a single SPI Flash device (as of 2019-07-05) so only one is enabled here. + */ +#if ENABLED(GTM32_PRO_VB_USE_EXT_SDCARD) + // + // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector + // + #define SS_PIN PC11 + #define SCK_PIN PC12 + #define MOSI_PIN PD2 + #define MISO_PIN PC8 + #define SD_DETECT_PIN PC7 +#else + // + // Use the on-board card socket labeled TF_CARD_SOCKET + // + #define SS_PIN PA4 + #define SCK_PIN PA5 + #define MOSI_PIN PA7 + #define MISO_PIN PA6 + #define SD_DETECT_PIN -1 // Card detect is not connected +#endif + +#define SDSS SS_PIN + +// +// ESP WiFi can be soldered to J9 connector which is wired to USART2. +// Must define WIFISUPPORT in Configuration.h for the printer. +// +#define ESP_WIFI_MODULE_COM 2 +#define ESP_WIFI_MODULE_BAUDRATE 115200 +#define ESP_WIFI_MODULE_RESET_PIN -1 diff --git a/Marlin/src/pins/stm32/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32/pins_GTM32_MINI_A30.h new file mode 100644 index 000000000000..c4b7b37b94ca --- /dev/null +++ b/Marlin/src/pins/stm32/pins_GTM32_MINI_A30.h @@ -0,0 +1,230 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 24 May 2018 - @chepo for STM32F103VET6 + * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "GTM32 Pro VB" +#define DEFAULT_MACHINE_NAME "STM32F103VET6" + +//#define DISABLE_DEBUG + +// +// It is required to disable JTAG function because its pins are +// used as GPIO to drive the Y axis stepper. +// DO NOT ENABLE! +// +#define DISABLE_JTAG + +// +// If you don't need the SWDIO functionality (any more), you may +// disable SWD here to regain PA13/PA14 pins for other use. +// +//#define DISABLE_JTAGSWD + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// Enable EEPROM Emulation for this board as it doesn't have EEPROM +#define FLASH_EEPROM_EMULATION +#define E2END 0xFFF // 4KB + +// +// Limit Switches +// +#define X_MIN_PIN PE5 // ENDSTOPS 15,17 +#define X_MAX_PIN PE4 // ENDSTOPS 16,18 +#define Y_MIN_PIN PE3 // ENDSTOPS 9,11 +#define Y_MAX_PIN PE2 // ENDSTOPS 10,12 +#define Z_MIN_PIN PE0 // ENDSTOPS 3,5 +#define Z_MAX_PIN PE1 // ENDSTOPS 4,6 + +// +// Steppers +// +#define X_STEP_PIN PC6 +#define X_DIR_PIN PD13 +#define X_ENABLE_PIN PA8 + +#define Y_STEP_PIN PA12 +#define Y_DIR_PIN PA11 +#define Y_ENABLE_PIN PA15 + +#define Z_STEP_PIN PD6 +#define Z_DIR_PIN PD3 +#define Z_ENABLE_PIN PB3 + +// Extruder stepper pins +// NOTE: Numbering here is made according to EXT connector numbers, +// the FANx_PWM line numbering in the schematics is reverse. +// That is, E0_*_PIN are the E2_* lines connected to E2_A1 step +// stick that drives the EXT0 output on the board. +// +#define E0_STEP_PIN PC14 +#define E0_DIR_PIN PC13 +#define E0_ENABLE_PIN PC15 + +#define E1_STEP_PIN PA0 +#define E1_DIR_PIN PB6 +#define E1_ENABLE_PIN PA1 + +#define E2_STEP_PIN PB2 +#define E2_DIR_PIN PB11 +#define E2_ENABLE_PIN PC4 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB0 // EXT0 port +#define HEATER_1_PIN PB5 // EXT1 port +#define HEATER_2_PIN PB4 // EXT2 port +#define HEATER_BED_PIN PB1 // CON2X3 hotbed port + +// +// These are FAN PWM pins on EXT0..EXT2 connectors. +// +//#define FAN_PIN PB9 // EXT0 port +#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan +#define FAN1_PIN PB8 // EXT1 port +#define FAN2_PIN PB7 // EXT2 port + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC2 // EXT0 port +#define TEMP_1_PIN PC1 // EXT1 port +#define TEMP_2_PIN PC0 // EXT2 port +#define TEMP_BED_PIN PC3 // CON2X3 hotbed port + +// +// Misc. Functions +// +#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector + +// +// LCD / Controller +// +#if HAS_SPI_LCD + + #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + // + // LCD display on J2 FFC40 + // Geeetech's LCD2004A Control Panel is very much like + // RepRapDiscount Smart Controller, but adds an FFC40 connector + // connected with a flat wire to J2 connector on the board. + // + #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select + #define LCD_PINS_ENABLE PE14 // SID (MOSI) + #define LCD_PINS_D4 PD8 // SCK (CLK) clock + #define LCD_PINS_D5 PD9 + #define LCD_PINS_D6 PD10 + #define LCD_PINS_D7 PE15 + + #define BTN_EN1 PE8 + #define BTN_EN2 PE9 + #define BTN_ENC PE13 + + #define GTM32_PRO_VB_USE_LCD_BEEPER + #define GTM32_PRO_VB_USE_EXT_SDCARD + + #else + // + // Serial LCDs can be implemented in ExtUI + // + //#define LCD_UART_TX PD8 + //#define LCD_UART_RX PD9 + #endif + + #if HAS_GRAPHICAL_LCD + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) + #endif + #endif + +#endif // HAS_SPI_LCD + +// +// Beeper +// +#ifdef GTM32_PRO_VB_USE_LCD_BEEPER + // This is pin 32 on J2 FFC40 and pin, goes to the beeper + // on Geeetech's version of RepRapDiscount Smart Controller + // (e.g. on Rostock 301) + #define BEEPER_PIN PE12 +#else + // This is the beeper on the board itself + #define BEEPER_PIN PB10 +#endif + +/** + * The on-board TF_CARD_SOCKET microSD card socket has no SD Detect pin wired. + * + * The FFC10 (SD_CARD) connector has the same pins as those routed to the FFC40 (J2) + * connector, which usually go to the SD Card slot on the Geeetech version of the + * RepRapDiscount Smart Controller. Both connectors have the card detect signal. + * + * The on-board SD card and the external card (on either SD_CARD or J2) are two + * separate devices and can work simultaneously. Unfortunately, Marlin only supports + * a single SPI Flash device (as of 2019-07-05) so only one is enabled here. + */ +#if ENABLED(GTM32_PRO_VB_USE_EXT_SDCARD) + // + // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector + // + #define SS_PIN PC11 + #define SCK_PIN PC12 + #define MOSI_PIN PD2 + #define MISO_PIN PC8 + #define SD_DETECT_PIN PC7 +#else + // + // Use the on-board card socket labeled TF_CARD_SOCKET + // + #define SS_PIN PA4 + #define SCK_PIN PA5 + #define MOSI_PIN PA7 + #define MISO_PIN PA6 + #define SD_DETECT_PIN -1 // Card detect is not connected +#endif + +#define SDSS SS_PIN + +// +// ESP WiFi can be soldered to J9 connector which is wired to USART2. +// Must define WIFISUPPORT in Configuration.h for the printer. +// +#define ESP_WIFI_MODULE_COM 2 +#define ESP_WIFI_MODULE_BAUDRATE 115200 +#define ESP_WIFI_MODULE_RESET_PIN -1 diff --git a/Marlin/src/pins/stm32/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32/pins_GTM32_PRO_VB.h new file mode 100644 index 000000000000..36d7377ffae6 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_GTM32_PRO_VB.h @@ -0,0 +1,230 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 24 May 2018 - @chepo for STM32F103VET6 + * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "GTM32 Pro VB" +#define DEFAULT_MACHINE_NAME "STM32F103VET6" + +//#define DISABLE_DEBUG + +// +// It is required to disable JTAG function because its pins are +// used as GPIO to drive the Y axis stepper. +// DO NOT ENABLE! +// +#define DISABLE_JTAG + +// +// If you don't need the SWDIO functionality (any more), you may +// disable SWD here to regain PA13/PA14 pins for other use. +// +//#define DISABLE_JTAGSWD + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// Enable EEPROM Emulation for this board as it doesn't have EEPROM +#define FLASH_EEPROM_EMULATION +#define E2END 0xFFF // 4KB + +// +// Limit Switches +// +#define X_MIN_PIN PE5 // ENDSTOPS 15,17 +#define X_MAX_PIN PE4 // ENDSTOPS 16,18 +#define Y_MIN_PIN PE3 // ENDSTOPS 9,11 +#define Y_MAX_PIN PE2 // ENDSTOPS 10,12 +#define Z_MIN_PIN PE1 // ENDSTOPS 3,5 +#define Z_MAX_PIN PE0 // ENDSTOPS 4,6 + +// +// Steppers +// +#define X_STEP_PIN PC6 +#define X_DIR_PIN PD13 +#define X_ENABLE_PIN PA8 + +#define Y_STEP_PIN PA12 +#define Y_DIR_PIN PA11 +#define Y_ENABLE_PIN PA15 + +#define Z_STEP_PIN PD6 +#define Z_DIR_PIN PD3 +#define Z_ENABLE_PIN PB3 + +// Extruder stepper pins +// NOTE: Numbering here is made according to EXT connector numbers, +// the FANx_PWM line numbering in the schematics is reverse. +// That is, E0_*_PIN are the E2_* lines connected to E2_A1 step +// stick that drives the EXT0 output on the board. +// +#define E0_STEP_PIN PC14 +#define E0_DIR_PIN PC13 +#define E0_ENABLE_PIN PC15 + +#define E1_STEP_PIN PA0 +#define E1_DIR_PIN PB6 +#define E1_ENABLE_PIN PA1 + +#define E2_STEP_PIN PB2 +#define E2_DIR_PIN PB11 +#define E2_ENABLE_PIN PC4 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB0 // EXT0 port +#define HEATER_1_PIN PB5 // EXT1 port +#define HEATER_2_PIN PB4 // EXT2 port +#define HEATER_BED_PIN PB1 // CON2X3 hotbed port + +// +// These are FAN PWM pins on EXT0..EXT2 connectors. +// +//#define FAN_PIN PB9 // EXT0 port +#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan +#define FAN1_PIN PB8 // EXT1 port +#define FAN2_PIN PB7 // EXT2 port + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC2 // EXT0 port +#define TEMP_1_PIN PC1 // EXT1 port +#define TEMP_2_PIN PC0 // EXT2 port +#define TEMP_BED_PIN PC3 // CON2X3 hotbed port + +// +// Misc. Functions +// +#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector + +// +// LCD / Controller +// +#if HAS_SPI_LCD + + #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + // + // LCD display on J2 FFC40 + // Geeetech's LCD2004A Control Panel is very much like + // RepRapDiscount Smart Controller, but adds an FFC40 connector + // + #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select + #define LCD_PINS_ENABLE PE14 // SID (MOSI) + #define LCD_PINS_D4 PD8 // SCK (CLK) clock + #define LCD_PINS_D5 PD9 + #define LCD_PINS_D6 PD10 + #define LCD_PINS_D7 PE15 + + #else + // + // Serial LCDs can be implemented in ExtUI + // + //#define LCD_UART_TX PD8 + //#define LCD_UART_RX PD9 + #endif + + #if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) + #endif + +#endif // HAS_SPI_LCD + +#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + // + // Geeetech's LCD2004A Control Panel is very much like + // RepRapDiscount Smart Controller, but adds an FFC40 connector + // connected with a flat wire to J2 connector on the board. + // + #define BTN_EN1 PE8 + #define BTN_EN2 PE9 + #define BTN_ENC PE13 + + #define GTM32_PRO_VB_USE_LCD_BEEPER + #define GTM32_PRO_VB_USE_EXT_SDCARD +#endif + +// +// Beeper +// +#ifdef GTM32_PRO_VB_USE_LCD_BEEPER + // This is pin 32 on J2 FFC40 and pin, goes to the beeper + // on Geeetech's version of RepRapDiscount Smart Controller + // (e.g. on Rostock 301) + #define BEEPER_PIN PE12 +#else + // This is the beeper on the board itself + #define BEEPER_PIN PB10 +#endif + +/** + * The on-board TF_CARD_SOCKET microSD card socket has no SD Detect pin wired. + * + * The FFC10 (SD_CARD) connector has the same pins as those routed to the FFC40 (J2) + * connector, which usually go to the SD Card slot on the Geeetech version of the + * RepRapDiscount Smart Controller. Both connectors have the card detect signal. + * + * The on-board SD card and the external card (on either SD_CARD or J2) are two + * separate devices and can work simultaneously. Unfortunately, Marlin only supports + * a single SPI Flash device (as of 2019-07-05) so only one is enabled here. + */ +#if ENABLED(GTM32_PRO_VB_USE_EXT_SDCARD) + // + // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector + // + #define SS_PIN PC11 + #define SCK_PIN PC12 + #define MOSI_PIN PD2 + #define MISO_PIN PC8 + #define SD_DETECT_PIN PC7 +#else + // + // Use the on-board card socket labeled TF_CARD_SOCKET + // + #define SS_PIN PA4 + #define SCK_PIN PA5 + #define MOSI_PIN PA7 + #define MISO_PIN PA6 + #define SD_DETECT_PIN -1 // Card detect is not connected +#endif + +#define SDSS SS_PIN + +// +// ESP WiFi can be soldered to J9 connector which is wired to USART2. +// Must define WIFISUPPORT in Configuration.h for the printer. +// +#define ESP_WIFI_MODULE_COM 2 +#define ESP_WIFI_MODULE_BAUDRATE 115200 +#define ESP_WIFI_MODULE_RESET_PIN -1 diff --git a/Marlin/src/pins/stm32/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32/pins_GTM32_REV_B.h new file mode 100644 index 000000000000..fcb510e161e6 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_GTM32_REV_B.h @@ -0,0 +1,232 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 24 May 2018 - @chepo for STM32F103VET6 + * Schematic: https://github.com/chepo92/Smartto/blob/master/circuit_diagram/Rostock301/Hardware_GTM32_PRO_VB.pdf + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#endif + +#define BOARD_NAME "GTM32 Pro VB" +#define DEFAULT_MACHINE_NAME "M201" + +//#define DISABLE_DEBUG + +// +// It is required to disable JTAG function because its pins are +// used as GPIO to drive the Y axis stepper. +// DO NOT ENABLE! +// +#define DISABLE_JTAG + +// +// If you don't need the SWDIO functionality (any more), you may +// disable SWD here to regain PA13/PA14 pins for other use. +// +//#define DISABLE_JTAGSWD + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// Enable EEPROM Emulation for this board as it doesn't have EEPROM +#define FLASH_EEPROM_EMULATION +#define E2END 0xFFF // 4KB + +// +// Limit Switches +// +#define X_MIN_PIN PE5 // ENDSTOPS 15,17 +#define X_MAX_PIN PE4 // ENDSTOPS 16,18 +#define Y_MIN_PIN PE3 // ENDSTOPS 9,11 +#define Y_MAX_PIN PE2 // ENDSTOPS 10,12 +#define Z_MIN_PIN PE1 // ENDSTOPS 3,5 +#define Z_MAX_PIN PE0 // ENDSTOPS 4,6 + +// +// Steppers +// +#define X_STEP_PIN PC6 +#define X_DIR_PIN PD13 +#define X_ENABLE_PIN PA8 + +#define Y_STEP_PIN PA12 +#define Y_DIR_PIN PA11 +#define Y_ENABLE_PIN PA15 + +#define Z_STEP_PIN PD6 +#define Z_DIR_PIN PD3 +#define Z_ENABLE_PIN PB3 + +// Extruder stepper pins +// NOTE: Numbering here is made according to EXT connector numbers, +// the FANx_PWM line numbering in the schematics is reverse. +// That is, E0_*_PIN are the E2_* lines connected to E2_A1 step +// stick that drives the EXT0 output on the board. +// +#define E0_STEP_PIN PC14 +#define E0_DIR_PIN PC13 +#define E0_ENABLE_PIN PC15 + +#define E1_STEP_PIN PA0 +#define E1_DIR_PIN PB6 +#define E1_ENABLE_PIN PA1 + +#define E2_STEP_PIN PB2 +#define E2_DIR_PIN PB11 +#define E2_ENABLE_PIN PC4 + +// +// Heaters / Fans - INFO: Extruders ports are in reverse order. Pin numbers here differ from schematic. Original firmware assumes heater, fan and temp sensor on port EXT0 PB0, PB9, PC2. +// +#define HEATER_0_PIN PB0 // EXT0 port. +#define HEATER_1_PIN PB5 // EXT1 port +#define HEATER_2_PIN PB4 // EXT2 port +#define HEATER_BED_PIN PB1 // CON2X3 hotbed port + +// +// These are FAN PWM pins on EXT0..EXT2 connectors. +// +//#define FAN_PIN PB9 // EXT0 port +#define FAN1_PIN PB8 // EXT1 port +#define FAN2_PIN PB7 // EXT2 port +#define ORIG_E0_AUTO_FAN_PIN PB9 // EXT0 port, used as main extruder fan + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC2 // EXT0 port +#define TEMP_1_PIN PC1 // EXT1 port +#define TEMP_2_PIN PC0 // EXT2 port +#define TEMP_BED_PIN PC3 // CON2X3 hotbed port + +// +// Misc. Functions +// +#define LED_PWM PD12 // External LED, pin 2 on LED labeled connector + +// +// LCD / Controller +// +#if HAS_SPI_LCD + + #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) + + // + // LCD display on J2 FFC40 + // Geeetech's LCD2004A Control Panel is very much like + // RepRapDiscount Smart Controller, but adds an FFC40 connector + // connected with a flat wire to J2 connector on the board. + // + #define LCD_PINS_RS PE6 // CS chip select /SS chip slave select + #define LCD_PINS_ENABLE PE14 // SID (MOSI) + #define LCD_PINS_D4 PD8 // SCK (CLK) clock + #define LCD_PINS_D5 PD9 + #define LCD_PINS_D6 PD10 + #define LCD_PINS_D7 PE15 + + #define BTN_EN1 PE8 + #define BTN_EN2 PE9 + #define BTN_ENC PE13 + + //#define GTM32_PRO_VB_USE_LCD_BEEPER + #define GTM32_PRO_VB_USE_EXT_SDCARD + + #else + // + // Serial LCDs can be implemented in ExtUI + // + //#define LCD_UART_TX PD8 + //#define LCD_UART_RX PD9 + #endif + + #if HAS_GRAPHICAL_LCD + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(96) + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(48) + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(715) + #endif + #endif + +#endif // HAS_SPI_LCD + +// +// Beeper +// +#ifdef GTM32_PRO_VB_USE_LCD_BEEPER + // This is pin 32 on J2 FFC40 and pin, goes to the beeper + // on Geeetech's version of RepRapDiscount Smart Controller + // (e.g. on Rostock 301) + #define BEEPER_PIN PE12 +#else + // This is the beeper on the board itself + #define BEEPER_PIN PB10 +#endif + +/** + * The on-board TF_CARD_SOCKET microSD card socket has no SD Detect pin wired. + * + * The FFC10 (SD_CARD) connector has the same pins as those routed to the FFC40 (J2) + * connector, which usually go to the SD Card slot on the Geeetech version of the + * RepRapDiscount Smart Controller. Both connectors have the card detect signal. + * + * The on-board SD card and the external card (on either SD_CARD or J2) are two + * separate devices and can work simultaneously. Unfortunately, Marlin only supports + * a single SPI Flash device (as of 2019-07-05) so only one is enabled here. + */ +#if ENABLED(GTM32_PRO_VB_USE_EXT_SDCARD) + // + // SD Card on RepRapDiscount Smart Controller (J2) or on SD_CARD connector + // + #define SS_PIN PB12 // PC11 + #define SCK_PIN PB13 // PC12 // PC1 + #define MOSI_PIN PB15 // PD2 // PD2 + #define MISO_PIN PB14 // PC8 + #define SD_DETECT_PIN PC7 + +#else + // + // Use the on-board card socket labeled TF_CARD_SOCKET + // + #define SS_PIN PA4 + #define SCK_PIN PA5 + #define MOSI_PIN PA7 + #define MISO_PIN PA6 // PA6 + #define SD_DETECT_PIN -1 // Card detect is not connected +#endif + +#define SDSS SS_PIN + +// +// ESP WiFi can be soldered to J9 connector which is wired to USART2. +// Must define WIFISUPPORT in Configuration.h for the printer. +// +#define ESP_WIFI_MODULE_COM 2 +#define ESP_WIFI_MODULE_BAUDRATE 115200 +#define ESP_WIFI_MODULE_RESET_PIN -1 diff --git a/Marlin/src/pins/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32/pins_JGAURORA_A5S_A1.h similarity index 61% rename from Marlin/src/pins/pins_JGAURORA_A5S_A1.h rename to Marlin/src/pins/stm32/pins_JGAURORA_A5S_A1.h index 4802bb1c0f87..d0e082dbd0b6 100644 --- a/Marlin/src/pins/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32/pins_JGAURORA_A5S_A1.h @@ -22,33 +22,31 @@ #pragma once /** - * 2017 Victor Perez Marlin for stm32f1 test - * 2018 Modified by Pablo Crespo for Morpheus Board (https://github.com/pscrespo/Morpheus-STM32) - * 2019 Modified by Roberto Mariani & Samuel Pinches for JGAurora A5S & A1 Board. + * ╦╔═╗╔═╗┬ ┬┬─┐┌─┐┬─┐┌─┐╔═╗┌─┐┬─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┬┐ + * ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││ + * ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴ + * Pin assignments for 32-bit JGAurora A5S & A1 */ -/** - * JGAurora A5S A1 Board pin assignments - */ - #ifndef __STM32F1__ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "JGAurora 32-bit board only supports 1 hotend / E-stepper. Comment out this line to continue." #endif +#define BOARD_INFO_NAME "JGAurora A5S A1 board" -#define BOARD_NAME "JGAurora A5S A1 board" - -// #define STM32_XL_DENSITY // required, but should be set by platformio flags, not here! (why? not sure.) - -//#define MCU_STM32F103ZE // not yet required - -// // I2C EEPROM with 64K of space - AT24C64 -// #define I2C_EEPROM -// #define E2END 0x7FFF +#ifndef STM32_XL_DENSITY + #define STM32_XL_DENSITY +#endif -// Enable EEPROM Emulation for this board +// #define MCU_STM32F103ZE // not yet required +// Enable EEPROM Emulation for this board, so that we don't overwrite factory data -//#define FLASH_EEPROM_EMULATION 1 -//#define E2END 0xFFF //((uint32)(EEPROM_START_ADDRESS + EEPROM_PAGE_SIZE + EEPROM_PAGE_SIZE)) // not 0xFFF +//#define I2C_EEPROM // AT24C64 +//#define E2END 0x7FFF // 64KB +//#define FLASH_EEPROM_EMULATION +//#define E2END 0xFFF // 4KB +//#define E2END uint32(EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE * 2) - 1) //#define EEPROM_CHITCHAT //#define DEBUG_EEPROM_READWRITE @@ -58,6 +56,9 @@ #define X_STOP_PIN PC6 #define Y_STOP_PIN PG8 #define Z_STOP_PIN PG7 +//#define X_MAX_PIN PC5 +//#define Y_MAX_PIN PC4 +//#define Z_MAX_PIN PB0 // // Steppers @@ -96,7 +97,6 @@ #define FAN_PIN PA1 -#define PS_ON_PIN PA0 #define FIL_RUNOUT_PIN PC7 // @@ -106,6 +106,10 @@ #define FSMC_CS_PIN PD7 #define FSMC_RS_PIN PG0 +#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT +#define FSMC_DMA_DEV DMA2 +#define FSMC_DMA_CHANNEL DMA_CH5 + // // SD Card // @@ -117,10 +121,10 @@ #define BEEPER_PIN PC3 // use PB7 to shut up if desired #define LED_PIN PC13 +// // Touch support -#define BTN_ENC PA11 // Real pin is needed to enable encoder's push button functionality used by touch screen. PA11 gives stable value. - -#define TOUCH_CS PA4 -//#define TOUCH_INTERRUPT PC4 // Not yet implemented - -#define NO_PAUSE_AFTER_PRINT +// +#if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CS_PIN PA4 + #define TOUCH_INT_PIN PC4 +#endif diff --git a/Marlin/src/pins/stm32/pins_LERDGE_K.h b/Marlin/src/pins/stm32/pins_LERDGE_K.h new file mode 100644 index 000000000000..10a36d8c6fa0 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_LERDGE_K.h @@ -0,0 +1,177 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#if !defined(STM32F4) && !defined(STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "LERDGE K supports up to 2 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "Lerdge K" +#define DEFAULT_MACHINE_NAME "LERDGE" + +#define I2C_EEPROM + +// Ignore temp readings during develpment. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// +// Servos +// +//#define SERVO0_PIN PD12 + +// +// Limit Switches +// +#define X_STOP_PIN PG3 +#define Y_STOP_PIN PG4 +#define Z_STOP_PIN PG5 + +// +// Z Probe (when not Z_MIN_PIN) +// +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PB15 +//#endif + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PE6 +#define FIL_RUNOUT2_PIN PE7 + +// +// Steppers +// +#define X_STEP_PIN PG1 +#define X_DIR_PIN PB10 +#define X_ENABLE_PIN PG0 +//#ifndef X_CS_PIN +// #define X_CS_PIN PE0 +//#endif + +#define Y_STEP_PIN PF14 +#define Y_DIR_PIN PF15 +#define Y_ENABLE_PIN PF13 +//#ifndef Y_CS_PIN +// #define Y_CS_PIN PE1 +//#endif + +#define Z_STEP_PIN PF11 +#define Z_DIR_PIN PF12 +#define Z_ENABLE_PIN PC5 +//#ifndef Z_CS_PIN +// #define Z_CS_PIN PE2 +//#endif + +#define E0_STEP_PIN PC14 +#define E0_DIR_PIN PC13 +#define E0_ENABLE_PIN PC15 +//#ifndef E0_CS_PIN +// #define E0_CS_PIN PE3 +//#endif + +#define E1_STEP_PIN PF1 +#define E1_DIR_PIN PF0 +#define E1_ENABLE_PIN PF2 +//#ifndef E1_CS_PIN +// #define E1_CS_PIN PE4 +//#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // Analog Input +#define TEMP_1_PIN PC2 // Analog Input +#define TEMP_BED_PIN PC0 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 +#define HEATER_1_PIN PA0 +#define HEATER_BED_PIN PA2 + +#ifndef FAN_PIN + #define FAN_PIN PC15 +#endif +#define FAN1_PIN PF6 +#define FAN2_PIN PF7 + +#define ORIG_E0_AUTO_FAN_PIN FAN1_PIN // Use this by NOT overriding E0_AUTO_FAN_PIN + +// +// LED / Lighting +// +//#define CASE_LIGHT_PIN_CI -1 +//#define CASE_LIGHT_PIN_DO -1 +//#define NEOPIXEL_PIN -1 + +// +// Prusa i3 MK2 Multi-Material Multiplexer Support +// +//#define E_MUX0_PIN -1 +//#define E_MUX1_PIN -1 + +// +// SD support +// +#define SDIO_SUPPORT + +// +// Misc. Functions +// +#define SDSS PC11 +#define LED_PIN PC7 // Alive +#define PS_ON_PIN -1 +#define KILL_PIN -1 +#define POWER_LOSS_PIN -1 // Power-loss / nAC_FAULT + +#define SCK_PIN PC12 +#define MISO_PIN PC8 +#define MOSI_PIN PD2 +#define SS_PIN PC11 + +// +// LCD / Controller +// + +// TODO: Replace these with the correct FSMC pins, once known +#define SD_DETECT_PIN -1 +#define BEEPER_PIN PD12 +#define LCD_PINS_RS -1 +#define LCD_PINS_ENABLE -1 +#define LCD_PINS_D4 -1 +#define LCD_PINS_D5 -1 +#define LCD_PINS_D6 -1 +#define LCD_PINS_D7 -1 + +#define BTN_EN1 PE3 +#define BTN_EN2 PE4 +#define BTN_ENC PE2 + +// +// ST7920 Delays +// +#if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) +#endif diff --git a/Marlin/src/pins/stm32/pins_LERDGE_X.h b/Marlin/src/pins/stm32/pins_LERDGE_X.h new file mode 100644 index 000000000000..c9c1da17e8ff --- /dev/null +++ b/Marlin/src/pins/stm32/pins_LERDGE_X.h @@ -0,0 +1,174 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#if !defined(STM32F4) && !defined(STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "LERDGE X supports up to 2 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "Lerdge X" +#define DEFAULT_MACHINE_NAME "LERDGE" + +//#define I2C_EEPROM + +// +// Servos +// +//#define SERVO0_PIN PD12 +//#define SERVO1_PIN -1 + +// +// Limit Switches +// +#define X_STOP_PIN PB12 +#define Y_STOP_PIN PB13 +#define Z_STOP_PIN PB14 + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PE1 + +// +// Z Probe (when not Z_MIN_PIN) +// +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PB15 +//#endif + +// +// Steppers +// +#define X_STEP_PIN PB10 +#define X_DIR_PIN PB2 +#define X_ENABLE_PIN PB11 +//#ifndef X_CS_PIN +// #define X_CS_PIN PD1 +//#endif + +#define Y_STEP_PIN PB0 +#define Y_DIR_PIN PC5 +#define Y_ENABLE_PIN PB1 +//#ifndef Y_CS_PIN +// #define Y_CS_PIN PE12 +//#endif + +#define Z_STEP_PIN PA7 +#define Z_DIR_PIN PA6 +#define Z_ENABLE_PIN PC4 +//#ifndef Z_CS_PIN +// #define Z_CS_PIN PD5 +//#endif + +#define E0_STEP_PIN PA4 +#define E0_DIR_PIN PA3 +#define E0_ENABLE_PIN PA5 +//#ifndef E0_CS_PIN +// #define E0_CS_PIN PB4 +//#endif + +#define E1_STEP_PIN -1 +#define E1_DIR_PIN -1 +#define E1_ENABLE_PIN -1 +//#ifndef E1_CS_PIN +// #define E1_CS_PIN PE5 +//#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 // Analog Input +#define TEMP_1_PIN -1 // Analog Input +#define TEMP_BED_PIN PC1 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 +#define HEATER_1_PIN -1 +#define HEATER_BED_PIN PA2 + +#ifndef FAN_PIN +// #define FAN_PIN PC15 +#endif +#define FAN1_PIN PC15 +#define FAN2_PIN PA0 + +#define ORIG_E0_AUTO_FAN_PIN PC15 // Use this by NOT overriding E0_AUTO_FAN_PIN + +// +// Prusa i3 MK2 Multi Material Multiplexer Support +// +//#define E_MUX0_PIN -1 +//#define E_MUX1_PIN -1 + +// +// LED / Lighting +// +//#define CASE_LIGHT_PIN_CI -1 +//#define CASE_LIGHT_PIN_DO -1 +//#define NEOPIXEL_PIN -1 + +// +// Misc. Functions +// +#define SDSS PC11 +#define LED_PIN PC7 // Alive +#define PS_ON_PIN -1 +#define KILL_PIN -1 +#define POWER_LOSS_PIN -1 // Power-loss / nAC_FAULT + +#define SCK_PIN PC12 +#define MISO_PIN PC8 +#define MOSI_PIN PD2 +#define SS_PIN PC11 + +// +// SD support +// +#define SDIO_SUPPORT + +// +// LCD / Controller +// + +// The LCD is initialized in FSMC mode +#define SD_DETECT_PIN -1 +#define BEEPER_PIN PD12 + +#define BTN_EN1 PE3 +#define BTN_EN2 PE4 +#define BTN_ENC PE2 + +#define LCD_RESET_PIN PD6 +#define LCD_BACKLIGHT_PIN PD3 +#define FSMC_CS_PIN PD4 +#define FSMC_RS_PIN PD11 +#define TOUCH_CS PB6 + +// +// ST7920 Delays +// +#if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) +#endif diff --git a/Marlin/src/pins/stm32/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32/pins_LONGER3D_LK.h new file mode 100644 index 000000000000..5862449e8795 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_LONGER3D_LK.h @@ -0,0 +1,169 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +/** + * Longer3D LK1/LK2 & Alfawise U20/U30 (STM32F103VET6) board pin assignments + */ + +#if !defined(__STM32F1__) && !defined(STM32F1xx) + #error "Oops! Select a STM32F1 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "Longer3D board only supports 1 hotend / E-stepper. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "Longer3D" +#define ALFAWISE_UX0 // Common to all Longer3D STM32F1 boards (used for Open drain mosfets) + +//#define DISABLE_DEBUG // We still want to debug with STLINK... +#define DISABLE_JTAG // We free the jtag pins (PA15) but keep STLINK + // Release PB4 (STEP_X_PIN) from JTAG NRST role. +// +// Limit Switches +// +#define X_MIN_PIN PC1 // pin 16 +#define X_MAX_PIN PC0 // pin 15 (Filament sensor on Alfawise setup) +#define Y_MIN_PIN PC15 // pin 9 +#define Y_MAX_PIN PC14 // pin 8 (Unused in stock Alfawise setup) +#define Z_MIN_PIN PE6 // pin 5 Standard Endstop or Z_Probe endstop function +#define Z_MAX_PIN PE5 // pin 4 (Unused in stock Alfawise setup) + // May be used for BLTouch Servo function on older variants (<= V08) + +// +// Filament Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PC0 // XMAX plug on PCB used as filament runout sensor on Alfawise boards (inverting true) +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PB5 // pin 91 +#define X_STEP_PIN PB4 // pin 90 +#define X_DIR_PIN PB3 // pin 89 + +#define Y_ENABLE_PIN PB8 // pin 95 +#define Y_STEP_PIN PB7 // pin 93 +#define Y_DIR_PIN PB6 // pin 92 + +#define Z_ENABLE_PIN PE1 // pin 98 +#define Z_STEP_PIN PE0 // pin 97 +#define Z_DIR_PIN PB9 // pin 96 + +#define E0_ENABLE_PIN PE4 // pin 3 +#define E0_STEP_PIN PE3 // pin 2 +#define E0_DIR_PIN PE2 // pin 1 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PA0 // pin 23 (Nozzle 100K/3950 thermistor) +#define TEMP_BED_PIN PA1 // pin 24 (Hot Bed 100K/3950 thermistor) + +// +// Heaters / Fans +// +#define HEATER_0_PIN PD3 // pin 84 (Nozzle Heat Mosfet) +#define HEATER_BED_PIN PA8 // pin 67 (Hot Bed Mosfet) + +#define FAN_PIN PA15 // pin 77 (4cm Fan) +#define FAN_SOFT_PWM // Required to avoid issues with heating or STLink +#define FAN_MIN_PWM 35 // Fan will not start in 1-30 range +#define FAN_MAX_PWM 255 + +//#define BEEPER_PIN PD13 // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor + // Can drive a PC Buzzer, if connected between PWM and 5V pins + +#define LED_PIN PC2 // pin 17 + +// +// PWM for a servo probe +// Other servo devices are not supported on this board! +// +#if HAS_Z_SERVO_PROBE + #define SERVO0_PIN PD13 // Open drain PWM pin on the V0G (GND or floating 5V) + #define SERVO0_PWM_OD // Comment this if using PE5 + + //#define SERVO0_PIN PE5 // Pulled up PWM pin on the V08 (3.3V or 0) + //#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5) +#endif + +/** + * Note: Alfawise screens use various TFT controllers. Supported screens + * are based on the ILI9341, ILI9328 and ST7798V. Define init sequences for + * other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp + * + * If the screen stays white, disable 'LCD_RESET_PIN' to let the bootloader + * init the screen. + * + * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu + * because Marlin uses the reset as a failsafe to revive a glitchy LCD. + */ + +#define LCD_RESET_PIN PC4 // pin 33 +#define LCD_BACKLIGHT_PIN PD12 // pin 59 +#define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1 +#define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed + +#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT +#define FSMC_DMA_DEV DMA2 +#define FSMC_DMA_CHANNEL DMA_CH5 + +#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h +#define DOGLCD_SCK -1 + +/** + * Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer + * mixed up MOSI and MISO pins. SPI is managed in SW, and needs pins + * declared below. + */ +#if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CS_PIN PB12 // pin 51 SPI2_NSS + #define TOUCH_SCK_PIN PB13 // pin 52 + #define TOUCH_MOSI_PIN PB14 // pin 53 + #define TOUCH_MISO_PIN PB15 // pin 54 + #define TOUCH_INT_PIN PC6 // pin 63 (PenIRQ coming from ADS7843) +#endif + +// +// Persistent Storage +// If no option is selected below the SD Card will be used +// +//#define SPI_EEPROM +#define FLASH_EEPROM_EMULATION + +#undef E2END +#if ENABLED(SPI_EEPROM) + // SPI1 EEPROM Winbond W25Q64 (8MB/64Mbits) + #define SPI_CHAN_EEPROM1 1 + #define SPI_EEPROM1_CS PC5 // pin 34 + #define EEPROM_SCK BOARD_SPI1_SCK_PIN // PA5 pin 30 + #define EEPROM_MISO BOARD_SPI1_MISO_PIN // PA6 pin 31 + #define EEPROM_MOSI BOARD_SPI1_MOSI_PIN // PA7 pin 32 + #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet) + #define E2END ((16 * EEPROM_PAGE_SIZE)-1) // Limit to 64KB for now... +#elif ENABLED(FLASH_EEPROM_EMULATION) + // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) + #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) + #define EEPROM_PAGE_SIZE (0x800U) // 2KB, but will use 2x more (4KB) + #define E2END (EEPROM_PAGE_SIZE - 1) +#else + #define E2END (0x7FFU) // On SD, Limit to 2KB, require this amount of RAM +#endif diff --git a/Marlin/src/pins/pins_MALYAN_M200.h b/Marlin/src/pins/stm32/pins_MALYAN_M200.h similarity index 76% rename from Marlin/src/pins/pins_MALYAN_M200.h rename to Marlin/src/pins/stm32/pins_MALYAN_M200.h index 63d0b8f9a2f9..87337c72b6f7 100644 --- a/Marlin/src/pins/pins_MALYAN_M200.h +++ b/Marlin/src/pins/stm32/pins_MALYAN_M200.h @@ -25,11 +25,11 @@ * MALYAN M200 pin assignments */ -#if !defined(__STM32F1__) && !defined(STM32F1xx) && !defined(STM32F0xx) - #error "Oops! You must be compiling for STM32." +#if NONE(__STM32F1__, STM32F1xx, STM32F0xx) + #error "Oops! Select an STM32 board in your IDE." #endif -#define BOARD_NAME "MALYANM200" +#define BOARD_INFO_NAME "Malyan M200" // Enable EEPROM Emulation for this board // This setting should probably be in configuration.h @@ -42,6 +42,8 @@ // On STM32F103: // PB3, PB6, PB7, and PB8 can be used with pwm, which rules out TIM2 and TIM4. // On STM32F070, 16 and 17 are in use, but 1 and 3 are available. +#undef STEP_TIMER +#undef TEMP_TIMER #define STEP_TIMER 1 #define TEMP_TIMER 3 @@ -84,15 +86,7 @@ #define HEATER_0_PIN PB6 // HOTEND0 MOSFET #define HEATER_BED_PIN PB7 // BED MOSFET -// FAN_PIN is commented out here because the M200 example -// Configuration_adv.h does NOT override E0_AUTO_FAN_PIN. -#ifndef FAN_PIN - //#define FAN_PIN PB8 // FAN1 header on board - PRINT FAN -#endif -#define FAN1_PIN PB3 // FAN2 header on board - CONTROLLER FAN -#define FAN2_PIN -1 // FAN3 header on board - EXTRUDER0 FAN +#define MALYAN_FAN1_PIN PB8 // FAN1 header on board - PRINT FAN +#define MALYAN_FAN2_PIN PB3 // FAN2 header on board - CONTROLLER FAN -// This board has only the controller fan and the extruder fan -// If someone hacks to put a direct power fan on the controller, PB3 could -// be used as a separate print cooling fan. -#define ORIG_E0_AUTO_FAN_PIN PB8 +#define FAN1_PIN MALYAN_FAN2_PIN diff --git a/Marlin/src/pins/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32/pins_MKS_ROBIN.h similarity index 65% rename from Marlin/src/pins/pins_MKS_ROBIN.h rename to Marlin/src/pins/stm32/pins_MKS_ROBIN.h index 6dac3f65c47b..2273da994fe2 100644 --- a/Marlin/src/pins/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32/pins_MKS_ROBIN.h @@ -23,22 +23,22 @@ /** * MKS Robin (STM32F130ZET6) board pin assignments + * + * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware */ #ifndef __STM32F1__ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 +#elif HOTENDS > 2 || E_STEPPERS > 2 #error "MKS Robin supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "MKS Robin" +#define BOARD_INFO_NAME "MKS Robin" // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // -#define DISABLE_DEBUG +#define DISABLE_JTAG // // Servos @@ -111,16 +111,48 @@ #define LED_PIN PB2 /** - * Note: MKS Robin TFT screens may have different TFT controllers - * If the screen stays white, disable 'LCD_RESET_PIN' to rely on the bootloader to do screen initialization. + * Note: MKS Robin TFT screens use various TFT controllers + * Supported screens are based on the ILI9341 and ST7789V (320x240), ILI9328 and 9488 are not. + * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp + * + * If the screen stays white, disable 'LCD_RESET_PIN' + * to let the bootloader init the screen. * - * Enabling 'LCD_RESET_PIN' causes flickering when entering the LCD menu due to LCD controller reset. - * Reset feature was designed to "revive the LCD if static electricity killed it." + * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu + * because Marlin uses the reset as a failsafe to revive a glitchy LCD. */ //#define LCD_RESET_PIN PF6 #define LCD_BACKLIGHT_PIN PG11 #define FSMC_CS_PIN PG12 // NE4 #define FSMC_RS_PIN PF0 // A0 -#define SD_DETECT_PIN PF12 -#define SDSS -1 +#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT +#define FSMC_DMA_DEV DMA2 +#define FSMC_DMA_CHANNEL DMA_CH5 + +#if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CS_PIN PB1 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI +#endif + +// SPI1(PA7) & SPI3(PB5) not available +#define ENABLE_SPI2 + +#if ENABLED(SDIO_SUPPORT) + #define SCK_PIN PB13 // SPI2 + #define MISO_PIN PB14 // SPI2 + #define MOSI_PIN PB15 // SPI2 + #define SS_PIN -1 // PB12 is X- + #define SD_DETECT_PIN PF12 // SD_CD +#else + // SD as custom software SPI (SDIO pins) + #define SCK_PIN PC12 + #define MISO_PIN PC8 + #define MOSI_PIN PD2 + #define SS_PIN -1 + #define ONBOARD_SD_CS_PIN PC11 + #define SDSS PD2 + #define SD_DETECT_PIN -1 +#endif diff --git a/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE.h new file mode 100644 index 000000000000..c86b62cddd0c --- /dev/null +++ b/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE.h @@ -0,0 +1,137 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#elif HOTENDS > 1 || E_STEPPERS > 1 + #error "MKS Robin Lite supports only 1 hotend / E-stepper. Comment out this line to continue." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS Robin Lite" +#endif +#define BOARD_WEBSITE_URL "github.com/makerbase-mks" + +//#define DISABLE_DEBUG +#define DISABLE_JTAG +#define ENABLE_SPI2 + +// +// Limit Switches +// +#define X_STOP_PIN PC13 +#define Y_STOP_PIN PC0 +#define Z_MIN_PIN PC12 +#define Z_MAX_PIN PB9 + +// +// Steppers +// +#define X_STEP_PIN PC6 +#define X_DIR_PIN PB12 +#define X_ENABLE_PIN PB10 + +#define Y_STEP_PIN PB11 +#define Y_DIR_PIN PB2 +#define Y_ENABLE_PIN PB10 + +#define Z_STEP_PIN PB1 +#define Z_DIR_PIN PC5 +#define Z_ENABLE_PIN PB10 + +#define E0_STEP_PIN PC4 +#define E0_DIR_PIN PA5 +#define E0_ENABLE_PIN PA4 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC9 +#define FAN_PIN PA8 +#define HEATER_BED_PIN PC8 + +// +// Temperature Sensors +// +#define TEMP_BED_PIN PA1 +#define TEMP_0_PIN PA0 + +#define FIL_RUNOUT_PIN PB8 // MT_DET + +// +// LCD Pins +// +#if HAS_SPI_LCD + #define BEEPER_PIN PD2 + #define BTN_ENC PB3 + #define LCD_PINS_RS PC3 + + #define BTN_EN1 PB5 + #define BTN_EN2 PB4 + + #define LCD_PINS_ENABLE PC2 + + #if ENABLED(MKS_MINI_12864) + + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN -1 + #define DOGLCD_A0 PC1 + #define DOGLCD_CS PC2 + #define DOGLCD_SCK PB13 + #define DOGLCD_MOSI PB15 + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PC1 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 -1 + #define LCD_PINS_D6 -1 + #define LCD_PINS_D7 -1 + #endif + + #endif // !MKS_MINI_12864 + +#endif // HAS_SPI_LCD + +// Motor current PWM pins +#define MOTOR_CURRENT_PWM_XY_PIN PB0 +#define MOTOR_CURRENT_PWM_Z_PIN PA7 +#define MOTOR_CURRENT_PWM_E_PIN PA6 +#define MOTOR_CURRENT_PWM_RANGE (65535/10/3.3) // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp +#define DEFAULT_PWM_MOTOR_CURRENT { 1000, 1000, 1000 } // 1.05Amp per driver, here is XY, Z and E. This values determined empirically. + +// +// SD Card +// +#define ENABLE_SPI2 +#define SD_DETECT_PIN PC10 +#define SCK_PIN PB13 +#define MISO_PIN P1B4 +#define MOSI_PIN P1B5 +#define SS_PIN PA15 + +#if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) +#endif diff --git a/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE3.h new file mode 100644 index 000000000000..6d6787903b70 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE3.h @@ -0,0 +1,153 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * MKS Robin Lite 3 (STM32F103RCT6) board pin assignments + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS Robin Lite3 supports up to 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "MKS Robin Lite3" +#endif +#define BOARD_WEBSITE_URL "github.com/makerbase-mks" + +//#define DISABLE_DEBUG +#define DISABLE_JTAG +#define ENABLE_SPI2 + +// +// Servos +// +#define SERVO0_PIN PA3 + +// +// Limit Switches +// +#define X_STOP_PIN PA12 +#define Y_STOP_PIN PA11 +#define Z_MIN_PIN PC6 +#define Z_MAX_PIN PB1 + +// +// Steppers +// +#define X_STEP_PIN PC0 +#define X_DIR_PIN PB2 +#define X_ENABLE_PIN PC13 + +#define Y_STEP_PIN PC2 +#define Y_DIR_PIN PB9 +#define Y_ENABLE_PIN PB12 + +#define Z_STEP_PIN PB7 +#define Z_DIR_PIN PB6 +#define Z_ENABLE_PIN PB8 + +#define E0_STEP_PIN PB4 +#define E0_DIR_PIN PB3 +#define E0_ENABLE_PIN PB5 + +#define E1_STEP_PIN PC12 +#define E1_DIR_PIN PC11 +#define E1_ENABLE_PIN PD2 + +// +// Heaters 0,1 / Fans / Bed +// +#define HEATER_0_PIN PC9 +#define HEATER_1_PIN PC7 +#define FAN_PIN PA8 +#define HEATER_BED_PIN PC8 + +// +// Temperature Sensors +// +#define TEMP_BED_PIN PA1 //TB +#define TEMP_0_PIN PA0 //TH1 +#define TEMP_1_PIN PA2 //TH2 + +#define FIL_RUNOUT_PIN PB10 // MT_DET + +// +// LCD Pins +// +#if HAS_SPI_LCD + + #define BEEPER_PIN PC1 + #define BTN_ENC PC3 + #define LCD_PINS_ENABLE PA4 + #define LCD_PINS_RS PA5 + #define BTN_EN1 PB11 + #define BTN_EN2 PB0 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN -1 + #define DOGLCD_A0 PC4 + #define DOGLCD_CS PA7 + #define DOGLCD_SCK PB13 + #define DOGLCD_MOSI PB15 + + // Required for MKS_MINI_12864 with this board + #define MKS_LCD12864B + #undef SHOW_BOOTSCREEN + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PA6 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PA7 + #define LCD_PINS_D6 PC4 + #define LCD_PINS_D7 PC5 + #endif + + #endif // !MKS_MINI_12864 + +#endif // HAS_SPI_LCD + +// +// SD Card +// +#define ENABLE_SPI2 +#define SD_DETECT_PIN PC10 +#define SCK_PIN PB13 +#define MISO_PIN PB14 +#define MOSI_PIN PB15 +#define SS_PIN PA15 + +#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 diff --git a/Marlin/src/pins/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32/pins_MKS_ROBIN_MINI.h old mode 100755 new mode 100644 similarity index 71% rename from Marlin/src/pins/pins_MKS_ROBIN_MINI.h rename to Marlin/src/pins/stm32/pins_MKS_ROBIN_MINI.h index b488955b89b8..202ea91edf7b --- a/Marlin/src/pins/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32/pins_MKS_ROBIN_MINI.h @@ -27,19 +27,23 @@ #ifndef __STM32F1__ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#if HOTENDS > 1 || E_STEPPERS > 1 +#elif HOTENDS > 1 || E_STEPPERS > 1 #error "MKS Robin mini supports up to 1 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "MKS Robin mini" +#define BOARD_INFO_NAME "MKS Robin mini" // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // #define DISABLE_DEBUG +#define FLASH_EEPROM_EMULATION +// 2K in a AT24C16N +#define EEPROM_PAGE_SIZE (uint16)0x800 // 2048 +#define EEPROM_START_ADDRESS ((uint32)(0x8000000 + 512 * 1024 - 2 * EEPROM_PAGE_SIZE)) +#define E2END (EEPROM_PAGE_SIZE - 1) + // // Note: MKS Robin mini board is using SPI2 interface. // @@ -48,13 +52,15 @@ // // Limit Switches // -#define X_MIN_PIN PA15 -#define X_MAX_PIN PA15 -#define Y_MIN_PIN PA12 -#define Y_MAX_PIN PA12 +#define X_STOP_PIN PA15 +#define Y_STOP_PIN PA12 #define Z_MIN_PIN PA11 #define Z_MAX_PIN PC4 +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA4 // MT_DET +#endif + // // Steppers // @@ -78,49 +84,63 @@ // Temperature Sensors // #define TEMP_0_PIN PC1 // TH1 -//#define TEMP_1_PIN PC2 // TH2 #define TEMP_BED_PIN PC0 // TB1 // // Heaters / Fans // #define HEATER_0_PIN PC3 // HEATER1 -//#define HEATER_1_PIN PA6 // HEATER2 #define HEATER_BED_PIN PA0 // HOT BED #define FAN_PIN PB1 // FAN -#define BTN_ENC PB3 // Pin is not connected. Real pin is needed to enable encoder's push button functionality used by touch screen - +// +// Thermocouples +// //#define MAX6675_SS_PIN PE5 // TC1 - CS1 //#define MAX6675_SS_PIN PE6 // TC2 - CS2 +// +// Misc. Functions +// #define POWER_LOSS_PIN PA2 // PW_DET #define PS_ON_PIN PA3 // PW_OFF -#define FIL_RUNOUT_PIN PF11 // MT_DET -#define BEEPER_PIN PC5 //#define LED_PIN PB2 +// +// LCD / Controller +// +#define BEEPER_PIN PC5 +#define SD_DETECT_PIN PD12 + /** - * Note: MKS Robin TFT screens may have different TFT controllers - * If the screen stays white, disable 'LCD_RESET_PIN' to rely on the bootloader to do screen initialization. + * Note: MKS Robin TFT screens use various TFT controllers. + * If the screen stays white, disable 'LCD_RESET_PIN' + * to let the bootloader init the screen. */ -#define LCD_RESET_PIN PF6 -#define NO_LCD_REINIT // Suppress LCD re-initialization +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 -#define LCD_BACKLIGHT_PIN PD13 -#define FSMC_CS_PIN PD7 // NE4 -#define FSMC_RS_PIN PD11 // A0 -#define TOUCH_CS PC2 + #define LCD_RESET_PIN PC6 + #define NO_LCD_REINIT // Suppress LCD re-initialization -#define SD_DETECT_PIN PD12 + #define LCD_BACKLIGHT_PIN PD13 + + #if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CS_PIN PC2 + #define TOUCH_SCK_PIN PB13 + #define TOUCH_MOSI_PIN PB15 + #define TOUCH_MISO_PIN PB14 + #endif +#endif // Motor current PWM pins #define MOTOR_CURRENT_PWM_XY_PIN PA6 #define MOTOR_CURRENT_PWM_Z_PIN PA7 #define MOTOR_CURRENT_PWM_E_PIN PB0 -#define MOTOR_CURRENT_PWM_RANGE 65535 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp +#define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp #define DEFAULT_PWM_MOTOR_CURRENT { 1030, 1030, 1030 } // 1.05Amp per driver, here is XY, Z and E. This values determined empirically. // This is a kind of workaround in case native marlin "digipot" interface won't work. diff --git a/Marlin/src/pins/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32/pins_MKS_ROBIN_NANO.h old mode 100755 new mode 100644 similarity index 73% rename from Marlin/src/pins/pins_MKS_ROBIN_NANO.h rename to Marlin/src/pins/stm32/pins_MKS_ROBIN_NANO.h index d57ac334065c..95337c07efe3 --- a/Marlin/src/pins/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32/pins_MKS_ROBIN_NANO.h @@ -27,24 +27,17 @@ #ifndef __STM32F1__ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" -#endif - -#if HOTENDS > 2 || E_STEPPERS > 2 +#elif HOTENDS > 2 || E_STEPPERS > 2 #error "MKS Robin nano supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "MKS Robin nano" +#define BOARD_INFO_NAME "MKS Robin nano" // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // #define DISABLE_DEBUG -// -// Note: MKS Robin board is using SPI2 interface. -// -#define SPI_MODULE 2 - // // Limit Switches // @@ -53,6 +46,10 @@ #define Z_MIN_PIN PA11 #define Z_MAX_PIN PC4 +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA4 // MT_DET +#endif + // // Steppers // @@ -92,28 +89,49 @@ #define FAN_PIN PB1 // FAN -#define BTN_ENC PC13 // Pin is not connected. Real pin is needed to enable encoder's push button functionality used by touch screen - +// +// Thermocouples +// //#define MAX6675_SS_PIN PE5 // TC1 - CS1 //#define MAX6675_SS_PIN PE6 // TC2 - CS2 +// +// Misc. Functions +// #define POWER_LOSS_PIN PA2 // PW_DET #define PS_ON_PIN PA3 // PW_OFF -#define FIL_RUNOUT_PIN PA4 // MT_DET -#define BEEPER_PIN PC5 #define LED_PIN PB2 +// +// SD Card +// +#define SDIO_SUPPORT +#define SD_DETECT_PIN PD12 + +// +// LCD / Controller +// +#define BEEPER_PIN PC5 + /** - * Note: MKS Robin TFT screens may have different TFT controllers - * If the screen stays white, disable 'LCD_RESET_PIN' to rely on the bootloader to do screen initialization. + * Note: MKS Robin TFT screens use various TFT controllers. + * If the screen stays white, disable 'LCD_RESET_PIN' + * to let the bootloader init the screen. */ -#define LCD_RESET_PIN PF6 -#define NO_LCD_REINIT // Suppress LCD re-initialization +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 -#define LCD_BACKLIGHT_PIN PD13 -#define FSMC_CS_PIN PD7 // NE4 -#define FSMC_RS_PIN PD11 // A0 -#define TOUCH_CS PA7 + #define LCD_RESET_PIN PC6 // FSMC_RST + #define NO_LCD_REINIT // Suppress LCD re-initialization -#define SD_DETECT_PIN PD12 + #define LCD_BACKLIGHT_PIN PD13 + + #if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CS_PIN PA7 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + #endif +#endif diff --git a/Marlin/src/pins/stm32/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32/pins_MKS_ROBIN_PRO.h new file mode 100644 index 000000000000..f29de56120f5 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_MKS_ROBIN_PRO.h @@ -0,0 +1,274 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * MKS Robin pro (STM32F103ZET6) board pin assignments + */ + +#ifndef __STM32F1__ + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "MKS Robin pro supports up to 3 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "MKS Robin pro" + +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + +// +// Note: MKS Robin board is using SPI2 interface. +// +//#define SPI_MODULE 2 +#define ENABLE_SPI2 + +// +// Servos +// +#define SERVO0_PIN PA8 // BLTOUCH + +// +// Limit Switches +// +#define X_MIN_PIN PA15 +#define X_MAX_PIN PG7 +#define Y_MIN_PIN PA12 +#define Y_MAX_PIN PG8 +#define Z_MIN_PIN PA11 +#define Z_MAX_PIN PC4 + +// +// Steppers +// +#define X_ENABLE_PIN PE4 +#define X_STEP_PIN PE3 +#define X_DIR_PIN PE2 +#ifndef X_CS_PIN + #define X_CS_PIN PF8 +#endif + +#define Y_ENABLE_PIN PE1 +#define Y_STEP_PIN PE0 +#define Y_DIR_PIN PB9 +#ifndef Y_CS_PIN + #define Y_CS_PIN PF3 +#endif + +#define Z_ENABLE_PIN PB8 +#define Z_STEP_PIN PB5 +#define Z_DIR_PIN PB4 +#ifndef Z_CS_PIN + #define Z_CS_PIN PF6 +#endif + +#define E0_ENABLE_PIN PB3 +#define E0_STEP_PIN PD6 +#define E0_DIR_PIN PD3 +#ifndef E0_CS_PIN + #define E0_CS_PIN PG15 +#endif + +#define E1_ENABLE_PIN PA3 +#define E1_STEP_PIN PA6 +#define E1_DIR_PIN PA1 +#ifndef E1_CS_PIN + #define E1_CS_PIN PG10 +#endif + +#define E2_ENABLE_PIN PF0 +#define E2_STEP_PIN PF2 +#define E2_DIR_PIN PF1 +#ifndef E2_CS_PIN + #define E2_CS_PIN PG9 +#endif +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PB15 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB14 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB13 + #endif +#endif + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PF7 + #define X_SERIAL_RX_PIN PF8 + + #define Y_SERIAL_TX_PIN PF4 + #define Y_SERIAL_RX_PIN PF3 + + #define Z_SERIAL_TX_PIN PF5 + #define Z_SERIAL_RX_PIN PF6 + + #define E0_SERIAL_TX_PIN PG13 + #define E0_SERIAL_RX_PIN PG15 + + #define E1_SERIAL_TX_PIN PG12 + #define E1_SERIAL_RX_PIN PG10 + + #define E2_SERIAL_TX_PIN PC13 + #define E2_SERIAL_RX_PIN PG9 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // TH1 +#define TEMP_1_PIN PC2 // TH2 +#define TEMP_2_PIN PC3 // TH3 +#define TEMP_BED_PIN PC0 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PF10 // +HE0- +#define HEATER_1_PIN PB0 // +HE1- +#define HEATER_2_PIN PF9 // +HE2- +#define HEATER_BED_PIN PA0 // +HOT-BED- +#define FAN_PIN PB1 // +FAN- + +/** + * Note: MKS Robin Pro board is using SPI2 interface. Make sure your stm32duino library is configured accordingly + */ +//#define MAX6675_SS_PIN PE5 // TC1 - CS1 +//#define MAX6675_SS_PIN PF11 // TC2 - CS2 + +#define POWER_LOSS_PIN PA2 // PW_DET +#define PS_ON_PIN PG11 // PW_OFF +#define FIL_RUNOUT_PIN PA4 // MT_DET1 +//#define FIL_RUNOUT_PIN PE6 // MT_DET2 +//#define FIL_RUNOUT_PIN PG14 // MT_DET3 + +// +// SD Card +// +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(LCD) + #define ENABLE_SPI2 + #define SD_DETECT_PIN PG3 + #define SCK_PIN PB13 + #define MISO_PIN PB14 + #define MOSI_PIN PB15 + #define SS_PIN PG6 +#elif SD_CONNECTION_IS(ONBOARD) + #define SDIO_SUPPORT + #define SD_DETECT_PIN PD12 +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "No custom SD drive cable defined for this board." +#endif + +/** + * Note: MKS Robin TFT screens use various TFT controllers. + * If the screen stays white, disable 'LCD_RESET_PIN' + * to let the bootloader init the screen. + */ +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define FSMC_CS_PIN PD7 // NE4 + #define FSMC_RS_PIN PD11 // A0 + + #define LCD_RESET_PIN PF6 + #define NO_LCD_REINIT // Suppress LCD re-initialization + + #define LCD_BACKLIGHT_PIN PD13 + + #if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CS_PIN PA7 + #else + #define BEEPER_PIN PC5 + #define BTN_ENC PG2 + #define BTN_EN1 PG5 + #define BTN_EN2 PG4 + #endif + +#elif HAS_SPI_LCD + + #define BEEPER_PIN PC5 + #define BTN_ENC PG2 + #define LCD_PINS_ENABLE PG0 + #define LCD_PINS_RS PG1 + #define BTN_EN1 PG5 + #define BTN_EN2 PG4 + + // MKS MINI12864 and MKS LCD12864B. If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN -1 + #define DOGLCD_A0 PF12 + #define DOGLCD_CS PF15 + #define DOGLCD_SCK PB13 + #define DOGLCD_MOSI PB15 + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 PF14 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PF15 + #define LCD_PINS_D6 PF12 + #define LCD_PINS_D7 PF13 + #endif + + #endif // !MKS_MINI_12864 +#endif + +#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 diff --git a/Marlin/src/pins/pins_MORPHEUS.h b/Marlin/src/pins/stm32/pins_MORPHEUS.h similarity index 97% rename from Marlin/src/pins/pins_MORPHEUS.h rename to Marlin/src/pins/stm32/pins_MORPHEUS.h index fe9c9dce3b9e..fd4da1ab7de5 100644 --- a/Marlin/src/pins/pins_MORPHEUS.h +++ b/Marlin/src/pins/stm32/pins_MORPHEUS.h @@ -34,7 +34,7 @@ #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #endif -#define BOARD_NAME "Bluepill based board" +#define BOARD_INFO_NAME "Bluepill based board" // // Limit Switches diff --git a/Marlin/src/pins/pins_REMRAM_V1.h b/Marlin/src/pins/stm32/pins_REMRAM_V1.h similarity index 96% rename from Marlin/src/pins/pins_REMRAM_V1.h rename to Marlin/src/pins/stm32/pins_REMRAM_V1.h index 409d47b2c207..aa9d6ea17813 100644 --- a/Marlin/src/pins/pins_REMRAM_V1.h +++ b/Marlin/src/pins/stm32/pins_REMRAM_V1.h @@ -25,10 +25,10 @@ #error "Oops! Select an STM32F7 board in 'Tools > Board.'" #endif +#define BOARD_INFO_NAME "RemRam v1" #define DEFAULT_MACHINE_NAME "RemRam" -#define BOARD_NAME "RemRam v1" -#define EEPROM_EMULATED_WITH_SRAM // Emulate the EEPROM using Backup SRAM +#define SRAM_EEPROM_EMULATION // Emulate the EEPROM using Backup SRAM #if HOTENDS > 1 || E_STEPPERS > 1 #error "RemRam supports only one hotend / E-stepper." diff --git a/Marlin/src/pins/pins_RUMBA32.h b/Marlin/src/pins/stm32/pins_RUMBA32.h similarity index 95% rename from Marlin/src/pins/pins_RUMBA32.h rename to Marlin/src/pins/stm32/pins_RUMBA32.h index f3fb0a3d4a55..26b4540c2b8c 100644 --- a/Marlin/src/pins/pins_RUMBA32.h +++ b/Marlin/src/pins/stm32/pins_RUMBA32.h @@ -23,19 +23,16 @@ #ifndef STM32F4 #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "RUMBA32 supports up to 3 hotends / E-steppers." #endif #define RUMBA32_V1_0 -#define DEFAULT_MACHINE_NAME "RUMBA32" -#define BOARD_NAME "RUMBA32" +#define BOARD_INFO_NAME "RUMBA32" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME //#define I2C_EEPROM - -#define E2END 0xFFF // EEPROM end address (4kB) - -#if HOTENDS > 3 || E_STEPPERS > 3 - #error "RUMBA32 supports up to 3 hotends / E-steppers." -#endif +#define E2END 0xFFF // 4KB // // Limit Switches diff --git a/Marlin/src/pins/pins_STEVAL.h b/Marlin/src/pins/stm32/pins_STEVAL.h similarity index 98% rename from Marlin/src/pins/pins_STEVAL.h rename to Marlin/src/pins/stm32/pins_STEVAL.h index d174b339c9a5..062981a1eac6 100644 --- a/Marlin/src/pins/pins_STEVAL.h +++ b/Marlin/src/pins/stm32/pins_STEVAL.h @@ -35,9 +35,9 @@ // // Limit Switches // -#define X_MIN_PIN 38 // PD8 X_STOP +#define X_MIN_PIN 38 // PD8 X_STOP #define X_MAX_PIN -1 -#define Y_MIN_PIN 39 // PD9 Y_STOP +#define Y_MIN_PIN 39 // PD9 Y_STOP #define Y_MAX_PIN -1 #define Z_MIN_PIN 40 // PD10 Z_STOP #define Z_MAX_PIN -1 diff --git a/Marlin/src/pins/pins_STM32F1R.h b/Marlin/src/pins/stm32/pins_STM32F1R.h similarity index 95% rename from Marlin/src/pins/pins_STM32F1R.h rename to Marlin/src/pins/stm32/pins_STM32F1R.h index 91de11a959d1..ccafcad1f7b4 100644 --- a/Marlin/src/pins/pins_STM32F1R.h +++ b/Marlin/src/pins/stm32/pins_STM32F1R.h @@ -29,18 +29,15 @@ * 21017 Victor Perez Marlin for stm32f1 test */ +#define BOARD_INFO_NAME "Misc. STM32F1R" #define DEFAULT_MACHINE_NAME "STM32F103RET6" -#define BOARD_NAME "Marlin for STM32" -// Ignore temp readings during develpment. -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 // // Limit Switches // -#define U_MIN_PIN -1 -#define V_MIN_PIN -1 -#define W_MIN_PIN -1 #define X_STOP_PIN PB3 #define Y_STOP_PIN PB4 #define Z_STOP_PIN PB5 @@ -122,7 +119,7 @@ #define LCD_PINS_D7 PB15 #if DISABLED(NEWPANEL) #define BEEPER_PIN 33 - // Buttons are attached to a shift register + // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK 38 //#define SHIFT_LD 42 @@ -233,7 +230,7 @@ // Beeper on AUX-4 #define BEEPER_PIN 33 - // buttons are directly attached using AUX-2 + // Buttons directly attached to AUX-2 #if ENABLED(REPRAPWORLD_KEYPAD) #define BTN_EN1 64 #define BTN_EN2 59 diff --git a/Marlin/src/pins/pins_STM3R_MINI.h b/Marlin/src/pins/stm32/pins_STM3R_MINI.h similarity index 54% rename from Marlin/src/pins/pins_STM3R_MINI.h rename to Marlin/src/pins/stm32/pins_STM3R_MINI.h index acf2dfaf2944..9192ae453e67 100644 --- a/Marlin/src/pins/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32/pins_STM3R_MINI.h @@ -29,21 +29,18 @@ * 21017 Victor Perez Marlin for stm32f1 test */ -#define DEFAULT_MACHINE_NAME "STM3R Mini" -#define BOARD_NAME "Marlin for STM32" +#define BOARD_INFO_NAME "STM3R Mini" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME // Enable I2C_EEPROM for testing #define I2C_EEPROM -// Ignore temp readings during develpment. -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 // // Limit Switches // -#define U_MIN_PIN -1 -#define V_MIN_PIN -1 -#define W_MIN_PIN -1 #define X_STOP_PIN PD0 #define Y_STOP_PIN PD1 #define Z_STOP_PIN PD4 @@ -118,35 +115,43 @@ #if HAS_SPI_LCD #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 BOTH(NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 + #define LCD_PINS_RS PB8 + #define LCD_PINS_ENABLE PD2 + #define LCD_PINS_D4 PB12 + #define LCD_PINS_D5 PB13 + #define LCD_PINS_D6 PB14 + #define LCD_PINS_D7 PB15 #else - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 + #define LCD_PINS_RS PB8 + #define LCD_PINS_ENABLE PD2 + #define LCD_PINS_D4 PB12 + #define LCD_PINS_D5 PB13 + #define LCD_PINS_D6 PB14 + #define LCD_PINS_D7 PB15 #if DISABLED(NEWPANEL) - #define BEEPER_PIN 33 - // Buttons are attached to a shift register + #define BEEPER_PIN 33 + // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + //#define SHIFT_CLK 38 + //#define SHIFT_LD 42 + //#define SHIFT_OUT 40 + //#define SHIFT_EN 17 #endif #endif - #if ENABLED(NEWPANEL) + #if ENABLED(TOUCH_BUTTONS) + + #define TOUCH_CS_PIN PB12 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 + #define TOUCH_MOSI_PIN PB14 + #define TOUCH_MISO_PIN PB15 + #define TOUCH_INT_PIN PC6 // (PenIRQ coming from ADS7843) + + #elif ENABLED(NEWPANEL) #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) @@ -165,111 +170,111 @@ #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 + #define BTN_EN1 64 + #define BTN_EN2 59 + #define BTN_ENC 63 + #define SD_DETECT_PIN 42 #elif ENABLED(LCD_I2C_PANELOLU2) - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 + #define BTN_EN1 47 + #define BTN_EN2 43 + #define BTN_ENC 32 + #define LCD_SDSS 53 + #define SD_DETECT_PIN -1 + #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 53 - #define SD_DETECT_PIN 49 + #define BTN_ENC -1 + #define LCD_SDSS 53 + #define SD_DETECT_PIN 49 #elif ANY(VIKI2, miniVIKI) - #define BEEPER_PIN 33 + #define BEEPER_PIN 33 // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 + #define DOGLCD_A0 44 + #define DOGLCD_CS 45 #define LCD_SCREEN_ROT_180 - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 + #define BTN_EN1 22 + #define BTN_EN2 7 + #define BTN_ENC 39 - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board + #define SDSS 53 + #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - #define KILL_PIN 31 + #define KILL_PIN 31 #define STAT_LED_RED_PIN 32 #define STAT_LED_BLUE_PIN 35 #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 + #define BTN_EN1 35 + #define BTN_EN2 37 + #define BTN_ENC 31 + #define SD_DETECT_PIN 49 + #define LCD_SDSS 53 + #define KILL_PIN 41 + #define BEEPER_PIN 23 + #define DOGLCD_CS 29 + #define DOGLCD_A0 27 #define LCD_BACKLIGHT_PIN 33 #elif ENABLED(MINIPANEL) - #define BEEPER_PIN 42 + #define BEEPER_PIN 42 // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 + #define DOGLCD_A0 44 + #define DOGLCD_CS 66 #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 + #define SDSS 53 - #define KILL_PIN 64 + #define KILL_PIN 64 // GLCD features // 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 40 - #define BTN_EN2 63 - #define BTN_ENC 59 + #define BTN_EN1 40 + #define BTN_EN2 63 + #define BTN_ENC 59 // not connected to a pin - #define SD_DETECT_PIN 49 + #define SD_DETECT_PIN 49 #else // Beeper on AUX-4 - #define BEEPER_PIN 33 + #define BEEPER_PIN 33 - // buttons are directly attached using AUX-2 + // Buttons directly attached to AUX-2 #if ENABLED(REPRAPWORLD_KEYPAD) - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 + #define BTN_EN1 64 + #define BTN_EN2 59 + #define BTN_ENC 63 + #define SHIFT_OUT 40 + #define SHIFT_CLK 44 + #define SHIFT_LD 42 #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 - #define BTN_ENC 31 + #define BTN_EN1 37 + #define BTN_EN2 35 + #define BTN_ENC 31 #endif #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 + #define SD_DETECT_PIN 49 + #define KILL_PIN 41 #else //#define SD_DETECT_PIN -1 // Ramps doesn't use this #endif diff --git a/Marlin/src/pins/pins_THE_BORG.h b/Marlin/src/pins/stm32/pins_THE_BORG.h similarity index 95% rename from Marlin/src/pins/pins_THE_BORG.h rename to Marlin/src/pins/stm32/pins_THE_BORG.h index 141320f88c7d..1f8569e4ea6a 100644 --- a/Marlin/src/pins/pins_THE_BORG.h +++ b/Marlin/src/pins/stm32/pins_THE_BORG.h @@ -21,21 +21,19 @@ */ #pragma once -#if !defined(STM32F7) +#ifndef STM32F7 #error "Oops! Select an STM32F7 board in 'Tools > Board.'" +#elif HOTENDS > 3 || E_STEPPERS > 3 + #error "The-Borg supports up to 3 hotends / E-steppers." #endif -#define DEFAULT_MACHINE_NAME "The-Borge" -#define BOARD_NAME "The-Borge" +#define BOARD_INFO_NAME "The-Borge" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #define E2END 0xFFF // EEPROM end address -// Ignore temp readings during develpment. -#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE - -#if HOTENDS > 3 || E_STEPPERS > 3 - #error "The-Borg supports up to 3 hotends / E-steppers." -#endif +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 // // Limit Switches diff --git a/Marlin/src/pins/stm32/pins_VAKE403D.h b/Marlin/src/pins/stm32/pins_VAKE403D.h new file mode 100644 index 000000000000..df23f3b3186d --- /dev/null +++ b/Marlin/src/pins/stm32/pins_VAKE403D.h @@ -0,0 +1,194 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +#if !defined(STM32F4) && !defined(STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "STM32F4 supports up to 2 hotends / E-steppers." +#endif + +#define DEFAULT_MACHINE_NAME "STM32F446VET6" +#define BOARD_NAME "STM32F4 VAkE" + +//#define I2C_EEPROM + +#define E2END 0xFFF // EEPROM end address (4kB) + +// +// Servos +// +//#define SERVO0_PIN PE13 +//#define SERVO1_PIN PE14 + +// +// Limit Switches +// +#define X_STOP_PIN PE10 +#define Y_STOP_PIN PE9 +#define Z_STOP_PIN PE8 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PA4 +#endif + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PA3 + +// +// Steppers +// + +#define STEPPER_ENABLE_PIN PB2 + +#define X_STEP_PIN PC6 // X_STEP +#define X_DIR_PIN PC7 // X_DIR +#define X_ENABLE_PIN PB2 // +#ifndef X_CS_PIN + #define X_CS_PIN PC8 // X_CS +#endif + +#define Y_STEP_PIN PD9 // Y_STEP +#define Y_DIR_PIN PD10 // Y_DIR +#define Y_ENABLE_PIN PB2 // +#ifndef Y_CS_PIN + #define Y_CS_PIN PD11 // Y_CS +#endif + +#define Z_STEP_PIN PE15 // Z_STEP +#define Z_DIR_PIN PB10 // Z_DIR +#define Z_ENABLE_PIN PB2 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD8 +#endif + +#define E0_STEP_PIN PB1 +#define E0_DIR_PIN PB13 +#define E0_ENABLE_PIN PB2 +#ifndef E0_CS_PIN + #define E0_CS_PIN PE11 +#endif + +#define E1_STEP_PIN PC4 +#define E1_DIR_PIN PC5 +#define E1_ENABLE_PIN PB2 +#ifndef E1_CS_PIN + #define E1_CS_PIN PB0 +#endif + +#define SCK_PIN PE12 // PA5 // SPI1 for SD card +#define MISO_PIN PE13 // PA6 +#define MOSI_PIN PE14 // PA7 + +// added for SD card : optional or not ??? +//#define SD_CHIP_SELECT_PIN SDSS // The default chip select pin for the SD card is SS. +// The following three pins must not be redefined for hardware SPI. +//#define SPI_MOSI_PIN MOSI_PIN // SPI Master Out Slave In pin +//#define SPI_MISO_PIN MISO_PIN // SPI Master In Slave Out pin +//#define SPI_SCK_PIN SCK_PIN // SPI Clock pin + +// +// Temperature Sensors (Analog inputs) +// + +#define TEMP_0_PIN PC0 // Analog Input +#define TEMP_1_PIN PC1 // Analog Input +#define TEMP_2_PIN PC2 // Analog Input +#define TEMP_3_PIN PC3 // Analog Input +#define TEMP_BED_PIN PC3 // Analog Input + +// +// Heaters / Fans +// + +#define HEATER_0_PIN PD15 +#define HEATER_1_PIN PD14 +#define HEATER_BED_PIN PD12 + +#ifndef FAN_PIN + #define FAN_PIN PD13 +#endif +#define FAN1_PIN PB5 // PA0 +#define FAN2_PIN PB4 // PA1 + +#define ORIG_E0_AUTO_FAN_PIN PD13 // Use this by NOT overriding E0_AUTO_FAN_PIN + +// +// Misc. Functions +// + +//#define CASE_LIGHT_PIN_CI PF13 +//#define CASE_LIGHT_PIN_DO PF14 +//#define NEOPIXEL_PIN PF13 + +// +// Prusa i3 MK2 Multi Material Multiplexer Support +// +//#define E_MUX0_PIN PG3 +//#define E_MUX1_PIN PG4 + +#define LED_PIN PB14 // Alive +#define PS_ON_PIN PE0 +#define KILL_PIN PD5 +#define POWER_LOSS_PIN PA4 // ?? Power loss / nAC_FAULT + +#if ENABLED(SDSUPPORT) + #define SD_DETECT_PIN PB7 + #define SS_PIN PB_15 // USD_CS -> CS for onboard SD +#endif + +// +// LCD / Controller +// +#if HAS_SPI_LCD + #if ENABLED(SDSUPPORT) + #define SDSS PB6 // CS for SD card in LCD + #endif + #define BEEPER_PIN PC9 + #define LCD_PINS_RS PC12 + #define LCD_PINS_ENABLE PD7 + #define LCD_PINS_D4 PD1 + #define LCD_PINS_D5 PD2 + #define LCD_PINS_D6 PD3 + #define LCD_PINS_D7 PD4 + #define BTN_EN1 PD6 + #define BTN_EN2 PD0 + #define BTN_ENC PB12 +#endif + +// +// ST7920 Delays +// +#ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(96) +#endif +#ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(48) +#endif +#ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(715) +#endif diff --git a/Marlin/src/pins/pins_5DPRINT.h b/Marlin/src/pins/teensy2/pins_5DPRINT.h old mode 100755 new mode 100644 similarity index 99% rename from Marlin/src/pins/pins_5DPRINT.h rename to Marlin/src/pins/teensy2/pins_5DPRINT.h index 27e26e242a59..80c6975279d1 --- a/Marlin/src/pins/pins_5DPRINT.h +++ b/Marlin/src/pins/teensy2/pins_5DPRINT.h @@ -73,7 +73,7 @@ #endif #define DEFAULT_MACHINE_NAME "Makibox" -#define BOARD_NAME "5DPrint D8" +#define BOARD_INFO_NAME "5DPrint D8" // // Servos diff --git a/Marlin/src/pins/pins_BRAINWAVE.h b/Marlin/src/pins/teensy2/pins_BRAINWAVE.h similarity index 99% rename from Marlin/src/pins/pins_BRAINWAVE.h rename to Marlin/src/pins/teensy2/pins_BRAINWAVE.h index c254aa89f95f..3c38ad0b0108 100644 --- a/Marlin/src/pins/pins_BRAINWAVE.h +++ b/Marlin/src/pins/teensy2/pins_BRAINWAVE.h @@ -72,7 +72,7 @@ #error "Oops! Select 'AT90USB646_TEENSYPP' in 'Tools > Board.'" #endif -#define BOARD_NAME "Brainwave" +#define BOARD_INFO_NAME "Brainwave" // // Limit Switches diff --git a/Marlin/src/pins/pins_BRAINWAVE_PRO.h b/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h similarity index 99% rename from Marlin/src/pins/pins_BRAINWAVE_PRO.h rename to Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h index 920d02f15d6b..cd4dd33695f4 100644 --- a/Marlin/src/pins/pins_BRAINWAVE_PRO.h +++ b/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h @@ -79,7 +79,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define BOARD_NAME "Brainwave Pro" +#define BOARD_INFO_NAME "Brainwave Pro" // // Limit Switches diff --git a/Marlin/src/pins/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h similarity index 99% rename from Marlin/src/pins/pins_PRINTRBOARD.h rename to Marlin/src/pins/teensy2/pins_PRINTRBOARD.h index eef617fe8c18..6f6ba5b8c106 100644 --- a/Marlin/src/pins/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h @@ -66,7 +66,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define BOARD_NAME "Printrboard" +#define BOARD_INFO_NAME "Printrboard" // Disable JTAG pins so they can be used for the Extrudrboard #define DISABLE_JTAG diff --git a/Marlin/src/pins/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h similarity index 97% rename from Marlin/src/pins/pins_PRINTRBOARD_REVF.h rename to Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h index 096283e4c438..6aaa037d25c6 100644 --- a/Marlin/src/pins/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h @@ -71,7 +71,7 @@ #error "USBCON should be defined by the platform for this board." #endif -#define BOARD_NAME "Printrboard Rev.F" +#define BOARD_INFO_NAME "Printrboard Rev.F" // Disable JTAG pins so EXP1 pins work correctly // (Its pins are used for the Extrudrboard and filament sensor, for example). @@ -247,15 +247,9 @@ //#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 BOARD_ST7920_DELAY_1 DELAY_NS(313) + #define BOARD_ST7920_DELAY_2 DELAY_NS(313) + #define BOARD_ST7920_DELAY_3 DELAY_NS(313) #else diff --git a/Marlin/src/pins/pins_SAV_MKI.h b/Marlin/src/pins/teensy2/pins_SAV_MKI.h similarity index 96% rename from Marlin/src/pins/pins_SAV_MKI.h rename to Marlin/src/pins/teensy2/pins_SAV_MKI.h index 82d763031145..1ae186ab598b 100644 --- a/Marlin/src/pins/pins_SAV_MKI.h +++ b/Marlin/src/pins/teensy2/pins_SAV_MKI.h @@ -66,9 +66,9 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define DEFAULT_MACHINE_NAME "SAV MkI" -#define DEFAULT_SOURCE_CODE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config" -#define BOARD_NAME "SAV MkI" +#define BOARD_INFO_NAME "SAV MkI" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +#define DEFAULT_SOURCE_CODE_URL "https://tinyurl.com/onru38b" // // Servos diff --git a/Marlin/src/pins/pins_TEENSY2.h b/Marlin/src/pins/teensy2/pins_TEENSY2.h similarity index 99% rename from Marlin/src/pins/pins_TEENSY2.h rename to Marlin/src/pins/teensy2/pins_TEENSY2.h index 572cb0707979..a91a019121f8 100644 --- a/Marlin/src/pins/pins_TEENSY2.h +++ b/Marlin/src/pins/teensy2/pins_TEENSY2.h @@ -111,7 +111,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define BOARD_NAME "Teensy++2.0" +#define BOARD_INFO_NAME "Teensy++2.0" // // Limit Switches diff --git a/Marlin/src/pins/pins_TEENSYLU.h b/Marlin/src/pins/teensy2/pins_TEENSYLU.h old mode 100755 new mode 100644 similarity index 99% rename from Marlin/src/pins/pins_TEENSYLU.h rename to Marlin/src/pins/teensy2/pins_TEENSYLU.h index c61e751c8716..5fde57180b70 --- a/Marlin/src/pins/pins_TEENSYLU.h +++ b/Marlin/src/pins/teensy2/pins_TEENSYLU.h @@ -77,7 +77,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define BOARD_NAME "Teensylu" +#define BOARD_INFO_NAME "Teensylu" // // Limit Switch definitions that match the SCHEMATIC diff --git a/Marlin/src/pins/pins_TEENSY31_32.h b/Marlin/src/pins/teensy3/pins_TEENSY31_32.h similarity index 51% rename from Marlin/src/pins/pins_TEENSY31_32.h rename to Marlin/src/pins/teensy3/pins_TEENSY31_32.h index 703652576263..a68b9e31c4d7 100644 --- a/Marlin/src/pins/pins_TEENSY31_32.h +++ b/Marlin/src/pins/teensy3/pins_TEENSY31_32.h @@ -21,18 +21,18 @@ */ #pragma once -/**************************************************************************************** -* Teensy 3.1 (MK20DX256) and Teensy 3.2 (MK20DX256) Breadboard pin assignments -* Requires the Teensyduino software with Teensy 3.1 or Teensy 3.2 selected in Arduino IDE! -* http://www.pjrc.com/teensy/teensyduino.html -****************************************************************************************/ +/** + * Teensy 3.1 (MK20DX256) and Teensy 3.2 (MK20DX256) Breadboard pin assignments + * Requires the Teensyduino software with Teensy 3.1 or Teensy 3.2 selected in Arduino IDE! + * http://www.pjrc.com/teensy/teensyduino.html + */ #if !IS_32BIT_TEENSY #error "Oops! Select 'Teensy 3.1' or 'Teensy 3.2' in 'Tools > Board.'" #endif -#if IS_TEENSY32 - #define BOARD_NAME "Teensy3.2" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Teensy3.2" #endif #define AT90USB 1286 // Disable MarlinSerial etc. @@ -41,64 +41,73 @@ // // Limit Switches // -#define X_STOP_PIN 3 -#define Y_STOP_PIN 4 -#define Z_STOP_PIN 5 +#define X_STOP_PIN 3 +#define Y_STOP_PIN 4 +#define Z_STOP_PIN 5 // // Steppers // -#define X_STEP_PIN 5 -#define X_DIR_PIN 6 -#define X_ENABLE_PIN 2 +#define X_STEP_PIN 5 +#define X_DIR_PIN 6 +#define X_ENABLE_PIN 2 -#define Y_STEP_PIN 7 -#define Y_DIR_PIN 8 -#define Y_ENABLE_PIN 2 +#define Y_STEP_PIN 7 +#define Y_DIR_PIN 8 +#define Y_ENABLE_PIN 2 -#define Z_STEP_PIN 9 +#define Z_STEP_PIN 9 #define Z_DIR_PIN 10 -#define Z_ENABLE_PIN 2 +#define Z_ENABLE_PIN 2 #define E0_STEP_PIN 11 #define E0_DIR_PIN 12 -#define E0_ENABLE_PIN 2 +#define E0_ENABLE_PIN 2 -// #define E1_STEP_PIN 33 -// #define E1_DIR_PIN 34 -// #define E1_ENABLE_PIN 35 +//#define E1_STEP_PIN 33 +//#define E1_DIR_PIN 34 +//#define E1_ENABLE_PIN 35 +// +// Heaters / Fans +// #define HEATER_0_PIN 20 -// #define HEATER_1_PIN 36 +// #define HEATER_1_PIN 36 #define HEATER_BED_PIN 21 #ifndef FAN_PIN #define FAN_PIN 22 #endif -#define TEMP_0_PIN 14 // Extruder / Analog pin numbering: 2 => A2 -// #define TEMP_1_PIN 0 -#define TEMP_BED_PIN 15 // Bed / Analog pin numbering +// +// Temperature Sensors +// +#define TEMP_0_PIN 14 // Analog Input - Extruder 2 => A2 +//#define TEMP_1_PIN 0 // Analog Input +#define TEMP_BED_PIN 15 // Analog Input - Bed -// #define SDSS 16 // 8 -#define LED_PIN 13 -#define PS_ON_PIN -1 -#define ALARM_PIN -1 - -// #define FILWIDTH_PIN 6 -// #define SOL1_PIN 28 - -#if 0 -// Pretty sure this is obsolete! -// Please use Marlin 1.1.x pins files as reference for new pins files. -#ifndef SDSUPPORT - // these are defined in the SD library if building with SD support - #define SCK_PIN 13 - #define MISO_PIN 12 - #define MOSI_PIN 11 -#endif +#ifndef FILWIDTH_PIN + #define FILWIDTH_PIN 6 // Analog Input #endif + +// +// Misc. Functions +// + +//#define SDSS 16 // 8 +#define LED_PIN 13 + +//#define SOL1_PIN 28 + +// +// LCD / Controller +// + +//#define SCK_PIN 13 +//#define MISO_PIN 12 +//#define MOSI_PIN 11 + /* -#ifdef ULTRA_LCD +#if HAS_SPI_LCD #define LCD_PINS_RS 40 #define LCD_PINS_ENABLE 41 #define LCD_PINS_D4 42 diff --git a/Marlin/src/pins/pins_TEENSY35_36.h b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h similarity index 98% rename from Marlin/src/pins/pins_TEENSY35_36.h rename to Marlin/src/pins/teensy3/pins_TEENSY35_36.h index 922eeb9fa4c9..b0f0e4d474bb 100644 --- a/Marlin/src/pins/pins_TEENSY35_36.h +++ b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h @@ -32,9 +32,9 @@ #endif #if IS_TEENSY35 - #define BOARD_NAME "Teensy3.5" + #define BOARD_INFO_NAME "Teensy3.5" #elif IS_TEENSY36 - #define BOARD_NAME "Teensy3.6" + #define BOARD_INFO_NAME "Teensy3.6" #endif #define AT90USB 1286 // Disable MarlinSerial etc. diff --git a/Marlin/src/sd/Sd2Card.cpp b/Marlin/src/sd/Sd2Card.cpp index 7942adde5f66..a09de08fe58a 100644 --- a/Marlin/src/sd/Sd2Card.cpp +++ b/Marlin/src/sd/Sd2Card.cpp @@ -227,18 +227,14 @@ 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(const uint8_t sckRateID/*=0*/, const pin_t chipSelectPin/*=SD_CHIP_SELECT_PIN*/) { +bool Sd2Card::init(const uint8_t sckRateID, const pin_t chipSelectPin) { errorCode_ = type_ = 0; chipSelectPin_ = chipSelectPin; // 16-bit init start time allows over a minute const millis_t init_timeout = millis() + SD_INIT_TIMEOUT; uint32_t arg; - // If init takes more than 4s it could trigger - // watchdog leading to a reboot loop. - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif + watchdog_refresh(); // In case init takes too long // Set pin modes extDigitalWrite(chipSelectPin_, HIGH); // For some CPUs pinMode can write the wrong data so init desired data value first @@ -252,10 +248,7 @@ bool Sd2Card::init(const uint8_t sckRateID/*=0*/, const pin_t chipSelectPin/*=SD // Must supply min of 74 clock cycles with CS high. for (uint8_t i = 0; i < 10; i++) spiSend(0xFF); - // Initialization can cause the watchdog to timeout, so reinit it here - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif + watchdog_refresh(); // In case init takes too long // Command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { @@ -269,10 +262,7 @@ bool Sd2Card::init(const uint8_t sckRateID/*=0*/, const pin_t chipSelectPin/*=SD crcSupported = (cardCommand(CMD59, 1) == R1_IDLE_STATE); #endif - // Initialization can cause the watchdog to timeout, so reinit it here - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif + watchdog_refresh(); // In case init takes too long // check SD version for (;;) { @@ -294,10 +284,7 @@ bool Sd2Card::init(const uint8_t sckRateID/*=0*/, const pin_t chipSelectPin/*=SD } } - // Initialization can cause the watchdog to timeout, so reinit it here - #if ENABLED(USE_WATCHDOG) - watchdog_reset(); - #endif + watchdog_refresh(); // In case init takes too long // Initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0; diff --git a/Marlin/src/sd/Sd2Card.h b/Marlin/src/sd/Sd2Card.h index cc895b009287..f44dbb3124b2 100644 --- a/Marlin/src/sd/Sd2Card.h +++ b/Marlin/src/sd/Sd2Card.h @@ -85,10 +85,6 @@ uint8_t const SD_CARD_TYPE_SD1 = 1, // Standard capacity V1 #elif USE_SOFTWARE_SPI #define SOFTWARE_SPI #endif // MEGA_SOFT_SPI -//------------------------------------------------------------------------------ -// SPI pin definitions - do not edit here - change in SdFatConfig.h -// -#define SD_CHIP_SELECT_PIN SS_PIN /** * \class Sd2Card @@ -123,7 +119,7 @@ class Sd2Card { * * \return true for success or false for failure. */ - bool init(const uint8_t sckRateID=SPI_FULL_SPEED, const pin_t chipSelectPin=SD_CHIP_SELECT_PIN); + bool init(const uint8_t sckRateID, const pin_t chipSelectPin); bool readBlock(uint32_t block, uint8_t* dst); diff --git a/Marlin/src/sd/Sd2Card_sdio.h b/Marlin/src/sd/Sd2Card_sdio.h index 990194eeea0b..2aa2e86c035c 100644 --- a/Marlin/src/sd/Sd2Card_sdio.h +++ b/Marlin/src/sd/Sd2Card_sdio.h @@ -25,7 +25,7 @@ #if ENABLED(SDIO_SUPPORT) -bool SDIO_Init(void); +bool SDIO_Init(); bool SDIO_ReadBlock(uint32_t block, uint8_t *dst); bool SDIO_WriteBlock(uint32_t block, const uint8_t *src); diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 08eb86409589..296920883845 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -273,7 +273,7 @@ int16_t SdBaseFile::fgets(char* str, int16_t num, char* delim) { * * \return true for success, false for failure. */ -bool SdBaseFile::getFilename(char * const name) { +bool SdBaseFile::getDosName(char * const name) { if (!isOpen()) return false; if (isRoot()) { @@ -957,7 +957,7 @@ void SdBaseFile::printFatTime(uint16_t fatTime) { */ bool SdBaseFile::printName() { char name[FILENAME_LENGTH]; - if (!getFilename(name)) return false; + if (!getDosName(name)) return false; SERIAL_ECHO(name); return true; } diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index 494b4f6bee0c..4d4062b1cd1f 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -286,7 +286,7 @@ class SdBaseFile { */ bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; } - bool getFilename(char * const name); + bool getDosName(char * const name); void ls(uint8_t flags = 0, uint8_t indent = 0); bool mkdir(SdBaseFile* dir, const char* path, bool pFlag = true); diff --git a/Marlin/src/sd/SdVolume.h b/Marlin/src/sd/SdVolume.h index 1c72fd3d27dc..b5282bdce3ec 100644 --- a/Marlin/src/sd/SdVolume.h +++ b/Marlin/src/sd/SdVolume.h @@ -33,6 +33,10 @@ * This file is part of the Arduino Sd2Card Library */ +#include + +#include "../inc/MarlinConfigPre.h" + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) #include "usb_flashdrive/Sd2Card_FlashDrive.h" #elif ENABLED(SDIO_SUPPORT) @@ -43,7 +47,6 @@ #include "SdFatConfig.h" #include "SdFatStructs.h" -#include //============================================================================== // SdVolume class diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index efd955259db6..7a01d3622f6d 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -62,6 +62,7 @@ SdFile CardReader::root, CardReader::workDir, CardReader::workDirParents[MAX_DIR uint8_t CardReader::workDirDepth; #if ENABLED(SDCARD_SORT_ALPHA) + uint16_t CardReader::sort_count; #if ENABLED(SDSORT_GCODE) bool CardReader::sort_alpha; @@ -78,6 +79,7 @@ uint8_t CardReader::workDirDepth; #if ENABLED(SDSORT_USES_RAM) #if ENABLED(SDSORT_CACHE_NAMES) + uint16_t CardReader::nrFiles; // Cached total file count #if ENABLED(SDSORT_DYNAMIC_RAM) char **CardReader::sortshort, **CardReader::sortnames; #else @@ -94,6 +96,7 @@ uint8_t CardReader::workDirDepth; #elif ENABLED(SDSORT_CACHE_NAMES) || DISABLED(SDSORT_USES_STACK) uint8_t CardReader::isDir[(SDSORT_LIMIT+7)>>3]; #endif + #define IS_DIR(n) TEST(isDir[(n) >> 3], (n) & 0x07) #endif #endif // SDSORT_USES_RAM @@ -110,10 +113,6 @@ char CardReader::proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; uint32_t CardReader::filesize, CardReader::sdpos; -LsAction CardReader::lsAction; //stored for recursion. -uint16_t CardReader::nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory. -char *CardReader::diveDirName; - CardReader::CardReader() { #if ENABLED(SDCARD_SORT_ALPHA) sort_count = 0; @@ -123,7 +122,7 @@ CardReader::CardReader() { //sort_reverse = false; #endif #endif - flag.sdprinting = flag.detected = flag.saving = flag.logging = false; + flag.sdprinting = flag.mounted = flag.saving = flag.logging = false; filesize = sdpos = 0; file_subcall_ctr = 0; @@ -133,13 +132,15 @@ CardReader::CardReader() { // Disable autostart until card is initialized autostart_index = -1; - //power to SD reader - #if SDPOWER > -1 - OUT_WRITE(SDPOWER, HIGH); + #if PIN_EXISTS(SDPOWER) + OUT_WRITE(SDPOWER_PIN, HIGH); // Power the SD reader #endif } -char *createFilename(char *buffer, const dir_t &p) { +// +// Get a DOS 8.3 filename in its useful form +// +char *createFilename(char * const buffer, const dir_t &p) { char *pos = buffer; for (uint8_t i = 0; i < 11; i++) { if (p.name[i] == ' ') continue; @@ -150,24 +151,78 @@ char *createFilename(char *buffer, const dir_t &p) { return buffer; } -/** - * Dive into a folder and recurse depth-first to perform a pre-set operation lsAction: - * LS_Count - Add +1 to nrFiles for every file within the parent - * LS_GetFilename - Get the filename of the file indexed by nrFile_index - * LS_SerialPrint - Print the full path and size of each file to serial output - */ +// +// Return 'true' if the item is a folder or G-code file +// +bool CardReader::is_dir_or_gcode(const dir_t &p) { + uint8_t pn0 = p.name[0]; + + if ( pn0 == DIR_NAME_FREE || pn0 == DIR_NAME_DELETED // Clear or Deleted entry + || pn0 == '.' || longFilename[0] == '.' // Hidden file + || !DIR_IS_FILE_OR_SUBDIR(&p) // Not a File or Directory + || (p.attributes & DIR_ATT_HIDDEN) // Hidden by attribute + ) return false; -uint16_t nrFile_index; + flag.filenameIsDir = DIR_IS_SUBDIR(&p); // We know it's a File or Folder -void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=nullptr*/) { + return ( + flag.filenameIsDir // All Directories are ok + || (p.name[8] == 'G' && p.name[9] != '~') // Non-backup *.G* files are accepted + ); +} + +// +// Get the number of (compliant) items in the folder +// +int CardReader::countItems(SdFile dir) { dir_t p; - uint8_t cnt = 0; + int c = 0; + while (dir.readDir(&p, longFilename) > 0) + c += is_dir_or_gcode(p); - // Read the next entry from a directory - while (parent.readDir(&p, longFilename) > 0) { + #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES + nrFiles = c; + #endif + + return c; +} - // If the entry is a directory and the action is LS_SerialPrint - if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) { +// +// Get file/folder info for an item by index +// +void CardReader::selectByIndex(SdFile dir, const uint8_t index) { + dir_t p; + for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0;) { + if (is_dir_or_gcode(p)) { + if (cnt == index) { + createFilename(filename, p); + return; // 0 based index + } + cnt++; + } + } +} + +// +// Get file/folder info for an item by name +// +void CardReader::selectByName(SdFile dir, const char * const match) { + dir_t p; + for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0; cnt++) { + if (is_dir_or_gcode(p)) { + createFilename(filename, p); + if (strcasecmp(match, filename) == 0) return; + } + } +} + +// +// Recursive method to list all files within a folder +// +void CardReader::printListing(SdFile parent, const char * const prepend/*=nullptr*/) { + dir_t p; + while (parent.readDir(&p, longFilename) > 0) { + if (DIR_IS_SUBDIR(&p)) { // Get the short name for the item, which we know is a folder char dosFilename[FILENAME_LENGTH]; @@ -189,69 +244,38 @@ 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 (lsAction == LS_SerialPrint) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHOLN(dosFilename); - } + SdFile child; + if (!child.open(&parent, dosFilename, O_READ)) { + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR(MSG_SD_CANT_OPEN_SUBDIR, dosFilename); } - lsDive(path, dir); + printListing(child, path); // close() is done automatically by destructor of SdFile } - else { - uint8_t pn0 = p.name[0]; - if (pn0 == DIR_NAME_FREE) break; - if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; - if (longFilename[0] == '.') continue; - - if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; - - flag.filenameIsDir = DIR_IS_SUBDIR(&p); - - if (!flag.filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; - - switch (lsAction) { // 1 based file count - case LS_Count: - nrFiles++; - break; - - case LS_SerialPrint: - createFilename(filename, p); - if (prepend) SERIAL_ECHO(prepend); - SERIAL_ECHO(filename); - SERIAL_CHAR(' '); - SERIAL_ECHOLN(p.fileSize); - break; - - case LS_GetFilename: - createFilename(filename, p); - if (match != nullptr) { - if (strcasecmp(match, filename) == 0) return; - } - else if (cnt == nrFile_index) return; // 0 based index - cnt++; - break; - } - + else if (is_dir_or_gcode(p)) { + createFilename(filename, p); + if (prepend) SERIAL_ECHO(prepend); + SERIAL_ECHO(filename); + SERIAL_CHAR(' '); + SERIAL_ECHOLN(p.fileSize); } - } // while readDir + } } +// +// List all files on the SD card +// void CardReader::ls() { - lsAction = LS_SerialPrint; root.rewind(); - lsDive(nullptr, root); + printListing(root); } #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - /** - * Get a long pretty path based on a DOS 8.3 path - */ - void CardReader::printLongPath(char *path) { - lsAction = LS_GetFilename; + // + // Get a long pretty path based on a DOS 8.3 path + // + void CardReader::printLongPath(char * const path) { int i, pathLen = strlen(path); @@ -277,7 +301,7 @@ void CardReader::ls() { // Find the item, setting the long filename diveDir.rewind(); - lsDive(nullptr, diveDir, segment); + selectByName(diveDir, segment); // Print /LongNamePart to serial output SERIAL_CHAR('/'); @@ -293,8 +317,7 @@ void CardReader::ls() { if (!dir.open(&diveDir, segment, O_READ)) { SERIAL_EOL(); SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHO(segment); + SERIAL_ECHOPAIR(MSG_SD_CANT_OPEN_SUBDIR, segment); break; } @@ -308,16 +331,16 @@ void CardReader::ls() { #endif // LONG_FILENAME_HOST_SUPPORT -/** - * Echo the DOS 8.3 filename (and long filename, if any) - */ +// +// Echo the DOS 8.3 filename (and long filename, if any) +// void CardReader::printFilename() { if (file.isOpen()) { char dosFilename[FILENAME_LENGTH]; - file.getFilename(dosFilename); + file.getDosName(dosFilename); SERIAL_ECHO(dosFilename); #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - getfilename(0, dosFilename); + selectFileByName(dosFilename); if (longFilename[0]) { SERIAL_ECHO(' '); SERIAL_ECHO(longFilename); @@ -330,53 +353,47 @@ void CardReader::printFilename() { SERIAL_EOL(); } -void CardReader::initsd() { - flag.detected = false; +void CardReader::mount() { + flag.mounted = false; if (root.isOpen()) root.close(); - #ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED - #endif - if (!sd2card.init(SPI_SPEED, SDSS) #if defined(LCD_SDSS) && (LCD_SDSS != SDSS) && !sd2card.init(SPI_SPEED, LCD_SDSS) #endif - ) { - //if (!sd2card.init(SPI_HALF_SPEED,SDSS)) - SERIAL_ECHO_MSG(MSG_SD_INIT_FAIL); - } + ) SERIAL_ECHO_MSG(MSG_SD_INIT_FAIL); else if (!volume.init(&sd2card)) SERIAL_ERROR_MSG(MSG_SD_VOL_INIT_FAIL); else if (!root.openRoot(&volume)) SERIAL_ERROR_MSG(MSG_SD_OPENROOT_FAIL); else { - flag.detected = true; + flag.mounted = true; SERIAL_ECHO_MSG(MSG_SD_CARD_OK); - #if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION) - (void)settings.load(); + #if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) + settings.first_load(); #endif } - setroot(); + cdroot(); ui.refresh(); } void CardReader::release() { stopSDPrint(); - flag.detected = false; + flag.mounted = false; } 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); + extern const char M23_STR[]; + sprintf_P(cmd, M23_STR, name); for (char *c = &cmd[4]; *c; c++) *c = tolower(*c); queue.enqueue_one_now(cmd); - queue.enqueue_now_P(PSTR("M24")); + queue.enqueue_now_P(M24_STR); } void CardReader::startFileprint() { - if (isDetected()) { + if (isMounted()) { flag.sdprinting = true; #if SD_RESORT flush_presort(); @@ -401,36 +418,68 @@ void CardReader::stopSDPrint( void CardReader::openLogFile(char * const path) { flag.logging = true; - openFile(path, false); + openFileWrite(path); } -void appendAtom(SdFile &file, char *& dst, uint8_t &cnt) { - file.getFilename(dst); - while (*dst && cnt < MAXPATHNAMELENGTH) { dst++; cnt++; } - if (cnt < MAXPATHNAMELENGTH) { *dst = '/'; dst++; cnt++; } -} - -void CardReader::getAbsFilename(char *t) { - *t++ = '/'; // Root folder +// +// Get the root-relative DOS path of the selected file +// +void CardReader::getAbsFilename(char *dst) { + *dst++ = '/'; uint8_t cnt = 1; - for (uint8_t i = 0; i < workDirDepth; i++) // Loop to current work dir - appendAtom(workDirParents[i], t, cnt); + auto appendAtom = [&](SdFile &file) { + file.getDosName(dst); + while (*dst && cnt < MAXPATHNAMELENGTH) { dst++; cnt++; } + if (cnt < MAXPATHNAMELENGTH) { *dst = '/'; dst++; cnt++; } + }; + + for (uint8_t i = 0; i < workDirDepth; i++) // Loop down to current work dir + appendAtom(workDirParents[i]); if (cnt < MAXPATHNAMELENGTH - (FILENAME_LENGTH) - 1) { // Leave room for filename and nul - appendAtom(file, t, cnt); - --t; + appendAtom(file); + --dst; } - *t = '\0'; + *dst = '\0'; } -void CardReader::openFile(char * const path, const bool read, const bool subcall/*=false*/) { +void openFailed(const char * const fname) { + SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, fname, "."); +} - if (!isDetected()) return; +void announceOpen(const uint8_t doing, const char * const path) { + if (doing) { + SERIAL_ECHO_START(); + SERIAL_ECHOPGM("Now "); + serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh")); + SERIAL_ECHOLNPAIR(" file: ", path); + } +} - uint8_t doing = 0; - if (isFileOpen()) { // Replacing current file or doing a subroutine - if (subcall) { +// +// Open a file by DOS path for read +// The 'subcall_type' flag indicates... +// - 0 : Standard open from host or user interface. +// - 1 : (file open) Opening a new sub-procedure. +// - 1 : (no file open) Opening a macro (M98). +// - 2 : Resuming from a sub-procedure +// +void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0*/) { + if (!isMounted()) return; + + switch (subcall_type) { + case 0: // Starting a new print. "Now fresh file: ..." + announceOpen(2, path); + file_subcall_ctr = 0; + break; + + case 1: // Starting a sub-procedure + + // With no file is open it's a simple macro. "Now doing file: ..." + if (!isFileOpen()) { announceOpen(1, path); break; } + + // Too deep? The firmware has to bail. if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { SERIAL_ERROR_MSG("trying to call sub-gcode files with too many levels. MAX level is:" STRINGIFY(SD_PROCEDURE_DEPTH)); kill(); @@ -441,25 +490,15 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall getAbsFilename(proc_filenames[file_subcall_ctr]); filespos[file_subcall_ctr] = sdpos; + // For sub-procedures say 'SUBROUTINE CALL target: "..." parent: "..." pos12345' SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("SUBROUTINE CALL target:\"", path, "\" parent:\"", proc_filenames[file_subcall_ctr], "\" pos", sdpos); file_subcall_ctr++; - } - else - doing = 1; - } - else if (subcall) // Returning from a subcall? - SERIAL_ECHO_MSG("END SUBROUTINE"); - else { // Opening fresh file - doing = 2; - file_subcall_ctr = 0; // Reset procedure depth in case user cancels print while in procedure - } + break; - if (doing) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Now "); - serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh")); - SERIAL_ECHOLNPAIR(" file: ", path); + case 2: // Resuming previous file after sub-procedure + SERIAL_ECHO_MSG("END SUBROUTINE"); + break; } stopSDPrint(); @@ -468,39 +507,52 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall const char * const fname = diveToFile(curDir, path); if (!fname) return; - if (read) { - if (file.open(curDir, fname, O_READ)) { - filesize = file.fileSize(); - sdpos = 0; - SERIAL_ECHOLNPAIR(MSG_SD_FILE_OPENED, fname, MSG_SD_SIZE, filesize); - SERIAL_ECHOLNPGM(MSG_SD_FILE_SELECTED); - - getfilename(0, fname); - ui.set_status(longFilename[0] ? longFilename : fname); - //if (longFilename[0]) { - // SERIAL_ECHOPAIR(MSG_SD_FILE_LONG_NAME, longFilename); - //} - } - else - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, fname, "."); + if (file.open(curDir, fname, O_READ)) { + filesize = file.fileSize(); + sdpos = 0; + SERIAL_ECHOLNPAIR(MSG_SD_FILE_OPENED, fname, MSG_SD_SIZE, filesize); + SERIAL_ECHOLNPGM(MSG_SD_FILE_SELECTED); + + selectFileByName(fname); + ui.set_status(longFilename[0] ? longFilename : fname); } - else { //write - if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, fname, "."); - else { - flag.saving = true; - getfilename(0, fname); - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.disable(); - #endif - SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, fname); - ui.set_status(fname); - } + else + openFailed(fname); +} + +// +// Open a file by DOS path for write +// +void CardReader::openFileWrite(char * const path) { + if (!isMounted()) return; + + announceOpen(2, path); + file_subcall_ctr = 0; + + stopSDPrint(); + + SdFile *curDir; + const char * const fname = diveToFile(curDir, path); + if (!fname) return; + + if (file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { + flag.saving = true; + selectFileByName(fname); + #if ENABLED(EMERGENCY_PARSER) + emergency_parser.disable(); + #endif + SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, fname); + ui.set_status(fname); } + else + openFailed(fname); } +// +// Delete a file by name in the working directory +// void CardReader::removeFile(const char * const name) { - if (!isDetected()) return; + if (!isMounted()) return; //stopSDPrint(); @@ -530,7 +582,7 @@ void CardReader::report_status() { SERIAL_ECHOLNPGM(MSG_SD_NOT_PRINTING); } -void CardReader::write_command(char *buf) { +void CardReader::write_command(char * const buf) { char* begin = buf; char* npos = nullptr; char* end = buf + strlen(buf) - 1; @@ -559,14 +611,12 @@ void CardReader::checkautostart() { if (autostart_index < 0 || flag.sdprinting) return; - if (!isDetected()) initsd(); - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION) - SERIAL_ECHOLNPGM("Loading settings from SD"); - (void)settings.load(); + if (!isMounted()) mount(); + #if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) + else settings.first_load(); #endif - if (isDetected() + if (isMounted() #if ENABLED(POWER_LOSS_RECOVERY) && !recovery.valid() // Don't run auto#.g when a resume file exists #endif @@ -589,7 +639,7 @@ void CardReader::checkautostart() { void CardReader::beginautostart() { autostart_index = 0; - setroot(); + cdroot(); } void CardReader::closefile(const bool store_location) { @@ -607,38 +657,42 @@ 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/*=nullptr*/) { +// +// Get info for a file in the working directory by index +// +void CardReader::selectFileByIndex(const uint16_t nr) { #if ENABLED(SDSORT_CACHE_NAMES) - if (match != nullptr) { - while (nr < sort_count) { - if (strcasecmp(match, sortshort[nr]) == 0) break; - nr++; - } - } if (nr < sort_count) { strcpy(filename, sortshort[nr]); strcpy(longFilename, sortnames[nr]); - flag.filenameIsDir = TEST(isDir[nr>>3], nr & 0x07); + flag.filenameIsDir = IS_DIR(nr); return; } - #endif // SDSORT_CACHE_NAMES - lsAction = LS_GetFilename; - nrFile_index = nr; + #endif workDir.rewind(); - lsDive(nullptr, workDir, match); + selectByIndex(workDir, nr); } -uint16_t CardReader::getnrfilenames() { - lsAction = LS_Count; - nrFiles = 0; +// +// Get info for a file in the working directory by DOS name +// +void CardReader::selectFileByName(const char * const match) { + #if ENABLED(SDSORT_CACHE_NAMES) + for (int nr = 0; nr < sort_count; nr++) + if (strcasecmp(match, sortshort[nr]) == 0) { + strcpy(filename, sortshort[nr]); + strcpy(longFilename, sortnames[nr]); + flag.filenameIsDir = IS_DIR(nr); + return; + } + #endif workDir.rewind(); - lsDive(nullptr, workDir); - //SERIAL_ECHOLN(nrFiles); - return nrFiles; + selectByName(workDir, match); +} + +uint16_t CardReader::countFilesInWorkDir() { + workDir.rewind(); + return countItems(workDir); } /** @@ -655,11 +709,11 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con static SdFile newDir1, newDir2; SdFile *sub = &newDir1, *startDir; - const char *dirname_start = path; + const char *item_name_adr = path; if (path[0] == '/') { curDir = &root; workDirDepth = 0; - dirname_start++; + item_name_adr++; } else curDir = &workDir; @@ -667,15 +721,15 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con startDir = curDir; // Start dive - while (dirname_start) { + while (item_name_adr) { // Find next sub - char * const dirname_end = strchr(dirname_start, '/'); - if (dirname_end <= dirname_start) break; + char * const name_end = strchr(item_name_adr, '/'); + if (name_end <= item_name_adr) break; // Set subDirName - const uint8_t len = dirname_end - dirname_start; + const uint8_t len = name_end - item_name_adr; char dosSubdirname[len + 1]; - strncpy(dosSubdirname, dirname_start, len); + strncpy(dosSubdirname, item_name_adr, len); dosSubdirname[len] = 0; if (echo) SERIAL_ECHOLN(dosSubdirname); @@ -698,18 +752,19 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con // Point sub pointer to unused newDir sub = (curDir != &newDir1) ? &newDir1 : &newDir2; - // dirname_start point to next sub - dirname_start = dirname_end + 1; + // item_name_adr point to next sub + item_name_adr = name_end + 1; } - return dirname_start; + return item_name_adr; } -void CardReader::chdir(const char * relpath) { +void CardReader::cd(const char * relpath) { SdFile newDir; SdFile *parent = workDir.isOpen() ? &workDir : &root; if (newDir.open(parent, relpath, O_READ)) { workDir = newDir; + flag.workDirIsRoot = false; if (workDirDepth < MAX_DIR_DEPTH) workDirParents[workDirDepth++] = workDir; #if ENABLED(SDCARD_SORT_ALPHA) @@ -722,21 +777,20 @@ void CardReader::chdir(const char * relpath) { } } -int8_t CardReader::updir() { +int8_t CardReader::cdup() { if (workDirDepth > 0) { // At least 1 dir has been saved workDir = --workDirDepth ? workDirParents[workDirDepth - 1] : root; // Use parent, or root if none #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif } + if (!workDirDepth) flag.workDirIsRoot = true; return workDirDepth; } -void CardReader::setroot() { - /*if (!workDir.openRoot(&volume)) { - SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); - }*/ +void CardReader::cdroot() { workDir = root; + flag.workDirIsRoot = true; #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif @@ -745,10 +799,10 @@ void CardReader::setroot() { #if ENABLED(SDCARD_SORT_ALPHA) /** - * Get the name of a file in the current directory by sort-index + * Get the name of a file in the working directory by sort-index */ void CardReader::getfilename_sorted(const uint16_t nr) { - getfilename( + selectFileByIndex( #if ENABLED(SDSORT_GCODE) sort_alpha && #endif @@ -762,7 +816,7 @@ void CardReader::setroot() { #define SET_SORTNAME(I) (sortnames[I] = strdup(longest_filename())) #if ENABLED(SDSORT_CACHE_NAMES) // When caching also store the short name, since - // we're replacing the getfilename() behavior. + // we're replacing the selectFileByIndex() behavior. #define SET_SORTSHORT(I) (sortshort[I] = strdup(filename)) #else #define SET_SORTSHORT(I) NOOP @@ -804,7 +858,7 @@ void CardReader::setroot() { #endif // If there are files, sort up to the limit - uint16_t fileCnt = getnrfilenames(); + uint16_t fileCnt = countFilesInWorkDir(); if (fileCnt > 0) { // Never sort more than the max allowed @@ -859,7 +913,7 @@ void CardReader::setroot() { i); // If using RAM then read all filenames now. #if ENABLED(SDSORT_USES_RAM) - getfilename(i); + selectFileByIndex(i); SET_SORTNAME(i); SET_SORTSHORT(i); // char out[30]; @@ -876,8 +930,17 @@ void CardReader::setroot() { // Bubble Sort for (uint16_t i = fileCnt; --i;) { bool didSwap = false; + uint8_t o1 = sort_order[0]; + #if DISABLED(SDSORT_USES_RAM) + selectFileByIndex(o1); // Pre-fetch the first entry and save it + strcpy(name1, longest_filename()); // so the loop only needs one fetch + #if HAS_FOLDER_SORTING + bool dir1 = flag.filenameIsDir; + #endif + #endif + for (uint16_t j = 0; j < i; ++j) { - const uint16_t o1 = sort_order[j], o2 = sort_order[j + 1]; + const uint16_t o2 = sort_order[j + 1]; // Compare names from the array or just the two buffered names #if ENABLED(SDSORT_USES_RAM) @@ -889,12 +952,7 @@ void CardReader::setroot() { #if HAS_FOLDER_SORTING #if ENABLED(SDSORT_USES_RAM) // Folder sorting needs an index and bit to test for folder-ness. - const uint8_t ind1 = o1 >> 3, bit1 = o1 & 0x07, - ind2 = o2 >> 3, bit2 = o2 & 0x07; - #define _SORT_CMP_DIR(fs) \ - (((isDir[ind1] & _BV(bit1)) != 0) == ((isDir[ind2] & _BV(bit2)) != 0) \ - ? _SORT_CMP_NODIR() \ - : (isDir[fs > 0 ? ind1 : ind2] & (fs > 0 ? _BV(bit1) : _BV(bit2))) != 0) + #define _SORT_CMP_DIR(fs) IS_DIR(o1) == IS_DIR(o2) ? _SORT_CMP_NODIR() : IS_DIR(fs > 0 ? o1 : o2) #else #define _SORT_CMP_DIR(fs) ((dir1 == flag.filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1)) #endif @@ -903,13 +961,9 @@ void CardReader::setroot() { // The most economical method reads names as-needed // 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) - #if HAS_FOLDER_SORTING - bool dir1 = flag.filenameIsDir; - #endif - getfilename(o2); - char *name2 = longest_filename(); // use the string in-place + selectFileByIndex(o2); + const bool dir2 = flag.filenameIsDir; + char * const name2 = longest_filename(); // use the string in-place #endif // !SDSORT_USES_RAM // Sort the current pair according to settings. @@ -924,10 +978,22 @@ void CardReader::setroot() { _SORT_CMP_NODIR() #endif ) { + // Reorder the index, indicate that sorting happened + // Note that the next o1 will be the current o1. No new fetch needed. sort_order[j] = o2; sort_order[j + 1] = o1; didSwap = true; } + else { + // The next o1 is the current o2. No new fetch needed. + o1 = o2; + #if DISABLED(SDSORT_USES_RAM) + #if HAS_FOLDER_SORTING + dir1 = dir2; + #endif + strcpy(name1, name2); + #endif + } } if (!didSwap) break; } @@ -949,10 +1015,10 @@ void CardReader::setroot() { sortshort = new char*[1]; isDir = new uint8_t[1]; #endif - getfilename(0); + selectFileByIndex(0); SET_SORTNAME(0); SET_SORTSHORT(0); - isDir[0] = flag.filenameIsDir ? 0x01 : 0x00; + isDir[0] = flag.filenameIsDir; #endif } @@ -984,17 +1050,20 @@ uint16_t CardReader::get_num_Files() { #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES nrFiles // no need to access the SD card for filenames #else - getnrfilenames() + countFilesInWorkDir() #endif ; } +// +// Return from procedure or close out the Print Job +// void CardReader::printingHasFinished() { planner.synchronize(); file.close(); - if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure. + if (file_subcall_ctr > 0) { // Resume calling file after closing procedure file_subcall_ctr--; - openFile(proc_filenames[file_subcall_ctr], true, true); + openFileRead(proc_filenames[file_subcall_ctr], 2); // 2 = Returning from sub-procedure setIndex(filespos[file_subcall_ctr]); startFileprint(); } @@ -1010,18 +1079,16 @@ void CardReader::printingHasFinished() { #endif print_job_timer.stop(); - if (print_job_timer.duration() > 60) queue.inject_P(PSTR("M31")); + queue.enqueue_now_P(print_job_timer.duration() > 60 ? PSTR("M31") : PSTR("M117")); #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - ui.progress_bar_percent = 0; + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) + ui.set_progress_done(); #endif - ui.reset_status(); - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) ui.reselect_last_file(); #endif @@ -1047,21 +1114,19 @@ void CardReader::printingHasFinished() { #if ENABLED(POWER_LOSS_RECOVERY) - constexpr char job_recovery_file_name[5] = "/PLR"; - bool CardReader::jobRecoverFileExists() { - const bool exists = recovery.file.open(&root, job_recovery_file_name, O_READ); + const bool exists = recovery.file.open(&root, recovery.filename, O_READ); if (exists) recovery.file.close(); return exists; } void CardReader::openJobRecoveryFile(const bool read) { - if (!isDetected()) return; + if (!isMounted()) return; if (recovery.file.isOpen()) return; - if (!recovery.file.open(&root, job_recovery_file_name, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, job_recovery_file_name, "."); + if (!recovery.file.open(&root, recovery.filename, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) + SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, recovery.filename, "."); else if (!read) - SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name); + SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, recovery.filename); } // Removing the job recovery file currently requires closing @@ -1070,7 +1135,7 @@ void CardReader::printingHasFinished() { void CardReader::removeJobRecoveryFile() { if (jobRecoverFileExists()) { recovery.init(); - removeFile(job_recovery_file_name); + removeFile(recovery.filename); #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) SERIAL_ECHOPGM("Power-loss file delete"); serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n")); diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 8eedfc384e0e..f7081b95b3da 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -33,14 +33,13 @@ #include "SdFile.h" -enum LsAction : uint8_t { LS_SerialPrint, LS_Count, LS_GetFilename }; - typedef struct { bool saving:1, logging:1, sdprinting:1, - detected:1, + mounted:1, filenameIsDir:1, + workDirIsRoot:1, abort_sd_printing:1 #if ENABLED(BINARY_FILE_TRANSFER) , binary_mode:1 @@ -50,48 +49,84 @@ typedef struct { class CardReader { public: + static card_flags_t flag; // Flags (above) + static char filename[FILENAME_LENGTH], // DOS 8.3 filename of the selected item + longFilename[LONG_FILENAME_LENGTH]; // Long name of the selected item + + // Fast! binary file transfer + #if ENABLED(BINARY_FILE_TRANSFER) + #if NUM_SERIAL > 1 + static int8_t transfer_port_index; + #else + static constexpr int8_t transfer_port_index = 0; + #endif + #endif + + // // // Methods // // // + CardReader(); - static void initsd(); - static void write_command(char *buf); + static SdFile getroot() { return root; } + + static void mount(); + static void release(); + static inline bool isMounted() { return flag.mounted; } + static void ls(); + + // SD Card Logging + static void openLogFile(char * const path); + static void write_command(char * const buf); + // Auto-Start files + static int8_t autostart_index; // Index of autoX.g files static void beginautostart(); static void checkautostart(); - static void openFile(char * const path, const bool read, const bool subcall=false); - static void openLogFile(char * const path); - static void removeFile(const char * const name); + // Basic file ops + static void openFileRead(char * const path, const uint8_t subcall=0); + static void openFileWrite(char * const path); static void closefile(const bool store_location=false); - static void release(); - static void openAndPrintFile(const char *name); + static void removeFile(const char * const name); + + static inline char* longest_filename() { return longFilename[0] ? longFilename : filename; } + #if ENABLED(LONG_FILENAME_HOST_SUPPORT) + static void printLongPath(char * const path); // Used by M33 + #endif + + // Working Directory for SD card menu + static void cdroot(); + static void cd(const char *relpath); + static int8_t cdup(); + static uint16_t countFilesInWorkDir(); + static uint16_t get_num_Files(); + + // Select a file + static void selectFileByIndex(const uint16_t nr); + static void selectFileByName(const char* const match); + + // Print job + static void openAndPrintFile(const char *name); // (working directory) + static void printingHasFinished(); + static void getAbsFilename(char *dst); static void startFileprint(); + static void printFilename(); static void stopSDPrint( #if SD_RESORT const bool re_sort=false #endif ); static void report_status(); - static void printingHasFinished(); - static void printFilename(); - - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - static void printLongPath(char *path); + static inline void pauseSDPrint() { flag.sdprinting = false; } + static inline bool isPaused() { return isFileOpen() && !flag.sdprinting; } + static inline bool isPrinting() { return flag.sdprinting; } + #if HAS_PRINT_PROGRESS_PERMYRIAD + static inline uint16_t permyriadDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 9999) / 10000) : 0; } #endif + static inline uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } - static void getfilename(uint16_t nr, const char* const match=nullptr); - static uint16_t getnrfilenames(); - - static void getAbsFilename(char *t); - - static void ls(); - static void chdir(const char *relpath); - static int8_t updir(); - static void setroot(); - + // Helper for open and remove static const char* diveToFile(SdFile*& curDir, const char * const path, const bool echo=false); - static uint16_t get_num_Files(); - #if ENABLED(SDCARD_SORT_ALPHA) static void presort(); static void getfilename_sorted(const uint16_t nr); @@ -101,7 +136,7 @@ class CardReader { //FORCE_INLINE static void setSortReverse(bool b) { sort_reverse = b; } #endif #else - FORCE_INLINE static void getfilename_sorted(const uint16_t nr) { getfilename(nr); } + FORCE_INLINE static void getfilename_sorted(const uint16_t nr) { selectFileByIndex(nr); } #endif #if ENABLED(POWER_LOSS_RECOVERY) @@ -110,24 +145,19 @@ class CardReader { static void removeJobRecoveryFile(); #endif - static inline void pauseSDPrint() { flag.sdprinting = false; } - static inline bool isDetected() { return flag.detected; } - static inline bool isFileOpen() { return isDetected() && file.isOpen(); } - static inline bool isPaused() { return isFileOpen() && !flag.sdprinting; } - static inline bool isPrinting() { return flag.sdprinting; } + static inline bool isFileOpen() { return isMounted() && file.isOpen(); } + static inline uint32_t getIndex() { return sdpos; } static inline bool eof() { return sdpos >= filesize; } - static inline int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } static inline void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } - static inline uint32_t getIndex() { return sdpos; } - static inline uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } - static inline char* getWorkDirName() { workDir.getFilename(filename); return filename; } + static inline char* getWorkDirName() { workDir.getDosName(filename); return filename; } + static inline int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } static inline int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } static inline int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } static Sd2Card& getSd2Card() { return sd2card; } #if ENABLED(AUTO_REPORT_SD_STATUS) - static void auto_report_sd_status(void); + static void auto_report_sd_status(); static inline void set_auto_report_interval(uint8_t v) { #if NUM_SERIAL > 1 auto_report_port = serial_port_index; @@ -138,27 +168,16 @@ class CardReader { } #endif - static inline char* longest_filename() { return longFilename[0] ? longFilename : filename; } - -public: - static card_flags_t flag; - static char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; - static int8_t autostart_index; - static SdFile getroot() { return root; } - - #if ENABLED(BINARY_FILE_TRANSFER) - #if NUM_SERIAL > 1 - static int8_t transfer_port_index; - #else - static constexpr int8_t transfer_port_index = 0; - #endif - #endif - private: + // + // Working directory and parents + // static SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; static uint8_t workDirDepth; - // Sort files and folders alphabetically. + // + // Alphabetical file and folder sorting + // #if ENABLED(SDCARD_SORT_ALPHA) static uint16_t sort_count; // Count of sorted items in the current directory #if ENABLED(SDSORT_GCODE) @@ -187,6 +206,7 @@ class CardReader { // If using dynamic ram for names, allocate on the heap. #if ENABLED(SDSORT_CACHE_NAMES) + static uint16_t nrFiles; // Cache the total count #if ENABLED(SDSORT_DYNAMIC_RAM) static char **sortshort, **sortnames; #else @@ -215,25 +235,21 @@ class CardReader { static SdVolume volume; static SdFile file; + static uint32_t filesize, sdpos; + + // + // Procedure calls to other files + // #ifndef SD_PROCEDURE_DEPTH #define SD_PROCEDURE_DEPTH 1 #endif - static uint8_t file_subcall_ctr; static uint32_t filespos[SD_PROCEDURE_DEPTH]; static char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; - static uint32_t filesize, sdpos; - - static LsAction lsAction; //stored for recursion. - static 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. - static char *diveDirName; - static void lsDive(const char *prepend, SdFile parent, const char * const match=nullptr); - - #if ENABLED(SDCARD_SORT_ALPHA) - static void flush_presort(); - #endif - + // + // SD Auto Reporting + // #if ENABLED(AUTO_REPORT_SD_STATUS) static uint8_t auto_report_sd_interval; static millis_t next_sd_report_ms; @@ -241,6 +257,19 @@ class CardReader { static int8_t auto_report_port; #endif #endif + + // + // Directory items + // + static bool is_dir_or_gcode(const dir_t &p); + static int countItems(SdFile dir); + static void selectByIndex(SdFile dir, const uint8_t index); + static void selectByName(SdFile dir, const char * const match); + static void printListing(SdFile parent, const char * const prepend=nullptr); + + #if ENABLED(SDCARD_SORT_ALPHA) + static void flush_presort(); + #endif }; #if ENABLED(USB_FLASH_DRIVE_SUPPORT) @@ -257,6 +286,7 @@ class CardReader { #endif #define IS_SD_PRINTING() card.flag.sdprinting +#define IS_SD_PAUSED() card.isPaused() #define IS_SD_FILE_OPEN() card.isFileOpen() extern CardReader card; @@ -264,6 +294,9 @@ extern CardReader card; #else // !SDSUPPORT #define IS_SD_PRINTING() false +#define IS_SD_PAUSED() false #define IS_SD_FILE_OPEN() false +#define LONG_FILENAME_LENGTH 0 + #endif // !SDSUPPORT diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index 8de27cb319a8..12f02c19f04d 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 @@ -22,23 +22,117 @@ #include "../../inc/MarlinConfigPre.h" +/** + * Adjust USB_DEBUG to select debugging verbosity. + * 0 - no debug messages + * 1 - basic insertion/removal messages + * 2 - show USB state transitions + * 3 - perform block range checking + * 4 - print each block access + */ +#define USB_DEBUG 1 +#define USB_STARTUP_DELAY 0 + +// uncomment to get 'printf' console debugging. NOT FOR UNO! +//#define HOST_DEBUG(...) {char s[255]; sprintf(s,__VA_ARGS__); SERIAL_ECHOLNPAIR("UHS:",s);} +//#define BS_HOST_DEBUG(...) {char s[255]; sprintf(s,__VA_ARGS__); SERIAL_ECHOLNPAIR("UHS:",s);} +//#define MAX_HOST_DEBUG(...) {char s[255]; sprintf(s,__VA_ARGS__); SERIAL_ECHOLNPAIR("UHS:",s);} + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) +#include "../../Marlin.h" #include "../../core/serial.h" +#include "../../module/temperature.h" -#include "lib/Usb.h" -#include "lib/masstorage.h" +static_assert(USB_CS_PIN != -1, "USB_CS_PIN must be defined"); +static_assert(USB_INTR_PIN != -1, "USB_INTR_PIN must be defined"); + +#if ENABLED(USE_UHS3_USB) + #define NO_AUTO_SPEED + #define UHS_MAX3421E_SPD 8000000 >> SPI_SPEED + #define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 1 + #define UHS_HOST_MAX_INTERFACE_DRIVERS 2 + #define MASS_MAX_SUPPORTED_LUN 1 + #define USB_HOST_SERIAL MYSERIAL0 + + // Workaround for certain issues with UHS3 + #define SKIP_PAGE3F // Required for IOGEAR media adapter + #define USB_NO_TEST_UNIT_READY // Required for removable media adapter + #define USB_HOST_MANUAL_POLL // Optimization to shut off IRQ automatically + + // Workarounds for keeping Marlin's watchdog timer from barking... + void marlin_yield() { + thermalManager.manage_heater(); + } + #define SYSTEM_OR_SPECIAL_YIELD(...) marlin_yield(); + #define delay(x) safe_delay(x) + + #define LOAD_USB_HOST_SYSTEM + #define LOAD_USB_HOST_SHIELD + #define LOAD_UHS_BULK_STORAGE + + #define MARLIN_UHS_WRITE_SS(v) WRITE(USB_CS_PIN, v) + #define MARLIN_UHS_READ_IRQ() READ(USB_INTR_PIN) + + #include "lib-uhs3/UHS_host/UHS_host.h" + + MAX3421E_HOST usb(USB_CS_PIN, USB_INTR_PIN); + UHS_Bulk_Storage bulk(&usb); + + #define UHS_START (usb.Init() == 0) + #define UHS_STATE(state) UHS_USB_HOST_STATE_##state +#else + #include "lib-uhs2/Usb.h" + #include "lib-uhs2/masstorage.h" + + USB usb; + BulkOnly bulk(&usb); + + #define UHS_START usb.start() + #define UHS_STATE(state) USB_STATE_##state +#endif #include "Sd2Card_FlashDrive.h" -#if EITHER(ULTRA_LCD, EXTENSIBLE_UI) +#if HAS_DISPLAY #include "../../lcd/ultralcd.h" #endif -USB usb; -BulkOnly bulk(&usb); +static enum { + UNINITIALIZED, + DO_STARTUP, + WAIT_FOR_DEVICE, + WAIT_FOR_LUN, + MEDIA_READY, + MEDIA_ERROR +} state; + +#if USB_DEBUG >= 3 + uint32_t lun0_capacity; +#endif -Sd2Card::state_t Sd2Card::state; +bool Sd2Card::usbStartup() { + if (state <= DO_STARTUP) { + SERIAL_ECHOPGM("Starting USB host..."); + if (!UHS_START) { + SERIAL_ECHOLNPGM(" failed."); + #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + LCD_MESSAGEPGM(MSG_MEDIA_USB_FAILED); + #endif + return false; + } + + // SPI quick test - check revision register + switch (usb.regRd(rREVISION)) { + case 0x01: SERIAL_ECHOLNPGM("rev.01 started"); break; + case 0x12: SERIAL_ECHOLNPGM("rev.02 started"); break; + case 0x13: SERIAL_ECHOLNPGM("rev.03 started"); break; + default: SERIAL_ECHOLNPGM("started. rev unknown."); break; + } + state = WAIT_FOR_DEVICE; + } + return true; +} // The USB library needs to be called periodically to detect USB thumbdrive // insertion and removals. Call this idle() function periodically to allow @@ -46,75 +140,145 @@ Sd2Card::state_t Sd2Card::state; // of initializing the USB library for the first time. void Sd2Card::idle() { - static uint32_t next_retry; - - switch (state) { - case USB_HOST_DELAY_INIT: - next_retry = millis() + 2000; - state = USB_HOST_WAITING; - break; - case USB_HOST_WAITING: - if (ELAPSED(millis(), next_retry)) { - next_retry = millis() + 2000; - state = USB_HOST_UNINITIALIZED; - } - break; - case USB_HOST_UNINITIALIZED: - SERIAL_ECHOPGM("Starting USB host..."); - if (!usb.start()) { - SERIAL_ECHOPGM(" Failed. Retrying in 2s."); - #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - LCD_MESSAGEPGM("USB start failed"); - #endif - state = USB_HOST_DELAY_INIT; + usb.Task(); + + const uint8_t task_state = usb.getUsbTaskState(); + + #if USB_DEBUG >= 2 + if (state > DO_STARTUP) { + static uint8_t laststate = 232; + if (task_state != laststate) { + laststate = task_state; + #define UHS_USB_DEBUG(x) case UHS_STATE(x): SERIAL_ECHOLNPGM(#x); break + switch (task_state) { + UHS_USB_DEBUG(IDLE); + UHS_USB_DEBUG(RESET_DEVICE); + UHS_USB_DEBUG(RESET_NOT_COMPLETE); + UHS_USB_DEBUG(DEBOUNCE); + UHS_USB_DEBUG(DEBOUNCE_NOT_COMPLETE); + UHS_USB_DEBUG(WAIT_SOF); + UHS_USB_DEBUG(ERROR); + UHS_USB_DEBUG(CONFIGURING); + UHS_USB_DEBUG(CONFIGURING_DONE); + UHS_USB_DEBUG(RUNNING); + default: + SERIAL_ECHOLNPAIR("UHS_USB_HOST_STATE: ", task_state); + break; + } } - else - state = USB_HOST_INITIALIZED; - SERIAL_EOL(); - break; - case USB_HOST_INITIALIZED: - const uint8_t lastUsbTaskState = usb.getUsbTaskState(); - usb.Task(); - const uint8_t newUsbTaskState = usb.getUsbTaskState(); - - if (lastUsbTaskState == USB_STATE_RUNNING && newUsbTaskState != USB_STATE_RUNNING) { - // the user pulled the flash drive. Make sure the bulk storage driver releases the address - #ifdef USB_DEBUG - SERIAL_ECHOLNPGM("USB drive removed"); + } + #endif + + static millis_t next_state_ms = millis(); + + #define GOTO_STATE_AFTER_DELAY(STATE, DELAY) do{ state = STATE; next_state_ms = millis() + DELAY; }while(0) + + if (ELAPSED(millis(), next_state_ms)) { + GOTO_STATE_AFTER_DELAY(state, 250); // Default delay + + switch (state) { + + case UNINITIALIZED: + #ifndef MANUAL_USB_STARTUP + GOTO_STATE_AFTER_DELAY( DO_STARTUP, USB_STARTUP_DELAY ); #endif - //bulk.Release(); - } - if (lastUsbTaskState != USB_STATE_RUNNING && newUsbTaskState == USB_STATE_RUNNING) { - #ifdef USB_DEBUG - SERIAL_ECHOLNPGM("USB drive inserted"); + break; + + case DO_STARTUP: usbStartup(); break; + + case WAIT_FOR_DEVICE: + if (task_state == UHS_STATE(RUNNING)) { + #if USB_DEBUG >= 1 + SERIAL_ECHOLNPGM("USB device inserted"); + #endif + GOTO_STATE_AFTER_DELAY( WAIT_FOR_LUN, 250 ); + } + break; + + case WAIT_FOR_LUN: + /* USB device is inserted, but if it is an SD card, + * adapter it may not have an SD card in it yet. */ + if (bulk.LUNIsGood(0)) { + #if USB_DEBUG >= 1 + SERIAL_ECHOLNPGM("LUN is good"); + #endif + GOTO_STATE_AFTER_DELAY( MEDIA_READY, 100 ); + } + else { + #ifdef USB_HOST_MANUAL_POLL + // Make sure we catch disconnect events + usb.busprobe(); + usb.VBUS_changed(); + #endif + #if USB_DEBUG >= 1 + SERIAL_ECHOLNPGM("Waiting for media"); + #endif + #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + LCD_MESSAGEPGM(MSG_MEDIA_WAITING); + #endif + GOTO_STATE_AFTER_DELAY(state, 2000); + } + break; + + case MEDIA_READY: break; + case MEDIA_ERROR: break; + } + + if (state > WAIT_FOR_DEVICE && task_state != UHS_STATE(RUNNING)) { + // Handle device removal events + #if USB_DEBUG >= 1 + SERIAL_ECHOLNPGM("USB device removed"); + #endif + #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + if (state != MEDIA_READY) + LCD_MESSAGEPGM(MSG_MEDIA_USB_REMOVED); + #endif + GOTO_STATE_AFTER_DELAY( WAIT_FOR_DEVICE, 0 ); + } + + else if (state > WAIT_FOR_LUN && !bulk.LUNIsGood(0)) { + // Handle media removal events + #if USB_DEBUG >= 1 + SERIAL_ECHOLNPGM("Media removed"); + #endif + #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + LCD_MESSAGEPGM(MSG_MEDIA_REMOVED); + #endif + GOTO_STATE_AFTER_DELAY( WAIT_FOR_DEVICE, 0 ); + } + + else if (task_state == UHS_STATE(ERROR)) { + #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) + LCD_MESSAGEPGM(MSG_MEDIA_READ_ERROR); #endif - } - break; + GOTO_STATE_AFTER_DELAY( MEDIA_ERROR, 0 ); + } } } // Marlin calls this function to check whether an USB drive is inserted. // This is equivalent to polling the SD_DETECT when using SD cards. bool Sd2Card::isInserted() { - return usb.getUsbTaskState() == USB_STATE_RUNNING; + return state == MEDIA_READY; } -// Marlin calls this to initialize an SD card once it is inserted. -bool Sd2Card::init(const uint8_t sckRateID/*=0*/, const pin_t chipSelectPin/*=SD_CHIP_SELECT_PIN*/) { - if (!ready()) return false; +bool Sd2Card::ready() { + return state > DO_STARTUP; +} - if (!bulk.LUNIsGood(0)) { - SERIAL_ECHOLNPGM("LUN zero is not good"); - return false; - } +// Marlin calls this to initialize an SD card once it is inserted. +bool Sd2Card::init(const uint8_t, const pin_t) { + if (!isInserted()) return false; + #if USB_DEBUG >= 1 const uint32_t sectorSize = bulk.GetSectorSize(0); if (sectorSize != 512) { SERIAL_ECHOLNPAIR("Expecting sector size of 512. Got: ", sectorSize); return false; } + #endif - #ifdef USB_DEBUG + #if USB_DEBUG >= 3 lun0_capacity = bulk.GetCapacity(0); SERIAL_ECHOLNPAIR("LUN Capacity (in blocks): ", lun0_capacity); #endif @@ -123,8 +287,8 @@ bool Sd2Card::init(const uint8_t sckRateID/*=0*/, const pin_t chipSelectPin/*=SD // Returns the capacity of the card in blocks. uint32_t Sd2Card::cardSize() { - if (!ready()) return 0; - #ifndef USB_DEBUG + if (!isInserted()) return false; + #if USB_DEBUG < 3 const uint32_t #endif lun0_capacity = bulk.GetCapacity(0); @@ -132,13 +296,13 @@ uint32_t Sd2Card::cardSize() { } bool Sd2Card::readBlock(uint32_t block, uint8_t* dst) { - if (!ready()) return false; - #ifdef USB_DEBUG + if (!isInserted()) return false; + #if USB_DEBUG >= 3 if (block >= lun0_capacity) { SERIAL_ECHOLNPAIR("Attempt to read past end of LUN: ", block); return false; } - #if USB_DEBUG > 1 + #if USB_DEBUG >= 4 SERIAL_ECHOLNPAIR("Read block ", block); #endif #endif @@ -146,13 +310,13 @@ bool Sd2Card::readBlock(uint32_t block, uint8_t* dst) { } bool Sd2Card::writeBlock(uint32_t block, const uint8_t* src) { - if (!ready()) return false; - #ifdef USB_DEBUG + if (!isInserted()) return false; + #if USB_DEBUG >= 3 if (block >= lun0_capacity) { SERIAL_ECHOLNPAIR("Attempt to write past end of LUN: ", block); return false; } - #if USB_DEBUG > 1 + #if USB_DEBUG >= 4 SERIAL_ECHOLNPAIR("Write block ", block); #endif #endif diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h index 6325de15e676..a429bfd28f7f 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 @@ -26,12 +26,6 @@ * \brief Sd2Card class for V2 SD/SDHC cards */ -/* Uncomment USB_DEBUG to enable debugging. - * 1 - basic debugging and bounds checking - * 2 - print each block access - */ -//#define USB_DEBUG 1 - #include "../SdFatConfig.h" #include "../SdInfo.h" @@ -52,39 +46,29 @@ class Sd2Card { private: - - typedef enum : uint8_t { - USB_HOST_UNINITIALIZED, - USB_HOST_INITIALIZED, - USB_HOST_DELAY_INIT, - USB_HOST_WAITING - } state_t; - - static state_t state; - uint32_t pos; - #ifdef USB_DEBUG - uint32_t lun0_capacity; - #endif - static inline bool ready() { return state == USB_HOST_INITIALIZED; } + static void usbStateDebug(); public: + static bool usbStartup(); + bool init(const uint8_t sckRateID=0, const pin_t chipSelectPin=SD_CHIP_SELECT_PIN); static void idle(); - inline bool readStart(const uint32_t block) { pos = block; return ready(); } - inline bool readData(uint8_t* dst) { return readBlock(pos++, dst); } - inline bool readStop() const { return true; } + inline bool readStart(const uint32_t block) { pos = block; return ready(); } + inline bool readData(uint8_t* dst) { return readBlock(pos++, dst); } + inline bool readStop() const { return true; } - inline bool writeStart(const uint32_t block, const uint32_t eraseCount) { UNUSED(eraseCount); pos = block; return ready(); } - inline bool writeData(uint8_t* src) { return writeBlock(pos++, src); } - inline bool writeStop() const { return true; } + inline bool writeStart(const uint32_t block, const uint32_t) { pos = block; return ready(); } + inline bool writeData(uint8_t* src) { return writeBlock(pos++, src); } + inline bool writeStop() const { return true; } bool readBlock(uint32_t block, uint8_t* dst); bool writeBlock(uint32_t blockNumber, const uint8_t* src); uint32_t cardSize(); static bool isInserted(); + static bool ready(); }; diff --git a/Marlin/src/sd/usb_flashdrive/SOURCES.txt b/Marlin/src/sd/usb_flashdrive/lib-uhs2/README.txt similarity index 74% rename from Marlin/src/sd/usb_flashdrive/SOURCES.txt rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/README.txt index 66f170a203ac..5abcc8f2adfb 100644 --- a/Marlin/src/sd/usb_flashdrive/SOURCES.txt +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/README.txt @@ -1,15 +1,4 @@ -==== SUMMARY ==== - -Source Path: Repository: License: ------------- ----------- -------- -usb_flashdrive/lib github.com/felis/USB_Host_Shield_2.0 GPLv2 or later -usb_flashdrive/lib/masstorage.cpp [1] github.com/greiman/UsbFat MIT -usb_flashdrive/lib/settings.h [1] github.com/greiman/UsbFat MIT - -[1] Changes related to SKIP_WRITE_PROTECT and DELAY only - - ==== USB HOST SHIELD 2.0 LIBRARY ==== The lib/ folder contains a subset of the files from the USB Host Shield 2.0 @@ -26,6 +15,15 @@ files needed for Marlin as "GPLv2 or later", as documented in this thread. Small modifications have been made to the source. Please search for USB_FLASH_DRIVE_SUPPORT or look at the patch file to see what was changed. +==== LICENSE SUMMARY ==== + +Source Path: Repository: License: +------------ ----------- -------- +lib-uhs3/ github.com/felis/USB_Host_Shield_2.0 GPLv2 or later +lib-uhs3/lib/masstorage.cpp github.com/greiman/UsbFat [1] MIT +lib-uhs3/lib/settings.h github.com/greiman/UsbFat [1] MIT + +[1] Changes related to SKIP_WRITE_PROTECT and DELAY only ==== PERFORMANCE ENHANCEMENTS FOR USB DRIVES ==== diff --git a/Marlin/src/sd/usb_flashdrive/lib/Usb.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp similarity index 99% rename from Marlin/src/sd/usb_flashdrive/lib/Usb.cpp rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp index b0a6d2943d6c..9092633b844f 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/Usb.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp @@ -26,7 +26,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) +#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) #include "Usb.h" @@ -45,7 +45,7 @@ void USB::init() { bmHubPre = 0; } -uint8_t USB::getUsbTaskState(void) { +uint8_t USB::getUsbTaskState() { return usb_task_state; } @@ -424,7 +424,7 @@ uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) { } /* USB main task. Performs enumeration/cleanup */ -void USB::Task(void) { //USB state machine +void USB::Task() { //USB state machine uint8_t rcode; uint8_t tmpdata; static uint32_t delay = 0; diff --git a/Marlin/src/sd/usb_flashdrive/lib/Usb.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h similarity index 96% rename from Marlin/src/sd/usb_flashdrive/lib/Usb.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h index 5880f9de0015..195b26e940ca 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/Usb.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.h @@ -45,8 +45,7 @@ #include "address.h" //#include "avrpins.h" #include "usb_ch9.h" -//#include "usbhost.h" -#include "../usb_host.h" +#include "usbhost.h" #include "UsbCore.h" #include "parsetools.h" #include "confdescparser.h" diff --git a/Marlin/src/sd/usb_flashdrive/lib/UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h similarity index 99% rename from Marlin/src/sd/usb_flashdrive/lib/UsbCore.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h index 063de843f738..472fed59cf6e 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h @@ -216,7 +216,7 @@ class USB : public MAX3421E { uint8_t bmHubPre; public: - USB(void); + USB(); void SetHubPreMask() { bmHubPre |= bmHUBPRE; @@ -243,7 +243,7 @@ class USB : public MAX3421E { void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) { addrPool.ForEachUsbDevice(pfunc); }; - uint8_t getUsbTaskState(void); + uint8_t getUsbTaskState(); void setUsbTaskState(uint8_t state); EpInfo* getEpInfoEntry(uint8_t addr, uint8_t ep); @@ -265,7 +265,7 @@ class USB : public MAX3421E { uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data); uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit); - void Task(void); + void Task(); uint8_t DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed); uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed); diff --git a/Marlin/src/sd/usb_flashdrive/lib/address.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h similarity index 100% rename from Marlin/src/sd/usb_flashdrive/lib/address.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/address.h diff --git a/Marlin/src/sd/usb_flashdrive/lib/confdescparser.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h similarity index 99% rename from Marlin/src/sd/usb_flashdrive/lib/confdescparser.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h index 69f2a96457de..5d4ddaf175c9 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/confdescparser.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h @@ -69,7 +69,7 @@ class ConfigDescParser : public USBReadParser { public: - void SetOR(void) { UseOr = true; } + void SetOR() { UseOr = true; } ConfigDescParser(UsbConfigXtracter *xtractor); void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset); }; diff --git a/Marlin/src/sd/usb_flashdrive/lib/hexdump.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h similarity index 100% rename from Marlin/src/sd/usb_flashdrive/lib/hexdump.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/hexdump.h diff --git a/Marlin/src/sd/usb_flashdrive/lib/macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h similarity index 100% rename from Marlin/src/sd/usb_flashdrive/lib/macros.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h diff --git a/Marlin/src/sd/usb_flashdrive/lib/masstorage.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp similarity index 99% rename from Marlin/src/sd/usb_flashdrive/lib/masstorage.cpp rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp index 74a6187d56c7..a57245f78a70 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/masstorage.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp @@ -25,7 +25,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) +#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) #include "masstorage.h" @@ -762,7 +762,7 @@ uint8_t BulkOnly::Page3F(uint8_t lun) { buf[i] = 0x00; } WriteOk[lun] = true; - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && defined(SKIP_WRITE_PROTECT) + #ifdef SKIP_WRITE_PROTECT return 0; #endif uint8_t rc = ModeSense6(lun, 0, 0x3f, 0, 192, buf); diff --git a/Marlin/src/sd/usb_flashdrive/lib/masstorage.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h similarity index 100% rename from Marlin/src/sd/usb_flashdrive/lib/masstorage.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h diff --git a/Marlin/src/sd/usb_flashdrive/lib/max3421e.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h similarity index 98% rename from Marlin/src/sd/usb_flashdrive/lib/max3421e.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h index 35011f55f15d..39845fb730b2 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/max3421e.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/max3421e.h @@ -191,6 +191,15 @@ #define bmSNDTOG1 0x80 #define rHXFR 0xf0 //30<<3 + +#undef tokSETUP +#undef tokIN +#undef tokOUT +#undef tokINHS +#undef tokOUTHS +#undef tokISOIN +#undef tokISOOUT + /* Host transfer token values for writing the HXFR register (R30) */ /* OR this bit field with the endpoint number in bits 3:0 */ #define tokSETUP 0x10 // HS=0, ISO=0, OUTNIN=0, SETUP=1 diff --git a/Marlin/src/sd/usb_flashdrive/lib/message.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp similarity index 94% rename from Marlin/src/sd/usb_flashdrive/lib/message.cpp rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp index 3148afb5b983..78a9ba1fd71d 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/message.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp @@ -25,7 +25,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) +#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) #include "Usb.h" @@ -74,19 +74,19 @@ void E_Notify(double d, int lvl) { #ifdef DEBUG_USB_HOST - void NotifyFailGetDevDescr(void) { + void NotifyFailGetDevDescr() { Notify(PSTR("\r\ngetDevDescr "), 0x80); } - void NotifyFailSetDevTblEntry(void) { + void NotifyFailSetDevTblEntry() { Notify(PSTR("\r\nsetDevTblEn "), 0x80); } - void NotifyFailGetConfDescr(void) { + void NotifyFailGetConfDescr() { Notify(PSTR("\r\ngetConf "), 0x80); } - void NotifyFailSetConfDescr(void) { + void NotifyFailSetConfDescr() { Notify(PSTR("\r\nsetConf "), 0x80); } diff --git a/Marlin/src/sd/usb_flashdrive/lib/message.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h similarity index 94% rename from Marlin/src/sd/usb_flashdrive/lib/message.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h index 087a4bf501a6..960120d18d2c 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/message.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h @@ -43,10 +43,10 @@ void E_Notifyc(char c, int lvl); void NotifyFailSetDevTblEntry(uint8_t reason); void NotifyFailGetConfDescr(uint8_t reason); void NotifyFailSetConfDescr(uint8_t reason); - void NotifyFailGetDevDescr(void); - void NotifyFailSetDevTblEntry(void); - void NotifyFailGetConfDescr(void); - void NotifyFailSetConfDescr(void); + void NotifyFailGetDevDescr(); + void NotifyFailSetDevTblEntry(); + void NotifyFailGetConfDescr(); + void NotifyFailSetConfDescr(); void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID); void NotifyFail(uint8_t rcode); #else diff --git a/Marlin/src/sd/usb_flashdrive/lib/parsetools.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp similarity index 97% rename from Marlin/src/sd/usb_flashdrive/lib/parsetools.cpp rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp index c03ce55cb31e..0c7061b77c30 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/parsetools.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.cpp @@ -25,7 +25,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) +#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) #include "Usb.h" diff --git a/Marlin/src/sd/usb_flashdrive/lib/parsetools.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h similarity index 99% rename from Marlin/src/sd/usb_flashdrive/lib/parsetools.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h index 529bafbbc052..28a28414463e 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/parsetools.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/parsetools.h @@ -120,7 +120,7 @@ class PTPListParser { lenSize(0), valSize(0), pBuf(nullptr), - prsMode(modeArray) { } + prsMode(modeArray) {} ; void Initialize(const uint8_t len_size, const uint8_t val_size, MultiValueBuffer * const p, const uint8_t mode = modeArray) { diff --git a/Marlin/src/sd/usb_flashdrive/lib/printhex.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h similarity index 100% rename from Marlin/src/sd/usb_flashdrive/lib/printhex.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h diff --git a/Marlin/src/sd/usb_flashdrive/lib/settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h similarity index 99% rename from Marlin/src/sd/usb_flashdrive/lib/settings.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h index dc7782f2a2e4..41821173d36b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib/settings.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h @@ -153,7 +153,7 @@ // define XMEM_ACQUIRE_SPI and XMEM_RELEASE_SPI to point to your lock and unlock. // NOTE: NO argument is passed. You have to do this within your routine for // whatever you are using to lock and unlock. -#if !defined(XMEM_ACQUIRE_SPI) +#ifndef XMEM_ACQUIRE_SPI #if USE_XMEM_SPI_LOCK || defined(USE_MULTIPLE_APP_API) #include #else diff --git a/Marlin/src/sd/usb_flashdrive/lib/usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h similarity index 100% rename from Marlin/src/sd/usb_flashdrive/lib/usb_ch9.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h diff --git a/Marlin/src/sd/usb_flashdrive/usb_host.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp similarity index 97% rename from Marlin/src/sd/usb_flashdrive/usb_host.cpp rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index 41895e86d740..16051b34c345 100644 --- a/Marlin/src/sd/usb_flashdrive/usb_host.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -23,12 +23,12 @@ * lib/usbhost.c". This has been rewritten to use SPI routines from the * Marlin HAL */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) +#if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) -#include "lib/Usb.h" -#include "usb_host.h" +#include "Usb.h" +#include "usbhost.h" uint8_t MAX3421e::vbusState = 0; @@ -194,7 +194,7 @@ void MAX3421e::busprobe() { } // MAX3421 state change task and interrupt handler -uint8_t MAX3421e::Task(void) { +uint8_t MAX3421e::Task() { return READ(USB_INTR_PIN) ? 0 : IntHandler(); } diff --git a/Marlin/src/sd/usb_flashdrive/usb_host.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h similarity index 97% rename from Marlin/src/sd/usb_flashdrive/usb_host.h rename to Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h index f5e86515563b..8fdad47ac2ec 100644 --- a/Marlin/src/sd/usb_flashdrive/usb_host.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h @@ -44,7 +44,7 @@ class MAX3421e { uint8_t gpioRd(); bool reset(); - uint8_t getVbusState(void) {return vbusState;}; + uint8_t getVbusState() {return vbusState;}; void busprobe(); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt b/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt new file mode 100644 index 000000000000..710b3f20b584 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt @@ -0,0 +1,31 @@ +==== USB HOST SHIELD 3.0 LIBRARY ==== + +The lib-uhs3/ folder contains a subset of the files from the USB Host Shield +3.0 library: + + https://github.com/felis/UHS30 + + +==== LICENSE SUMMARY ==== + +Source Path: Repository: License: +------------ ----------- -------- +usb_flashdrive/lib github.com/felis/UHS30 GPLv2 or later + + +==== MARLIN INTEGRATION WORK ==== + +All additional work done to integrate USB into Marlin was performed by +AlephObjects, Inc. and is licensed under the GPLv3. + +This version of UHS3 has been modified for better compatibility with Marlin. +The upstream version of UHS 3.0 runs a frame timer interrupt every 1 ms to +handle device polling. This timer interrupt interferes with Marlin's stepper +IRQ, so the flag USB_HOST_MANUAL_POLL has been added to move the polling to +the idle task. Additional logic was added to disable and enable the frame +IRQ. + +SKIP_PAGE3F and USB_NO_TEST_UNIT_READY were added to work around bugs with +certain devices. + +-- marcio@alephobjects.com diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h new file mode 100644 index 000000000000..6ad9cb5c8dc3 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h @@ -0,0 +1,249 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and + Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#ifndef __UHS_BULK_STORAGE_H__ +#define __UHS_BULK_STORAGE_H__ + + +//////////////////////////////////////////////////////////////////////////////// +// Define any of these options at the top of your sketch to override +// the defaults contained herewith. Do NOT do modifications here. +// Macro | Settings and notes | Default +// -----------------------------------------+-----------------------+----------- +// | 1 to 8 | +// | Each LUN needs | +// MASS_MAX_SUPPORTED_LUN | ~13 bytes to be able | 8 +// | to track the state of | +// | each unit. | +// -----------------------------------------+-----------------------+----------- +// | Just define to use. | +// DEBUG_PRINTF_EXTRA_HUGE_UHS_BULK_STORAGE | works only if extra | +// | huge debug is on too. | +// -----------------------------------------^-----------------------^----------- + +#ifndef MASS_MAX_SUPPORTED_LUN +#define MASS_MAX_SUPPORTED_LUN 8 +#endif + +#include "UHS_SCSI.h" + +#define UHS_BULK_bmREQ_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE +#define UHS_BULK_bmREQ_IN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE + +// Request Codes +#define UHS_BULK_REQ_ADSC 0x00U +#define UHS_BULK_REQ_GET 0xFCU +#define UHS_BULK_REQ_PUT 0xFDU +#define UHS_BULK_REQ_GET_MAX_LUN 0xFEU +#define UHS_BULK_REQ_BOMSR 0xFFU // Mass Storage Reset + +#define UHS_BULK_CBW_SIGNATURE 0x43425355LU +#define UHS_BULK_CSW_SIGNATURE 0x53425355LU + +#define UHS_BULK_CMD_DIR_OUT 0x00U +#define UHS_BULK_CMD_DIR_IN 0x80U + +/* Bulk error codes */ +#define UHS_BULK_ERR_SUCCESS UHS_HOST_ERROR_NONE +#define UHS_BULK_ERR_PHASE_ERROR 0x22U +#define UHS_BULK_ERR_UNIT_NOT_READY 0x23U +#define UHS_BULK_ERR_UNIT_BUSY 0x24U +#define UHS_BULK_ERR_STALL 0x25U +#define UHS_BULK_ERR_CMD_NOT_SUPPORTED 0x26U +#define UHS_BULK_ERR_INVALID_CSW 0x27U +#define UHS_BULK_ERR_NO_MEDIA 0x28U +#define UHS_BULK_ERR_BAD_LBA 0x29U +#define UHS_BULK_ERR_MEDIA_CHANGED 0x2AU +#define UHS_BULK_ERR_DEVICE_DISCONNECTED UHS_HOST_ERROR_UNPLUGGED +#define UHS_BULK_ERR_UNABLE_TO_RECOVER 0x32U // Reset recovery error +#define UHS_BULK_ERR_INVALID_LUN 0x33U +#define UHS_BULK_ERR_WRITE_STALL 0x34U +#define UHS_BULK_ERR_READ_NAKS 0x35U +#define UHS_BULK_ERR_WRITE_NAKS 0x36U +#define UHS_BULK_ERR_WRITE_PROTECTED 0x37U +#define UHS_BULK_ERR_NOT_IMPLEMENTED 0xFDU +#define UHS_BULK_ERR_GENERAL_SCSI_ERROR 0xF0U +#define UHS_BULK_ERR_GENERAL_USB_ERROR 0xFFU +#define UHS_BULK_ERR_USER 0xA0U // For subclasses to define their own error codes + +#define MASS_MAX_ENDPOINTS 3 + +struct UHS_BULK_CommandBlockWrapperBase { + volatile uint32_t dCBWSignature; + volatile uint32_t dCBWTag; + volatile uint32_t dCBWDataTransferLength; + volatile uint8_t bmCBWFlags; +public: + + UHS_BULK_CommandBlockWrapperBase() { + } + + UHS_BULK_CommandBlockWrapperBase(uint32_t tag, uint32_t xflen, uint8_t flgs) : + dCBWSignature(UHS_BULK_CBW_SIGNATURE), dCBWTag(tag), dCBWDataTransferLength(xflen), bmCBWFlags(flgs) { + } +} __attribute__((packed)); + +struct UHS_BULK_CommandBlockWrapper : public UHS_BULK_CommandBlockWrapperBase { + + struct { + uint8_t bmCBWLUN : 4; + uint8_t bmReserved1 : 4; + }; + + struct { + uint8_t bmCBWCBLength : 4; + uint8_t bmReserved2 : 4; + }; + + uint8_t CBWCB[16]; + +public: + // All zeroed. + + UHS_BULK_CommandBlockWrapper() : + UHS_BULK_CommandBlockWrapperBase(0, 0, 0), bmReserved1(0), bmReserved2(0) { + for(int i = 0; i < 16; i++) CBWCB[i] = 0; + } + + // Generic Wrap, CDB zeroed. + + UHS_BULK_CommandBlockWrapper(uint32_t tag, uint32_t xflen, uint8_t flgs, uint8_t lu, uint8_t cmdlen, uint8_t cmd) : + UHS_BULK_CommandBlockWrapperBase(tag, xflen, flgs), + bmCBWLUN(lu), bmReserved1(0), bmCBWCBLength(cmdlen), bmReserved2(0) { + for(int i = 0; i < 16; i++) CBWCB[i] = 0; + SCSI_CDB_BASE_t *x = reinterpret_cast(CBWCB); + x->LUN = cmd; + } + + // Wrap for CDB of 6 + + UHS_BULK_CommandBlockWrapper(uint32_t tag, uint32_t xflen, SCSI_CDB6_t *cdb, uint8_t dir) : + UHS_BULK_CommandBlockWrapperBase(tag, xflen, dir), + bmCBWLUN(cdb->LUN), bmReserved1(0), bmCBWCBLength(6), bmReserved2(0) { + memcpy(&CBWCB, cdb, 6); + } + // Wrap for CDB of 10 + + UHS_BULK_CommandBlockWrapper(uint32_t tag, uint32_t xflen, SCSI_CDB10_t *cdb, uint8_t dir) : + UHS_BULK_CommandBlockWrapperBase(tag, xflen, dir), + bmCBWLUN(cdb->LUN), bmReserved1(0), bmCBWCBLength(10), bmReserved2(0) { + memcpy(&CBWCB, cdb, 10); + } +} __attribute__((packed)); + +struct UHS_BULK_CommandStatusWrapper { + uint32_t dCSWSignature; + uint32_t dCSWTag; + uint32_t dCSWDataResidue; + uint8_t bCSWStatus; +} __attribute__((packed)); + +class UHS_Bulk_Storage : public UHS_USBInterface { +protected: + static const uint8_t epDataInIndex = 1; // DataIn endpoint index + static const uint8_t epDataOutIndex = 2; // DataOUT endpoint index + static const uint8_t epInterruptInIndex = 3; // InterruptIN endpoint index + + uint8_t bMaxLUN; // Max LUN + volatile uint32_t dCBWTag; // Tag + volatile uint8_t bTheLUN; // Active LUN + volatile uint32_t CurrentCapacity[MASS_MAX_SUPPORTED_LUN]; // Total sectors + volatile uint16_t CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]; // Sector size, clipped to 16 bits + volatile bool LUNOk[MASS_MAX_SUPPORTED_LUN]; // use this to check for media changes. + volatile bool WriteOk[MASS_MAX_SUPPORTED_LUN]; + void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr); + +public: + UHS_Bulk_Storage(UHS_USB_HOST_BASE *p); + + volatile UHS_EpInfo epInfo[MASS_MAX_ENDPOINTS]; + + uint8_t GetbMaxLUN() { + return bMaxLUN; // Max LUN + } + + uint8_t GetbTheLUN() { + return bTheLUN; // Active LUN + } + + bool WriteProtected(uint8_t lun); + uint8_t MediaCTL(uint8_t lun, uint8_t ctl); + uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf); + uint8_t Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t *buf); + uint8_t LockMedia(uint8_t lun, uint8_t lock); + + bool LUNIsGood(uint8_t lun); + uint32_t GetCapacity(uint8_t lun); + uint16_t GetSectorSize(uint8_t lun); + uint8_t SCSITransaction6(SCSI_CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir); + uint8_t SCSITransaction10(SCSI_CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir); + + + // Configure and internal methods, these should never be called by a user's sketch. + uint8_t Start(); + bool OKtoEnumerate(ENUMERATION_INFO *ei); + uint8_t SetInterface(ENUMERATION_INFO *ei); + + uint8_t GetAddress() { + return bAddress; + }; + + + void Poll(); + + void DriverDefaults(); + + +private: + void Reset(); + void CheckMedia(); + + bool IsValidCBW(uint8_t size, uint8_t *pcbw); + bool IsMeaningfulCBW(uint8_t size, uint8_t *pcbw); + bool IsValidCSW(UHS_BULK_CommandStatusWrapper *pcsw, UHS_BULK_CommandBlockWrapperBase *pcbw); + + bool CheckLUN(uint8_t lun); + + uint8_t Inquiry(uint8_t lun, uint16_t size, uint8_t *buf); + uint8_t TestUnitReady(uint8_t lun); + uint8_t RequestSense(uint8_t lun, uint16_t size, uint8_t *buf); + uint8_t ModeSense6(uint8_t lun, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t len, uint8_t *buf); + uint8_t GetMaxLUN(uint8_t *max_lun); + uint8_t SetCurLUN(uint8_t lun); + uint8_t ResetRecovery(); + uint8_t ReadCapacity10(uint8_t lun, uint8_t *buf); + uint8_t Page3F(uint8_t lun); + uint8_t ClearEpHalt(uint8_t index); + uint8_t Transaction(UHS_BULK_CommandBlockWrapper *cbw, uint16_t bsize, void *buf); + uint8_t HandleUsbError(uint8_t error, uint8_t index); + uint8_t HandleSCSIError(uint8_t status); + +}; + +#if defined(LOAD_UHS_BULK_STORAGE) && !defined(UHS_BULK_STORAGE_LOADED) +#include "UHS_BULK_STORAGE_INLINE.h" +#endif +#endif // __MASSTORAGE_H__ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h new file mode 100644 index 000000000000..a171b13818ca --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h @@ -0,0 +1,1210 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#if defined(LOAD_UHS_BULK_STORAGE) && defined(__UHS_BULK_STORAGE_H__) && !defined(UHS_BULK_STORAGE_LOADED) +#define UHS_BULK_STORAGE_LOADED + +// uncomment to get 'printf' console debugging. NOT FOR UNO! +//#define DEBUG_PRINTF_EXTRA_HUGE_UHS_BULK_STORAGE + +#if DEBUG_PRINTF_EXTRA_HUGE +#ifdef DEBUG_PRINTF_EXTRA_HUGE_UHS_BULK_STORAGE +#define BS_HOST_DEBUG(...) printf(__VA_ARGS__) +#else +#define BS_HOST_DEBUG(...) VOID0 +#endif +#else +#define BS_HOST_DEBUG(...) VOID0 +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// Interface code + +//////////////////////////////////////////////////////////////////////////////// + +/** + * Get the capacity of the media + * + * @param lun Logical Unit Number + * @return media capacity + */ +uint32_t UHS_NI UHS_Bulk_Storage::GetCapacity(uint8_t lun) { + uint32_t v = 0LU; + pUsb->DisablePoll(); + if(LUNOk[lun]) + v = CurrentCapacity[lun]; + pUsb->EnablePoll(); + return v; +} + +/** + * Get the sector (block) size used on the media + * + * @param lun Logical Unit Number + * @return media sector size + */ +uint16_t UHS_NI UHS_Bulk_Storage::GetSectorSize(uint8_t lun) { + uint16_t v = 0U; + pUsb->DisablePoll(); + if(LUNOk[lun]) + v = CurrentSectorSize[lun]; + pUsb->EnablePoll(); + return v; +} + +/** + * Test if LUN is ready for use + * + * @param lun Logical Unit Number + * @return true if LUN is ready for use + */ +bool UHS_NI UHS_Bulk_Storage::LUNIsGood(uint8_t lun) { + bool v; + pUsb->DisablePoll(); + v = LUNOk[lun]; + pUsb->EnablePoll(); + return v; +} + +/** + * Test if LUN is write protected + * + * @param lun Logical Unit Number + * @return cached status of write protect switch + */ +bool UHS_NI UHS_Bulk_Storage::WriteProtected(uint8_t lun) { + bool v; + pUsb->DisablePoll(); + v = WriteOk[lun]; + pUsb->EnablePoll(); + return v; +} + +/** + * Wrap and execute a SCSI CDB with length of 6 + * + * @param cdb CDB to execute + * @param buf_size Size of expected transaction + * @param buf Buffer + * @param dir MASS_CMD_DIR_IN | MASS_CMD_DIR_OUT + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::SCSITransaction6(SCSI_CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + pUsb->DisablePoll(); + // promote buf_size to 32bits. + UHS_BULK_CommandBlockWrapper cbw = UHS_BULK_CommandBlockWrapper(++dCBWTag, (uint32_t)buf_size, cdb, dir); + +#if 0 + // Lets check the CBW here: + printf("\r\n"); + printf("\r\n"); + uint8_t *dump = (uint8_t*)(&cbw); + + for(int i=0; i<(sizeof (UHS_BULK_CommandBlockWrapper)); i++) { + printf("%02.2x ", *dump); + dump++; + } + printf("\r\n"); + printf("\r\n"); +#endif + + uint8_t v = (HandleSCSIError(Transaction(&cbw, buf_size, buf))); + pUsb->EnablePoll(); + return v; +} + +/** + * Wrap and execute a SCSI CDB with length of 10 + * + * @param cdb CDB to execute + * @param buf_size Size of expected transaction + * @param buf Buffer + * @param dir MASS_CMD_DIR_IN | MASS_CMD_DIR_OUT + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::SCSITransaction10(SCSI_CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + pUsb->DisablePoll(); + // promote buf_size to 32bits. + UHS_BULK_CommandBlockWrapper cbw = UHS_BULK_CommandBlockWrapper(++dCBWTag, (uint32_t)buf_size, cdb, dir); + //SetCurLUN(cdb->LUN); + uint8_t v = (HandleSCSIError(Transaction(&cbw, buf_size, buf))); + pUsb->EnablePoll(); + return v; +} + +/** + * Lock or Unlock the tray or door on device. + * Caution: Some devices with buggy firmware will lock up. + * + * @param lun Logical Unit Number + * @param lock 1 to lock, 0 to unlock + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::LockMedia(uint8_t lun, uint8_t lock) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + pUsb->DisablePoll(); + Notify(PSTR("\r\nLockMedia\r\n"), 0x80); + Notify(PSTR("---------\r\n"), 0x80); + + SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_PREVENT_REMOVAL, lun, (uint8_t)0, lock); + + uint8_t v = SCSITransaction6(&cdb, (uint16_t)0, NULL, (uint8_t)UHS_BULK_CMD_DIR_IN); + pUsb->EnablePoll(); + return v; +} + +/** + * Media control, for spindle motor and media tray or door. + * This includes CDROM, TAPE and anything with a media loader. + * + * @param lun Logical Unit Number + * @param ctl 0x00 Stop Motor, 0x01 Start Motor, 0x02 Eject Media, 0x03 Load Media + * @return 0 on success + */ +uint8_t UHS_NI UHS_Bulk_Storage::MediaCTL(uint8_t lun, uint8_t ctl) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + pUsb->DisablePoll(); + Notify(PSTR("\r\nMediaCTL\r\n"), 0x80); + Notify(PSTR("-----------------\r\n"), 0x80); + + uint8_t rcode = UHS_BULK_ERR_UNIT_NOT_READY; + if(bAddress) { + SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_START_STOP_UNIT, lun, ctl & 0x03, 0); + rcode = SCSITransaction6(&cdb, (uint16_t)0, NULL, (uint8_t)UHS_BULK_CMD_DIR_OUT); + } else { + SetCurLUN(lun); + } + pUsb->EnablePoll(); + return rcode; +} + +/** + * Read data from media + * + * @param lun Logical Unit Number + * @param addr LBA address on media to read + * @param bsize size of a block (we should probably use the cached size) + * @param blocks how many blocks to read + * @param buf memory that is able to hold the requested data + * @return 0 on success + */ +uint8_t UHS_NI UHS_Bulk_Storage::Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf) { + if(!bAddress) return UHS_BULK_ERR_NO_MEDIA; + uint8_t er = UHS_BULK_ERR_NO_MEDIA; + pUsb->DisablePoll(); + if(LUNOk[lun]) { + Notify(PSTR("\r\nRead LUN:\t"), 0x80); + D_PrintHex (lun, 0x90); + Notify(PSTR("\r\nLBA:\t\t"), 0x90); + D_PrintHex (addr, 0x90); + Notify(PSTR("\r\nblocks:\t\t"), 0x90); + D_PrintHex (blocks, 0x90); + Notify(PSTR("\r\nblock size:\t"), 0x90); + D_PrintHex (bsize, 0x90); + Notify(PSTR("\r\n---------\r\n"), 0x80); + SCSI_CDB10_t cdb = SCSI_CDB10_t(SCSI_CMD_READ_10, lun, blocks, addr); + +again: + er = SCSITransaction10(&cdb, ((uint16_t)bsize * blocks), buf, (uint8_t)UHS_BULK_CMD_DIR_IN); + + if(er == UHS_BULK_ERR_STALL) { + MediaCTL(lun, 1); + + if(UHS_SLEEP_MS(150)) { + if(!TestUnitReady(lun)) goto again; + } + } + } + qNextPollTime = millis() + 100; + pUsb->EnablePoll(); + + return er; +} + +/** + * Write data to media + * + * @param lun Logical Unit Number + * @param addr LBA address on media to write + * @param bsize size of a block (we should probably use the cached size) + * @param blocks how many blocks to write + * @param buf memory that contains the data to write + * @return 0 on success + */ +uint8_t UHS_NI UHS_Bulk_Storage::Write(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, const uint8_t * buf) { + if(!bAddress) return UHS_BULK_ERR_NO_MEDIA; + uint8_t er = UHS_BULK_ERR_NO_MEDIA; + pUsb->DisablePoll(); + if(LUNOk[lun]) { + if(!WriteOk[lun]) { + er = UHS_BULK_ERR_WRITE_PROTECTED; + } else { + Notify(PSTR("\r\nWrite LUN:\t"), 0x80); + D_PrintHex (lun, 0x90); + Notify(PSTR("\r\nLBA:\t\t"), 0x90); + D_PrintHex (addr, 0x90); + Notify(PSTR("\r\nblocks:\t\t"), 0x90); + D_PrintHex (blocks, 0x90); + Notify(PSTR("\r\nblock size:\t"), 0x90); + D_PrintHex (bsize, 0x90); + Notify(PSTR("\r\n---------\r\n"), 0x80); + SCSI_CDB10_t cdb = SCSI_CDB10_t(SCSI_CMD_WRITE_10, lun, blocks, addr); + +again: + er = SCSITransaction10(&cdb, ((uint16_t)bsize * blocks), (void*)buf, (uint8_t)UHS_BULK_CMD_DIR_OUT); + + if(er == UHS_BULK_ERR_WRITE_STALL) { + MediaCTL(lun, 1); + + if(UHS_SLEEP_MS(150)) { + if(!TestUnitReady(lun)) goto again; + } + } + } + } + qNextPollTime = millis() + 100; + pUsb->EnablePoll(); + + return er; +} + +// End of user functions, the remaining code below is driver internals. +// Only developer serviceable parts below! + +//////////////////////////////////////////////////////////////////////////////// + +// Main driver code + +//////////////////////////////////////////////////////////////////////////////// + +UHS_NI UHS_Bulk_Storage::UHS_Bulk_Storage(UHS_USB_HOST_BASE *p) { + pUsb = p; + dCBWTag = 0; + if(pUsb) { + + DriverDefaults(); + pUsb->RegisterDeviceClass(this); + // Serial.print("Bulk Register to USB Host @ 0x"); + // Serial.println((uint32_t)pUsb, HEX); + // Serial.print("Bulk Register to USB Host Address Pool @ 0x"); + // Serial.println((uint32_t)pUsb->GetAddressPool(), HEX); + } +} + +/** + * + * @param ei Enumeration information + * @return true if this interface driver can handle this interface description + */ +bool UHS_NI UHS_Bulk_Storage::OKtoEnumerate(ENUMERATION_INFO *ei) { + BS_HOST_DEBUG("BulkOnly: checking numep %i, klass %2.2x, subklass %2.2x\r\n", ei->interface.numep, ei->klass, ei->subklass); + BS_HOST_DEBUG("BulkOnly: checking protocol %2.2x, interface.klass %2.2x, interface.subklass %2.2x\r\n", ei->protocol, ei->interface.klass, ei->interface.subklass); + BS_HOST_DEBUG("BulkOnly: checking interface.protocol %2.2x\r\n", ei->interface.protocol); + // + // TO-DO? + // Check that we have 2 bulk endpoints, and one in each direction?? + // e.g. (ei->interface.numep > 1) && // two or more endpoints AND check types + // This will work with proper hardware though. + // + + return ( + ((ei->klass == UHS_USB_CLASS_MASS_STORAGE) || (ei->interface.klass == UHS_USB_CLASS_MASS_STORAGE)) && // mass storage class AND + ((ei->subklass == UHS_BULK_SUBCLASS_SCSI) || (ei->interface.subklass == UHS_BULK_SUBCLASS_SCSI)) && // SCSI command set AND + ((ei->protocol == UHS_STOR_PROTO_BBB) || (ei->interface.protocol == UHS_STOR_PROTO_BBB)) // Bulk Only transport + ); +} + +/** + * @param ei Enumeration information + * @return 0 always + */ +uint8_t UHS_NI UHS_Bulk_Storage::SetInterface(ENUMERATION_INFO *ei) { + uint8_t index; + + bAddress = ei->address; + BS_HOST_DEBUG("BS SetInterface\r\n"); + // Fill in the endpoint info structure + for(uint8_t ep = 0; ep < ei->interface.numep; ep++) { + BS_HOST_DEBUG("ep: 0x%2.2x bmAttributes: 0x%2.2x ", ep, ei->interface.epInfo[ep].bmAttributes); + if(ei->interface.epInfo[ep].bmAttributes == USB_TRANSFER_TYPE_BULK) { + index = ((ei->interface.epInfo[ep].bEndpointAddress & USB_TRANSFER_DIRECTION_IN) == USB_TRANSFER_DIRECTION_IN) ? epDataInIndex : epDataOutIndex; + epInfo[index].epAddr = (ei->interface.epInfo[ep].bEndpointAddress & 0x0F); + epInfo[index].maxPktSize = ei->interface.epInfo[ep].wMaxPacketSize; + epInfo[index].epAttribs = 0; + epInfo[index].bmNakPower = UHS_USB_NAK_MAX_POWER; + epInfo[index].bmSndToggle = 0; + epInfo[index].bmRcvToggle = 0; + epInfo[index].bIface=ei->interface.bInterfaceNumber; + BS_HOST_DEBUG("index: %i\r\n", index); + } + BS_HOST_DEBUG("\r\n"); + } + bNumEP = 3; + epInfo[0].epAddr = 0; + epInfo[0].maxPktSize = ei->bMaxPacketSize0; + epInfo[0].bmNakPower = UHS_USB_NAK_MAX_POWER; + bIface = ei->interface.bInterfaceNumber; + + return 0; +}; + +/** + * + * @return 0 for success + */ +uint8_t UHS_NI UHS_Bulk_Storage::Start() { + uint8_t rcode; + // Serial.print("Bulk Start from USB Host @ 0x"); + // Serial.println((uint32_t)pUsb, HEX); + // Serial.print("Bulk Start USB Host Address Pool @ 0x"); + // Serial.println((uint32_t)pUsb->GetAddressPool(), HEX); + + BS_HOST_DEBUG("BS Start, speed: %i\r\n", pUsb->GetAddressPool()->GetUsbDevicePtr(bAddress)->speed); + BS_HOST_DEBUG("BS Start\r\n"); + rcode = pUsb->setEpInfoEntry(bAddress, bIface, 3, epInfo); + // Serial.println(rcode,HEX); + if(rcode) goto FailOnInit; + + // Do a 1 second delay before LUN query + if(!UHS_SLEEP_MS(1000)) goto FailUnPlug; + + rcode = GetMaxLUN(&bMaxLUN); + BS_HOST_DEBUG("GetMaxLUN 0x%2.2x\r\n", rcode); + if(rcode) { + goto FailGetMaxLUN; + } + if(bMaxLUN >= MASS_MAX_SUPPORTED_LUN) bMaxLUN = MASS_MAX_SUPPORTED_LUN - 1; + BS_HOST_DEBUG("MaxLUN %u\r\n", bMaxLUN); + //ErrorMessage (PSTR("MaxLUN"), bMaxLUN); + if(!UHS_SLEEP_MS(150)) goto FailUnPlug; // Delay a bit for slow firmware. (again) + + for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { + if(!UHS_SLEEP_MS(3)) goto FailUnPlug; + SCSI_Inquiry_Response response; + rcode = Inquiry(lun, sizeof (SCSI_Inquiry_Response), (uint8_t*) & response); + BS_HOST_DEBUG("Inquiry 0x%2.2x 0x%2.2x\r\n", sizeof (SCSI_Inquiry_Response), rcode); + if(rcode) { + goto FailInquiry; +#if 0 + } else { + BS_HOST_DEBUG("LUN %i `", lun); + uint8_t *buf = response.VendorID; + for(int i = 0; i < 28; i++) BS_HOST_DEBUG("%c", buf[i]); + BS_HOST_DEBUG("'\r\nQualifier %1.1X ", response.PeripheralQualifier); + BS_HOST_DEBUG("Device type %2.2X ", response.DeviceType); + BS_HOST_DEBUG("RMB %1.1X ", response.Removable); + BS_HOST_DEBUG("SSCS %1.1X ", response.SCCS); + uint8_t sv = response.Version; + BS_HOST_DEBUG("SCSI version %2.2X\r\nDevice conforms to ", sv); + switch(sv) { + case 0: + BS_HOST_DEBUG("No specific"); + break; + case 1: + BS_HOST_DEBUG("ANSI X3.131-1986 (ANSI 1)"); + break; + case 2: + BS_HOST_DEBUG("ANSI X3.131-1994 (ANSI 2)"); + break; + case 3: + BS_HOST_DEBUG("ANSI INCITS 301-1997 (SPC)"); + break; + case 4: + BS_HOST_DEBUG("ANSI INCITS 351-2001 (SPC-2)"); + break; + case 5: + BS_HOST_DEBUG("ANSI INCITS 408-2005 (SPC-4)"); + break; + case 6: + BS_HOST_DEBUG("T10/1731-D (SPC-4)"); + break; + default: + BS_HOST_DEBUG("unknown"); + } + BS_HOST_DEBUG(" standards.\r\n"); +#endif + } + } + + for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { + if(!UHS_SLEEP_MS(3)) goto FailUnPlug; + #ifndef USB_NO_TEST_UNIT_READY + uint8_t tries = 0xf0; + while((rcode = TestUnitReady(lun))) { + BS_HOST_DEBUG("\r\nTry %2.2x TestUnitReady %2.2x\r\n", tries - 0xf0, rcode); + if(rcode == 0x08) break; // break on no media, this is OK to do. + if(rcode == UHS_BULK_ERR_DEVICE_DISCONNECTED) goto FailUnPlug; + if(rcode == UHS_BULK_ERR_INVALID_CSW) goto Fail; + if(rcode != UHS_BULK_ERR_MEDIA_CHANGED) goto Fail; + if(!UHS_SLEEP_MS(2 * (tries + 1))) goto FailUnPlug; + tries++; + if(!tries) break; + } + #else + // Don't wait for the LUN to become ready, as this will + // trigger Marlin's watchdog timer + rcode = -1; + #endif + if(!UHS_SLEEP_MS(3)) goto FailUnPlug; + LockMedia(lun, 1); + if(rcode == 0x08) { + if(!UHS_SLEEP_MS(3)) goto FailUnPlug; + if(MediaCTL(lun, 1) == UHS_BULK_ERR_DEVICE_DISCONNECTED) goto FailUnPlug; // I actually have a USB stick that needs this! + } + BS_HOST_DEBUG("\r\nTry %2.2x TestUnitReady %2.2x\r\n", tries - 0xf0, rcode); + if(!rcode) { + if(!UHS_SLEEP_MS(3)) goto FailUnPlug; + BS_HOST_DEBUG("CheckLUN...\r\n"); + BS_HOST_DEBUG("%lu\r\n", millis()/1000); + // Stalls on ***some*** devices, ***WHY***?! Device SAID it is READY!! + LUNOk[lun] = CheckLUN(lun); + BS_HOST_DEBUG("%lu\r\n", millis()/1000); + if(!LUNOk[lun]) LUNOk[lun] = CheckLUN(lun); + if(!UHS_SLEEP_MS(1)) goto FailUnPlug; + BS_HOST_DEBUG("Checked LUN...\r\n"); + } else { + LUNOk[lun] = false; + } + } + + rcode = OnStart(); + + if(rcode) goto FailOnInit; + +#ifdef DEBUG_USB_HOST + USBTRACE("BS configured\r\n\r\n"); +#endif + qNextPollTime = millis() + 100; + bPollEnable = true; + + return 0; +FailUnPlug: + rcode = UHS_BULK_ERR_DEVICE_DISCONNECTED; + goto Fail; + +FailOnInit: +#ifdef DEBUG_USB_HOST + USBTRACE("OnStart:"); + goto Fail; +#endif + +FailGetMaxLUN: +#ifdef DEBUG_USB_HOST + USBTRACE("GetMaxLUN:"); + goto Fail; +#endif + +FailInquiry: +#ifdef DEBUG_USB_HOST + USBTRACE("Inquiry:"); +#endif + +Fail: +#ifdef DEBUG_USB_HOST + NotifyFail(rcode); +#endif + Release(); + + return rcode; +} + +// Base class definition of Release() used. See UHS_USBInterface class definition for details + +/** + * For driver use only. + * + * @return + */ +//void UHS_NI UHS_Bulk_Storage::Release() { +// pUsb->DisablePoll(); +// OnRelease(); +// DriverDefaults(); +// pUsb->EnablePoll(); +// return; +//} + +/** + * For driver use only. + * + * @param lun Logical Unit Number + * @return true if LUN is ready for use. + */ +bool UHS_NI UHS_Bulk_Storage::CheckLUN(uint8_t lun) { + uint8_t rcode; + SCSI_Capacity capacity; + for(uint8_t i = 0; i < 8; i++) capacity.data[i] = 0; + + rcode = ReadCapacity10(lun, (uint8_t*)capacity.data); + if(rcode) { + BS_HOST_DEBUG(">>>>>>>>>>>>>>>>ReadCapacity returned %i\r\n", rcode); + return false; + } +#ifdef DEBUG_USB_HOST + ErrorMessage (PSTR(">>>>>>>>>>>>>>>>CAPACITY OK ON LUN"), lun); + for(uint8_t i = 0; i < 8 /*sizeof (Capacity)*/; i++) + D_PrintHex (capacity.data[i], 0x80); + Notify(PSTR("\r\n\r\n"), 0x80); +#endif + // Only 512/1024/2048/4096 are valid values! + uint32_t c = UHS_BYTES_TO_UINT32(capacity.data[4], capacity.data[5], capacity.data[6], capacity.data[7]); + if(c != 0x0200LU && c != 0x0400LU && c != 0x0800LU && c != 0x1000LU) { + return false; + } + // Store capacity information. + CurrentSectorSize[lun] = (uint16_t)(c); // & 0xFFFF); + + CurrentCapacity[lun] = UHS_BYTES_TO_UINT32(capacity.data[0], capacity.data[1], capacity.data[2], capacity.data[3]) + 1; + if(CurrentCapacity[lun] == /*0xffffffffLU */ 0x01LU || CurrentCapacity[lun] == 0x00LU) { + // Buggy firmware will report 0xffffffff or 0 for no media +#ifdef DEBUG_USB_HOST + if(CurrentCapacity[lun]) + ErrorMessage (PSTR(">>>>>>>>>>>>>>>>BUGGY FIRMWARE. CAPACITY FAIL ON LUN"), lun); +#endif + return false; + } + if(!UHS_SLEEP_MS(20)) return false; + #ifndef SKIP_PAGE3F + Page3F(lun); + #endif + if(!TestUnitReady(lun)) return true; + + return false; +} + +/** + * For driver use only. + * + * Scan for media change on all LUNs + */ +void UHS_NI UHS_Bulk_Storage::CheckMedia() { + if(!bAddress) return; + for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { + if(TestUnitReady(lun)) { + LUNOk[lun] = false; + continue; + } + if(!LUNOk[lun]) + LUNOk[lun] = CheckLUN(lun); + } +#if 0 + BS_HOST_DEBUG("}}}}}}}}}}}}}}}}STATUS "); + for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { + if(LUNOk[lun]) + BS_HOST_DEBUG("#"); + + else BS_HOST_DEBUG("."); + } + BS_HOST_DEBUG("\r\n"); +#endif + OnPoll(); + qNextPollTime = millis() + 100; +} + +/** + * For driver use only. + * + */ +void UHS_NI UHS_Bulk_Storage::Poll() { + if((long)(millis() - qNextPollTime) >= 0L) { + + CheckMedia(); + } + + return; +} + +//////////////////////////////////////////////////////////////////////////////// + + +// SCSI code + + +//////////////////////////////////////////////////////////////////////////////// + +/** + * For driver use only. + * + * @param plun + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::GetMaxLUN(uint8_t *plun) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + uint8_t ret = pUsb->ctrlReq(bAddress, mkSETUP_PKT16(UHS_BULK_bmREQ_IN, UHS_BULK_REQ_GET_MAX_LUN, 0x0000U, bIface, 1), 1, plun); + + if(ret == UHS_HOST_ERROR_STALL) { + + *plun = 0; + Notify(PSTR("\r\nGetMaxLUN Stalled\r\n"), 0x80); + } + return 0; +} + +/** + * For driver use only. Used during Driver Start + * + * @param lun Logical Unit Number + * @param bsize + * @param buf + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::Inquiry(uint8_t lun, uint16_t bsize, uint8_t *buf) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + Notify(PSTR("\r\nInquiry\r\n"), 0x80); + Notify(PSTR("---------\r\n"), 0x80); + + SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_INQUIRY, lun, 0LU, (uint8_t)bsize, 0); + uint8_t rc = SCSITransaction6(&cdb, bsize, buf, (uint8_t)UHS_BULK_CMD_DIR_IN); + + return rc; +} + +/** + * For driver use only. + * + * @param lun Logical Unit Number + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::TestUnitReady(uint8_t lun) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + //SetCurLUN(lun); + if(!bAddress) + return UHS_BULK_ERR_UNIT_NOT_READY; + + Notify(PSTR("\r\nTestUnitReady\r\n"), 0x80); + Notify(PSTR("-----------------\r\n"), 0x80); + + SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_TEST_UNIT_READY, lun, (uint8_t)0, 0); + + return SCSITransaction6(&cdb, 0, NULL, (uint8_t)UHS_BULK_CMD_DIR_IN); + +} + +/** + * For driver use only. + * + * @param lun Logical Unit Number + * @param pc + * @param page + * @param subpage + * @param len + * @param pbuf + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::ModeSense6(uint8_t lun, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t len, uint8_t * pbuf) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + Notify(PSTR("\r\rModeSense\r\n"), 0x80); + Notify(PSTR("------------\r\n"), 0x80); + + SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_MODE_SENSE_6, lun, (uint32_t)((((pc << 6) | page) << 8) | subpage), len, 0); + + return SCSITransaction6(&cdb, len, pbuf, (uint8_t)UHS_BULK_CMD_DIR_IN); +} + +/** + * For driver use only. + * + * @param lun Logical Unit Number + * @param bsize + * @param buf + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::ReadCapacity10(uint8_t lun, uint8_t *buf) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + Notify(PSTR("\r\nReadCapacity\r\n"), 0x80); + Notify(PSTR("---------------\r\n"), 0x80); + + SCSI_CDB10_t cdb = SCSI_CDB10_t(SCSI_CMD_READ_CAPACITY_10, lun); + + return SCSITransaction10(&cdb, 8, buf, (uint8_t)UHS_BULK_CMD_DIR_IN); +} + +/** + * For driver use only. + * + * Page 3F contains write protect status. + * + * @param lun Logical Unit Number to test. + * @return Write protect switch status. + */ +uint8_t UHS_NI UHS_Bulk_Storage::Page3F(uint8_t lun) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + uint8_t buf[192]; + for(int i = 0; i < 192; i++) { + buf[i] = 0x00; + } + WriteOk[lun] = true; + uint8_t rc = ModeSense6(lun, 0, 0x3f, 0, 192, buf); + if(!rc) { + WriteOk[lun] = ((buf[2] & 0x80) == 0); +#ifdef DEBUG_USB_HOST + Notify(PSTR("Mode Sense: "), 0x80); + for(int i = 0; i < 4; i++) { + + D_PrintHex (buf[i], 0x80); + Notify(PSTR(" "), 0x80); + } + Notify(PSTR("\r\n"), 0x80); +#endif + } + return rc; +} + +/** + * For driver use only. + * + * @param lun Logical Unit Number + * @param size + * @param buf + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::RequestSense(uint8_t lun, uint16_t size, uint8_t *buf) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + pUsb->DisablePoll(); + Notify(PSTR("\r\nRequestSense\r\n"), 0x80); + Notify(PSTR("----------------\r\n"), 0x80); + + SCSI_CDB6_t cdb = SCSI_CDB6_t(SCSI_CMD_REQUEST_SENSE, lun, 0LU, (uint8_t)size, 0); + UHS_BULK_CommandBlockWrapper cbw = UHS_BULK_CommandBlockWrapper(++dCBWTag, (uint32_t)size, &cdb, (uint8_t)UHS_BULK_CMD_DIR_IN); + uint8_t v = Transaction(&cbw, size, buf); + pUsb->EnablePoll(); + + return v; +} + + +//////////////////////////////////////////////////////////////////////////////// + + +// USB code + + +//////////////////////////////////////////////////////////////////////////////// + +/** + * For driver use only. + * + * @param index + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::ClearEpHalt(uint8_t index) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + uint8_t ret = 0; + if(index != 0) { + uint8_t ep = (index == epDataInIndex) ? (0x80 | epInfo[index].epAddr) : epInfo[index].epAddr; + do { + ret = pUsb->EPClearHalt(bAddress, ep); + if(!UHS_SLEEP_MS(6)) break; + } while(ret == 0x01); + + if(ret) { + ErrorMessage (PSTR("ClearEpHalt"), ret); + ErrorMessage (PSTR("EP"), ep); + epInfo[index].bmSndToggle = 0; + epInfo[index].bmRcvToggle = 0; + return ret; + } else { + + epInfo[index].bmSndToggle = 0; + epInfo[index].bmRcvToggle = 0; + } + } + return ret; +} + +/** + * For driver use only. + * + */ +void UHS_NI UHS_Bulk_Storage::Reset() { + if(!bAddress) return; + + while(pUsb->ctrlReq(bAddress, mkSETUP_PKT16(UHS_BULK_bmREQ_OUT, UHS_BULK_REQ_BOMSR, 0x0000U, bIface, 0), 0, NULL) == 0x01) { + if(!UHS_SLEEP_MS(6)) break; + } + + if(!bAddress) return; + + UHS_SLEEP_MS(2500); +} + +/** + * For driver use only. + * + * @return 0 if successful + */ +uint8_t UHS_NI UHS_Bulk_Storage::ResetRecovery() { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + Notify(PSTR("\r\nResetRecovery\r\n"), 0x80); + Notify(PSTR("-----------------\r\n"), 0x80); + qNextPollTime = millis() + 90000; + uint8_t bLastUsbError = UHS_HOST_ERROR_UNPLUGGED; + if(UHS_SLEEP_MS(6)) { + Reset(); + if(UHS_SLEEP_MS(6)) { + bLastUsbError = ClearEpHalt(epDataInIndex); + if(UHS_SLEEP_MS(6)) { + + bLastUsbError = ClearEpHalt(epDataOutIndex); + UHS_SLEEP_MS(6); + } + } + } + return bLastUsbError; +} + +/** + * For driver use only. + * + * Clear all EP data and clear all LUN status + */ +void UHS_NI UHS_Bulk_Storage::DriverDefaults() { + + pUsb->DeviceDefaults(MASS_MAX_ENDPOINTS, this); + + for(uint8_t i = 0; i < MASS_MAX_SUPPORTED_LUN; i++) { + + LUNOk[i] = false; + WriteOk[i] = false; + CurrentCapacity[i] = 0lu; + CurrentSectorSize[i] = 0; + } + + dCBWTag = 0; + bMaxLUN = 0; + bTheLUN = 0; +} + +/** + * For driver use only. + * + * @param pcsw + * @param pcbw + * @return + */ +bool UHS_NI UHS_Bulk_Storage::IsValidCSW(UHS_BULK_CommandStatusWrapper *pcsw, UHS_BULK_CommandBlockWrapperBase *pcbw) { + if(!bAddress) return false; + if(pcsw->dCSWSignature != UHS_BULK_CSW_SIGNATURE) { + Notify(PSTR("CSW:Sig error\r\n"), 0x80); + return false; + } + if(pcsw->dCSWTag != pcbw->dCBWTag) { + Notify(PSTR("CSW:Wrong tag\r\n"), 0x80); + ErrorMessage (PSTR("dCSWTag"), pcsw->dCSWTag); + ErrorMessage (PSTR("dCBWTag"), pcbw->dCBWTag); + + return false; + } + return true; +} + +/** + * For driver use only. + * + * @param error + * @param index + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::HandleUsbError(uint8_t error, uint8_t index) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + + uint8_t count = 3; + while(error && count) { + if(error != UHS_HOST_ERROR_NONE) { + ErrorMessage (PSTR("USB Error"), error); + ErrorMessage (PSTR("Index"), index); + } + switch(error) { + // case UHS_HOST_ERROR_WRONGPID: + case UHS_HOST_ERROR_NONE: + return UHS_BULK_ERR_SUCCESS; + case UHS_HOST_ERROR_BUSY: + // SIE is busy, just hang out and try again. + return UHS_BULK_ERR_UNIT_BUSY; + case UHS_HOST_ERROR_NAK: + return UHS_BULK_ERR_UNIT_BUSY; + case UHS_HOST_ERROR_UNPLUGGED: + case UHS_HOST_ERROR_TIMEOUT: + case UHS_HOST_ERROR_JERR: + return UHS_BULK_ERR_DEVICE_DISCONNECTED; + case UHS_HOST_ERROR_STALL: + if(index == 0) return UHS_BULK_ERR_STALL; + ClearEpHalt(index); + if(index != epDataInIndex) return UHS_BULK_ERR_WRITE_STALL; + return UHS_BULK_ERR_STALL; + + + case UHS_HOST_ERROR_TOGERR: + // Handle a very super rare corner case, where toggles become de-synched. + // I have only ran into one device that has this firmware bug, and this is + // the only clean way to get back into sync with the buggy device firmware. + // --AJK + if(bAddress && bConfNum) { + error = pUsb->setConf(bAddress, bConfNum); + + if(error) break; + } + return UHS_BULK_ERR_SUCCESS; + + default: + ErrorMessage (PSTR("\r\nUSB"), error); + + return UHS_BULK_ERR_GENERAL_USB_ERROR; + } + count--; + } // while + + return ((error && !count) ? UHS_BULK_ERR_GENERAL_USB_ERROR : UHS_BULK_ERR_SUCCESS); +} + +/** + * For driver use only. + * + * @param pcbw + * @param buf_size + * @param buf + * @param flags + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::Transaction(UHS_BULK_CommandBlockWrapper *pcbw, uint16_t buf_size, void *buf) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + + uint16_t bytes = buf_size; + bool write = (pcbw->bmCBWFlags & UHS_BULK_CMD_DIR_IN) != UHS_BULK_CMD_DIR_IN; + uint8_t ret = 0; + uint8_t usberr; + UHS_BULK_CommandStatusWrapper csw; // up here, we allocate ahead to save cpu cycles. + SetCurLUN(pcbw->bmCBWLUN); + ErrorMessage (PSTR("CBW.dCBWTag"), pcbw->dCBWTag); + + while((usberr = pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, sizeof (UHS_BULK_CommandBlockWrapper), (uint8_t*)pcbw)) == UHS_HOST_ERROR_BUSY) { + if(!UHS_SLEEP_MS(1)) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + } + ret = HandleUsbError(usberr, epDataOutIndex); + if(ret) { + ErrorMessage (PSTR("============================ CBW"), ret); + } else { + if(bytes) { + if(!write) { + while((usberr = pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, &bytes, (uint8_t*)buf)) == UHS_HOST_ERROR_BUSY) { + if(!UHS_SLEEP_MS(1)) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + } + ret = HandleUsbError(usberr, epDataInIndex); + } else { + while((usberr = pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, bytes, (uint8_t*)buf)) == UHS_HOST_ERROR_BUSY) { + if(!UHS_SLEEP_MS(1)) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + } + ret = HandleUsbError(usberr, epDataOutIndex); + } + if(ret) { + ErrorMessage (PSTR("============================ DAT"), ret); + } + } + } + + { + bytes = sizeof (UHS_BULK_CommandStatusWrapper); + int tries = 2; + while(tries--) { + while((usberr = pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, &bytes, (uint8_t*) & csw)) == UHS_HOST_ERROR_BUSY) { + if(!UHS_SLEEP_MS(1)) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + } + if(!usberr) break; + if(tries) { + if(usberr == UHS_HOST_ERROR_STALL) { + ResetRecovery(); + } else { + ClearEpHalt(epDataInIndex); + } + } + } + if(!ret) { + Notify(PSTR("CBW:\t\tOK\r\n"), 0x80); + Notify(PSTR("Data Stage:\tOK\r\n"), 0x80); + } else { + // Throw away csw, IT IS NOT OF ANY USE. + ResetRecovery(); + return ret; + } + ret = HandleUsbError(usberr, epDataInIndex); + if(ret) { + ErrorMessage (PSTR("============================ CSW"), ret); + } + if(usberr == UHS_HOST_ERROR_NONE) { + if(IsValidCSW(&csw, pcbw)) { + //ErrorMessage (PSTR("CSW.dCBWTag"), csw.dCSWTag); + //ErrorMessage (PSTR("bCSWStatus"), csw.bCSWStatus); + //ErrorMessage (PSTR("dCSWDataResidue"), csw.dCSWDataResidue); + Notify(PSTR("CSW:\t\tOK\r\n\r\n"), 0x80); + return csw.bCSWStatus; + } else { + // NOTE! Sometimes this is caused by the reported residue being wrong. + // Get a different device. It isn't compliant, and should have never passed Q&A. + // I own one... 05e3:0701 Genesys Logic, Inc. USB 2.0 IDE Adapter. + // Other devices that exhibit this behavior exist in the wild too. + // Be sure to check quirks in the Linux source code before reporting a bug. --xxxajk + Notify(PSTR("Invalid CSW\r\n"), 0x80); + Reset(); + ResetRecovery(); + + return UHS_BULK_ERR_INVALID_CSW; + } + } + } + return ret; +} + +/** + * For driver use only. + * + * @param lun Logical Unit Number + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::SetCurLUN(uint8_t lun) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + if(lun > bMaxLUN) + return UHS_BULK_ERR_INVALID_LUN; + bTheLUN = lun; + + return UHS_BULK_ERR_SUCCESS; +}; + +/** + * For driver use only. + * + * @param status + * @return + */ +uint8_t UHS_NI UHS_Bulk_Storage::HandleSCSIError(uint8_t status) { + if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + uint8_t ret = 0; + switch(status) { + case 0: return UHS_BULK_ERR_SUCCESS; + + case 2: + ErrorMessage (PSTR("Phase Error"), status); + ErrorMessage (PSTR("LUN"), bTheLUN); + ResetRecovery(); + return UHS_BULK_ERR_GENERAL_SCSI_ERROR; + + case 1: + ErrorMessage (PSTR("SCSI Error"), status); + ErrorMessage (PSTR("LUN"), bTheLUN); + SCSI_Request_Sense_Response rsp; + + ret = RequestSense(bTheLUN, sizeof (SCSI_Request_Sense_Response), (uint8_t*) & rsp); + + if(ret) { + if(ret == UHS_BULK_ERR_DEVICE_DISCONNECTED) return UHS_BULK_ERR_DEVICE_DISCONNECTED; + return UHS_BULK_ERR_GENERAL_SCSI_ERROR; + } +#if ENABLE_UHS_DEBUGGING + ErrorMessage (PSTR("Response Code"), rsp.bResponseCode); + if(rsp.bResponseCode & 0x80) { + Notify(PSTR("Information field: "), 0x80); + for(int i = 0; i < 4; i++) { + D_PrintHex (rsp.CmdSpecificInformation[i], 0x80); + Notify(PSTR(" "), 0x80); + } + Notify(PSTR("\r\n"), 0x80); + } + ErrorMessage (PSTR("Sense Key"), rsp.bmSenseKey); + ErrorMessage (PSTR("Add Sense Code"), rsp.bAdditionalSenseCode); + ErrorMessage (PSTR("Add Sense Qual"), rsp.bAdditionalSenseQualifier); +#endif + // warning, this is not testing ASQ, only SK and ASC. + switch(rsp.bmSenseKey) { + case SCSI_S_UNIT_ATTENTION: + switch(rsp.bAdditionalSenseCode) { + case SCSI_ASC_MEDIA_CHANGED: + return UHS_BULK_ERR_MEDIA_CHANGED; + default: + return UHS_BULK_ERR_UNIT_NOT_READY; + } + case SCSI_S_NOT_READY: + switch(rsp.bAdditionalSenseCode) { + case SCSI_ASC_MEDIUM_NOT_PRESENT: + return UHS_BULK_ERR_NO_MEDIA; + default: + return UHS_BULK_ERR_UNIT_NOT_READY; + } + case SCSI_S_ILLEGAL_REQUEST: + switch(rsp.bAdditionalSenseCode) { + case SCSI_ASC_LBA_OUT_OF_RANGE: + return UHS_BULK_ERR_BAD_LBA; + default: + return UHS_BULK_ERR_CMD_NOT_SUPPORTED; + } + default: + return UHS_BULK_ERR_GENERAL_SCSI_ERROR; + } + + // case 4: return MASS_ERR_UNIT_BUSY; // Busy means retry later. + // case 0x05/0x14: we stalled out + // case 0x15/0x16: we naked out. + default: + ErrorMessage (PSTR("Gen SCSI Err"), status); + ErrorMessage (PSTR("LUN"), bTheLUN); + + return status; + } // switch +} + + +//////////////////////////////////////////////////////////////////////////////// + + +// Debugging code + + +//////////////////////////////////////////////////////////////////////////////// + +/** + * + * @param ep_ptr + */ +void UHS_NI UHS_Bulk_Storage::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR * ep_ptr) { + Notify(PSTR("Endpoint descriptor:"), 0x80); + Notify(PSTR("\r\nLength:\t\t"), 0x80); + D_PrintHex (ep_ptr->bLength, 0x80); + Notify(PSTR("\r\nType:\t\t"), 0x80); + D_PrintHex (ep_ptr->bDescriptorType, 0x80); + Notify(PSTR("\r\nAddress:\t"), 0x80); + D_PrintHex (ep_ptr->bEndpointAddress, 0x80); + Notify(PSTR("\r\nAttributes:\t"), 0x80); + D_PrintHex (ep_ptr->bmAttributes, 0x80); + Notify(PSTR("\r\nMaxPktSize:\t"), 0x80); + D_PrintHex (ep_ptr->wMaxPacketSize, 0x80); + Notify(PSTR("\r\nPoll Intrv:\t"), 0x80); + D_PrintHex (ep_ptr->bInterval, 0x80); + Notify(PSTR("\r\n"), 0x80); +} + +#else +#error "Never include UHS_BULK_STORAGE_INLINE.h, include UHS_host.h instead" +#endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h new file mode 100644 index 000000000000..1050d70c74e2 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h @@ -0,0 +1,327 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#ifndef UHS_SCSI_H +#define UHS_SCSI_H + +/* + * Reference documents from T10 (http://www.t10.org) + * SCSI Primary Commands - 3 (SPC-3) + * SCSI Block Commands - 2 (SBC-2) + * Multi-Media Commands - 5 (MMC-5) + */ + +/* Group 1 commands (CDB's here are should all be 6-bytes) */ +#define SCSI_CMD_TEST_UNIT_READY 0x00U +#define SCSI_CMD_REQUEST_SENSE 0x03U +#define SCSI_CMD_FORMAT_UNIT 0x04U +#define SCSI_CMD_READ_6 0x08U +#define SCSI_CMD_WRITE_6 0x0AU +#define SCSI_CMD_INQUIRY 0x12U +#define SCSI_CMD_MODE_SELECT_6 0x15U +#define SCSI_CMD_MODE_SENSE_6 0x1AU +#define SCSI_CMD_START_STOP_UNIT 0x1BU +#define SCSI_CMD_PREVENT_REMOVAL 0x1EU +/* Group 2 Commands (CDB's here are 10-bytes) */ +#define SCSI_CMD_READ_FORMAT_CAPACITIES 0x23U +#define SCSI_CMD_READ_CAPACITY_10 0x25U +#define SCSI_CMD_READ_10 0x28U +#define SCSI_CMD_WRITE_10 0x2AU +#define SCSI_CMD_SEEK_10 0x2BU +#define SCSI_CMD_ERASE_10 0x2CU +#define SCSI_CMD_WRITE_AND_VERIFY_10 0x2EU +#define SCSI_CMD_VERIFY_10 0x2FU +#define SCSI_CMD_SYNCHRONIZE_CACHE 0x35U +#define SCSI_CMD_WRITE_BUFFER 0x3BU +#define SCSI_CMD_READ_BUFFER 0x3CU +#define SCSI_CMD_READ_SUBCHANNEL 0x42U +#define SCSI_CMD_READ_TOC 0x43U +#define SCSI_CMD_READ_HEADER 0x44U +#define SCSI_CMD_PLAY_AUDIO_10 0x45U +#define SCSI_CMD_GET_CONFIGURATION 0x46U +#define SCSI_CMD_PLAY_AUDIO_MSF 0x47U +#define SCSI_CMD_PLAY_AUDIO_TI 0x48U +#define SCSI_CMD_PLAY_TRACK_REL_10 0x49U +#define SCSI_CMD_GET_EVENT_STATUS 0x4AU +#define SCSI_CMD_PAUSE_RESUME 0x4BU +#define SCSI_CMD_READ_DISC_INFORMATION 0x51U +#define SCSI_CMD_READ_TRACK_INFORMATION 0x52U +#define SCSI_CMD_RESERVE_TRACK 0x53U +#define SCSI_CMD_SEND_OPC_INFORMATION 0x54U +#define SCSI_CMD_MODE_SELECT_10 0x55U +#define SCSI_CMD_REPAIR_TRACK 0x58U +#define SCSI_CMD_MODE_SENSE_10 0x5AU +#define SCSI_CMD_CLOSE_TRACK_SESSION 0x5BU +#define SCSI_CMD_READ_BUFFER_CAPACITY 0x5CU +#define SCSI_CMD_SEND_CUE_SHEET 0x5DU +/* Group 5 Commands (CDB's here are 12-bytes) */ +#define SCSI_CMD_REPORT_LUNS 0xA0U +#define SCSI_CMD_BLANK 0xA1U +#define SCSI_CMD_SECURITY_PROTOCOL_IN 0xA2U +#define SCSI_CMD_SEND_KEY 0xA3U +#define SCSI_CMD_REPORT_KEY 0xA4U +#define SCSI_CMD_PLAY_AUDIO_12 0xA5U +#define SCSI_CMD_LOAD_UNLOAD 0xA6U +#define SCSI_CMD_SET_READ_AHEAD 0xA7U +#define SCSI_CMD_READ_12 0xA8U +#define SCSI_CMD_PLAY_TRACK_REL_12 0xA9U +#define SCSI_CMD_WRITE_12 0xAAU +#define SCSI_CMD_READ_MEDIA_SERIAL_12 0xABU +#define SCSI_CMD_GET_PERFORMANCE 0xACU +#define SCSI_CMD_READ_DVD_STRUCTURE 0xADU +#define SCSI_CMD_SECURITY_PROTOCOL_OUT 0xB5U +#define SCSI_CMD_SET_STREAMING 0xB6U +#define SCSI_CMD_READ_MSF 0xB9U +#define SCSI_CMD_SET_SPEED 0xBBU +#define SCSI_CMD_MECHANISM_STATUS 0xBDU +#define SCSI_CMD_READ_CD 0xBEU +#define SCSI_CMD_SEND_DISC_STRUCTURE 0xBFU +/* Vendor-unique Commands, included for completeness */ +#define SCSI_CMD_CD_PLAYBACK_STATUS 0xC4U /* SONY unique */ +#define SCSI_CMD_PLAYBACK_CONTROL 0xC9U /* SONY unique */ +#define SCSI_CMD_READ_CDDA 0xD8U /* Vendor unique */ +#define SCSI_CMD_READ_CDXA 0xDBU /* Vendor unique */ +#define SCSI_CMD_READ_ALL_SUBCODES 0xDFU /* Vendor unique */ + +/* SCSI error codes */ +#define SCSI_S_NOT_READY 0x02U +#define SCSI_S_MEDIUM_ERROR 0x03U +#define SCSI_S_ILLEGAL_REQUEST 0x05U +#define SCSI_S_UNIT_ATTENTION 0x06U +#define SCSI_ASC_LBA_OUT_OF_RANGE 0x21U +#define SCSI_ASC_MEDIA_CHANGED 0x28U +#define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3AU + +struct SCSI_Capacity { + uint8_t data[8]; + //uint32_t dwBlockAddress; + //uint32_t dwBlockLength; +} __attribute__((packed)); + +struct SCSI_CDB_BASE { + uint8_t Opcode; + + unsigned unused : 5; + unsigned LUN : 3; + + uint8_t info[12]; +} __attribute__((packed)); + +typedef SCSI_CDB_BASE SCSI_CDB_BASE_t; + +struct SCSI_CDB6 { + uint8_t Opcode; + + unsigned LBAMSB : 5; + unsigned LUN : 3; + + uint8_t LBAHB; + uint8_t LBALB; + uint8_t AllocationLength; + uint8_t Control; + +public: + + SCSI_CDB6(uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control) : + Opcode(_Opcode), LBAMSB(UHS_UINT8_BYTE2(LBA) & 0x1f), LUN(_LUN), LBAHB(UHS_UINT8_BYTE1(LBA)), LBALB(UHS_UINT8_BYTE0(LBA)), + AllocationLength(_AllocationLength), Control(_Control) { + } + + SCSI_CDB6(uint8_t _Opcode, uint8_t _LUN, uint8_t _AllocationLength, uint8_t _Control) : + Opcode(_Opcode), LBAMSB(0), LUN(_LUN), LBAHB(0), LBALB(0), + AllocationLength(_AllocationLength), Control(_Control) { + } +} __attribute__((packed)); + +typedef SCSI_CDB6 SCSI_CDB6_t; + +struct SCSI_CDB10 { + uint8_t Opcode; + + unsigned Service_Action : 5; + unsigned LUN : 3; + + uint8_t LBA_L_M_MB; + uint8_t LBA_L_M_LB; + uint8_t LBA_L_L_MB; + uint8_t LBA_L_L_LB; + + uint8_t Misc2; + + uint8_t ALC_MB; + uint8_t ALC_LB; + + uint8_t Control; +public: + + SCSI_CDB10(uint8_t _Opcode, uint8_t _LUN) : + Opcode(_Opcode), Service_Action(0), LUN(_LUN), + LBA_L_M_MB(0), LBA_L_M_LB(0), LBA_L_L_MB(0), LBA_L_L_LB(0), + Misc2(0), ALC_MB(0), ALC_LB(0), Control(0) { + } + + SCSI_CDB10(uint8_t _Opcode, uint8_t _LUN, uint16_t xflen, uint32_t _LBA) : + Opcode(_Opcode), Service_Action(0), LUN(_LUN), + LBA_L_M_MB(UHS_UINT8_BYTE3(_LBA)), LBA_L_M_LB(UHS_UINT8_BYTE2(_LBA)), LBA_L_L_MB(UHS_UINT8_BYTE1(_LBA)), LBA_L_L_LB(UHS_UINT8_BYTE0(_LBA)), + Misc2(0), ALC_MB(UHS_UINT8_BYTE1(xflen)), ALC_LB(UHS_UINT8_BYTE0(xflen)), Control(0) { + } +} __attribute__((packed)); + +typedef SCSI_CDB10 SCSI_CDB10_t; + +struct SCSI_CDB12 { + uint8_t Opcode; + + unsigned Service_Action : 5; + unsigned Misc : 3; + + uint8_t LBA_L_M_LB; + uint8_t LBA_L_L_MB; + uint8_t LBA_L_L_LB; + + uint8_t ALC_M_LB; + uint8_t ALC_L_MB; + uint8_t ALC_L_LB; + uint8_t Control; +} __attribute__((packed)); + +typedef SCSI_CDB12 SCSI_CDB12_t; + +struct SCSI_CDB_LBA32_16 { + uint8_t Opcode; + + unsigned Service_Action : 5; + unsigned Misc : 3; + + uint8_t LBA_L_M_MB; + uint8_t LBA_L_M_LB; + uint8_t LBA_L_L_MB; + uint8_t LBA_L_L_LB; + + uint8_t A_M_M_MB; + uint8_t A_M_M_LB; + uint8_t A_M_L_MB; + uint8_t A_M_L_LB; + + uint8_t ALC_M_MB; + uint8_t ALC_M_LB; + uint8_t ALC_L_MB; + uint8_t ALC_L_LB; + + uint8_t Misc2; + uint8_t Control; +} __attribute__((packed)); + +struct SCSI_CDB_LBA64_16 { + uint8_t Opcode; + uint8_t Misc; + + uint8_t LBA_M_M_MB; + uint8_t LBA_M_M_LB; + uint8_t LBA_M_L_MB; + uint8_t LBA_M_L_LB; + + uint8_t LBA_L_M_MB; + uint8_t LBA_L_M_LB; + uint8_t LBA_L_L_MB; + uint8_t LBA_L_L_LB; + + uint8_t ALC_M_MB; + uint8_t ALC_M_LB; + uint8_t ALC_L_MB; + uint8_t ALC_L_LB; + + uint8_t Misc2; + uint8_t Control; +} __attribute__((packed)); + +struct SCSI_Inquiry_Response { + uint8_t DeviceType : 5; + uint8_t PeripheralQualifier : 3; + + unsigned Reserved : 7; + unsigned Removable : 1; + + uint8_t Version; + + unsigned ResponseDataFormat : 4; + unsigned HISUP : 1; + unsigned NormACA : 1; + unsigned TrmTsk : 1; + unsigned AERC : 1; + + uint8_t AdditionalLength; + + unsigned PROTECT : 1; + unsigned Res : 2; + unsigned ThreePC : 1; + unsigned TPGS : 2; + unsigned ACC : 1; + unsigned SCCS : 1; + + unsigned ADDR16 : 1; + unsigned R1 : 1; + unsigned R2 : 1; + unsigned MCHNGR : 1; + unsigned MULTIP : 1; + unsigned VS : 1; + unsigned ENCSERV : 1; + unsigned BQUE : 1; + + unsigned SoftReset : 1; + unsigned CmdQue : 1; + unsigned Reserved4 : 1; + unsigned Linked : 1; + unsigned Sync : 1; + unsigned WideBus16Bit : 1; + unsigned WideBus32Bit : 1; + unsigned RelAddr : 1; + + uint8_t VendorID[8]; + uint8_t ProductID[16]; + uint8_t RevisionID[4]; +} __attribute__((packed)); + +struct SCSI_Request_Sense_Response { + uint8_t bResponseCode; + uint8_t bSegmentNumber; + + uint8_t bmSenseKey : 4; + uint8_t bmReserved : 1; + uint8_t bmILI : 1; + uint8_t bmEOM : 1; + uint8_t bmFileMark : 1; + + uint8_t Information[4]; + uint8_t bAdditionalLength; + uint8_t CmdSpecificInformation[4]; + uint8_t bAdditionalSenseCode; + uint8_t bAdditionalSenseQualifier; + uint8_t bFieldReplaceableUnitCode; + uint8_t SenseKeySpecific[3]; +} __attribute__((packed)); + +#endif /* UHS_SCSI_H */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h new file mode 100644 index 000000000000..5c60f2d1839a --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h @@ -0,0 +1,33 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ +#ifndef _UHS_UNOFFICIAL_IDs_h +#define _UHS_UNOFFICIAL_IDs_h + +// Bogus unofficial and unregistered VIDs from cloners to be listed here. + +#define UHS_VID_UNOFFICIAL_JOYTECH 0x162EU // For unofficial Joytech controllers + +#endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h new file mode 100644 index 000000000000..417c9f6e6946 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h @@ -0,0 +1,2993 @@ +/* + * USB vendor ids + * This file was generated by running python ./make-USB_IDs.py > UHS_USB_IDs.h + * Don't change it directly. + * + * Copyright 2014, Andrew J. Kroll for Circuits At Home, LTD. All rights reserved. + * + * Copyright 2012, Michal Labedzki for Tieto Corporation + * Other values imported from libghoto2/camlibs/ptp2/library.c, music-players.h + * Copyright (C) 2001-2005 Mariusz Woloszyn + * Copyright (C) 2003-2013 Marcus Meissner + * Copyright (C) 2005 Hubert Figuiere + * Copyright (C) 2009 Axel Waggershauser + * Copyright (C) 2005-2007 Richard A. Low + * Copyright (C) 2005-2012 Linus Walleij + * Copyright (C) 2007 Ted Bullock + * Copyright (C) 2012 Sony Mobile Communications AB + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * Copyright 1998 Gerald Combs + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifndef _UHS_USB_IDs_h_ +#define _UHS_USB_IDs_h_ +#include "UHS_UNOFFICIAL_IDs.h" + +#define UHS_VID_FRYS_ELECTRONICS 0x0001U // Fry's Electronics +#define UHS_VID_INGRAM 0x0002U // Ingram +#define UHS_VID_CLUB_MAC 0x0003U // Club Mac +#define UHS_VID_NEBRASKA_FURNITURE_MART 0x0004U // Nebraska Furniture Mart +#define UHS_VID_UNKNOWN 0x0011U // Unknown +#define UHS_VID_PLANEX 0x0053U // Planex +#define UHS_VID_DRAGONRISE 0x0079U // DragonRise Inc. +#define UHS_VID_TRUST_INTERNATIONAL_BV 0x0105U // Trust International B.V. +#define UHS_VID_IBP 0x0127U // IBP +#define UHS_VID_UNKNOWN_1 0x0145U // Unknown +#define UHS_VID_MLK 0x017cU // MLK +#define UHS_VID_TP_LINK 0x0200U // TP-Link +#define UHS_VID_CHIPSBANK_MICROELECTRONICS 0x0204U // Chipsbank Microelectronics Co., Ltd +#define UHS_VID_HANGZHOU_WORLDE 0x0218U // Hangzhou Worlde +#define UHS_VID_HUMAX 0x02adU // HUMAX Co., Ltd. +#define UHS_VID_MM300_EBOOK_READER 0x0300U // MM300 eBook Reader +#define UHS_VID_OCZ_TECHNOLOGY 0x0324U // OCZ Technology Inc +#define UHS_VID_OCZ_TECHNOLOGY_1 0x0325U // OCZ Technology Inc +#define UHS_VID_LTS 0x0386U // LTS +#define UHS_VID_SHENZHEN_SINOTE_TECH_ELECTRON 0x03d9U // Shenzhen Sinote Tech-Electron Co., Ltd +#define UHS_VID_BERND_WALTER_COMPUTER_TECHNOLOGY 0x03daU // Bernd Walter Computer Technology +#define UHS_VID_ENDPOINTS 0x03e8U // EndPoints, Inc. +#define UHS_VID_THESYS_MICROELECTRONICS 0x03e9U // Thesys Microelectronics +#define UHS_VID_DATA_BROADCASTING 0x03eaU // Data Broadcasting Corp. +#define UHS_VID_ATMEL 0x03ebU // Atmel Corp. +#define UHS_VID_IWATSU_AMERICA 0x03ecU // Iwatsu America, Inc. +#define UHS_VID_MITEL 0x03edU // Mitel Corp. +#define UHS_VID_MITSUMI 0x03eeU // Mitsumi +#define UHS_VID_HEWLETT_PACKARD 0x03f0U // Hewlett-Packard +#define UHS_VID_GENOA_TECHNOLOGY 0x03f1U // Genoa Technology +#define UHS_VID_OAK_TECHNOLOGY 0x03f2U // Oak Technology, Inc. +#define UHS_VID_ADAPTEC 0x03f3U // Adaptec, Inc. +#define UHS_VID_DIEBOLD 0x03f4U // Diebold, Inc. +#define UHS_VID_SIEMENS_ELECTROMECHANICAL 0x03f5U // Siemens Electromechanical +#define UHS_VID_EPSON_IMAGING_TECHNOLOGY_CENTER 0x03f8U // Epson Imaging Technology Center +#define UHS_VID_KEYTRONIC 0x03f9U // KeyTronic Corp. +#define UHS_VID_OPTI 0x03fbU // OPTi, Inc. +#define UHS_VID_ELITEGROUP_COMPUTER_SYSTEMS 0x03fcU // Elitegroup Computer Systems +#define UHS_VID_XILINX 0x03fdU // Xilinx, Inc. +#define UHS_VID_FARALLON_COMUNICATIONS 0x03feU // Farallon Communications +#define UHS_VID_NATIONAL_SEMICONDUCTOR 0x0400U // National Semiconductor Corp. +#define UHS_VID_NATIONAL_REGISTRY 0x0401U // National Registry, Inc. +#define UHS_VID_ALI 0x0402U // ALi Corp. +#define UHS_VID_FUTURE_TECHNOLOGY_DEVICES_INTERNATIONAL 0x0403U // Future Technology Devices International, Ltd +#define UHS_VID_NCR 0x0404U // NCR Corp. +#define UHS_VID_SYNOPSYS 0x0405U // Synopsys, Inc. +#define UHS_VID_FUJITSU_ICL_COMPUTERS 0x0406U // Fujitsu-ICL Computers +#define UHS_VID_FUJITSU_PERSONAL_SYSTEMS 0x0407U // Fujitsu Personal Systems, Inc. +#define UHS_VID_QUANTA_COMPUTER 0x0408U // Quanta Computer, Inc. +#define UHS_VID_NEC 0x0409U // NEC Corp. +#define UHS_VID_KODAK 0x040aU // Kodak Co. +#define UHS_VID_WELTREND_SEMICONDUCTOR 0x040bU // Weltrend Semiconductor +#define UHS_VID_VTECH_COMPUTERS 0x040cU // VTech Computers, Ltd +#define UHS_VID_VIA_TECHNOLOGIES 0x040dU // VIA Technologies, Inc. +#define UHS_VID_MCCI 0x040eU // MCCI +#define UHS_VID_ECHO_SPEECH 0x040fU // Echo Speech Corp. +#define UHS_VID_BUFFALO_INC_FORMERLY_MELCO 0x0411U // BUFFALO INC. (formerly MelCo., Inc.) +#define UHS_VID_AWARD_SOFTWARE_INTERNATIONAL 0x0412U // Award Software International +#define UHS_VID_LEADTEK_RESEARCH 0x0413U // Leadtek Research, Inc. +#define UHS_VID_GIGA_BYTE_TECHNOLOGY 0x0414U // Giga-Byte Technology Co., Ltd +#define UHS_VID_WINBOND_ELECTRONICS 0x0416U // Winbond Electronics Corp. +#define UHS_VID_SYMBIOS_LOGIC 0x0417U // Symbios Logic +#define UHS_VID_AST_RESEARCH 0x0418U // AST Research +#define UHS_VID_SAMSUNG_INFO_SYSTEMS_AMERICA 0x0419U // Samsung Info. Systems America, Inc. +#define UHS_VID_PHOENIX_TECHNOLOGIES 0x041aU // Phoenix Technologies, Ltd +#define UHS_VID_DTV 0x041bU // d'TV +#define UHS_VID_S3 0x041dU // S3, Inc. +#define UHS_VID_CREATIVE_TECHNOLOGY 0x041eU // Creative Technology, Ltd +#define UHS_VID_LCS_TELEGRAPHICS 0x041fU // LCS Telegraphics +#define UHS_VID_CHIPS_AND_TECHNOLOGIES 0x0420U // Chips and Technologies +#define UHS_VID_NOKIA_MOBILE_PHONES 0x0421U // Nokia Mobile Phones +#define UHS_VID_ADI_SYSTEMS 0x0422U // ADI Systems, Inc. +#define UHS_VID_COMPUTER_ACCESS_TECHNOLOGY 0x0423U // Computer Access Technology Corp. +#define UHS_VID_STANDARD_MICROSYSTEMS 0x0424U // Standard Microsystems Corp. +#define UHS_VID_MOTOROLA_SEMICONDUCTORS_HK 0x0425U // Motorola Semiconductors HK, Ltd +#define UHS_VID_INTEGRATED_DEVICE_TECHNOLOGY 0x0426U // Integrated Device Technology, Inc. +#define UHS_VID_MOTOROLA_ELECTRONICS_TAIWAN 0x0427U // Motorola Electronics Taiwan, Ltd +#define UHS_VID_ADVANCED_GRAVIS_COMPUTER_TECH 0x0428U // Advanced Gravis Computer Tech, Ltd +#define UHS_VID_CIRRUS_LOGIC 0x0429U // Cirrus Logic +#define UHS_VID_ERICSSON_AUSTRIAN_AG 0x042aU // Ericsson Austrian, AG +#define UHS_VID_INTEL 0x042bU // Intel Corp. +#define UHS_VID_INNOVATIVE_SEMICONDUCTORS 0x042cU // Innovative Semiconductors, Inc. +#define UHS_VID_MICRONICS 0x042dU // Micronics +#define UHS_VID_ACER 0x042eU // Acer, Inc. +#define UHS_VID_MOLEX 0x042fU // Molex, Inc. +#define UHS_VID_SUN_MICROSYSTEMS 0x0430U // Sun Microsystems, Inc. +#define UHS_VID_ITAC_SYSTEMS 0x0431U // Itac Systems, Inc. +#define UHS_VID_UNISYS 0x0432U // Unisys Corp. +#define UHS_VID_ALPS_ELECTRIC 0x0433U // Alps Electric, Inc. +#define UHS_VID_SAMSUNG_INFO_SYSTEMS_AMERICA_1 0x0434U // Samsung Info. Systems America, Inc. +#define UHS_VID_HYUNDAI_ELECTRONICS_AMERICA 0x0435U // Hyundai Electronics America +#define UHS_VID_TAUGAGREINING_HF 0x0436U // Taugagreining HF +#define UHS_VID_FRAMATOME_CONNECTORS_USA 0x0437U // Framatome Connectors USA +#define UHS_VID_ADVANCED_MICRO_DEVICES 0x0438U // Advanced Micro Devices, Inc. +#define UHS_VID_VOICE_TECHNOLOGIES_GROUP 0x0439U // Voice Technologies Group +#define UHS_VID_LEXMARK_INTERNATIONAL 0x043dU // Lexmark International, Inc. +#define UHS_VID_LG_ELECTRONICS_USA 0x043eU // LG Electronics USA, Inc. +#define UHS_VID_RADISYS 0x043fU // RadiSys Corp. +#define UHS_VID_EIZO_NANAO 0x0440U // Eizo Nanao Corp. +#define UHS_VID_WINBOND_SYSTEMS_LAB 0x0441U // Winbond Systems Lab. +#define UHS_VID_ERICSSON 0x0442U // Ericsson, Inc. +#define UHS_VID_GATEWAY 0x0443U // Gateway, Inc. +#define UHS_VID_LUCENT_TECHNOLOGIES 0x0445U // Lucent Technologies, Inc. +#define UHS_VID_NMB_TECHNOLOGIES 0x0446U // NMB Technologies Corp. +#define UHS_VID_MOMENTUM_MICROSYSTEMS 0x0447U // Momentum Microsystems +#define UHS_VID_SHAMROCK_TECH 0x044aU // Shamrock Tech. Co., Ltd +#define UHS_VID_WSI 0x044bU // WSI +#define UHS_VID_CCLITRI 0x044cU // CCL/ITRI +#define UHS_VID_SIEMENS_NIXDORF_AG 0x044dU // Siemens Nixdorf AG +#define UHS_VID_ALPS_ELECTRIC_1 0x044eU // Alps Electric Co., Ltd +#define UHS_VID_THRUSTMASTER 0x044fU // ThrustMaster, Inc. +#define UHS_VID_DFI 0x0450U // DFI, Inc. +#define UHS_VID_TEXAS_INSTRUMENTS 0x0451U // Texas Instruments, Inc. +#define UHS_VID_MITSUBISHI_ELECTRONICS_AMERICA 0x0452U // Mitsubishi Electronics America, Inc. +#define UHS_VID_CMD_TECHNOLOGY 0x0453U // CMD Technology +#define UHS_VID_VOBIS_MICROCOMPUTER_AG 0x0454U // Vobis Microcomputer AG +#define UHS_VID_TELEMATICS_INTERNATIONAL 0x0455U // Telematics International, Inc. +#define UHS_VID_ANALOG_DEVICES 0x0456U // Analog Devices, Inc. +#define UHS_VID_SILICON_INTEGRATED_SYSTEMS 0x0457U // Silicon Integrated Systems Corp. +#define UHS_VID_KYE_SYSTEMS_CORP_MOUSE_SYSTEMS 0x0458U // KYE Systems Corp. (Mouse Systems) +#define UHS_VID_ADOBE_SYSTEMS 0x0459U // Adobe Systems, Inc. +#define UHS_VID_SONICBLUE 0x045aU // SONICblue, Inc. +#define UHS_VID_HITACHI 0x045bU // Hitachi, Ltd +#define UHS_VID_NORTEL_NETWORKS 0x045dU // Nortel Networks, Ltd +#define UHS_VID_MICROSOFT 0x045eU // Microsoft Corp. +#define UHS_VID_ACE_CAD_ENTERPRISE 0x0460U // Ace Cad Enterprise Co., Ltd +#define UHS_VID_PRIMAX_ELECTRONICS 0x0461U // Primax Electronics, Ltd +#define UHS_VID_MGE_UPS_SYSTEMS 0x0463U // MGE UPS Systems +#define UHS_VID_AMPTYCOELECTRONICS 0x0464U // AMP/Tycoelectronics Corp. +#define UHS_VID_ATANDT_PARADYNE 0x0467U // AT&T Paradyne +#define UHS_VID_WIESON_TECHNOLOGIES 0x0468U // Wieson Technologies Co., Ltd +#define UHS_VID_CHERRY 0x046aU // Cherry GmbH +#define UHS_VID_AMERICAN_MEGATRENDS 0x046bU // American Megatrends, Inc. +#define UHS_VID_TOSHIBA_CORP_DIGITAL_MEDIA_EQUIPMENT 0x046cU // Toshiba Corp., Digital Media Equipment +#define UHS_VID_LOGITECH 0x046dU // Logitech, Inc. +#define UHS_VID_BEHAVIOR_TECH_COMPUTER 0x046eU // Behavior Tech. Computer Corp. +#define UHS_VID_CRYSTAL_SEMICONDUCTOR 0x046fU // Crystal Semiconductor +#define UHS_VID_PHILIPS_OR_NXP 0x0471U // Philips (or NXP) +#define UHS_VID_CHICONY_ELECTRONICS 0x0472U // Chicony Electronics Co., Ltd +#define UHS_VID_SANYO_INFORMATION_BUSINESS 0x0473U // Sanyo Information Business Co., Ltd +#define UHS_VID_SANYO_ELECTRIC 0x0474U // Sanyo Electric Co., Ltd +#define UHS_VID_RELISYSTECO_INFORMATION_SYSTEM 0x0475U // Relisys/Teco Information System +#define UHS_VID_AESP 0x0476U // AESP +#define UHS_VID_SEAGATE_TECHNOLOGY 0x0477U // Seagate Technology, Inc. +#define UHS_VID_CONNECTIX 0x0478U // Connectix Corp. +#define UHS_VID_ADVANCED_PERIPHERAL_LABORATORIES 0x0479U // Advanced Peripheral Laboratories +#define UHS_VID_SEMTECH 0x047aU // Semtech Corp. +#define UHS_VID_SILITEK 0x047bU // Silitek Corp. +#define UHS_VID_DELL_COMPUTER 0x047cU // Dell Computer Corp. +#define UHS_VID_KENSINGTON 0x047dU // Kensington +#define UHS_VID_AGERE_SYSTEMS_INC_LUCENT 0x047eU // Agere Systems, Inc. (Lucent) +#define UHS_VID_PLANTRONICS 0x047fU // Plantronics, Inc. +#define UHS_VID_TOSHIBA_AMERICA 0x0480U // Toshiba America Inc +#define UHS_VID_ZENITH_DATA_SYSTEMS 0x0481U // Zenith Data Systems +#define UHS_VID_KYOCERA 0x0482U // Kyocera Corp. +#define UHS_VID_STMICROELECTRONICS 0x0483U // STMicroelectronics +#define UHS_VID_SPECIALIX 0x0484U // Specialix +#define UHS_VID_NOKIA_MONITORS 0x0485U // Nokia Monitors +#define UHS_VID_ASUS_COMPUTERS 0x0486U // ASUS Computers, Inc. +#define UHS_VID_STEWART_CONNECTOR 0x0487U // Stewart Connector +#define UHS_VID_CIRQUE 0x0488U // Cirque Corp. +#define UHS_VID_FOXCONN_HON_HAI 0x0489U // Foxconn / Hon Hai +#define UHS_VID_S_MOS_SYSTEMS 0x048aU // S-MOS Systems, Inc. +#define UHS_VID_ALPS_ELECTRIC_IRELAND 0x048cU // Alps Electric Ireland, Ltd +#define UHS_VID_INTEGRATED_TECHNOLOGY_EXPRESS 0x048dU // Integrated Technology Express, Inc. +#define UHS_VID_EICON_TECH 0x048fU // Eicon Tech. +#define UHS_VID_UNITED_MICROELECTRONICS 0x0490U // United Microelectronics Corp. +#define UHS_VID_CAPETRONIC 0x0491U // Capetronic +#define UHS_VID_SAMSUNG_SEMICONDUCTOR 0x0492U // Samsung SemiConductor, Inc. +#define UHS_VID_MAG_TECHNOLOGY 0x0493U // MAG Technology Co., Ltd +#define UHS_VID_ESS_TECHNOLOGY 0x0495U // ESS Technology, Inc. +#define UHS_VID_MICRON_ELECTRONICS 0x0496U // Micron Electronics +#define UHS_VID_SMILE_INTERNATIONAL 0x0497U // Smile International +#define UHS_VID_CAPETRONIC_KAOHSIUNG 0x0498U // Capetronic (Kaohsiung) Corp. +#define UHS_VID_YAMAHA 0x0499U // Yamaha Corp. +#define UHS_VID_GANDALF_TECHNOLOGIES 0x049aU // Gandalf Technologies, Ltd +#define UHS_VID_CURTIS_COMPUTER_PRODUCTS 0x049bU // Curtis Computer Products +#define UHS_VID_ACER_ADVANCED_LABS 0x049cU // Acer Advanced Labs, Inc. +#define UHS_VID_VLSI_TECHNOLOGY 0x049dU // VLSI Technology +#define UHS_VID_COMPAQ_COMPUTER 0x049fU // Compaq Computer Corp. +#define UHS_VID_DIGITAL_EQUIPMENT 0x04a0U // Digital Equipment Corp. +#define UHS_VID_SYSTEMSOFT 0x04a1U // SystemSoft Corp. +#define UHS_VID_FIREPOWER_SYSTEMS 0x04a2U // FirePower Systems +#define UHS_VID_TRIDENT_MICROSYSTEMS 0x04a3U // Trident Microsystems, Inc. +#define UHS_VID_HITACHI_1 0x04a4U // Hitachi, Ltd +#define UHS_VID_ACER_PERIPHERALS_INC_NOW_BENQ 0x04a5U // Acer Peripherals Inc. (now BenQ Corp.) +#define UHS_VID_NOKIA_DISPLAY_PRODUCTS 0x04a6U // Nokia Display Products +#define UHS_VID_VISIONEER 0x04a7U // Visioneer +#define UHS_VID_MULTIVIDEO_LABS 0x04a8U // Multivideo Labs, Inc. +#define UHS_VID_CANON 0x04a9U // Canon, Inc. +#define UHS_VID_DAEWOO_TELECOM 0x04aaU // DaeWoo Telecom, Ltd +#define UHS_VID_CHROMATIC_RESEARCH 0x04abU // Chromatic Research +#define UHS_VID_MICRO_AUDIOMETRICS 0x04acU // Micro Audiometrics Corp. +#define UHS_VID_DOOIN_ELECTRONICS 0x04adU // Dooin Electronics +#define UHS_VID_WINNOV_LP 0x04afU // Winnov L.P. +#define UHS_VID_NIKON 0x04b0U // Nikon Corp. +#define UHS_VID_PAN_INTERNATIONAL 0x04b1U // Pan International +#define UHS_VID_IBM 0x04b3U // IBM Corp. +#define UHS_VID_CYPRESS_SEMICONDUCTOR 0x04b4U // Cypress Semiconductor Corp. +#define UHS_VID_ROHM_LSI_SYSTEMS_USA 0x04b5U // ROHM LSI Systems USA, LLC +#define UHS_VID_HINT 0x04b6U // Hint Corp. +#define UHS_VID_COMPAL_ELECTRONICS 0x04b7U // Compal Electronics, Inc. +#define UHS_VID_SEIKO_EPSON 0x04b8U // Seiko Epson Corp. +#define UHS_VID_RAINBOW_TECHNOLOGIES 0x04b9U // Rainbow Technologies, Inc. +#define UHS_VID_TOUCAN_SYSTEMS 0x04baU // Toucan Systems, Ltd +#define UHS_VID_I_O_DATA_DEVICE 0x04bbU // I-O Data Device, Inc. +#define UHS_VID_TOSHIBA_ELECTRONICS_TAIWAN 0x04bdU // Toshiba Electronics Taiwan Corp. +#define UHS_VID_TELIA_RESEARCH 0x04beU // Telia Research AB +#define UHS_VID_TDK 0x04bfU // TDK Corp. +#define UHS_VID_US_ROBOTICS_3COM 0x04c1U // U.S. Robotics (3Com) +#define UHS_VID_METHODE_ELECTRONICS_FAR_EAST_PTE 0x04c2U // Methode Electronics Far East PTE, Ltd +#define UHS_VID_MAXI_SWITCH 0x04c3U // Maxi Switch, Inc. +#define UHS_VID_LOCKHEED_MARTIN_ENERGY_RESEARCH 0x04c4U // Lockheed Martin Energy Research +#define UHS_VID_FUJITSU 0x04c5U // Fujitsu, Ltd +#define UHS_VID_TOSHIBA_AMERICA_ELECTRONIC_COMPONENTS 0x04c6U // Toshiba America Electronic Components +#define UHS_VID_MICRO_MACRO_TECHNOLOGIES 0x04c7U // Micro Macro Technologies +#define UHS_VID_KONICA 0x04c8U // Konica Corp. +#define UHS_VID_LITE_ON_TECHNOLOGY 0x04caU // Lite-On Technology Corp. +#define UHS_VID_FUJI_PHOTO_FILM 0x04cbU // Fuji Photo Film Co., Ltd +#define UHS_VID_ST_ERICSSON 0x04ccU // ST-Ericsson +#define UHS_VID_TATUNG_CO_OF_AMERICA 0x04cdU // Tatung Co. Of America +#define UHS_VID_SCANLOGIC 0x04ceU // ScanLogic Corp. +#define UHS_VID_MYSON_CENTURY 0x04cfU // Myson Century, Inc. +#define UHS_VID_DIGI_INTERNATIONAL 0x04d0U // Digi International +#define UHS_VID_ITT_CANON 0x04d1U // ITT Canon +#define UHS_VID_ALTEC_LANSING_TECHNOLOGIES 0x04d2U // Altec Lansing Technologies +#define UHS_VID_VIDUS 0x04d3U // VidUS, Inc. +#define UHS_VID_LSI_LOGIC 0x04d4U // LSI Logic, Inc. +#define UHS_VID_FORTE_TECHNOLOGIES 0x04d5U // Forte Technologies, Inc. +#define UHS_VID_MENTOR_GRAPHICS 0x04d6U // Mentor Graphics +#define UHS_VID_OKI_SEMICONDUCTOR 0x04d7U // Oki Semiconductor +#define UHS_VID_MICROCHIP_TECHNOLOGY 0x04d8U // Microchip Technology, Inc. +#define UHS_VID_HOLTEK_SEMICONDUCTOR 0x04d9U // Holtek Semiconductor, Inc. +#define UHS_VID_PANASONIC_MATSUSHITA 0x04daU // Panasonic (Matsushita) +#define UHS_VID_HYPERTEC_PTY 0x04dbU // Hypertec Pty, Ltd +#define UHS_VID_HUAN_HSIN_HOLDINGS 0x04dcU // Huan Hsin Holdings, Ltd +#define UHS_VID_SHARP 0x04ddU // Sharp Corp. +#define UHS_VID_MINDSHARE 0x04deU // MindShare, Inc. +#define UHS_VID_INTERLINK_ELECTRONICS 0x04dfU // Interlink Electronics +#define UHS_VID_IIYAMA_NORTH_AMERICA 0x04e1U // Iiyama North America, Inc. +#define UHS_VID_EXAR 0x04e2U // Exar Corp. +#define UHS_VID_ZILOG 0x04e3U // Zilog, Inc. +#define UHS_VID_ACC_MICROELECTRONICS 0x04e4U // ACC Microelectronics +#define UHS_VID_PROMISE_TECHNOLOGY 0x04e5U // Promise Technology +#define UHS_VID_SCM_MICROSYSTEMS 0x04e6U // SCM Microsystems, Inc. +#define UHS_VID_ELO_TOUCHSYSTEMS 0x04e7U // Elo TouchSystems +#define UHS_VID_SAMSUNG_ELECTRONICS 0x04e8U // Samsung Electronics Co., Ltd +#define UHS_VID_PC_TEL 0x04e9U // PC-Tel, Inc. +#define UHS_VID_BROOKTREE 0x04eaU // Brooktree Corp. +#define UHS_VID_NORTHSTAR_SYSTEMS 0x04ebU // Northstar Systems, Inc. +#define UHS_VID_TOKYO_ELECTRON_DEVICE 0x04ecU // Tokyo Electron Device, Ltd +#define UHS_VID_ANNABOOKS 0x04edU // Annabooks +#define UHS_VID_PACIFIC_ELECTRONIC_INTERNATIONAL 0x04efU // Pacific Electronic International, Inc. +#define UHS_VID_DAEWOO_ELECTRONICS 0x04f0U // Daewoo Electronics Co., Ltd +#define UHS_VID_VICTOR_COMPANY_OF_JAPAN 0x04f1U // Victor Company of Japan, Ltd +#define UHS_VID_CHICONY_ELECTRONICS_1 0x04f2U // Chicony Electronics Co., Ltd +#define UHS_VID_ELAN_MICROELECTRONICS 0x04f3U // Elan Microelectronics Corp. +#define UHS_VID_HARTING_ELEKTRONIK 0x04f4U // Harting Elektronik, Inc. +#define UHS_VID_FUJITSU_ICL_SYSTEMS 0x04f5U // Fujitsu-ICL Systems, Inc. +#define UHS_VID_NORAND 0x04f6U // Norand Corp. +#define UHS_VID_NEWNEX_TECHNOLOGY 0x04f7U // Newnex Technology Corp. +#define UHS_VID_FUTUREPLUS_SYSTEMS 0x04f8U // FuturePlus Systems +#define UHS_VID_BROTHER_INDUSTRIES 0x04f9U // Brother Industries, Ltd +#define UHS_VID_DALLAS_SEMICONDUCTOR 0x04faU // Dallas Semiconductor +#define UHS_VID_BIOSTAR_MICROTECH_INTERNATIONAL 0x04fbU // Biostar Microtech International Corp. +#define UHS_VID_SUNPLUS_TECHNOLOGY 0x04fcU // Sunplus Technology Co., Ltd +#define UHS_VID_SOLITON_SYSTEMS_KK 0x04fdU // Soliton Systems, K.K. +#define UHS_VID_PFU 0x04feU // PFU, Ltd +#define UHS_VID_E_CMOS 0x04ffU // E-CMOS Corp. +#define UHS_VID_SIAM_UNITED_HI_TECH 0x0500U // Siam United Hi-Tech +#define UHS_VID_FUJIKURA_DDK 0x0501U // Fujikura DDK, Ltd +#define UHS_VID_ACER_1 0x0502U // Acer, Inc. +#define UHS_VID_HITACHI_AMERICA 0x0503U // Hitachi America, Ltd +#define UHS_VID_HAYES_MICROCOMPUTER_PRODUCTS 0x0504U // Hayes Microcomputer Products +#define UHS_VID_3COM 0x0506U // 3Com Corp. +#define UHS_VID_HOSIDEN 0x0507U // Hosiden Corp. +#define UHS_VID_CLARION 0x0508U // Clarion Co., Ltd +#define UHS_VID_AZTECH_SYSTEMS 0x0509U // Aztech Systems, Ltd +#define UHS_VID_CINCH_CONNECTORS 0x050aU // Cinch Connectors +#define UHS_VID_CABLE_SYSTEM_INTERNATIONAL 0x050bU // Cable System International +#define UHS_VID_INNOMEDIA 0x050cU // InnoMedia, Inc. +#define UHS_VID_BELKIN_COMPONENTS 0x050dU // Belkin Components +#define UHS_VID_NEON_TECHNOLOGY 0x050eU // Neon Technology, Inc. +#define UHS_VID_KC_TECHNOLOGY 0x050fU // KC Technology, Inc. +#define UHS_VID_SEJIN_ELECTRON 0x0510U // Sejin Electron, Inc. +#define UHS_VID_NABLE_DATABOOK_TECHNOLOGIES 0x0511U // N'Able (DataBook) Technologies, Inc. +#define UHS_VID_HUALON_MICROELECTRONICS 0x0512U // Hualon Microelectronics Corp. +#define UHS_VID_DIGITAL_X 0x0513U // digital-X, Inc. +#define UHS_VID_FCI_ELECTRONICS 0x0514U // FCI Electronics +#define UHS_VID_ACTC 0x0515U // ACTC +#define UHS_VID_LONGWELL_ELECTRONICS 0x0516U // Longwell Electronics +#define UHS_VID_BUTTERFLY_COMMUNICATIONS 0x0517U // Butterfly Communications +#define UHS_VID_EZKEY 0x0518U // EzKEY Corp. +#define UHS_VID_STAR_MICRONICS 0x0519U // Star Micronics Co., Ltd +#define UHS_VID_WYSE_TECHNOLOGY 0x051aU // WYSE Technology +#define UHS_VID_SILICON_GRAPHICS 0x051bU // Silicon Graphics +#define UHS_VID_SHUTTLE 0x051cU // Shuttle, Inc. +#define UHS_VID_AMERICAN_POWER_CONVERSION 0x051dU // American Power Conversion +#define UHS_VID_SCIENTIFIC_ATLANTA 0x051eU // Scientific Atlanta, Inc. +#define UHS_VID_IO_SYSTEMS_ELITE_ELECTRONICS 0x051fU // IO Systems (Elite Electronics), Inc. +#define UHS_VID_TAIWAN_SEMICONDUCTOR_MANUFACTURING 0x0520U // Taiwan Semiconductor Manufacturing Co. +#define UHS_VID_AIRBORN_CONNECTORS 0x0521U // Airborn Connectors +#define UHS_VID_ADVANCED_CONNECTEK 0x0522U // Advanced Connectek, Inc. +#define UHS_VID_ATEN 0x0523U // ATEN GmbH +#define UHS_VID_SOLA_ELECTRONICS 0x0524U // Sola Electronics +#define UHS_VID_NETCHIP_TECHNOLOGY 0x0525U // Netchip Technology, Inc. +#define UHS_VID_TEMIC_MHS 0x0526U // Temic MHS S.A. +#define UHS_VID_ALTRA 0x0527U // ALTRA +#define UHS_VID_ATI_TECHNOLOGIES 0x0528U // ATI Technologies, Inc. +#define UHS_VID_ALADDIN_KNOWLEDGE_SYSTEMS 0x0529U // Aladdin Knowledge Systems +#define UHS_VID_CRESCENT_HEART_SOFTWARE 0x052aU // Crescent Heart Software +#define UHS_VID_TEKOM_TECHNOLOGIES 0x052bU // Tekom Technologies, Inc. +#define UHS_VID_CANON_INFORMATION_SYSTEMS 0x052cU // Canon Information Systems, Inc. +#define UHS_VID_AVID_ELECTRONICS 0x052dU // Avid Electronics Corp. +#define UHS_VID_STANDARD_MICROSYSTEMS_1 0x052eU // Standard Microsystems Corp. +#define UHS_VID_UNICORE_SOFTWARE 0x052fU // Unicore Software, Inc. +#define UHS_VID_AMERICAN_MICROSYSTEMS 0x0530U // American Microsystems, Inc. +#define UHS_VID_WACOM_TECHNOLOGY 0x0531U // Wacom Technology Corp. +#define UHS_VID_SYSTECH 0x0532U // Systech Corp. +#define UHS_VID_ALCATEL_MOBILE_PHONES 0x0533U // Alcatel Mobile Phones +#define UHS_VID_MOTOROLA 0x0534U // Motorola, Inc. +#define UHS_VID_LIH_TZU_ELECTRIC 0x0535U // LIH TZU Electric Co., Ltd +#define UHS_VID_HAND_HELD_PRODUCTS_WELCH_ALLYN 0x0536U // Hand Held Products (Welch Allyn, Inc.) +#define UHS_VID_INVENTEC 0x0537U // Inventec Corp. +#define UHS_VID_CALDERA_INTERNATIONAL_INC_SCO 0x0538U // Caldera International, Inc. (SCO) +#define UHS_VID_SHYH_SHIUN_TERMINALS 0x0539U // Shyh Shiun Terminals Co., Ltd +#define UHS_VID_PREHKEYTEC 0x053aU // PrehKeyTec GmbH +#define UHS_VID_GLOBAL_VILLAGE_COMMUNICATION 0x053bU // Global Village Communication +#define UHS_VID_INSTITUT_OF_MICROELECTRONIC_AND_MECHATRONIC_SYSTEMS 0x053cU // Institut of Microelectronic & Mechatronic Systems +#define UHS_VID_SILICON_ARCHITECT 0x053dU // Silicon Architect +#define UHS_VID_MOBILITY_ELECTRONICS 0x053eU // Mobility Electronics +#define UHS_VID_SYNOPSYS_1 0x053fU // Synopsys, Inc. +#define UHS_VID_UNIACCESS 0x0540U // UniAccess AB +#define UHS_VID_SIRF_TECHNOLOGY 0x0541U // Sirf Technology, Inc. +#define UHS_VID_VIEWSONIC 0x0543U // ViewSonic Corp. +#define UHS_VID_CRISTIE_ELECTRONICS 0x0544U // Cristie Electronics, Ltd +#define UHS_VID_XIRLINK 0x0545U // Xirlink, Inc. +#define UHS_VID_POLAROID 0x0546U // Polaroid Corp. +#define UHS_VID_ANCHOR_CHIPS 0x0547U // Anchor Chips, Inc. +#define UHS_VID_TYAN_COMPUTER 0x0548U // Tyan Computer Corp. +#define UHS_VID_PIXERA 0x0549U // Pixera Corp. +#define UHS_VID_FUJITSU_MICROELECTRONICS 0x054aU // Fujitsu Microelectronics, Inc. +#define UHS_VID_NEW_MEDIA 0x054bU // New Media Corp. +#define UHS_VID_SONY 0x054cU // Sony Corp. +#define UHS_VID_TRY 0x054dU // Try Corp. +#define UHS_VID_PROSIDE 0x054eU // Proside Corp. +#define UHS_VID_WYSE_TECHNOLOGY_TAIWAN 0x054fU // WYSE Technology Taiwan +#define UHS_VID_FUJI_XEROX 0x0550U // Fuji Xerox Co., Ltd +#define UHS_VID_COMPUTREND_SYSTEMS 0x0551U // CompuTrend Systems, Inc. +#define UHS_VID_PHILIPS_MONITORS 0x0552U // Philips Monitors +#define UHS_VID_STMICROELECTRONICS_IMAGING_DIVISION_VLSI_VISION 0x0553U // STMicroelectronics Imaging Division (VLSI Vision) +#define UHS_VID_DICTAPHONE 0x0554U // Dictaphone Corp. +#define UHS_VID_ANAM_SANDT 0x0555U // ANAM S&T Co., Ltd +#define UHS_VID_ASAHI_KASEI_MICROSYSTEMS 0x0556U // Asahi Kasei Microsystems Co., Ltd +#define UHS_VID_ATEN_INTERNATIONAL 0x0557U // ATEN International Co., Ltd +#define UHS_VID_TRUEVISION 0x0558U // Truevision, Inc. +#define UHS_VID_CADENCE_DESIGN_SYSTEMS 0x0559U // Cadence Design Systems, Inc. +#define UHS_VID_KENWOOD_USA 0x055aU // Kenwood USA +#define UHS_VID_KNOWLEDGETEK 0x055bU // KnowledgeTek, Inc. +#define UHS_VID_PROTON_ELECTRONIC_IND 0x055cU // Proton Electronic Ind. +#define UHS_VID_SAMSUNG_ELECTRO_MECHANICS 0x055dU // Samsung Electro-Mechanics Co. +#define UHS_VID_CTX_OPTO_ELECTRONICS 0x055eU // CTX Opto-Electronics Corp. +#define UHS_VID_MUSTEK_SYSTEMS 0x055fU // Mustek Systems, Inc. +#define UHS_VID_INTERFACE 0x0560U // Interface Corp. +#define UHS_VID_OASIS_DESIGN 0x0561U // Oasis Design, Inc. +#define UHS_VID_TELEX_COMMUNICATIONS 0x0562U // Telex Communications, Inc. +#define UHS_VID_IMMERSION 0x0563U // Immersion Corp. +#define UHS_VID_KODAK_DIGITAL_PRODUCT_CENTER_JAPAN_LTD_FORMERLY_CHINON_INDUSTRIES 0x0564U // Kodak Digital Product Center, Japan Ltd. (formerly Chinon Industries Inc.) +#define UHS_VID_PERACOM_NETWORKS 0x0565U // Peracom Networks, Inc. +#define UHS_VID_MONTEREY_INTERNATIONAL 0x0566U // Monterey International Corp. +#define UHS_VID_XYRATEX_INTERNATIONAL 0x0567U // Xyratex International, Ltd +#define UHS_VID_QUARTZ_INGENIERIE 0x0568U // Quartz Ingenierie +#define UHS_VID_SEGASOFT 0x0569U // SegaSoft +#define UHS_VID_WACOM 0x056aU // Wacom Co., Ltd +#define UHS_VID_DECICON 0x056bU // Decicon, Inc. +#define UHS_VID_ETEK_LABS 0x056cU // eTEK Labs +#define UHS_VID_EIZO 0x056dU // EIZO Corp. +#define UHS_VID_ELECOM 0x056eU // Elecom Co., Ltd +#define UHS_VID_KOREA_DATA_SYSTEMS 0x056fU // Korea Data Systems Co., Ltd +#define UHS_VID_EPSON_AMERICA 0x0570U // Epson America +#define UHS_VID_INTEREX 0x0571U // Interex, Inc. +#define UHS_VID_CONEXANT_SYSTEMS_ROCKWELL 0x0572U // Conexant Systems (Rockwell), Inc. +#define UHS_VID_ZORAN_CO_PERSONAL_MEDIA_DIVISION_NOGATECH 0x0573U // Zoran Co. Personal Media Division (Nogatech) +#define UHS_VID_CITY_UNIVERSITY_OF_HONG_KONG 0x0574U // City University of Hong Kong +#define UHS_VID_PHILIPS_CREATIVE_DISPLAY_SOLUTIONS 0x0575U // Philips Creative Display Solutions +#define UHS_VID_BAFOQUALITY_COMPUTER_ACCESSORIES 0x0576U // BAFO/Quality Computer Accessories +#define UHS_VID_ELSA 0x0577U // ELSA +#define UHS_VID_INTRINSIX 0x0578U // Intrinsix Corp. +#define UHS_VID_GVC 0x0579U // GVC Corp. +#define UHS_VID_SAMSUNG_ELECTRONICS_AMERICA 0x057aU // Samsung Electronics America +#define UHS_VID_Y_E_DATA 0x057bU // Y-E Data, Inc. +#define UHS_VID_AVM 0x057cU // AVM GmbH +#define UHS_VID_SHARK_MULTIMEDIA 0x057dU // Shark Multimedia, Inc. +#define UHS_VID_NINTENDO 0x057eU // Nintendo Co., Ltd +#define UHS_VID_QUICKSHOT 0x057fU // QuickShot, Ltd +#define UHS_VID_DENRON 0x0580U // Denron, Inc. +#define UHS_VID_RACAL_DATA_GROUP 0x0581U // Racal Data Group +#define UHS_VID_ROLAND 0x0582U // Roland Corp. +#define UHS_VID_PADIX_CO_LTD_ROCKFIRE 0x0583U // Padix Co., Ltd (Rockfire) +#define UHS_VID_RATOC_SYSTEM 0x0584U // RATOC System, Inc. +#define UHS_VID_FLASHPOINT_TECHNOLOGY 0x0585U // FlashPoint Technology, Inc. +#define UHS_VID_ZYXEL_COMMUNICATIONS 0x0586U // ZyXEL Communications Corp. +#define UHS_VID_AMERICA_KOTOBUKI_ELECTRONICS_INDUSTRIES 0x0587U // America Kotobuki Electronics Industries, Inc. +#define UHS_VID_SAPIEN_DESIGN 0x0588U // Sapien Design +#define UHS_VID_VICTRON 0x0589U // Victron +#define UHS_VID_NOHAU 0x058aU // Nohau Corp. +#define UHS_VID_INFINEON_TECHNOLOGIES 0x058bU // Infineon Technologies +#define UHS_VID_IN_FOCUS_SYSTEMS 0x058cU // In Focus Systems +#define UHS_VID_MICREL_SEMICONDUCTOR 0x058dU // Micrel Semiconductor +#define UHS_VID_TRIPATH_TECHNOLOGY 0x058eU // Tripath Technology, Inc. +#define UHS_VID_ALCOR_MICRO 0x058fU // Alcor Micro Corp. +#define UHS_VID_OMRON 0x0590U // Omron Corp. +#define UHS_VID_QUESTRA_CONSULTING 0x0591U // Questra Consulting +#define UHS_VID_POWERWARE 0x0592U // Powerware Corp. +#define UHS_VID_INCITE 0x0593U // Incite +#define UHS_VID_PRINCETON_GRAPHIC_SYSTEMS 0x0594U // Princeton Graphic Systems +#define UHS_VID_ZORAN_MICROELECTRONICS 0x0595U // Zoran Microelectronics, Ltd +#define UHS_VID_MICROTOUCH_SYSTEMS 0x0596U // MicroTouch Systems, Inc. +#define UHS_VID_TRISIGNAL_COMMUNICATIONS 0x0597U // Trisignal Communications +#define UHS_VID_NIIGATA_CANOTEC 0x0598U // Niigata Canotec Co., Inc. +#define UHS_VID_BRILLIANCE_SEMICONDUCTOR 0x0599U // Brilliance Semiconductor, Inc. +#define UHS_VID_SPECTRUM_SIGNAL_PROCESSING 0x059aU // Spectrum Signal Processing, Inc. +#define UHS_VID_IOMEGA 0x059bU // Iomega Corp. +#define UHS_VID_A_TREND_TECHNOLOGY 0x059cU // A-Trend Technology Co., Ltd +#define UHS_VID_ADVANCED_INPUT_DEVICES 0x059dU // Advanced Input Devices +#define UHS_VID_INTELLIGENT_INSTRUMENTATION 0x059eU // Intelligent Instrumentation +#define UHS_VID_LACIE 0x059fU // LaCie, Ltd +#define UHS_VID_VETRONIX 0x05a0U // Vetronix Corp. +#define UHS_VID_USC 0x05a1U // USC Corp. +#define UHS_VID_FUJI_FILM_MICRODEVICES 0x05a2U // Fuji Film Microdevices Co., Ltd +#define UHS_VID_ARC_INTERNATIONAL 0x05a3U // ARC International +#define UHS_VID_ORTEK_TECHNOLOGY 0x05a4U // Ortek Technology, Inc. +#define UHS_VID_SAMPO_TECHNOLOGY 0x05a5U // Sampo Technology Corp. +#define UHS_VID_CISCO_SYSTEMS 0x05a6U // Cisco Systems, Inc. +#define UHS_VID_BOSE 0x05a7U // Bose Corp. +#define UHS_VID_SPACETEC_IMC 0x05a8U // Spacetec IMC Corp. +#define UHS_VID_OMNIVISION_TECHNOLOGIES 0x05a9U // OmniVision Technologies, Inc. +#define UHS_VID_UTILUX_SOUTH_CHINA 0x05aaU // Utilux South China, Ltd +#define UHS_VID_IN_SYSTEM_DESIGN 0x05abU // In-System Design +#define UHS_VID_APPLE 0x05acU // Apple, Inc. +#define UHS_VID_YC_CABLE_USA 0x05adU // Y.C. Cable U.S.A., Inc. +#define UHS_VID_SYNOPSYS_2 0x05aeU // Synopsys, Inc. +#define UHS_VID_JING_MOLD_ENTERPRISE 0x05afU // Jing-Mold Enterprise Co., Ltd +#define UHS_VID_FOUNTAIN_TECHNOLOGIES 0x05b0U // Fountain Technologies, Inc. +#define UHS_VID_FIRST_INTERNATIONAL_COMPUTER 0x05b1U // First International Computer, Inc. +#define UHS_VID_LG_SEMICON 0x05b4U // LG Semicon Co., Ltd +#define UHS_VID_DIALOGIC 0x05b5U // Dialogic Corp. +#define UHS_VID_PROXIMA 0x05b6U // Proxima Corp. +#define UHS_VID_MEDIANIX_SEMICONDUCTOR 0x05b7U // Medianix Semiconductor, Inc. +#define UHS_VID_AGILER 0x05b8U // Agiler, Inc. +#define UHS_VID_PHILIPS_RESEARCH_LABORATORIES 0x05b9U // Philips Research Laboratories +#define UHS_VID_DIGITALPERSONA 0x05baU // DigitalPersona, Inc. +#define UHS_VID_GREY_CELL_SYSTEMS 0x05bbU // Grey Cell Systems +#define UHS_VID_3G_GREEN_GREEN_GLOBE 0x05bcU // 3G Green Green Globe Co., Ltd +#define UHS_VID_RAFI_GMBH_AND_CO_KG 0x05bdU // RAFI GmbH & Co. KG +#define UHS_VID_TYCO_ELECTRONICS_RAYCHEM 0x05beU // Tyco Electronics (Raychem) +#define UHS_VID_S_AND_S_RESEARCH 0x05bfU // S & S Research +#define UHS_VID_KEIL_SOFTWARE 0x05c0U // Keil Software +#define UHS_VID_KAWASAKI_MICROELECTRONICS 0x05c1U // Kawasaki Microelectronics, Inc. +#define UHS_VID_MEDIA_PHONICS_SUISSE 0x05c2U // Media Phonics (Suisse) S.A. +#define UHS_VID_DIGI_INTERNATIONAL_1 0x05c5U // Digi International, Inc. +#define UHS_VID_QUALCOMM 0x05c6U // Qualcomm, Inc. +#define UHS_VID_QTRONIX 0x05c7U // Qtronix Corp. +#define UHS_VID_CHENG_UEI_PRECISION_INDUSTRY_CO_LTD_FOXLINK 0x05c8U // Cheng Uei Precision Industry Co., Ltd (Foxlink) +#define UHS_VID_SEMTECH_1 0x05c9U // Semtech Corp. +#define UHS_VID_RICOH 0x05caU // Ricoh Co., Ltd +#define UHS_VID_POWERVISION_TECHNOLOGIES 0x05cbU // PowerVision Technologies, Inc. +#define UHS_VID_ELSA_AG 0x05ccU // ELSA AG +#define UHS_VID_SILICOM 0x05cdU // Silicom, Ltd +#define UHS_VID_SCI_WORX 0x05ceU // sci-worx GmbH +#define UHS_VID_SUNG_FORN 0x05cfU // Sung Forn Co., Ltd +#define UHS_VID_GE_MEDICAL_SYSTEMS_LUNAR 0x05d0U // GE Medical Systems Lunar +#define UHS_VID_BRAINBOXES 0x05d1U // Brainboxes, Ltd +#define UHS_VID_WAVE_SYSTEMS 0x05d2U // Wave Systems Corp. +#define UHS_VID_TOHOKU_RICOH 0x05d3U // Tohoku Ricoh Co., Ltd +#define UHS_VID_SUPER_GATE_TECHNOLOGY 0x05d5U // Super Gate Technology Co., Ltd +#define UHS_VID_PHILIPS_SEMICONDUCTORS_CICT 0x05d6U // Philips Semiconductors, CICT +#define UHS_VID_THOMAS_AND_BETTS 0x05d7U // Thomas & Betts Corp. +#define UHS_VID_ULTIMA_ELECTRONICS 0x05d8U // Ultima Electronics Corp. +#define UHS_VID_AXIOHM_TRANSACTION_SOLUTIONS 0x05d9U // Axiohm Transaction Solutions +#define UHS_VID_MICROTEK_INTERNATIONAL 0x05daU // Microtek International, Inc. +#define UHS_VID_SUN_CORP_SUNTAC_UNKNOWN 0x05dbU // Sun Corp. (Suntac?) +#define UHS_VID_LEXAR_MEDIA 0x05dcU // Lexar Media, Inc. +#define UHS_VID_DELTA_ELECTRONICS 0x05ddU // Delta Electronics, Inc. +#define UHS_VID_SILICON_VISION 0x05dfU // Silicon Vision, Inc. +#define UHS_VID_SYMBOL_TECHNOLOGIES 0x05e0U // Symbol Technologies +#define UHS_VID_SYNTEK_SEMICONDUCTOR 0x05e1U // Syntek Semiconductor Co., Ltd +#define UHS_VID_ELECVISION 0x05e2U // ElecVision, Inc. +#define UHS_VID_GENESYS_LOGIC 0x05e3U // Genesys Logic, Inc. +#define UHS_VID_RED_WING 0x05e4U // Red Wing Corp. +#define UHS_VID_FUJI_ELECTRIC 0x05e5U // Fuji Electric Co., Ltd +#define UHS_VID_KEITHLEY_INSTRUMENTS 0x05e6U // Keithley Instruments +#define UHS_VID_ICC 0x05e8U // ICC, Inc. +#define UHS_VID_KAWASAKI_LSI 0x05e9U // Kawasaki LSI +#define UHS_VID_FFC 0x05ebU // FFC, Ltd +#define UHS_VID_COM21 0x05ecU // COM21, Inc. +#define UHS_VID_CYTECHINFO 0x05eeU // Cytechinfo Inc. +#define UHS_VID_AVB_INC_ANKO_UNKNOWN_ 0x05efU // AVB, Inc. [anko?] +#define UHS_VID_CANOPUS 0x05f0U // Canopus Co., Ltd +#define UHS_VID_COMPASS_COMMUNICATIONS 0x05f1U // Compass Communications +#define UHS_VID_DEXIN 0x05f2U // Dexin Corp., Ltd +#define UHS_VID_PI_ENGINEERING 0x05f3U // PI Engineering, Inc. +#define UHS_VID_UNIXTAR_TECHNOLOGY 0x05f5U // Unixtar Technology, Inc. +#define UHS_VID_AOC_INTERNATIONAL 0x05f6U // AOC International +#define UHS_VID_RFC_DISTRIBUTIONS_PTE 0x05f7U // RFC Distribution(s) PTE, Ltd +#define UHS_VID_PSC_SCANNING 0x05f9U // PSC Scanning, Inc. +#define UHS_VID_SIEMENS_TELECOMMUNICATIONS_SYSTEMS 0x05faU // Siemens Telecommunications Systems, Ltd +#define UHS_VID_HARMAN 0x05fcU // Harman +#define UHS_VID_INTERACT 0x05fdU // InterAct, Inc. +#define UHS_VID_CHIC_TECHNOLOGY 0x05feU // Chic Technology Corp. +#define UHS_VID_LECROY 0x05ffU // LeCroy Corp. +#define UHS_VID_BARCO_DISPLAY_SYSTEMS 0x0600U // Barco Display Systems +#define UHS_VID_JAZZ_HIPSTER 0x0601U // Jazz Hipster Corp. +#define UHS_VID_VISTA_IMAGING 0x0602U // Vista Imaging, Inc. +#define UHS_VID_NOVATEK_MICROELECTRONICS 0x0603U // Novatek Microelectronics Corp. +#define UHS_VID_JEAN 0x0604U // Jean Co., Ltd +#define UHS_VID_ANCHOR_CANDC 0x0605U // Anchor C&C Co., Ltd +#define UHS_VID_ROYAL_INFORMATION_ELECTRONICS 0x0606U // Royal Information Electronics Co., Ltd +#define UHS_VID_BRIDGE_INFORMATION 0x0607U // Bridge Information Co., Ltd +#define UHS_VID_GENRAD_ADS 0x0608U // Genrad Ads +#define UHS_VID_SMK_MANUFACTURING 0x0609U // SMK Manufacturing, Inc. +#define UHS_VID_WORTHINGTON_DATA_SOLUTIONS 0x060aU // Worthington Data Solutions, Inc. +#define UHS_VID_SOLID_YEAR 0x060bU // Solid Year +#define UHS_VID_EEH_DATALINK 0x060cU // EEH Datalink GmbH +#define UHS_VID_AUCTOR 0x060dU // Auctor Corp. +#define UHS_VID_TRANSMONDE_TECHNOLOGIES 0x060eU // Transmonde Technologies, Inc. +#define UHS_VID_JOINSOON_ELECTRONICS_MFG 0x060fU // Joinsoon Electronics Mfg. Co., Ltd +#define UHS_VID_COSTAR_ELECTRONICS 0x0610U // Costar Electronics, Inc. +#define UHS_VID_TOTOKU_ELECTRIC 0x0611U // Totoku Electric Co., Ltd +#define UHS_VID_TRANSACT_TECHNOLOGIES 0x0613U // TransAct Technologies, Inc. +#define UHS_VID_BIO_RAD_LABORATORIES 0x0614U // Bio-Rad Laboratories +#define UHS_VID_QUABBIN_WIRE_AND_CABLE 0x0615U // Quabbin Wire & Cable Co., Inc. +#define UHS_VID_FUTURE_TECHNO_DESIGNS_PVT 0x0616U // Future Techno Designs PVT, Ltd +#define UHS_VID_SWISS_FEDERAL_INSITUTE_OF_TECHNOLOGY 0x0617U // Swiss Federal Insitute of Technology +#define UHS_VID_MACALLY 0x0618U // MacAlly +#define UHS_VID_SEIKO_INSTRUMENTS 0x0619U // Seiko Instruments, Inc. +#define UHS_VID_VERIDICOM_INTERNATIONAL 0x061aU // Veridicom International, Inc. +#define UHS_VID_PROMPTUS_COMMUNICATIONS 0x061bU // Promptus Communications, Inc. +#define UHS_VID_ACT_LABS 0x061cU // Act Labs, Ltd +#define UHS_VID_QUATECH 0x061dU // Quatech, Inc. +#define UHS_VID_NISSEI_ELECTRIC 0x061eU // Nissei Electric Co. +#define UHS_VID_ALARIS 0x0620U // Alaris, Inc. +#define UHS_VID_ODU_STECKVERBINDUNGSSYSTEME_GMBH_AND_CO_KG 0x0621U // ODU-Steckverbindungssysteme GmbH & Co. KG +#define UHS_VID_IOTECH 0x0622U // Iotech, Inc. +#define UHS_VID_LITTELFUSE 0x0623U // Littelfuse, Inc. +#define UHS_VID_AVOCENT 0x0624U // Avocent Corp. +#define UHS_VID_TIMEDIA_TECHNOLOGY 0x0625U // TiMedia Technology Co., Ltd +#define UHS_VID_NIPPON_SYSTEMS_DEVELOPMENT 0x0626U // Nippon Systems Development Co., Ltd +#define UHS_VID_ADOMAX_TECHNOLOGY 0x0627U // Adomax Technology Co., Ltd +#define UHS_VID_TASKING_SOFTWARE 0x0628U // Tasking Software, Inc. +#define UHS_VID_ZIDA_TECHNOLOGIES 0x0629U // Zida Technologies, Ltd +#define UHS_VID_CREATIVE_LABS 0x062aU // Creative Labs +#define UHS_VID_GREATLINK_ELECTRONICS_TAIWAN 0x062bU // Greatlink Electronics Taiwan, Ltd +#define UHS_VID_INSTITUTE_FOR_INFORMATION_INDUSTRY 0x062cU // Institute for Information Industry +#define UHS_VID_TAIWAN_TAI_HAO_ENTERPRISES 0x062dU // Taiwan Tai-Hao Enterprises Co., Ltd +#define UHS_VID_MAINSUPER_ENTERPRISES 0x062eU // Mainsuper Enterprises Co., Ltd +#define UHS_VID_SIN_SHENG_TERMINAL_AND_MACHINE 0x062fU // Sin Sheng Terminal & Machine, Inc. +#define UHS_VID_JUJO_ELECTRONICS 0x0631U // JUJO Electronics Corp. +#define UHS_VID_CYRIX 0x0633U // Cyrix Corp. +#define UHS_VID_MICRON_TECHNOLOGY 0x0634U // Micron Technology, Inc. +#define UHS_VID_METHODE_ELECTRONICS 0x0635U // Methode Electronics, Inc. +#define UHS_VID_SIERRA_IMAGING 0x0636U // Sierra Imaging, Inc. +#define UHS_VID_AVISION 0x0638U // Avision, Inc. +#define UHS_VID_CHRONTEL 0x0639U // Chrontel, Inc. +#define UHS_VID_TECHWIN 0x063aU // Techwin Corp. +#define UHS_VID_TAUGAGREINING_HF_1 0x063bU // Taugagreining HF +#define UHS_VID_YAMAICHI_ELECTRONICS_CO_LTD_SAKURA 0x063cU // Yamaichi Electronics Co., Ltd (Sakura) +#define UHS_VID_FONG_KAI_INDUSTRIAL 0x063dU // Fong Kai Industrial Co., Ltd +#define UHS_VID_REALMEDIA_TECHNOLOGY 0x063eU // RealMedia Technology, Inc. +#define UHS_VID_NEW_TECHNOLOGY_CABLE 0x063fU // New Technology Cable, Ltd +#define UHS_VID_HITEX_DEVELOPMENT_TOOLS 0x0640U // Hitex Development Tools +#define UHS_VID_WOODS_INDUSTRIES 0x0641U // Woods Industries, Inc. +#define UHS_VID_VIA_MEDICAL 0x0642U // VIA Medical Corp. +#define UHS_VID_TEAC 0x0644U // TEAC Corp. +#define UHS_VID_WHO_UNKNOWN_VISION_SYSTEMS 0x0645U // Who? Vision Systems, Inc. +#define UHS_VID_UMAX 0x0646U // UMAX +#define UHS_VID_ACTON_RESEARCH 0x0647U // Acton Research Corp. +#define UHS_VID_INSIDE_OUT_NETWORKS 0x0648U // Inside Out Networks +#define UHS_VID_WELI_SCIENCE 0x0649U // Weli Science Co., Ltd +#define UHS_VID_ANALOG_DEVICES_INC_WHITE_MOUNTAIN_DSP 0x064bU // Analog Devices, Inc. (White Mountain DSP) +#define UHS_VID_JI_HAW_INDUSTRIAL 0x064cU // Ji-Haw Industrial Co., Ltd +#define UHS_VID_TRITECH_MICROELECTRONICS 0x064dU // TriTech Microelectronics, Ltd +#define UHS_VID_SUYIN 0x064eU // Suyin Corp. +#define UHS_VID_WIBU_SYSTEMS_AG 0x064fU // WIBU-Systems AG +#define UHS_VID_DYNAPRO_SYSTEMS 0x0650U // Dynapro Systems +#define UHS_VID_LIKOM_TECHNOLOGY_SDN_BHD 0x0651U // Likom Technology Sdn. Bhd. +#define UHS_VID_STARGATE_SOLUTIONS 0x0652U // Stargate Solutions, Inc. +#define UHS_VID_CNF 0x0653U // CNF, Inc. +#define UHS_VID_GRANITE_MICROSYSTEMS 0x0654U // Granite Microsystems, Inc. +#define UHS_VID_SPACE_SHUTTLE_HI_TECH 0x0655U // Space Shuttle Hi-Tech Co., Ltd +#define UHS_VID_GLORY_MARK_ELECTRONIC 0x0656U // Glory Mark Electronic, Ltd +#define UHS_VID_TEKCON_ELECTRONICS 0x0657U // Tekcon Electronics Corp. +#define UHS_VID_SIGMA_DESIGNS 0x0658U // Sigma Designs, Inc. +#define UHS_VID_AETHRA 0x0659U // Aethra +#define UHS_VID_OPTOELECTRONICS 0x065aU // Optoelectronics Co., Ltd +#define UHS_VID_TRACEWELL_SYSTEMS 0x065bU // Tracewell Systems +#define UHS_VID_SILICON_GRAPHICS_1 0x065eU // Silicon Graphics +#define UHS_VID_GOOD_WAY_TECHNOLOGY_CO_LTD_AND_GWC_TECHNOLOGY 0x065fU // Good Way Technology Co., Ltd & GWC technology Inc. +#define UHS_VID_TSAY_E_BVI_INTERNATIONAL 0x0660U // TSAY-E (BVI) International, Inc. +#define UHS_VID_HAMAMATSU_PHOTONICS_KK 0x0661U // Hamamatsu Photonics K.K. +#define UHS_VID_KANSAI_ELECTRIC 0x0662U // Kansai Electric Co., Ltd +#define UHS_VID_TOPMAX_ELECTRONIC 0x0663U // Topmax Electronic Co., Ltd +#define UHS_VID_ETANDT_TECHNOLOGY 0x0664U // ET&T Technology Co., Ltd. +#define UHS_VID_CYPRESS_SEMICONDUCTOR_1 0x0665U // Cypress Semiconductor +#define UHS_VID_AIWA 0x0667U // Aiwa Co., Ltd +#define UHS_VID_WORDWAND 0x0668U // WordWand +#define UHS_VID_OCE_PRINTING_SYSTEMS 0x0669U // Oce' Printing Systems GmbH +#define UHS_VID_TOTAL_TECHNOLOGIES 0x066aU // Total Technologies, Ltd +#define UHS_VID_LINKSYS 0x066bU // Linksys, Inc. +#define UHS_VID_ENTREGA 0x066dU // Entrega, Inc. +#define UHS_VID_ACER_SEMICONDUCTOR_AMERICA 0x066eU // Acer Semiconductor America, Inc. +#define UHS_VID_SIGMATEL 0x066fU // SigmaTel, Inc. +#define UHS_VID_SEQUEL_IMAGING 0x0670U // Sequel Imaging +#define UHS_VID_LABTEC 0x0672U // Labtec, Inc. +#define UHS_VID_HCL 0x0673U // HCL +#define UHS_VID_KEY_MOUSE_ELECTRONIC_ENTERPRISE 0x0674U // Key Mouse Electronic Enterprise Co., Ltd +#define UHS_VID_DRAYTEK 0x0675U // DrayTek Corp. +#define UHS_VID_TELES_AG 0x0676U // Teles AG +#define UHS_VID_AIWA_1 0x0677U // Aiwa Co., Ltd +#define UHS_VID_ACARD_TECHNOLOGY 0x0678U // ACard Technology Corp. +#define UHS_VID_PROLIFIC_TECHNOLOGY 0x067bU // Prolific Technology, Inc. +#define UHS_VID_EFFICIENT_NETWORKS 0x067cU // Efficient Networks, Inc. +#define UHS_VID_HOHNER 0x067dU // Hohner Corp. +#define UHS_VID_INTERMEC_TECHNOLOGIES 0x067eU // Intermec Technologies Corp. +#define UHS_VID_VIRATA 0x067fU // Virata, Ltd +#define UHS_VID_REALTEK_SEMICONDUCTOR_CORP_CPP_DIV_AVANCE_LOGIC 0x0680U // Realtek Semiconductor Corp., CPP Div. (Avance Logic) +#define UHS_VID_SIEMENS_INFORMATION_AND_COMMUNICATION_PRODUCTS 0x0681U // Siemens Information and Communication Products +#define UHS_VID_VICTOR_COMPANY_OF_JAPAN_1 0x0682U // Victor Company of Japan, Ltd +#define UHS_VID_ACTIONTEC_ELECTRONICS 0x0684U // Actiontec Electronics, Inc. +#define UHS_VID_ZD_INCORPORATED 0x0685U // ZD Incorporated +#define UHS_VID_MINOLTA 0x0686U // Minolta Co., Ltd +#define UHS_VID_PERTECH 0x068aU // Pertech, Inc. +#define UHS_VID_POTRANS_INTERNATIONAL 0x068bU // Potrans International, Inc. +#define UHS_VID_CH_PRODUCTS 0x068eU // CH Products, Inc. +#define UHS_VID_GOLDEN_BRIDGE_ELECTECH 0x0690U // Golden Bridge Electech, Inc. +#define UHS_VID_HAGIWARA_SYS_COM 0x0693U // Hagiwara Sys-Com Co., Ltd +#define UHS_VID_LEGO_GROUP 0x0694U // Lego Group +#define UHS_VID_CHUNTEX_CTX 0x0698U // Chuntex (CTX) +#define UHS_VID_TEKTRONIX 0x0699U // Tektronix, Inc. +#define UHS_VID_ASKEY_COMPUTER 0x069aU // Askey Computer Corp. +#define UHS_VID_THOMSON 0x069bU // Thomson, Inc. +#define UHS_VID_HUGHES_NETWORK_SYSTEMS_HNS 0x069dU // Hughes Network Systems (HNS) +#define UHS_VID_WELCAT 0x069eU // Welcat Inc. +#define UHS_VID_ALLIED_DATA_TECHNOLOGIES_BV 0x069fU // Allied Data Technologies BV +#define UHS_VID_TOPRO_TECHNOLOGY 0x06a2U // Topro Technology, Inc. +#define UHS_VID_SAITEK_PLC 0x06a3U // Saitek PLC +#define UHS_VID_XIAMEN_DOOWELL_ELECTRON 0x06a4U // Xiamen Doowell Electron Co., Ltd +#define UHS_VID_DIVIO 0x06a5U // Divio +#define UHS_VID_MICROSTORE 0x06a7U // MicroStore, Inc. +#define UHS_VID_TOPAZ_SYSTEMS 0x06a8U // Topaz Systems, Inc. +#define UHS_VID_WESTELL 0x06a9U // Westell +#define UHS_VID_SYSGRATION 0x06aaU // Sysgration, Ltd +#define UHS_VID_FUJITSU_LABORATORIES_OF_AMERICA 0x06acU // Fujitsu Laboratories of America, Inc. +#define UHS_VID_GREATLAND_ELECTRONICS_TAIWAN 0x06adU // Greatland Electronics Taiwan, Ltd +#define UHS_VID_PROFESSIONAL_MULTIMEDIA_TESTING_CENTRE 0x06aeU // Professional Multimedia Testing Centre +#define UHS_VID_HARTING_INC_OF_NORTH_AMERICA 0x06afU // Harting, Inc. of North America +#define UHS_VID_PIXELA 0x06b8U // Pixela Corp. +#define UHS_VID_ALCATEL_TELECOM 0x06b9U // Alcatel Telecom +#define UHS_VID_SMOOTH_CORD_AND_CONNECTOR 0x06baU // Smooth Cord & Connector Co., Ltd +#define UHS_VID_EDA 0x06bbU // EDA, Inc. +#define UHS_VID_OKI_DATA 0x06bcU // Oki Data Corp. +#define UHS_VID_AGFA_GEVAERT_NV 0x06bdU // AGFA-Gevaert NV +#define UHS_VID_AME_OPTIMEDIA_TECHNOLOGY 0x06beU // AME Optimedia Technology Co., Ltd +#define UHS_VID_LEOCO 0x06bfU // Leoco Corp. +#define UHS_VID_PHIDGETS_INC_FORMERLY_GLAB 0x06c2U // Phidgets Inc. (formerly GLAB) +#define UHS_VID_BIZLINK_INTERNATIONAL 0x06c4U // Bizlink International Corp. +#define UHS_VID_HAGENUK 0x06c5U // Hagenuk, GmbH +#define UHS_VID_INFOWAVE_SOFTWARE 0x06c6U // Infowave Software, Inc. +#define UHS_VID_SIIG 0x06c8U // SIIG, Inc. +#define UHS_VID_TAXAN_EUROPE 0x06c9U // Taxan (Europe), Ltd +#define UHS_VID_NEWER_TECHNOLOGY 0x06caU // Newer Technology, Inc. +#define UHS_VID_SYNAPTICS 0x06cbU // Synaptics, Inc. +#define UHS_VID_TERAYON_COMMUNICATION_SYSTEMS 0x06ccU // Terayon Communication Systems +#define UHS_VID_KEYSPAN 0x06cdU // Keyspan +#define UHS_VID_CONTEC 0x06ceU // Contec +#define UHS_VID_SPHERONVR_AG 0x06cfU // SpheronVR AG +#define UHS_VID_LAPLINK 0x06d0U // LapLink, Inc. +#define UHS_VID_DAEWOO_ELECTRONICS_1 0x06d1U // Daewoo Electronics Co., Ltd +#define UHS_VID_MITSUBISHI_ELECTRIC 0x06d3U // Mitsubishi Electric Corp. +#define UHS_VID_CISCO_SYSTEMS_1 0x06d4U // Cisco Systems +#define UHS_VID_TOSHIBA 0x06d5U // Toshiba +#define UHS_VID_AASHIMA_TECHNOLOGY_BV 0x06d6U // Aashima Technology B.V. +#define UHS_VID_NETWORK_COMPUTING_DEVICES_NCD 0x06d7U // Network Computing Devices (NCD) +#define UHS_VID_TECHNICAL_MARKETING_RESEARCH 0x06d8U // Technical Marketing Research, Inc. +#define UHS_VID_PHOENIXTEC_POWER 0x06daU // Phoenixtec Power Co., Ltd +#define UHS_VID_PARADYNE 0x06dbU // Paradyne +#define UHS_VID_FOXLINK_IMAGE_TECHNOLOGY 0x06dcU // Foxlink Image Technology Co., Ltd +#define UHS_VID_HEISEI_ELECTRONICS 0x06deU // Heisei Electronics Co., Ltd +#define UHS_VID_MULTI_TECH_SYSTEMS 0x06e0U // Multi-Tech Systems, Inc. +#define UHS_VID_ADS_TECHNOLOGIES 0x06e1U // ADS Technologies, Inc. +#define UHS_VID_ALCATEL_MICROELECTRONICS 0x06e4U // Alcatel Microelectronics +#define UHS_VID_TIGER_JET_NETWORK 0x06e6U // Tiger Jet Network, Inc. +#define UHS_VID_SIRIUS_TECHNOLOGIES 0x06eaU // Sirius Technologies +#define UHS_VID_PC_EXPERT_TECH 0x06ebU // PC Expert Tech. Co., Ltd +#define UHS_VID_IAC_GEOMETRISCHE_INGENIEURS_BV 0x06efU // I.A.C. Geometrische Ingenieurs B.V. +#define UHS_VID_TNC_INDUSTRIAL 0x06f0U // T.N.C Industrial Co., Ltd +#define UHS_VID_OPCODE_SYSTEMS 0x06f1U // Opcode Systems, Inc. +#define UHS_VID_EMINE_TECHNOLOGY 0x06f2U // Emine Technology Co. +#define UHS_VID_WINTREND_TECHNOLOGY 0x06f6U // Wintrend Technology Co., Ltd +#define UHS_VID_WAILLY_TECHNOLOGY 0x06f7U // Wailly Technology Ltd +#define UHS_VID_GUILLEMOT 0x06f8U // Guillemot Corp. +#define UHS_VID_ASYST_ELECTRONIC_DOO 0x06f9U // ASYST electronic d.o.o. +#define UHS_VID_HSD_SRL 0x06faU // HSD S.r.L +#define UHS_VID_MOTOROLA_SEMICONDUCTOR_PRODUCTS_SECTOR 0x06fcU // Motorola Semiconductor Products Sector +#define UHS_VID_BOSTON_ACOUSTICS 0x06fdU // Boston Acoustics +#define UHS_VID_GALLANT_COMPUTER 0x06feU // Gallant Computer, Inc. +#define UHS_VID_SUPERCOMAL_WIRE_AND_CABLE_SDN_BHD 0x0701U // Supercomal Wire & Cable SDN. BHD. +#define UHS_VID_BVTECH_INDUSTRY 0x0703U // Bvtech Industry, Inc. +#define UHS_VID_NKK 0x0705U // NKK Corp. +#define UHS_VID_ARIEL 0x0706U // Ariel Corp. +#define UHS_VID_STANDARD_MICROSYSTEMS_2 0x0707U // Standard Microsystems Corp. +#define UHS_VID_PUTERCOM 0x0708U // Putercom Co., Ltd +#define UHS_VID_SILICON_SYSTEMS_LTD_SSL 0x0709U // Silicon Systems, Ltd (SSL) +#define UHS_VID_OKI_ELECTRIC_INDUSTRY 0x070aU // Oki Electric Industry Co., Ltd +#define UHS_VID_COMOSS_ELECTRONIC 0x070dU // Comoss Electronic Co., Ltd +#define UHS_VID_EXCEL_CELL_ELECTRONIC 0x070eU // Excel Cell Electronic Co., Ltd +#define UHS_VID_CONNECT_TECH 0x0710U // Connect Tech, Inc. +#define UHS_VID_MAGIC_CONTROL_TECHNOLOGY 0x0711U // Magic Control Technology Corp. +#define UHS_VID_INTERVAL_RESEARCH 0x0713U // Interval Research Corp. +#define UHS_VID_NEWMOTION 0x0714U // NewMotion, Inc. +#define UHS_VID_ZNK 0x0717U // ZNK Corp. +#define UHS_VID_IMATION 0x0718U // Imation Corp. +#define UHS_VID_TREMON_ENTERPRISES 0x0719U // Tremon Enterprises Co., Ltd +#define UHS_VID_DOMAIN_TECHNOLOGIES 0x071bU // Domain Technologies, Inc. +#define UHS_VID_XIONICS_DOCUMENT_TECHNOLOGIES 0x071cU // Xionics Document Technologies, Inc. +#define UHS_VID_EICON_NETWORKS 0x071dU // Eicon Networks Corp. +#define UHS_VID_ARISTON_TECHNOLOGIES 0x071eU // Ariston Technologies +#define UHS_VID_CENTILLIUM_COMMUNICATIONS 0x0723U // Centillium Communications Corp. +#define UHS_VID_VANGUARD_INTERNATIONAL_SEMICONDUCTOR_AMERICA 0x0726U // Vanguard International Semiconductor-America +#define UHS_VID_AMITM 0x0729U // Amitm +#define UHS_VID_SUNIX 0x072eU // Sunix Co., Ltd +#define UHS_VID_ADVANCED_CARD_SYSTEMS 0x072fU // Advanced Card Systems, Ltd +#define UHS_VID_SUSTEEN 0x0731U // Susteen, Inc. +#define UHS_VID_GOLDFULL_ELECTRONICS_AND_TELECOMMUNICATIONS 0x0732U // Goldfull Electronics & Telecommunications Corp. +#define UHS_VID_VIEWQUEST_TECHNOLOGIES 0x0733U // ViewQuest Technologies, Inc. +#define UHS_VID_LASAT_COMMUNICATIONS_AS 0x0734U // Lasat Communications A/S +#define UHS_VID_ASUSCOM_NETWORK 0x0735U // Asuscom Network +#define UHS_VID_LOROM_INDUSTRIAL 0x0736U // Lorom Industrial Co., Ltd +#define UHS_VID_MAD_CATZ 0x0738U // Mad Catz, Inc. +#define UHS_VID_CHAPLET_SYSTEMS 0x073aU // Chaplet Systems, Inc. +#define UHS_VID_SUNCOM_TECHNOLOGIES 0x073bU // Suncom Technologies +#define UHS_VID_INDUSTRIAL_ELECTRONIC_ENGINEERS 0x073cU // Industrial Electronic Engineers, Inc. +#define UHS_VID_EUTRON_SPA 0x073dU // Eutron S.p.a. +#define UHS_VID_NEC_1 0x073eU // NEC, Inc. +#define UHS_VID_STOLLMANN 0x0742U // Stollmann +#define UHS_VID_SYNTECH_INFORMATION 0x0745U // Syntech Information Co., Ltd +#define UHS_VID_ONKYO 0x0746U // Onkyo Corp. +#define UHS_VID_LABWAY 0x0747U // Labway Corp. +#define UHS_VID_STRONG_MAN_ENTERPRISE 0x0748U // Strong Man Enterprise Co., Ltd +#define UHS_VID_EVER_ELECTRONICS 0x0749U // EVer Electronics Corp. +#define UHS_VID_MING_FORTUNE_INDUSTRY 0x074aU // Ming Fortune Industry Co., Ltd +#define UHS_VID_POLESTAR_TECH 0x074bU // Polestar Tech. Corp. +#define UHS_VID_C_C_C_GROUP_PLC 0x074cU // C-C-C Group PLC +#define UHS_VID_MICRONAS 0x074dU // Micronas GmbH +#define UHS_VID_DIGITAL_STREAM 0x074eU // Digital Stream Corp. +#define UHS_VID_AUREAL_SEMICONDUCTOR 0x0755U // Aureal Semiconductor +#define UHS_VID_NETWORK_TECHNOLOGIES 0x0757U // Network Technologies, Inc. +#define UHS_VID_SOPHISTICATED_CIRCUITS 0x075bU // Sophisticated Circuits, Inc. +#define UHS_VID_MIDIMAN 0x0763U // Midiman +#define UHS_VID_CYBER_POWER_SYSTEM 0x0764U // Cyber Power System, Inc. +#define UHS_VID_X_RITE 0x0765U // X-Rite, Inc. +#define UHS_VID_JESS_LINK_PRODUCTS 0x0766U // Jess-Link Products Co., Ltd +#define UHS_VID_TOKHEIM 0x0767U // Tokheim Corp. +#define UHS_VID_CAMTEL_TECHNOLOGY 0x0768U // Camtel Technology Corp. +#define UHS_VID_SURECOM_TECHNOLOGY 0x0769U // Surecom Technology Corp. +#define UHS_VID_SMART_TECHNOLOGY_ENABLERS 0x076aU // Smart Technology Enablers, Inc. +#define UHS_VID_OMNIKEY_AG 0x076bU // OmniKey AG +#define UHS_VID_PARTNER_TECH 0x076cU // Partner Tech +#define UHS_VID_DENSO 0x076dU // Denso Corp. +#define UHS_VID_KUAN_TECH_ENTERPRISE 0x076eU // Kuan Tech Enterprise Co., Ltd +#define UHS_VID_JHEN_VEI_ELECTRONIC 0x076fU // Jhen Vei Electronic Co., Ltd +#define UHS_VID_WELCH_ALLYN_INC__MEDICAL_DIVISION 0x0770U // Welch Allyn, Inc - Medical Division +#define UHS_VID_OBSERVATOR_INSTRUMENTS_BV 0x0771U // Observator Instruments BV +#define UHS_VID_YOUR_DATA_OUR_CARE 0x0772U // Your data Our Care +#define UHS_VID_AMTRAN_TECHNOLOGY 0x0774U // AmTRAN Technology Co., Ltd +#define UHS_VID_LONGSHINE_ELECTRONICS 0x0775U // Longshine Electronics Corp. +#define UHS_VID_INALWAYS 0x0776U // Inalways Corp. +#define UHS_VID_COMDA_ENTERPRISE 0x0777U // Comda Enterprise Corp. +#define UHS_VID_VOLEX 0x0778U // Volex, Inc. +#define UHS_VID_FAIRCHILD_SEMICONDUCTOR 0x0779U // Fairchild Semiconductor +#define UHS_VID_SANKYO_SEIKI_MFG 0x077aU // Sankyo Seiki Mfg. Co., Ltd +#define UHS_VID_LINKSYS_1 0x077bU // Linksys +#define UHS_VID_FORWARD_ELECTRONICS 0x077cU // Forward Electronics Co., Ltd +#define UHS_VID_GRIFFIN_TECHNOLOGY 0x077dU // Griffin Technology +#define UHS_VID_WELL_EXCELLENT_AND_MOST 0x077fU // Well Excellent & Most Corp. +#define UHS_VID_SAGEM_MONETEL 0x0780U // Sagem Monetel GmbH +#define UHS_VID_SANDISK 0x0781U // SanDisk Corp. +#define UHS_VID_TRACKERBALL 0x0782U // Trackerball +#define UHS_VID_C3PO 0x0783U // C3PO +#define UHS_VID_VIVITAR 0x0784U // Vivitar, Inc. +#define UHS_VID_NTT_ME 0x0785U // NTT-ME +#define UHS_VID_LOGITEC 0x0789U // Logitec Corp. +#define UHS_VID_HAPP_CONTROLS 0x078bU // Happ Controls, Inc. +#define UHS_VID_GTCOCALCOMP 0x078cU // GTCO/CalComp +#define UHS_VID_BRINCOM 0x078eU // Brincom, Inc. +#define UHS_VID_PRO_IMAGE_MANUFACTURING 0x0790U // Pro-Image Manufacturing Co., Ltd +#define UHS_VID_COPARTNER_WIRE_AND_CABLE_MFG 0x0791U // Copartner Wire and Cable Mfg. Corp. +#define UHS_VID_AXIS_COMMUNICATIONS 0x0792U // Axis Communications AB +#define UHS_VID_WHA_YU_INDUSTRIAL 0x0793U // Wha Yu Industrial Co., Ltd +#define UHS_VID_ABL_ELECTRONICS 0x0794U // ABL Electronics Corp. +#define UHS_VID_REALCHIP 0x0795U // RealChip, Inc. +#define UHS_VID_CERTICOM 0x0796U // Certicom Corp. +#define UHS_VID_GRANDTECH_SEMICONDUCTOR 0x0797U // Grandtech Semiconductor Corp. +#define UHS_VID_OPTELEC 0x0798U // Optelec +#define UHS_VID_ALTERA 0x0799U // Altera +#define UHS_VID_SAGEM 0x079bU // Sagem +#define UHS_VID_ALFADATA_COMPUTER 0x079dU // Alfadata Computer Corp. +#define UHS_VID_DIGICOM_SPA 0x07a1U // Digicom S.p.A. +#define UHS_VID_NATIONAL_TECHNICAL_SYSTEMS 0x07a2U // National Technical Systems +#define UHS_VID_ONNTO 0x07a3U // Onnto Corp. +#define UHS_VID_BE 0x07a4U // Be, Inc. +#define UHS_VID_ADMTEK 0x07a6U // ADMtek, Inc. +#define UHS_VID_COREGA_KK 0x07aaU // Corega K.K. +#define UHS_VID_FREECOM_TECHNOLOGIES 0x07abU // Freecom Technologies +#define UHS_VID_MICROTECH 0x07afU // Microtech +#define UHS_VID_TRUST_TECHNOLOGIES 0x07b0U // Trust Technologies +#define UHS_VID_IMP 0x07b1U // IMP, Inc. +#define UHS_VID_MOTOROLA_BCS 0x07b2U // Motorola BCS, Inc. +#define UHS_VID_PLUSTEK 0x07b3U // Plustek, Inc. +#define UHS_VID_OLYMPUS_OPTICAL 0x07b4U // Olympus Optical Co., Ltd +#define UHS_VID_MEGA_WORLD_INTERNATIONAL 0x07b5U // Mega World International, Ltd +#define UHS_VID_MARUBUN 0x07b6U // Marubun Corp. +#define UHS_VID_TIME_INTERCONNECT 0x07b7U // TIME Interconnect, Ltd +#define UHS_VID_ABOCOM_SYSTEMS 0x07b8U // AboCom Systems Inc +#define UHS_VID_CANON_COMPUTER_SYSTEMS 0x07bcU // Canon Computer Systems, Inc. +#define UHS_VID_WEBGEAR 0x07bdU // Webgear, Inc. +#define UHS_VID_VERIDICOM 0x07beU // Veridicom +#define UHS_VID_CODE_MERCENARIES_HARD_UND_SOFTWARE 0x07c0U // Code Mercenaries Hard- und Software GmbH +#define UHS_VID_KEISOKUGIKEN 0x07c1U // Keisokugiken +#define UHS_VID_DATAFAB_SYSTEMS 0x07c4U // Datafab Systems, Inc. +#define UHS_VID_APG_CASH_DRAWER 0x07c5U // APG Cash Drawer +#define UHS_VID_SHAREWAVE 0x07c6U // ShareWave, Inc. +#define UHS_VID_POWERTECH_INDUSTRIAL 0x07c7U // Powertech Industrial Co., Ltd +#define UHS_VID_BUG 0x07c8U // B.U.G., Inc. +#define UHS_VID_ALLIED_TELESYN_INTERNATIONAL 0x07c9U // Allied Telesyn International +#define UHS_VID_AVERMEDIA_TECHNOLOGIES 0x07caU // AVerMedia Technologies, Inc. +#define UHS_VID_KINGMAX_TECHNOLOGY 0x07cbU // Kingmax Technology, Inc. +#define UHS_VID_CARRY_COMPUTER_ENG 0x07ccU // Carry Computer Eng., Co., Ltd +#define UHS_VID_ELEKTOR 0x07cdU // Elektor +#define UHS_VID_CASIO_COMPUTER 0x07cfU // Casio Computer Co., Ltd +#define UHS_VID_DAZZLE 0x07d0U // Dazzle +#define UHS_VID_D_LINK_SYSTEM 0x07d1U // D-Link System +#define UHS_VID_APTIO_PRODUCTS 0x07d2U // Aptio Products, Inc. +#define UHS_VID_CYBERDATA 0x07d3U // Cyberdata Corp. +#define UHS_VID_RADIANT_SYSTEMS 0x07d5U // Radiant Systems +#define UHS_VID_GCC_TECHNOLOGIES 0x07d7U // GCC Technologies, Inc. +#define UHS_VID_ARASAN_CHIP_SYSTEMS 0x07daU // Arasan Chip Systems +#define UHS_VID_DIAMOND_MULTIMEDIA 0x07deU // Diamond Multimedia +#define UHS_VID_DAVID_ELECTRONICS 0x07dfU // David Electronics Co., Ltd +#define UHS_VID_AMBIENT_TECHNOLOGIES 0x07e1U // Ambient Technologies, Inc. +#define UHS_VID_ELMEG_GMBH_AND 0x07e2U // Elmeg GmbH & Co., Ltd +#define UHS_VID_PLANEX_COMMUNICATIONS 0x07e3U // Planex Communications, Inc. +#define UHS_VID_MOVADO_ENTERPRISE 0x07e4U // Movado Enterprise Co., Ltd +#define UHS_VID_QPS 0x07e5U // QPS, Inc. +#define UHS_VID_ALLIED_CABLE 0x07e6U // Allied Cable Corp. +#define UHS_VID_MIRVO_TOYS 0x07e7U // Mirvo Toys, Inc. +#define UHS_VID_LABSYSTEMS 0x07e8U // Labsystems +#define UHS_VID_IWATSU_ELECTRIC 0x07eaU // Iwatsu Electric Co., Ltd +#define UHS_VID_DOUBLE_H_TECHNOLOGY 0x07ebU // Double-H Technology Co., Ltd +#define UHS_VID_TAIYO_ELECTRIC_WIRE_AND_CABLE 0x07ecU // Taiyo Electric Wire & Cable Co., Ltd +#define UHS_VID_TOREX_RETAIL_FORMERLY_LOGWARE 0x07eeU // Torex Retail (formerly Logware) +#define UHS_VID_STSN 0x07efU // STSN +#define UHS_VID_MICROCOMPUTER_APPLICATIONS 0x07f2U // Microcomputer Applications, Inc. +#define UHS_VID_CIRCUIT_ASSEMBLY 0x07f6U // Circuit Assembly Corp. +#define UHS_VID_CENTURY 0x07f7U // Century Corp. +#define UHS_VID_DOTOP_TECHNOLOGY 0x07f9U // Dotop Technology, Inc. +#define UHS_VID_DRAYTEK_1 0x07faU // DrayTek Corp. +#define UHS_VID_MARK_OF_THE_UNICORN 0x07fdU // Mark of the Unicorn +#define UHS_VID_UNKNOWN_2 0x07ffU // Unknown +#define UHS_VID_MAGTEK 0x0801U // MagTek +#define UHS_VID_MAKO_TECHNOLOGIES 0x0802U // Mako Technologies, LLC +#define UHS_VID_ZOOM_TELEPHONICS 0x0803U // Zoom Telephonics, Inc. +#define UHS_VID_GENICOM_TECHNOLOGY 0x0809U // Genicom Technology, Inc. +#define UHS_VID_EVERMUCH_TECHNOLOGY 0x080aU // Evermuch Technology Co., Ltd +#define UHS_VID_CROSS_MATCH_TECHNOLOGIES 0x080bU // Cross Match Technologies +#define UHS_VID_DATALOGIC_SPA 0x080cU // Datalogic S.p.A. +#define UHS_VID_TECO_IMAGE_SYSTEMS 0x080dU // Teco Image Systems Co., Ltd +#define UHS_VID_PERSONAL_COMMUNICATION_SYSTEMS 0x0810U // Personal Communication Systems, Inc. +#define UHS_VID_MATTEL 0x0813U // Mattel, Inc. +#define UHS_VID_ELICENSER 0x0819U // eLicenser +#define UHS_VID_MG_LOGIC 0x081aU // MG Logic +#define UHS_VID_INDIGITA 0x081bU // Indigita Corp. +#define UHS_VID_MIPSYS 0x081cU // Mipsys +#define UHS_VID_ALPHASMART 0x081eU // AlphaSmart, Inc. +#define UHS_VID_REUDO 0x0822U // Reudo Corp. +#define UHS_VID_GC_PROTRONICS 0x0825U // GC Protronics +#define UHS_VID_DATA_TRANSIT 0x0826U // Data Transit +#define UHS_VID_BROADLOGIC 0x0827U // BroadLogic, Inc. +#define UHS_VID_SATO 0x0828U // Sato Corp. +#define UHS_VID_DIRECTV_BROADBAND_INC_TELOCITY 0x0829U // DirecTV Broadband, Inc. (Telocity) +#define UHS_VID_HANDSPRING 0x082dU // Handspring +#define UHS_VID_PALM 0x0830U // Palm, Inc. +#define UHS_VID_KOUWELL_ELECTRONICS 0x0832U // Kouwell Electronics Corp. +#define UHS_VID_SOURCENEXT 0x0833U // Sourcenext Corp. +#define UHS_VID_ACTION_STAR_ENTERPRISE 0x0835U // Action Star Enterprise Co., Ltd +#define UHS_VID_TREKSTOR 0x0836U // TrekStor +#define UHS_VID_SAMSUNG_TECHWIN 0x0839U // Samsung Techwin Co., Ltd +#define UHS_VID_ACCTON_TECHNOLOGY 0x083aU // Accton Technology Corp. +#define UHS_VID_GLOBAL_VILLAGE 0x083fU // Global Village +#define UHS_VID_ARGOSY_RESEARCH 0x0840U // Argosy Research, Inc. +#define UHS_VID_RIOPORTCOM 0x0841U // Rioport.com, Inc. +#define UHS_VID_WELLAND_INDUSTRIAL 0x0844U // Welland Industrial Co., Ltd +#define UHS_VID_NETGEAR 0x0846U // NetGear, Inc. +#define UHS_VID_MINTON_OPTIC_INDUSTRY 0x084dU // Minton Optic Industry Co., Inc. +#define UHS_VID_KB_GEAR 0x084eU // KB Gear +#define UHS_VID_EMPEG 0x084fU // Empeg +#define UHS_VID_FAST_POINT_TECHNOLOGIES 0x0850U // Fast Point Technologies, Inc. +#define UHS_VID_MACRONIX_INTERNATIONAL 0x0851U // Macronix International Co., Ltd +#define UHS_VID_CSEM 0x0852U // CSEM +#define UHS_VID_TOPRE_CORPORATION 0x0853U // Topre Corporation +#define UHS_VID_ACTIVEWIRE 0x0854U // ActiveWire, Inc. +#define UHS_VID_BANDB_ELECTRONICS 0x0856U // B&B Electronics +#define UHS_VID_HITACHI_MAXELL 0x0858U // Hitachi Maxell, Ltd +#define UHS_VID_MINOLTA_SYSTEMS_LABORATORY 0x0859U // Minolta Systems Laboratory, Inc. +#define UHS_VID_XIRCOM 0x085aU // Xircom +#define UHS_VID_COLORVISION 0x085cU // ColorVision, Inc. +#define UHS_VID_TELETROL_SYSTEMS 0x0862U // Teletrol Systems, Inc. +#define UHS_VID_FILANET 0x0863U // Filanet Corp. +#define UHS_VID_NETGEAR_1 0x0864U // NetGear, Inc. +#define UHS_VID_DATA_TRANSLATION 0x0867U // Data Translation, Inc. +#define UHS_VID_EMAGIC_SOFT_UND_HARDWARE 0x086aU // Emagic Soft- und Hardware GmbH +#define UHS_VID_DETEWE__DEUTSCHE_TELEPHONWERKE_AG_AND 0x086cU // DeTeWe - Deutsche Telephonwerke AG & Co. +#define UHS_VID_SYSTEM_TALKS 0x086eU // System TALKS, Inc. +#define UHS_VID_MEC_IMEX 0x086fU // MEC IMEX, Inc. +#define UHS_VID_METRICOM 0x0870U // Metricom +#define UHS_VID_SANDISK_1 0x0871U // SanDisk, Inc. +#define UHS_VID_XPEED 0x0873U // Xpeed, Inc. +#define UHS_VID_A_TEC_SUBSYSTEM 0x0874U // A-Tec Subsystem, Inc. +#define UHS_VID_COMTROL 0x0879U // Comtrol Corp. +#define UHS_VID_ADESSOKBTEK_AMERICA 0x087cU // Adesso/Kbtek America, Inc. +#define UHS_VID_JATON 0x087dU // Jaton Corp. +#define UHS_VID_FUJITSU_COMPUTER_PRODUCTS_OF_AMERICA 0x087eU // Fujitsu Computer Products of America +#define UHS_VID_QUALCORE_LOGIC 0x087fU // QualCore Logic Inc. +#define UHS_VID_APT_TECHNOLOGIES 0x0880U // APT Technologies, Inc. +#define UHS_VID_RECORDING_INDUSTRY_ASSOCIATION_OF_AMERICA_RIAA 0x0883U // Recording Industry Association of America (RIAA) +#define UHS_VID_BOCA_RESEARCH 0x0885U // Boca Research, Inc. +#define UHS_VID_XAC_AUTOMATION 0x0886U // XAC Automation Corp. +#define UHS_VID_HANNSTAR_ELECTRONICS 0x0887U // Hannstar Electronics Corp. +#define UHS_VID_TECHTOOLS 0x088aU // TechTools +#define UHS_VID_MASSWORKS 0x088bU // MassWorks, Inc. +#define UHS_VID_SWECOIN 0x088cU // Swecoin AB +#define UHS_VID_ILOK 0x088eU // iLok +#define UHS_VID_DIOGRAPHY 0x0892U // DioGraphy, Inc. +#define UHS_VID_TSI_INCORPORATED 0x0894U // TSI Incorporated +#define UHS_VID_LAUTERBACH 0x0897U // Lauterbach +#define UHS_VID_UNITED_TECHNOLOGIES_RESEARCH_CNTR 0x089cU // United Technologies Research Cntr. +#define UHS_VID_ICRON_TECHNOLOGIES 0x089dU // Icron Technologies Corp. +#define UHS_VID_NST 0x089eU // NST Co., Ltd +#define UHS_VID_PRIMEX_AEROSPACE 0x089fU // Primex Aerospace Co. +#define UHS_VID_E9 0x08a5U // e9, Inc. +#define UHS_VID_TOSHIBA_TEC 0x08a6U // Toshiba TEC +#define UHS_VID_ANDREA_ELECTRONICS 0x08a8U // Andrea Electronics +#define UHS_VID_CWAV 0x08a9U // CWAV Inc. +#define UHS_VID_MACRAIGOR_SYSTEMS 0x08acU // Macraigor Systems LLC +#define UHS_VID_MACALLY_MACE_GROUP 0x08aeU // Macally (Mace Group, Inc.) +#define UHS_VID_METROHM 0x08b0U // Metrohm +#define UHS_VID_SORENSON_VISION 0x08b4U // Sorenson Vision, Inc. +#define UHS_VID_NATSU 0x08b7U // NATSU +#define UHS_VID_J_GORDON_ELECTRONIC_DESIGN 0x08b8U // J. Gordon Electronic Design, Inc. +#define UHS_VID_RADIOSHACK_CORP_TANDY 0x08b9U // RadioShack Corp. (Tandy) +#define UHS_VID_TEXAS_INSTRUMENTS_1 0x08bbU // Texas Instruments +#define UHS_VID_CITIZEN_WATCH 0x08bdU // Citizen Watch Co., Ltd +#define UHS_VID_PRECISE_BIOMETRICS 0x08c3U // Precise Biometrics +#define UHS_VID_PROXIM 0x08c4U // Proxim, Inc. +#define UHS_VID_KEY_NICE_ENTERPRISE 0x08c7U // Key Nice Enterprise Co., Ltd +#define UHS_VID_2WIRE 0x08c8U // 2Wire, Inc. +#define UHS_VID_NIPPON_TELEGRAPH_AND_TELEPHONE 0x08c9U // Nippon Telegraph and Telephone Corp. +#define UHS_VID_AIPTEK_INTERNATIONAL 0x08caU // Aiptek International, Inc. +#define UHS_VID_JUE_HSUN_IND 0x08cdU // Jue Hsun Ind. Corp. +#define UHS_VID_LONG_WELL_ELECTRONICS 0x08ceU // Long Well Electronics Corp. +#define UHS_VID_PRODUCTIVITY_ENHANCEMENT_PRODUCTS 0x08cfU // Productivity Enhancement Products +#define UHS_VID_SMARTBRIDGES 0x08d1U // smartBridges, Inc. +#define UHS_VID_VIRTUAL_INK 0x08d3U // Virtual Ink +#define UHS_VID_FUJITSU_SIEMENS_COMPUTERS 0x08d4U // Fujitsu Siemens Computers +#define UHS_VID_IXXAT_AUTOMATION 0x08d8U // IXXAT Automation GmbH +#define UHS_VID_INCREMENT_P 0x08d9U // Increment P Corp. +#define UHS_VID_BILLIONTON_SYSTEMS 0x08ddU // Billionton Systems, Inc. +#define UHS_VID__UNKNOWN 0x08deU // ? +#define UHS_VID_SPYRUS 0x08dfU // Spyrus, Inc. +#define UHS_VID_OLITEC 0x08e3U // Olitec, Inc. +#define UHS_VID_PIONEER 0x08e4U // Pioneer Corp. +#define UHS_VID_LITRONIC 0x08e5U // Litronic +#define UHS_VID_GEMALTO_WAS_GEMPLUS 0x08e6U // Gemalto (was Gemplus) +#define UHS_VID_PAN_INTERNATIONAL_WIRE_AND_CABLE 0x08e7U // Pan-International Wire & Cable +#define UHS_VID_INTEGRATED_MEMORY_LOGIC 0x08e8U // Integrated Memory Logic +#define UHS_VID_EXTENDED_SYSTEMS 0x08e9U // Extended Systems, Inc. +#define UHS_VID_ERICSSON_INC_BLUE_RIDGE_LABS 0x08eaU // Ericsson, Inc., Blue Ridge Labs +#define UHS_VID_M_SYSTEMS_FLASH_DISK_PIONEERS 0x08ecU // M-Systems Flash Disk Pioneers +#define UHS_VID_MEDIATEK 0x08edU // MediaTek Inc. +#define UHS_VID_CCSIHESSO 0x08eeU // CCSI/Hesso +#define UHS_VID_COREX_TECHNOLOGIES 0x08f0U // Corex Technologies +#define UHS_VID_CTI_ELECTRONICS 0x08f1U // CTI Electronics Corp. +#define UHS_VID_GOTOP_INFORMATION 0x08f2U // Gotop Information Inc. +#define UHS_VID_SYSTEC 0x08f5U // SysTec Co., Ltd +#define UHS_VID_LOGIC_3_INTERNATIONAL 0x08f6U // Logic 3 International, Ltd +#define UHS_VID_VERNIER 0x08f7U // Vernier +#define UHS_VID_KEEN_TOP_INTERNATIONAL_ENTERPRISE 0x08f8U // Keen Top International Enterprise Co., Ltd +#define UHS_VID_WIPRO_TECHNOLOGIES 0x08f9U // Wipro Technologies +#define UHS_VID_CAERE 0x08faU // Caere +#define UHS_VID_SOCKET_COMMUNICATIONS 0x08fbU // Socket Communications +#define UHS_VID_SICON_CABLE_TECHNOLOGY 0x08fcU // Sicon Cable Technology Co., Ltd +#define UHS_VID_DIGIANSWER_AS 0x08fdU // Digianswer A/S +#define UHS_VID_AUTHENTEC 0x08ffU // AuthenTec, Inc. +#define UHS_VID_PINNACLE_SYSTEMS 0x0900U // Pinnacle Systems, Inc. +#define UHS_VID_VST_TECHNOLOGIES 0x0901U // VST Technologies +#define UHS_VID_FARADAY_TECHNOLOGY 0x0906U // Faraday Technology Corp. +#define UHS_VID_SIEMENS_AG 0x0908U // Siemens AG +#define UHS_VID_AUDIO_TECHNICA 0x0909U // Audio-Technica Corp. +#define UHS_VID_TRUMPION_MICROELECTRONICS 0x090aU // Trumpion Microelectronics, Inc. +#define UHS_VID_NEUROSMITH 0x090bU // Neurosmith +#define UHS_VID_SILICON_MOTION_INC__TAIWAN_FORMERLY_FEIYA_TECHNOLOGY 0x090cU // Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) +#define UHS_VID_MULTIPORT_COMPUTER_VERTRIEBS 0x090dU // Multiport Computer Vertriebs GmbH +#define UHS_VID_SHINING_TECHNOLOGY 0x090eU // Shining Technology, Inc. +#define UHS_VID_FUJITSU_DEVICES 0x090fU // Fujitsu Devices, Inc. +#define UHS_VID_ALATION_SYSTEMS 0x0910U // Alation Systems, Inc. +#define UHS_VID_PHILIPS_SPEECH_PROCESSING 0x0911U // Philips Speech Processing +#define UHS_VID_VOQUETTE 0x0912U // Voquette, Inc. +#define UHS_VID_GLOBESPAN 0x0915U // GlobeSpan, Inc. +#define UHS_VID_SMARTDISK 0x0917U // SmartDisk Corp. +#define UHS_VID_TIGER_ELECTRONICS 0x0919U // Tiger Electronics +#define UHS_VID_GARMIN_INTERNATIONAL 0x091eU // Garmin International +#define UHS_VID_ECHELON 0x0920U // Echelon Co. +#define UHS_VID_GOHUBS 0x0921U // GoHubs, Inc. +#define UHS_VID_DYMO_COSTAR 0x0922U // Dymo-CoStar Corp. +#define UHS_VID_IC_MEDIA 0x0923U // IC Media Corp. +#define UHS_VID_XEROX 0x0924U // Xerox +#define UHS_VID_LAKEVIEW_RESEARCH 0x0925U // Lakeview Research +#define UHS_VID_SUMMUS 0x0927U // Summus, Ltd +#define UHS_VID_PLX_TECHNOLOGY_INC_FORMERLY_OXFORD_SEMICONDUCTOR 0x0928U // PLX Technology, Inc. (formerly Oxford Semiconductor, Ltd) +#define UHS_VID_AMERICAN_BIOMETRIC 0x0929U // American Biometric Co. +#define UHS_VID_TOSHIBA_INFORMATION_AND_INDUSTRIAL_SYS_AND_SERVICES 0x092aU // Toshiba Information & Industrial Sys. And Services +#define UHS_VID_SENA_TECHNOLOGIES 0x092bU // Sena Technologies, Inc. +#define UHS_VID_NORTHERN_EMBEDDED_SCIENCECAVNEX 0x092fU // Northern Embedded Science/CAVNEX +#define UHS_VID_TOSHIBA_1 0x0930U // Toshiba Corp. +#define UHS_VID_HARMONIC_DATA_SYSTEMS 0x0931U // Harmonic Data Systems, Ltd +#define UHS_VID_CRESCENTEC 0x0932U // Crescentec Corp. +#define UHS_VID_QUANTUM 0x0933U // Quantum Corp. +#define UHS_VID_SPIRENT_COMMUNICATIONS 0x0934U // Spirent Communications +#define UHS_VID_NUTESLA 0x0936U // NuTesla +#define UHS_VID_LUMBERG 0x0939U // Lumberg, Inc. +#define UHS_VID_PIXART_IMAGING 0x093aU // Pixart Imaging, Inc. +#define UHS_VID_PLEXTOR 0x093bU // Plextor Corp. +#define UHS_VID_INTREPID_CONTROL_SYSTEMS 0x093cU // Intrepid Control Systems, Inc. +#define UHS_VID_INNOSYNC 0x093dU // InnoSync, Inc. +#define UHS_VID_JST_MFG 0x093eU // J.S.T. Mfg. Co., Ltd +#define UHS_VID_OLYMPIA_TELECOM_VERTRIEBS 0x093fU // Olympia Telecom Vertriebs GmbH +#define UHS_VID_JAPAN_STORAGE_BATTERY 0x0940U // Japan Storage Battery Co., Ltd +#define UHS_VID_PHOTOBIT 0x0941U // Photobit Corp. +#define UHS_VID_I2GOCOM 0x0942U // i2Go.com, LLC +#define UHS_VID_HCL_TECHNOLOGIES_INDIA_PRIVATE 0x0943U // HCL Technologies India Private, Ltd +#define UHS_VID_KORG 0x0944U // KORG, Inc. +#define UHS_VID_PASCO_SCIENTIFIC 0x0945U // Pasco Scientific +#define UHS_VID_KRONAUER_MUSIC_IN_DIGITAL 0x0948U // Kronauer music in digital +#define UHS_VID_LINKUP_SYSTEMS 0x094bU // Linkup Systems Corp. +#define UHS_VID_CABLE_TELEVISION_LABORATORIES 0x094dU // Cable Television Laboratories +#define UHS_VID_YANO 0x094fU // Yano +#define UHS_VID_KINGSTON_TECHNOLOGY 0x0951U // Kingston Technology +#define UHS_VID_RPM_SYSTEMS 0x0954U // RPM Systems Corp. +#define UHS_VID_NVIDIA 0x0955U // NVidia Corp. +#define UHS_VID_BSQUARE 0x0956U // BSquare Corp. +#define UHS_VID_AGILENT_TECHNOLOGIES 0x0957U // Agilent Technologies, Inc. +#define UHS_VID_COMPULINK_RESEARCH 0x0958U // CompuLink Research, Inc. +#define UHS_VID_COLOGNE_CHIP_AG 0x0959U // Cologne Chip AG +#define UHS_VID_PORTSMITH 0x095aU // Portsmith +#define UHS_VID_MEDIALOGIC 0x095bU // Medialogic Corp. +#define UHS_VID_K_TEC_ELECTRONICS 0x095cU // K-Tec Electronics +#define UHS_VID_POLYCOM 0x095dU // Polycom, Inc. +#define UHS_VID_ACER_NEWEB 0x0967U // Acer NeWeb Corp. +#define UHS_VID_CATALYST_ENTERPRISES 0x0968U // Catalyst Enterprises, Inc. +#define UHS_VID_FEITIAN_TECHNOLOGIES 0x096eU // Feitian Technologies, Inc. +#define UHS_VID_GRETAG_MACBETH_AG 0x0971U // Gretag-Macbeth AG +#define UHS_VID_SCHLUMBERGER 0x0973U // Schlumberger +#define UHS_VID_DATAGRAPHIX_A_BUSINESS_UNIT_OF_ANACOMP 0x0974U // Datagraphix, a business unit of Anacomp +#define UHS_VID_OLE_COMMUNICATIONS 0x0975U // OL'E Communications, Inc. +#define UHS_VID_ADIRONDACK_WIRE_AND_CABLE 0x0976U // Adirondack Wire & Cable +#define UHS_VID_LIGHTSURF_TECHNOLOGIES 0x0977U // Lightsurf Technologies +#define UHS_VID_BECKHOFF 0x0978U // Beckhoff GmbH +#define UHS_VID_JEILIN_TECHNOLOGY 0x0979U // Jeilin Technology Corp., Ltd +#define UHS_VID_MINDS_AT_WORK 0x097aU // Minds At Work LLC +#define UHS_VID_KNUDSEN_ENGINEERING 0x097bU // Knudsen Engineering, Ltd +#define UHS_VID_MARUNIX 0x097cU // Marunix Co., Ltd +#define UHS_VID_ROSUN_TECHNOLOGIES 0x097dU // Rosun Technologies, Inc. +#define UHS_VID_BIOPAC_SYSTEMS 0x097eU // Biopac Systems Inc. +#define UHS_VID_BARUN_ELECTRONICS 0x097fU // Barun Electronics Co., Ltd +#define UHS_VID_OAK_TECHNOLOGY_1 0x0981U // Oak Technology, Ltd +#define UHS_VID_APRICORN 0x0984U // Apricorn +#define UHS_VID_CAB_PRODUKTTECHNIK_GMBH_AND_CO_KG 0x0985U // cab Produkttechnik GmbH & Co KG +#define UHS_VID_MATSUSHITA_ELECTRIC_WORKS 0x0986U // Matsushita Electric Works, Ltd. +#define UHS_VID_VITANA 0x098cU // Vitana Corp. +#define UHS_VID_INDESIGN 0x098dU // INDesign +#define UHS_VID_INTEGRATED_INTELLECTUAL_PROPERTY 0x098eU // Integrated Intellectual Property, Inc. +#define UHS_VID_KENWOOD_TMI 0x098fU // Kenwood TMI Corp. +#define UHS_VID_GEMSTAR_EBOOK_GROUP 0x0993U // Gemstar eBook Group, Ltd +#define UHS_VID_INTEGRATED_TELECOM_EXPRESS 0x0996U // Integrated Telecom Express, Inc. +#define UHS_VID_ZIPPY_TECHNOLOGY 0x099aU // Zippy Technology Corp. +#define UHS_VID_PAIRGAIN_TECHNOLOGIES 0x09a3U // PairGain Technologies +#define UHS_VID_CONTECH_RESEARCH 0x09a4U // Contech Research, Inc. +#define UHS_VID_VCON_TELECOMMUNICATIONS 0x09a5U // VCON Telecommunications +#define UHS_VID_POINCHIPS 0x09a6U // Poinchips +#define UHS_VID_DATA_TRANSMISSION_NETWORK 0x09a7U // Data Transmission Network Corp. +#define UHS_VID_LIN_SHIUNG_ENTERPRISE 0x09a8U // Lin Shiung Enterprise Co., Ltd +#define UHS_VID_SMART_CARD_TECHNOLOGIES 0x09a9U // Smart Card Technologies Co., Ltd +#define UHS_VID_INTERSIL 0x09aaU // Intersil Corp. +#define UHS_VID_JAPAN_CASH_MACHINE 0x09abU // Japan Cash Machine Co., Ltd. +#define UHS_VID_TRIPP_LITE 0x09aeU // Tripp Lite +#define UHS_VID_FRANKLIN_ELECTRONIC_PUBLISHERS 0x09b2U // Franklin Electronic Publishers, Inc. +#define UHS_VID_ALTIUS_SOLUTIONS 0x09b3U // Altius Solutions, Inc. +#define UHS_VID_MDS_TELEPHONE_SYSTEMS 0x09b4U // MDS Telephone Systems +#define UHS_VID_CELLTRIX_TECHNOLOGY 0x09b5U // Celltrix Technology Co., Ltd +#define UHS_VID_GRUNDIG 0x09bcU // Grundig +#define UHS_VID_MYSMARTCOM 0x09beU // MySmart.Com +#define UHS_VID_AUERSWALD_GMBH_AND_CO_KG 0x09bfU // Auerswald GmbH & Co. KG +#define UHS_VID_GENPIX_ELECTRONICS 0x09c0U // Genpix Electronics, LLC +#define UHS_VID_ARRIS_INTERACTIVE 0x09c1U // Arris Interactive LLC +#define UHS_VID_NISCA 0x09c2U // Nisca Corp. +#define UHS_VID_ACTIVCARD 0x09c3U // ActivCard, Inc. +#define UHS_VID_ACTISYS 0x09c4U // ACTiSYS Corp. +#define UHS_VID_MEMORY 0x09c5U // Memory Corp. +#define UHS_VID_BMC_MESSSYSTEME 0x09caU // BMC Messsysteme GmbH +#define UHS_VID_WORKBIT 0x09ccU // Workbit Corp. +#define UHS_VID_PSION_DACOM_HOME_NETWORKS 0x09cdU // Psion Dacom Home Networks, Ltd +#define UHS_VID_CITY_ELECTRONICS 0x09ceU // City Electronics, Ltd +#define UHS_VID_ELECTRONICS_TESTING_CENTER_TAIWAN 0x09cfU // Electronics Testing Center, Taiwan +#define UHS_VID_NEOMAGIC 0x09d1U // NeoMagic, Inc. +#define UHS_VID_VREELIN_ENGINEERING 0x09d2U // Vreelin Engineering, Inc. +#define UHS_VID_COM_ONE 0x09d3U // Com One +#define UHS_VID_NOVATEL_WIRELESS 0x09d7U // Novatel Wireless +#define UHS_VID_KRF_TECH 0x09d9U // KRF Tech, Ltd +#define UHS_VID_A4TECH 0x09daU // A4Tech Co., Ltd. +#define UHS_VID_MEASUREMENT_COMPUTING 0x09dbU // Measurement Computing Corp. +#define UHS_VID_AIMEX 0x09dcU // Aimex Corp. +#define UHS_VID_FELLOWES 0x09ddU // Fellowes, Inc. +#define UHS_VID_ADDONICS_TECHNOLOGIES 0x09dfU // Addonics Technologies Corp. +#define UHS_VID_INTELLON 0x09e1U // Intellon Corp. +#define UHS_VID_JO_DAN_INTERNATIONAL 0x09e5U // Jo-Dan International, Inc. +#define UHS_VID_SILUTIA 0x09e6U // Silutia, Inc. +#define UHS_VID_REAL_3D 0x09e7U // Real 3D, Inc. +#define UHS_VID_AKAI_PROFESSIONAL_MI 0x09e8U // AKAI Professional M.I. Corp. +#define UHS_VID_CHEN_SOURCE 0x09e9U // Chen-Source, Inc. +#define UHS_VID_IM_NETWORKS 0x09ebU // IM Networks, Inc. +#define UHS_VID_XITEL 0x09efU // Xitel +#define UHS_VID_GOFLIGHT 0x09f3U // GoFlight, Inc. +#define UHS_VID_ARESCOM 0x09f5U // AresCom +#define UHS_VID_ROCKETCHIPS 0x09f6U // RocketChips, Inc. +#define UHS_VID_EDU_SCIENCE_HK 0x09f7U // Edu-Science (H.K.), Ltd +#define UHS_VID_SOFTCONNEX_TECHNOLOGIES 0x09f8U // SoftConnex Technologies, Inc. +#define UHS_VID_BAY_ASSOCIATES 0x09f9U // Bay Associates +#define UHS_VID_MTEK_VISION 0x09faU // Mtek Vision +#define UHS_VID_ALTERA_1 0x09fbU // Altera +#define UHS_VID_GAIN_TECHNOLOGY 0x09ffU // Gain Technology Corp. +#define UHS_VID_LIQUID_AUDIO 0x0a00U // Liquid Audio +#define UHS_VID_VIA 0x0a01U // ViA, Inc. +#define UHS_VID_UNKNOWN_MANUFACTURER 0x0a05U // Unknown Manufacturer +#define UHS_VID_ONTRAK_CONTROL_SYSTEMS 0x0a07U // Ontrak Control Systems Inc. +#define UHS_VID_CYBEX_COMPUTER_PRODUCTS 0x0a0bU // Cybex Computer Products Co. +#define UHS_VID_SERVERGY 0x0a0dU // Servergy, Inc +#define UHS_VID_XENTEC 0x0a11U // Xentec, Inc. +#define UHS_VID_CAMBRIDGE_SILICON_RADIO 0x0a12U // Cambridge Silicon Radio, Ltd +#define UHS_VID_TELEBYTE 0x0a13U // Telebyte, Inc. +#define UHS_VID_SPACELABS_MEDICAL 0x0a14U // Spacelabs Medical, Inc. +#define UHS_VID_SCALAR 0x0a15U // Scalar Corp. +#define UHS_VID_TREK_TECHNOLOGY_S_PTE 0x0a16U // Trek Technology (S) PTE, Ltd +#define UHS_VID_PENTAX 0x0a17U // Pentax Corp. +#define UHS_VID_HEIDELBERGER_DRUCKMASCHINEN_AG 0x0a18U // Heidelberger Druckmaschinen AG +#define UHS_VID_HUA_GENG_TECHNOLOGIES 0x0a19U // Hua Geng Technologies, Inc. +#define UHS_VID_MEDTRONIC_PHYSIO_CONTROL 0x0a21U // Medtronic Physio Control Corp. +#define UHS_VID_CENTURY_SEMICONDUCTOR_USA 0x0a22U // Century Semiconductor USA, Inc. +#define UHS_VID_DATACARD_GROUP 0x0a27U // Datacard Group +#define UHS_VID_AK_MODUL_BUS_COMPUTER 0x0a2cU // AK-Modul-Bus Computer GmbH +#define UHS_VID_TG3_ELECTRONICS 0x0a34U // TG3 Electronics, Inc. +#define UHS_VID_RADIKAL_TECHNOLOGIES 0x0a35U // Radikal Technologies +#define UHS_VID_GILAT_SATELLITE_NETWORKS 0x0a39U // Gilat Satellite Networks, Ltd +#define UHS_VID_PENTAMEDIA 0x0a3aU // PentaMedia Co., Ltd +#define UHS_VID_NTT_DOCOMO 0x0a3cU // NTT DoCoMo, Inc. +#define UHS_VID_VARO_VISION 0x0a3dU // Varo Vision +#define UHS_VID_SWISSONIC_AG 0x0a3fU // Swissonic AG +#define UHS_VID_BOCA_SYSTEMS 0x0a43U // Boca Systems, Inc. +#define UHS_VID_DAVICOM_SEMICONDUCTOR 0x0a46U // Davicom Semiconductor, Inc. +#define UHS_VID_HIROSE_ELECTRIC 0x0a47U // Hirose Electric +#define UHS_VID_IO_INTERCONNECT 0x0a48U // I/O Interconnect +#define UHS_VID_PLOYTEC 0x0a4aU // Ploytec GmbH +#define UHS_VID_FUJITSU_MEDIA_DEVICES 0x0a4bU // Fujitsu Media Devices, Ltd +#define UHS_VID_COMPUTEX 0x0a4cU // Computex Co., Ltd +#define UHS_VID_EVOLUTION_ELECTRONICS 0x0a4dU // Evolution Electronics, Ltd +#define UHS_VID_STEINBERG_SOFT_UND_HARDWARE 0x0a4eU // Steinberg Soft-und Hardware GmbH +#define UHS_VID_LITTON_SYSTEMS 0x0a4fU // Litton Systems, Inc. +#define UHS_VID_MIMAKI_ENGINEERING 0x0a50U // Mimaki Engineering Co., Ltd +#define UHS_VID_SONY_ELECTRONICS 0x0a51U // Sony Electronics, Inc. +#define UHS_VID_JEBSEE_ELECTRONICS 0x0a52U // Jebsee Electronics Co., Ltd +#define UHS_VID_PORTABLE_PERIPHERAL 0x0a53U // Portable Peripheral Co., Ltd +#define UHS_VID_ELECTRONICS_FOR_IMAGING 0x0a5aU // Electronics For Imaging, Inc. +#define UHS_VID_EASICS_NV 0x0a5bU // EAsics NV +#define UHS_VID_BROADCOM 0x0a5cU // Broadcom Corp. +#define UHS_VID_DIATREND 0x0a5dU // Diatrend Corp. +#define UHS_VID_ZEBRA 0x0a5fU // Zebra +#define UHS_VID_MPMAN 0x0a62U // MPMan +#define UHS_VID_CLEARCUBE_TECHNOLOGY 0x0a66U // ClearCube Technology +#define UHS_VID_MEDELI_ELECTRONICS 0x0a67U // Medeli Electronics Co., Ltd +#define UHS_VID_COMAIDE 0x0a68U // Comaide Corp. +#define UHS_VID_CHROMA_ATE 0x0a69U // Chroma ate, Inc. +#define UHS_VID_GREEN_HOUSE 0x0a6bU // Green House Co., Ltd +#define UHS_VID_INTEGRATED_CIRCUIT_SYSTEMS 0x0a6cU // Integrated Circuit Systems, Inc. +#define UHS_VID_UPS_MANUFACTURING 0x0a6dU // UPS Manufacturing +#define UHS_VID_BENWIN 0x0a6eU // Benwin +#define UHS_VID_CORE_TECHNOLOGY 0x0a6fU // Core Technology, Inc. +#define UHS_VID_INTERNATIONAL_GAME_TECHNOLOGY 0x0a70U // International Game Technology +#define UHS_VID_VIPCOLOR_TECHNOLOGIES_USA 0x0a71U // VIPColor Technologies USA, Inc. +#define UHS_VID_SANWA_DENSHI 0x0a72U // Sanwa Denshi +#define UHS_VID_MACKIE_DESIGNS 0x0a73U // Mackie Designs +#define UHS_VID_NSTL 0x0a7dU // NSTL, Inc. +#define UHS_VID_OCTAGON_SYSTEMS 0x0a7eU // Octagon Systems Corp. +#define UHS_VID_REXON_TECHNOLOGY 0x0a80U // Rexon Technology Corp., Ltd +#define UHS_VID_CHESEN_ELECTRONICS 0x0a81U // Chesen Electronics Corp. +#define UHS_VID_SYSCAN 0x0a82U // Syscan +#define UHS_VID_NEXTCOMM 0x0a83U // NextComm, Inc. +#define UHS_VID_MAUI_INNOVATIVE_PERIPHERALS 0x0a84U // Maui Innovative Peripherals +#define UHS_VID_IDEXX_LABS 0x0a85U // Idexx Labs +#define UHS_VID_NITGEN 0x0a86U // NITGen Co., Ltd +#define UHS_VID_AKTIV 0x0a89U // Aktiv +#define UHS_VID_PICTURETEL 0x0a8dU // Picturetel +#define UHS_VID_JAPAN_AVIATION_ELECTRONICS_INDUSTRY 0x0a8eU // Japan Aviation Electronics Industry, Ltd +#define UHS_VID_CANDY_TECHNOLOGY 0x0a90U // Candy Technology Co., Ltd +#define UHS_VID_GLOBLINK_TECHNOLOGY 0x0a91U // Globlink Technology, Inc. +#define UHS_VID_EGO_SYSTEMS 0x0a92U // EGO SYStems, Inc. +#define UHS_VID_C_TECHNOLOGIES 0x0a93U // C Technologies AB +#define UHS_VID_INTERSENSE 0x0a94U // Intersense +#define UHS_VID_LAVA_COMPUTER_MFG 0x0aa3U // Lava Computer Mfg., Inc. +#define UHS_VID_DEVELCO_ELEKTRONIK 0x0aa4U // Develco Elektronik +#define UHS_VID_FIRST_INTERNATIONAL_DIGITAL 0x0aa5U // First International Digital +#define UHS_VID_PERCEPTION_DIGITAL 0x0aa6U // Perception Digital, Ltd +#define UHS_VID_WINCOR_NIXDORF_INTERNATIONAL 0x0aa7U // Wincor Nixdorf International GmbH +#define UHS_VID_TRIGEM_COMPUTER 0x0aa8U // TriGem Computer, Inc. +#define UHS_VID_BAROMTEC 0x0aa9U // Baromtec Co. +#define UHS_VID_JAPAN_CBM 0x0aaaU // Japan CBM Corp. +#define UHS_VID_VISION_SHAPE_EUROPE 0x0aabU // Vision Shape Europe SA +#define UHS_VID_ICOMPRESSION 0x0aacU // iCompression, Inc. +#define UHS_VID_ROHDE_AND_SCHWARZ_GMBH_AND_CO_KG 0x0aadU // Rohde & Schwarz GmbH & Co. KG +#define UHS_VID_NEC_INFRONTIA_CORP_NITSUKO 0x0aaeU // NEC infrontia Corp. (Nitsuko) +#define UHS_VID_DIGITALWAY 0x0aafU // Digitalway Co., Ltd +#define UHS_VID_ARROW_STRONG_ELECTRONICS 0x0ab0U // Arrow Strong Electronics Co., Ltd +#define UHS_VID_FEIG_ELECTRONIC 0x0ab1U // FEIG ELECTRONIC GmbH +#define UHS_VID_ELLISYS 0x0abaU // Ellisys +#define UHS_VID_STEREO_LINK 0x0abeU // Stereo-Link +#define UHS_VID_DIOLAN 0x0abfU // Diolan +#define UHS_VID_SANYO_SEMICONDUCTOR_COMPANY_MICRO 0x0ac3U // Sanyo Semiconductor Company Micro +#define UHS_VID_LECO 0x0ac4U // Leco Corp. +#define UHS_VID_I_AND_C 0x0ac5U // I & C Corp. +#define UHS_VID_SINGING_ELECTRONS 0x0ac6U // Singing Electrons, Inc. +#define UHS_VID_PANWEST 0x0ac7U // Panwest Corp. +#define UHS_VID_Z_STAR_MICROELECTRONICS 0x0ac8U // Z-Star Microelectronics Corp. +#define UHS_VID_MICRO_SOLUTIONS 0x0ac9U // Micro Solutions, Inc. +#define UHS_VID_OPEN_NETWORKS 0x0acaU // OPEN Networks Ltd +#define UHS_VID_KOGA_ELECTRONICS 0x0accU // Koga Electronics Co. +#define UHS_VID_ID_TECH 0x0acdU // ID Tech +#define UHS_VID_ZYDAS 0x0aceU // ZyDAS +#define UHS_VID_INTOTO 0x0acfU // Intoto, Inc. +#define UHS_VID_INTELLIX 0x0ad0U // Intellix Corp. +#define UHS_VID_REMOTEC_TECHNOLOGY 0x0ad1U // Remotec Technology, Ltd +#define UHS_VID_SERVICE_AND_QUALITY_TECHNOLOGY 0x0ad2U // Service & Quality Technology Co., Ltd +#define UHS_VID_DATA_ENCRYPTION_SYSTEMS 0x0adaU // Data Encryption Systems Ltd. +#define UHS_VID_ALLION_COMPUTER 0x0ae3U // Allion Computer, Inc. +#define UHS_VID_TAITO 0x0ae4U // Taito Corp. +#define UHS_VID_NEODYM_SYSTEMS 0x0ae7U // Neodym Systems, Inc. +#define UHS_VID_SYSTEM_SUPPORT 0x0ae8U // System Support Co., Ltd +#define UHS_VID_NORTH_SHORE_CIRCUIT_DESIGN_LLP 0x0ae9U // North Shore Circuit Design L.L.P. +#define UHS_VID_SCIESSENCE 0x0aeaU // SciEssence, LLC +#define UHS_VID_TTP_COMMUNICATIONS 0x0aebU // TTP Communications, Ltd +#define UHS_VID_NEODIO_TECHNOLOGIES 0x0aecU // Neodio Technologies Corp. +#define UHS_VID_OPTION 0x0af0U // Option +#define UHS_VID_SILVER_I 0x0af6U // Silver I Co., Ltd +#define UHS_VID_B2C2 0x0af7U // B2C2, Inc. +#define UHS_VID_HAMA 0x0af9U // Hama, Inc. +#define UHS_VID_DMC 0x0afaU // DMC Co., Ltd. +#define UHS_VID_ZAPTRONIX 0x0afcU // Zaptronix Ltd +#define UHS_VID_TATENO_DENNOU 0x0afdU // Tateno Dennou, Inc. +#define UHS_VID_CUMMINS_ENGINE 0x0afeU // Cummins Engine Co. +#define UHS_VID_JUMP_ZONE_NETWORK_PRODUCTS 0x0affU // Jump Zone Network Products, Inc. +#define UHS_VID_INGENICO 0x0b00U // INGENICO +#define UHS_VID_ASUSTEK_COMPUTER 0x0b05U // ASUSTek Computer, Inc. +#define UHS_VID_DATAMAX_ONEIL 0x0b0bU // Datamax-O'Neil +#define UHS_VID_TODOS 0x0b0cU // Todos AB +#define UHS_VID_PROJECTLAB 0x0b0dU // ProjectLab +#define UHS_VID_GN_NETCOM 0x0b0eU // GN Netcom +#define UHS_VID_AVID_TECHNOLOGY 0x0b0fU // AVID Technology +#define UHS_VID_PCALLY 0x0b10U // Pcally +#define UHS_VID_I_TECH_SOLUTIONS 0x0b11U // I Tech Solutions Co., Ltd +#define UHS_VID_ELECTRONIC_WARFARE_ASSOC_INC_EWA 0x0b1eU // Electronic Warfare Assoc., Inc. (EWA) +#define UHS_VID_INSYDE_SOFTWARE 0x0b1fU // Insyde Software Corp. +#define UHS_VID_TRANSDIMENSION 0x0b20U // TransDimension, Inc. +#define UHS_VID_YOKOGAWA_ELECTRIC 0x0b21U // Yokogawa Electric Corp. +#define UHS_VID_JAPAN_SYSTEM_DEVELOPMENT 0x0b22U // Japan System Development Co., Ltd +#define UHS_VID_PAN_ASIA_ELECTRONICS 0x0b23U // Pan-Asia Electronics Co., Ltd +#define UHS_VID_LINK_EVOLUTION 0x0b24U // Link Evolution Corp. +#define UHS_VID_RITEK 0x0b27U // Ritek Corp. +#define UHS_VID_KENWOOD 0x0b28U // Kenwood Corp. +#define UHS_VID_VILLAGE_CENTER 0x0b2cU // Village Center, Inc. +#define UHS_VID_PNY_TECHNOLOGIES 0x0b30U // PNY Technologies, Inc. +#define UHS_VID_CONTOUR_DESIGN 0x0b33U // Contour Design, Inc. +#define UHS_VID_HITACHI_ULSI_SYSTEMS 0x0b37U // Hitachi ULSI Systems Co., Ltd +#define UHS_VID_GEAR_HEAD 0x0b38U // Gear Head +#define UHS_VID_OMNIDIRECTIONAL_CONTROL_TECHNOLOGY 0x0b39U // Omnidirectional Control Technology, Inc. +#define UHS_VID_IPAXESS 0x0b3aU // IPaxess +#define UHS_VID_TEKRAM_TECHNOLOGY 0x0b3bU // Tekram Technology Co., Ltd +#define UHS_VID_OLIVETTI_TECHCENTER 0x0b3cU // Olivetti Techcenter +#define UHS_VID_KIKUSUI_ELECTRONICS 0x0b3eU // Kikusui Electronics Corp. +#define UHS_VID_HAL 0x0b41U // Hal Corp. +#define UHS_VID_PLAYCOM 0x0b43U // Play.com, Inc. +#define UHS_VID_SPORTBUGCOM 0x0b47U // Sportbug.com, Inc. +#define UHS_VID_TECHNOTREND_AG 0x0b48U // TechnoTrend AG +#define UHS_VID_ASCII 0x0b49U // ASCII Corp. +#define UHS_VID_PINE 0x0b4bU // Pine Corp. Ltd. +#define UHS_VID_GRAPHTEC_AMERICA 0x0b4dU // Graphtec America, Inc. +#define UHS_VID_MUSICAL_ELECTRONICS 0x0b4eU // Musical Electronics, Ltd +#define UHS_VID_DUMPRIES 0x0b50U // Dumpries Co., Ltd +#define UHS_VID_COMFORT_KEYBOARD 0x0b51U // Comfort Keyboard Co. +#define UHS_VID_COLORADO_MICRODISPLAY 0x0b52U // Colorado MicroDisplay, Inc. +#define UHS_VID_SINBON_ELECTRONICS 0x0b54U // Sinbon Electronics Co., Ltd +#define UHS_VID_TYI_SYSTEMS 0x0b56U // TYI Systems, Ltd +#define UHS_VID_BEIJING_HANWANGTECHNOLOGY 0x0b57U // Beijing HanwangTechnology Co., Ltd +#define UHS_VID_LAKE_COMMUNICATIONS 0x0b59U // Lake Communications, Ltd +#define UHS_VID_COREL 0x0b5aU // Corel Corp. +#define UHS_VID_GREEN_ELECTRONICS 0x0b5fU // Green Electronics Co., Ltd +#define UHS_VID_NSINE 0x0b60U // Nsine, Ltd +#define UHS_VID_NEC_VIEWTECHNOLOGY 0x0b61U // NEC Viewtechnology, Ltd +#define UHS_VID_ORANGE_MICRO 0x0b62U // Orange Micro, Inc. +#define UHS_VID_ADLINK_TECHNOLOGY 0x0b63U // ADLink Technology, Inc. +#define UHS_VID_WONDERFUL_WIRE_CABLE 0x0b64U // Wonderful Wire Cable Co., Ltd +#define UHS_VID_EXPERT_MAGNETICS 0x0b65U // Expert Magnetics Corp. +#define UHS_VID_CYBIKO 0x0b66U // Cybiko Inc. +#define UHS_VID_FAIRBANKS_SCALES 0x0b67U // Fairbanks Scales +#define UHS_VID_CACHEVISION 0x0b69U // CacheVision +#define UHS_VID_MAXIM_INTEGRATED_PRODUCTS 0x0b6aU // Maxim Integrated Products +#define UHS_VID_NAGANO_JAPAN_RADIO 0x0b6fU // Nagano Japan Radio Co., Ltd +#define UHS_VID_PORTALPLAYER 0x0b70U // PortalPlayer, Inc. +#define UHS_VID_SHIN_EI_SANGYO 0x0b71U // SHIN-EI Sangyo Co., Ltd +#define UHS_VID_EMBEDDED_WIRELESS_TECHNOLOGY 0x0b72U // Embedded Wireless Technology Co., Ltd +#define UHS_VID_COMPUTONE 0x0b73U // Computone Corp. +#define UHS_VID_ROLAND_DG 0x0b75U // Roland DG Corp. +#define UHS_VID_SUNRISE_TELECOM 0x0b79U // Sunrise Telecom, Inc. +#define UHS_VID_ZEEVO 0x0b7aU // Zeevo, Inc. +#define UHS_VID_TAIKO_DENKI 0x0b7bU // Taiko Denki Co., Ltd +#define UHS_VID_ITRAN_COMMUNICATIONS 0x0b7cU // ITRAN Communications, Ltd +#define UHS_VID_ASTRODESIGN 0x0b7dU // Astrodesign, Inc. +#define UHS_VID_ID3_TECHNOLOGIES 0x0b81U // id3 Technologies +#define UHS_VID_REXTRON_TECHNOLOGY 0x0b84U // Rextron Technology, Inc. +#define UHS_VID_ELKAT_ELECTRONICS_SDN_BHD 0x0b85U // Elkat Electronics, Sdn., Bhd. +#define UHS_VID_EXPUTER_SYSTEMS 0x0b86U // Exputer Systems, Inc. +#define UHS_VID_PLUS_ONE_I_AND_T 0x0b87U // Plus-One I & T, Inc. +#define UHS_VID_SIGMA_KOKI_CO_LTD_TECHNOLOGY_CENTER 0x0b88U // Sigma Koki Co., Ltd, Technology Center +#define UHS_VID_ADVANCED_DIGITAL_BROADCAST 0x0b89U // Advanced Digital Broadcast, Ltd +#define UHS_VID_SMART_TECHNOLOGIES 0x0b8cU // SMART Technologies Inc. +#define UHS_VID_ASIX_ELECTRONICS 0x0b95U // ASIX Electronics Corp. +#define UHS_VID_SEWON_TELECOM 0x0b96U // Sewon Telecom +#define UHS_VID_O2_MICRO 0x0b97U // O2 Micro, Inc. +#define UHS_VID_PLAYMATES_TOYS 0x0b98U // Playmates Toys, Inc. +#define UHS_VID_AUDIO_INTERNATIONAL 0x0b99U // Audio International, Inc. +#define UHS_VID_DIPL_ING_STEFAN_KUNDE 0x0b9bU // Dipl.-Ing. Stefan Kunde +#define UHS_VID_SOFTPROTEC 0x0b9dU // Softprotec Co. +#define UHS_VID_CHIPPO_TECHNOLOGIES 0x0b9fU // Chippo Technologies +#define UHS_VID_US_ROBOTICS 0x0bafU // U.S. Robotics +#define UHS_VID_CONCORD_CAMERA 0x0bb0U // Concord Camera Corp. +#define UHS_VID_INFINILINK 0x0bb1U // Infinilink Corp. +#define UHS_VID_AMBIT_MICROSYSTEMS 0x0bb2U // Ambit Microsystems Corp. +#define UHS_VID_OFUJI_TECHNOLOGY 0x0bb3U // Ofuji Technology +#define UHS_VID_HTC_HIGH_TECH_COMPUTER 0x0bb4U // HTC (High Tech Computer Corp.) +#define UHS_VID_MURATA_MANUFACTURING 0x0bb5U // Murata Manufacturing Co., Ltd +#define UHS_VID_NETWORK_ALCHEMY 0x0bb6U // Network Alchemy +#define UHS_VID_JOYTECH_COMPUTER 0x0bb7U // Joytech Computer Co., Ltd +#define UHS_VID_HITACHI_SEMICONDUCTOR_AND_DEVICES_SALES 0x0bb8U // Hitachi Semiconductor and Devices Sales Co., Ltd +#define UHS_VID_EIGER_MANDC 0x0bb9U // Eiger M&C Co., Ltd +#define UHS_VID_ZACCESS_SYSTEMS 0x0bbaU // ZAccess Systems +#define UHS_VID_GENERAL_METERS 0x0bbbU // General Meters Corp. +#define UHS_VID_ASSISTIVE_TECHNOLOGY 0x0bbcU // Assistive Technology, Inc. +#define UHS_VID_SYSTEM_CONNECTION 0x0bbdU // System Connection, Inc. +#define UHS_VID_KNILINK_TECHNOLOGY 0x0bc0U // Knilink Technology, Inc. +#define UHS_VID_FUW_YNG_ELECTRONICS 0x0bc1U // Fuw Yng Electronics Co., Ltd +#define UHS_VID_SEAGATE_RSS 0x0bc2U // Seagate RSS LLC +#define UHS_VID_IPWIRELESS 0x0bc3U // IPWireless, Inc. +#define UHS_VID_MICROCUBE 0x0bc4U // Microcube Corp. +#define UHS_VID_JCN 0x0bc5U // JCN Co., Ltd +#define UHS_VID_EXWAY 0x0bc6U // ExWAY, Inc. +#define UHS_VID_X10_WIRELESS_TECHNOLOGY 0x0bc7U // X10 Wireless Technology, Inc. +#define UHS_VID_TELMAX_COMMUNICATIONS 0x0bc8U // Telmax Communications +#define UHS_VID_ECI_TELECOM 0x0bc9U // ECI Telecom, Ltd +#define UHS_VID_STARTEK_ENGINEERING 0x0bcaU // Startek Engineering, Inc. +#define UHS_VID_PERFECT_TECHNIC_ENTERPRISE 0x0bcbU // Perfect Technic Enterprise Co., Ltd +#define UHS_VID_ANDREW_PARGETER_AND_ASSOCIATES 0x0bd7U // Andrew Pargeter & Associates +#define UHS_VID_REALTEK_SEMICONDUCTOR 0x0bdaU // Realtek Semiconductor Corp. +#define UHS_VID_ERICSSON_BUSINESS_MOBILE_NETWORKS_BV 0x0bdbU // Ericsson Business Mobile Networks BV +#define UHS_VID_Y_MEDIA 0x0bdcU // Y Media Corp. +#define UHS_VID_ORANGE_PCS 0x0bddU // Orange PCS +#define UHS_VID_KANDA_TSUSHIN_KOGYO 0x0be2U // Kanda Tsushin Kogyo Co., Ltd +#define UHS_VID_TOYO 0x0be3U // TOYO Corp. +#define UHS_VID_ELKA_INTERNATIONAL 0x0be4U // Elka International, Ltd +#define UHS_VID_DOME_IMAGING_SYSTEMS 0x0be5U // DOME imaging systems, Inc. +#define UHS_VID_DONG_GUAN_HUMEN_WONDERFUL_WIRE_CABLE_FACTORY 0x0be6U // Dong Guan Humen Wonderful Wire Cable Factory +#define UHS_VID_MEI 0x0bedU // MEI +#define UHS_VID_LTK_INDUSTRIES 0x0beeU // LTK Industries, Ltd +#define UHS_VID_WAY2CALL_COMMUNICATIONS 0x0befU // Way2Call Communications +#define UHS_VID_PACE_MICRO_TECHNOLOGY_PLC 0x0bf0U // Pace Micro Technology PLC +#define UHS_VID_INTRACOM 0x0bf1U // Intracom S.A. +#define UHS_VID_KONEXX 0x0bf2U // Konexx +#define UHS_VID_ADDONICS_TECHNOLOGIES_1 0x0bf6U // Addonics Technologies, Inc. +#define UHS_VID_SUNNY_GIKEN 0x0bf7U // Sunny Giken, Inc. +#define UHS_VID_FUJITSU_SIEMENS_COMPUTERS_1 0x0bf8U // Fujitsu Siemens Computers +#define UHS_VID_KVASER 0x0bfdU // Kvaser AB +#define UHS_VID_MOTO_DEVELOPMENT_GROUP 0x0c04U // MOTO Development Group, Inc. +#define UHS_VID_APPIAN_GRAPHICS 0x0c05U // Appian Graphics +#define UHS_VID_HASBRO_GAMES 0x0c06U // Hasbro Games, Inc. +#define UHS_VID_INFINITE_DATA_STORAGE 0x0c07U // Infinite Data Storage, Ltd +#define UHS_VID_AGATE 0x0c08U // Agate +#define UHS_VID_COMJET_INFORMATION_SYSTEM 0x0c09U // Comjet Information System +#define UHS_VID_HIGHPOINT_TECHNOLOGIES 0x0c0aU // Highpoint Technologies, Inc. +#define UHS_VID_DURA_MICRO_INC_ACOMDATA 0x0c0bU // Dura Micro, Inc. (Acomdata) +#define UHS_VID_ZEROPLUS 0x0c12U // Zeroplus +#define UHS_VID_IRIS_GRAPHICS 0x0c15U // Iris Graphics +#define UHS_VID_GYRATION 0x0c16U // Gyration, Inc. +#define UHS_VID_CYBERBOARD_AS 0x0c17U // Cyberboard A/S +#define UHS_VID_SYNERTEK_KOREA 0x0c18U // SynerTek Korea, Inc. +#define UHS_VID_CYBERPIXIE 0x0c19U // cyberPIXIE, Inc. +#define UHS_VID_SILICON_MOTION 0x0c1aU // Silicon Motion, Inc. +#define UHS_VID_MIPS_TECHNOLOGIES 0x0c1bU // MIPS Technologies +#define UHS_VID_HANG_ZHOU_SILAN_ELECTRONICS 0x0c1cU // Hang Zhou Silan Electronics Co., Ltd +#define UHS_VID_TALLY_PRINTER 0x0c22U // Tally Printer Corp. +#define UHS_VID_LERNOUT__HAUSPIE 0x0c23U // Lernout + Hauspie +#define UHS_VID_TAIYO_YUDEN 0x0c24U // Taiyo Yuden +#define UHS_VID_SAMPO 0x0c25U // Sampo Corp. +#define UHS_VID_PROLIFIC_TECHNOLOGY_1 0x0c26U // Prolific Technology Inc. +#define UHS_VID_RFIDEAS 0x0c27U // RFIDeas, Inc +#define UHS_VID_METROLOGIC_INSTRUMENTS 0x0c2eU // Metrologic Instruments +#define UHS_VID_EAGLETRON 0x0c35U // Eagletron, Inc. +#define UHS_VID_E_INK 0x0c36U // E Ink Corp. +#define UHS_VID_EDIGITAL 0x0c37U // e.Digital +#define UHS_VID_DER_AN_ELECTRIC_WIRE_AND_CABLE 0x0c38U // Der An Electric Wire & Cable Co., Ltd +#define UHS_VID_IFR 0x0c39U // IFR +#define UHS_VID_FURUI_PRECISE_COMPONENT_KUNSHAN 0x0c3aU // Furui Precise Component (Kunshan) Co., Ltd +#define UHS_VID_KOMATSU 0x0c3bU // Komatsu, Ltd +#define UHS_VID_RADIUS 0x0c3cU // Radius Co., Ltd +#define UHS_VID_INNOCOM 0x0c3dU // Innocom, Inc. +#define UHS_VID_NEXTCELL 0x0c3eU // Nextcell, Inc. +#define UHS_VID_MOTOROLA_IDEN 0x0c44U // Motorola iDEN +#define UHS_VID_MICRODIA 0x0c45U // Microdia +#define UHS_VID_WAVERIDER_COMMUNICATIONS 0x0c46U // WaveRider Communications, Inc. +#define UHS_VID_ALGE_TIMING 0x0c4aU // ALGE-TIMING GmbH +#define UHS_VID_REINER_SCT_KARTENSYSTEME 0x0c4bU // Reiner SCT Kartensysteme GmbH +#define UHS_VID_NEEDHAMS_ELECTRONICS 0x0c4cU // Needham's Electronics +#define UHS_VID_SEALEVEL_SYSTEMS 0x0c52U // Sealevel Systems, Inc. +#define UHS_VID_VIEWPLUS 0x0c53U // ViewPLUS, Inc. +#define UHS_VID_GLORY 0x0c54U // Glory, Ltd +#define UHS_VID_SPECTRUM_DIGITAL 0x0c55U // Spectrum Digital, Inc. +#define UHS_VID_BILLION_BRIGHT 0x0c56U // Billion Bright, Ltd +#define UHS_VID_IMAGINATIVE_DESIGN_OPERATION 0x0c57U // Imaginative Design Operation Co., Ltd +#define UHS_VID_VIDAR_SYSTEMS 0x0c58U // Vidar Systems Corp. +#define UHS_VID_DONG_GUAN_SHINKO_WIRE 0x0c59U // Dong Guan Shinko Wire Co., Ltd +#define UHS_VID_TRS_INTERNATIONAL_MFG 0x0c5aU // TRS International Mfg., Inc. +#define UHS_VID_XYTRONIX_RESEARCH_AND_DESIGN 0x0c5eU // Xytronix Research & Design +#define UHS_VID_APOGEE_ELECTRONICS 0x0c60U // Apogee Electronics Corp. +#define UHS_VID_CHANT_SINCERE 0x0c62U // Chant Sincere Co., Ltd +#define UHS_VID_TOKO 0x0c63U // Toko, Inc. +#define UHS_VID_SIGNALITY_SYSTEM_ENGINEERING 0x0c64U // Signality System Engineering Co., Ltd +#define UHS_VID_EMINENCE_ENTERPRISE 0x0c65U // Eminence Enterprise Co., Ltd +#define UHS_VID_REXON_ELECTRONICS 0x0c66U // Rexon Electronics Corp. +#define UHS_VID_CONCEPT_TELECOM 0x0c67U // Concept Telecom, Ltd +#define UHS_VID_ACS 0x0c6aU // ACS +#define UHS_VID_JETI_TECHNISCHE_INSTRUMENTE 0x0c6cU // JETI Technische Instrumente GmbH +#define UHS_VID_MCT_ELEKTRONIKLADEN 0x0c70U // MCT Elektronikladen +#define UHS_VID_PEAK_SYSTEM 0x0c72U // PEAK System +#define UHS_VID_OPTRONIC_LABORATORIES 0x0c74U // Optronic Laboratories Inc. +#define UHS_VID_JMTEK 0x0c76U // JMTek, LLC. +#define UHS_VID_SIPIX_GROUP 0x0c77U // Sipix Group, Ltd +#define UHS_VID_DETTO 0x0c78U // Detto Corp. +#define UHS_VID_NUCONNEX_TECHNOLOGIES_PTE 0x0c79U // NuConnex Technologies Pte., Ltd +#define UHS_VID_WING_SPAN_ENTERPRISE 0x0c7aU // Wing-Span Enterprise Co., Ltd +#define UHS_VID_NDA_TECHNOLOGIES 0x0c86U // NDA Technologies, Inc. +#define UHS_VID_KYOCERA_WIRELESS 0x0c88U // Kyocera Wireless Corp. +#define UHS_VID_HONDA_TSUSHIN_KOGYO 0x0c89U // Honda Tsushin Kogyo Co., Ltd +#define UHS_VID_PATHWAY_CONNECTIVITY 0x0c8aU // Pathway Connectivity, Inc. +#define UHS_VID_WAVEFLY 0x0c8bU // Wavefly Corp. +#define UHS_VID_COACTIVE_NETWORKS 0x0c8cU // Coactive Networks +#define UHS_VID_TEMPO 0x0c8dU // Tempo +#define UHS_VID_CESSCOM 0x0c8eU // Cesscom Co., Ltd +#define UHS_VID_APPLIED_MICROSYSTEMS 0x0c8fU // Applied Microsystems +#define UHS_VID_CRYPTERA 0x0c94U // Cryptera +#define UHS_VID_BERKSHIRE_PRODUCTS 0x0c98U // Berkshire Products, Inc. +#define UHS_VID_INNOCHIPS 0x0c99U // Innochips Co., Ltd +#define UHS_VID_HANWOOL_ROBOTICS 0x0c9aU // Hanwool Robotics Corp. +#define UHS_VID_JOBIN_YVON 0x0c9bU // Jobin Yvon, Inc. +#define UHS_VID_SEMTEK 0x0c9dU // SemTek +#define UHS_VID_ZYFER 0x0ca2U // Zyfer +#define UHS_VID_SEGA 0x0ca3U // Sega Corp. +#define UHS_VID_STANDT_INSTRUMENT 0x0ca4U // ST&T Instrument Corp. +#define UHS_VID_BAE_SYSTEMS_CANADA 0x0ca5U // BAE Systems Canada, Inc. +#define UHS_VID_CASTLES_TECHNOLOGY 0x0ca6U // Castles Technology Co., Ltd +#define UHS_VID_INFORMATION_SYSTEMS_LABORATORIES 0x0ca7U // Information Systems Laboratories +#define UHS_VID_MOTOROLA_CGISS 0x0cadU // Motorola CGISS +#define UHS_VID_ASCOM_BUSINESS_SYSTEMS 0x0caeU // Ascom Business Systems, Ltd +#define UHS_VID_BUSLINK 0x0cafU // Buslink +#define UHS_VID_FLYING_PIG_SYSTEMS 0x0cb0U // Flying Pig Systems +#define UHS_VID_INNOVONICS 0x0cb1U // Innovonics, Inc. +#define UHS_VID_CELESTIX_NETWORKS_PTE 0x0cb6U // Celestix Networks, Pte., Ltd +#define UHS_VID_SINGATRON_ENTERPRISE 0x0cb7U // Singatron Enterprise Co., Ltd +#define UHS_VID_OPTICIS 0x0cb8U // Opticis Co., Ltd +#define UHS_VID_TRUST_ELECTRONIC_SHANGHAI 0x0cbaU // Trust Electronic (Shanghai) Co., Ltd +#define UHS_VID_SHANGHAI_DARONG_ELECTRONICS 0x0cbbU // Shanghai Darong Electronics Co., Ltd +#define UHS_VID_PALMAX_TECHNOLOGY 0x0cbcU // Palmax Technology Co., Ltd +#define UHS_VID_PENTEL_CO_LTD_ELECTRONICS_EQUIPMENT_DIV 0x0cbdU // Pentel Co., Ltd (Electronics Equipment Div.) +#define UHS_VID_KERYX_TECHNOLOGIES 0x0cbeU // Keryx Technologies, Inc. +#define UHS_VID_UNION_GENIUS_COMPUTER 0x0cbfU // Union Genius Computer Co., Ltd +#define UHS_VID_KUON_YI_INDUSTRIAL 0x0cc0U // Kuon Yi Industrial Corp. +#define UHS_VID_GIVEN_IMAGING 0x0cc1U // Given Imaging, Ltd +#define UHS_VID_TIMEX 0x0cc2U // Timex Corp. +#define UHS_VID_RIMAGE 0x0cc3U // Rimage Corp. +#define UHS_VID_EMSYS 0x0cc4U // emsys GmbH +#define UHS_VID_SENDO 0x0cc5U // Sendo +#define UHS_VID_INTERMAGIC 0x0cc6U // Intermagic Corp. +#define UHS_VID_KONTRON_MEDICAL_AG 0x0cc7U // Kontron Medical AG +#define UHS_VID_TECHNOTOOLS 0x0cc8U // Technotools Corp. +#define UHS_VID_BROADMAX_TECHNOLOGIES 0x0cc9U // BroadMAX Technologies, Inc. +#define UHS_VID_AMPHENOL 0x0ccaU // Amphenol +#define UHS_VID_SKNET 0x0ccbU // SKNet Co., Ltd +#define UHS_VID_DOMEX_TECHNOLOGY 0x0cccU // Domex Technology Corp. +#define UHS_VID_TERRATEC_ELECTRONIC 0x0ccdU // TerraTec Electronic GmbH +#define UHS_VID_BANG_OLUFSEN 0x0cd4U // Bang Olufsen +#define UHS_VID_LABJACK_CORPORATION 0x0cd5U // LabJack Corporation +#define UHS_VID_NEWCHIP_SRL 0x0cd7U // NewChip S.r.l. +#define UHS_VID_JS_DIGITECH 0x0cd8U // JS Digitech, Inc. +#define UHS_VID_HITACHI_SHIN_DIN_CABLE 0x0cd9U // Hitachi Shin Din Cable, Ltd +#define UHS_VID_Z_COM 0x0cdeU // Z-Com +#define UHS_VID_VALIDATION_TECHNOLOGIES_INTERNATIONAL 0x0ce5U // Validation Technologies International +#define UHS_VID_PICO_TECHNOLOGY 0x0ce9U // Pico Technology +#define UHS_VID_E_CONN_ELECTRONIC 0x0cf1U // e-Conn Electronic Co., Ltd +#define UHS_VID_ENE_TECHNOLOGY 0x0cf2U // ENE Technology, Inc. +#define UHS_VID_ATHEROS_COMMUNICATIONS 0x0cf3U // Atheros Communications, Inc. +#define UHS_VID_FOMTEX 0x0cf4U // Fomtex Corp. +#define UHS_VID_CELLINK 0x0cf5U // Cellink Co., Ltd +#define UHS_VID_COMPUCABLE 0x0cf6U // Compucable Corp. +#define UHS_VID_ISHONI_NETWORKS 0x0cf7U // ishoni Networks +#define UHS_VID_CLARISYS 0x0cf8U // Clarisys, Inc. +#define UHS_VID_CENTRAL_SYSTEM_RESEARCH 0x0cf9U // Central System Research Co., Ltd +#define UHS_VID_INVISO 0x0cfaU // Inviso, Inc. +#define UHS_VID_MINOLTA_QMS 0x0cfcU // Minolta-QMS, Inc. +#define UHS_VID_SAFA_MEDIA 0x0cffU // SAFA MEDIA Co., Ltd. +#define UHS_VID_TELOS_EDV_SYSTEMENTWICKLUNG 0x0d06U // telos EDV Systementwicklung GmbH +#define UHS_VID_UTSTARCOM 0x0d08U // UTStarcom +#define UHS_VID_CONTEMPORARY_CONTROLS 0x0d0bU // Contemporary Controls +#define UHS_VID_ASTRON_ELECTRONICS 0x0d0cU // Astron Electronics Co., Ltd +#define UHS_VID_MKNET 0x0d0dU // MKNet Corp. +#define UHS_VID_HYBRID_NETWORKS 0x0d0eU // Hybrid Networks, Inc. +#define UHS_VID_FENG_SHIN_CABLE 0x0d0fU // Feng Shin Cable Co., Ltd +#define UHS_VID_ELASTIC_NETWORKS 0x0d10U // Elastic Networks +#define UHS_VID_MASPRO_DENKOH 0x0d11U // Maspro Denkoh Corp. +#define UHS_VID_HANSOL_ELECTRONICS 0x0d12U // Hansol Electronics, Inc. +#define UHS_VID_BMF 0x0d13U // BMF Corp. +#define UHS_VID_ARRAY_COMM 0x0d14U // Array Comm, Inc. +#define UHS_VID_ONSTREAM_BV 0x0d15U // OnStream b.v. +#define UHS_VID_HI_TOUCH_IMAGING_TECHNOLOGIES 0x0d16U // Hi-Touch Imaging Technologies Co., Ltd +#define UHS_VID_NALTEC 0x0d17U // NALTEC, Inc. +#define UHS_VID_COAXMEDIA 0x0d18U // coaXmedia +#define UHS_VID_HANK_CONNECTION_INDUSTRIAL 0x0d19U // Hank Connection Industrial Co., Ltd +#define UHS_VID_NXP 0x0d28U // NXP +#define UHS_VID_LEO_HUI_ELECTRIC_WIRE_AND_CABLE 0x0d32U // Leo Hui Electric Wire & Cable Co., Ltd +#define UHS_VID_AIRSPEAK 0x0d33U // AirSpeak, Inc. +#define UHS_VID_REARDEN_STEEL_TECHNOLOGIES 0x0d34U // Rearden Steel Technologies +#define UHS_VID_DAH_KUN 0x0d35U // Dah Kun Co., Ltd +#define UHS_VID_POSIFLEX_TECHNOLOGIES 0x0d3aU // Posiflex Technologies, Inc. +#define UHS_VID_SRI_CABLE_TECHNOLOGY 0x0d3cU // Sri Cable Technology, Ltd +#define UHS_VID_TANGTOP_TECHNOLOGY 0x0d3dU // Tangtop Technology Co., Ltd +#define UHS_VID_FITCOM 0x0d3eU // Fitcom, inc. +#define UHS_VID_MTS_SYSTEMS 0x0d3fU // MTS Systems Corp. +#define UHS_VID_ASCOR 0x0d40U // Ascor, Inc. +#define UHS_VID_TA_YUN_TERMINALS_INDUSTRIAL 0x0d41U // Ta Yun Terminals Industrial Co., Ltd +#define UHS_VID_FULL_DER 0x0d42U // Full Der Co., Ltd +#define UHS_VID_KOBIL_SYSTEMS 0x0d46U // Kobil Systems GmbH +#define UHS_VID_PROMETHEAN_LIMITED 0x0d48U // Promethean Limited +#define UHS_VID_MAXTOR 0x0d49U // Maxtor +#define UHS_VID_NF 0x0d4aU // NF Corp. +#define UHS_VID_GRAPE_SYSTEMS 0x0d4bU // Grape Systems, Inc. +#define UHS_VID_TEDAS_AG 0x0d4cU // Tedas AG +#define UHS_VID_COHERENT 0x0d4dU // Coherent, Inc. +#define UHS_VID_AGERE_SYSTEMS_NETHERLAND_BV 0x0d4eU // Agere Systems Netherland BV +#define UHS_VID_EADS_AIRBUS_FRANCE 0x0d4fU // EADS Airbus France +#define UHS_VID_CLEWARE 0x0d50U // Cleware GmbH +#define UHS_VID_VOLEX_ASIA_PTE 0x0d51U // Volex (Asia) Pte., Ltd +#define UHS_VID_HMI 0x0d53U // HMI Co., Ltd +#define UHS_VID_HOLON 0x0d54U // Holon Corp. +#define UHS_VID_ASKA_TECHNOLOGIES 0x0d55U // ASKA Technologies, Inc. +#define UHS_VID_AVLAB_TECHNOLOGY 0x0d56U // AVLAB Technology, Inc. +#define UHS_VID_SOLOMON_MICROTECH 0x0d57U // Solomon Microtech, Ltd +#define UHS_VID_SMC_NETWORKS 0x0d5cU // SMC Networks, Inc. +#define UHS_VID_MYACOM 0x0d5eU // Myacom, Ltd +#define UHS_VID_CSI 0x0d5fU // CSI, Inc. +#define UHS_VID_IVL_TECHNOLOGIES 0x0d60U // IVL Technologies, Ltd +#define UHS_VID_MEILU_ELECTRONICS_SHENZHEN 0x0d61U // Meilu Electronics (Shenzhen) Co., Ltd +#define UHS_VID_DARFON_ELECTRONICS 0x0d62U // Darfon Electronics Corp. +#define UHS_VID_FRITZ_GEGAUF_AG 0x0d63U // Fritz Gegauf AG +#define UHS_VID_DXG_TECHNOLOGY 0x0d64U // DXG Technology Corp. +#define UHS_VID_KMJP 0x0d65U // KMJP Co., Ltd +#define UHS_VID_TMT 0x0d66U // TMT +#define UHS_VID_ADVANET 0x0d67U // Advanet, Inc. +#define UHS_VID_SUPER_LINK_ELECTRONICS 0x0d68U // Super Link Electronics Co., Ltd +#define UHS_VID_NSI 0x0d69U // NSI +#define UHS_VID_MEGAPOWER_INTERNATIONAL 0x0d6aU // Megapower International Corp. +#define UHS_VID_AND_OR_LOGIC 0x0d6bU // And-Or Logic +#define UHS_VID_TRY_COMPUTER 0x0d70U // Try Computer Co., Ltd +#define UHS_VID_HIRAKAWA_HEWTECH 0x0d71U // Hirakawa Hewtech Corp. +#define UHS_VID_WINMATE_COMMUNICATION 0x0d72U // Winmate Communication, Inc. +#define UHS_VID_HITS_COMMUNICATIONS 0x0d73U // Hit's Communications, Inc. +#define UHS_VID_MFP_KOREA 0x0d76U // MFP Korea, Inc. +#define UHS_VID_POWER_SENTRYNEWPOINT 0x0d77U // Power Sentry/Newpoint +#define UHS_VID_JAPAN_DISTRIBUTOR 0x0d78U // Japan Distributor Corp. +#define UHS_VID_MARX_DATENTECHNIK 0x0d7aU // MARX Datentechnik GmbH +#define UHS_VID_WELLCO_TECHNOLOGY 0x0d7bU // Wellco Technology Co., Ltd +#define UHS_VID_TAIWAN_LINE_TEK_ELECTRONIC 0x0d7cU // Taiwan Line Tek Electronic Co., Ltd +#define UHS_VID_PHISON_ELECTRONICS 0x0d7dU // Phison Electronics Corp. +#define UHS_VID_AMERICAN_COMPUTER_AND_DIGITAL_COMPONENTS 0x0d7eU // American Computer & Digital Components +#define UHS_VID_ESSENTIAL_REALITY 0x0d7fU // Essential Reality LLC +#define UHS_VID_HR_SILVINE_ELECTRONICS 0x0d80U // H.R. Silvine Electronics, Inc. +#define UHS_VID_TECHNOVISION 0x0d81U // TechnoVision +#define UHS_VID_THINK_OUTSIDE 0x0d83U // Think Outside, Inc. +#define UHS_VID_DOLBY_LABORATORIES 0x0d87U // Dolby Laboratories Inc. +#define UHS_VID_OZ_SOFTWARE 0x0d89U // Oz Software +#define UHS_VID_KING_JIM 0x0d8aU // King Jim Co., Ltd +#define UHS_VID_ASCOM_TELECOMMUNICATIONS 0x0d8bU // Ascom Telecommunications, Ltd +#define UHS_VID_C_MEDIA_ELECTRONICS 0x0d8cU // C-Media Electronics, Inc. +#define UHS_VID_PROMOTION_AND_DISPLAY_TECHNOLOGY 0x0d8dU // Promotion & Display Technology, Ltd +#define UHS_VID_GLOBAL_SUN_TECHNOLOGY 0x0d8eU // Global Sun Technology, Inc. +#define UHS_VID_PITNEY_BOWES 0x0d8fU // Pitney Bowes +#define UHS_VID_SURE_FIRE_ELECTRICAL 0x0d90U // Sure-Fire Electrical Corp. +#define UHS_VID_SKANHEX_TECHNOLOGY 0x0d96U // Skanhex Technology, Inc. +#define UHS_VID_SANTA_BARBARA_INSTRUMENT_GROUP 0x0d97U // Santa Barbara Instrument Group +#define UHS_VID_MARS_SEMICONDUCTOR 0x0d98U // Mars Semiconductor Corp. +#define UHS_VID_TRAZER_TECHNOLOGIES 0x0d99U // Trazer Technologies, Inc. +#define UHS_VID_RTX_TELECOM_AS 0x0d9aU // RTX Telecom AS +#define UHS_VID_TAT_SHING_ELECTRICAL 0x0d9bU // Tat Shing Electrical Co. +#define UHS_VID_CHEE_CHEN_HI_TECHNOLOGY 0x0d9cU // Chee Chen Hi-Technology Co., Ltd +#define UHS_VID_SANWA_SUPPLY 0x0d9dU // Sanwa Supply, Inc. +#define UHS_VID_AVAYA 0x0d9eU // Avaya +#define UHS_VID_POWERCOM 0x0d9fU // Powercom Co., Ltd +#define UHS_VID_DANGER_RESEARCH 0x0da0U // Danger Research +#define UHS_VID_SUZHOU_PETERS_PRECISE_INDUSTRIAL 0x0da1U // Suzhou Peter's Precise Industrial Co., Ltd +#define UHS_VID_LAND_INSTRUMENTS_INTERNATIONAL 0x0da2U // Land Instruments International, Ltd +#define UHS_VID_NIPPON_ELECTRO_SENSORY_DEVICES 0x0da3U // Nippon Electro-Sensory Devices Corp. +#define UHS_VID_POLAR_ELECTRO_OY 0x0da4U // Polar Electro Oy +#define UHS_VID_IOGEAR 0x0da7U // IOGear, Inc. +#define UHS_VID_SOFTDSP 0x0da8U // softDSP Co., Ltd +#define UHS_VID_CUBIG_GROUP 0x0dabU // Cubig Group +#define UHS_VID_WESTOVER_SCIENTIFIC 0x0dadU // Westover Scientific +#define UHS_VID_MICRO_STAR_INTERNATIONAL 0x0db0U // Micro Star International +#define UHS_VID_WEN_TE_ELECTRONICS 0x0db1U // Wen Te Electronics Co., Ltd +#define UHS_VID_SHIAN_HWI_PLUG_PARTS_PLASTIC_FACTORY 0x0db2U // Shian Hwi Plug Parts, Plastic Factory +#define UHS_VID_TEKRAM_TECHNOLOGY_1 0x0db3U // Tekram Technology Co., Ltd +#define UHS_VID_CHUNG_FU_CHEN_YEH_ENTERPRISE 0x0db4U // Chung Fu Chen Yeh Enterprise Corp. +#define UHS_VID_ACCESS_IS 0x0db5U // Access IS +#define UHS_VID_ELCON_SYSTEMTECHNIK 0x0db7U // ELCON Systemtechnik +#define UHS_VID_DIGIDESIGN 0x0dbaU // Digidesign +#define UHS_VID_AANDD_MEDICAL 0x0dbcU // A&D Medical +#define UHS_VID_JIUH_SHIUH_PRECISION_INDUSTRY 0x0dbeU // Jiuh Shiuh Precision Industry Co., Ltd +#define UHS_VID_JESS_LINK_INTERNATIONAL 0x0dbfU // Jess-Link International +#define UHS_VID_G7_SOLUTIONS_FORMERLY_GREAT_NOTIONS 0x0dc0U // G7 Solutions (formerly Great Notions) +#define UHS_VID_TAMAGAWA_SEIKI 0x0dc1U // Tamagawa Seiki Co., Ltd +#define UHS_VID_ATHENA_SMARTCARD_SOLUTIONS 0x0dc3U // Athena Smartcard Solutions, Inc. +#define UHS_VID_MACPOWER_PERIPHERALS 0x0dc4U // Macpower Peripherals, Ltd +#define UHS_VID_SDK 0x0dc5U // SDK Co., Ltd +#define UHS_VID_PRECISION_SQUARED_TECHNOLOGY 0x0dc6U // Precision Squared Technology Corp. +#define UHS_VID_FIRST_CABLE_LINE 0x0dc7U // First Cable Line, Inc. +#define UHS_VID_NETWORKFAB 0x0dcdU // NetworkFab Corp. +#define UHS_VID_ACCESS_SOLUTIONS 0x0dd0U // Access Solutions +#define UHS_VID_CONTEK_ELECTRONICS 0x0dd1U // Contek Electronics Co., Ltd +#define UHS_VID_POWER_QUOTIENT_INTERNATIONAL 0x0dd2U // Power Quotient International Co., Ltd +#define UHS_VID_MEDIAQ 0x0dd3U // MediaQ +#define UHS_VID_CUSTOM_ENGINEERING_SPA 0x0dd4U // Custom Engineering SPA +#define UHS_VID_CALIFORNIA_MICRO_DEVICES 0x0dd5U // California Micro Devices +#define UHS_VID_KOCOM 0x0dd7U // Kocom Co., Ltd +#define UHS_VID_NETAC_TECHNOLOGY 0x0dd8U // Netac Technology Co., Ltd +#define UHS_VID_HIGHSPEED_SURFING 0x0dd9U // HighSpeed Surfing +#define UHS_VID_INTEGRATED_CIRCUIT_SOLUTION 0x0ddaU // Integrated Circuit Solution, Inc. +#define UHS_VID_TAMARACK 0x0ddbU // Tamarack, Inc. +#define UHS_VID_DATELINK_TECHNOLOGY 0x0dddU // Datelink Technology Co., Ltd +#define UHS_VID_UBICOM 0x0ddeU // Ubicom, Inc. +#define UHS_VID_BD_CONSUMER_HEALTHCARE 0x0de0U // BD Consumer Healthcare +#define UHS_VID_USBMICRO 0x0de7U // USBmicro +#define UHS_VID_UTECH_ELECTRONIC_DG 0x0deaU // UTECH Electronic (D.G.) Co., Ltd. +#define UHS_VID_NOVASONICS 0x0dedU // Novasonics +#define UHS_VID_LIFETIME_MEMORY_PRODUCTS 0x0deeU // Lifetime Memory Products +#define UHS_VID_FULL_RISE_ELECTRONIC 0x0defU // Full Rise Electronic Co., Ltd +#define UHS_VID_NETANDSYS 0x0df4U // NET&SYS +#define UHS_VID_SITECOM_EUROPE_BV 0x0df6U // Sitecom Europe B.V. +#define UHS_VID_MOBILE_ACTION_TECHNOLOGY 0x0df7U // Mobile Action Technology, Inc. +#define UHS_VID_TOYO_COMMUNICATION_EQUIPMENT 0x0dfaU // Toyo Communication Equipment Co., Ltd +#define UHS_VID_GENERALTOUCH_TECHNOLOGY 0x0dfcU // GeneralTouch Technology Co., Ltd +#define UHS_VID_NIPPON_SYSTEMWARE 0x0e03U // Nippon Systemware Co., Ltd +#define UHS_VID_WINBEST_TECHNOLOGY 0x0e08U // Winbest Technology Co., Ltd +#define UHS_VID_AMIGO_TECHNOLOGY 0x0e0bU // Amigo Technology Inc. +#define UHS_VID_GESYTEC 0x0e0cU // Gesytec +#define UHS_VID_PICOQUANT 0x0e0dU // PicoQuant GmbH +#define UHS_VID_VMWARE 0x0e0fU // VMware, Inc. +#define UHS_VID_JMTEK_1 0x0e16U // JMTek, LLC +#define UHS_VID_WALEX_ELECTRONIC 0x0e17U // Walex Electronic, Ltd +#define UHS_VID_UNISYS_1 0x0e1aU // Unisys +#define UHS_VID_CREWAVE 0x0e1bU // Crewave +#define UHS_VID_PEGASUS_TECHNOLOGIES 0x0e20U // Pegasus Technologies Ltd. +#define UHS_VID_COWON_SYSTEMS 0x0e21U // Cowon Systems, Inc. +#define UHS_VID_SYMBIAN 0x0e22U // Symbian Ltd. +#define UHS_VID_LIOU_YUANE_ENTERPRISE 0x0e23U // Liou Yuane Enterprise Co., Ltd +#define UHS_VID_VINCHIP_SYSTEMS 0x0e25U // VinChip Systems, Inc. +#define UHS_VID_J_PHONE_EAST 0x0e26U // J-Phone East Co., Ltd +#define UHS_VID_HEARTMATH 0x0e30U // HeartMath LLC +#define UHS_VID_MICRO_COMPUTER_CONTROL 0x0e34U // Micro Computer Control Corp. +#define UHS_VID_3PEA_TECHNOLOGIES 0x0e35U // 3Pea Technologies, Inc. +#define UHS_VID_TIEPIE_ENGINEERING 0x0e36U // TiePie engineering +#define UHS_VID_STRATITEC 0x0e38U // Stratitec, Inc. +#define UHS_VID_SMART_MODULAR_TECHNOLOGIES 0x0e39U // Smart Modular Technologies, Inc. +#define UHS_VID_NEOSTAR_TECHNOLOGY 0x0e3aU // Neostar Technology Co., Ltd +#define UHS_VID_MANSELLA 0x0e3bU // Mansella, Ltd +#define UHS_VID_LINE6 0x0e41U // Line6, Inc. +#define UHS_VID_SUN_RISEFUL_TECHNOLOGY 0x0e44U // Sun-Riseful Technology Co., Ltd. +#define UHS_VID_JULIA 0x0e48U // Julia Corp., Ltd +#define UHS_VID_SHENZHEN_BAO_HING_ELECTRIC_WIRE_AND_CABLE_MFR 0x0e4aU // Shenzhen Bao Hing Electric Wire & Cable Mfr. Co. +#define UHS_VID_RADICA_GAMES 0x0e4cU // Radica Games, Ltd +#define UHS_VID_TECHNODATA_INTERWARE 0x0e50U // TechnoData Interware +#define UHS_VID_SPEED_DRAGON_MULTIMEDIA 0x0e55U // Speed Dragon Multimedia, Ltd +#define UHS_VID_KINGSTON_TECHNOLOGY_COMPANY 0x0e56U // Kingston Technology Company, Inc. +#define UHS_VID_ACTIVE 0x0e5aU // Active Co., Ltd +#define UHS_VID_UNION_POWER_INFORMATION_INDUSTRIAL 0x0e5bU // Union Power Information Industrial Co., Ltd +#define UHS_VID_BITLAND_INFORMATION_TECHNOLOGY 0x0e5cU // Bitland Information Technology Co., Ltd +#define UHS_VID_NELTRON_INDUSTRIAL 0x0e5dU // Neltron Industrial Co., Ltd +#define UHS_VID_CONWISE_TECHNOLOGY 0x0e5eU // Conwise Technology Co., Ltd. +#define UHS_VID_HAWKING_TECHNOLOGIES 0x0e66U // Hawking Technologies +#define UHS_VID_FOSSIL 0x0e67U // Fossil, Inc. +#define UHS_VID_MEGAWIN_TECHNOLOGY 0x0e6aU // Megawin Technology Co., Ltd +#define UHS_VID_LOGIC3 0x0e6fU // Logic3 +#define UHS_VID_TOKYO_ELECTRONIC_INDUSTRY 0x0e70U // Tokyo Electronic Industry Co., Ltd +#define UHS_VID_HSI_CHIN_ELECTRONICS 0x0e72U // Hsi-Chin Electronics Co., Ltd +#define UHS_VID_TVS_ELECTRONICS 0x0e75U // TVS Electronics, Ltd +#define UHS_VID_ARCHOS 0x0e79U // Archos, Inc. +#define UHS_VID_ON_TECH_INDUSTRY 0x0e7bU // On-Tech Industry Co., Ltd +#define UHS_VID_GMATE 0x0e7eU // Gmate, Inc. +#define UHS_VID_CHING_TAI_ELECTRIC_WIRE_AND_CABLE 0x0e82U // Ching Tai Electric Wire & Cable Co., Ltd +#define UHS_VID_SHIN_AN_WIRE_AND_CABLE 0x0e83U // Shin An Wire & Cable Co. +#define UHS_VID_WELL_FORCE_ELECTRONIC 0x0e8cU // Well Force Electronic Co., Ltd +#define UHS_VID_MEDIATEK_1 0x0e8dU // MediaTek Inc. +#define UHS_VID_GREENASIA 0x0e8fU // GreenAsia Inc. +#define UHS_VID_WIEBETECH 0x0e90U // WiebeTech, LLC +#define UHS_VID_VTECH_ENGINEERING_CANADA 0x0e91U // VTech Engineering Canada, Ltd +#define UHS_VID_CS_GLORY_ENTERPRISE 0x0e92U // C's Glory Enterprise Co., Ltd +#define UHS_VID_EM_TECHNICS 0x0e93U // eM Technics Co., Ltd +#define UHS_VID_FUTURE_TECHNOLOGY 0x0e95U // Future Technology Co., Ltd +#define UHS_VID_APLUX_COMMUNICATIONS 0x0e96U // Aplux Communications, Ltd +#define UHS_VID_FINGERWORKS 0x0e97U // Fingerworks, Inc. +#define UHS_VID_ADVANCED_ANALOGIC_TECHNOLOGIES 0x0e98U // Advanced Analogic Technologies, Inc. +#define UHS_VID_PARALLEL_DICE 0x0e99U // Parallel Dice Co., Ltd +#define UHS_VID_TA_HSING_INDUSTRIES 0x0e9aU // TA HSING Industries, Ltd +#define UHS_VID_ADTEC 0x0e9bU // ADTEC Corp. +#define UHS_VID_STREAMZAP 0x0e9cU // Streamzap, Inc. +#define UHS_VID_TAMURA 0x0e9fU // Tamura Corp. +#define UHS_VID_OURS_TECHNOLOGY 0x0ea0U // Ours Technology, Inc. +#define UHS_VID_NIHON_COMPUTER 0x0ea6U // Nihon Computer Co., Ltd +#define UHS_VID_MSL_ENTERPRISES 0x0ea7U // MSL Enterprises Corp. +#define UHS_VID_CENDYNE 0x0ea8U // CenDyne, Inc. +#define UHS_VID_HUMAX_1 0x0eadU // Humax Co., Ltd +#define UHS_VID_NOVATECH 0x0eb0U // NovaTech +#define UHS_VID_WIS_TECHNOLOGIES 0x0eb1U // WIS Technologies, Inc. +#define UHS_VID_Y_S_ELECTRONIC 0x0eb2U // Y-S Electronic Co., Ltd +#define UHS_VID_SAINT_TECHNOLOGY 0x0eb3U // Saint Technology Corp. +#define UHS_VID_ENDOR_AG 0x0eb7U // Endor AG +#define UHS_VID_METTLER_TOLEDO 0x0eb8U // Mettler Toledo +#define UHS_VID_THERMO_FISHER_SCIENTIFIC 0x0ebbU // Thermo Fisher Scientific +#define UHS_VID_VWEB 0x0ebeU // VWeb Corp. +#define UHS_VID_OMEGA_TECHNOLOGY_OF_TAIWAN 0x0ebfU // Omega Technology of Taiwan, Inc. +#define UHS_VID_LHI_TECHNOLOGY_CHINA 0x0ec0U // LHI Technology (China) Co., Ltd +#define UHS_VID_ABIT_COMPUTER 0x0ec1U // Abit Computer Corp. +#define UHS_VID_SWEETRAY_INDUSTRIAL 0x0ec2U // Sweetray Industrial, Ltd +#define UHS_VID_AXELL 0x0ec3U // Axell Co., Ltd +#define UHS_VID_BALLRACING_DEVELOPMENTS 0x0ec4U // Ballracing Developments, Ltd +#define UHS_VID_GT_INFORMATION_SYSTEM 0x0ec5U // GT Information System Co., Ltd +#define UHS_VID_INNOVISION_MULTIMEDIA 0x0ec6U // InnoVISION Multimedia, Ltd +#define UHS_VID_THETA_LINK 0x0ec7U // Theta Link Corp. +#define UHS_VID_LITE_ON_IT 0x0ecdU // Lite-On IT Corp. +#define UHS_VID_TAISOL_ELECTRONICS 0x0eceU // TaiSol Electronics Co., Ltd +#define UHS_VID_PHOGENIX_IMAGING 0x0ecfU // Phogenix Imaging, LLC +#define UHS_VID_WINMAXGROUP 0x0ed1U // WinMaxGroup +#define UHS_VID_KYOTO_MICRO_COMPUTER 0x0ed2U // Kyoto Micro Computer Co., Ltd +#define UHS_VID_WING_TECH_ENTERPRISE 0x0ed3U // Wing-Tech Enterprise Co., Ltd +#define UHS_VID_FIBERBYTE 0x0ed5U // Fiberbyte +#define UHS_VID_NORIAKE_ITRON 0x0edaU // Noriake Itron Corp. +#define UHS_VID_E_MDT 0x0edfU // e-MDT Co., Ltd +#define UHS_VID_SHIMA_SEIKI_MFG 0x0ee0U // Shima Seiki Mfg., Ltd +#define UHS_VID_SAROTECH 0x0ee1U // Sarotech Co., Ltd +#define UHS_VID_AMI_SEMICONDUCTOR 0x0ee2U // AMI Semiconductor, Inc. +#define UHS_VID_COMTRUE_TECHNOLOGY 0x0ee3U // ComTrue Technology Corp. +#define UHS_VID_SUNRICH_TECHNOLOGY 0x0ee4U // Sunrich Technology, Ltd +#define UHS_VID_DIGITAL_STREAM_TECHNOLOGY 0x0eeeU // Digital Stream Technology, Inc. +#define UHS_VID_D_WAV_SCIENTIFIC 0x0eefU // D-WAV Scientific Co., Ltd +#define UHS_VID_HITACHI_CABLE 0x0ef0U // Hitachi Cable, Ltd +#define UHS_VID_AICHI_MICRO_INTELLIGENT 0x0ef1U // Aichi Micro Intelligent Corp. +#define UHS_VID_IO_MAGIC 0x0ef2U // I/O Magic Corp. +#define UHS_VID_LYNN_PRODUCTS 0x0ef3U // Lynn Products, Inc. +#define UHS_VID_DSI_DATOTECH 0x0ef4U // DSI Datotech +#define UHS_VID_POINTCHIPS 0x0ef5U // PointChips +#define UHS_VID_YIELD_MICROELECTRONICS 0x0ef6U // Yield Microelectronics Corp. +#define UHS_VID_SM_TECH_CO_LTD_TULIP 0x0ef7U // SM Tech Co., Ltd (Tulip) +#define UHS_VID_OASIS_SEMICONDUCTOR 0x0efdU // Oasis Semiconductor +#define UHS_VID_WEM_TECHNOLOGY 0x0efeU // Wem Technology, Inc. +#define UHS_VID_UNITEK_UPS_SYSTEMS 0x0f03U // Unitek UPS Systems +#define UHS_VID_VISUAL_FRONTIER_ENTERPRISE 0x0f06U // Visual Frontier Enterprise Co., Ltd +#define UHS_VID_CSL_WIRE_AND_PLUG_SHEN_ZHEN 0x0f08U // CSL Wire & Plug (Shen Zhen) Co. +#define UHS_VID_CAS 0x0f0cU // CAS Corp. +#define UHS_VID_HORI 0x0f0dU // Hori Co., Ltd +#define UHS_VID_ENERGY_FULL 0x0f0eU // Energy Full Corp. +#define UHS_VID_LD_DIDACTIC 0x0f11U // LD Didactic GmbH +#define UHS_VID_MARS_ENGINEERING 0x0f12U // Mars Engineering Corp. +#define UHS_VID_ACETEK_TECHNOLOGY 0x0f13U // Acetek Technology Co., Ltd +#define UHS_VID_INGENICO_1 0x0f14U // Ingenico +#define UHS_VID_FINGER_LAKES_INSTRUMENTATION 0x0f18U // Finger Lakes Instrumentation +#define UHS_VID_ORACOM 0x0f19U // Oracom Co., Ltd +#define UHS_VID_ONSET_COMPUTER 0x0f1bU // Onset Computer Corp. +#define UHS_VID_FUNAI_ELECTRIC 0x0f1cU // Funai Electric Co., Ltd +#define UHS_VID_IWILL 0x0f1dU // Iwill Corp. +#define UHS_VID_IOI_TECHNOLOGY 0x0f21U // IOI Technology Corp. +#define UHS_VID_SENIOR_INDUSTRIES 0x0f22U // Senior Industries, Inc. +#define UHS_VID_LEADER_TECH_MANUFACTURER 0x0f23U // Leader Tech Manufacturer Co., Ltd +#define UHS_VID_FLEX_P_INDUSTRIES_SND_BHD 0x0f24U // Flex-P Industries, Snd., Bhd. +#define UHS_VID_VIPOWER 0x0f2dU // ViPower, Inc. +#define UHS_VID_GENIALITY_MAPLE_TECHNOLOGY 0x0f2eU // Geniality Maple Technology Co., Ltd +#define UHS_VID_PRIVA_DESIGN_SERVICES 0x0f2fU // Priva Design Services +#define UHS_VID_JESS_TECHNOLOGY 0x0f30U // Jess Technology Co., Ltd +#define UHS_VID_CHRYSALIS_DEVELOPMENT 0x0f31U // Chrysalis Development +#define UHS_VID_YFC_BONEAGLE_ELECTRIC 0x0f32U // YFC-BonEagle Electric Co., Ltd +#define UHS_VID_KOKUYO 0x0f37U // Kokuyo Co., Ltd +#define UHS_VID_NIEN_YI_INDUSTRIAL 0x0f38U // Nien-Yi Industrial Corp. +#define UHS_VID_TG3_ELECTRONICS_1 0x0f39U // TG3 Electronics +#define UHS_VID_AIRPRIME_INCORPORATED 0x0f3dU // Airprime, Incorporated +#define UHS_VID_RDC_SEMICONDUCTOR 0x0f41U // RDC Semiconductor Co., Ltd +#define UHS_VID_NITAL_CONSULTING_SERVICES 0x0f42U // Nital Consulting Services, Inc. +#define UHS_VID_POLHEMUS 0x0f44U // Polhemus +#define UHS_VID_ST_JOHN_TECHNOLOGY 0x0f4bU // St. John Technology Co., Ltd +#define UHS_VID_WORLDWIDE_CABLE_OPTO 0x0f4cU // WorldWide Cable Opto Corp. +#define UHS_VID_MICROTUNE 0x0f4dU // Microtune, Inc. +#define UHS_VID_FREEDOM_SCIENTIFIC 0x0f4eU // Freedom Scientific +#define UHS_VID_WING_KEY_ELECTRICAL 0x0f52U // Wing Key Electrical Co., Ltd +#define UHS_VID_DONGGUAN_WHITE_HORSE_CABLE_FACTORY 0x0f53U // Dongguan White Horse Cable Factory, Ltd +#define UHS_VID_KAWAI_MUSICAL_INSTRUMENTS_MFG 0x0f54U // Kawai Musical Instruments Mfg. Co., Ltd +#define UHS_VID_AMBICOM 0x0f55U // AmbiCom, Inc. +#define UHS_VID_PRAIRIECOMM 0x0f5cU // Prairiecomm, Inc. +#define UHS_VID_NEWAGE_INTERNATIONAL 0x0f5dU // NewAge International, LLC +#define UHS_VID_KEY_TECHNOLOGY 0x0f5fU // Key Technology Corp. +#define UHS_VID_NTK 0x0f60U // NTK, Ltd +#define UHS_VID_VARIAN 0x0f61U // Varian, Inc. +#define UHS_VID_ACROX_TECHNOLOGIES 0x0f62U // Acrox Technologies Co., Ltd +#define UHS_VID_LEAPFROG_ENTERPRISES 0x0f63U // LeapFrog Enterprises +#define UHS_VID_KOBE_STEEL 0x0f68U // Kobe Steel, Ltd +#define UHS_VID_DIONEX 0x0f69U // Dionex Corp. +#define UHS_VID_VIBREN_TECHNOLOGIES 0x0f6aU // Vibren Technologies, Inc. +#define UHS_VID_INTELLIGENT_SYSTEMS 0x0f6eU // INTELLIGENT SYSTEMS +#define UHS_VID_DFI_1 0x0f73U // DFI +#define UHS_VID_GUNTERMANN_AND_DRUNCK 0x0f78U // Guntermann & Drunck GmbH +#define UHS_VID_DQ_TECHNOLOGY 0x0f7cU // DQ Technology, Inc. +#define UHS_VID_NETBOTZ 0x0f7dU // NetBotz, Inc. +#define UHS_VID_FLUKE 0x0f7eU // Fluke Corp. +#define UHS_VID_VTECH_HOLDINGS 0x0f88U // VTech Holdings, Ltd +#define UHS_VID_YAZAKI 0x0f8bU // Yazaki Corp. +#define UHS_VID_YOUNG_GENERATION_INTERNATIONAL 0x0f8cU // Young Generation International Corp. +#define UHS_VID_UNIWILL_COMPUTER 0x0f8dU // Uniwill Computer Corp. +#define UHS_VID_KINGNET_TECHNOLOGY 0x0f8eU // Kingnet Technology Co., Ltd +#define UHS_VID_SOMA_NETWORKS 0x0f8fU // Soma Networks +#define UHS_VID_CVILUX 0x0f97U // CviLux Corp. +#define UHS_VID_CYBERBANK 0x0f98U // CyberBank Corp. +#define UHS_VID_HYUN_WON 0x0f9cU // Hyun Won, Inc. +#define UHS_VID_LUCENT_TECHNOLOGIES_1 0x0f9eU // Lucent Technologies +#define UHS_VID_STARCONN_ELECTRONIC 0x0fa3U // Starconn Electronic Co., Ltd +#define UHS_VID_ATL_TECHNOLOGY 0x0fa4U // ATL Technology +#define UHS_VID_SOTEC 0x0fa5U // Sotec Co., Ltd +#define UHS_VID_EPOX_COMPUTER 0x0fa7U // Epox Computer Co., Ltd +#define UHS_VID_LOGIC_CONTROLS 0x0fa8U // Logic Controls, Inc. +#define UHS_VID_WINPOINT_ELECTRONIC 0x0fafU // Winpoint Electronic Corp. +#define UHS_VID_HAURTIAN_WIRE_AND_CABLE 0x0fb0U // Haurtian Wire & Cable Co., Ltd +#define UHS_VID_INCLOSE_DESIGN 0x0fb1U // Inclose Design, Inc. +#define UHS_VID_JUAN_CHERN_INDUSTRIAL 0x0fb2U // Juan-Chern Industrial Co., Ltd +#define UHS_VID_HEBER 0x0fb6U // Heber Ltd +#define UHS_VID_WISTRON 0x0fb8U // Wistron Corp. +#define UHS_VID_AACOM 0x0fb9U // AACom Corp. +#define UHS_VID_SAN_SHING_ELECTRONICS 0x0fbaU // San Shing Electronics Co., Ltd +#define UHS_VID_BITWISE_SYSTEMS 0x0fbbU // Bitwise Systems, Inc. +#define UHS_VID_MITAC_INTERNATINAL 0x0fc1U // Mitac Internatinal Corp. +#define UHS_VID_PLUG_AND_JACK_INDUSTRIAL 0x0fc2U // Plug and Jack Industrial, Inc. +#define UHS_VID_DELCOM_ENGINEERING 0x0fc5U // Delcom Engineering +#define UHS_VID_DATAPLUS_SUPPLIES 0x0fc6U // Dataplus Supplies, Inc. +#define UHS_VID_RESEARCH_IN_MOTION 0x0fcaU // Research In Motion, Ltd. +#define UHS_VID_SONY_ERICSSON_MOBILE_COMMUNICATIONS 0x0fceU // Sony Ericsson Mobile Communications AB +#define UHS_VID_DYNASTREAM_INNOVATIONS 0x0fcfU // Dynastream Innovations, Inc. +#define UHS_VID_TULIP_COMPUTERS_BV 0x0fd0U // Tulip Computers B.V. +#define UHS_VID_GIANT_ELECTRONICS 0x0fd1U // Giant Electronics Ltd. +#define UHS_VID_SEAC_BANCHE 0x0fd2U // Seac Banche +#define UHS_VID_TENOVIS_GMBH_AND_CO_KG 0x0fd4U // Tenovis GmbH & Co., KG +#define UHS_VID_DIRECT_ACCESS_TECHNOLOGY 0x0fd5U // Direct Access Technology, Inc. +#define UHS_VID_ELGATO_SYSTEMS 0x0fd9U // Elgato Systems GmbH +#define UHS_VID_QUANTEC_NETWORKS 0x0fdaU // Quantec Networks GmbH +#define UHS_VID_MICRO_PLUS 0x0fdcU // Micro Plus +#define UHS_VID_OREGON_SCIENTIFIC 0x0fdeU // Oregon Scientific +#define UHS_VID_OSTERHOUT_DESIGN_GROUP 0x0fe0U // Osterhout Design Group +#define UHS_VID_IN_TECH_ELECTRONICS 0x0fe4U // IN-Tech Electronics, Ltd +#define UHS_VID_GREENCONN_USA 0x0fe5U // Greenconn (U.S.A.), Inc. +#define UHS_VID_KONTRON_INDUSTRIAL_COMPUTER_SOURCE_ICS_ADVENT 0x0fe6U // Kontron (Industrial Computer Source / ICS Advent) +#define UHS_VID_DVICO 0x0fe9U // DVICO +#define UHS_VID_UNITED_COMPUTER_ACCESSORIES 0x0feaU // United Computer Accessories +#define UHS_VID_CRS_ELECTRONIC 0x0febU // CRS Electronic Co., Ltd +#define UHS_VID_UMC_ELECTRONICS 0x0fecU // UMC Electronics Co., Ltd +#define UHS_VID_ACCESS 0x0fedU // Access Co., Ltd +#define UHS_VID_XSIDO 0x0feeU // Xsido Corp. +#define UHS_VID_MJ_RESEARCH 0x0fefU // MJ Research, Inc. +#define UHS_VID_CORE_VALLEY 0x0ff6U // Core Valley Co., Ltd +#define UHS_VID_CHI_SHING_COMPUTER_ACCESSORIES 0x0ff7U // CHI SHING Computer Accessories Co., Ltd +#define UHS_VID_CLAVIA_DMI 0x0ffcU // Clavia DMI AB +#define UHS_VID_EARLYSENSE 0x0ffdU // EarlySense +#define UHS_VID_AOPEN 0x0fffU // Aopen, Inc. +#define UHS_VID_SPEED_TECH 0x1000U // Speed Tech Corp. +#define UHS_VID_RITRONICS_COMPONENTS_S_PTE 0x1001U // Ritronics Components (S) Pte., Ltd +#define UHS_VID_SIGMA 0x1003U // Sigma Corp. +#define UHS_VID_LG_ELECTRONICS 0x1004U // LG Electronics, Inc. +#define UHS_VID_APACER_TECHNOLOGY 0x1005U // Apacer Technology, Inc. +#define UHS_VID_IRIVER 0x1006U // iRiver, Ltd. +#define UHS_VID_EMUZED 0x1009U // Emuzed, Inc. +#define UHS_VID_AV_CHASEWAY 0x100aU // AV Chaseway, Ltd +#define UHS_VID_CHOU_CHIN_INDUSTRIAL 0x100bU // Chou Chin Industrial Co., Ltd +#define UHS_VID_NETOPIA 0x100dU // Netopia, Inc. +#define UHS_VID_FUKUDA_DENSHI 0x1010U // Fukuda Denshi Co., Ltd +#define UHS_VID_MOBILE_MEDIA_TECH 0x1011U // Mobile Media Tech. +#define UHS_VID_SDKM_FIBRES_WIRES_AND_CABLES_BERHAD 0x1012U // SDKM Fibres, Wires & Cables Berhad +#define UHS_VID_TST_TOUCHLESS_SENSOR_TECHNOLOGY_AG 0x1013U // TST-Touchless Sensor Technology AG +#define UHS_VID_DENSITRON_TECHNOLOGIES_PLC 0x1014U // Densitron Technologies PLC +#define UHS_VID_SOFTRONICS_PTY 0x1015U // Softronics Pty., Ltd +#define UHS_VID_XIAMEN_HUNGS_ENTERPRISE 0x1016U // Xiamen Hung's Enterprise Co., Ltd +#define UHS_VID_SPEEDY_INDUSTRIAL_SUPPLIES_PTE 0x1017U // Speedy Industrial Supplies, Pte., Ltd +#define UHS_VID_ELITEGROUP_COMPUTER_SYSTEMS_ECS 0x1019U // Elitegroup Computer Systems (ECS) +#define UHS_VID_LABTEC_1 0x1020U // Labtec +#define UHS_VID_SHINKO_SHOJI 0x1022U // Shinko Shoji Co., Ltd +#define UHS_VID_HYPER_PALTEK 0x1025U // Hyper-Paltek +#define UHS_VID_NEWLY 0x1026U // Newly Corp. +#define UHS_VID_TIME_DOMAIN 0x1027U // Time Domain +#define UHS_VID_INOVYS 0x1028U // Inovys Corp. +#define UHS_VID_ATLANTIC_COAST_TELESYS 0x1029U // Atlantic Coast Telesys +#define UHS_VID_RAMOS_TECHNOLOGY 0x102aU // Ramos Technology Co., Ltd +#define UHS_VID_INFOTRONIC_AMERICA 0x102bU // Infotronic America, Inc. +#define UHS_VID_ETOMS_ELECTRONICS 0x102cU // Etoms Electronics Corp. +#define UHS_VID_WINIC 0x102dU // Winic Corp. +#define UHS_VID_COMAX_TECHNOLOGY 0x1031U // Comax Technology, Inc. +#define UHS_VID_C_ONE_TECHNOLOGY 0x1032U // C-One Technology Corp. +#define UHS_VID_NUCAM 0x1033U // Nucam Corp. +#define UHS_VID_STEELSERIES_APS 0x1038U // SteelSeries ApS +#define UHS_VID_DEVOLO_AG 0x1039U // devolo AG +#define UHS_VID_PSA 0x103aU // PSA +#define UHS_VID_STANTON 0x103dU // Stanton +#define UHS_VID_ICREATE_TECHNOLOGIES 0x1043U // iCreate Technologies Corp. +#define UHS_VID_CHU_YUEN_ENTERPRISE 0x1044U // Chu Yuen Enterprise Co., Ltd +#define UHS_VID_WINBOND_ELECTRONICS_CORP_HEX_ 0x1046U // Winbond Electronics Corp. [hex] +#define UHS_VID_TARGUS_GROUP_INTERNATIONAL 0x1048U // Targus Group International +#define UHS_VID_MYLEX_BUSLOGIC 0x104bU // Mylex / Buslogic +#define UHS_VID_AMCO_TEC_INTERNATIONAL 0x104cU // AMCO TEC International, Inc. +#define UHS_VID_NEWPORT_CORPORATION 0x104dU // Newport Corporation +#define UHS_VID_WB_ELECTRONICS 0x104fU // WB Electronics +#define UHS_VID_YUBICOCOM 0x1050U // Yubico.com +#define UHS_VID_IMMANUEL_ELECTRONICS 0x1053U // Immanuel Electronics Co., Ltd +#define UHS_VID_BMS_INTERNATIONAL_BEHEER_NV 0x1054U // BMS International Beheer N.V. +#define UHS_VID_COMPLEX_MICRO_INTERCONNECTION 0x1055U // Complex Micro Interconnection Co., Ltd +#define UHS_VID_HSIN_CHEN_ENT 0x1056U // Hsin Chen Ent Co., Ltd +#define UHS_VID_ON_SEMICONDUCTOR 0x1057U // ON Semiconductor +#define UHS_VID_WESTERN_DIGITAL_TECHNOLOGIES 0x1058U // Western Digital Technologies, Inc. +#define UHS_VID_GIESECKE_AND_DEVRIENT 0x1059U // Giesecke & Devrient GmbH +#define UHS_VID_FOXCONN_INTERNATIONAL 0x105bU // Foxconn International, Inc. +#define UHS_VID_HONG_JI_ELECTRIC_WIRE_AND_CABLE_DONGGUAN 0x105cU // Hong Ji Electric Wire & Cable (Dongguan) Co., Ltd +#define UHS_VID_DELKIN_DEVICES 0x105dU // Delkin Devices, Inc. +#define UHS_VID_VALENCE_SEMICONDUCTOR_DESIGN 0x105eU // Valence Semiconductor Design, Ltd +#define UHS_VID_CHIN_SHONG_ENTERPRISE 0x105fU // Chin Shong Enterprise Co., Ltd +#define UHS_VID_EASTHOME_INDUSTRIAL 0x1060U // Easthome Industrial Co., Ltd +#define UHS_VID_MOTOROLA_ELECTRONICS_TAIWAN_LTD_HEX_ 0x1063U // Motorola Electronics Taiwan, Ltd [hex] +#define UHS_VID_CCYU_TECHNOLOGY 0x1065U // CCYU Technology +#define UHS_VID_LOYAL_LEGEND 0x106aU // Loyal Legend, Ltd +#define UHS_VID_CURITEL_COMMUNICATIONS 0x106cU // Curitel Communications, Inc. +#define UHS_VID_SAN_CHIEH_MANUFACTURING 0x106dU // San Chieh Manufacturing, Ltd +#define UHS_VID_CONECTL 0x106eU // ConectL +#define UHS_VID_MONEY_CONTROLS 0x106fU // Money Controls +#define UHS_VID_GCT_SEMICONDUCTOR 0x1076U // GCT Semiconductor, Inc. +#define UHS_VID_GATEWAY_1 0x107bU // Gateway, Inc. +#define UHS_VID_ARLEC_AUSTRALIA 0x107dU // Arlec Australia, Ltd +#define UHS_VID_MIDORIYA_ELECTRIC 0x107eU // Midoriya Electric Co., Ltd +#define UHS_VID_KIDZMOUSE 0x107fU // KidzMouse, Inc. +#define UHS_VID_SHIN_ETSUKAKEN 0x1082U // Shin-Etsukaken Co., Ltd +#define UHS_VID_CANON_ELECTRONICS 0x1083U // Canon Electronics, Inc. +#define UHS_VID_PANTECH 0x1084U // Pantech Co., Ltd +#define UHS_VID_CHLORIDE_POWER_PROTECTION 0x108aU // Chloride Power Protection +#define UHS_VID_GRAND_TEK_TECHNOLOGY 0x108bU // Grand-tek Technology Co., Ltd +#define UHS_VID_ROBERT_BOSCH 0x108cU // Robert Bosch GmbH +#define UHS_VID_LOTES 0x108eU // Lotes Co., Ltd. +#define UHS_VID_SURFACE_OPTICS 0x1099U // Surface Optics Corp. +#define UHS_VID_DATASOFT_SYSTEMS 0x109aU // DATASOFT Systems GmbH +#define UHS_VID_HISENSE 0x109bU // Hisense +#define UHS_VID_ESOL 0x109fU // eSOL Co., Ltd +#define UHS_VID_HIROTECH 0x10a0U // Hirotech, Inc. +#define UHS_VID_MITSUBISHI_MATERIALS 0x10a3U // Mitsubishi Materials Corp. +#define UHS_VID_SK_TELETECH 0x10a9U // SK Teletech Co., Ltd +#define UHS_VID_CABLES_TO_GO 0x10aaU // Cables To Go +#define UHS_VID_USI 0x10abU // USI Co., Ltd +#define UHS_VID_HONEYWELL 0x10acU // Honeywell, Inc. +#define UHS_VID_PRINCETON_TECHNOLOGY 0x10aeU // Princeton Technology Corp. +#define UHS_VID_LIEBERT 0x10afU // Liebert Corp. +#define UHS_VID_COMODO_PLX_UNKNOWN 0x10b5U // Comodo (PLX?) +#define UHS_VID_DIBCOM 0x10b8U // DiBcom +#define UHS_VID_TM_TECHNOLOGY 0x10bbU // TM Technology, Inc. +#define UHS_VID_DINGING_TECHNOLOGY 0x10bcU // Dinging Technology Co., Ltd +#define UHS_VID_TMT_TECHNOLOGY 0x10bdU // TMT Technology, Inc. +#define UHS_VID_SMARTHOME 0x10bfU // SmartHome +#define UHS_VID_UNIVERSAL_LASER_SYSTEMS 0x10c3U // Universal Laser Systems, Inc. +#define UHS_VID_CYGNAL_INTEGRATED_PRODUCTS 0x10c4U // Cygnal Integrated Products, Inc. +#define UHS_VID_SANEI_ELECTRIC 0x10c5U // Sanei Electric, Inc. +#define UHS_VID_INTEC 0x10c6U // Intec, Inc. +#define UHS_VID_ERATECH 0x10cbU // Eratech +#define UHS_VID_GBM_CONNECTOR 0x10ccU // GBM Connector Co., Ltd +#define UHS_VID_KYCON 0x10cdU // Kycon, Inc. +#define UHS_VID_SILICON_LABS 0x10ceU // Silicon Labs +#define UHS_VID_VELLEMAN_COMPONENTS 0x10cfU // Velleman Components, Inc. +#define UHS_VID_HOTTINGER_BALDWIN_MEASUREMENT 0x10d1U // Hottinger Baldwin Measurement +#define UHS_VID_RAYCOMPOSER__R_ADAMS 0x10d2U // RayComposer - R. Adams +#define UHS_VID_MAN_BOON_MANUFACTORY 0x10d4U // Man Boon Manufactory, Ltd +#define UHS_VID_UNI_CLASS_TECHNOLOGY 0x10d5U // Uni Class Technology Co., Ltd +#define UHS_VID_ACTIONS_SEMICONDUCTOR 0x10d6U // Actions Semiconductor Co., Ltd +#define UHS_VID_AUTHENEX 0x10deU // Authenex, Inc. +#define UHS_VID_IN_WIN_DEVELOPMENT 0x10dfU // In-Win Development, Inc. +#define UHS_VID_POST_OP_VIDEO 0x10e0U // Post-Op Video, Inc. +#define UHS_VID_CABLEPLUS 0x10e1U // CablePlus, Ltd +#define UHS_VID_NADA_ELECTRONICS 0x10e2U // Nada Electronics, Ltd +#define UHS_VID_VAST_TECHNOLOGIES 0x10ecU // Vast Technologies, Inc. +#define UHS_VID_NEXIO 0x10f0U // Nexio Co., Ltd +#define UHS_VID_IMPORTEK 0x10f1U // Importek +#define UHS_VID_TURTLE_BEACH 0x10f5U // Turtle Beach +#define UHS_VID_PICTOS_TECHNOLOGIES 0x10fbU // Pictos Technologies, Inc. +#define UHS_VID_ANUBIS_ELECTRONICS 0x10fdU // Anubis Electronics, Ltd +#define UHS_VID_THRANE_AND_THRANE 0x10feU // Thrane & Thrane +#define UHS_VID_VIRTOUCH 0x1100U // VirTouch, Ltd +#define UHS_VID_EASYPASS_INDUSTRIAL 0x1101U // EasyPass Industrial Co., Ltd +#define UHS_VID_BRIGHTCOM_TECHNOLOGIES 0x1108U // Brightcom Technologies, Ltd +#define UHS_VID_MOXA_TECHNOLOGIES 0x110aU // Moxa Technologies Co., Ltd. +#define UHS_VID_ANALOG_DEVICES_CANADA_LTD_ALLIED_TELESYN 0x1110U // Analog Devices Canada, Ltd (Allied Telesyn) +#define UHS_VID_PANDORA_INTERNATIONAL 0x1111U // Pandora International Ltd. +#define UHS_VID_YM_ELECTRIC 0x1112U // YM ELECTRIC CO., Ltd +#define UHS_VID_MEDION_AG 0x1113U // Medion AG +#define UHS_VID_VSO_ELECTRIC 0x111eU // VSO Electric Co., Ltd +#define UHS_VID_REDRAT 0x112aU // RedRat +#define UHS_VID_MASTER_HILL_ELECTRIC_WIRE_AND_CABLE 0x112eU // Master Hill Electric Wire and Cable Co., Ltd +#define UHS_VID_CELLON_INTERNATIONAL 0x112fU // Cellon International, Inc. +#define UHS_VID_TENX_TECHNOLOGY 0x1130U // Tenx Technology, Inc. +#define UHS_VID_INTEGRATED_SYSTEM_SOLUTION 0x1131U // Integrated System Solution Corp. +#define UHS_VID_TOSHIBA_CORP_DIGITAL_MEDIA_EQUIPMENT_HEX_ 0x1132U // Toshiba Corp., Digital Media Equipment [hex] +#define UHS_VID_CTS_ELECTRONINCS 0x1136U // CTS Electronincs +#define UHS_VID_ARIN_TECH 0x113cU // Arin Tech Co., Ltd +#define UHS_VID_MAPOWER_ELECTRONICS 0x113dU // Mapower Electronics Co., Ltd +#define UHS_VID_V_ONE_MULTIMEDIA_PTE 0x1141U // V One Multimedia, Pte., Ltd +#define UHS_VID_CYBERSCAN_TECHNOLOGIES 0x1142U // CyberScan Technologies, Inc. +#define UHS_VID_JAPAN_RADIO_COMPANY 0x1145U // Japan Radio Company +#define UHS_VID_SHIMANE_SANYO_ELECTRIC 0x1146U // Shimane SANYO Electric Co., Ltd. +#define UHS_VID_EVER_GREAT_ELECTRIC_WIRE_AND_CABLE 0x1147U // Ever Great Electric Wire and Cable Co., Ltd +#define UHS_VID_SPHAIRON_ACCESS_SYSTEMS 0x114bU // Sphairon Access Systems GmbH +#define UHS_VID_TINIUS_OLSEN_TESTING_MACHINE 0x114cU // Tinius Olsen Testing Machine Co., Inc. +#define UHS_VID_ALPHA_IMAGING_TECHNOLOGY 0x114dU // Alpha Imaging Technology Corp. +#define UHS_VID_WAVECOM 0x114fU // Wavecom +#define UHS_VID_SALIX_TECHNOLOGY 0x115bU // Salix Technology Co., Ltd. +#define UHS_VID_SECUGEN 0x1162U // Secugen Corp. +#define UHS_VID_DELORME_PUBLISHING 0x1163U // DeLorme Publishing, Inc. +#define UHS_VID_YUAN_HIGH_TECH_DEVELOPMENT 0x1164U // YUAN High-Tech Development Co., Ltd +#define UHS_VID_TELSON_ELECTRONICS 0x1165U // Telson Electronics Co., Ltd +#define UHS_VID_BANTAM_INTERACTIVE_TECHNOLOGIES 0x1166U // Bantam Interactive Technologies +#define UHS_VID_SALIENT_SYSTEMS 0x1167U // Salient Systems Corp. +#define UHS_VID_BIZCONN_INTERNATIONAL 0x1168U // BizConn International Corp. +#define UHS_VID_GIGASTORAGE 0x116eU // Gigastorage Corp. +#define UHS_VID_SILICON_10_TECHNOLOGY 0x116fU // Silicon 10 Technology Corp. +#define UHS_VID_SHENGYIH_STEEL_MOLD 0x1175U // Shengyih Steel Mold Co., Ltd +#define UHS_VID_SANTA_ELECTRONIC 0x117dU // Santa Electronic, Inc. +#define UHS_VID_JNC 0x117eU // JNC, Inc. +#define UHS_VID_VENTURE 0x1182U // Venture Corp., Ltd +#define UHS_VID_COMPAQ_COMPUTER_CORP_HEX_DIGITAL_DREAM_UNKNOWN 0x1183U // Compaq Computer Corp. [hex] (Digital Dream ?) +#define UHS_VID_KYOCERA_ELCO 0x1184U // Kyocera Elco Corp. +#define UHS_VID_BLOOMBERG_LP 0x1188U // Bloomberg L.P. +#define UHS_VID_ACER_COMMUNICATIONS_AND_MULTIMEDIA 0x1189U // Acer Communications & Multimedia +#define UHS_VID_YOU_YANG_TECHNOLOGY 0x118fU // You Yang Technology Co., Ltd +#define UHS_VID_TRIPACE 0x1190U // Tripace +#define UHS_VID_LOYALTY_FOUNDER_ENTERPRISE 0x1191U // Loyalty Founder Enterprise Co., Ltd +#define UHS_VID_YANKEE_ROBOTICS 0x1196U // Yankee Robotics, LLC +#define UHS_VID_TECHNOIMAGIA 0x1197U // Technoimagia Co., Ltd +#define UHS_VID_STARSHINE_TECHNOLOGY 0x1198U // StarShine Technology Corp. +#define UHS_VID_SIERRA_WIRELESS 0x1199U // Sierra Wireless, Inc. +#define UHS_VID_ZHAN_QI_TECHNOLOGY 0x119aU // ZHAN QI Technology Co., Ltd +#define UHS_VID_RUWIDO_AUSTRIA 0x119bU // ruwido austria GmbH +#define UHS_VID_CHIPCON_AS 0x11a0U // Chipcon AS +#define UHS_VID_TECHNOVAS 0x11a3U // Technovas Co., Ltd +#define UHS_VID_GLOBALMEDIA_GROUP 0x11aaU // GlobalMedia Group, LLC +#define UHS_VID_EXITO_ELECTRONICS 0x11abU // Exito Electronics Co., Ltd +#define UHS_VID_NIKE 0x11acU // Nike +#define UHS_VID_ATECH_FLASH_TECHNOLOGY 0x11b0U // ATECH FLASH TECHNOLOGY +#define UHS_VID_RANDD_INTERNATIONAL_NV 0x11beU // R&D International NV +#define UHS_VID_INMAX 0x11c5U // Inmax +#define UHS_VID_VERIFONE 0x11caU // VeriFone Inc +#define UHS_VID_TOPFIELD 0x11dbU // Topfield Co., Ltd. +#define UHS_VID_KI_TECHNOLOGY 0x11e6U // K.I. Technology Co. Ltd. +#define UHS_VID_SIEMENS_AG_1 0x11f5U // Siemens AG +#define UHS_VID_PROLIFIC 0x11f6U // Prolific +#define UHS_VID_ALCATEL_UNKNOWN 0x11f7U // Alcatel (?) +#define UHS_VID_TSC_AUTO_ID_TECHNOLOGY 0x1203U // TSC Auto ID Technology Co., Ltd +#define UHS_VID_INTERBIOMETRICS 0x1209U // InterBiometrics +#define UHS_VID_HUDSON_SOFT 0x120eU // Hudson Soft Co., Ltd +#define UHS_VID_MAGELLAN 0x120fU // Magellan +#define UHS_VID_DIGITECH 0x1210U // DigiTech +#define UHS_VID_JUNGSOFT 0x121eU // Jungsoft Co., Ltd +#define UHS_VID_UNKNOWN_MANUFACTURER_1 0x1221U // Unknown manufacturer +#define UHS_VID_SKYCABLE_ENTERPRISE 0x1223U // SKYCABLE ENTERPRISE. CO., LTD. +#define UHS_VID_DATAPAQ_LIMITED 0x1228U // Datapaq Limited +#define UHS_VID_CHIPIDEA_MICROELECTRONICA 0x1230U // Chipidea-Microelectronica, S.A. +#define UHS_VID_DENVER_ELECTRONICS 0x1233U // Denver Electronics +#define UHS_VID_BRAIN_ACTUATED_TECHNOLOGIES 0x1234U // Brain Actuated Technologies +#define UHS_VID_FOCUSRITE_NOVATION 0x1235U // Focusrite-Novation +#define UHS_VID_BELKIN 0x1241U // Belkin +#define UHS_VID_AIRVAST 0x124aU // AirVast +#define UHS_VID_NYKO_HONEY_BEE 0x124bU // Nyko (Honey Bee) +#define UHS_VID_MXI__MEMORY_EXPERTS_INTERNATIONAL 0x124cU // MXI - Memory Experts International, Inc. +#define UHS_VID_APOGEE 0x125cU // Apogee Inc. +#define UHS_VID_A_DATA_TECHNOLOGY 0x125fU // A-DATA Technology Co., Ltd. +#define UHS_VID_STANDARD_MICROSYSTEMS_3 0x1260U // Standard Microsystems Corp. +#define UHS_VID_COVIDIEN_ENERGY_BASED_DEVICES 0x1264U // Covidien Energy-based Devices +#define UHS_VID_PIRELLI_BROADBAND_SOLUTIONS 0x1266U // Pirelli Broadband Solutions +#define UHS_VID_LOGIC3_SPECTRAVIDEO_PLC 0x1267U // Logic3 / SpectraVideo plc +#define UHS_VID_ARISTOCRAT_TECHNOLOGIES 0x126cU // Aristocrat Technologies +#define UHS_VID_BEL_STEWART 0x126dU // Bel Stewart +#define UHS_VID_STROBE_DATA 0x126eU // Strobe Data, Inc. +#define UHS_VID_TWINMOS 0x126fU // TwinMOS +#define UHS_VID_ENSONIQ 0x1274U // Ensoniq +#define UHS_VID_XAXERO_MARINE_SOFTWARE_ENGINEERING 0x1275U // Xaxero Marine Software Engineering, Ltd. +#define UHS_VID_STARLIGHT_XPRESS 0x1278U // Starlight Xpress +#define UHS_VID_ZEBRIS_MEDICAL 0x1283U // zebris Medical GmbH +#define UHS_VID_MARVELL_SEMICONDUCTOR 0x1286U // Marvell Semiconductor, Inc. +#define UHS_VID_QUALCOMM_FLARION_TECHNOLOGIES_INC_LEADTEK_RESEARCH 0x1291U // Qualcomm Flarion Technologies, Inc. / Leadtek Research, Inc. +#define UHS_VID_INNOMEDIA_1 0x1292U // Innomedia +#define UHS_VID_BELKIN_COMPONENTS_HEX_ 0x1293U // Belkin Components [hex] +#define UHS_VID_RISO_KAGAKU 0x1294U // RISO KAGAKU CORP. +#define UHS_VID_CYBERTAN_TECHNOLOGY 0x129bU // CyberTAN Technology +#define UHS_VID_TRENDCHIP_TECHNOLOGIES 0x12a7U // Trendchip Technologies Corp. +#define UHS_VID_HONEY_BEE_ELECTRONIC_INTERNATIONAL 0x12abU // Honey Bee Electronic International Ltd. +#define UHS_VID_ZHEJIANG_XINYA_ELECTRONIC_TECHNOLOGY 0x12b8U // Zhejiang Xinya Electronic Technology Co., Ltd. +#define UHS_VID_E28 0x12b9U // E28 +#define UHS_VID_LICENSED_BY_SONY_COMPUTER_ENTERTAINMENT_AMERICA 0x12baU // Licensed by Sony Computer Entertainment America +#define UHS_VID_GEMBIRD 0x12bdU // Gembird +#define UHS_VID_AUTOCUE_GROUP 0x12c4U // Autocue Group Ltd +#define UHS_VID_DEXIN_1 0x12cfU // DEXIN +#define UHS_VID_HUAWEI_TECHNOLOGIES 0x12d1U // Huawei Technologies Co., Ltd. +#define UHS_VID_LINE_TECH_INDUSTRIAL 0x12d2U // LINE TECH INDUSTRIAL CO., LTD. +#define UHS_VID_EMS_DR_THOMAS_WUENSCHE 0x12d6U // EMS Dr. Thomas Wuensche +#define UHS_VID_BETTER_WIRE_FACTORY 0x12d7U // BETTER WIRE FACTORY CO., LTD. +#define UHS_VID_ARANEUS_INFORMATION_SYSTEMS_OY 0x12d8U // Araneus Information Systems Oy +#define UHS_VID_WALDORF_MUSIC 0x12e6U // Waldorf Music GmbH +#define UHS_VID_TAPWAVE 0x12efU // Tapwave, Inc. +#define UHS_VID_DYNAMIC_SYSTEM_ELECTRONICS 0x12f5U // Dynamic System Electronics Corp. +#define UHS_VID_MEMOREX_PRODUCTS 0x12f7U // Memorex Products, Inc. +#define UHS_VID_AIN_COMM_TECHNOLOGY 0x12fdU // AIN Comm. Technology Co., Ltd +#define UHS_VID_FASCINATING_ELECTRONICS 0x12ffU // Fascinating Electronics, Inc. +#define UHS_VID_TRANSCEND_INFORMATION 0x1307U // Transcend Information, Inc. +#define UHS_VID_SHUTTLE_1 0x1308U // Shuttle, Inc. +#define UHS_VID_ROPER 0x1310U // Roper +#define UHS_VID_ICS_ELECTRONICS 0x1312U // ICS Electronics +#define UHS_VID_THORLABS 0x1313U // ThorLabs +#define UHS_VID_NATURAL_POINT 0x131dU // Natural Point +#define UHS_VID_ENVARA 0x132aU // Envara Inc. +#define UHS_VID_KONICA_MINOLTA 0x132bU // Konica Minolta +#define UHS_VID_KEMPER_DIGITAL 0x133eU // Kemper Digital GmbH +#define UHS_VID_MOBILITY 0x1342U // Mobility +#define UHS_VID_CITIZEN_SYSTEMS 0x1343U // Citizen Systems +#define UHS_VID_SINO_LITE_TECHNOLOGY 0x1345U // Sino Lite Technology Corp. +#define UHS_VID_MORAVIAN_INSTRUMENTS 0x1347U // Moravian Instruments +#define UHS_VID_KATSURAGAWA_ELECTRIC 0x1348U // Katsuragawa Electric Co., Ltd. +#define UHS_VID_PANJIT_INTERNATIONAL 0x134cU // PanJit International Inc. +#define UHS_VID_DIGBYS_BITPILE_INC_DBA_D_BIT 0x134eU // Digby's Bitpile, Inc. DBA D Bit +#define UHS_VID_PANDE_MICROCOMPUTER_SYSTEMS 0x1357U // P&E Microcomputer Systems +#define UHS_VID_CONTROL_DEVELOPMENT 0x135fU // Control Development Inc. +#define UHS_VID_SEGGER 0x1366U // SEGGER +#define UHS_VID_STEC 0x136bU // STEC +#define UHS_VID_ANDOR_TECHNOLOGY 0x136eU // Andor Technology Ltd. +#define UHS_VID_SWISSBIT 0x1370U // Swissbit +#define UHS_VID_CNET_TECHNOLOGY 0x1371U // CNet Technology Inc. +#define UHS_VID_VIMTRON_ELECTRONICS 0x1376U // Vimtron Electronics Co., Ltd. +#define UHS_VID_SCAPS 0x137bU // SCAPS GmbH +#define UHS_VID_NETGEAR_2 0x1385U // Netgear, Inc +#define UHS_VID_VALIDITY_SENSORS 0x138aU // Validity Sensors, Inc. +#define UHS_VID_JUNGO 0x138eU // Jungo LTD +#define UHS_VID_TOMTOM_BV 0x1390U // TOMTOM B.V. +#define UHS_VID_IDEALTEK 0x1391U // IdealTEK, Inc. +#define UHS_VID_SENNHEISER_COMMUNICATIONS 0x1395U // Sennheiser Communications +#define UHS_VID_BEHRINGER_INTERNATIONAL 0x1397U // BEHRINGER International GmbH +#define UHS_VID_Q_TEC 0x1398U // Q-tec +#define UHS_VID_BALTECH 0x13adU // Baltech +#define UHS_VID_PERKINELMER_OPTOELECTRONICS 0x13b0U // PerkinElmer Optoelectronics +#define UHS_VID_LINKSYS_2 0x13b1U // Linksys +#define UHS_VID_ALESIS 0x13b2U // Alesis +#define UHS_VID_NIPPON_DICS 0x13b3U // Nippon Dics Co., Ltd. +#define UHS_VID_PCPLAY 0x13baU // PCPlay +#define UHS_VID_RICOH_PRINTING_SYSTEMS 0x13beU // Ricoh Printing Systems, Ltd. +#define UHS_VID_JYETAI_PRECISION_INDUSTRIAL 0x13caU // JyeTai Precision Industrial Co., Ltd. +#define UHS_VID_WISAIR 0x13cfU // Wisair Ltd. +#define UHS_VID_TECHSAN_ELECTRONICS 0x13d0U // Techsan Electronics Co., Ltd. +#define UHS_VID_A_MAX_TECHNOLOGY_MACAO_COMMERCIAL_OFFSHORE 0x13d1U // A-Max Technology Macao Commercial Offshore Co. Ltd. +#define UHS_VID_SHARK_MULTIMEDIA_1 0x13d2U // Shark Multimedia +#define UHS_VID_IMC_NETWORKS 0x13d3U // IMC Networks +#define UHS_VID_GUIDANCE_SOFTWARE 0x13d7U // Guidance Software, Inc. +#define UHS_VID_ALEREON 0x13dcU // ALEREON, INC. +#define UHS_VID_ITECH_DYNAMIC_LIMITED 0x13ddU // i.Tech Dynamic Limited +#define UHS_VID_KAIBO_WIRE_AND_CABLE_SHENZHEN 0x13e1U // Kaibo Wire & Cable (Shenzhen) Co., Ltd. +#define UHS_VID_RANE 0x13e5U // Rane +#define UHS_VID_TECHNOSCOPE 0x13e6U // TechnoScope Co., Ltd. +#define UHS_VID_HENGSTLER 0x13eaU // Hengstler +#define UHS_VID_ZYDACRON 0x13ecU // Zydacron +#define UHS_VID_MOSART 0x13eeU // MosArt +#define UHS_VID_INITIO_CORPORATION 0x13fdU // Initio Corporation +#define UHS_VID_KINGSTON_TECHNOLOGY_COMPANY_1 0x13feU // Kingston Technology Company Inc. +#define UHS_VID_AXXION_GROUP 0x1400U // Axxion Group Corp. +#define UHS_VID_BOWE_BELL_AND_HOWELL 0x1402U // Bowe Bell & Howell +#define UHS_VID_SITRONIX 0x1403U // Sitronix +#define UHS_VID_IDS_IMAGING_DEVELOPMENT_SYSTEMS 0x1409U // IDS Imaging Development Systems GmbH +#define UHS_VID_TELECHIPS 0x140eU // Telechips, Inc. +#define UHS_VID_NOVATEL_WIRELESS_1 0x1410U // Novatel Wireless +#define UHS_VID_NAM_TAI_EANDE_PRODUCTS_LTD_OR_OMNIVISION_TECHNOLOGIES 0x1415U // Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. +#define UHS_VID_ABILITY_ENTERPRISE 0x1419U // ABILITY ENTERPRISE CO., LTD. +#define UHS_VID_SENSOR_TECHNOLOGY 0x1421U // Sensor Technology +#define UHS_VID_VEGA_TECHNOLOGIES_INDUSTRIAL_AUSTRIA 0x1429U // Vega Technologies Industrial (Austria) Co. +#define UHS_VID_THALES_E_TRANSACTIONS 0x142aU // Thales E-Transactions +#define UHS_VID_ARBITER_SYSTEMS 0x142bU // Arbiter Systems, Inc. +#define UHS_VID_REDOCTANE 0x1430U // RedOctane +#define UHS_VID_PERTECH_RESOURCES 0x1431U // Pertech Resources, Inc. +#define UHS_VID_WISTRON_NEWEB 0x1435U // Wistron NeWeb +#define UHS_VID_DENALI_SOFTWARE 0x1436U // Denali Software, Inc. +#define UHS_VID_ALTEK_CORPORATION 0x143cU // Altek Corporation +#define UHS_VID_DIGILENT 0x1443U // Digilent +#define UHS_VID_XJGROUP 0x1446U // X.J.GROUP +#define UHS_VID_RADIO_SHACK 0x1453U // Radio Shack +#define UHS_VID_EXTENDING_WIRE_AND_CABLE 0x1456U // Extending Wire & Cable Co., Ltd. +#define UHS_VID_FIRST_INTERNATIONAL_COMPUTER_1 0x1457U // First International Computer, Inc. +#define UHS_VID_TRUST 0x145fU // Trust +#define UHS_VID_TATUNG 0x1460U // Tatung Co. +#define UHS_VID_STACCATO_COMMUNICATIONS 0x1461U // Staccato Communications +#define UHS_VID_MICRO_STAR_INTERNATIONAL_1 0x1462U // Micro Star International +#define UHS_VID_HUAWEI_3COM 0x1472U // Huawei-3Com +#define UHS_VID_FORMOSA_INDUSTRIAL_COMPUTING 0x147aU // Formosa Industrial Computing, Inc. +#define UHS_VID_UPEK 0x147eU // Upek +#define UHS_VID_HAMA_GMBH_AND_CO_KG 0x147fU // Hama GmbH & Co., KG +#define UHS_VID_VAILLANT 0x1482U // Vaillant +#define UHS_VID_ELSA_AG_HEX_ 0x1484U // Elsa AG [hex] +#define UHS_VID_SILICOM_1 0x1485U // Silicom +#define UHS_VID_DSP_GROUP 0x1487U // DSP Group, Ltd. +#define UHS_VID_EVATRONIX 0x148eU // EVATRONIX SA +#define UHS_VID_RALINK_TECHNOLOGY 0x148fU // Ralink Technology, Corp. +#define UHS_VID_FUTRONIC_TECHNOLOGY 0x1491U // Futronic Technology Co. Ltd. +#define UHS_VID_SUUNTO 0x1493U // Suunto +#define UHS_VID_PANSTRONG_COMPANY 0x1497U // Panstrong Company Ltd. +#define UHS_VID_MICROTEK_INTERNATIONAL_1 0x1498U // Microtek International Inc. +#define UHS_VID_IMAGINATION_TECHNOLOGIES 0x149aU // Imagination Technologies +#define UHS_VID_WIDEVIEW_TECHNOLOGY 0x14aaU // WideView Technology Inc. +#define UHS_VID_CTK_CORPORATION 0x14adU // CTK Corporation +#define UHS_VID_PRINTRONIX 0x14aeU // Printronix Inc. +#define UHS_VID_ATP_ELECTRONICS 0x14afU // ATP Electronics Inc. +#define UHS_VID_STARTECHCOM 0x14b0U // StarTech.com Ltd. +#define UHS_VID_RALINK_TECHNOLOGY_1 0x14b2U // Ralink Technology, Corp. +#define UHS_VID_ROCKWELL_AUTOMATION 0x14c0U // Rockwell Automation, Inc. +#define UHS_VID_GEMLIGHT_COMPUTER 0x14c2U // Gemlight Computer, Ltd +#define UHS_VID_ZYTRONIC 0x14c8U // Zytronic +#define UHS_VID_SUPER_TOP 0x14cdU // Super Top +#define UHS_VID_JAMER_INDUSTRIES 0x14d8U // JAMER INDUSTRIES CO., LTD. +#define UHS_VID_RARITAN_COMPUTER 0x14ddU // Raritan Computer, Inc. +#define UHS_VID_WINRADIO_COMMUNICATIONS 0x14e0U // WiNRADiO Communications +#define UHS_VID_DIALOGUE_TECHNOLOGY 0x14e1U // Dialogue Technology Corp. +#define UHS_VID_SAIN_INFORMATION_AND_COMMUNICATIONS 0x14e5U // SAIN Information & Communications Co., Ltd. +#define UHS_VID_PLANEX_COMMUNICATIONS_1 0x14eaU // Planex Communications +#define UHS_VID_SHURE 0x14edU // Shure Inc. +#define UHS_VID_TECHNISAT_DIGITAL 0x14f7U // TechniSat Digital GmbH +#define UHS_VID_ELLISYS_1 0x1500U // Ellisys +#define UHS_VID_PINE_TUM_ENTERPRISE 0x1501U // Pine-Tum Enterprise Co., Ltd. +#define UHS_VID_FIRST_INTERNATIONAL_COMPUTER_2 0x1509U // First International Computer, Inc. +#define UHS_VID_MEDMOBILE 0x1513U // medMobile +#define UHS_VID_ACTEL 0x1514U // Actel +#define UHS_VID_COMPUSA 0x1516U // CompUSA +#define UHS_VID_CHESHIRE_ENGINEERING 0x1518U // Cheshire Engineering Corp. +#define UHS_VID_COMNEON 0x1519U // Comneon +#define UHS_VID_BITWIRE 0x1520U // Bitwire Corp. +#define UHS_VID_ENE_TECHNOLOGY_1 0x1524U // ENE Technology Inc +#define UHS_VID_SILICON_PORTALS 0x1527U // Silicon Portals +#define UHS_VID_UBIQUAM 0x1529U // UBIQUAM Co., Ltd. +#define UHS_VID_THESYCON_SYSTEMSOFTWARE_AND_CONSULTING 0x152aU // Thesycon Systemsoftware & Consulting GmbH +#define UHS_VID_MIR_SRL 0x152bU // MIR Srl +#define UHS_VID_JMICRON_TECHNOLOGY_CORP_JMICRON_USA_TECHNOLOGY 0x152dU // JMicron Technology Corp. / JMicron USA Technology Corp. +#define UHS_VID_LG_HLDS 0x152eU // LG (HLDS) +#define UHS_VID_RAZER_USA 0x1532U // Razer USA, Ltd +#define UHS_VID_TERRATEC_ELECTRONIC_1 0x153bU // TerraTec Electronic GmbH +#define UHS_VID_U_BLOX_AG 0x1546U // U-Blox AG +#define UHS_VID_SG_INTEC_LTD_AND_CO_KG 0x1547U // SG Intec Ltd & Co KG +#define UHS_VID_CELECTRONIC 0x154aU // Celectronic GmbH +#define UHS_VID_PNY 0x154bU // PNY +#define UHS_VID_CONNECTCOUNTY_HOLDINGS_BERHAD 0x154dU // ConnectCounty Holdings Berhad +#define UHS_VID_DANDM_HOLDINGS_INC_DENONMARANTZ 0x154eU // D&M Holdings, Inc. (Denon/Marantz) +#define UHS_VID_SNBC 0x154fU // SNBC CO., Ltd +#define UHS_VID_PROLINK_MICROSYSTEMS 0x1554U // Prolink Microsystems Corp. +#define UHS_VID_OQO 0x1557U // OQO +#define UHS_VID_SUNF_PU_TECHNOLOGY 0x1568U // Sunf Pu Technology Co., Ltd +#define UHS_VID_QUANTUM_CORPORATION 0x156fU // Quantum Corporation +#define UHS_VID_ALLTOP_TECHNOLOGY 0x1570U // ALLTOP TECHNOLOGY CO., LTD. +#define UHS_VID_KETRON_SRL 0x157bU // Ketron SRL +#define UHS_VID_TRENDNET 0x157eU // TRENDnet +#define UHS_VID_FIBERLINE 0x1582U // Fiberline +#define UHS_VID_SMA_TECHNOLOGIE_AG 0x1587U // SMA Technologie AG +#define UHS_VID_OAKLEY 0x158dU // Oakley Inc. +#define UHS_VID_JDS_UNIPHASE_CORPORATION_JDSU 0x158eU // JDS Uniphase Corporation (JDSU) +#define UHS_VID_KUNSHAN_GUOJI_ELECTRONICS 0x1598U // Kunshan Guoji Electronics Co., Ltd. +#define UHS_VID_FREESCALE_SEMICONDUCTOR 0x15a2U // Freescale Semiconductor, Inc. +#define UHS_VID_AFATECH_TECHNOLOGIES 0x15a4U // Afatech Technologies, Inc. +#define UHS_VID_TEAMS_POWER_LIMITED 0x15a8U // Teams Power Limited +#define UHS_VID_GEMTEK 0x15a9U // Gemtek +#define UHS_VID_GEARWAY_ELECTRONICS_DONG_GUAN 0x15aaU // Gearway Electronics (Dong Guan) Co., Ltd. +#define UHS_VID_VMWARE_1 0x15adU // VMware Inc. +#define UHS_VID_OLIMEX 0x15baU // Olimex Ltd. +#define UHS_VID_XL_IMAGING 0x15c0U // XL Imaging +#define UHS_VID_SOUNDGRAPH 0x15c2U // SoundGraph Inc. +#define UHS_VID_ADVANCE_MULTIMEDIA_INTERNET_TECHNOLOGY_INC_AMIT 0x15c5U // Advance Multimedia Internet Technology Inc. (AMIT) +#define UHS_VID_LABORATOIRES_MXM 0x15c6U // Laboratoires MXM +#define UHS_VID_KTF_TECHNOLOGIES 0x15c8U // KTF Technologies +#define UHS_VID_D_BOX_TECHNOLOGIES 0x15c9U // D-Box Technologies +#define UHS_VID_TEXTECH_INTERNATIONAL 0x15caU // Textech International Ltd. +#define UHS_VID_COULOMB_ELECTRONICS 0x15d5U // Coulomb Electronics Ltd. +#define UHS_VID_TRUST_INTERNATIONAL_BV_1 0x15d9U // Trust International B.V. +#define UHS_VID_HYNIX_SEMICONDUCTOR 0x15dcU // Hynix Semiconductor Inc. +#define UHS_VID_SEONG_JI_INDUSTRIAL 0x15e0U // Seong Ji Industrial Co., Ltd. +#define UHS_VID_RSA 0x15e1U // RSA +#define UHS_VID_NUMARK 0x15e4U // Numark +#define UHS_VID_SOHOWARE 0x15e8U // SohoWare +#define UHS_VID_PACIFIC_DIGITAL 0x15e9U // Pacific Digital Corp. +#define UHS_VID_BELCARRA_TECHNOLOGIES 0x15ecU // Belcarra Technologies Corp. +#define UHS_VID_HANFTEK 0x15f4U // HanfTek +#define UHS_VID_TASCAM 0x1604U // Tascam +#define UHS_VID_UMAX_1 0x1606U // Umax +#define UHS_VID_INSIDE_OUT_NETWORKS_HEX_ 0x1608U // Inside Out Networks [hex] +#define UHS_VID_VIA_TECHNOLOGIES_1 0x160aU // VIA Technologies, Inc. +#define UHS_VID_INRO 0x160eU // INRO +#define UHS_VID_AMOI_ELECTRONICS 0x1614U // Amoi Electronics +#define UHS_VID_SONY_1 0x1617U // Sony Corp. +#define UHS_VID_L_AND_K_PRECISION_TECHNOLOGY 0x1619U // L & K Precision Technology Co., Ltd. +#define UHS_VID_WIONICS_RESEARCH 0x1621U // Wionics Research +#define UHS_VID_STONESTREET_ONE 0x1628U // Stonestreet One, Inc. +#define UHS_VID_AIRGO_NETWORKS 0x162aU // Airgo Networks Inc. +#define UHS_VID_WIQUEST_COMMUNICATIONS 0x162fU // WiQuest Communications, Inc. +#define UHS_VID_2WIRE_1 0x1630U // 2Wire, Inc. +#define UHS_VID_GOOD_WAY_TECHNOLOGY 0x1631U // Good Way Technology +#define UHS_VID_ENTREGA_HEX_ 0x1645U // Entrega [hex] +#define UHS_VID_SOFTEC_MICROSYSTEMS 0x1649U // SofTec Microsystems +#define UHS_VID_CHIPX 0x164aU // ChipX +#define UHS_VID_MATRIX_VISION 0x164cU // Matrix Vision GmbH +#define UHS_VID_STRUCK_INNOVATIVE_SYSTEME 0x1657U // Struck Innovative Systeme GmbH +#define UHS_VID_FRONTIER_DESIGN_GROUP 0x165bU // Frontier Design Group +#define UHS_VID_KONDO_KAGAKU 0x165cU // Kondo Kagaku +#define UHS_VID_CREATIX_POLYMEDIA 0x1660U // Creatix Polymedia GmbH +#define UHS_VID_GIGA_TMS 0x1667U // GIGA-TMS INC. +#define UHS_VID_ACTIONTEC_ELECTRONICS_INC_HEX_ 0x1668U // Actiontec Electronics, Inc. [hex] +#define UHS_VID_PIKRON_LTD_HEX_ 0x1669U // PiKRON Ltd. [hex] +#define UHS_VID_CLIPSAL 0x166aU // Clipsal +#define UHS_VID_CHINA_HUADA_INTEGRATED_CIRCUIT_DESIGN_GROUP_CO_LTD_CIDC_GROUP 0x1677U // China Huada Integrated Circuit Design (Group) Co., Ltd. (CIDC Group) +#define UHS_VID_TOTAL_PHASE 0x1679U // Total Phase +#define UHS_VID_GOLDEN_BRIDGE_ELECTECH_1 0x1680U // Golden Bridge Electech Inc. +#define UHS_VID_PREVO_TECHNOLOGIES 0x1681U // Prevo Technologies, Inc. +#define UHS_VID_MAXWISE_PRODUCTION_ENTERPRISE 0x1682U // Maxwise Production Enterprise Ltd. +#define UHS_VID_GODSPEED_COMPUTER 0x1684U // Godspeed Computer Corp. +#define UHS_VID_DELOCK 0x1685U // Delock +#define UHS_VID_ZOOM_CORPORATION 0x1686U // ZOOM Corporation +#define UHS_VID_KINGMAX_DIGITAL 0x1687U // Kingmax Digital Inc. +#define UHS_VID_SAAB 0x1688U // Saab AB +#define UHS_VID_RAZER_USA_1 0x1689U // Razer USA, Ltd +#define UHS_VID_ATHEROS_COMMUNICATIONS_1 0x168cU // Atheros Communications +#define UHS_VID_ASKEY_COMPUTER_CORP_HEX_ 0x1690U // Askey Computer Corp. [hex] +#define UHS_VID_HITACHI_VIDEO_AND_INFORMATION_SYSTEM 0x1696U // Hitachi Video and Information System, Inc. +#define UHS_VID_VTEC_TEST 0x1697U // VTec Test, Inc. +#define UHS_VID_SHENZHEN_ZHENGERYA_CABLE 0x16a5U // Shenzhen Zhengerya Cable Co., Ltd. +#define UHS_VID_UNIGRAF 0x16a6U // Unigraf +#define UHS_VID_GLOBAL_SUN_TECHNOLOGY_1 0x16abU // Global Sun Technology +#define UHS_VID_DONGGUAN_CHINGLUNG_WIRE_AND_CABLE 0x16acU // Dongguan ChingLung Wire & Cable Co., Ltd. +#define UHS_VID_ISTATION 0x16b4U // iStation +#define UHS_VID_PERSENTEC 0x16b5U // Persentec, Inc. +#define UHS_VID_VAN_OOIJEN_TECHNISCHE_INFORMATICA 0x16c0U // Van Ooijen Technische Informatica +#define UHS_VID_WIRELESS_CABLES 0x16caU // Wireless Cables, Inc. +#define UHS_VID_SILEX_TECHNOLOGY 0x16ccU // silex technology, Inc. +#define UHS_VID_MCS 0x16d0U // MCS +#define UHS_VID_SUPREMA 0x16d1U // Suprema Inc. +#define UHS_VID_FRONTLINE_TEST_EQUIPMENT 0x16d3U // Frontline Test Equipment, Inc. +#define UHS_VID_ANYDATA_CORPORATION 0x16d5U // AnyDATA Corporation +#define UHS_VID_JABLOCOM_SRO 0x16d6U // JABLOCOM s.r.o. +#define UHS_VID_CMOTECH 0x16d8U // CMOTECH Co., Ltd. +#define UHS_VID_WIENER_PLEIN_AND_BAUS 0x16dcU // Wiener, Plein & Baus +#define UHS_VID_KING_BILLION_ELECTRONICS 0x16dfU // King Billion Electronics Co., Ltd. +#define UHS_VID_GN_RESOUND_AS 0x16f0U // GN ReSound A/S +#define UHS_VID_FUTURELOGIC 0x16f5U // Futurelogic Inc. +#define UHS_VID_BLUEVIEW_TECHNOLOGIES 0x1706U // BlueView Technologies, Inc. +#define UHS_VID_ARTIMI 0x1707U // ARTIMI +#define UHS_VID_SWISSONIC 0x170bU // Swissonic +#define UHS_VID_AVNERA 0x170dU // Avnera +#define UHS_VID_LEICA_MICROSYSTEMS 0x1711U // Leica Microsystems +#define UHS_VID_MEYER_INSTRUMENTS_MIS 0x1724U // Meyer Instruments (MIS) +#define UHS_VID_VITESSE_SEMICONDUCTOR 0x1725U // Vitesse Semiconductor +#define UHS_VID_AXESSTEL 0x1726U // Axesstel, Inc. +#define UHS_VID_WALTOP_INTERNATIONAL 0x172fU // Waltop International Corp. +#define UHS_VID_CELLINK_TECHNOLOGY 0x1733U // Cellink Technology Co., Ltd +#define UHS_VID_CANON_IMAGING_SYSTEM_TECHNOLOGIES 0x1736U // CANON IMAGING SYSTEM TECHNOLOGIES INC. +#define UHS_VID_LINKSYS_3 0x1737U // Linksys +#define UHS_VID_QSENN 0x173dU // QSENN +#define UHS_VID_SENAO 0x1740U // Senao +#define UHS_VID_GENERAL_ATOMICS 0x1743U // General Atomics +#define UHS_VID_MQP_ELECTRONICS 0x1748U // MQP Electronics +#define UHS_VID_ASMEDIA_TECHNOLOGY 0x174cU // ASMedia Technology Inc. +#define UHS_VID_SYNTEK 0x174fU // Syntek +#define UHS_VID_GERTEC_TELECOMUNICACOES_LTDA 0x1753U // GERTEC Telecomunicacoes Ltda. +#define UHS_VID_ENENSYS_TECHNOLOGIES 0x1756U // ENENSYS Technologies +#define UHS_VID_LUCIDPORT_TECHNOLOGY 0x1759U // LucidPort Technology, Inc. +#define UHS_VID_ASUSTEK_COMPUTER_INC_WRONG_ID 0x1761U // ASUSTek Computer, Inc. (wrong ID) +#define UHS_VID_SYSTEM_LEVEL_SOLUTIONS 0x1772U // System Level Solutions, Inc. +#define UHS_VID_AROWANA 0x1776U // Arowana +#define UHS_VID_SWEEX 0x177fU // Sweex +#define UHS_VID_MULTIPLE_VENDORS 0x1781U // Multiple Vendors +#define UHS_VID_SPREADTRUM_COMMUNICATIONS 0x1782U // Spreadtrum Communications Inc. +#define UHS_VID_TOPSEED_TECHNOLOGY 0x1784U // TopSeed Technology Corp. +#define UHS_VID_ATI_AIB 0x1787U // ATI AIB +#define UHS_VID_SHENZHEN_LITKCONN_TECHNOLOGY 0x1788U // ShenZhen Litkconn Technology Co., Ltd. +#define UHS_VID_PRINTREX 0x1796U // Printrex, Inc. +#define UHS_VID_JALCO 0x1797U // JALCO CO., LTD. +#define UHS_VID_THALES_NORWAY_AS 0x1799U // Thales Norway A/S +#define UHS_VID_RICAVISION_INTERNATIONAL 0x179dU // Ricavision International, Inc. +#define UHS_VID_SAMSON_TECHNOLOGIES 0x17a0U // Samson Technologies Corp. +#define UHS_VID_CONCEPT2 0x17a4U // Concept2 +#define UHS_VID_ADVANCED_CONNECTION_TECHNOLOGY 0x17a5U // Advanced Connection Technology Inc. +#define UHS_VID_MICOMSOFT 0x17a7U // MICOMSOFT CO., LTD. +#define UHS_VID_KAMSTRUP_AS 0x17a8U // Kamstrup A/S +#define UHS_VID_GREY_INNOVATION 0x17b3U // Grey Innovation +#define UHS_VID_LUNATONE 0x17b5U // Lunatone +#define UHS_VID_SAURIS 0x17baU // SAURIS GmbH +#define UHS_VID_SINGIM_INTERNATIONAL 0x17c3U // Singim International Corp. +#define UHS_VID_NATIVE_INSTRUMENTS 0x17ccU // Native Instruments +#define UHS_VID_HIP_HING_CABLE_AND_PLUG_MFY 0x17cfU // Hip Hing Cable & Plug Mfy. Ltd. +#define UHS_VID_SANFORD_LP 0x17d0U // Sanford L.P. +#define UHS_VID_KOREA_TECHTRON 0x17d3U // Korea Techtron Co., Ltd. +#define UHS_VID_DISPLAYLINK 0x17e9U // DisplayLink +#define UHS_VID_CORNICE 0x17ebU // Cornice, Inc. +#define UHS_VID_LENOVO 0x17efU // Lenovo +#define UHS_VID_WAVESENSE 0x17f4U // WaveSense +#define UHS_VID_KK_ROCKY 0x17f5U // K.K. Rocky +#define UHS_VID_UNICOMP 0x17f6U // Unicomp, Inc +#define UHS_VID_ADVANTECH 0x1809U // Advantech +#define UHS_VID_TWINHAN 0x1822U // Twinhan +#define UHS_VID_GWO_JINN_INDUSTRIES 0x1831U // Gwo Jinn Industries Co., Ltd. +#define UHS_VID_HUIZHOU_SHENGHUA_INDUSTRIAL 0x1832U // Huizhou Shenghua Industrial Co., Ltd. +#define UHS_VID_VIVOPHONE 0x183dU // VIVOphone +#define UHS_VID_VAISALA 0x1843U // Vaisala +#define UHS_VID_ASROCK_INCORPORATION 0x1849U // ASRock Incorporation +#define UHS_VID_GYROCOM_CANDC 0x1852U // GYROCOM C&C Co., LTD +#define UHS_VID_MEMORY_DEVICES 0x1854U // Memory Devices Ltd. +#define UHS_VID_COMPRO 0x185bU // Compro +#define UHS_VID_TECH_TECHNOLOGY_INDUSTRIAL_COMPANY 0x1861U // Tech Technology Industrial Company +#define UHS_VID_TERIDIAN_SEMICONDUCTOR 0x1862U // Teridian Semiconductor Corp. +#define UHS_VID_NEXIO_1 0x1870U // Nexio Co., Ltd +#define UHS_VID_AVEO_TECHNOLOGY 0x1871U // Aveo Technology Corp. +#define UHS_VID_NAVILOCK 0x1873U // Navilock +#define UHS_VID_ALIENWARE_CORPORATION 0x187cU // Alienware Corporation +#define UHS_VID_SIANO_MOBILE_SILICON 0x187fU // Siano Mobile Silicon +#define UHS_VID_VAST_TECHNOLOGIES_1 0x1892U // Vast Technologies, Inc. +#define UHS_VID_TOPSEED 0x1894U // Topseed +#define UHS_VID_EVERTOP_WIRE_CABLE 0x1897U // Evertop Wire Cable Co. +#define UHS_VID_3SHAPE_AS 0x189fU // 3Shape A/S +#define UHS_VID_CSSN 0x18a4U // CSSN +#define UHS_VID_VERBATIM 0x18a5U // Verbatim, Ltd +#define UHS_VID_PETALYNX 0x18b1U // Petalynx +#define UHS_VID_E3C_TECHNOLOGIES 0x18b4U // e3C Technologies +#define UHS_VID_MIKKON_TECHNOLOGY_LIMITED 0x18b6U // Mikkon Technology Limited +#define UHS_VID_ZOTEK_ELECTRONIC 0x18b7U // Zotek Electronic Co., Ltd. +#define UHS_VID_AMIT_TECHNOLOGY 0x18c5U // AMIT Technology, Inc. +#define UHS_VID_ECAMM 0x18cdU // Ecamm +#define UHS_VID_GOOGLE 0x18d1U // Google Inc. +#define UHS_VID_STARLINE_INTERNATIONAL_GROUP_LIMITED 0x18d5U // Starline International Group Limited +#define UHS_VID_KABA 0x18d9U // Kaba +#define UHS_VID_LKC_TECHNOLOGIES 0x18dcU // LKC Technologies, Inc. +#define UHS_VID_PLANON_SYSTEM_SOLUTIONS 0x18ddU // Planon System Solutions Inc. +#define UHS_VID_FITIPOWER_INTEGRATED_TECHNOLOGY 0x18e3U // Fitipower Integrated Technology Inc +#define UHS_VID_QCOM 0x18e8U // Qcom +#define UHS_VID_MATROX_GRAPHICS 0x18eaU // Matrox Graphics, Inc. +#define UHS_VID_ARKMICRO_TECHNOLOGIES 0x18ecU // Arkmicro Technologies Inc. +#define UHS_VID_FINEARCH 0x18fdU // FineArch Inc. +#define UHS_VID_GEMBIRD_1 0x1908U // GEMBIRD +#define UHS_VID_MOTOROLA_GSG 0x190dU // Motorola GSG +#define UHS_VID_ALCO_DIGITAL_DEVICES_LIMITED 0x1914U // Alco Digital Devices Limited +#define UHS_VID_NORDIC_SEMICONDUCTOR_ASA 0x1915U // Nordic Semiconductor ASA +#define UHS_VID_FITLINXX 0x1923U // FitLinxx +#define UHS_VID_NEXTWINDOW 0x1926U // NextWindow +#define UHS_VID_AVAGO_TECHNOLOGIES_PTE 0x192fU // Avago Technologies, Pte. +#define UHS_VID_SHENZHEN_XIANHE_TECHNOLOGY 0x1930U // Shenzhen Xianhe Technology Co., Ltd. +#define UHS_VID_NINGBO_BROAD_TELECOMMUNICATION 0x1931U // Ningbo Broad Telecommunication Co., Ltd. +#define UHS_VID_FEATURE_INTEGRATION_TECHNOLOGY_INC_FINTEK 0x1934U // Feature Integration Technology Inc. (Fintek) +#define UHS_VID_DREAM_LINK 0x1941U // Dream Link +#define UHS_VID_SENSORAY 0x1943U // Sensoray Co., Inc. +#define UHS_VID_LAB126 0x1949U // Lab126, Inc. +#define UHS_VID_PRESONUS_AUDIO_ELECTRONICS 0x194fU // PreSonus Audio Electronics, Inc. +#define UHS_VID_HYPERSTONE_AG 0x1951U // Hyperstone AG +#define UHS_VID_IRONKEY 0x1953U // Ironkey Inc. +#define UHS_VID_RADIIENT_TECHNOLOGIES 0x1954U // Radiient Technologies +#define UHS_VID_ITRON_TECHNOLOGY_IONE 0x195dU // Itron Technology iONE +#define UHS_VID_UNIDEN_CORPORATION 0x1965U // Uniden Corporation +#define UHS_VID_CASIO_HITACHI_MOBILE_COMMUNICATIONS 0x1967U // CASIO HITACHI Mobile Communications Co., Ltd. +#define UHS_VID_WISPRO_TECHNOLOGY 0x196bU // Wispro Technology Inc. +#define UHS_VID_DANE_ELEC_CORP_USA 0x1970U // Dane-Elec Corp. USA +#define UHS_VID_DONGGUAN_GUNEETAL_WIRE_AND_CABLE 0x1975U // Dongguan Guneetal Wire & Cable Co., Ltd. +#define UHS_VID_CHIPSBRAND_MICROELECTRONICS_HK 0x1976U // Chipsbrand Microelectronics (HK) Co., Ltd. +#define UHS_VID_T_LOGIC 0x1977U // T-Logic +#define UHS_VID_LEUZE_ELECTRONIC 0x197dU // Leuze electronic +#define UHS_VID_NUCONN_TECHNOLOGY 0x1989U // Nuconn Technology Corp. +#define UHS_VID_BECEEM_COMMUNICATIONS 0x198fU // Beceem Communications Inc. +#define UHS_VID_ACRON_PRECISION_INDUSTRIAL 0x1990U // Acron Precision Industrial Co., Ltd. +#define UHS_VID_TRILLIUM_TECHNOLOGY_PTY 0x1995U // Trillium Technology Pty. Ltd. +#define UHS_VID_PIXELINK 0x1996U // PixeLINK +#define UHS_VID_MICROSTRAIN 0x199bU // MicroStrain, Inc. +#define UHS_VID_THE_IMAGING_SOURCE_EUROPE 0x199eU // The Imaging Source Europe GmbH +#define UHS_VID_BENICA_CORPORATION 0x199fU // Benica Corporation +#define UHS_VID_BIFORST_TECHNOLOGY 0x19a8U // Biforst Technology Inc. +#define UHS_VID_BODELIN 0x19abU // Bodelin +#define UHS_VID_S_LIFE 0x19afU // S Life +#define UHS_VID_BATRONIX 0x19b2U // Batronix +#define UHS_VID_CELESTRON 0x19b4U // Celestron +#define UHS_VID_B_AND_W_GROUP 0x19b5U // B & W Group +#define UHS_VID_INFOTECH_LOGISTIC 0x19b6U // Infotech Logistic, LLC +#define UHS_VID_DATA_ROBOTICS 0x19b9U // Data Robotics +#define UHS_VID_FUTUBA 0x19c2U // Futuba +#define UHS_VID_MINDTRIBE 0x19caU // Mindtribe +#define UHS_VID_PARROT 0x19cfU // Parrot SA +#define UHS_VID_ZTE_WCDMA_TECHNOLOGIES_MSM 0x19d2U // ZTE WCDMA Technologies MSM +#define UHS_VID_KFI_PRINTERS 0x19dbU // KFI Printers +#define UHS_VID_WEIDUAN_ELECTRONIC_ACCESSORY_SZ 0x19e1U // WeiDuan Electronic Accessory (S.Z.) Co., Ltd. +#define UHS_VID_INDUSTRIAL_TECHNOLOGY_RESEARCH_INSTITUTE 0x19e8U // Industrial Technology Research Institute +#define UHS_VID_PAK_HENG_TECHNOLOGY_SHENZHEN 0x19efU // Pak Heng Technology (Shenzhen) Co., Ltd. +#define UHS_VID_RODE_MICROPHONES 0x19f7U // RODE Microphones +#define UHS_VID_GAMPAQ_COLTD 0x19faU // Gampaq Co.Ltd +#define UHS_VID_DYNEX 0x19ffU // Dynex +#define UHS_VID_BELLWOOD_INTERNATIONAL 0x1a08U // Bellwood International, Inc. +#define UHS_VID_USB_IF_NON_WORKSHOP 0x1a0aU // USB-IF non-workshop +#define UHS_VID_KES 0x1a12U // KES Co., Ltd. +#define UHS_VID_VEHO 0x1a1dU // Veho +#define UHS_VID_AMPHENOL_EAST_ASIA 0x1a25U // Amphenol East Asia Ltd. +#define UHS_VID_SEAGATE_BRANDED_SOLUTIONS 0x1a2aU // Seagate Branded Solutions +#define UHS_VID_CHINA_RESOURCE_SEMICO 0x1a2cU // China Resource Semico Co., Ltd +#define UHS_VID_QUANTA_MICROSYSTEMS 0x1a32U // Quanta Microsystems, Inc. +#define UHS_VID_ACRUX 0x1a34U // ACRUX +#define UHS_VID_BIWIN_TECHNOLOGY 0x1a36U // Biwin Technology Ltd. +#define UHS_VID_TERMINUS_TECHNOLOGY 0x1a40U // Terminus Technology Inc. +#define UHS_VID_ACTION_ELECTRONICS 0x1a41U // Action Electronics Co., Ltd. +#define UHS_VID_VASCO_DATA_SECURITY_INTERNATIONAL 0x1a44U // VASCO Data Security International +#define UHS_VID_SILICON_IMAGE 0x1a4aU // Silicon Image +#define UHS_VID_SAFEBOOT_INTERNATIONAL_BV 0x1a4bU // SafeBoot International B.V. +#define UHS_VID_TANDBERG_DATA 0x1a5aU // Tandberg Data +#define UHS_VID_ABBOTT_DIABETES_CARE 0x1a61U // Abbott Diabetes Care +#define UHS_VID_SPANSION 0x1a6aU // Spansion Inc. +#define UHS_VID_SAMYOUNG_ELECTRONICS 0x1a6dU // SamYoung Electronics Co., Ltd +#define UHS_VID_GLOBAL_UNICHIP 0x1a6eU // Global Unichip Corp. +#define UHS_VID_SAGEM_ORGA 0x1a6fU // Sagem Orga GmbH +#define UHS_VID_PHYSIK_INSTRUMENTE 0x1a72U // Physik Instrumente +#define UHS_VID_BAYER_HEALTH_CARE 0x1a79U // Bayer Health Care LLC +#define UHS_VID_LUMBERG_CONNECT_GMBH_AND_CO_KG 0x1a7bU // Lumberg Connect GmbH & Co. KG +#define UHS_VID_EVOLUENT 0x1a7cU // Evoluent +#define UHS_VID_HOLTEK_SEMICONDUCTOR_1 0x1a81U // Holtek Semiconductor, Inc. +#define UHS_VID_QINHENG_ELECTRONICS 0x1a86U // QinHeng Electronics +#define UHS_VID_DYNALITH_SYSTEMS 0x1a89U // Dynalith Systems Co., Ltd. +#define UHS_VID_SGS_TAIWAN 0x1a8bU // SGS Taiwan Ltd. +#define UHS_VID_BANDRICH 0x1a8dU // BandRich, Inc. +#define UHS_VID_LEICA_CAMERA_AG 0x1a98U // Leica Camera AG +#define UHS_VID_DATA_DRIVE_THRU 0x1aa4U // Data Drive Thru, Inc. +#define UHS_VID_UBEACON_TECHNOLOGIES 0x1aa5U // UBeacon Technologies, Inc. +#define UHS_VID_EFORTUNE_TECHNOLOGY 0x1aa6U // eFortune Technology Corp. +#define UHS_VID_KEETOUCH 0x1aadU // KeeTouch +#define UHS_VID_RIGOL_TECHNOLOGIES 0x1ab1U // Rigol Technologies +#define UHS_VID_SALCOMP_PLC 0x1acbU // Salcomp Plc +#define UHS_VID_MIDIPLUS 0x1accU // Midiplus Co, Ltd. +#define UHS_VID_DESAY_WIRE 0x1ad1U // Desay Wire Co., Ltd. +#define UHS_VID_APS 0x1ad4U // APS +#define UHS_VID_SEL_C662_SERIAL_CABLE 0x1adbU // SEL C662 Serial Cable +#define UHS_VID_IC_DESIGN_REINHARD_GOTTINGER 0x1ae4U // ic-design Reinhard Gottinger GmbH +#define UHS_VID_X_TENSIONS 0x1ae7U // X-TENSIONS +#define UHS_VID_HIGH_TOP_PRECISION_ELECTRONIC 0x1aedU // High Top Precision Electronic Co., Ltd. +#define UHS_VID_CONNTECH_ELECTRONIC_SUZHOU_CORPORATION 0x1aefU // Conntech Electronic (Suzhou) Corporation +#define UHS_VID_CONNECT_ONE 0x1af1U // Connect One Ltd. +#define UHS_VID_A_EBERLE_GMBH_AND_CO_KG 0x1afeU // A. Eberle GmbH & Co. KG +#define UHS_VID_MEILHAUS_ELECTRONIC 0x1b04U // Meilhaus Electronic GmbH +#define UHS_VID_BLUTRONICS_SRL 0x1b0eU // BLUTRONICS S.r.l. +#define UHS_VID_CORSAIR 0x1b1cU // Corsair +#define UHS_VID_MSTAR_SEMICONDUCTOR 0x1b20U // MStar Semiconductor, Inc. +#define UHS_VID_WILINX 0x1b22U // WiLinx Corp. +#define UHS_VID_CELLEX_POWER_PRODUCTS 0x1b26U // Cellex Power Products, Inc. +#define UHS_VID_CURRENT_ELECTRONICS 0x1b27U // Current Electronics Inc. +#define UHS_VID_NAVISIS 0x1b28U // NAVIsis Inc. +#define UHS_VID_UGOBE_LIFE_FORMS 0x1b32U // Ugobe Life Forms, Inc. +#define UHS_VID_VIXS_SYSTEMS 0x1b36U // ViXS Systems, Inc. +#define UHS_VID_IPASSION_TECHNOLOGY 0x1b3bU // iPassion Technology Inc. +#define UHS_VID_GENERALPLUS_TECHNOLOGY 0x1b3fU // Generalplus Technology Inc. +#define UHS_VID_ENERGIZER_HOLDINGS 0x1b47U // Energizer Holdings, Inc. +#define UHS_VID_PLASTRON_PRECISION 0x1b48U // Plastron Precision Co., Ltd. +#define UHS_VID_ARH 0x1b52U // ARH Inc. +#define UHS_VID_KS_TERMINALS 0x1b59U // K.S. Terminals Inc. +#define UHS_VID_CHAO_ZHOU_KAI_YUAN_ELECTRIC 0x1b5aU // Chao Zhou Kai Yuan Electric Co., Ltd. +#define UHS_VID_THE_HONG_KONG_STANDARDS_AND_TESTING_CENTRE 0x1b65U // The Hong Kong Standards and Testing Centre Ltd. +#define UHS_VID_FUSHICAI 0x1b71U // Fushicai +#define UHS_VID_ATERGI_TECHNOLOGY 0x1b72U // ATERGI TECHNOLOGY CO., LTD. +#define UHS_VID_FRESCO_LOGIC 0x1b73U // Fresco Logic +#define UHS_VID_OVISLINK 0x1b75U // Ovislink Corp. +#define UHS_VID_LEGEND_SILICON 0x1b76U // Legend Silicon Corp. +#define UHS_VID_AFATECH 0x1b80U // Afatech +#define UHS_VID_DONGGUAN_GUANSHANG_ELECTRONICS 0x1b86U // Dongguan Guanshang Electronics Co., Ltd. +#define UHS_VID_SHENMING_ELECTRON_DONG_GUAN 0x1b88U // ShenMing Electron (Dong Guan) Co., Ltd. +#define UHS_VID_ALTIUM_LIMITED 0x1b8cU // Altium Limited +#define UHS_VID_E_MOVE_TECHNOLOGY 0x1b8dU // e-MOVE Technology Co., Ltd. +#define UHS_VID_AMLOGIC 0x1b8eU // Amlogic, Inc. +#define UHS_VID_MA_LABS 0x1b8fU // MA LABS, Inc. +#define UHS_VID_N_TRIG 0x1b96U // N-Trig +#define UHS_VID_YMAX_COMMUNICATIONS 0x1b98U // YMax Communications Corp. +#define UHS_VID_SHENZHEN_YUANCHUAN_ELECTRONIC 0x1b99U // Shenzhen Yuanchuan Electronic +#define UHS_VID_JINQ_CHERN_ENTERPRISE 0x1ba1U // JINQ CHERN ENTERPRISE CO., LTD. +#define UHS_VID_LITE_METALS_AND_PLASTIC_SHENZHEN 0x1ba2U // Lite Metals & Plastic (Shenzhen) Co., Ltd. +#define UHS_VID_EMBER_CORPORATION 0x1ba4U // Ember Corporation +#define UHS_VID_ABILIS_SYSTEMS 0x1ba6U // Abilis Systems +#define UHS_VID_CHINA_TELECOMMUNICATION_TECHNOLOGY_LABS 0x1ba8U // China Telecommunication Technology Labs +#define UHS_VID_HARMONIX_MUSIC 0x1badU // Harmonix Music +#define UHS_VID_VUZIX_CORPORATION 0x1baeU // Vuzix Corporation +#define UHS_VID_T_AND_A_MOBILE_PHONES 0x1bbbU // T & A Mobile Phones +#define UHS_VID_FORD_MOTOR 0x1bc4U // Ford Motor Co. +#define UHS_VID_AVIXE_TECHNOLOGY_CHINA 0x1bc5U // AVIXE Technology (China) Ltd. +#define UHS_VID_TELIT_WIRELESS_SOLUTIONS 0x1bc7U // Telit Wireless Solutions +#define UHS_VID_CONTAC_CABLE_INDUSTRIAL_LIMITED 0x1bceU // Contac Cable Industrial Limited +#define UHS_VID_SUNPLUS_INNOVATION_TECHNOLOGY 0x1bcfU // Sunplus Innovation Technology Inc. +#define UHS_VID_HANGZHOU_RIYUE_ELECTRONIC 0x1bd0U // Hangzhou Riyue Electronic Co., Ltd. +#define UHS_VID_BG_SYSTEMS 0x1bd5U // BG Systems, Inc. +#define UHS_VID_P_TWO_INDUSTRIES 0x1bdeU // P-TWO INDUSTRIES, INC. +#define UHS_VID_SHENZHEN_TONGYUAN_NETWORK_COMMUNICATION_CABLES 0x1befU // Shenzhen Tongyuan Network-Communication Cables Co., Ltd +#define UHS_VID_REALVISION 0x1bf0U // RealVision Inc. +#define UHS_VID_EXTRANET_SYSTEMS 0x1bf5U // Extranet Systems Inc. +#define UHS_VID_ORIENT_SEMICONDUCTOR_ELECTRONICS 0x1bf6U // Orient Semiconductor Electronics, Ltd. +#define UHS_VID_TOUCHPACK 0x1bfdU // TouchPack +#define UHS_VID_KRETON_CORPORATION 0x1c02U // Kreton Corporation +#define UHS_VID_QNAP_SYSTEM 0x1c04U // QNAP System Inc. +#define UHS_VID_IONICS_EMS 0x1c0cU // Ionics EMS, Inc. +#define UHS_VID_RELM_WIRELESS 0x1c0dU // Relm Wireless +#define UHS_VID_LANTERRA_INDUSTRIAL 0x1c10U // Lanterra Industrial Co., Ltd. +#define UHS_VID_ALECTRONIC_LIMITED 0x1c13U // ALECTRONIC LIMITED +#define UHS_VID_DATEL_ELECTRONICS 0x1c1aU // Datel Electronics Ltd. +#define UHS_VID_VOLKSWAGEN_OF_AMERICA 0x1c1bU // Volkswagen of America, Inc. +#define UHS_VID_GOLDVISH 0x1c1fU // Goldvish S.A. +#define UHS_VID_FUJI_ELECTRIC_DEVICE_TECHNOLOGY 0x1c20U // Fuji Electric Device Technology Co., Ltd. +#define UHS_VID_ADDMM 0x1c21U // ADDMM LLC +#define UHS_VID_ZHONGSHAN_CHIANG_YU_ELECTRIC 0x1c22U // ZHONGSHAN CHIANG YU ELECTRIC CO., LTD. +#define UHS_VID_SHANGHAI_HAIYING_ELECTRONICS 0x1c26U // Shanghai Haiying Electronics Co., Ltd. +#define UHS_VID_HUIYANG_D_AND_S_CABLE 0x1c27U // HuiYang D & S Cable Co., Ltd. +#define UHS_VID_ELSTER 0x1c29U // Elster GmbH +#define UHS_VID_LS_CABLE 0x1c31U // LS Cable Ltd. +#define UHS_VID_SPRINGCARD 0x1c34U // SpringCard +#define UHS_VID_AUTHORIZER_TECHNOLOGIES 0x1c37U // Authorizer Technologies, Inc. +#define UHS_VID_NONIN_MEDICAL 0x1c3dU // NONIN MEDICAL INC. +#define UHS_VID_WEP_PERIPHERALS 0x1c3eU // Wep Peripherals +#define UHS_VID_EZPROTOTYPES 0x1c40U // EZPrototypes +#define UHS_VID_CHERNG_WEEI_TECHNOLOGY 0x1c49U // Cherng Weei Technology Corp. +#define UHS_VID_SIGMA_MICRO 0x1c4fU // SiGma Micro +#define UHS_VID_PHILIPS_AND_LITE_ON_DIGITAL_SOLUTIONS_CORPORATION 0x1c6bU // Philips & Lite-ON Digital Solutions Corporation +#define UHS_VID_SKYDIGITAL 0x1c6cU // Skydigital Inc. +#define UHS_VID_AMT 0x1c73U // AMT +#define UHS_VID_KAETAT_INDUSTRIAL 0x1c77U // Kaetat Industrial Co., Ltd. +#define UHS_VID_DATASCOPE 0x1c78U // Datascope Corp. +#define UHS_VID_UNIGEN_CORPORATION 0x1c79U // Unigen Corporation +#define UHS_VID_LIGHTUNING_TECHNOLOGY 0x1c7aU // LighTuning Technology Inc. +#define UHS_VID_LUXSHARE_PRECISION_INDUSTRY_SHENZHEN 0x1c7bU // LUXSHARE PRECISION INDUSTRY (SHENZHEN) CO., LTD. +#define UHS_VID_SCHOMAECKER 0x1c83U // Schomaecker GmbH +#define UHS_VID_2N_TELEKOMUNIKACE_AS 0x1c87U // 2N TELEKOMUNIKACE a.s. +#define UHS_VID_SOMAGIC 0x1c88U // Somagic, Inc. +#define UHS_VID_HONGKONG_WEIDIDA_ELECTRON_LIMITED 0x1c89U // HONGKONG WEIDIDA ELECTRON LIMITED +#define UHS_VID_ASTRON_INTERNATIONAL 0x1c8eU // ASTRON INTERNATIONAL CORP. +#define UHS_VID_ALPINE_ELECTRONICS 0x1c98U // ALPINE ELECTRONICS, INC. +#define UHS_VID_OMEGA_TECHNOLOGY 0x1c9eU // OMEGA TECHNOLOGY +#define UHS_VID_ACCARIO 0x1ca0U // ACCARIO Inc. +#define UHS_VID_SYMWAVE 0x1ca1U // Symwave +#define UHS_VID_KINSTONE 0x1cacU // Kinstone +#define UHS_VID_ACES_ELECTRONIC 0x1cb3U // Aces Electronic Co., Ltd. +#define UHS_VID_OPEX_CORPORATION 0x1cb4U // OPEX CORPORATION +#define UHS_VID_IDEACOM_TECHNOLOGY 0x1cb6U // IdeaCom Technology Inc. +#define UHS_VID_LUMINARY_MICRO 0x1cbeU // Luminary Micro Inc. +#define UHS_VID_FORTAT_SKYMARK_INDUSTRIAL_COMPANY 0x1cbfU // FORTAT SKYMARK INDUSTRIAL COMPANY +#define UHS_VID_PLANTSENSE 0x1cc0U // PlantSense +#define UHS_VID_NEXTWAVE_BROADBAND 0x1ccaU // NextWave Broadband Inc. +#define UHS_VID_BODATONG_TECHNOLOGY_SHENZHEN 0x1ccdU // Bodatong Technology (Shenzhen) Co., Ltd. +#define UHS_VID_ADP_CORPORATION 0x1cd4U // adp corporation +#define UHS_VID_FIRECOMMS 0x1cd5U // Firecomms Ltd. +#define UHS_VID_ANTONIO_PRECISE_PRODUCTS_MANUFACTORY 0x1cd6U // Antonio Precise Products Manufactory Ltd. +#define UHS_VID_TELECOMMUNICATIONS_TECHNOLOGY_ASSOCIATION_TTA 0x1cdeU // Telecommunications Technology Association (TTA) +#define UHS_VID_WONTEN_TECHNOLOGY 0x1cdfU // WonTen Technology Co., Ltd. +#define UHS_VID_EDIMAX_TECHNOLOGY 0x1ce0U // EDIMAX TECHNOLOGY CO., LTD. +#define UHS_VID_AMPHENOL_KAE 0x1ce1U // Amphenol KAE +#define UHS_VID_DRESDEN_ELEKTRONIK 0x1cf1U // Dresden Elektronik +#define UHS_VID_ANDES_TECHNOLOGY_CORPORATION 0x1cfcU // ANDES TECHNOLOGY CORPORATION +#define UHS_VID_FLEXTRONICS_DIGITAL_DESIGN_JAPAN 0x1cfdU // Flextronics Digital Design Japan, LTD. +#define UHS_VID_ICON 0x1d03U // iCON +#define UHS_VID_SOLID_MOTION 0x1d07U // Solid-Motion +#define UHS_VID_NINGBO_HENTEK_DRAGON_ELECTRONICS 0x1d08U // NINGBO HENTEK DRAGON ELECTRONICS CO., LTD. +#define UHS_VID_TECHFAITH_WIRELESS_TECHNOLOGY_LIMITED 0x1d09U // TechFaith Wireless Technology Limited +#define UHS_VID_JOHNSON_CONTROLS_INC_THE_AUTOMOTIVE_BUSINESS_UNIT 0x1d0aU // Johnson Controls, Inc. The Automotive Business Unit +#define UHS_VID_HAN_HUA_CABLE_AND_WIRE_TECHNOLOGY_JX 0x1d0bU // HAN HUA CABLE & WIRE TECHNOLOGY (J.X.) CO., LTD. +#define UHS_VID_SONIX_TECHNOLOGY 0x1d0fU // Sonix Technology Co., Ltd. +#define UHS_VID_ALPHA_SAT_TECHNOLOGY_LIMITED 0x1d14U // ALPHA-SAT TECHNOLOGY LIMITED +#define UHS_VID_C_THRU_MUSIC 0x1d17U // C-Thru Music Ltd. +#define UHS_VID_DEXATEK_TECHNOLOGY 0x1d19U // Dexatek Technology Ltd. +#define UHS_VID_DIOSTECH 0x1d1fU // Diostech Co., Ltd. +#define UHS_VID_SAMTACK 0x1d20U // SAMTACK INC. +#define UHS_VID_ASUS 0x1d27U // ASUS +#define UHS_VID_DREAM_CHEEKY 0x1d34U // Dream Cheeky +#define UHS_VID_TOUCH 0x1d45U // Touch +#define UHS_VID_PEGATRON_CORPORATION 0x1d4dU // PEGATRON CORPORATION +#define UHS_VID_OPENMOKO 0x1d50U // OpenMoko, Inc. +#define UHS_VID_XENTA 0x1d57U // Xenta +#define UHS_VID_SMARTRONIX 0x1d5bU // Smartronix, Inc. +#define UHS_VID_LINUX_FOUNDATION 0x1d6bU // Linux Foundation +#define UHS_VID_CITIZEN 0x1d90U // Citizen +#define UHS_VID_ACTIONS_MICROELECTRONICS 0x1de1U // Actions Microelectronics Co. +#define UHS_VID_QUALCOMM_OPTION 0x1e0eU // Qualcomm / Option +#define UHS_VID_POINT_GREY_RESEARCH 0x1e10U // Point Grey Research, Inc. +#define UHS_VID_MIRION_TECHNOLOGIES_DOSIMETRY_SERVICES_DIVISION 0x1e17U // Mirion Technologies Dosimetry Services Division +#define UHS_VID_LUMENSION_SECURITY 0x1e1dU // Lumension Security +#define UHS_VID_INVIA 0x1e1fU // INVIA +#define UHS_VID_FESTO_AG_AND_CO_KG 0x1e29U // Festo AG & Co. KG +#define UHS_VID_CHIPSBANK_MICROELECTRONICS_1 0x1e3dU // Chipsbank Microelectronics Co., Ltd +#define UHS_VID_CLEVERSCOPE 0x1e41U // Cleverscope +#define UHS_VID_CUBETERNET 0x1e4eU // Cubeternet +#define UHS_VID_TYPEMATRIX 0x1e54U // TypeMatrix +#define UHS_VID_TREKSTOR_GMBH_AND_CO_KG 0x1e68U // TrekStor GmbH & Co. KG +#define UHS_VID_NZXT 0x1e71U // NZXT +#define UHS_VID_COBY_ELECTRONICS_CORPORATION 0x1e74U // Coby Electronics Corporation +#define UHS_VID_ROCCAT 0x1e7dU // ROCCAT +#define UHS_VID_NUCORE_TECHNOLOGY 0x1ebbU // NuCORE Technology, Inc. +#define UHS_VID_AIRTIES_WIRELESS_NETWORKS 0x1edaU // AirTies Wireless Networks +#define UHS_VID_BLACKMAGIC_DESIGN 0x1edbU // Blackmagic design +#define UHS_VID_ONDA_COMMUNICATION_SPA 0x1ee8U // ONDA COMMUNICATION S.p.a. +#define UHS_VID_EADS_DEUTSCHLAND 0x1ef6U // EADS Deutschland GmbH +#define UHS_VID_CAL_COMP 0x1f28U // Cal-Comp +#define UHS_VID_ONDA_UNVERIFIED 0x1f3aU // Onda (unverified) +#define UHS_VID_THE_NEAT_COMPANY 0x1f44U // The Neat Company +#define UHS_VID_H_TRONIC 0x1f48U // H-TRONIC GmbH +#define UHS_VID_G_TEK_ELECTRONICS_GROUP 0x1f4dU // G-Tek Electronics Group +#define UHS_VID_ALIPH 0x1f6fU // Aliph +#define UHS_VID_INNOSTOR_TECHNOLOGY_CORPORATION 0x1f75U // Innostor Technology Corporation +#define UHS_VID_TANDBERG 0x1f82U // TANDBERG +#define UHS_VID_ALERE 0x1f84U // Alere, Inc. +#define UHS_VID_STANTUM 0x1f87U // Stantum +#define UHS_VID_UBIQUITI_NETWORKS 0x1f9bU // Ubiquiti Networks, Inc. +#define UHS_VID_SAMSUNG_OPTO_ELECTRONCS 0x1fabU // Samsung Opto-Electroncs Co., Ltd. +#define UHS_VID_DELPHIN_TECHNOLOGY_AG 0x1fbdU // Delphin Technology AG +#define UHS_VID_NXP_SEMICONDUCTORS 0x1fc9U // NXP Semiconductors +#define UHS_VID_ILX_LIGHTWAVE_CORPORATION 0x1fdeU // ILX Lightwave Corporation +#define UHS_VID_VERTEX_WIRELESS 0x1fe7U // Vertex Wireless Co., Ltd. +#define UHS_VID_CVT_ELECTRONICSCOLTD 0x1ff7U // CVT Electronics.Co.,Ltd +#define UHS_VID_IDEOFY 0x1fffU // Ideofy Inc. +#define UHS_VID_D_LINK 0x2001U // D-Link Corp. +#define UHS_VID_DAP_TECHNOLOGIES 0x2002U // DAP Technologies +#define UHS_VID_DETECTOMAT 0x2003U // detectomat +#define UHS_VID_RELOOP 0x200cU // Reloop +#define UHS_VID_PCTV_SYSTEMS 0x2013U // PCTV Systems +#define UHS_VID_PLANEX_1 0x2019U // PLANEX +#define UHS_VID_ENCORE_ELECTRONICS 0x203dU // Encore Electronics Inc. +#define UHS_VID_HAUPPAUGE 0x2040U // Hauppauge +#define UHS_VID_TEXAS_INSTRUMENTS_2 0x2047U // Texas Instruments +#define UHS_VID_NANO_RIVER_TECHNOLOGY 0x2058U // Nano River Technology +#define UHS_VID_TAICANG_TANDW_ELECTRONICS 0x2077U // Taicang T&W Electronics Co. Ltd +#define UHS_VID_BARNES_AND_NOBLE 0x2080U // Barnes & Noble +#define UHS_VID_SIMPASS 0x2086U // SIMPASS +#define UHS_VID_CANDO 0x2087U // Cando +#define UHS_VID_CLAY_LOGIC 0x20a0U // Clay Logic +#define UHS_VID_XMOS 0x20b1U // XMOS Ltd +#define UHS_VID_HANVON 0x20b3U // Hanvon +#define UHS_VID_QI_HARDWARE 0x20b7U // Qi Hardware +#define UHS_VID_MINICIRCUITS 0x20ceU // Minicircuits +#define UHS_VID_SIMTEC_ELECTRONICS 0x20dfU // Simtec Electronics +#define UHS_VID_NET_NEW_ELECTRONIC_TECHNOLOGY 0x20f1U // NET New Electronic Technology GmbH +#define UHS_VID_TRENDNET_1 0x20f4U // TRENDnet +#define UHS_VID_XIMEA 0x20f7U // XIMEA +#define UHS_VID_RT_SYSTEMS 0x2100U // RT Systems +#define UHS_VID_ACTIONSTAR 0x2101U // ActionStar +#define UHS_VID_VIA_LABS 0x2109U // VIA Labs, Inc. +#define UHS_VID_SOFTKINETIC 0x2113U // Softkinetic +#define UHS_VID_ADVANCED_SILICON 0x2149U // Advanced Silicon S.A. +#define UHS_VID_CREATIVE_UNKNOWN 0x2162U // Creative (?) +#define UHS_VID_GW_INSTEK 0x2184U // GW Instek +#define UHS_VID_EMOTIV_SYSTEMS_PTY 0x21a1U // Emotiv Systems Pty. Ltd. +#define UHS_VID_AGECODAGIS_SARL 0x21d6U // Agecodagis SARL +#define UHS_VID_MACALLY_1 0x2222U // MacAlly +#define UHS_VID_SAMWOO_ENTERPRISE 0x2227U // SAMWOO Enterprise +#define UHS_VID_SILICON_MOTION_1 0x2232U // Silicon Motion +#define UHS_VID_RADIOSHACK_CORPORATION 0x2233U // RadioShack Corporation +#define UHS_VID_KOBO 0x2237U // Kobo Inc. +#define UHS_VID_MORPHO 0x225dU // Morpho +#define UHS_VID_8D_TECHNOLOGIES 0x228dU // 8D Technologies inc. +#define UHS_VID_PIE_DIGITAL 0x22a6U // Pie Digital, Inc. +#define UHS_VID_MOTOROLA_PCS 0x22b8U // Motorola PCS +#define UHS_VID_ETURBOTOUCH_TECHNOLOGY 0x22b9U // eTurboTouch Technology, Inc. +#define UHS_VID_TECHNOLOGY_INNOVATION_HOLDINGS 0x22baU // Technology Innovation Holdings, Ltd +#define UHS_VID_PINNACLE_SYSTEMS_1 0x2304U // Pinnacle Systems, Inc. +#define UHS_VID_SHINING_TECHNOLOGIES_INC_HEX_ 0x2318U // Shining Technologies, Inc. [hex] +#define UHS_VID_ARDUINO 0x2341U // Arduino SA +#define UHS_VID_PUMATRONIX_LTDA 0x2373U // Pumatronix Ltda +#define UHS_VID_DIGITALWAY_1 0x2375U // Digit@lway, Inc. +#define UHS_VID_SANHO_DIGITAL_ELECTRONICS 0x2406U // SANHO Digital Electronics Co., Ltd. +#define UHS_VID_AESSENT_TECHNOLOGY 0x2443U // Aessent Technology Ltd +#define UHS_VID_TRIPP_LITE_1 0x2478U // Tripp-Lite +#define UHS_VID_MAXXTER 0x248aU // Maxxter +#define UHS_VID_M2TECH_SRL 0x249cU // M2Tech s.r.l. +#define UHS_VID_PARATRONIC 0x24e1U // Paratronic +#define UHS_VID_TWINMOS_1 0x2632U // TwinMOS +#define UHS_VID_XSENS 0x2639U // Xsens +#define UHS_VID_ELECTRONICS_FOR_IMAGING_INC_HEX_ 0x2650U // Electronics For Imaging, Inc. [hex] +#define UHS_VID_SUNDTEK 0x2659U // Sundtek +#define UHS_VID_BASLER_AG 0x2676U // Basler AG +#define UHS_VID_CITIZEN_1 0x2730U // Citizen +#define UHS_VID_DIGITALWAY_2 0x2735U // DigitalWay +#define UHS_VID_NHJ 0x2770U // NHJ, Ltd +#define UHS_VID_THINGM 0x27b8U // ThingM +#define UHS_VID_ASUSTEK_COMPUTER_1 0x2821U // ASUSTek Computer Inc. +#define UHS_VID_TOPTRONIC_INDUSTRIAL 0x2899U // Toptronic Industrial Co., Ltd +#define UHS_VID_DRACALRAPHNET_TECHNOLOGIES 0x289bU // Dracal/Raphnet technologies +#define UHS_VID_JOLLA_OY 0x2931U // Jolla Oy +#define UHS_VID_DOG_HUNTER_AG 0x2a03U // dog hunter AG +#define UHS_VID_RTD_EMBEDDED_TECHNOLOGIES 0x2a37U // RTD Embedded Technologies, Inc. +#define UHS_VID_MEIZU 0x2a45U // Meizu Corp. +#define UHS_VID_PLANEX_COMMUNICATIONS_2 0x2c02U // Planex Communications +#define UHS_VID_DOLPHIN_PERIPHERALS 0x2c1aU // Dolphin Peripherals +#define UHS_VID_FUJITSU_1 0x2fb2U // Fujitsu, Ltd +#define UHS_VID_EAGLETRON_1 0x3125U // Eagletron +#define UHS_VID_NAVINI_NETWORKS 0x3136U // Navini Networks +#define UHS_VID_WHANAM_ELECTRONICS 0x3176U // Whanam Electronics Co., Ltd +#define UHS_VID_LINK_INSTRUMENTS 0x3195U // Link Instruments +#define UHS_VID_VIDZMEDIA_PTE 0x3275U // VidzMedia Pte Ltd +#define UHS_VID_INLINE 0x3333U // InLine +#define UHS_VID_AEI 0x3334U // AEI +#define UHS_VID_YAKUMO 0x3340U // Yakumo +#define UHS_VID_LEAGUER_MICROELECTRONICS_LME 0x3344U // Leaguer Microelectronics (LME) +#define UHS_VID_MICRO_STAR 0x3504U // Micro Star +#define UHS_VID_POWER_QUOTIENT_INTERNATIONAL_1 0x3538U // Power Quotient International Co., Ltd +#define UHS_VID_DIVA 0x3579U // DIVA +#define UHS_VID_SHARKOON 0x357dU // Sharkoon +#define UHS_VID_INVIBRO 0x3636U // InVibro +#define UHS_VID_WEM 0x3838U // WEM +#define UHS_VID_NATIONAL_INSTRUMENTS 0x3923U // National Instruments Corp. +#define UHS_VID_I_O_DATA 0x40bbU // I-O Data +#define UHS_VID_I_ROCKS 0x4101U // i-rocks +#define UHS_VID_IRIVER_1 0x4102U // iRiver, Ltd. +#define UHS_VID_DELL_COMPUTER_1 0x413cU // Dell Computer Corp. +#define UHS_VID_USBEST_TECHNOLOGY 0x4146U // USBest Technology +#define UHS_VID_TARGUS 0x4168U // Targus +#define UHS_VID_USB_DESIGN_BY_EXAMPLE 0x4242U // USB Design by Example +#define UHS_VID_GOPRO 0x4255U // GoPro +#define UHS_VID_BROADCOM_1 0x4317U // Broadcom Corp. +#define UHS_VID_WINCHIPHEAD 0x4348U // WinChipHead +#define UHS_VID_SHUTTLE_2 0x4572U // Shuttle, Inc. +#define UHS_VID_PANRAM 0x4586U // Panram +#define UHS_VID_EMS_PRODUCTION 0x4670U // EMS Production +#define UHS_VID_MIDITECH 0x4752U // Miditech +#define UHS_VID_GW_INSTEK_1 0x4757U // GW Instek +#define UHS_VID_ACEECA 0x4766U // Aceeca +#define UHS_VID_MEMOREX 0x4855U // Memorex +#define UHS_VID_SIMPLETECH 0x4971U // SimpleTech +#define UHS_VID_MUSICAL_FIDELITY 0x4d46U // Musical Fidelity +#define UHS_VID_GRANDTEC 0x5032U // Grandtec +#define UHS_VID_LINKSYS_UNKNOWN 0x5041U // Linksys (?) +#define UHS_VID_AVERATEC_UNKNOWN 0x50c2U // Averatec (?) +#define UHS_VID_SWEEX_1 0x5173U // Sweex +#define UHS_VID_I_TETRA 0x5219U // I-Tetra +#define UHS_VID_OWON 0x5345U // Owon +#define UHS_VID_SATOSHILABS 0x534cU // SatoshiLabs +#define UHS_VID_MEYER_INSTRUMENTS_MIS_1 0x5354U // Meyer Instruments (MIS) +#define UHS_VID_TRANSMETA 0x544dU // Transmeta Corp. +#define UHS_VID_UC_LOGIC_TECHNOLOGY 0x5543U // UC-Logic Technology Corp. +#define UHS_VID_EPIPHAN_SYSTEMS 0x5555U // Epiphan Systems Inc. +#define UHS_VID_ONSPEC_ELECTRONIC 0x55aaU // OnSpec Electronic, Inc. +#define UHS_VID_GOTVIEW 0x5654U // Gotview +#define UHS_VID_UNI_TREND_GROUP_LIMITED 0x5656U // Uni-Trend Group Limited +#define UHS_VID_IRTOUCHSYSTEMS 0x595aU // IRTOUCHSYSTEMS Co. Ltd. +#define UHS_VID_ACER_2 0x5986U // Acer, Inc +#define UHS_VID_NONOLITH_LABS 0x59e3U // Nonolith Labs +#define UHS_VID_ZINWELL 0x5a57U // Zinwell +#define UHS_VID_BEHOLDER_INTERNATIONAL 0x6000U // Beholder International Ltd. +#define UHS_VID_INGENIC_SEMICONDUCTOR 0x601aU // Ingenic Semiconductor Ltd. +#define UHS_VID_SITECOM 0x6189U // Sitecom +#define UHS_VID_LIGHTINGSOFT_AG 0x6244U // LightingSoft AG +#define UHS_VID_TWINHAN_TECHNOLOGY 0x6253U // TwinHan Technology Co., Ltd +#define UHS_VID_CORELOGIC 0x636cU // CoreLogic, Inc. +#define UHS_VID_UNKNOWN_SONY_UNKNOWN 0x6472U // Unknown (Sony?) +#define UHS_VID_ARKMICRO_TECHNOLOGIES_1 0x6547U // Arkmicro Technologies Inc. +#define UHS_VID_IRTOUCHSYSTEMS_1 0x6615U // IRTOUCHSYSTEMS Co. Ltd. +#define UHS_VID_PROTOTYPE_PRODUCT_VENDOR_ID 0x6666U // Prototype product Vendor ID +#define UHS_VID_WISEGROUP 0x6677U // WiseGroup, Ltd. +#define UHS_VID_3COM_1 0x6891U // 3Com +#define UHS_VID_OPERA1 0x695cU // Opera1 +#define UHS_VID_YEALINK_NETWORK_TECHNOLOGY 0x6993U // Yealink Network Technology Co., Ltd. +#define UHS_VID_SHANGHAI_JUJO_ELECTRONICS 0x6a75U // Shanghai Jujo Electronics Co., Ltd +#define UHS_VID_CME_CENTRAL_MUSIC 0x7104U // CME (Central Music Co.) +#define UHS_VID_STACKFOUNDRY 0x726cU // StackFoundry LLC +#define UHS_VID_TBS_TECHNOLOGIES_CHINA 0x734cU // TBS Technologies China +#define UHS_VID_BEIJING_STONE_TECHNOLOGY 0x7373U // Beijing STONE Technology Co. Ltd. +#define UHS_VID_EDIMAX_TECHNOLOGY_1 0x7392U // Edimax Technology Co., Ltd +#define UHS_VID_INTEL_1 0x8086U // Intel Corp. +#define UHS_VID_INTEL_2 0x8087U // Intel Corp. +#define UHS_VID_VIRTUALBOX 0x80eeU // VirtualBox +#define UHS_VID_KEIO 0x8282U // Keio +#define UHS_VID_EGO_SYSTEMS_1 0x8341U // EGO Systems, Inc. +#define UHS_VID_TRANSCEND_INFORMATION_1 0x8564U // Transcend Information, Inc. +#define UHS_VID_INTENSO_GMBG 0x8644U // Intenso GmbG +#define UHS_VID_CH_PRODUCTS_1 0x8e06U // CH Products, Inc. +#define UHS_VID_SITECOM_1 0x9016U // Sitecom +#define UHS_VID_TEVII_TECHNOLOGY 0x9022U // TeVii Technology Ltd. +#define UHS_VID_GEOLAB 0x9148U // GeoLab, Ltd +#define UHS_VID_MOSCHIP_SEMICONDUCTOR 0x9710U // MosChip Semiconductor +#define UHS_VID_BESTMEDIA_CD_RECORDABLE_GMBH_AND_CO_KG 0x9849U // Bestmedia CD Recordable GmbH & Co. KG +#define UHS_VID_ODEON 0x9999U // Odeon +#define UHS_VID_GRANDTEC_1 0x99faU // Grandtec +#define UHS_VID_J_WESTHUES 0x9ac4U // J. Westhues +#define UHS_VID_MARVELL_SEMICONDUCTOR_1 0x9e88U // Marvell Semiconductor, Inc. +#define UHS_VID_ANMO_ELECTRONICS_CORP_DINO_LITE_UNKNOWN 0xa128U // AnMo Electronics Corp. / Dino-Lite (?) +#define UHS_VID_ANMO_ELECTRONICS_CORPORATION 0xa168U // AnMo Electronics Corporation +#define UHS_VID_ASIX 0xa600U // Asix +#define UHS_VID_3COM_2 0xa727U // 3Com +#define UHS_VID_MXT 0xaaaaU // MXT +#define UHS_VID_UNKNOWN_3 0xabcdU // Unknown +#define UHS_VID_BLUE_MICROPHONES 0xb58eU // Blue Microphones +#define UHS_VID_CARD_DEVICE_EXPERT 0xc216U // Card Device Expert Co., LTD +#define UHS_VID_KEIL_SOFTWARE_1 0xc251U // Keil Software, Inc. +#define UHS_VID_CACE_TECHNOLOGIES 0xcaceU // CACE Technologies Inc. +#define UHS_VID_SMART_TECHNOLOGY_INDUSTRIAL 0xcd12U // SMART TECHNOLOGY INDUSTRIAL LTD. +#define UHS_VID_ULTIMARC 0xd208U // Ultimarc +#define UHS_VID_ULTIMARC_1 0xd209U // Ultimarc +#define UHS_VID_LOGILINK 0xd904U // LogiLink +#define UHS_VID_XORCOM 0xe4e4U // Xorcom Ltd. +#define UHS_VID_MAKINGTHINGS 0xeb03U // MakingThings +#define UHS_VID_EMPIA_TECHNOLOGY 0xeb1aU // eMPIA Technology, Inc. +#define UHS_VID_KWORLD 0xeb2aU // KWorld +#define UHS_VID_SMART_TECHNOLOGY_INDUSTRIAL_1 0xef18U // SMART TECHNOLOGY INDUSTRIAL LTD. +#define UHS_VID_HEWLETT_PACKARD_1 0xf003U // Hewlett Packard +#define UHS_VID_LEAP_MOTION 0xf182U // Leap Motion +#define UHS_VID_ATTEN_ELECTRONICS_SIGLENT_TECHNOLOGIES 0xf4ecU // Atten Electronics / Siglent Technologies +#define UHS_VID_SHENZHEN_SIGLENT 0xf4edU // Shenzhen Siglent Co., Ltd. +#define UHS_VID_HAMA_1 0xf766U // Hama +#define UHS_VID_CONRAD_ELECTRONIC_SE 0xfc08U // Conrad Electronic SE +#define UHS_VID_FNK_TECH 0xffeeU // FNK Tech + +#endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h new file mode 100644 index 000000000000..190077d17c86 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h @@ -0,0 +1,336 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#if !defined(_UHS_host_h_) || defined(USBCORE_H) +#error "Never include UHS_UsbCore.h directly; include UHS_Host.h instead" +#else +#define USBCORE_H + +#ifndef UHS_HOST_MAX_INTERFACE_DRIVERS +#define UHS_HOST_MAX_INTERFACE_DRIVERS 0x10U // Default maximum number of USB interface drivers +#endif + +#ifndef SYSTEM_OR_SPECIAL_YIELD +#define SYSTEM_OR_SPECIAL_YIELD(...) VOID0 +#endif + +#ifndef SYSTEM_OR_SPECIAL_YIELD_FROM_ISR +#define SYSTEM_OR_SPECIAL_YIELD_FROM_ISR(...) SYSTEM_OR_SPECIAL_YIELD +#endif + +// As we make extensions to a target interface add to UHS_HOST_MAX_INTERFACE_DRIVERS +// This offset gets calculated for supporting wide subclasses, such as HID, BT, etc. +#define UHS_HID_INDEX (UHS_HOST_MAX_INTERFACE_DRIVERS + 1) + +/* Common setup data constant combinations */ +//get descriptor request type +#define UHS_bmREQ_GET_DESCR (USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE) + +//set request type for all but 'set feature' and 'set interface' +#define UHS_bmREQ_SET (USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE) + +//get interface request type +#define UHS_bmREQ_CL_GET_INTF (USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE) + +// D7 data transfer direction (0 - host-to-device, 1 - device-to-host) +// D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved) +// D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved) + + +// TO-DO: Use the python script to generate these. +// TO-DO: Add _all_ subclasses here. +// USB Device Classes, Subclasses and Protocols +//////////////////////////////////////////////////////////////////////////////// +// Use Class Info in the Interface Descriptors +#define UHS_USB_CLASS_USE_CLASS_INFO 0x00U + +//////////////////////////////////////////////////////////////////////////////// +// Audio +#define UHS_USB_CLASS_AUDIO 0x01U +// Subclasses +#define UHS_USB_SUBCLASS_AUDIOCONTROL 0x01U +#define UHS_USB_SUBCLASS_AUDIOSTREAMING 0x02U +#define UHS_USB_SUBCLASS_MIDISTREAMING 0x03U + +//////////////////////////////////////////////////////////////////////////////// +// Communications and CDC Control +#define UHS_USB_CLASS_COM_AND_CDC_CTRL 0x02U + +//////////////////////////////////////////////////////////////////////////////// +// HID +#define UHS_USB_CLASS_HID 0x03U +// Subclasses +#define UHS_HID_BOOT_SUBCLASS 0x01U +// Protocols +#define UHS_HID_PROTOCOL_HIDBOOT_KEYBOARD 0x01U +#define UHS_HID_PROTOCOL_HIDBOOT_MOUSE 0x02U +//////////////////////////////////////////////////////////////////////////////// +// Physical +#define UHS_USB_CLASS_PHYSICAL 0x05U + +//////////////////////////////////////////////////////////////////////////////// +// Image +#define UHS_USB_CLASS_IMAGE 0x06U + +//////////////////////////////////////////////////////////////////////////////// +// Printer +#define UHS_USB_CLASS_PRINTER 0x07U + +//////////////////////////////////////////////////////////////////////////////// +// Mass Storage +#define UHS_USB_CLASS_MASS_STORAGE 0x08 +// Subclasses +#define UHS_BULK_SUBCLASS_SCSI_NOT_REPORTED 0x00U // De facto use +#define UHS_BULK_SUBCLASS_RBC 0x01U +#define UHS_BULK_SUBCLASS_ATAPI 0x02U // MMC-5 (ATAPI) +#define UHS_BULK_SUBCLASS_OBSOLETE1 0x03U // Was QIC-157 +#define UHS_BULK_SUBCLASS_UFI 0x04U // Specifies how to interface Floppy Disk Drives to USB +#define UHS_BULK_SUBCLASS_OBSOLETE2 0x05U // Was SFF-8070i +#define UHS_BULK_SUBCLASS_SCSI 0x06U // SCSI Transparent Command Set +#define UHS_BULK_SUBCLASS_LSDFS 0x07U // Specifies how host has to negotiate access before trying SCSI +#define UHS_BULK_SUBCLASS_IEEE1667 0x08U +// Protocols +#define UHS_STOR_PROTO_CBI 0x00U // CBI (with command completion interrupt) +#define UHS_STOR_PROTO_CBI_NO_INT 0x01U // CBI (without command completion interrupt) +#define UHS_STOR_PROTO_OBSOLETE 0x02U +#define UHS_STOR_PROTO_BBB 0x50U // Bulk Only Transport +#define UHS_STOR_PROTO_UAS 0x62U + +//////////////////////////////////////////////////////////////////////////////// +// Hub +#define UHS_USB_CLASS_HUB 0x09U + +//////////////////////////////////////////////////////////////////////////////// +// CDC-Data +#define UHS_USB_CLASS_CDC_DATA 0x0AU + +//////////////////////////////////////////////////////////////////////////////// +// Smart-Card +#define UHS_USB_CLASS_SMART_CARD 0x0BU + +//////////////////////////////////////////////////////////////////////////////// +// Content Security +#define UHS_USB_CLASS_CONTENT_SECURITY 0x0DU + +//////////////////////////////////////////////////////////////////////////////// +// Video +#define UHS_USB_CLASS_VIDEO 0x0EU + +//////////////////////////////////////////////////////////////////////////////// +// Personal Healthcare +#define UHS_USB_CLASS_PERSONAL_HEALTH 0x0FU + +//////////////////////////////////////////////////////////////////////////////// +// Diagnostic Device +#define UHS_USB_CLASS_DIAGNOSTIC_DEVICE 0xDCU + +//////////////////////////////////////////////////////////////////////////////// +// Wireless Controller +#define UHS_USB_CLASS_WIRELESS_CTRL 0xE0U + +//////////////////////////////////////////////////////////////////////////////// +// Miscellaneous +#define UHS_USB_CLASS_MISC 0xEFU + +//////////////////////////////////////////////////////////////////////////////// +// Application Specific +#define UHS_USB_CLASS_APP_SPECIFIC 0xFEU + +//////////////////////////////////////////////////////////////////////////////// +// Vendor Specific +#define UHS_USB_CLASS_VENDOR_SPECIFIC 0xFFU + +//////////////////////////////////////////////////////////////////////////////// + + +/* USB state machine states */ +#define UHS_USB_HOST_STATE_MASK 0xF0U + +// Configure states, MSN == 0 --------------------------V +#define UHS_USB_HOST_STATE_DETACHED 0x00U +#define UHS_USB_HOST_STATE_DEBOUNCE 0x01U +#define UHS_USB_HOST_STATE_DEBOUNCE_NOT_COMPLETE 0x02U +#define UHS_USB_HOST_STATE_RESET_NOT_COMPLETE 0x03U +#define UHS_USB_HOST_STATE_WAIT_SOF 0x04U +#define UHS_USB_HOST_STATE_WAIT_BUS_READY 0x05U +#define UHS_USB_HOST_STATE_RESET_DEVICE 0x0AU +#define UHS_USB_HOST_STATE_CONFIGURING 0x0CU // Looks like "CO"nfig (backwards) +#define UHS_USB_HOST_STATE_CONFIGURING_DONE 0x0DU // Looks like "DO"one (backwards) +#define UHS_USB_HOST_STATE_CHECK 0x0EU +#define UHS_USB_HOST_STATE_ILLEGAL 0x0FU // Foo + +// Run states, MSN != 0 --------------------------------V +#define UHS_USB_HOST_STATE_RUNNING 0x60U // Looks like "GO" +#define UHS_USB_HOST_STATE_IDLE 0x1DU // Looks like "ID"le +#define UHS_USB_HOST_STATE_ERROR 0xF0U // Looks like "FO"o +#define UHS_USB_HOST_STATE_INITIALIZE 0x10U // Looks like "I"nit + +// Host SE result codes. +// Common SE results are stored in the low nybble, all interface drivers understand these plus 0x1f. +// Extended SE results are 0x10-0x1e. SE code only understands these internal to the hardware. +// Values > 0x1F are driver or other internal error conditions. +// Return these result codes from your host controller driver to match the error condition +// ALL Non-zero values are errors. +// Values not listed in this table are not handled in the base class, or any host driver. + +#define UHS_HOST_ERROR_NONE 0x00U // No error +#define UHS_HOST_ERROR_BUSY 0x01U // transfer pending +#define UHS_HOST_ERROR_BADREQ 0x02U // Transfer Launch Request was bad +#define UHS_HOST_ERROR_DMA 0x03U // DMA was too short, or too long +#define UHS_HOST_ERROR_NAK 0x04U // Peripheral returned NAK +#define UHS_HOST_ERROR_STALL 0x05U // Peripheral returned STALL +#define UHS_HOST_ERROR_TOGERR 0x06U // Toggle error/ISO over-underrun +#define UHS_HOST_ERROR_WRONGPID 0x07U // Received wrong Packet ID +#define UHS_HOST_ERROR_BADBC 0x08U // Byte count is bad +#define UHS_HOST_ERROR_PIDERR 0x09U // Received Packet ID is corrupted +#define UHS_HOST_ERROR_BADRQ 0x0AU // Packet error. Increase max packet. +#define UHS_HOST_ERROR_CRC 0x0BU // USB CRC was incorrect +#define UHS_HOST_ERROR_KERR 0x0CU // K-state instead of response, usually indicates wrong speed +#define UHS_HOST_ERROR_JERR 0x0DU // J-state instead of response, usually indicates wrong speed +#define UHS_HOST_ERROR_TIMEOUT 0x0EU // Device did not respond in time +#define UHS_HOST_ERROR_BABBLE 0x0FU // Line noise/unexpected data +#define UHS_HOST_ERROR_MEM_LAT 0x10U // Error caused by memory latency. +#define UHS_HOST_ERROR_NYET 0x11U // OUT transfer accepted with NYET + +// Addressing error codes +#define ADDR_ERROR_INVALID_INDEX 0xA0U +#define ADDR_ERROR_INVALID_ADDRESS 0xA1U + +// Common Interface Driver error codes +#define UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED 0xD1U // Driver doesn't support the device or interfaces +#define UHS_HOST_ERROR_DEVICE_INIT_INCOMPLETE 0xD2U // Init partially finished, but died. +#define UHS_HOST_ERROR_CANT_REGISTER_DEVICE_CLASS 0xD3U // There was no driver for the interface requested. +#define UHS_HOST_ERROR_ADDRESS_POOL_FULL 0xD4U // No addresses left in the address pool. +#define UHS_HOST_ERROR_HUB_ADDRESS_OVERFLOW 0xD5U // No hub addresses left. The maximum is 7. +#define UHS_HOST_ERROR_NO_ADDRESS_IN_POOL 0xD6U // Address was not allocated in the pool, thus not found. +#define UHS_HOST_ERROR_NULL_EPINFO 0xD7U // The supplied endpoint was NULL, indicates a bug or other problem. +#define UHS_HOST_ERROR_BAD_ARGUMENT 0xD8U // Indicates a range violation bug. +#define UHS_HOST_ERROR_DEVICE_DRIVER_BUSY 0xD9U // The interface driver is busy or out buffer is full, try again later. +#define UHS_HOST_ERROR_BAD_MAX_PACKET_SIZE 0xDAU // The maximum packet size was exceeded. Try again with smaller size. +#define UHS_HOST_ERROR_NO_ENDPOINT_IN_TABLE 0xDBU // The endpoint could not be found in the endpoint table. +#define UHS_HOST_ERROR_UNPLUGGED 0xDEU // Someone removed the USB device, or Vbus was turned off. +#define UHS_HOST_ERROR_NOMEM 0xDFU // Out Of Memory. + +// Control request stream errors +#define UHS_HOST_ERROR_FailGetDevDescr 0xE1U +#define UHS_HOST_ERROR_FailSetDevTblEntry 0xE2U +#define UHS_HOST_ERROR_FailGetConfDescr 0xE3U +#define UHS_HOST_ERROR_END_OF_STREAM 0xEFU + +// Host base class specific Error codes +#define UHS_HOST_ERROR_NOT_IMPLEMENTED 0xFEU +#define UHS_HOST_ERROR_TRANSFER_TIMEOUT 0xFFU + +// SEI interaction defaults +#define UHS_HOST_TRANSFER_MAX_MS 10000 // USB transfer timeout in ms, per section 9.2.6.1 of USB 2.0 spec +#define UHS_HOST_TRANSFER_RETRY_MAXIMUM 3 // 3 retry limit for a transfer +#define UHS_HOST_DEBOUNCE_DELAY_MS 500 // settle delay in milliseconds +#define UHS_HUB_RESET_DELAY_MS 20 // hub port reset delay, 10ms recomended, but can be up to 20ms + +// +// We only provide the minimum needed information for enumeration. +// Interface drivers should be able to set up what is needed with nothing more. +// A driver needs to know the following information: +// 1: address on the USB network, parent and port (aka UsbDeviceAddress) +// 2: endpoints +// 3: vid:pid, class, subclass, protocol +// + +struct ENDPOINT_INFO { + uint8_t bEndpointAddress; // Endpoint address. Bit 7 indicates direction (0=OUT, 1=IN). + uint8_t bmAttributes; // Endpoint transfer type. + uint16_t wMaxPacketSize; // Maximum packet size. + uint8_t bInterval; // Polling interval in frames. +} __attribute__((packed)); + +struct INTERFACE_INFO { + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t numep; + uint8_t klass; + uint8_t subklass; + uint8_t protocol; + ENDPOINT_INFO epInfo[16]; +} __attribute__((packed)); + +struct ENUMERATION_INFO { + uint16_t vid; + uint16_t pid; + uint16_t bcdDevice; + uint8_t klass; + uint8_t subklass; + uint8_t protocol; + uint8_t bMaxPacketSize0; + uint8_t currentconfig; + uint8_t parent; + uint8_t port; + uint8_t address; + INTERFACE_INFO interface; +} __attribute__((packed)); + +/* USB Setup Packet Structure */ +typedef struct { + // offset description + // 0 Bit-map of request type + union { + uint8_t bmRequestType; + + struct { + uint8_t recipient : 5; // Recipient of the request + uint8_t type : 2; // Type of request + uint8_t direction : 1; // Direction of data transfer + } __attribute__((packed)); + } ReqType_u; + + // 1 Request + uint8_t bRequest; + + // 2 Depends on bRequest + union { + uint16_t wValue; + + struct { + uint8_t wValueLo; + uint8_t wValueHi; + } __attribute__((packed)); + } wVal_u; + // 4 Depends on bRequest + uint16_t wIndex; + // 6 Depends on bRequest + uint16_t wLength; + // 8 bytes total +} __attribute__((packed)) SETUP_PKT, *PSETUP_PKT; + + +// little endian :-) 8 8 8 8 16 16 +#define mkSETUP_PKT8(bmReqType, bRequest, wValLo, wValHi, wInd, total) ((uint64_t)(((uint64_t)(bmReqType)))|(((uint64_t)(bRequest))<<8)|(((uint64_t)(wValLo))<<16)|(((uint64_t)(wValHi))<<24)|(((uint64_t)(wInd))<<32)|(((uint64_t)(total)<<48))) +#define mkSETUP_PKT16(bmReqType, bRequest, wVal, wInd, total) ((uint64_t)(((uint64_t)(bmReqType)))|(((uint64_t)(bRequest))<<8)|(((uint64_t)(wVal ))<<16) |(((uint64_t)(wInd))<<32)|(((uint64_t)(total)<<48))) + +// Big endian -- but we aren't able to use this :-/ +//#define mkSETUP_PKT8(bmReqType, bRequest, wValLo, wValHi, wInd, total) ((uint64_t)(((uint64_t)(bmReqType))<<56)|(((uint64_t)(bRequest))<<48)|(((uint64_t)(wValLo))<<40)|(((uint64_t)(wValHi))<<32)|(((uint64_t)(wInd))<<16)|((uint64_t)(total))) +//#define mkSETUP_PKT16(bmReqType, bRequest, wVal, wInd, total) ((uint64_t)(((uint64_t)(bmReqType))<<56)|(((uint64_t)(bRequest))<<48) |(((uint64_t)(wVal))<<32) |(((uint64_t)(wInd))<<16)|((uint64_t)(total))) + +#endif /* USBCORE_H */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h new file mode 100644 index 000000000000..1c8b79191037 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h @@ -0,0 +1,248 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#if !defined(_UHS_host_h_) || defined(__ADDRESS_H__) +#error "Never include UHS_address.h directly; include UHS_Usb.h instead" +#else +#define __ADDRESS_H__ + + + +/* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */ +/* bmNakPower as a power of 2. The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) */ +#define UHS_USB_NAK_MAX_POWER 14 // NAK binary order maximum value +#define UHS_USB_NAK_DEFAULT 13 // default 16K-1 NAKs before giving up +#define UHS_USB_NAK_NOWAIT 1 // Single NAK stops transfer +#define UHS_USB_NAK_NONAK 0 // Do not count NAKs, stop retrying after USB Timeout. Try not to use this. + +#define bmUSB_DEV_ADDR_PORT 0x07 +#define bmUSB_DEV_ADDR_PARENT 0x78 +#define bmUSB_DEV_ADDR_HUB 0x40 + +// TODO: embed parent? +struct UHS_EpInfo { + uint8_t epAddr; // Endpoint address + uint8_t bIface; + uint16_t maxPktSize; // Maximum packet size + + union { + uint8_t epAttribs; + + struct { + uint8_t bmSndToggle : 1; // Send toggle, when zero bmSNDTOG0, bmSNDTOG1 otherwise + uint8_t bmRcvToggle : 1; // Send toggle, when zero bmRCVTOG0, bmRCVTOG1 otherwise + uint8_t bmNeedPing : 1; // 1 == ping protocol needed for next out packet + uint8_t bmNakPower : 5; // Binary order for NAK_LIMIT value + } __attribute__((packed)); + }; +} __attribute__((packed)); + +// TODO: embed parent address and port into epinfo struct, +// and nuke this address stupidity. +// This is a compact scheme. Should also support full spec. +// This produces a 7 hub limit, 49 devices + 7 hubs, 56 total. +// +// 7 6 5 4 3 2 1 0 +// --------------------------------- +// | | H | P | P | P | A | A | A | +// --------------------------------- +// +// H - if 1 the address is a hub address +// P - parent hub number +// A - port number of parent +// + +struct UHS_DeviceAddress { + + union { + + struct { + uint8_t bmAddress : 3; // port number + uint8_t bmParent : 3; // parent hub address + uint8_t bmHub : 1; // hub flag + uint8_t bmReserved : 1; // reserved, must be zero + } __attribute__((packed)); + uint8_t devAddress; + }; +} __attribute__((packed)); + +struct UHS_Device { + volatile UHS_EpInfo *epinfo[UHS_HOST_MAX_INTERFACE_DRIVERS]; // endpoint info pointer + UHS_DeviceAddress address; + uint8_t epcount; // number of endpoints + uint8_t speed; // indicates device speed +} __attribute__((packed)); + +typedef void (*UsbDeviceHandleFunc)(UHS_Device *pdev); + +class AddressPool { + UHS_EpInfo dev0ep; //Endpoint data structure used during enumeration for uninitialized device + + // In order to avoid hub address duplication, this should use bits + uint8_t hubCounter; // hub counter + + UHS_Device thePool[UHS_HOST_MAX_INTERFACE_DRIVERS]; + + // Initializes address pool entry + + void UHS_NI InitEntry(uint8_t index) { + thePool[index].address.devAddress = 0; + thePool[index].epcount = 1; + thePool[index].speed = 0; + for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { + thePool[index].epinfo[i] = &dev0ep; + } + }; + + // Returns thePool index for a given address + + uint8_t UHS_NI FindAddressIndex(uint8_t address = 0) { + for(uint8_t i = 1; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { + if(thePool[i].address.devAddress == address) + return i; + } + return 0; + }; + + // Returns thePool child index for a given parent + + uint8_t UHS_NI FindChildIndex(UHS_DeviceAddress addr, uint8_t start = 1) { + for(uint8_t i = (start < 1 || start >= UHS_HOST_MAX_INTERFACE_DRIVERS) ? 1 : start; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { + if(thePool[i].address.bmParent == addr.bmAddress) + return i; + } + return 0; + }; + + // Frees address entry specified by index parameter + + void UHS_NI FreeAddressByIndex(uint8_t index) { + // Zero field is reserved and should not be affected + if(index == 0) + return; + + UHS_DeviceAddress uda = thePool[index].address; + // If a hub was switched off all port addresses should be freed + if(uda.bmHub == 1) { + for(uint8_t i = 1; (i = FindChildIndex(uda, i));) + FreeAddressByIndex(i); + + // FIXME: use BIT MASKS + // If the hub had the last allocated address, hubCounter should be decremented + if(hubCounter == uda.bmAddress) + hubCounter--; + } + InitEntry(index); + } + + void InitAllAddresses() { + for(uint8_t i = 1; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) InitEntry(i); + hubCounter = 0; + }; +public: + + AddressPool() { + hubCounter = 0; + // Zero address is reserved + InitEntry(0); + + thePool[0].epinfo[0] = &dev0ep; + dev0ep.epAddr = 0; +#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + dev0ep.maxPktSize = 0x40; //starting at 0x40 and work down +#else + dev0ep.maxPktSize = 0x08; +#endif + dev0ep.epAttribs = 0; //set DATA0/1 toggles to 0 + dev0ep.bmNakPower = UHS_USB_NAK_MAX_POWER; + InitAllAddresses(); + }; + + // Returns a pointer to a specified address entry + + UHS_Device* UHS_NI GetUsbDevicePtr(uint8_t addr) { + if(!addr) + return thePool; + + uint8_t index = FindAddressIndex(addr); + + return (!index) ? NULL : &thePool[index]; + }; + + + // Allocates new address + + uint8_t UHS_NI AllocAddress(uint8_t parent, bool is_hub = false, uint8_t port = 1) { + /* if (parent != 0 && port == 0) + USB_HOST_SERIAL.println("PRT:0"); */ + UHS_DeviceAddress _parent; + _parent.devAddress = parent; + if(_parent.bmReserved || port > 7) + //if(parent > 127 || port > 7) + return 0; + + // FIXME: use BIT MASKS + if(is_hub && hubCounter == 7) + return 0; + + // finds first empty address entry starting from one + uint8_t index = FindAddressIndex(0); + + if(!index) // if empty entry is not found + return 0; + + UHS_DeviceAddress addr; + addr.devAddress = port; + addr.bmParent = _parent.bmAddress; + + // FIXME: use BIT MASKS + if(is_hub) { + hubCounter++; + addr.bmHub = 1; + addr.bmAddress = hubCounter; + } + thePool[index].address = addr; +#if DEBUG_PRINTF_EXTRA_HUGE +#ifdef UHS_DEBUG_USB_ADDRESS + printf("Address: %x (%x.%x.%x)\r\n", addr.devAddress, addr.bmHub, addr.bmParent, addr.bmAddress); +#endif +#endif + return thePool[index].address.devAddress; + }; + + void UHS_NI FreeAddress(uint8_t addr) { + // if the root hub is disconnected all the addresses should be initialized + if(addr == 0x41) { + InitAllAddresses(); + return; + } + uint8_t index = FindAddressIndex(addr); + FreeAddressByIndex(index); + }; + +}; + +#endif // __ADDRESS_H__ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h new file mode 100644 index 000000000000..bc111f7b616e --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h @@ -0,0 +1,70 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ +#if !defined(_usb_h_) || defined(__HEXDUMP_H__) +#error "Never include UHS_hexdump.h directly; include UHS_Usb.h instead" +#else +#define __HEXDUMP_H__ + +extern int UsbDEBUGlvl; + +template +class HexDumper : public BASE_CLASS { + uint8_t byteCount; + OFFSET_TYPE byteTotal; + +public: + + HexDumper() : byteCount(0), byteTotal(0) { + }; + + void Initialize() { + byteCount = 0; + byteTotal = 0; + }; + + virtual void Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset); +}; + +template +void HexDumper::Parse(const LEN_TYPE len, const uint8_t *pbuf, const OFFSET_TYPE &offset) { + if(UsbDEBUGlvl >= 0x80) { // Fully bypass this block of code if we do not debug. + for(LEN_TYPE j = 0; j < len; j++, byteCount++, byteTotal++) { + if(!byteCount) { + PrintHex (byteTotal, 0x80); + E_Notify(PSTR(": "), 0x80); + } + PrintHex (pbuf[j], 0x80); + E_Notify(PSTR(" "), 0x80); + + if(byteCount == 15) { + E_Notify(PSTR("\r\n"), 0x80); + byteCount = 0xFF; + } + } + } +} + +#endif // __HEXDUMP_H__ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h new file mode 100644 index 000000000000..7f7d18116c9a --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h @@ -0,0 +1,111 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ +/* USB functions */ +#ifndef _UHS_host_h_ +#define _UHS_host_h_ + +// WARNING: Do not change the order of includes, or stuff will break! +#include +#include +#include +#include + +#if DISABLED(USE_UHS3_USB) +#include +#include +#include +#include +#endif +#include "UHS_macros.h" + +// None of these should ever be directly included by a driver, or a user's sketch. +#include "../dyn_SWI/dyn_SWI.h" +#include "UHS_USB_IDs.h" +#include "UHS_settings.h" +#include "UHS_usb_ch9.h" +#include "UHS_UsbCore.h" +#include "UHS_address.h" +#include "UHS_usbhost.h" +#include "UHS_printhex.h" +#include "UHS_message.h" + +// Load system components as required +#if defined(LOAD_USB_HOST_SYSTEM) && !defined(USB_HOST_SYSTEM_LOADED) +#include "UHS_util_INLINE.h" +#include "UHS_host_INLINE.h" +#include "UHS_printf_HELPER.h" + +#ifdef LOAD_USB_HOST_SHIELD +#include "USB_HOST_SHIELD/USB_HOST_SHIELD.h" +#endif + +#if defined(LOAD_UHS_KINETIS_FS_HOST) && !defined(UHS_KINETIS_FS_HOST_LOADED) +#include "UHS_KINETIS_FS_HOST/UHS_KINETIS_FS_HOST.h" +#endif + +#if defined(LOAD_UHS_KINETIS_EHCI) && !defined(UHS_KINETIS_EHCI_LOADED) +#include "UHS_KINETIS_EHCI/UHS_KINETIS_EHCI.h" +#endif + +// Load USB drivers and multiplexers + +#ifdef LOAD_UHS_HUB +#include "UHS_HUB/UHS_HUB.h" +#endif // HUB loaded + +#ifdef LOAD_UHS_BULK_STORAGE +#include "UHS_BULK_STORAGE/UHS_BULK_STORAGE.h" +#endif + +#ifdef LOAD_GENERIC_STORAGE +#include "../UHS_FS/UHS_FS.h" +#endif +// Add BT and optionally HID if directed to do so +#ifdef LOAD_UHS_BT +#include "UHS_BT/UHS_BT.h" +#endif // BT and optionally HID loaded + +// Add HID +#ifdef LOAD_UHS_HID +#include "UHS_HID/UHS_HID.h" +#endif // HID loaded + +// Add CDC multiplexers (currently only ACM) +#if defined(LOAD_UHS_CDC_ACM) || defined(LOAD_UHS_CDC_ACM_FTDI) || defined(LOAD_UHS_CDC_ACM_PROLIFIC) || defined(LOAD_UHS_CDC_ACM_XR21B1411) +#include "UHS_CDC/UHS_CDC.h" +#endif // CDC loaded + +#ifdef LOAD_UHS_ADK +#include "UHS_ADK/UHS_ADK.h" +#endif + +#ifdef LOAD_UHS_MIDI +#include "UHS_MIDI/UHS_MIDI.h" +#endif + +#endif // System code loaded + +#endif // _UHS_host_h_ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h new file mode 100644 index 000000000000..908391a157f1 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h @@ -0,0 +1,1224 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#if defined(LOAD_USB_HOST_SYSTEM) && !defined(USB_HOST_SYSTEM_LOADED) +#define USB_HOST_SYSTEM_LOADED + +#ifndef DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST +#define DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST 0 +#endif + +#if DEBUG_PRINTF_EXTRA_HUGE +#if DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST +#define HOST_DEBUG(...) printf(__VA_ARGS__) +#else +#define HOST_DEBUG(...) VOID0 +#endif +#else +#define HOST_DEBUG(...) VOID0 +#endif + +UHS_EpInfo* UHS_USB_HOST_BASE::getEpInfoEntry(uint8_t addr, uint8_t ep) { + UHS_Device *p = addrPool.GetUsbDevicePtr(addr); + + if(!p || !p->epinfo) + return NULL; + + + UHS_EpInfo *pep; + for(uint8_t j = 0; j < UHS_HOST_MAX_INTERFACE_DRIVERS; j++) { + pep = (UHS_EpInfo *)(p->epinfo[j]); + + for(uint8_t i = 0; i < p->epcount; i++) { + if((pep)->epAddr == ep) { + HOST_DEBUG("ep entry for interface %d ep %d max packet size = %d\r\n", pep->bIface, ep, pep->maxPktSize); + return pep; + } + + pep++; + } + } + return NULL; +} + +/** + * Sets a device table entry for a device. + * Each device is different and has different number of endpoints. + * This function plugs endpoint record structure, defined in application, to devtable + * + * @param addr device address + * @param epcount how many endpoints + * @param eprecord pointer to the endpoint structure + * @return Zero for success, or error code + */ +uint8_t UHS_USB_HOST_BASE::setEpInfoEntry(uint8_t addr, uint8_t iface, uint8_t epcount, volatile UHS_EpInfo* eprecord) { + if(!eprecord) + return UHS_HOST_ERROR_BAD_ARGUMENT; + + UHS_Device *p = addrPool.GetUsbDevicePtr(addr); + + if(!p) + return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; + + p->address.devAddress = addr; + p->epinfo[iface] = eprecord; + p->epcount = epcount; + return 0; +} + +/** + * sets all enpoint addresses to zero. + * Sets all max packet sizes to defaults + * Clears all endpoint attributes + * Sets bmNakPower to USB_NAK_DEFAULT + * Sets binterface to zero. + * Sets bNumEP to zero. + * Sets bAddress to zero. + * Clears qNextPollTime and sets bPollEnable to false. + * + * @param maxep How many endpoints to initialize + * @param device pointer to the device driver instance (this) + * + */ + +void UHS_USB_HOST_BASE::DeviceDefaults(uint8_t maxep, UHS_USBInterface *interface) { + + for(uint8_t i = 0; i < maxep; i++) { + interface->epInfo[i].epAddr = 0; + interface->epInfo[i].maxPktSize = (i) ? 0 : 8; + interface->epInfo[i].epAttribs = 0; + interface->epInfo[i].bmNakPower = UHS_USB_NAK_DEFAULT; + } + interface->pUsb->GetAddressPool()->FreeAddress(interface->bAddress); + interface->bIface = 0; + interface->bNumEP = 1; + interface->bAddress = 0; + interface->qNextPollTime = 0; + interface->bPollEnable = false; +} + +/** + * Perform a bus reset to the port of the connected device + * + * @param parent index to Parent + * @param port what port on the parent + * @param address address of the device + * @return Zero for success, or error code + */ + +uint8_t UHS_USB_HOST_BASE::doSoftReset(uint8_t parent, uint8_t port, uint8_t address) { + uint8_t rcode = 0; + + if(parent == 0) { + // Send a bus reset on the root interface. + doHostReset(); + } else { + // reset parent port + devConfig[parent]->ResetHubPort(port); + } + + // + // Many devices require a delay before setting the address here... + // We loop upon fails for up to 2 seconds instead. + // Most devices will be happy without a retry. + // + uint8_t retries = 0; + if(address) { + do { + rcode = setAddr(0, address); + if(!rcode) break; + retries++; + sof_delay(10); + } while(retries < 200); + HOST_DEBUG("%i retries.\r\n", retries); + } else { +#if DEBUG_PRINTF_EXTRA_HUGE + printf("\r\ndoSoftReset called with address == 0.\r\n"); +#endif + } + return rcode; +} + +/* + * Pseudo code so you may understand the code flow. + * + * reset; (happens at the lower level) + * GetDevDescr(); + * reset; + * If there are no configuration descriptors { + * // + * // Note: I know of no device that does this. + * // I suppose there could be one though. + * // + * try to enumerate. + * } else { + * last success count = 0 + * best config = 0 + * for each configuration descriptor { + * for each interface descriptor { + * get the endpoint descriptors for this interface. + * Check to see if a driver can handle this interface. + * If it can, add 1 to the success count. + * } + * if success count > last success count { + * best config = current config + * last success count = success count + * } + * } + * set the device config to the best config + * for each best config interface descriptor { + * initialize driver that can handle this interface config + * } + * } + * + * NOTES: + * 1: We do not need to save toggle states anymore and have not + * needed to for some time, because the lower level driver + * actually corrects wrong toggles on-the-fly for us. + * + * 2: We always do a second reset, since this stupid bug is + * actually part of the specification documents that I + * have found all over the net. Even Linux does it, and + * many devices actually EXPECT this behavior. Some devices + * will not enumerate without it. For devices that do not + * need it, the additional reset is harmless. Here is an + * example of one of these documents, see page Five: + * http://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_113_Simplified%20Description%20of%20USB%20Device%20Enumeration.pdf + * + * + */ + +/** + * Enumerates interfaces on devices + * + * @param parent index to Parent + * @param port what port on the parent + * @param speed the speed of the device + * @return Zero for success, or error code + */ +uint8_t UHS_USB_HOST_BASE::Configuring(uint8_t parent, uint8_t port, uint8_t speed) { + //uint8_t bAddress = 0; + HOST_DEBUG("\r\n\r\n\r\nConfiguring: parent = %i, port = %i, speed = %i\r\n", parent, port, speed); + uint8_t rcode = 0; + uint8_t retries = 0; + uint8_t numinf = 0; + uint8_t configs; + UHS_Device *p = NULL; + //EpInfo epInfo; // cap at 16, this should be fairly reasonable. + ENUMERATION_INFO ei; + uint8_t bestconf = 0; + uint8_t bestsuccess = 0; + + uint8_t devConfigIndex; + +#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + const uint8_t biggest = 0x40; + // wrap in {} to throw away the 64 byte buffer when we are done with it + { + uint8_t buf[biggest]; + USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast(buf); +#else + const uint8_t biggest = 18; + uint8_t buf[biggest]; + USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast(buf); + USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); +#endif + + //for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { + // if((devConfig[devConfigIndex]->bAddress) && (!devConfig[devConfigIndex]->bPollEnable)) { + // devConfig[devConfigIndex]->bAddress = 0; + // } + //} + // Serial.print("HOST USB Host @ 0x"); + // Serial.println((uint32_t)this, HEX); + // Serial.print("HOST USB Host Address Pool @ 0x"); + // Serial.println((uint32_t)GetAddressPool(), HEX); + + sof_delay(200); + p = addrPool.GetUsbDevicePtr(0); + if(!p) { + HOST_DEBUG("Configuring error: USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL\r\n"); + return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; + } + + p->speed = speed; +#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + + p->epinfo[0][0].maxPktSize = 0x40; // Windows bug is expected. + // poison data + // udd->bMaxPacketSize0 = 0U; +#else + p->epinfo[0][0].maxPktSize = 0x08; // USB Spec, start small, work your way up. +#endif +again: + memset((void *)buf, 0, biggest); + HOST_DEBUG("\r\n\r\nConfiguring PktSize 0x%2.2x, rcode: 0x%2.2x, retries %i,\r\n", p->epinfo[0][0].maxPktSize, rcode, retries); + rcode = getDevDescr(0, biggest, (uint8_t*)buf); +#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + if(rcode || udd->bMaxPacketSize0 < 8) +#else + if(rcode) +#endif + { + if(rcode == UHS_HOST_ERROR_JERR && retries < 4) { + // + // Some devices return JERR when plugged in. + // Attempts to reinitialize the device usually works. + // + // I have a hub that will refuse to work and acts like + // this unless external power is supplied. + // So this may not always work, and you may be fooled. + // + sof_delay(100); + retries++; + goto again; +#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + } else if(((rcode == UHS_HOST_ERROR_DMA || rcode == UHS_HOST_ERROR_MEM_LAT) && retries < 4) || (udd->bMaxPacketSize0 < 8 && !rcode)) { + + if(p->epinfo[0][0].maxPktSize > 8 && rcode == UHS_HOST_ERROR_DMA) p->epinfo[0][0].maxPktSize = p->epinfo[0][0].maxPktSize >> 1; +#else + } else if((rcode == UHS_HOST_ERROR_DMA || rcode == UHS_HOST_ERROR_MEM_LAT) && retries < 4) { + if(p->epinfo[0][0].maxPktSize < 32) p->epinfo[0][0].maxPktSize = p->epinfo[0][0].maxPktSize << 1; +#endif + HOST_DEBUG("Configuring error: 0x%2.2x UHS_HOST_ERROR_DMA. Retry with maxPktSize: %i\r\n", rcode, p->epinfo[0][0].maxPktSize); + doSoftReset(parent, port, 0); + retries++; + sof_delay(200); + goto again; + } + HOST_DEBUG("Configuring error: 0x%2.2x Can't get USB_DEVICE_DESCRIPTOR\r\n", rcode); + return rcode; + } + + +#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + ei.address = addrPool.AllocAddress(parent, false, port); + + if(!ei.address) { + return UHS_HOST_ERROR_ADDRESS_POOL_FULL; + } + + p = addrPool.GetUsbDevicePtr(ei.address); + // set to 1 if you suspect address table corruption. +#if 0 + if(!p) { + return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; + } +#endif + + p->speed = speed; + + rcode = doSoftReset(parent, port, ei.address); + + if(rcode) { + addrPool.FreeAddress(ei.address); + HOST_DEBUG("Configuring error: %2.2x Can't set USB INTERFACE ADDRESS\r\n", rcode); + return rcode; + } + + { // the { } wrapper saves on stack. + HOST_DEBUG("DevDescr 2nd poll, bMaxPacketSize0:%u\r\n", udd->bMaxPacketSize0); + UHS_EpInfo dev1ep; + dev1ep.maxPktSize = udd->bMaxPacketSize0; + dev1ep.epAddr = 0; + dev1ep.epAttribs = 0; + dev1ep.bmNakPower = UHS_USB_NAK_MAX_POWER; + p->address.devAddress = ei.address; + p->epcount = 1; + p->epinfo[0] = &dev1ep; + + sof_delay(10); + memset((void *)buf, 0, biggest); + rcode = getDevDescr(ei.address, 18, (uint8_t*)buf); + if(rcode) HOST_DEBUG("getDevDescr err: 0x%x \r\n", rcode); + + addrPool.FreeAddress(ei.address); + if(rcode && rcode != UHS_HOST_ERROR_DMA) { + return rcode; + } + sof_delay(10); + } +#endif + + ei.vid = udd->idVendor; + ei.pid = udd->idProduct; + ei.bcdDevice = udd->bcdDevice; + ei.klass = udd->bDeviceClass; + ei.subklass = udd->bDeviceSubClass; + ei.protocol = udd->bDeviceProtocol; + ei.bMaxPacketSize0 = udd->bMaxPacketSize0; + ei.currentconfig = 0; + ei.parent = parent; + ei.port = port; + configs = udd->bNumConfigurations; +#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + } // unwrapped, old large buf now invalid and discarded. + + uint8_t buf[18]; + USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast(buf); +#endif + + ei.address = addrPool.AllocAddress(parent, IsHub(ei.klass), port); + + if(!ei.address) { + return UHS_HOST_ERROR_ADDRESS_POOL_FULL; + } + + p = addrPool.GetUsbDevicePtr(ei.address); + // set to 1 if you suspect address table corruption. +#if 0 + if(!p) { + return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; + } +#endif + + p->speed = speed; + + rcode = doSoftReset(parent, port, ei.address); + + if(rcode) { + addrPool.FreeAddress(ei.address); + HOST_DEBUG("Configuring error: %2.2x Can't set USB INTERFACE ADDRESS\r\n", rcode); + return rcode; + } + + if(configs < 1) { + HOST_DEBUG("No interfaces?!\r\n"); + addrPool.FreeAddress(ei.address); + // rcode = TestInterface(&ei); + // Not implemented (yet) + rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED; + } else { + HOST_DEBUG("configs: %i\r\n", configs); + for(uint8_t conf = 0; (!rcode) && (conf < configs); conf++) { + // read the config descriptor into a buffer. + rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), conf, buf); + if(rcode) { + HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode); + rcode = UHS_HOST_ERROR_FailGetConfDescr; + continue; + } + ei.currentconfig = conf; + numinf = ucd->bNumInterfaces; // Does _not_ include alternates! + HOST_DEBUG("CONFIGURATION: %i, bNumInterfaces %i, wTotalLength %i\r\n", conf, numinf, ucd->wTotalLength); + uint8_t success = 0; + uint16_t inf = 0; + uint8_t data[ei.bMaxPacketSize0]; + UHS_EpInfo *pep; + pep = ctrlReqOpen(ei.address, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, ei.currentconfig, USB_DESCRIPTOR_CONFIGURATION, 0x0000U, ucd->wTotalLength), data); + if(!pep) { + rcode = UHS_HOST_ERROR_NULL_EPINFO; + continue; + } + uint16_t left; + uint16_t read; + uint8_t offset; + rcode = initDescrStream(&ei, ucd, pep, data, &left, &read, &offset); + if(rcode) { + HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); + break; + } + for(; (numinf) && (!rcode); inf++) { + // iterate for each interface on this config + rcode = getNextInterface(&ei, pep, data, &left, &read, &offset); + if(rcode == UHS_HOST_ERROR_END_OF_STREAM) { + HOST_DEBUG("USB_INTERFACE END OF STREAM\r\n"); + ctrlReqClose(pep, UHS_bmREQ_GET_DESCR, left, ei.bMaxPacketSize0, data); + rcode = 0; + break; + } + if(rcode) { + HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); + continue; + } + rcode = TestInterface(&ei); + if(!rcode) success++; + rcode = 0; + } + if(!inf) { + rcode = TestInterface(&ei); + if(!rcode) success++; + rcode = 0; + } + if(success > bestsuccess) { + bestconf = conf; + bestsuccess = success; + } + } + if(!bestsuccess) rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED; + } + if(!rcode) { + rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), bestconf, buf); + if(rcode) { + HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode); + rcode = UHS_HOST_ERROR_FailGetConfDescr; + } + } + if(!rcode) { + bestconf++; + ei.currentconfig = bestconf; + numinf = ucd->bNumInterfaces; // Does _not_ include alternates! + HOST_DEBUG("CONFIGURATION: %i, bNumInterfaces %i, wTotalLength %i\r\n", bestconf, numinf, ucd->wTotalLength); + if(!rcode) { + HOST_DEBUG("Best configuration is %i, enumerating interfaces.\r\n", bestconf); + uint16_t inf = 0; + uint8_t data[ei.bMaxPacketSize0]; + UHS_EpInfo *pep; + pep = ctrlReqOpen(ei.address, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, ei.currentconfig - 1, USB_DESCRIPTOR_CONFIGURATION, 0x0000U, ucd->wTotalLength), data); + if(!pep) { + rcode = UHS_HOST_ERROR_NULL_EPINFO; + + } else { + uint16_t left; + uint16_t read; + uint8_t offset; + rcode = initDescrStream(&ei, ucd, pep, data, &left, &read, &offset); + if(rcode) { + HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); + } else { + for(; (numinf) && (!rcode); inf++) { + // iterate for each interface on this config + rcode = getNextInterface(&ei, pep, data, &left, &read, &offset); + if(rcode == UHS_HOST_ERROR_END_OF_STREAM) { + ctrlReqClose(pep, UHS_bmREQ_GET_DESCR, left, ei.bMaxPacketSize0, data); + rcode = 0; + break; + } + if(rcode) { + HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode); + continue; + } + + if(enumerateInterface(&ei) == UHS_HOST_MAX_INTERFACE_DRIVERS) { + HOST_DEBUG("No interface driver for this interface."); + } else { + HOST_DEBUG("Interface Configured\r\n"); + } + } + } + } + } else { + HOST_DEBUG("Configuring error: %2.2x Can't set USB_INTERFACE_CONFIG stream.\r\n", rcode); + } + } + + if(!rcode) { + rcode = setConf(ei.address, bestconf); + if(rcode) { + HOST_DEBUG("Configuring error: %2.2x Can't set Configuration.\r\n", rcode); + addrPool.FreeAddress(ei.address); + } else { + for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { + HOST_DEBUG("Driver %i ", devConfigIndex); + if(!devConfig[devConfigIndex]) { + HOST_DEBUG("no driver at this index.\r\n"); + continue; // no driver + } + HOST_DEBUG("@ %2.2x ", devConfig[devConfigIndex]->bAddress); + if(devConfig[devConfigIndex]->bAddress) { + if(!devConfig[devConfigIndex]->bPollEnable) { + HOST_DEBUG("Initialize\r\n"); + rcode = devConfig[devConfigIndex]->Finalize(); + rcode = devConfig[devConfigIndex]->Start(); + if(!rcode) { + HOST_DEBUG("Total endpoints = (%i)%i\r\n", p->epcount, devConfig[devConfigIndex]->bNumEP); + } else { + break; + } + } else { + HOST_DEBUG("Already initialized.\r\n"); + continue; // consumed + } + } else { + HOST_DEBUG("Skipped\r\n"); + } + } +#if 0 // defined(UHS_HID_LOADED) + // Now do HID +#endif + } + } else { + addrPool.FreeAddress(ei.address); + } + return rcode; +} + +/** + * Removes a device from the tables + * + * @param addr address of the device + * @return nothing + */ +void UHS_USB_HOST_BASE::ReleaseDevice(uint8_t addr) { + if(addr) { +#if 0 // defined(UHS_HID_LOADED) + // Release any HID children + UHS_HID_Release(this, addr); +#endif + for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { + if(!devConfig[i]) continue; + if(devConfig[i]->bAddress == addr) { + devConfig[i]->Release(); + break; + } + } + } +} + +/** + * Gets the device descriptor, or part of it from endpoint Zero. + * + * @param addr Address of the device + * @param nbytes how many bytes to return + * @param dataptr pointer to the data to return + * @return status of the request, zero is success. + */ +uint8_t UHS_USB_HOST_BASE::getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t* dataptr) { + return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes), nbytes, dataptr)); +} + +/** + * Gets the config descriptor, or part of it from endpoint Zero. + * + * @param addr Address of the device + * @param nbytes how many bytes to return + * @param conf index to descriptor to return + * @param dataptr ointer to the data to return + * @return status of the request, zero is success. + */ +uint8_t UHS_USB_HOST_BASE::getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) { + return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes), nbytes, dataptr)); +} + +/** + * Get the string descriptor from a device + * + * @param addr Address of the device + * @param ns + * @param index + * @param langid language ID + * @param dataptr pointer to the data to return + * @return status of the request, zero is success. + */ +uint8_t UHS_USB_HOST_BASE::getStrDescr(uint8_t addr, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) { + return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns), ns, dataptr)); +} + +// +//set address +// + +/** + * Set the address of a device to a new address via endpoint Zero. + * + * @param oldaddr current address + * @param newaddr new address + * @return status of the request, zero is success. + */ +uint8_t UHS_USB_HOST_BASE::setAddr(uint8_t oldaddr, uint8_t newaddr) { + uint8_t rcode = ctrlReq(oldaddr, mkSETUP_PKT8(UHS_bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000), 0x0000, NULL); + sof_delay(300); // Older spec says you should wait at least 200ms + return rcode; +} + +// +//set configuration +// + +/** + * Set the configuration for the device to use via endpoint Zero. + * + * @param addr Address of the device + * @param conf_value configuration index value + * @return status of the request, zero is success. + */ +uint8_t UHS_USB_HOST_BASE::setConf(uint8_t addr, uint8_t conf_value) { + return ( ctrlReq(addr, mkSETUP_PKT8(UHS_bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000), 0x0000, NULL)); +} + +/* rcode 0 if no errors. rcode 01-0f is relayed from HRSL */ + +/** + * Writes data to an interface pipe + * + * @param addr Address of the device + * @param ep Endpoint of the pipe + * @param nbytes number of bytes to transfer + * @param data pointer to buffer to hold transfer + * @return zero for success or error code + */ +uint8_t UHS_USB_HOST_BASE::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) { + UHS_EpInfo *pep = NULL; + uint16_t nak_limit = 0; + HOST_DEBUG("outTransfer: addr: 0x%2.2x ep: 0x%2.2x nbytes: 0x%4.4x data: 0x%p\r\n", addr, ep, nbytes, data); + + uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit); + HOST_DEBUG("outTransfer: SetAddress 0x%2.2x\r\n", rcode); + if(!rcode) + rcode = OutTransfer(pep, nak_limit, nbytes, data); + return rcode; +}; + +/** + * Reads data from an interface pipe + * + * @param addr Address of the device + * @param ep Endpoint of the pipe + * @param nbytesptr number of bytes to transfer + * @param data pointer to buffer to hold transfer + * @return zero for success or error code + */ +uint8_t UHS_USB_HOST_BASE::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data) { + UHS_EpInfo *pep = NULL; + uint16_t nak_limit = 0; + + uint8_t rcode = SetAddress(addr, ep, &pep, nak_limit); + + // if(rcode) { + // USBTRACE3("(USB::InTransfer) SetAddress Failed ", rcode, 0x81); + // USBTRACE3("(USB::InTransfer) addr requested ", addr, 0x81); + // USBTRACE3("(USB::InTransfer) ep requested ", ep, 0x81); + // return rcode; + // } + if(!rcode) + rcode = InTransfer(pep, nak_limit, nbytesptr, data); + return rcode; + +} + +/** + * Initialize the descriptor stream, works much like opening a file. + * + * @param ei + * @param ucd + * @param pep + * @param data + * @param left + * @param read + * @param offset + * @return zero for success or error code + */ +uint8_t UHS_USB_HOST_BASE::initDescrStream(ENUMERATION_INFO *ei, USB_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset) { + if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT; + if(!pep) return UHS_HOST_ERROR_NULL_EPINFO; + *left = ucd->wTotalLength; + *read = 0; + *offset = 1; + uint8_t rcode; + pep->maxPktSize = ei->bMaxPacketSize0; + rcode = getone(pep, left, read, data, offset); + return rcode; +} + +uint8_t UHS_USB_HOST_BASE::getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pep, uint8_t data[], uint16_t *left, uint16_t *read, uint8_t *offset) { + uint16_t remain; + uint8_t ty; + uint8_t rcode = UHS_HOST_ERROR_END_OF_STREAM; + uint8_t *ptr; + uint8_t epc = 0; + ei->interface.numep = 0; + ei->interface.klass = 0; + ei->interface.subklass = 0; + ei->interface.protocol = 0; + while(*left + *read) { + remain = data[*offset]; // bLength + while(remain < 2) { + rcode = getone(pep, left, read, data, offset); + if(rcode) + return rcode; + remain = data[*offset]; + } + rcode = getone(pep, left, read, data, offset); + if(rcode) + return rcode; + ty = data[*offset]; // bDescriptorType + HOST_DEBUG("bLength: %i ", remain); + HOST_DEBUG("bDescriptorType: %2.2x\r\n", ty); + remain--; + if(ty == USB_DESCRIPTOR_INTERFACE) { + HOST_DEBUG("INTERFACE DESCRIPTOR FOUND\r\n"); + ptr = (uint8_t *)(&(ei->interface.bInterfaceNumber)); + for(int i = 0; i < 6; i++) { + rcode = getone(pep, left, read, data, offset); + if(rcode) + return rcode; + *ptr = data[*offset]; + ptr++; + } + rcode = getone(pep, left, read, data, offset); + if(rcode) + return rcode; + // Now at iInterface + // Get endpoints. + HOST_DEBUG("Getting %i endpoints\r\n", ei->interface.numep); + while(epc < ei->interface.numep) { + rcode = getone(pep, left, read, data, offset); + if(rcode) { + HOST_DEBUG("ENDPOINT DESCRIPTOR DIED WAY EARLY\r\n"); + return rcode; + } + remain = data[*offset]; // bLength + while(remain < 2) { + rcode = getone(pep, left, read, data, offset); + if(rcode) + return rcode; + remain = data[*offset]; + } + rcode = getone(pep, left, read, data, offset); + if(rcode) { + HOST_DEBUG("ENDPOINT DESCRIPTOR DIED EARLY\r\n"); + return rcode; + } + ty = data[*offset]; // bDescriptorType + HOST_DEBUG("bLength: %i ", remain); + HOST_DEBUG("bDescriptorType: %2.2x\r\n", ty); + remain -= 2; + if(ty == USB_DESCRIPTOR_ENDPOINT) { + HOST_DEBUG("ENDPOINT DESCRIPTOR: %i\r\n", epc); + ptr = (uint8_t *)(&(ei->interface.epInfo[epc].bEndpointAddress)); + for(unsigned int i = 0; i< sizeof (ENDPOINT_INFO); i++) { + rcode = getone(pep, left, read, data, offset); + if(rcode) { + HOST_DEBUG("ENDPOINT DESCRIPTOR DIED LATE\r\n"); + return rcode; + } + *ptr = data[*offset]; + ptr++; + remain--; + } + epc++; + HOST_DEBUG("ENDPOINT DESCRIPTOR OK\r\n"); + } + rcode = eat(pep, left, read, data, offset, &remain); + if(rcode) { + HOST_DEBUG("ENDPOINT DESCRIPTOR DIED EATING\r\n"); + return rcode; + } + remain = 0; + } + remain = 1; + // queue ahead, but do not report if error. + rcode = eat(pep, left, read, data, offset, &remain); + if(!ei->interface.numep && rcode) { + return rcode; + } + HOST_DEBUG("ENDPOINT DESCRIPTORS FILLED\r\n"); + return 0; + } else { + rcode = eat(pep, left, read, data, offset, &remain); + if(rcode) + return rcode; + } + rcode = UHS_HOST_ERROR_END_OF_STREAM; + } + return rcode; +} + +uint8_t UHS_USB_HOST_BASE::seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd) { + if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT; + uint8_t data[ei->bMaxPacketSize0]; + UHS_EpInfo *pep; + pep = ctrlReqOpen(ei->address, mkSETUP_PKT8(UHS_bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, ei->currentconfig, + USB_DESCRIPTOR_CONFIGURATION, 0x0000U, ucd->wTotalLength), data); + if(!pep) return UHS_HOST_ERROR_NULL_EPINFO; + uint16_t left = ucd->wTotalLength; + uint8_t cinf = 0; + uint8_t ty; + uint8_t epc = 0; + uint16_t remain = ucd->bLength; + uint16_t read = 0; + uint8_t offset = remain; + uint8_t *ptr; + uint8_t rcode; + ei->interface.numep = 0; + ei->interface.klass = 0; + ei->interface.subklass = 0; + ei->interface.protocol = 0; + pep->maxPktSize = ei->bMaxPacketSize0; + + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + HOST_DEBUG("\r\nGetting interface: %i\r\n", inf); + inf++; + while(cinf != inf && (left + read)) { + //HOST_DEBUG("getInterface: cinf: %i inf: %i left: %i read: %i offset: %i remain %i\r\n", cinf, inf, left, read, offset, remain); + // Go past current descriptor + HOST_DEBUG("Skip: %i\r\n", remain); + rcode = eat(pep, &left, &read, data, &offset, &remain); + if(rcode) + return rcode; + remain = data[offset]; // bLength + while(remain < 2) { + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + remain = data[offset]; + } + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + ty = data[offset]; // bDescriptorType + HOST_DEBUG("bLength: %i ", remain); + HOST_DEBUG("bDescriptorType: %2.2x\r\n", ty); + remain--; + if(ty == USB_DESCRIPTOR_INTERFACE) { + HOST_DEBUG("INTERFACE DESCRIPTOR: %i\r\n", cinf); + cinf++; + if(cinf == inf) { + // Get the interface descriptor information. + ptr = (uint8_t *)(&(ei->interface.bInterfaceNumber)); + for(int i = 0; i < 6; i++) { + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + *ptr = data[offset]; + ptr++; + } + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + // Now at iInterface + remain = 0; + // Get endpoints. + HOST_DEBUG("Getting %i endpoints\r\n", ei->interface.numep); + while(epc < ei->interface.numep) { + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + remain = data[offset]; // bLength + while(remain < 2) { + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + remain = data[offset]; + } + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + ty = data[offset]; // bDescriptorType + HOST_DEBUG("bLength: %i ", remain); + HOST_DEBUG("bDescriptorType: %2.2x\r\n", ty); + remain--; + if(ty == USB_DESCRIPTOR_ENDPOINT) { + HOST_DEBUG("ENDPOINT DESCRIPTOR: %i\r\n", epc); + ptr = (uint8_t *)(&(ei->interface.epInfo[epc].bEndpointAddress)); + for(unsigned int i = 0; i< sizeof (ENDPOINT_INFO); i++) { + rcode = getone(pep, &left, &read, data, &offset); + if(rcode) + return rcode; + *ptr = data[offset]; + ptr++; + } + epc++; + remain = 0; + } else { + rcode = eat(pep, &left, &read, data, &offset, &remain); + if(rcode) + return rcode; + remain = 0; + } + } + } + } + } + + return ctrlReqClose(pep, UHS_bmREQ_GET_DESCR, left, ei->bMaxPacketSize0, data); +} + +uint8_t UHS_USB_HOST_BASE::getone(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset) { + uint8_t rcode = 0; + *offset += 1; + if(*offset < *read) { + return 0; + } else if(*left > 0) { + // uint16_t num = *left; + uint16_t num = pep->maxPktSize; + if(num > *left) num = *left; + *offset = 0; + rcode = ctrlReqRead(pep, left, read, num, dataptr); + if(rcode == 0) { + if(*read == 0) { + rcode = UHS_HOST_ERROR_END_OF_STREAM; + } else if(*read < num) *left = 0; + } + } else { + rcode = UHS_HOST_ERROR_END_OF_STREAM; + } + return rcode; +} + +uint8_t UHS_USB_HOST_BASE::eat(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset, uint16_t *yum) { + uint8_t rcode = 0; + HOST_DEBUG("eating %i\r\n", *yum); + while(*yum) { + *yum -= 1; + rcode = getone(pep, left, read, dataptr, offset); + if(rcode) break; + } + return rcode; +} + +uint8_t UHS_USB_HOST_BASE::ctrlReq(uint8_t addr, uint64_t Request, uint16_t nbytes, uint8_t* dataptr) { + //bool direction = bmReqType & 0x80; //request direction, IN or OUT + uint8_t rcode = 0; + + // Serial.println(""); + UHS_EpInfo *pep = ctrlReqOpen(addr, Request, dataptr); + if(!pep) { + HOST_DEBUG("ctrlReq1: ERROR_NULL_EPINFO addr: %d\r\n", addr); + return UHS_HOST_ERROR_NULL_EPINFO; + } + uint8_t rt = (uint8_t)(Request & 0xFFU); + + // Serial.println("Opened"); + uint16_t left = (uint16_t)(Request >> 48) /*total*/; + if(dataptr != NULL) { + //data stage + if((rt & 0x80) == 0x80) { + //IN transfer + while(left) { + // Bytes read into buffer + uint16_t read = nbytes; + HOST_DEBUG("ctrlReq2: left: %i, read:%i, nbytes %i\r\n", left, read, nbytes); + rcode = ctrlReqRead(pep, &left, &read, nbytes, dataptr); + +#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + HOST_DEBUG("RESULT: 0x%2.2x 0x%2.2x 0x%2.2x 0x%8.8lx%8.8lx\r\n", rcode, addr, read, (uint32_t)((Request>>32)&0xfffffffflu), (uint32_t)(Request&0xfffffffflu)); + // Should only be used for GET_DESCRIPTOR USB_DESCRIPTOR_DEVICE + constexpr uint32_t req_match = ((uint32_t)USB_DESCRIPTOR_DEVICE << 24) | + ((uint32_t)USB_REQUEST_GET_DESCRIPTOR << 8); + const uint32_t req_found = Request & 0xFF00FF00ul; + if(!addr && read && (req_found == req_match)) { + HOST_DEBUG("ctrlReq3: acceptBuffer sz %i nbytes %i left %i\n\r", read, nbytes, left); + left = 0; + rcode = UHS_HOST_ERROR_NONE; + break; + } +#endif + if(rcode) { + return rcode; + } + } + } else { + // OUT transfer + rcode = OutTransfer(pep, 0, nbytes, dataptr); + } + if(rcode) { + //return error + return ( rcode); + } + } + + // Serial.println("Close Phase"); + // Serial.flush(); + // Status stage + rcode = ctrlReqClose(pep, rt, left, nbytes, dataptr); + // Serial.println("Closed"); + return rcode; +} + +uint8_t UHS_USB_HOST_BASE::EPClearHalt(uint8_t addr, uint8_t ep) { + return ctrlReq(addr, mkSETUP_PKT8(USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_STANDARD | USB_SETUP_RECIPIENT_ENDPOINT, USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT, 0, ep, 0), 0, NULL); +} + +uint8_t UHS_USB_HOST_BASE::TestInterface(ENUMERATION_INFO *ei) { + + uint8_t devConfigIndex; + uint8_t rcode = 0; + HOST_DEBUG("TestInterface VID:%4.4x PID:%4.4x Class:%2.2x Subclass:%2.2x Protocol %2.2x\r\n", ei->vid, ei->pid, ei->klass, ei->subklass, ei->protocol); + HOST_DEBUG("Interface data: Class:%2.2x Subclass:%2.2x Protocol %2.2x, number of endpoints %i\r\n", ei->interface.klass, ei->interface.subklass, ei->interface.subklass, ei->interface.numep); + HOST_DEBUG("Parent: %2.2x, bAddress: %2.2x\r\n", ei->parent, ei->address); + for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { + if(!devConfig[devConfigIndex]) { + HOST_DEBUG("No driver at index %i\r\n", devConfigIndex); + continue; // no driver + } + if(devConfig[devConfigIndex]->bAddress) { + HOST_DEBUG("Driver %i is already consumed @ %2.2x\r\n", devConfigIndex, devConfig[devConfigIndex]->bAddress); + continue; // consumed + } + + if(devConfig[devConfigIndex]->OKtoEnumerate(ei)) { + HOST_DEBUG("Driver %i supports this interface\r\n", devConfigIndex); + break; + } + } + if(devConfigIndex == UHS_HOST_MAX_INTERFACE_DRIVERS) { + rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED; +#if 0 // defined(UHS_HID_LOADED) + // Check HID here, if it is, then lie + if(ei->klass == UHS_USB_CLASS_HID) { + devConfigIndex = UHS_HID_INDEX; // for debugging, otherwise this has no use. + rcode = 0; + } +#endif + } + if(!rcode) HOST_DEBUG("Driver %i can be used for this interface\r\n", devConfigIndex); + else HOST_DEBUG("No driver for this interface.\r\n"); + return rcode; +}; + +uint8_t UHS_USB_HOST_BASE::enumerateInterface(ENUMERATION_INFO *ei) { + uint8_t devConfigIndex; + + HOST_DEBUG("AttemptConfig: parent = %i, port = %i\r\n", ei->parent, ei->port); + +#if 0 // defined(UHS_HID_LOADED) + // Check HID here, if it is, then lie + if(ei->klass == UHS_USB_CLASS_HID || ei->interface.klass == UHS_USB_CLASS_HID) { + UHS_HID_SetUSBInterface(this, ENUMERATION_INFO * ei); + devConfigIndex = UHS_HID_INDEX; + } else +#endif + for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) { + if(!devConfig[devConfigIndex]) { + HOST_DEBUG("No driver at index %i\r\n", devConfigIndex); + continue; // no driver + } + if(devConfig[devConfigIndex]->bAddress) { + HOST_DEBUG("Driver %i is already consumed @ %2.2x\r\n", devConfigIndex, devConfig[devConfigIndex]->bAddress); + continue; // consumed + } + + if(devConfig[devConfigIndex]->OKtoEnumerate(ei)) { + HOST_DEBUG("Driver %i supports this interface\r\n", devConfigIndex); + if(!devConfig[devConfigIndex]->SetInterface(ei)) break; + else devConfigIndex = UHS_HOST_MAX_INTERFACE_DRIVERS; + } + } + return devConfigIndex; +}; + + +//////////////////////////////////////////////////////////////////////////////// +// Vendor Specific Interface Class +//////////////////////////////////////////////////////////////////////////////// + +#if 0 +/** + * Might go away, depends on if it is useful, or not. + * + * @param ei Enumeration information + * @return true if this interface driver can handle this interface description + */ +bool UHS_NI UHS_VSI::OKtoEnumerate(ENUMERATION_INFO *ei) { + return ( + (ei->subklass == UHS_USB_CLASS_VENDOR_SPECIFIC) || + (ei->interface.subklass == UHS_USB_CLASS_VENDOR_SPECIFIC) + ); +} + +/** + * Copy the entire ENUMERATION_INFO structure + * @param ei Enumeration information + * @return 0 + */ +uint8_t UHS_NI UHS_VSI::SetInterface(ENUMERATION_INFO *ei) { + bNumEP = 1; + bAddress = ei->address; + + eInfo.address = ei->address; + eInfo.bMaxPacketSize0 = ei->bMaxPacketSize0; + eInfo.currentconfig = ei->currentconfig; + eInfo.interface.bAlternateSetting = ei->interface.bAlternateSetting; + eInfo.interface.bInterfaceNumber = ei->interface.bInterfaceNumber; + eInfo.interface.numep = ei->interface.numep; + eInfo.interface.protocol = ei->interface.protocol; + eInfo.interface.subklass = ei->interface.subklass; + eInfo.klass = ei->klass; + eInfo.parent = ei->parent; + eInfo.pid = ei->pid; + eInfo.port = ei->port; + eInfo.protocol = ei->protocol; + eInfo.subklass = ei->subklass; + eInfo.vid = ei->vid; + for(uint8_t i = 0; i < eInfo.interface.numep; i++) { + eInfo.interface.epInfo[i].bEndpointAddress = ei->interface.epInfo[i].bEndpointAddress; + eInfo.interface.epInfo[i].bInterval = ei->interface.epInfo[i].bInterval; + eInfo.interface.epInfo[i].bmAttributes = ei->interface.epInfo[i].bmAttributes; + eInfo.interface.epInfo[i].wMaxPacketSize = ei->interface.epInfo[i].wMaxPacketSize; + } + return 0; +} +#endif + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +#if 0 + +/* TO-DO: Move this silliness to a NONE driver. + * When we have a generic NONE driver we can: + * o Extract ALL device information to help users with a new device. + * o Use an unknown device from a sketch, kind of like usblib does. + * This will aid in making more drivers in a faster way. + */ +uint8_t UHS_USB_HOST_BASE::DefaultAddressing(uint8_t parent, uint8_t port, uint8_t speed) { + uint8_t rcode; + UHS_Device *p0 = NULL, *p = NULL; + + // Get pointer to pseudo device with address 0 assigned + p0 = addrPool.GetUsbDevicePtr(0); + + if(!p0) + return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; + + if(!p0->epinfo) + return UHS_HOST_ERROR_NULL_EPINFO; + + p0->speed = speed; + + // Allocate new address according to device class + uint8_t bAddress = addrPool.AllocAddress(parent, false, port); + + if(!bAddress) + return UHS_HOST_ERROR_ADDRESS_POOL_FULL; + + p = addrPool.GetUsbDevicePtr(bAddress); + + if(!p) + return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; + + p->speed = speed; + + // Assign new address to the device + rcode = setAddr(0, bAddress); + + if(rcode) { + addrPool.FreeAddress(bAddress); + bAddress = 0; + return rcode; + } + return 0; +} +#endif + +#else +#error "Never include UHS_host_INLINE.h, include UHS_host.h instead" +#endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h new file mode 100644 index 000000000000..9c94e4d0ee6d --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h @@ -0,0 +1,392 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#ifndef MACROS_H +#define MACROS_H +#include "macro_logic.h" +/* + * Universal Arduino(tm) "IDE" fixups. + */ + + +// Just in case... +#ifndef SERIAL_PORT_MONITOR +#define SERIAL_PORT_MONITOR Serial +#endif + +#ifndef INT16_MIN +#define INT16_MIN -32768 +#endif +// require 10607+ +#if defined(ARDUINO) && ARDUINO >=10607 +// nop :-) +#else +#error "Arduino version too old, and must be at least 1.6.7" +#endif + +// Nuke screwed up macro junk from the IDE. +#ifdef __cplusplus +#ifdef true +#undef true +#endif +#ifdef false +#undef false +#endif +#endif + + +#ifndef UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE + +#ifndef UHS_BIG_FLASH + +#if defined(FLASHEND) && defined(FLASHSTART) +#if (FLASHEND - FLASHSTART) > 0x0FFFFU +#define UHS_BIG_FLASH 1 +#else +#define UHS_BIG_FLASH 0 +#endif + +#elif defined(__PIC32_FLASH_SIZE) +#if __PIC32_FLASH_SIZE > 511 +#define UHS_BIG_FLASH 1 +#else +#define UHS_BIG_FLASH 0 +#endif + +#elif defined(FLASHEND) && !defined(FLASHSTART) +// Assumes flash starts at 0x00000, is this a safe assumption? +// 192K + should be OK +#if FLASHEND > 0x02FFFFU +#define UHS_BIG_FLASH 1 +#else +#define UHS_BIG_FLASH 0 +#endif + +#elif defined(IFLASH_SIZE) +#if IFLASH_SIZE > 0x0FFFFU +#define UHS_BIG_FLASH 1 +#else +#define UHS_BIG_FLASH 0 +#endif + +#elif defined(ESP8266) +#define UHS_BIG_FLASH 1 +#define SYSTEM_OR_SPECIAL_YIELD(...) yield() + +#elif defined(__arm__) && defined(CORE_TEENSY) +#define UHS_BIG_FLASH 1 + +#elif defined(ARDUINO_spresense_ast) +#define UHS_BIG_FLASH 1 +#else +// safe default +#warning Small flash? +#define UHS_BIG_FLASH 0 +#endif +#endif + +#if UHS_BIG_FLASH +#define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 1 +#else +#define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 0 +#endif +#endif + +#if defined(__arm__) && defined(CORE_TEENSY) +#define UHS_PIN_WRITE(p, v) digitalWriteFast(p, v) +#define UHS_PIN_READ(p) digitalReadFast(p) +#endif +// TODO: Fast inline code for AVR and SAM based microcontrollers +// This can be done pretty easily. +// For now, this will just work out-of-the-box. +#ifndef UHS_PIN_WRITE +#define UHS_PIN_WRITE(p, v) digitalWrite(p, v) +#endif +#ifndef UHS_PIN_READ +#define UHS_PIN_READ(p) digitalRead(p) +#endif + +#if defined( __PIC32MX__ ) && !defined(interrupts) // compiling with Microchip XC32 compiler +#define interrupts() __builtin_enable_interrupts() +#edfine noInterrupts() __builtin_disable_interrupts() +#endif + +#ifndef ARDUINO_SAMD_ZERO +#ifdef ARDUINO_AVR_ADK +#define UHS_GET_DPI(x) (x == 54 ? 6 : digitalPinToInterrupt(x)) +#else +#define UHS_GET_DPI(x) digitalPinToInterrupt(x) +#endif +#else +#define UHS_GET_DPI(x) (x) +#endif + +#ifndef __AVR__ +#ifndef __PGMSPACE_H_ +// This define should prevent reading the system pgmspace.h if included elsewhere +// This is not normally needed. +#define __PGMSPACE_H_ 1 +#endif + +#ifndef PROGMEM +#define PROGMEM +#endif +#ifndef PGM_P +#define PGM_P const char * +#endif +#ifndef PSTR +#define PSTR(str) (str) +#endif +#ifndef F +#define F(str) (str) +#endif +#ifndef _SFR_BYTE +#define _SFR_BYTE(n) (n) +#endif +#ifndef memchr_P +#define memchr_P(str, c, len) memchr((str), (c), (len)) +#endif +#ifndef memcmp_P +#define memcmp_P(a, b, n) memcmp((a), (b), (n)) +#endif +#ifndef memcpy_P +#define memcpy_P(dest, src, num) memcpy((dest), (src), (num)) +#endif +#ifndef memmem_P +#define memmem_P(a, alen, b, blen) memmem((a), (alen), (b), (blen)) +#endif +#ifndef memrchr_P +#define memrchr_P(str, val, len) memrchr((str), (val), (len)) +#endif +#ifndef strcat_P +#define strcat_P(dest, src) strcat((dest), (src)) +#endif +#ifndef strchr_P +#define strchr_P(str, c) strchr((str), (c)) +#endif +#ifndef strchrnul_P +#define strchrnul_P(str, c) strchrnul((str), (c)) +#endif +#ifndef strcmp_P +#define strcmp_P(a, b) strcmp((a), (b)) +#endif +#ifndef strcpy_P +#define strcpy_P(dest, src) strcpy((dest), (src)) +#endif +#ifndef strcasecmp_P +#define strcasecmp_P(a, b) strcasecmp((a), (b)) +#endif +#ifndef strcasestr_P +#define strcasestr_P(a, b) strcasestr((a), (b)) +#endif +#ifndef strlcat_P +#define strlcat_P(dest, src, len) strlcat((dest), (src), (len)) +#endif +#ifndef strlcpy_P +#define strlcpy_P(dest, src, len) strlcpy((dest), (src), (len)) +#endif +#ifndef strlen_P +#define strlen_P(s) strlen((const char *)(s)) +#endif +#ifndef strnlen_P +#define strnlen_P(str, len) strnlen((str), (len)) +#endif +#ifndef strncmp_P +#define strncmp_P(a, b, n) strncmp((a), (b), (n)) +#endif +#ifndef strncasecmp_P +#define strncasecmp_P(a, b, n) strncasecmp((a), (b), (n)) +#endif +#ifndef strncat_P +#define strncat_P(a, b, n) strncat((a), (b), (n)) +#endif +#ifndef strncpy_P +#define strncpy_P(a, b, n) strncmp((a), (b), (n)) +#endif +#ifndef strpbrk_P +#define strpbrk_P(str, chrs) strpbrk((str), (chrs)) +#endif +#ifndef strrchr_P +#define strrchr_P(str, c) strrchr((str), (c)) +#endif +#ifndef strsep_P +#define strsep_P(strp, delim) strsep((strp), (delim)) +#endif +#ifndef strspn_P +#define strspn_P(str, chrs) strspn((str), (chrs)) +#endif +#ifndef strstr_P +#define strstr_P(a, b) strstr((a), (b)) +#endif +#ifndef sprintf_P +#define sprintf_P(s, ...) sprintf((s), __VA_ARGS__) +#endif +#ifndef vfprintf_P +#define vfprintf_P(s, ...) vfprintf((s), __VA_ARGS__) +#endif +#ifndef printf_P +#define printf_P(...) printf(__VA_ARGS__) +#endif +#ifndef snprintf_P +#define snprintf_P(s, n, ...) ((s), (n), __VA_ARGS__) +#endif +#ifndef vsprintf_P +#define vsprintf_P(s, ...) ((s),__VA_ARGS__) +#endif +#ifndef vsnprintf_P +#define vsnprintf_P(s, n, ...) ((s), (n),__VA_ARGS__) +#endif +#ifndef fprintf_P +#define fprintf_P(s, ...) ((s), __VA_ARGS__) +#endif + +#ifndef pgm_read_byte +#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) +#endif +#ifndef pgm_read_word +#define pgm_read_word(addr) (*(const unsigned short *)(addr)) +#endif +#ifndef pgm_read_dword +#define pgm_read_dword(addr) (*(const unsigned long *)(addr)) +#endif +#ifndef pgm_read_float +#define pgm_read_float(addr) (*(const float *)(addr)) +#endif + +#ifndef pgm_read_byte_near +#define pgm_read_byte_near(addr) pgm_read_byte(addr) +#endif +#ifndef pgm_read_word_near +#define pgm_read_word_near(addr) pgm_read_word(addr) +#endif +#ifndef pgm_read_dword_near +#define pgm_read_dword_near(addr) pgm_read_dword(addr) +#endif +#ifndef pgm_read_float_near +#define pgm_read_float_near(addr) pgm_read_float(addr) +#endif +#ifndef pgm_read_byte_far +#define pgm_read_byte_far(addr) pgm_read_byte(addr) +#endif +#ifndef pgm_read_word_far +#define pgm_read_word_far(addr) pgm_read_word(addr) +#endif +#ifndef pgm_read_dword_far +#define pgm_read_dword_far(addr) pgm_read_dword(addr) +#endif +#ifndef pgm_read_float_far +#define pgm_read_float_far(addr) pgm_read_float(addr) +#endif + +#ifndef pgm_read_pointer +#define pgm_read_pointer +#endif + +#endif + + +//////////////////////////////////////////////////////////////////////////////// +// HANDY MACROS +//////////////////////////////////////////////////////////////////////////////// + +// Atmoically set/clear single bits using bitbands. +// Believe it or not, this boils down to a constant, +// and is less code than using |= &= operators. +// Bonus, it makes code easier to read too. +// Bitbanding is a wonderful thing. +#define BITNR(i) (i&0x1?0:i&0x2?1:i&0x4?2:i&0x8?3:i&0x10?4:i&0x20?5:i&0x40?6:i&0x80?7:i&0x100?8:i&0x200?9:i&0x400?10:i&0x800?11:i&0x1000?12:i&0x2000?13:i&0x4000?14:i&0x8000?15:i&0x10000?16:i&0x20000?17:i&0x40000?18:i&0x80000?19:i&0x100000?20:i&0x200000?21:i&0x400000?22:i&0x800000?23:i&0x1000000?24:i&0x2000000?25:i&0x4000000?26:i&0x8000000?27:i&0x10000000?28:i&0x20000000?29:i&0x40000000?30:i&0x80000000?31:32) +#define UHS_KIO_BITBAND_ADDR(r, i) (((uint32_t)&(r) - 0x40000000) * 32 + (i) * 4 + 0x42000000) +#define UHS_KIO_SETBIT_ATOMIC(r, m) (*(uint32_t *)UHS_KIO_BITBAND_ADDR((r), BITNR((m)))) = 1 +#define UHS_KIO_CLRBIT_ATOMIC(r, m) (*(uint32_t *)UHS_KIO_BITBAND_ADDR((r), BITNR((m)))) = 0 + + +#define VALUE_BETWEEN(v,l,h) (((v)>(l)) && ((v)<(h))) +#define VALUE_WITHIN(v,l,h) (((v)>=(l)) && ((v)<=(h))) +#define output_pgm_message(wa,fp,mp,el) wa = &mp, fp((char *)pgm_read_pointer(wa), el) +#define output_if_between(v,l,h,wa,fp,mp,el) if(VALUE_BETWEEN(v,l,h)) output_pgm_message(wa,fp,mp[v-(l+1)],el); + +#define UHS_SWAP_VALUES(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) +#ifndef __BYTE_GRABBING_DEFINED__ +#define __BYTE_GRABBING_DEFINED__ 1 +#ifdef BROKEN_OPTIMIZER_LITTLE_ENDIAN +// Note: Use this if your compiler generates horrible assembler! +#define UHS_UINT8_BYTE0(__usi__) (((uint8_t *)&(__usi__))[0]) +#define UHS_UINT8_BYTE1(__usi__) (((uint8_t *)&(__usi__))[1]) +#define UHS_UINT8_BYTE2(__usi__) (((uint8_t *)&(__usi__))[2]) +#define UHS_UINT8_BYTE3(__usi__) (((uint8_t *)&(__usi__))[3]) +#define UHS_UINT8_BYTE4(__usi__) (((uint8_t *)&(__usi__))[4]) +#define UHS_UINT8_BYTE5(__usi__) (((uint8_t *)&(__usi__))[5]) +#define UHS_UINT8_BYTE6(__usi__) (((uint8_t *)&(__usi__))[6]) +#define UHS_UINT8_BYTE7(__usi__) (((uint8_t *)&(__usi__))[7]) +#else +// Note: The cast alone to uint8_t is actually enough. +// GCC throws out the "& 0xff", and the size is no different. +// Some compilers need it. +#define UHS_UINT8_BYTE0(__usi__) ((uint8_t)((__usi__) & 0xff )) +#define UHS_UINT8_BYTE1(__usi__) ((uint8_t)(((__usi__) >> 8) & 0xff)) +#define UHS_UINT8_BYTE2(__usi__) ((uint8_t)(((__usi__) >> 16) & 0xff)) +#define UHS_UINT8_BYTE3(__usi__) ((uint8_t)(((__usi__) >> 24) & 0xff)) +#define UHS_UINT8_BYTE4(__usi__) ((uint8_t)(((__usi__) >> 32) & 0xff)) +#define UHS_UINT8_BYTE5(__usi__) ((uint8_t)(((__usi__) >> 40) & 0xff)) +#define UHS_UINT8_BYTE6(__usi__) ((uint8_t)(((__usi__) >> 48) & 0xff)) +#define UHS_UINT8_BYTE7(__usi__) ((uint8_t)(((__usi__) >> 56) & 0xff)) +#endif +#define UHS_UINT16_SET_BYTE1(__usi__) ((uint16_t)(__usi__) << 8) +#define UHS_UINT32_SET_BYTE1(__usi__) ((uint32_t)(__usi__) << 8) +#define UHS_UINT64_SET_BYTE1(__usi__) ((uint64_t)(__usi__) << 8) +#define UHS_UINT32_SET_BYTE2(__usi__) ((uint32_t)(__usi__) << 16) +#define UHS_UINT64_SET_BYTE2(__usi__) ((uint64_t)(__usi__) << 16) +#define UHS_UINT32_SET_BYTE3(__usi__) ((uint32_t)(__usi__) << 24) +#define UHS_UINT64_SET_BYTE3(__usi__) ((uint64_t)(__usi__) << 24) +#define UHS_UINT64_SET_BYTE4(__usi__) ((uint64_t)(__usi__) << 32) +#define UHS_UINT64_SET_BYTE5(__usi__) ((uint64_t)(__usi__) << 40) +#define UHS_UINT64_SET_BYTE6(__usi__) ((uint64_t)(__usi__) << 48) +#define UHS_UINT64_SET_BYTE7(__usi__) ((uint64_t)(__usi__) << 56) + +// These are the smallest and fastest ways I have found so far in pure C/C++. +#define UHS_BYTES_TO_UINT16(__usc1__,__usc0__) ((uint16_t)((uint16_t)(__usc0__) | (uint16_t)UHS_UINT16_SET_BYTE1(__usc1__))) +#define UHS_BYTES_TO_UINT32(__usc3__,__usc2__,__usc1__,__usc0__) ((uint32_t)((uint32_t)(__usc0__) | UHS_UINT32_SET_BYTE1(__usc1__) | UHS_UINT32_SET_BYTE2(__usc2__) | UHS_UINT32_SET_BYTE3(__usc3__))) +#define UHS_BYTES_TO_UINT64(__usc7__,__usc6__,__usc5__,__usc4__,__usc3__,__usc2__,__usc1__,__usc0__) ((uint64_t)((uint64_t)__usc0__ | UHS_UINT64_SET_BYTE1(__usc1__) | UHS_UINT64_SET_BYTE2(__usc2__) | UHS_UINT64_SET_BYTE3(__usc3__) | UHS_UINT64_SET_BYTE4(__usc4__) | UHS_UINT64_SET_BYTE5(__usc5__) | UHS_UINT64_SET_BYTE6(__usc6__) | UHS_UINT64_SET_BYTE7(__usc7__))) +#endif +/* + * Debug macros. + * Useful when porting from UHS2. + * Do not use these for any new code. + * Change to better debugging after port is completed. + * Strings are stored in progmem (flash) instead of RAM. + */ +#define USBTRACE1(s,l) (Notify(PSTR(s), l)) +#define USBTRACE(s) (USBTRACE1((s), 0x80)); USB_HOST_SERIAL.flush() +#define USBTRACE3(s,r,l) (Notify(PSTR(s), l), D_PrintHex((r), l), Notify(PSTR("\r\n"), l)) +#define USBTRACE3X(s,r,l) (Notify(PSTR(s), l), D_PrintHex((r), l)) +#define USBTRACE2(s,r) (USBTRACE3((s),(r),0x80)); USB_HOST_SERIAL.flush() +#define USBTRACE2X(s,r) (USBTRACE3X((s),(r),0x80)); USB_HOST_SERIAL.flush() + +#define VOID0 ((void)0) +#ifndef NOTUSED +#define NOTUSED(...) __VA_ARGS__ __attribute__((unused)) +#endif +#endif /* MACROS_H */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h new file mode 100644 index 000000000000..f5ed3d8b4075 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h @@ -0,0 +1,91 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ +#if !defined(_UHS_host_h_) || defined(__MESSAGE_H__) +#error "Never include UHS_message.h directly; include UHS_Usb.h instead" +#else +#define __MESSAGE_H__ + +extern int UsbDEBUGlvl; + +void E_Notify(char const * msg, int lvl); +void E_Notify(uint8_t b, int lvl); +void E_NotifyStr(char const * msg, int lvl); +void E_Notifyc(char c, int lvl); + +#ifdef DEBUG_USB_HOST +#define Notify E_Notify +#define NotifyStr E_NotifyStr +#define Notifyc E_Notifyc +void NotifyFailGetDevDescr(uint8_t reason); +void NotifyFailSetDevTblEntry(uint8_t reason); +void NotifyFailGetConfDescr(uint8_t reason); +void NotifyFailSetConfDescr(uint8_t reason); +void NotifyFailGetDevDescr(); +void NotifyFailSetDevTblEntry(); +void NotifyFailGetConfDescr(); +void NotifyFailSetConfDescr(); +void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID); +void NotifyFail(uint8_t rcode); +#else +#define Notify(...) VOID0 +#define NotifyStr(...) VOID0 +#define Notifyc(...) VOID0 +#define NotifyFailGetDevDescr(...) VOID0 +#define NotifyFailSetDevTblEntry(...) VOID0 +#define NotifyFailGetConfDescr(...) VOID0 +#define NotifyFailGetDevDescr(...) VOID0 +#define NotifyFailSetDevTblEntry(...) VOID0 +#define NotifyFailGetConfDescr(...) VOID0 +#define NotifyFailSetConfDescr(...) VOID0 +#define NotifyFailUnknownDevice(...) VOID0 +#define NotifyFail(...) VOID0 +#endif + +#ifdef DEBUG_USB_HOST +template void ErrorMessage(uint8_t level, char const * msg, ERROR_TYPE rcode = 0) { + Notify(msg, level); + Notify(PSTR(": "), level); + D_PrintHex (rcode, level); + Notify(PSTR("\r\n"), level); +#else +template void ErrorMessage(NOTUSED(uint8_t level), NOTUSED(char const * msg), ERROR_TYPE rcode = 0) { + (void)rcode; +#endif +} + +#ifdef DEBUG_USB_HOST +template void ErrorMessage(char const * msg, ERROR_TYPE rcode = 0) { + Notify(msg, 0x80); + Notify(PSTR(": "), 0x80); + D_PrintHex (rcode, 0x80); + Notify(PSTR("\r\n"), 0x80); +#else +template void ErrorMessage(NOTUSED(char const * msg), ERROR_TYPE rcode = 0) { + (void)rcode; +#endif +} + +#endif // __MESSAGE_H__ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h new file mode 100644 index 000000000000..4b8d387d270f --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h @@ -0,0 +1,200 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#ifndef UHS_PRINTF_HELPER_H +#define UHS_PRINTF_HELPER_H + +#ifdef LOAD_UHS_PRINTF_HELPER +#include +#ifdef true +#undef true +#endif +#ifdef false +#undef false +#endif + +#ifndef STDIO_IS_OK_TO_USE_AS_IS +#if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAM_DUE) || defined(ARDUINO_spresense_ast) +// STDIO patching not required. +#define STDIO_IS_OK_TO_USE_AS_IS +#endif +#endif + +#ifndef STDIO_IS_OK_TO_USE_AS_IS +// We need to patch STDIO so it can be used. + +#ifndef SERIAL_PORT_MONITOR +// Some don't define this. +#define SERIAL_PORT_MONITOR Serial +#endif + +#ifndef SERIAL_PORT_HARDWARE +// Some don't define this. +#define SERIAL_PORT_HARDWARE SERIAL_PORT_MONITOR +#endif + +#ifndef USB_HOST_SERIAL +#if defined(SERIAL_PORT_USBVIRTUAL) && defined(LOAD_UHS_KINETIS_FS_HOST) +#define USB_HOST_SERIAL SERIAL_PORT_HARDWARE +#else +#define USB_HOST_SERIAL SERIAL_PORT_MONITOR +#endif +#endif + +#ifndef NOTUSED +#define NOTUSED(...) __VA_ARGS__ __attribute__((unused)) +#endif + +#ifndef __AVR__ +#ifndef printf_P +#define printf_P(...) printf(__VA_ARGS__) +#endif +#endif + +#ifdef ARDUINO_ARCH_PIC32 +/* + * For printf() output with pic32 Arduino + */ +extern "C" { + + void _mon_putc(char s) { + USB_HOST_SERIAL.write(s); + } + + int _mon_getc() { + while(!USB_HOST_SERIAL.available()); + return USB_HOST_SERIAL.read(); + } +} + +#elif defined(__AVR__) +extern "C" { + + static FILE tty_stdio; + static FILE tty_stderr; + + static int NOTUSED(tty_stderr_putc(char c, NOTUSED(FILE *t))); + static int NOTUSED(tty_stderr_flush(NOTUSED(FILE *t))); + static int NOTUSED(tty_std_putc(char c, NOTUSED(FILE *t))); + static int NOTUSED(tty_std_getc(NOTUSED(FILE *t))); + static int NOTUSED(tty_std_flush(NOTUSED(FILE *t))); + + static int tty_stderr_putc(char c, NOTUSED(FILE *t)) { + USB_HOST_SERIAL.write(c); + return 0; + } + + static int tty_stderr_flush(NOTUSED(FILE *t)) { + USB_HOST_SERIAL.flush(); + return 0; + } + + static int tty_std_putc(char c, NOTUSED(FILE *t)) { + USB_HOST_SERIAL.write(c); + return 0; + } + + static int tty_std_getc(NOTUSED(FILE *t)) { + while(!USB_HOST_SERIAL.available()); + return USB_HOST_SERIAL.read(); + } + + static int tty_std_flush(NOTUSED(FILE *t)) { + USB_HOST_SERIAL.flush(); + return 0; + } +} +#elif defined(CORE_TEENSY) +extern "C" { + + int _write(int fd, const char *ptr, int len) { + int j; + for(j = 0; j < len; j++) { + if(fd == 1) + USB_HOST_SERIAL.write(*ptr++); + else if(fd == 2) + USB_HOST_SERIAL.write(*ptr++); + } + return len; + } + + int _read(int fd, char *ptr, int len) { + if(len > 0 && fd == 0) { + while(!USB_HOST_SERIAL.available()); + *ptr = USB_HOST_SERIAL.read(); + return 1; + } + return 0; + } + +#include + + int _fstat(int fd, struct stat *st) { + memset(st, 0, sizeof (*st)); + st->st_mode = S_IFCHR; + st->st_blksize = 1024; + return 0; + } + + int _isatty(int fd) { + return (fd < 3) ? 1 : 0; + } +} +#else +#error no STDIO +#endif // defined(ARDUINO_ARCH_PIC32) + + + +#ifdef __AVR__ +// The only wierdo in the bunch... +void UHS_AVR_printf_HELPER_init() { + // Set up stdio/stderr + tty_stdio.put = tty_std_putc; + tty_stdio.get = tty_std_getc; + tty_stdio.flags = _FDEV_SETUP_RW; + tty_stdio.udata = 0; + + tty_stderr.put = tty_stderr_putc; + tty_stderr.get = NULL; + tty_stderr.flags = _FDEV_SETUP_WRITE; + tty_stderr.udata = 0; + + stdout = &tty_stdio; + stdin = &tty_stdio; + stderr = &tty_stderr; + +} +#define UHS_printf_HELPER_init() UHS_AVR_printf_HELPER_init() +#endif + +#endif /* STDIO_IS_OK_TO_USE_AS_IS */ +#endif /* load.... */ + +#ifndef UHS_printf_HELPER_init +#define UHS_printf_HELPER_init() (void(0)) +#endif +#endif /* UHS_PRINTF_HELPER_H */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h new file mode 100644 index 000000000000..09e336510771 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h @@ -0,0 +1,96 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#if !defined(_UHS_host_h_) || defined(__PRINTHEX_H__) +#error "Never include UHS_printhex.h directly; include UHS_Usb.h instead" +#else +#define __PRINTHEX_H__ + +void E_Notifyc(char c, int lvl); + +template +void PrintHex(T val, int lvl) { + int num_nibbles = sizeof (T) * 2; + + do { + char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0f); + if(v > 57) v += 7; + E_Notifyc(v, lvl); + } while(--num_nibbles); +} + +template +void PrintBin(T val, int lvl) { + for(T mask = (((T)1) << ((sizeof (T) << 3) - 1)); mask; mask >>= 1) + if(val & mask) + E_Notifyc('1', lvl); + else + E_Notifyc('0', lvl); +} + +template +void SerialPrintHex(T val) { + int num_nibbles = sizeof (T) * 2; + + do { + char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0f); + if(v > 57) v += 7; + USB_HOST_SERIAL.print(v); + } while(--num_nibbles); +} + +template +void PrintHex2(Print *prn, T val) { + T mask = (((T)1) << (((sizeof (T) << 1) - 1) << 2)); + + while(mask > 1) { + if(val < mask) + prn->print("0"); + + mask >>= 4; + } + prn->print((T)val, HEX); +} + +#ifdef DEBUG_USB_HOST +template void D_PrintHex(T val, int lvl) { + PrintHex (val, lvl); +#else +template void D_PrintHex(NOTUSED(T val), NOTUSED(int lvl)) { +#endif +} + +#ifdef DEBUG_USB_HOST +template void D_PrintBin(T val, int lvl) { + PrintBin (val, lvl); +#else +template void D_PrintBin(NOTUSED(T val), NOTUSED(int lvl)) { +#endif +} + + + +#endif // __PRINTHEX_H__ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h new file mode 100644 index 000000000000..a401c2851647 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h @@ -0,0 +1,141 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#ifndef UHS_SETTINGS_H +#define UHS_SETTINGS_H + +// TO-DO: Move specific settings to modules which use them. + +//////////////////////////////////////////////////////////////////////////////// +// Define any of these options at the top of your sketch to override +// the defaults contained herewith. Do NOT do modifications here. +// Individual Components have their own settings. +// +// Macro | Settings and notes | Default +// -----------------------------+-----------------------+----------------------- +// | Any class that does | +// USB_HOST_SERIAL | text streaming | SERIAL_PORT_MONITOR +// | e.g. Serial2 | +// -----------------------------+-----------------------+----------------------- +// ENABLE_UHS_DEBUGGING | 0 = off, 1 = on | 0 +// -----------------------------+-----------------------+----------------------- +// | 0 = off, 1 = on | +// | Caution! Can make | +// DEBUG_PRINTF_EXTRA_HUGE | program too large! | 0 +// | Other modules depend | +// | on this setting. | +// -----------------------------+-----------------------+----------------------- +// USE_UHS_BLACK_WIDDOW | 0 = no, 1 = yes | 0 +// -----------------------------+-----------------------+----------------------- +// ENABLE_WII_IR_CAMERA | 0 = no, 1 = yes | 0 +// -----------------------------^-----------------------^----------------------- +// +//////////////////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////////////////// +// DEBUGGING +//////////////////////////////////////////////////////////////////////////////// + +#ifndef USB_HOST_SERIAL +#if defined(SERIAL_PORT_USBVIRTUAL) && defined(LOAD_UHS_KINETIS_FS_HOST) +#define USB_HOST_SERIAL SERIAL_PORT_HARDWARE +#else +#define USB_HOST_SERIAL SERIAL_PORT_MONITOR +#endif +#endif + +#ifndef ENABLE_UHS_DEBUGGING +#define ENABLE_UHS_DEBUGGING 0 +#endif + +#ifndef DEBUG_PRINTF_EXTRA_HUGE +#define DEBUG_PRINTF_EXTRA_HUGE 0 +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Manual board activation +//////////////////////////////////////////////////////////////////////////////// + +/* Set this to 1 if you are using a Black Widdow */ +#ifndef USE_UHS_BLACK_WIDDOW +#define USE_UHS_BLACK_WIDDOW 0 +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Wii IR camera +//////////////////////////////////////////////////////////////////////////////// + +/* Set this to 1 to activate code for the Wii IR camera */ +#ifndef ENABLE_WII_IR_CAMERA +#define ENABLE_WII_IR_CAMERA 0 +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Set to 1 to use the faster spi4teensy3 driver. (not used yet)) +//////////////////////////////////////////////////////////////////////////////// +#ifndef USE_SPI4TEENSY3 +#define USE_SPI4TEENSY3 0 +#endif + +//////////////////////////////////////////////////////////////////////////////// +// AUTOMATIC Settings +//////////////////////////////////////////////////////////////////////////////// + +// No user serviceable parts below this line. +// DO NOT change anything below here unless you are a developer! + +#if defined(__GNUC__) && defined(__AVR__) +#ifndef GCC_VERSION +#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#endif +#if GCC_VERSION < 40602 // Test for GCC < 4.6.2 +#ifdef PROGMEM +#undef PROGMEM +#define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4 +#ifdef PSTR +#undef PSTR +#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source +#endif +#endif +#endif +#endif + +#if !defined(DEBUG_USB_HOST) && ENABLE_UHS_DEBUGGING +#define DEBUG_USB_HOST +#endif + +#if !defined(WIICAMERA) && ENABLE_WII_IR_CAMERA +#define WIICAMERA +#endif + +#define UHS_SLEEP_MS(v) pUsb->sof_delay(v) + +#ifndef UHS_NI +#define UHS_NI __attribute__((noinline)) +#endif + +#endif /* SETTINGS_H */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h new file mode 100644 index 000000000000..34b8ad72e7ef --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h @@ -0,0 +1,222 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#if !defined(_UHS_host_h_) || defined(_UHS_ch9_h_) +#error "Never include UHS_usb_ch9.h directly; include UHS_Usb.h instead" +#else + +/* USB chapter 9 structures */ +#define _UHS_ch9_h_ + +/* Misc.USB constants */ +#define DEV_DESCR_LEN 18 //device descriptor length +#define CONF_DESCR_LEN 9 //configuration descriptor length +#define INTR_DESCR_LEN 9 //interface descriptor length +#define EP_DESCR_LEN 7 //endpoint descriptor length + +/* Standard Device Requests */ +#define USB_REQUEST_GET_STATUS 0 // Standard Device Request - GET STATUS +#define USB_REQUEST_CLEAR_FEATURE 1 // Standard Device Request - CLEAR FEATURE +#define USB_REQUEST_SET_FEATURE 3 // Standard Device Request - SET FEATURE +#define USB_REQUEST_SET_ADDRESS 5 // Standard Device Request - SET ADDRESS +#define USB_REQUEST_GET_DESCRIPTOR 6 // Standard Device Request - GET DESCRIPTOR +#define USB_REQUEST_SET_DESCRIPTOR 7 // Standard Device Request - SET DESCRIPTOR +#define USB_REQUEST_GET_CONFIGURATION 8 // Standard Device Request - GET CONFIGURATION +#define USB_REQUEST_SET_CONFIGURATION 9 // Standard Device Request - SET CONFIGURATION +#define USB_REQUEST_GET_INTERFACE 10 // Standard Device Request - GET INTERFACE +#define USB_REQUEST_SET_INTERFACE 11 // Standard Device Request - SET INTERFACE +#define USB_REQUEST_SYNCH_FRAME 12 // Standard Device Request - SYNCH FRAME + +/* Wireless USB Device Requests */ +#define USB_REQ_SET_ENCRYPTION 0x0D +#define USB_REQ_GET_ENCRYPTION 0x0E +#define USB_REQ_RPIPE_ABORT 0x0E +#define USB_REQ_SET_HANDSHAKE 0x0F +#define USB_REQ_RPIPE_RESET 0x0F +#define USB_REQ_GET_HANDSHAKE 0x10 +#define USB_REQ_SET_CONNECTION 0x11 +#define USB_REQ_SET_SECURITY_DATA 0x12 +#define USB_REQ_GET_SECURITY_DATA 0x13 +#define USB_REQ_SET_WUSB_DATA 0x14 +#define USB_REQ_LOOPBACK_DATA_WRITE 0x15 +#define USB_REQ_LOOPBACK_DATA_READ 0x16 +#define USB_REQ_SET_INTERFACE_DS 0x17 + +/* USB feature flags */ +#define USB_DEVICE_SELF_POWERED 0 /* (read only) */ +#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ +#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */ +#define USB_DEVICE_BATTERY 2 /* (wireless) */ +#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */ +#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/ +#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */ +#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */ +#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ + +#define USB_FEATURE_ENDPOINT_HALT 0 // CLEAR/SET FEATURE - Endpoint Halt +#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // CLEAR/SET FEATURE - Device remote wake-up +#define USB_FEATURE_TEST_MODE 2 // CLEAR/SET FEATURE - Test mode +/* OTG SET FEATURE Constants */ +#define OTG_FEATURE_B_HNP_ENABLE 3 // SET FEATURE OTG - Enable B device to perform HNP +#define OTG_FEATURE_A_HNP_SUPPORT 4 // SET FEATURE OTG - A device supports HNP +#define OTG_FEATURE_A_ALT_HNP_SUPPORT 5 // SET FEATURE OTG - Another port on the A device supports HNP + +/* Setup Data Constants */ +#define USB_SETUP_HOST_TO_DEVICE 0x00 // Device Request bmRequestType transfer direction - host to device transfer +#define USB_SETUP_DEVICE_TO_HOST 0x80 // Device Request bmRequestType transfer direction - device to host transfer +#define USB_SETUP_TYPE_STANDARD 0x00 // Device Request bmRequestType type - standard +#define USB_SETUP_TYPE_CLASS 0x20 // Device Request bmRequestType type - class +#define USB_SETUP_TYPE_VENDOR 0x40 // Device Request bmRequestType type - vendor +#define USB_SETUP_RECIPIENT_DEVICE 0x00 // Device Request bmRequestType recipient - device +#define USB_SETUP_RECIPIENT_INTERFACE 0x01 // Device Request bmRequestType recipient - interface +#define USB_SETUP_RECIPIENT_ENDPOINT 0x02 // Device Request bmRequestType recipient - endpoint +#define USB_SETUP_RECIPIENT_OTHER 0x03 // Device Request bmRequestType recipient - other +#define USB_SETUP_RECIPIENT_PORT 0x04 // Wireless USB 1.0 +#define USB_SETUP_RECIPIENT_RPIPE 0x05 // Wireless USB 1.0 + + +/* USB descriptors */ +#define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor. +#define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor. +#define USB_DESCRIPTOR_STRING 0x03 // bDescriptorType for a String Descriptor. +#define USB_DESCRIPTOR_INTERFACE 0x04 // bDescriptorType for an Interface Descriptor. +#define USB_DESCRIPTOR_ENDPOINT 0x05 // bDescriptorType for an Endpoint Descriptor. +#define USB_DESCRIPTOR_DEVICE_QUALIFIER 0x06 // bDescriptorType for a Device Qualifier. +#define USB_DESCRIPTOR_OTHER_SPEED 0x07 // bDescriptorType for a Other Speed Configuration. +#define USB_DESCRIPTOR_INTERFACE_POWER 0x08 // bDescriptorType for Interface Power. +#define USB_DESCRIPTOR_OTG 0x09 // bDescriptorType for an OTG Descriptor. +#define USB_DESCRIPTOR_DEBUG 0x0a +#define USB_DESCRIPTOR_INTERFACE_ASSOCIATION 0x0b +#define USB_DESCRIPTOR_SECURITY 0x0c +#define USB_DESCRIPTOR_KEY 0x0d +#define USB_DESCRIPTOR_ENCRYPTION_TYPE 0x0e +#define USB_DESCRIPTOR_BOS 0x0f +#define USB_DESCRIPTOR_DEVICE_CAPABILITY 0x10 +#define USB_DESCRIPTOR_WIRELESS_ENDPOINT_COMP 0x11 +#define USB_DESCRIPTOR_WIRE_ADAPTER 0x21 +#define USB_DESCRIPTOR_RPIPE 0x22 +#define USB_DESCRIPTOR_CS_RADIO_CONTROL 0x23 +#define USB_DESCRIPTOR_SS_ENDPOINT_COMP 0x30 + +#define USB_HID_DESCRIPTOR 0x21 + + +// Conventional codes for class-specific descriptors. "Common Class" Spec (3.11) +#define USB_DESCRIPTOR_CS_DEVICE 0x21 +#define USB_DESCRIPTOR_CS_CONFIG 0x22 +#define USB_DESCRIPTOR_CS_STRING 0x23 +#define USB_DESCRIPTOR_CS_INTERFACE 0x24 +#define USB_DESCRIPTOR_CS_ENDPOINT 0x25 + + + +/* USB Endpoint Transfer Types */ +#define USB_TRANSFER_TYPE_CONTROL 0x00 // Endpoint is a control endpoint. +#define USB_TRANSFER_TYPE_ISOCHRONOUS 0x01 // Endpoint is an isochronous endpoint. +#define USB_TRANSFER_TYPE_BULK 0x02 // Endpoint is a bulk endpoint. +#define USB_TRANSFER_TYPE_INTERRUPT 0x03 // Endpoint is an interrupt endpoint. +#define bmUSB_TRANSFER_TYPE 0x03 // bit mask to separate transfer type from ISO attributes +#define USB_TRANSFER_DIRECTION_IN 0x80 // Indicate direction is IN + +/* Standard Feature Selectors for CLEAR_FEATURE Requests */ +#define USB_FEATURE_ENDPOINT_STALL 0 // Endpoint recipient +#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // Device recipient +#define USB_FEATURE_TEST_MODE 2 // Device recipient + +/* descriptor data structures */ + +/* Device descriptor structure */ +typedef struct { + uint8_t bLength; // Length of this descriptor. + uint8_t bDescriptorType; // DEVICE descriptor type (USB_DESCRIPTOR_DEVICE). + uint16_t bcdUSB; // USB Spec Release Number (BCD). + uint8_t bDeviceClass; // Class code (assigned by the USB-IF). 0xFF-Vendor specific. + uint8_t bDeviceSubClass; // Subclass code (assigned by the USB-IF). + uint8_t bDeviceProtocol; // Protocol code (assigned by the USB-IF). 0xFF-Vendor specific. + uint8_t bMaxPacketSize0; // Maximum packet size for endpoint 0. + uint16_t idVendor; // Vendor ID (assigned by the USB-IF). + uint16_t idProduct; // Product ID (assigned by the manufacturer). + uint16_t bcdDevice; // Device release number (BCD). + uint8_t iManufacturer; // Index of String Descriptor describing the manufacturer. + uint8_t iProduct; // Index of String Descriptor describing the product. + uint8_t iSerialNumber; // Index of String Descriptor with the device's serial number. + uint8_t bNumConfigurations; // Number of possible configurations. +} __attribute__((packed)) USB_DEVICE_DESCRIPTOR; + +/* Configuration descriptor structure */ +typedef struct { + uint8_t bLength; // Length of this descriptor. + uint8_t bDescriptorType; // CONFIGURATION descriptor type (USB_DESCRIPTOR_CONFIGURATION). + uint16_t wTotalLength; // Total length of all descriptors for this configuration. + uint8_t bNumInterfaces; // Number of interfaces in this configuration. + uint8_t bConfigurationValue; // Value of this configuration (1 based). + uint8_t iConfiguration; // Index of String Descriptor describing the configuration. + uint8_t bmAttributes; // Configuration characteristics. + uint8_t bMaxPower; // Maximum power consumed by this configuration. +} __attribute__((packed)) USB_CONFIGURATION_DESCRIPTOR; + +/* Interface descriptor structure */ +typedef struct { + uint8_t bLength; // Length of this descriptor. + uint8_t bDescriptorType; // INTERFACE descriptor type (USB_DESCRIPTOR_INTERFACE). + uint8_t bInterfaceNumber; // Number of this interface (0 based). + uint8_t bAlternateSetting; // Value of this alternate interface setting. + uint8_t bNumEndpoints; // Number of endpoints in this interface. + uint8_t bInterfaceClass; // Class code (assigned by the USB-IF). 0xFF-Vendor specific. + uint8_t bInterfaceSubClass; // Subclass code (assigned by the USB-IF). + uint8_t bInterfaceProtocol; // Protocol code (assigned by the USB-IF). 0xFF-Vendor specific. + uint8_t iInterface; // Index of String Descriptor describing the interface. +} __attribute__((packed)) USB_INTERFACE_DESCRIPTOR; + +/* Endpoint descriptor structure */ +typedef struct { + uint8_t bLength; // Length of this descriptor. + uint8_t bDescriptorType; // ENDPOINT descriptor type (USB_DESCRIPTOR_ENDPOINT). + uint8_t bEndpointAddress; // Endpoint address. Bit 7 indicates direction (0=OUT, 1=IN). + uint8_t bmAttributes; // Endpoint transfer type. + uint16_t wMaxPacketSize; // Maximum packet size. + uint8_t bInterval; // Polling interval in frames. +} __attribute__((packed)) USB_ENDPOINT_DESCRIPTOR; + +/* HID descriptor */ +/* +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t bcdHID; // HID class specification release + uint8_t bCountryCode; + uint8_t bNumDescriptors; // Number of additional class specific descriptors + uint8_t bDescrType; // Type of class descriptor + uint16_t wDescriptorLength; // Total size of the Report descriptor +} __attribute__((packed)) USB_HID_DESCRIPTOR; +*/ + +typedef struct { + uint8_t bDescrType; // Type of class descriptor + uint16_t wDescriptorLength; // Total size of the Report descriptor +} __attribute__((packed)) HID_CLASS_DESCRIPTOR_LEN_AND_TYPE; + +#endif // _ch9_h_ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h new file mode 100644 index 000000000000..9a6b110a156b --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h @@ -0,0 +1,452 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#ifndef _UHS_host_h_ +#error "Never include UHS_usbhost.h directly; include UHS_host.h instead" +#else +#ifndef _USBHOST_H_ +#define _USBHOST_H_ + +// Very early prototypes +#ifdef UHS_LOAD_BT +void UHS_BT_SetUSBInterface(UHS_USB_HOST_BASE *host, ENUMERATION_INFO *ei); +void UHS_BT_ScanUninitialized(UHS_USB_HOST_BASE *host); +void UHS_BT_Poll(UHS_USB_HOST_BASE *host); +#endif +#ifdef UHS_LOAD_HID +void UHS_HID_SetUSBInterface(UHS_USB_HOST_BASE *host, ENUMERATION_INFO *ei); +void UHS_HID_ScanUninitialized(UHS_USB_HOST_BASE *host); +void UHS_HID_Poll(UHS_USB_HOST_BASE *host); +#endif + +//#if defined(LOAD_UHS_CDC_ACM) || defined(LOAD_UHS_CDC_ACM_FTDI) || defined(LOAD_UHS_CDC_ACM_PROLIFIC) || defined(LOAD_UHS_CDC_ACM_XR21B1411) +//void UHS_CDC_ACM_SetUSBInterface(UHS_USB_HOST_BASE *host, ENUMERATION_INFO *ei); +//void UHS_CDC_ACM_ScanUninitialized(UHS_USB_HOST_BASE *host); +//void UHS_CDC_ACM_Poll(UHS_USB_HOST_BASE *host); +//#endif + +class UHS_USBInterface; // forward class declaration + +// enumerator to turn the VBUS on/off + +typedef enum { + vbus_on = 0, + vbus_off = 1 +} VBUS_t; + +// All host SEI use this base class + +class UHS_USB_HOST_BASE { +public: + AddressPool addrPool; + UHS_USBInterface* devConfig[UHS_HOST_MAX_INTERFACE_DRIVERS]; + volatile uint8_t usb_error; + volatile uint8_t usb_task_state; + volatile uint8_t usb_task_polling_disabled; + volatile uint8_t usb_host_speed; + volatile uint8_t hub_present; + + UHS_USB_HOST_BASE() { + for(uint16_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { + devConfig[i] = NULL; + } + usb_task_polling_disabled = 0; + usb_task_state = UHS_USB_HOST_STATE_INITIALIZE; //set up state machine + usb_host_speed = 0; + usb_error = 0; + }; + + ///////////////////////////////////////////// + // + // Virtual methods that interface to the SIE + // Overriding each is mandatory. + // + ///////////////////////////////////////////// + + /** + * Delay for x milliseconds + * Override if your controller provides an SOF IRQ, which may involve + * some sort of reentrant ISR or workaround with interrupts enabled. + * + * @param x how many milliseconds to delay + * @return true if delay completed without a state change, false if delay aborted + */ + virtual bool UHS_NI sof_delay(uint16_t x) { + if(!(usb_task_state & UHS_USB_HOST_STATE_MASK)) return false; + uint8_t current_state = usb_task_state; + while(current_state == usb_task_state && x--) { + delay(1); + } + return (current_state == usb_task_state); + }; + + virtual UHS_EpInfo * UHS_NI ctrlReqOpen(NOTUSED(uint8_t addr), NOTUSED(uint64_t Request), NOTUSED(uint8_t* dataptr)) { + return NULL; + }; + + virtual void UHS_NI vbusPower(NOTUSED(VBUS_t state)) { + }; + + virtual void UHS_NI Task() { + }; + + virtual uint8_t UHS_NI SetAddress(NOTUSED(uint8_t addr), NOTUSED(uint8_t ep), NOTUSED(UHS_EpInfo **ppep), NOTUSED(uint16_t &nak_limit)) { + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + virtual uint8_t UHS_NI OutTransfer(NOTUSED(UHS_EpInfo *pep), NOTUSED(uint16_t nak_limit), NOTUSED(uint16_t nbytes), NOTUSED(uint8_t *data)) { + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + virtual uint8_t UHS_NI InTransfer(NOTUSED(UHS_EpInfo *pep), NOTUSED(uint16_t nak_limit), NOTUSED(uint16_t *nbytesptr), NOTUSED(uint8_t *data)) { + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + virtual uint8_t UHS_NI ctrlReqClose(NOTUSED(UHS_EpInfo *pep), NOTUSED(uint8_t bmReqType), NOTUSED(uint16_t left), NOTUSED(uint16_t nbytes), NOTUSED(uint8_t *dataptr)) { + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + virtual uint8_t UHS_NI ctrlReqRead(NOTUSED(UHS_EpInfo *pep), NOTUSED(uint16_t *left), NOTUSED(uint16_t *read), NOTUSED(uint16_t nbytes), NOTUSED(uint8_t *dataptr)) { + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + virtual uint8_t UHS_NI dispatchPkt(NOTUSED(uint8_t token), NOTUSED(uint8_t ep), NOTUSED(uint16_t nak_limit)) { + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + virtual uint8_t UHS_NI init() { + return 0; + }; + + virtual void UHS_NI doHostReset() { + }; + + virtual int16_t UHS_NI Init(NOTUSED(int16_t mseconds)) { + return -1; + }; + + virtual int16_t UHS_NI Init() { + return Init(INT16_MIN); + }; + + virtual uint8_t hwlPowerUp() { + /* This is for machine specific support to enable/power up the USB HW to operate*/ + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + virtual uint8_t hwPowerDown() { + /* This is for machine specific support to disable/powerdown the USB Hw */ + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + virtual bool IsHub(uint8_t klass) { + return (klass == UHS_USB_CLASS_HUB); + }; + + virtual void UHS_NI suspend_host() { + // Used on MCU that lack control of IRQ priority (AVR). + // Suspends ISRs, for critical code. IRQ will be serviced after it is resumed. + // NOTE: you must track the state yourself! + }; + + virtual void UHS_NI resume_host() { + // Used on MCU that lack control of IRQ priority (AVR). + // Resumes ISRs. + // NOTE: you must track the state yourself! + }; + + ///////////////////////////////////////////// + // + // Built-ins, No need to override + // + ///////////////////////////////////////////// + // these two probably will go away, and won't be used, TBD + inline void Poll_Others() { +#ifdef UHS_LOAD_BT + UHS_BT_Poll(this); +#endif +#ifdef UHS_LOAD_HID + UHS_HID_Poll(this); +#endif + } + + inline void DisablePoll() { + noInterrupts(); + usb_task_polling_disabled++; + DDSB(); + interrupts(); + } + + inline void EnablePoll() { + noInterrupts(); + usb_task_polling_disabled--; + DDSB(); + interrupts(); + } + + uint8_t UHS_NI seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd); + + uint8_t UHS_NI setEpInfoEntry(uint8_t addr, uint8_t iface, uint8_t epcount, volatile UHS_EpInfo* eprecord_ptr); + + uint8_t UHS_NI EPClearHalt(uint8_t addr, uint8_t ep); + + uint8_t UHS_NI ctrlReq(uint8_t addr, uint64_t Request, uint16_t nbytes, uint8_t* dataptr); + + uint8_t UHS_NI getDevDescr(uint8_t addr, uint16_t nbytes, uint8_t* dataptr); + + uint8_t UHS_NI getConfDescr(uint8_t addr, uint16_t nbytes, uint8_t conf, uint8_t* dataptr); + + uint8_t UHS_NI setAddr(uint8_t oldaddr, uint8_t newaddr); + + uint8_t UHS_NI setConf(uint8_t addr, uint8_t conf_value); + + uint8_t UHS_NI getStrDescr(uint8_t addr, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr); + + void UHS_NI ReleaseDevice(uint8_t addr); + + uint8_t UHS_NI Configuring(uint8_t parent, uint8_t port, uint8_t speed); + + void UHS_NI DeviceDefaults(uint8_t maxep, UHS_USBInterface *device); + + UHS_EpInfo* UHS_NI getEpInfoEntry(uint8_t addr, uint8_t ep); + + inline uint8_t getUsbTaskState() { + return ( usb_task_state); + }; + + inline AddressPool* GetAddressPool() { + return &addrPool; + }; + + int UHS_NI RegisterDeviceClass(UHS_USBInterface *pdev) { + for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { + if(!devConfig[i]) { + devConfig[i] = pdev; + return i; + } + } + //return UHS_HOST_ERROR_CANT_REGISTER_DEVICE_CLASS; + return -1; + }; +#if 0 + + inline void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) { + addrPool.ForEachUsbDevice(pfunc); + }; +#endif + + uint8_t TestInterface(ENUMERATION_INFO *ei); + uint8_t enumerateInterface(ENUMERATION_INFO *ei); + uint8_t getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pep, uint8_t data[], uint16_t *left, uint16_t *read, uint8_t *offset); + uint8_t initDescrStream(ENUMERATION_INFO *ei, USB_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset); + uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data); + uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data); + uint8_t doSoftReset(uint8_t parent, uint8_t port, uint8_t address); + uint8_t getone(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset); + uint8_t eat(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint8_t *dataptr, uint8_t *offset, uint16_t *yum); + +}; + +// All device interface drivers use this subclass + +class UHS_USBInterface { +public: + + UHS_USB_HOST_BASE *pUsb; // Parent USB host + volatile uint8_t bNumEP; // total number of EP in this interface + volatile UHS_EpInfo epInfo[16]; // This is a stub, override in the driver. + + volatile uint8_t bAddress; // address of the device + volatile uint8_t bConfNum; // configuration number + volatile uint8_t bIface; // interface value + volatile bool bPollEnable; // poll enable flag, operating status + volatile uint32_t qNextPollTime; // next poll time + + /** + * Resets interface driver to unused state. You should override this in + * your driver if it requires extra class variable cleanup. + */ + virtual void DriverDefaults() { + printf("Default driver defaults.\r\n"); + pUsb->DeviceDefaults(bNumEP, this); + }; + + /** + * Checks if this interface is supported. + * Executed called when new devices are connected. + * + * @param ei + * @return true if the interface is supported + */ + virtual bool OKtoEnumerate(NOTUSED(ENUMERATION_INFO *ei)) { + return false; + }; + + /** + * Configures any needed endpoint information for an interface. + * You must provide this in your driver. + * Executed when new devices are connected and OKtoEnumerate() + * returned true. + * + * @param ei + * @return zero on success + */ + virtual uint8_t SetInterface(NOTUSED(ENUMERATION_INFO *ei)) { + return UHS_HOST_ERROR_NOT_IMPLEMENTED; + }; + + /** + * Interface specific additional setup and enumeration that + * can't occur when the descriptor stream is open. + * Also used for collection of unclaimed interfaces, to link to the master. + * + * @return zero on success + */ + virtual uint8_t Finalize() { + return 0; + }; + + /** + * Executed after interface is finalized but, before polling has started. + * + * @return 0 on success + */ + virtual uint8_t OnStart() { + return 0; + }; + + /** + * Start interface polling + * @return + */ + virtual uint8_t Start() { + uint8_t rcode = OnStart(); + if(!rcode) bPollEnable = true; + return rcode; + }; + + /** + * Executed before anything else in Release(). + * + */ + virtual void OnRelease() { + return; + }; + + /** + * Release resources when device is disconnected. + * Normally this does not need to be overridden. + */ + virtual void Release() { + OnRelease(); + DriverDefaults(); + return; + }; + + /** + * Executed After driver polls. + * Can be used when there is an important change detected during polling + * and you want to handle it elsewhere. + * Examples: + * Media status change for bulk, e.g. ready, not-ready, media changed, door opened. + * Button state/joystick position/etc changes on a HID device. + * Flow control status change on a communication device, e.g. CTS on serial + */ + virtual void OnPoll() { + return; + }; + + /** + * Poll interface driver. You should override this in your driver if you + * require polling faster or slower than every 100 milliseconds, or your + * driver requires special housekeeping. + */ + virtual void Poll() { + OnPoll(); + qNextPollTime = millis() + 100; + }; + + virtual bool UHS_NI Polling() { + return bPollEnable; + } + + /** + * This is only for a hub. + * @param port + */ + virtual void ResetHubPort(NOTUSED(uint8_t port)) { + return; + }; + +#if 0 + /** + * + * @return true if this interface is Vendor Specific. + */ + virtual bool IsVSI() { + return false; + } +#endif +}; + +#if 0 +/** + * + * Vendor Specific interface class. + * This is used by a partner interface. + * It can also be used to force-enumerate an interface that + * can use this interface directly. + * You can also add an instance of this class within the interface constructor + * if you expect the interface. + * + * If this is not needed, it may be removed. Nothing I have written needs this. + * Let me know if it is not required, then IsVSI method can also be shit-canned. + * -- AJK + */ + +class UHS_VSI : public UHS_USBInterface { +public: + volatile UHS_EpInfo epInfo[1]; + volatile ENUMERATION_INFO eInfo; + UHS_VSI(UHS_USB_HOST_BASE *p); + bool OKtoEnumerate(ENUMERATION_INFO *ei); + uint8_t SetInterface(ENUMERATION_INFO *ei); + virtual void DriverDefaults(); + virtual void Release(); + + uint8_t GetAddress() { + return bAddress; + }; + + virtual bool IsVSI() { + return true; + } + +}; +#endif + +#endif //_USBHOST_H_ +#endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h new file mode 100644 index 000000000000..4f53443fb0db --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h @@ -0,0 +1,129 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +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 2 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, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#if defined(LOAD_USB_HOST_SYSTEM) && !defined(USB_HOST_SYSTEM_UTIL_LOADED) +#define USB_HOST_SYSTEM_UTIL_LOADED + +// 0x80 is the default (i.e. trace) to turn off set this global to something lower. +// this allows for 126 other debugging levels. +// TO-DO: Allow assignment to a different serial port by software +int UsbDEBUGlvl = 0x80; + +void E_Notifyc(char c, int lvl) { + if(UsbDEBUGlvl < lvl) return; +#if defined(ARDUINO) && ARDUINO >=100 + USB_HOST_SERIAL.print(c); +#else + USB_HOST_SERIAL.print(c, BYTE); +#endif + //USB_HOST_SERIAL.flush(); +} + +void E_Notify(char const * msg, int lvl) { + if(UsbDEBUGlvl < lvl) return; + if(!msg) return; + char c; + + while((c = pgm_read_byte(msg++))) E_Notifyc(c, lvl); +} + +void E_NotifyStr(char const * msg, int lvl) { + if(UsbDEBUGlvl < lvl) return; + if(!msg) return; + char c; + + while((c = *msg++)) E_Notifyc(c, lvl); +} + +void E_Notify(uint8_t b, int lvl) { + if(UsbDEBUGlvl < lvl) return; +#if defined(ARDUINO) && ARDUINO >=100 + USB_HOST_SERIAL.print(b); +#else + USB_HOST_SERIAL.print(b, DEC); +#endif +} + +void E_Notify(double d, int lvl) { + if(UsbDEBUGlvl < lvl) return; + USB_HOST_SERIAL.print(d); +} + +#ifdef DEBUG_USB_HOST + +void NotifyFailGetDevDescr() { + Notify(PSTR("\r\ngetDevDescr "), 0x80); +} + +void NotifyFailSetDevTblEntry() { + Notify(PSTR("\r\nsetDevTblEn "), 0x80); +} + +void NotifyFailGetConfDescr() { + Notify(PSTR("\r\ngetConf "), 0x80); +} + +void NotifyFailSetConfDescr() { + Notify(PSTR("\r\nsetConf "), 0x80); +} + +void NotifyFailGetDevDescr(uint8_t reason) { + NotifyFailGetDevDescr(); + NotifyFail(reason); +} + +void NotifyFailSetDevTblEntry(uint8_t reason) { + NotifyFailSetDevTblEntry(); + NotifyFail(reason); + +} + +void NotifyFailGetConfDescr(uint8_t reason) { + NotifyFailGetConfDescr(); + NotifyFail(reason); +} + +void NotifyFailSetConfDescr(uint8_t reason) { + NotifyFailSetConfDescr(); + NotifyFail(reason); +} + +void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID) { + Notify(PSTR("\r\nUnknown Device Connected - VID: "), 0x80); + D_PrintHex (VID, 0x80); + Notify(PSTR(" PID: "), 0x80); + D_PrintHex (PID, 0x80); +} + +void NotifyFail(uint8_t rcode) { + D_PrintHex (rcode, 0x80); + Notify(PSTR("\r\n"), 0x80); +} +#endif + +#else +#error "Never include UHS_util_INLINE.h, include UHS_host.h instead" +#endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h new file mode 100644 index 000000000000..f42a806d7038 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h @@ -0,0 +1,226 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +This software may be distributed and modified under the terms of the GNU +General Public License version 2 (GPL2) as published by the Free Software +Foundation and appearing in the file GPL2.TXT included in the packaging of +this file. Please note that GPL2 Section 2[b] requires that all works based +on this software must also be made publicly available under the terms of +the GPL2 ("Copyleft"). + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ +#if !defined(USB_HOST_SHIELD_H) || defined(_max3421e_h_) +#error "Never include UHS_max3421e.h directly; include USB_HOST_SHIELD.h instead" +#else + +#define _max3421e_h_ + +/* MAX3421E register/bit names and bitmasks */ + +#define SE0 0 +#define SE1 1 +#define FSHOST 2 +#define LSHOST 3 + +/* MAX3421E command byte format: rrrrr0wa where 'r' is register number */ + +// +// MAX3421E Registers in HOST mode. +// +#define rRCVFIFO 0x08 // Receive FIFO Register +#define rSNDFIFO 0x10 // Send FIFO Register +#define rSUDFIFO 0x20 // Set Up Data FIFO Register +#define rRCVBC 0x30 // Receive FIFO Byte Count Register +#define rSNDBC 0x38 // Send FIFO Byte Count Register + +// USB Interrupt Request Status (USBIRQ) +#define rUSBIRQ 0x68 // USB Interrupt Request Register +#define bmVBUSIRQ 0x40 // Vbus Present Interrupt Request +#define bmNOVBUSIRQ 0x20 // Vbus Absent Interrupt Request +#define bmOSCOKIRQ 0x01 // Oscillator OK Interrupt Request + +// USB Interrupt Request Control (USBIEN) +#define rUSBIEN 0x70 // USB Interrupt Request Enable Register +#define bmVBUSIE bmVBUSIRQ // Vbus Present Interrupt Request Enable +#define bmNOVBUSIE bmNOVBUSIRQ // Vbus Absent Interrupt Request Enable +#define bmOSCOKIE bmOSCOKIRQ // Oscillator OK Interrupt Request Enable + +// (USBCTL) +#define rUSBCTL 0x78 //15<<3 +#define bmCHIPRES 0x20 //b5 +#define bmPWRDOWN 0x10 //b4 + +// (CPUCTL) +#define rCPUCTL 0x80 //16<<3 +#define bmPUSLEWID1 0x80 //b7 +#define bmPULSEWID0 0x40 //b6 +#define bmIE 0x01 //b0 + +// bmPUSLEWID1 bmPULSEWID0 Pulse width +// 0 0 10.6uS +// 0 1 5.3uS +// 1 0 2.6uS +// 1 1 1.3uS +#define PUSLEWIDTH10_6 (0) +#define PUSLEWIDTH5_3 (bmPULSEWID0) +#define PUSLEWIDTH2_6 (bmPUSLEWID1) +#define PUSLEWIDTH1_3 (bmPULSEWID0 | bmPUSLEWID1) + +// (PINCTL) +#define rPINCTL 0x88 //17<<3 +#define bmFDUPSPI 0x10 //b4 +#define bmINTLEVEL 0x08 //b3 +#define bmPOSINT 0x04 //b2 +#define bmGPXB 0x02 //b1 +#define bmGPXA 0x01 //b0 + +// GPX pin selections +#define GPX_OPERATE 0x00 // +#define GPX_VBDET 0x01 // +#define GPX_BUSACT 0x02 // +#define GPX_SOF 0x03 // + +#define rREVISION 0x90 //18<<3 + +// (IOPINS1) +#define rIOPINS1 0xa0 //20<<3 +#define bmGPOUT0 0x01 // +#define bmGPOUT1 0x02 // +#define bmGPOUT2 0x04 // +#define bmGPOUT3 0x08 // +#define bmGPIN0 0x10 // +#define bmGPIN1 0x20 // +#define bmGPIN2 0x40 // +#define bmGPIN3 0x80 // + +// (IOPINS2) +#define rIOPINS2 0xa8 //21<<3 +#define bmGPOUT4 0x01 // +#define bmGPOUT5 0x02 // +#define bmGPOUT6 0x04 // +#define bmGPOUT7 0x08 // +#define bmGPIN4 0x10 // +#define bmGPIN5 0x20 // +#define bmGPIN6 0x40 // +#define bmGPIN7 0x80 // + +// (GPINIRQ) +#define rGPINIRQ 0xb0 //22<<3 +#define bmGPINIRQ0 0x01 // +#define bmGPINIRQ1 0x02 // +#define bmGPINIRQ2 0x04 // +#define bmGPINIRQ3 0x08 // +#define bmGPINIRQ4 0x10 // +#define bmGPINIRQ5 0x20 // +#define bmGPINIRQ6 0x40 // +#define bmGPINIRQ7 0x80 // + +// (GPINIEN) +#define rGPINIEN 0xb8 //23<<3 +#define bmGPINIEN0 0x01 // +#define bmGPINIEN1 0x02 // +#define bmGPINIEN2 0x04 // +#define bmGPINIEN3 0x08 // +#define bmGPINIEN4 0x10 // +#define bmGPINIEN5 0x20 // +#define bmGPINIEN6 0x40 // +#define bmGPINIEN7 0x80 // + +// (GPINPOL) +#define rGPINPOL 0xc0 //24<<3 +#define bmGPINPOL0 0x01 // +#define bmGPINPOL1 0x02 // +#define bmGPINPOL2 0x04 // +#define bmGPINPOL3 0x08 // +#define bmGPINPOL4 0x10 // +#define bmGPINPOL5 0x20 // +#define bmGPINPOL6 0x40 // +#define bmGPINPOL7 0x80 // + +// +// If any data transfer errors occur, the HXFRDNIRQ asserts, while the RCVDAVIRQ does not. +// +// The CPU clears the SNDBAVIRQ by writing the SNDBC register. +// The CPU should never directly clear the SNDBAVIRQ bit. + +// Host Interrupt Request Status (HIRQ) +#define rHIRQ 0xc8 // Host Interrupt Request Register +#define bmBUSEVENTIRQ 0x01 // BUS Reset Done or BUS Resume Interrupt Request +#define bmRWUIRQ 0x02 // Remote Wakeup Interrupt Request +#define bmRCVDAVIRQ 0x04 // Receive FIFO Data Available Interrupt Request +#define bmSNDBAVIRQ 0x08 // Send Buffer Available Interrupt Request +#define bmSUSDNIRQ 0x10 // Suspend operation Done Interrupt Request +#define bmCONDETIRQ 0x20 // Peripheral Connect/Disconnect Interrupt Request +#define bmFRAMEIRQ 0x40 // Frame Generator Interrupt Request +#define bmHXFRDNIRQ 0x80 // Host Transfer Done Interrupt Request + +// IRQs that are OK for the CPU to clear +#define ICLRALLBITS (bmBUSEVENTIRQ | bmRWUIRQ | bmRCVDAVIRQ | bmSUSDNIRQ | bmCONDETIRQ | bmFRAMEIRQ | bmHXFRDNIRQ) + +// Host Interrupt Request Control (HIEN) +#define rHIEN 0xd0 // +#define bmBUSEVENTIE bmBUSEVENTIRQ // BUS Reset Done or BUS Resume Interrupt Request Enable +#define bmRWUIE bmRWUIRQ // Remote Wakeup Interrupt Request Enable +#define bmRCVDAVIE bmRCVDAVIRQ // Receive FIFO Data Available Interrupt Request Enable +#define bmSNDBAVIE bmSNDBAVIRQ // Send Buffer Available Interrupt Request Enable +#define bmSUSDNIE bmSUSDNIRQ // Suspend operation Done Interrupt Request Enable +#define bmCONDETIE bmCONDETIRQ // Peripheral Connect/Disconnect Interrupt Request Enable +#define bmFRAMEIE bmFRAMEIRQ // Frame Generator Interrupt Request Enable +#define bmHXFRDNIE bmHXFRDNIRQ // Host Transfer Done Interrupt Request Enable + +// (MODE)) +#define rMODE 0xd8 //27<<3 +#define bmHOST 0x01 // +#define bmLOWSPEED 0x02 // +#define bmHUBPRE 0x04 // +#define bmSOFKAENAB 0x08 // +#define bmSEPIRQ 0x10 // +#define bmDELAYISO 0x20 // +#define bmDMPULLDN 0x40 // +#define bmDPPULLDN 0x80 // + +#define rPERADDR 0xe0 //28<<3 + +// (HCTL) +#define rHCTL 0xe8 //29<<3 +#define bmBUSRST 0x01 // +#define bmFRMRST 0x02 // +#define bmSAMPLEBUS 0x04 // +#define bmSIGRSM 0x08 // +#define bmRCVTOG0 0x10 // +#define bmRCVTOG1 0x20 // +#define bmSNDTOG0 0x40 // +#define bmSNDTOG1 0x80 // + +// Host transfer (HXFR) +#define rHXFR 0xf0 //30<<3 +/* Host transfer token values for writing the HXFR register (R30) */ +/* OR this bit field with the endpoint number in bits 3:0 */ +#define MAX3421E_tokSETUP 0x10 // HS=0, ISO=0, OUTNIN=0, SETUP=1 +#define MAX3421E_tokIN 0x00 // HS=0, ISO=0, OUTNIN=0, SETUP=0 +#define MAX3421E_tokOUT 0x20 // HS=0, ISO=0, OUTNIN=1, SETUP=0 +#define MAX3421E_tokINHS 0x80 // HS=1, ISO=0, OUTNIN=0, SETUP=0 +#define MAX3421E_tokOUTHS 0xA0 // HS=1, ISO=0, OUTNIN=1, SETUP=0 +#define MAX3421E_tokISOIN 0x40 // HS=0, ISO=1, OUTNIN=0, SETUP=0 +#define MAX3421E_tokISOOUT 0x60 // HS=0, ISO=1, OUTNIN=1, SETUP=0 + +// (HRSL) +#define rHRSL 0xf8 //31<<3 +#define bmRCVTOGRD 0x10 // +#define bmSNDTOGRD 0x20 // +#define bmKSTATUS 0x40 // +#define bmJSTATUS 0x80 // +#define bmSE0 0x00 //SE0 - disconnect state +#define bmSE1 0xc0 //SE1 - illegal state + +#define MODE_FS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmSOFKAENAB) +#define MODE_LS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmLOWSPEED|bmSOFKAENAB) + +#endif //_max3421e_h_ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h new file mode 100644 index 000000000000..f0cdae2b6bab --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h @@ -0,0 +1,519 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +This software may be distributed and modified under the terms of the GNU +General Public License version 2 (GPL2) as published by the Free Software +Foundation and appearing in the file GPL2.TXT included in the packaging of +this file. Please note that GPL2 Section 2[b] requires that all works based +on this software must also be made publicly available under the terms of +the GPL2 ("Copyleft"). + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#ifndef USB_HOST_SHIELD_H +#define USB_HOST_SHIELD_H + +// uncomment to get 'printf' console debugging. NOT FOR UNO! +//#define DEBUG_PRINTF_EXTRA_HUGE_USB_HOST_SHIELD + +#ifdef LOAD_USB_HOST_SHIELD +#include "UHS_max3421e.h" +#include + + +#ifndef SPI_HAS_TRANSACTION +#error "Your SPI library installation is too old." +#else +#ifndef SPI_ATOMIC_VERSION +#warning "Your SPI library installation lacks 'SPI_ATOMIC_VERSION'. Please complain to the maintainer." +#elif SPI_ATOMIC_VERSION < 1 +#error "Your SPI library installation is too old." +#endif + +#endif +#if DEBUG_PRINTF_EXTRA_HUGE +#ifdef DEBUG_PRINTF_EXTRA_HUGE_USB_HOST_SHIELD +#define MAX_HOST_DEBUG(...) printf_P(__VA_ARGS__) +#else +#define MAX_HOST_DEBUG(...) VOID0 +#endif +#else +#define MAX_HOST_DEBUG(...) VOID0 +#endif + +#ifndef USB_HOST_SHIELD_USE_ISR +#ifdef USE_MULTIPLE_APP_API +#define USB_HOST_SHIELD_USE_ISR 0 +#else +#define USB_HOST_SHIELD_USE_ISR 1 +#endif +#else +#define USB_HOST_SHIELD_USE_ISR 1 +#endif + + + +#if !USB_HOST_SHIELD_USE_ISR +#error NOISR Polled mode _NOT SUPPORTED YET_ + +// +// Polled defaults +// +#ifdef BOARD_BLACK_WIDDOW +#define UHS_MAX3421E_SS_ 6 +#define UHS_MAX3421E_INT_ 3 +#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) +#if EXT_RAM +// Teensy++ 2.0 with XMEM2 +#define UHS_MAX3421E_SS_ 20 +#define UHS_MAX3421E_INT_ 7 +#else +#define UHS_MAX3421E_SS_ 9 +#define UHS_MAX3421E_INT_ 8 +#endif +#define UHS_MAX3421E_SPD +#elif defined(ARDUINO_AVR_ADK) +#define UHS_MAX3421E_SS_ 53 +#define UHS_MAX3421E_INT_ 54 +#elif defined(ARDUINO_AVR_BALANDUINO) +#define UHS_MAX3421E_SS_ 20 +#define UHS_MAX3421E_INT_ 19 +#else +#define UHS_MAX3421E_SS_ 10 +#define UHS_MAX3421E_INT_ 9 +#endif + +#else +#ifdef ARDUINO_ARCH_PIC32 +// PIC32 only allows edge interrupts, isn't that lovely? We'll emulate it... +#if CHANGE < 2 +#error core too old. +#endif + +#define IRQ_IS_EDGE 0 +#ifndef digitalPinToInterrupt +// great, this isn't implemented. +#warning digitalPinToInterrupt is not defined, complain here https://github.com/chipKIT32/chipKIT-core/issues/114 +#if defined(_BOARD_UNO_) || defined(_BOARD_UC32_) +#define digitalPinToInterrupt(p) ((p) == 2 ? 1 : ((p) == 7 ? 2 : ((p) == 8 ? 3 : ((p) == 35 ? 4 : ((p) == 38 ? 0 : NOT_AN_INTERRUPT))))) +#warning digitalPinToInterrupt is now defined until this is taken care of. +#else +#error digitalPinToInterrupt not defined for your board, complain here https://github.com/chipKIT32/chipKIT-core/issues/114 +#endif +#endif +#else +#define IRQ_IS_EDGE 0 +#endif + +// More stupidity from our friends @ Sony... +#ifdef ARDUINO_spresense_ast +#ifndef NOT_AN_INTERRUPT +#define NOT_AN_INTERRUPT -1 +#endif +#endif + +// SAMD uses an enum for this instead of a define. Isn't that just dandy? +#if !defined(NOT_AN_INTERRUPT) && !defined(ARDUINO_ARCH_SAMD) +#warning NOT_AN_INTERRUPT not defined, possible problems ahead. +#warning If NOT_AN_INTERRUPT is an enum or something else, complain to UHS30 developers on github. +#warning Otherwise complain to your board core developer/maintainer. +#define NOT_AN_INTERRUPT -1 +#endif + +// +// Interrupt defaults. Int0 or Int1 +// +#ifdef BOARD_BLACK_WIDDOW +#error "HELP! Please send us an email, I don't know the values for Int0 and Int1 on the Black Widow board!" +#elif defined(ARDUINO_AVR_ADK) +#define UHS_MAX3421E_SS_ 53 +#define UHS_MAX3421E_INT_ 54 +#elif defined(ARDUINO_spresense_ast) +#define UHS_MAX3421E_SS_ 21 +#define UHS_MAX3421E_INT_ 20 +#define SPIclass SPI5 +//#define UHS_MAX3421E_SPD 100000 +#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) + +// TO-DO! + +#if EXT_RAM +// Teensy++ 2.0 with XMEM2 +#define UHS_MAX3421E_SS_ 20 +#define UHS_MAX3421E_INT_ 7 +#else +#define UHS_MAX3421E_SS_ 9 +#define UHS_MAX3421E_INT_ 8 +#endif + +#elif defined(ARDUINO_AVR_BALANDUINO) +#error "ISR mode is currently not supported on the Balanduino. Please set USB_HOST_SHIELD_USE_ISR to 0." +#else +#define UHS_MAX3421E_SS_ 10 +#ifdef __AVR__ +#ifdef __AVR_ATmega32U4__ +#define INT_FOR_PIN2 1 +#define INT_FOR_PIN3 0 +#else +// Everybody else??? +#define INT_FOR_PIN2 0 +#define INT_FOR_PIN3 1 +#endif +#define UHS_MAX3421E_INT_ 3 +#else +// Non-avr +#ifdef ARDUINO_ARCH_PIC32 +// UNO32 External Interrupts: +// Pin 38 (INT0), Pin 2 (INT1), Pin 7 (INT2), Pin 8 (INT3), Pin 35 (INT4) +#define UHS_MAX3421E_INT_ 7 +#else +#define UHS_MAX3421E_INT_ 9 +#endif +#endif +#endif +#endif + + + +#ifdef NO_AUTO_SPEED +// Ugly details section... +// MAX3421E characteristics +// SPI Serial - Clock Input. An external SPI master supplies SCLK with frequencies up to 26MHz. The +// logic level is referenced to the voltage on VL. Data is clocked into the SPI slave inter face on the +// rising edge of SCLK. Data is clocked out of the SPI slave interface on the falling edge of SCLK. +// Serial Clock (SCLK) Period 38.4ns minimum. 17ns minimum pulse width. VL >2.5V +// SCLK Fall to MISO Propagation Delay 14.2ns +// SCLK Fall to MOSI Propagation Delay 14.2ns +// SCLK Fall to MOSI Drive 3.5ns +// Theoretical deadline for reply 17.7ns +// 26MHz 38.4615ns period <-- MAX3421E theoretical maximum + +#ifndef UHS_MAX3421E_SPD +#ifdef ARDUINO_SAMD_ZERO +// Zero violates spec early, needs a long setup time, or doesn't like high latency. +#define UHS_MAX3421E_SPD 10000000 +#elif defined(ARDUINO_ARCH_PIC32) +// PIC MX 5/6/7 characteristics +// 25MHZ 40ns period <-- PIC MX 5/6/7 theoretical maximum +// pulse width minimum Tsclk/2ns +// Trise/fall 10ns maximum. 5ns is typical but not guaranteed. +// Tsetup minimum for MISO 10ns. +// We are in violation by 7.7ns @ 25MHz due to latency alone. +// Even reading at end of data cycle, we only have a 2.3ns window. +// This is too narrow to to compensate for capacitance, trace lengths, and noise. + +// 17.7ns + 10ns = 27.7ns +// 18MHz fits and has enough slack time to compensate for capacitance, trace lengths, and noise. +// For high speeds the SMP bit is recommended too, which samples at the end instead of the middle. +// 20Mhz seems to work. + +#define UHS_MAX3421E_SPD 20000000 +#else +#define UHS_MAX3421E_SPD 25000000 +#endif +#endif +#else +// We start at 25MHz, and back down until hardware can take it. +// Of course, SPI library can adjust this for us too. +// Why not 26MHz? Because I have not found any MCU board that +// can actually go that fast without problems. +// Could be a shield limitation too. +#ifndef UHS_MAX3421E_SPD +#define UHS_MAX3421E_SPD 25000000 +#endif +#endif + +#ifndef UHS_MAX3421E_INT +#define UHS_MAX3421E_INT UHS_MAX3421E_INT_ +#endif + +#ifndef UHS_MAX3421E_SS +#define UHS_MAX3421E_SS UHS_MAX3421E_SS_ +#endif + +// NOTE: On the max3421e the irq enable and irq bits are in the same position. + +// IRQs used if CPU polls +#define ENIBITSPOLLED (bmCONDETIE | bmBUSEVENTIE | bmFRAMEIE) +// IRQs used if CPU is interrupted +#define ENIBITSISR (bmCONDETIE | bmBUSEVENTIE | bmFRAMEIE /* | bmRCVDAVIRQ | bmSNDBAVIRQ | bmHXFRDNIRQ */ ) + +#if !USB_HOST_SHIELD_USE_ISR +#define IRQ_CHECK_MASK (ENIBITSPOLLED & ICLRALLBITS) +#define IRQ_IS_EDGE 0 +#else +#define IRQ_CHECK_MASK (ENIBITSISR & ICLRALLBITS) +#endif + +#if IRQ_IS_EDGE +// Note: UNO32 Interrupts can only be RISING, or FALLING. +// This poses an interesting problem, since we want to use a LOW level. +// The MAX3421E provides for pulse width control for an IRQ. +// We do need to watch the timing on this, as a second IRQ could cause +// a missed IRQ, since we read the level of the line to check if the IRQ +// is actually for this chip. The only other alternative is to add a capacitor +// and an NPN transistor, and use two lines. We can try this first, though. +// Worse case, we can ignore reading the pin for verification on UNO32. +// Too bad there is no minimum low width setting. +// +// Single Clear First Second Clear first Clear last +// IRQ Single IRQ IRQ Second active pending IRQ +// | | | | | | +// V V V V V V +// _____ _________ _ _ _______ +// |______| |______| |______| |______________| +// +#define IRQ_SENSE FALLING +#ifdef ARDUINO_ARCH_PIC32 +//#define bmPULSEWIDTH PUSLEWIDTH10_6 +#define bmPULSEWIDTH 0 +#define bmIRQ_SENSE 0 +#else +#define bmPULSEWIDTH PUSLEWIDTH1_3 +#define bmIRQ_SENSE 0 +#endif +#else +#ifndef IRQ_SENSE +#define IRQ_SENSE LOW +#endif +#ifndef bmPULSEWIDTH +#define bmPULSEWIDTH 0 +#endif +#ifndef bmIRQ_SENSE +#define bmIRQ_SENSE bmINTLEVEL +#endif +#endif + +class MAX3421E_HOST : +public UHS_USB_HOST_BASE +#ifdef SWI_IRQ_NUM +, public dyn_SWI +#endif +{ + // TO-DO: move these into the parent class. + volatile uint8_t vbusState; + volatile uint16_t sof_countdown; + + // TO-DO: pack into a struct/union and use one byte + volatile bool busevent; + volatile bool sofevent; + volatile bool counted; + volatile bool condet; + volatile bool doingreset; + + #ifdef USB_HOST_MANUAL_POLL + volatile bool frame_irq_enabled = false; + + bool enable_frame_irq(bool enable) { + const bool prev_state = frame_irq_enabled; + if(prev_state != enable) { + if(enable) + regWr(rHIEN, regRd(rHIEN) | bmFRAMEIE); + else + regWr(rHIEN, regRd(rHIEN) & ~bmFRAMEIE); + frame_irq_enabled = enable; + } + return prev_state; + } + #endif + +public: + SPISettings MAX3421E_SPI_Settings; + uint8_t ss_pin; + uint8_t irq_pin; + // Will use the defaults UHS_MAX3421E_SS, UHS_MAX3421E_INT and speed + + UHS_NI MAX3421E_HOST() { + sof_countdown = 0; + busevent = false; + doingreset = false; + sofevent = false; + condet = false; + ss_pin = UHS_MAX3421E_SS; + irq_pin = UHS_MAX3421E_INT; + MAX3421E_SPI_Settings = SPISettings(UHS_MAX3421E_SPD, MSBFIRST, SPI_MODE0); + hub_present = 0; + }; + + // Will use user supplied pins, and UHS_MAX3421E_SPD + + UHS_NI MAX3421E_HOST(uint8_t pss, uint8_t pirq) { + sof_countdown = 0; + busevent = false; + doingreset = false; + sofevent = false; + condet = false; + ss_pin = pss; + irq_pin = pirq; + MAX3421E_SPI_Settings = SPISettings(UHS_MAX3421E_SPD, MSBFIRST, SPI_MODE0); + hub_present = 0; + }; + + // Will use user supplied pins, and speed + + UHS_NI MAX3421E_HOST(uint8_t pss, uint8_t pirq, uint32_t pspd) { + sof_countdown = 0; + doingreset = false; + busevent = false; + sofevent = false; + condet = false; + ss_pin = pss; + irq_pin = pirq; + MAX3421E_SPI_Settings = SPISettings(pspd, MSBFIRST, SPI_MODE0); + hub_present = 0; + }; + + virtual bool UHS_NI sof_delay(uint16_t x) { +#ifdef USB_HOST_MANUAL_POLL + const bool saved_irq_state = enable_frame_irq(true); +#endif + sof_countdown = x; + while((sof_countdown != 0) && !condet) { + SYSTEM_OR_SPECIAL_YIELD(); +#if !USB_HOST_SHIELD_USE_ISR + Task(); +#endif + } +#ifdef USB_HOST_MANUAL_POLL + enable_frame_irq(saved_irq_state); +#endif + // Serial.println("...Wake"); + return (!condet); + }; + + virtual UHS_EpInfo *ctrlReqOpen(uint8_t addr, uint64_t Request, uint8_t* dataptr); + + virtual void UHS_NI vbusPower(VBUS_t state) { + regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE) | (uint8_t)(state)); + }; + + void UHS_NI Task(); + + virtual uint8_t SetAddress(uint8_t addr, uint8_t ep, UHS_EpInfo **ppep, uint16_t &nak_limit); + virtual uint8_t OutTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data); + virtual uint8_t InTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data); + virtual uint8_t ctrlReqClose(UHS_EpInfo *pep, uint8_t bmReqType, uint16_t left, uint16_t nbytes, uint8_t *dataptr); + virtual uint8_t ctrlReqRead(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint16_t nbytes, uint8_t *dataptr); + virtual uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit); + + void UHS_NI ReleaseChildren() { + for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) + if(devConfig[i]) + devConfig[i]->Release(); + hub_present = 0; + }; + + virtual bool IsHub(uint8_t klass) { + if(klass == UHS_USB_CLASS_HUB) { + hub_present = bmHUBPRE; + return true; + } + return false; + }; + + virtual void VBUS_changed(); + + virtual void UHS_NI doHostReset() { +#if USB_HOST_SHIELD_USE_ISR + // Enable interrupts + noInterrupts(); +#endif + doingreset = true; + busevent = true; + regWr(rHIRQ, bmBUSEVENTIRQ); // see data sheet. + regWr(rHCTL, bmBUSRST); //issue bus reset +#if USB_HOST_SHIELD_USE_ISR + DDSB(); + // Enable interrupts + interrupts(); +#endif + while(busevent) { + DDSB(); + SYSTEM_OR_SPECIAL_YIELD(); + } +#endif +#if USB_HOST_SHIELD_USE_ISR + // Enable interrupts + noInterrupts(); +#endif + #ifdef USB_HOST_MANUAL_POLL + enable_frame_irq(true); + #endif + sofevent = true; +#if USB_HOST_SHIELD_USE_ISR + DDSB(); + // Enable interrupts + interrupts(); +#endif + // Wait for SOF + while(sofevent) { + } +#if USB_HOST_SHIELD_USE_ISR + // Enable interrupts + noInterrupts(); +#endif + doingreset = false; +#if USB_HOST_SHIELD_USE_ISR + DDSB(); + // Enable interrupts + interrupts(); + }; + + + int16_t UHS_NI Init(int16_t mseconds); + + int16_t UHS_NI Init() { + return Init(INT16_MIN); + }; + + void ISRTask(); + void ISRbottom(); + void busprobe(); + uint16_t reset(); + + // MAX3421e specific + void regWr(uint8_t reg, uint8_t data); + void gpioWr(uint8_t data); + uint8_t regRd(uint8_t reg); + uint8_t gpioRd(); + uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p); + uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p); + + // ARM/NVIC specific, used to emulate reentrant ISR. +#ifdef SWI_IRQ_NUM + + void dyn_SWISR() { + ISRbottom(); + }; +#endif + + virtual void UHS_NI suspend_host() { + // Used on MCU that lack control of IRQ priority (AVR). + // Suspends ISRs, for critical code. IRQ will be serviced after it is resumed. + // NOTE: you must track the state yourself! +#ifdef __AVR__ + noInterrupts(); + detachInterrupt(UHS_GET_DPI(irq_pin)); + interrupts(); +#endif + }; + + virtual void UHS_NI resume_host(); +}; +#ifndef SPIclass +#define SPIclass SPI +#endif +#ifndef USB_HOST_SHIELD_LOADED +#include "USB_HOST_SHIELD_INLINE.h" +#endif +#else +#error "define LOAD_USB_HOST_SHIELD in your sketch, never include USB_HOST_SHIELD.h in a driver." +#endif +#endif /* USB_HOST_SHIELD_H */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h new file mode 100644 index 000000000000..ef2dfe013782 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h @@ -0,0 +1,1003 @@ +/* Copyright (C) 2015-2016 Andrew J. Kroll + and +Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +This software may be distributed and modified under the terms of the GNU +General Public License version 2 (GPL2) as publishe7d by the Free Software +Foundation and appearing in the file GPL2.TXT included in the packaging of +this file. Please note that GPL2 Section 2[b] requires that all works based +on this software must also be made publicly available under the terms of +the GPL2 ("Copyleft"). + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com + */ + +#if defined(USB_HOST_SHIELD_H) && !defined(USB_HOST_SHIELD_LOADED) +#define USB_HOST_SHIELD_LOADED +#include + +#ifndef digitalPinToInterrupt +#error digitalPinToInterrupt not defined, complain to your board maintainer. +#endif + + +#if USB_HOST_SHIELD_USE_ISR + +// allow two slots. this makes the maximum allowed shield count TWO +// for AVRs this is limited to pins 2 and 3 ONLY +// for all other boards, one odd and one even pin number is allowed. +static MAX3421E_HOST *ISReven; +static MAX3421E_HOST *ISRodd; + +static void UHS_NI call_ISReven() { + ISReven->ISRTask(); +} + +static void UHS_NI call_ISRodd() { + UHS_PIN_WRITE(LED_BUILTIN, HIGH); + ISRodd->ISRTask(); +} +#endif + + +void UHS_NI MAX3421E_HOST::resume_host() { + // Used on MCU that lack control of IRQ priority (AVR). + // Resumes ISRs. + // NOTE: you must track the state yourself! +#ifdef __AVR__ + noInterrupts(); + if(irq_pin & 1) { + ISRodd = this; + attachInterrupt(UHS_GET_DPI(irq_pin), call_ISRodd, IRQ_SENSE); + } else { + ISReven = this; + attachInterrupt(UHS_GET_DPI(irq_pin), call_ISReven, IRQ_SENSE); + } + interrupts(); +#endif + +} +/* write single byte into MAX3421e register */ +void UHS_NI MAX3421E_HOST::regWr(uint8_t reg, uint8_t data) { + SPIclass.beginTransaction(MAX3421E_SPI_Settings); + MARLIN_UHS_WRITE_SS(LOW); + SPIclass.transfer(reg | 0x02); + SPIclass.transfer(data); + MARLIN_UHS_WRITE_SS(HIGH); + SPIclass.endTransaction(); +} + + +/* multiple-byte write */ + +/* returns a pointer to memory position after last written */ +uint8_t* UHS_NI MAX3421E_HOST::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { + SPIclass.beginTransaction(MAX3421E_SPI_Settings); + MARLIN_UHS_WRITE_SS(LOW); + SPIclass.transfer(reg | 0x02); + //printf("%2.2x :", reg); + + while(nbytes) { + SPIclass.transfer(*data_p); + //printf("%2.2x ", *data_p); + nbytes--; + data_p++; // advance data pointer + } + MARLIN_UHS_WRITE_SS(HIGH); + SPIclass.endTransaction(); + //printf("\r\n"); + return (data_p); +} +/* GPIO write */ +/*GPIO byte is split between 2 registers, so two writes are needed to write one byte */ + +/* GPOUT bits are in the low nibble. 0-3 in IOPINS1, 4-7 in IOPINS2 */ +void UHS_NI MAX3421E_HOST::gpioWr(uint8_t data) { + regWr(rIOPINS1, data); + data >>= 4; + regWr(rIOPINS2, data); + return; +} + +/* single host register read */ +uint8_t UHS_NI MAX3421E_HOST::regRd(uint8_t reg) { + SPIclass.beginTransaction(MAX3421E_SPI_Settings); + MARLIN_UHS_WRITE_SS(LOW); + SPIclass.transfer(reg); + uint8_t rv = SPIclass.transfer(0); + MARLIN_UHS_WRITE_SS(HIGH); + SPIclass.endTransaction(); + return (rv); +} +/* multiple-byte register read */ + +/* returns a pointer to a memory position after last read */ +uint8_t* UHS_NI MAX3421E_HOST::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p) { + SPIclass.beginTransaction(MAX3421E_SPI_Settings); + MARLIN_UHS_WRITE_SS(LOW); + SPIclass.transfer(reg); + while(nbytes) { + *data_p++ = SPIclass.transfer(0); + nbytes--; + } + MARLIN_UHS_WRITE_SS(HIGH); + SPIclass.endTransaction(); + return ( data_p); +} + +/* GPIO read. See gpioWr for explanation */ + +/* GPIN pins are in high nibbles of IOPINS1, IOPINS2 */ +uint8_t UHS_NI MAX3421E_HOST::gpioRd() { + uint8_t gpin = 0; + gpin = regRd(rIOPINS2); //pins 4-7 + gpin &= 0xf0; //clean lower nibble + gpin |= (regRd(rIOPINS1) >> 4); //shift low bits and OR with upper from previous operation. + return ( gpin); +} + +/* reset MAX3421E. Returns number of microseconds it took for PLL to stabilize after reset + or zero if PLL haven't stabilized in 65535 cycles */ +uint16_t UHS_NI MAX3421E_HOST::reset() { + uint16_t i = 0; + + // Initiate chip reset + regWr(rUSBCTL, bmCHIPRES); + regWr(rUSBCTL, 0x00); + + int32_t now; + uint32_t expires = micros() + 65535; + + // Enable full-duplex SPI so we can read rUSBIRQ + regWr(rPINCTL, bmFDUPSPI); + while((int32_t)(micros() - expires) < 0L) { + if((regRd(rUSBIRQ) & bmOSCOKIRQ)) { + break; + } + } + now = (int32_t)(micros() - expires); + if(now < 0L) { + i = 65535 + now; // Note this subtracts, as now is negative + } + return (i); +} + +void UHS_NI MAX3421E_HOST::VBUS_changed() { + /* modify USB task state because Vbus changed or unknown */ + uint8_t speed = 1; + //printf("\r\n\r\n\r\n\r\nSTATE %2.2x -> ", usb_task_state); + switch(vbusState) { + case LSHOST: // Low speed + + speed = 0; + // Intentional fall-through + case FSHOST: // Full speed + // Start device initialization if we are not initializing + // Resets to the device cause an IRQ + // usb_task_state == UHS_USB_HOST_STATE_RESET_NOT_COMPLETE; + //if((usb_task_state & UHS_USB_HOST_STATE_MASK) != UHS_USB_HOST_STATE_DETACHED) { + ReleaseChildren(); + if(!doingreset) { + if(usb_task_state == UHS_USB_HOST_STATE_RESET_NOT_COMPLETE) { + usb_task_state = UHS_USB_HOST_STATE_WAIT_BUS_READY; + } else if(usb_task_state != UHS_USB_HOST_STATE_WAIT_BUS_READY) { + usb_task_state = UHS_USB_HOST_STATE_DEBOUNCE; + } + } + sof_countdown = 0; + break; + case SE1: //illegal state + sof_countdown = 0; + doingreset = false; + ReleaseChildren(); + usb_task_state = UHS_USB_HOST_STATE_ILLEGAL; + break; + case SE0: //disconnected + default: + sof_countdown = 0; + doingreset = false; + ReleaseChildren(); + usb_task_state = UHS_USB_HOST_STATE_IDLE; + break; + } + usb_host_speed = speed; + //printf("0x%2.2x\r\n\r\n\r\n\r\n", usb_task_state); + return; +}; + +/** + * Probe bus to determine device presence and speed, + * then switch host to detected speed. + */ +void UHS_NI MAX3421E_HOST::busprobe() { + uint8_t bus_sample; + uint8_t tmpdata; + bus_sample = regRd(rHRSL); //Get J,K status + bus_sample &= (bmJSTATUS | bmKSTATUS); //zero the rest of the byte + switch(bus_sample) { //start full-speed or low-speed host + case(bmJSTATUS): + // Serial.println("J"); + if((regRd(rMODE) & bmLOWSPEED) == 0) { + regWr(rMODE, MODE_FS_HOST); // start full-speed host + vbusState = FSHOST; + } else { + regWr(rMODE, MODE_LS_HOST); // start low-speed host + vbusState = LSHOST; + } + #ifdef USB_HOST_MANUAL_POLL + enable_frame_irq(true); + #endif + tmpdata = regRd(rMODE) | bmSOFKAENAB; // start SOF generation + regWr(rHIRQ, bmFRAMEIRQ); // see data sheet. + regWr(rMODE, tmpdata); + break; + case(bmKSTATUS): + // Serial.println("K"); + if((regRd(rMODE) & bmLOWSPEED) == 0) { + regWr(rMODE, MODE_LS_HOST); // start low-speed host + vbusState = LSHOST; + } else { + regWr(rMODE, MODE_FS_HOST); // start full-speed host + vbusState = FSHOST; + } + #ifdef USB_HOST_MANUAL_POLL + enable_frame_irq(true); + #endif + tmpdata = regRd(rMODE) | bmSOFKAENAB; // start SOF generation + regWr(rHIRQ, bmFRAMEIRQ); // see data sheet. + regWr(rMODE, tmpdata); + break; + case(bmSE1): //illegal state + // Serial.println("I"); + regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); + vbusState = SE1; + // sofevent = false; + break; + case(bmSE0): //disconnected state + // Serial.println("D"); + regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); + vbusState = SE0; + // sofevent = false; + break; + }//end switch( bus_sample ) +} + +/** + * Initialize USB hardware, turn on VBUS + * + * @param mseconds Delay energizing VBUS after mseconds, A value of INT16_MIN means no delay. + * @return 0 on success, -1 on error + */ +int16_t UHS_NI MAX3421E_HOST::Init(int16_t mseconds) { + usb_task_state = UHS_USB_HOST_STATE_INITIALIZE; //set up state machine + // Serial.print("MAX3421E 'this' USB Host @ 0x"); + // Serial.println((uint32_t)this, HEX); + // Serial.print("MAX3421E 'this' USB Host Address Pool @ 0x"); + // Serial.println((uint32_t)GetAddressPool(), HEX); + Init_dyn_SWI(); + UHS_printf_HELPER_init(); + noInterrupts(); +#ifdef ARDUINO_AVR_ADK + // For Mega ADK, which has a Max3421e on-board, + // set MAX_RESET to output mode, and then set it to HIGH + // PORTJ bit 2 + if(irq_pin == 54) { + DDRJ |= 0x04; // output + PORTJ |= 0x04; // HIGH + } +#endif + SPIclass.begin(); +#ifdef ARDUINO_AVR_ADK + if(irq_pin == 54) { + DDRE &= ~0x20; // input + PORTE |= 0x20; // pullup + } else +#endif + pinMode(irq_pin, INPUT_PULLUP); + //UHS_PIN_WRITE(irq_pin, HIGH); + pinMode(ss_pin, OUTPUT); + MARLIN_UHS_WRITE_SS(HIGH); + +#ifdef USB_HOST_SHIELD_TIMING_PIN + pinMode(USB_HOST_SHIELD_TIMING_PIN, OUTPUT); + // My counter/timer can't work on an inverted gate signal + // so we gate using a high pulse -- AJK + UHS_PIN_WRITE(USB_HOST_SHIELD_TIMING_PIN, LOW); +#endif + interrupts(); + +#if USB_HOST_SHIELD_USE_ISR + int intr = digitalPinToInterrupt(irq_pin); + if(intr == NOT_AN_INTERRUPT) { +#ifdef ARDUINO_AVR_ADK + if(irq_pin == 54) + intr = 6; + else +#endif + return (-2); + } + SPIclass.usingInterrupt(intr); +#else + SPIclass.usingInterrupt(255); +#endif +#ifndef NO_AUTO_SPEED + // test to get to reset acceptance. + uint32_t spd = UHS_MAX3421E_SPD; +again: + MAX3421E_SPI_Settings = SPISettings(spd, MSBFIRST, SPI_MODE0); + if(reset() == 0) { + MAX_HOST_DEBUG(PSTR("Fail SPI speed %lu\r\n"), spd); + if(spd > 1999999) { + spd -= 1000000; + goto again; + } + return (-1); + } else { + // reset passes, does 64k? + uint8_t sample_wr = 0; + uint8_t sample_rd = 0; + uint8_t gpinpol_copy = regRd(rGPINPOL); + for(uint16_t j = 0; j < 65535; j++) { + regWr(rGPINPOL, sample_wr); + sample_rd = regRd(rGPINPOL); + if(sample_rd != sample_wr) { + MAX_HOST_DEBUG(PSTR("Fail SPI speed %lu\r\n"), spd); + if(spd > 1999999) { + spd -= 1000000; + goto again; + } + return (-1); + } + sample_wr++; + } + regWr(rGPINPOL, gpinpol_copy); + } + + MAX_HOST_DEBUG(PSTR("Pass SPI speed %lu\r\n"), spd); +#endif + + if(reset() == 0) { //OSCOKIRQ hasn't asserted in time + MAX_HOST_DEBUG(PSTR("OSCOKIRQ hasn't asserted in time")); + return ( -1); + } + + /* MAX3421E - full-duplex SPI, interrupt kind, vbus off */ + regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE | GPX_VBDET)); + + // Delay a minimum of 1 second to ensure any capacitors are drained. + // 1 second is required to make sure we do not smoke a Microdrive! + if(mseconds != INT16_MIN) { + if(mseconds < 1000) mseconds = 1000; + delay(mseconds); // We can't depend on SOF timer here. + } + + regWr(rMODE, bmDPPULLDN | bmDMPULLDN | bmHOST); // set pull-downs, Host + + // Enable interrupts on the MAX3421e + regWr(rHIEN, IRQ_CHECK_MASK); + // Enable interrupt pin on the MAX3421e, set pulse width for edge + regWr(rCPUCTL, (bmIE | bmPULSEWIDTH)); + + /* check if device is connected */ + regWr(rHCTL, bmSAMPLEBUS); // sample USB bus + while(!(regRd(rHCTL) & bmSAMPLEBUS)); //wait for sample operation to finish + + busprobe(); //check if anything is connected + VBUS_changed(); + + // GPX pin on. This is done here so that a change is detected if we have a switch connected. + /* MAX3421E - full-duplex SPI, interrupt kind, vbus on */ + regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE)); + regWr(rHIRQ, bmBUSEVENTIRQ); // see data sheet. + regWr(rHCTL, bmBUSRST); // issue bus reset to force generate yet another possible IRQ + + +#if USB_HOST_SHIELD_USE_ISR + // Attach ISR to service IRQ from MAX3421e + noInterrupts(); + if(irq_pin & 1) { + ISRodd = this; + attachInterrupt(UHS_GET_DPI(irq_pin), call_ISRodd, IRQ_SENSE); + } else { + ISReven = this; + attachInterrupt(UHS_GET_DPI(irq_pin), call_ISReven, IRQ_SENSE); + } + interrupts(); +#endif + //printf("\r\nrPINCTL 0x%2.2X\r\n", rPINCTL); + //printf("rCPUCTL 0x%2.2X\r\n", rCPUCTL); + //printf("rHIEN 0x%2.2X\r\n", rHIEN); + //printf("irq_pin %i\r\n", irq_pin); + return 0; +} + +/** + * Setup UHS_EpInfo structure + * + * @param addr USB device address + * @param ep Endpoint + * @param ppep pointer to the pointer to a valid UHS_EpInfo structure + * @param nak_limit how many NAKs before aborting + * @return 0 on success + */ +uint8_t UHS_NI MAX3421E_HOST::SetAddress(uint8_t addr, uint8_t ep, UHS_EpInfo **ppep, uint16_t &nak_limit) { + UHS_Device *p = addrPool.GetUsbDevicePtr(addr); + + if(!p) + return UHS_HOST_ERROR_NO_ADDRESS_IN_POOL; + + if(!p->epinfo) + return UHS_HOST_ERROR_NULL_EPINFO; + + *ppep = getEpInfoEntry(addr, ep); + + if(!*ppep) + return UHS_HOST_ERROR_NO_ENDPOINT_IN_TABLE; + + nak_limit = (0x0001UL << (((*ppep)->bmNakPower > UHS_USB_NAK_MAX_POWER) ? UHS_USB_NAK_MAX_POWER : (*ppep)->bmNakPower)); + nak_limit--; + /* + USBTRACE2("\r\nAddress: ", addr); + USBTRACE2(" EP: ", ep); + USBTRACE2(" NAK Power: ",(*ppep)->bmNakPower); + USBTRACE2(" NAK Limit: ", nak_limit); + USBTRACE("\r\n"); + */ + regWr(rPERADDR, addr); //set peripheral address + + uint8_t mode = regRd(rMODE); + + //Serial.print("\r\nMode: "); + //Serial.println( mode, HEX); + //Serial.print("\r\nLS: "); + //Serial.println(p->speed, HEX); + + // Set bmLOWSPEED and bmHUBPRE in case of low-speed device, reset them otherwise + regWr(rMODE, (p->speed) ? mode & ~(bmHUBPRE | bmLOWSPEED) : mode | bmLOWSPEED | hub_present); + + return 0; +} + +/** + * Receive a packet + * + * @param pep pointer to a valid UHS_EpInfo structure + * @param nak_limit how many NAKs before aborting + * @param nbytesptr pointer to maximum number of bytes of data to receive + * @param data pointer to data buffer + * @return 0 on success + */ +uint8_t UHS_NI MAX3421E_HOST::InTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t* data) { + uint8_t rcode = 0; + uint8_t pktsize; + + uint16_t nbytes = *nbytesptr; + MAX_HOST_DEBUG(PSTR("Requesting %i bytes "), nbytes); + uint8_t maxpktsize = pep->maxPktSize; + + *nbytesptr = 0; + regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value + + // use a 'break' to exit this loop + while(1) { + rcode = dispatchPkt(MAX3421E_tokIN, pep->epAddr, nak_limit); //IN packet to EP-'endpoint'. Function takes care of NAKS. +#if 0 + // This issue should be resolved now. + if(rcode == UHS_HOST_ERROR_TOGERR) { + //MAX_HOST_DEBUG(PSTR("toggle wrong\r\n")); + // yes, we flip it wrong here so that next time it is actually correct! + pep->bmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; + regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value + continue; + } +#endif + if(rcode) { + //MAX_HOST_DEBUG(PSTR(">>>>>>>> Problem! dispatchPkt %2.2x\r\n"), rcode); + break; //should be 0, indicating ACK. Else return error code. + } + /* check for RCVDAVIRQ and generate error if not present */ + /* the only case when absence of RCVDAVIRQ makes sense is when toggle error occurred. Need to add handling for that */ + if((regRd(rHIRQ) & bmRCVDAVIRQ) == 0) { + //MAX_HOST_DEBUG(PSTR(">>>>>>>> Problem! NO RCVDAVIRQ!\r\n")); + rcode = 0xf0; //receive error + break; + } + pktsize = regRd(rRCVBC); //number of received bytes + MAX_HOST_DEBUG(PSTR("Got %i bytes \r\n"), pktsize); + + if(pktsize > nbytes) { //certain devices send more than asked + //MAX_HOST_DEBUG(PSTR(">>>>>>>> Warning: wanted %i bytes but got %i.\r\n"), nbytes, pktsize); + pktsize = nbytes; + } + + int16_t mem_left = (int16_t)nbytes - *((int16_t*)nbytesptr); + + if(mem_left < 0) + mem_left = 0; + + data = bytesRd(rRCVFIFO, ((pktsize > mem_left) ? mem_left : pktsize), data); + + regWr(rHIRQ, bmRCVDAVIRQ); // Clear the IRQ & free the buffer + *nbytesptr += pktsize; // add this packet's byte count to total transfer length + + /* The transfer is complete under two conditions: */ + /* 1. The device sent a short packet (L.T. maxPacketSize) */ + /* 2. 'nbytes' have been transferred. */ + if((pktsize < maxpktsize) || (*nbytesptr >= nbytes)) // have we transferred 'nbytes' bytes? + { + // Save toggle value + pep->bmRcvToggle = ((regRd(rHRSL) & bmRCVTOGRD)) ? 1 : 0; + //MAX_HOST_DEBUG(PSTR("\r\n")); + rcode = 0; + break; + } // if + } //while( 1 ) + return ( rcode); +} + +/** + * Transmit a packet + * + * @param pep pointer to a valid UHS_EpInfo structure + * @param nak_limit how many NAKs before aborting + * @param nbytes number of bytes of data to send + * @param data pointer to data buffer + * @return 0 on success + */ +uint8_t UHS_NI MAX3421E_HOST::OutTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data) { + uint8_t rcode = UHS_HOST_ERROR_NONE; + uint8_t retry_count; + uint8_t *data_p = data; //local copy of the data pointer + uint16_t bytes_tosend; + uint16_t nak_count; + uint16_t bytes_left = nbytes; + + uint8_t maxpktsize = pep->maxPktSize; + + if(maxpktsize < 1 || maxpktsize > 64) + return UHS_HOST_ERROR_BAD_MAX_PACKET_SIZE; + + unsigned long timeout = millis() + UHS_HOST_TRANSFER_MAX_MS; + + regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value + + while(bytes_left) { + SYSTEM_OR_SPECIAL_YIELD(); + retry_count = 0; + nak_count = 0; + bytes_tosend = (bytes_left >= maxpktsize) ? maxpktsize : bytes_left; + bytesWr(rSNDFIFO, bytes_tosend, data_p); //filling output FIFO + regWr(rSNDBC, bytes_tosend); //set number of bytes + regWr(rHXFR, (MAX3421E_tokOUT | pep->epAddr)); //dispatch packet + while(!(regRd(rHIRQ) & bmHXFRDNIRQ)); //wait for the completion IRQ + regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ + rcode = (regRd(rHRSL) & 0x0f); + + while(rcode && ((long)(millis() - timeout) < 0L)) { + switch(rcode) { + case UHS_HOST_ERROR_NAK: + nak_count++; + if(nak_limit && (nak_count == nak_limit)) + goto breakout; + break; + case UHS_HOST_ERROR_TIMEOUT: + retry_count++; + if(retry_count == UHS_HOST_TRANSFER_RETRY_MAXIMUM) + goto breakout; + break; + case UHS_HOST_ERROR_TOGERR: + // yes, we flip it wrong here so that next time it is actually correct! + pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; + regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value + break; + default: + goto breakout; + }//switch( rcode + + /* process NAK according to Host out NAK bug */ + regWr(rSNDBC, 0); + regWr(rSNDFIFO, *data_p); + regWr(rSNDBC, bytes_tosend); + regWr(rHXFR, (MAX3421E_tokOUT | pep->epAddr)); //dispatch packet + while(!(regRd(rHIRQ) & bmHXFRDNIRQ)); //wait for the completion IRQ + regWr(rHIRQ, bmHXFRDNIRQ); //clear IRQ + rcode = (regRd(rHRSL) & 0x0f); + SYSTEM_OR_SPECIAL_YIELD(); + }//while( rcode && .... + bytes_left -= bytes_tosend; + data_p += bytes_tosend; + }//while( bytes_left... +breakout: + + pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 1 : 0; //bmSNDTOG1 : bmSNDTOG0; //update toggle + return ( rcode); //should be 0 in all cases +} + +/** + * Send the actual packet. + * + * @param token + * @param ep Endpoint + * @param nak_limit how many NAKs before aborting, 0 == exit after timeout + * @return 0 on success, 0xFF indicates NAK timeout. @see + */ +/* Assumes peripheral address is set and relevant buffer is loaded/empty */ +/* If NAK, tries to re-send up to nak_limit times */ +/* If nak_limit == 0, do not count NAKs, exit after timeout */ +/* If bus timeout, re-sends up to USB_RETRY_LIMIT times */ + +/* return codes 0x00-0x0f are HRSLT( 0x00 being success ), 0xff means timeout */ +uint8_t UHS_NI MAX3421E_HOST::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) { + unsigned long timeout = millis() + UHS_HOST_TRANSFER_MAX_MS; + uint8_t tmpdata; + uint8_t rcode = UHS_HOST_ERROR_NONE; + uint8_t retry_count = 0; + uint16_t nak_count = 0; + + for(;;) { + regWr(rHXFR, (token | ep)); //launch the transfer + while((long)(millis() - timeout) < 0L) //wait for transfer completion + { + SYSTEM_OR_SPECIAL_YIELD(); + tmpdata = regRd(rHIRQ); + + if(tmpdata & bmHXFRDNIRQ) { + regWr(rHIRQ, bmHXFRDNIRQ); //clear the interrupt + //rcode = 0x00; + break; + }//if( tmpdata & bmHXFRDNIRQ + + }//while ( millis() < timeout + + rcode = (regRd(rHRSL) & 0x0f); //analyze transfer result + + switch(rcode) { + case UHS_HOST_ERROR_NAK: + nak_count++; + if(nak_limit && (nak_count == nak_limit)) + return (rcode); + delayMicroseconds(200); + break; + case UHS_HOST_ERROR_TIMEOUT: + retry_count++; + if(retry_count == UHS_HOST_TRANSFER_RETRY_MAXIMUM) + return (rcode); + break; + default: + return (rcode); + }//switch( rcode + } +} + +// +// NULL is error, we don't need to know the reason. +// + +UHS_EpInfo * UHS_NI MAX3421E_HOST::ctrlReqOpen(uint8_t addr, uint64_t Request, uint8_t *dataptr) { + uint8_t rcode; + UHS_EpInfo *pep = NULL; + uint16_t nak_limit = 0; + rcode = SetAddress(addr, 0, &pep, nak_limit); + + if(!rcode) { + + bytesWr(rSUDFIFO, 8, (uint8_t*)(&Request)); //transfer to setup packet FIFO + + rcode = dispatchPkt(MAX3421E_tokSETUP, 0, nak_limit); //dispatch packet + if(!rcode) { + if(dataptr != NULL) { + if(((Request)/* bmReqType*/ & 0x80) == 0x80) { + pep->bmRcvToggle = 1; //bmRCVTOG1; + } else { + pep->bmSndToggle = 1; //bmSNDTOG1; + } + } + } else { + pep = NULL; + } + } + return pep; +} + +uint8_t UHS_NI MAX3421E_HOST::ctrlReqRead(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint16_t nbytes, uint8_t *dataptr) { + *read = 0; + uint16_t nak_limit = 0; + MAX_HOST_DEBUG(PSTR("ctrlReqRead left: %i\r\n"), *left); + if(*left) { +again: + *read = nbytes; + uint8_t rcode = InTransfer(pep, nak_limit, read, dataptr); + if(rcode == UHS_HOST_ERROR_TOGERR) { + // yes, we flip it wrong here so that next time it is actually correct! + pep->bmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; + goto again; + } + + if(rcode) { + MAX_HOST_DEBUG(PSTR("ctrlReqRead ERROR: %2.2x, left: %i, read %i\r\n"), rcode, *left, *read); + return rcode; + } + *left -= *read; + MAX_HOST_DEBUG(PSTR("ctrlReqRead left: %i, read %i\r\n"), *left, *read); + } + return 0; +} + +uint8_t UHS_NI MAX3421E_HOST::ctrlReqClose(UHS_EpInfo *pep, uint8_t bmReqType, uint16_t left, uint16_t nbytes, uint8_t *dataptr) { + uint8_t rcode = 0; + + //MAX_HOST_DEBUG(PSTR("Closing")); + if(((bmReqType & 0x80) == 0x80) && pep && left && dataptr) { + MAX_HOST_DEBUG(PSTR("ctrlReqRead Sinking %i\r\n"), left); + // If reading, sink the rest of the data. + while(left) { + uint16_t read = nbytes; + rcode = InTransfer(pep, 0, &read, dataptr); + if(rcode == UHS_HOST_ERROR_TOGERR) { + // yes, we flip it wrong here so that next time it is actually correct! + pep->bmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; + continue; + } + if(rcode) break; + left -= read; + if(read < nbytes) break; + } + } + if(!rcode) { + // Serial.println("Dispatching"); + rcode = dispatchPkt(((bmReqType & 0x80) == 0x80) ? MAX3421E_tokOUTHS : MAX3421E_tokINHS, 0, 0); //GET if direction + // } else { + // Serial.println("Bypassed Dispatch"); + } + return rcode; +} + +/** + * Bottom half of the ISR task + */ +void UHS_NI MAX3421E_HOST::ISRbottom() { + uint8_t x; + // Serial.print("Enter "); + // Serial.print((uint32_t)this,HEX); + // Serial.print(" "); + // Serial.println(usb_task_state, HEX); + + DDSB(); + if(condet) { + VBUS_changed(); +#if USB_HOST_SHIELD_USE_ISR + noInterrupts(); +#endif + condet = false; +#if USB_HOST_SHIELD_USE_ISR + interrupts(); +#endif + } + switch(usb_task_state) { + case UHS_USB_HOST_STATE_INITIALIZE: + // should never happen... + MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_INITIALIZE\r\n")); + busprobe(); + VBUS_changed(); + break; + case UHS_USB_HOST_STATE_DEBOUNCE: + MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_DEBOUNCE\r\n")); + // This seems to not be needed. The host controller has debounce built in. + sof_countdown = UHS_HOST_DEBOUNCE_DELAY_MS; + usb_task_state = UHS_USB_HOST_STATE_DEBOUNCE_NOT_COMPLETE; + break; + case UHS_USB_HOST_STATE_DEBOUNCE_NOT_COMPLETE: + MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_DEBOUNCE_NOT_COMPLETE\r\n")); + if(!sof_countdown) usb_task_state = UHS_USB_HOST_STATE_RESET_DEVICE; + break; + case UHS_USB_HOST_STATE_RESET_DEVICE: + MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_RESET_DEVICE\r\n")); + busevent = true; + usb_task_state = UHS_USB_HOST_STATE_RESET_NOT_COMPLETE; + regWr(rHIRQ, bmBUSEVENTIRQ); // see data sheet. + regWr(rHCTL, bmBUSRST); // issue bus reset + break; + case UHS_USB_HOST_STATE_RESET_NOT_COMPLETE: + MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_RESET_NOT_COMPLETE\r\n")); + if(!busevent) usb_task_state = UHS_USB_HOST_STATE_WAIT_BUS_READY; + break; + case UHS_USB_HOST_STATE_WAIT_BUS_READY: + MAX_HOST_DEBUG(PSTR("UHS_USB_HOST_STATE_WAIT_BUS_READY\r\n")); + usb_task_state = UHS_USB_HOST_STATE_CONFIGURING; + break; // don't fall through + + case UHS_USB_HOST_STATE_CONFIGURING: + usb_task_state = UHS_USB_HOST_STATE_CHECK; + x = Configuring(0, 1, usb_host_speed); + usb_error = x; + if(usb_task_state == UHS_USB_HOST_STATE_CHECK) { + if(x) { + MAX_HOST_DEBUG(PSTR("Error 0x%2.2x"), x); + if(x == UHS_HOST_ERROR_JERR) { + usb_task_state = UHS_USB_HOST_STATE_IDLE; + } else if(x != UHS_HOST_ERROR_DEVICE_INIT_INCOMPLETE) { + usb_error = x; + usb_task_state = UHS_USB_HOST_STATE_ERROR; + } + } else + usb_task_state = UHS_USB_HOST_STATE_CONFIGURING_DONE; + } + break; + + case UHS_USB_HOST_STATE_CHECK: + // Serial.println((uint32_t)__builtin_return_address(0), HEX); + break; + case UHS_USB_HOST_STATE_CONFIGURING_DONE: + usb_task_state = UHS_USB_HOST_STATE_RUNNING; + break; + #ifdef USB_HOST_MANUAL_POLL + case UHS_USB_HOST_STATE_RUNNING: + case UHS_USB_HOST_STATE_ERROR: + case UHS_USB_HOST_STATE_IDLE: + case UHS_USB_HOST_STATE_ILLEGAL: + enable_frame_irq(false); + break; + #else + case UHS_USB_HOST_STATE_RUNNING: + Poll_Others(); + for(x = 0; (usb_task_state == UHS_USB_HOST_STATE_RUNNING) && (x < UHS_HOST_MAX_INTERFACE_DRIVERS); x++) { + if(devConfig[x]) { + if(devConfig[x]->bPollEnable) devConfig[x]->Poll(); + } + } + // fall thru + #endif + default: + // Do nothing + break; + } // switch( usb_task_state ) + DDSB(); +#if USB_HOST_SHIELD_USE_ISR + if(condet) { + VBUS_changed(); + noInterrupts(); + condet = false; + interrupts(); + } +#endif +#ifdef USB_HOST_SHIELD_TIMING_PIN + // My counter/timer can't work on an inverted gate signal + // so we gate using a high pulse -- AJK + UHS_PIN_WRITE(USB_HOST_SHIELD_TIMING_PIN, LOW); +#endif + //usb_task_polling_disabled--; + EnablePoll(); + DDSB(); +} + + +/* USB main task. Services the MAX3421e */ +#if !USB_HOST_SHIELD_USE_ISR + +void UHS_NI MAX3421E_HOST::ISRTask() { +} +void UHS_NI MAX3421E_HOST::Task() +#else + +void UHS_NI MAX3421E_HOST::Task() { +#ifdef USB_HOST_MANUAL_POLL + if(usb_task_state == UHS_USB_HOST_STATE_RUNNING) { + noInterrupts(); + for(uint8_t x = 0; x < UHS_HOST_MAX_INTERFACE_DRIVERS; x++) + if(devConfig[x] && devConfig[x]->bPollEnable) + devConfig[x]->Poll(); + interrupts(); + } +#endif +} + +void UHS_NI MAX3421E_HOST::ISRTask() +#endif +{ + DDSB(); + +#ifndef SWI_IRQ_NUM + suspend_host(); +#if USB_HOST_SHIELD_USE_ISR + // Enable interrupts + interrupts(); +#endif +#endif + + counted = false; + if(!MARLIN_UHS_READ_IRQ()) { + uint8_t HIRQALL = regRd(rHIRQ); //determine interrupt source + uint8_t HIRQ = HIRQALL & IRQ_CHECK_MASK; + uint8_t HIRQ_sendback = 0x00; + + if((HIRQ & bmCONDETIRQ) || (HIRQ & bmBUSEVENTIRQ)) { + MAX_HOST_DEBUG + (PSTR("\r\nBEFORE CDIRQ %s BEIRQ %s resetting %s state 0x%2.2x\r\n"), + (HIRQ & bmCONDETIRQ) ? "T" : "F", + (HIRQ & bmBUSEVENTIRQ) ? "T" : "F", + doingreset ? "T" : "F", + usb_task_state + ); + } + // ALWAYS happens BEFORE or WITH CONDETIRQ + if(HIRQ & bmBUSEVENTIRQ) { + HIRQ_sendback |= bmBUSEVENTIRQ; + if(!doingreset) condet = true; + busprobe(); + busevent = false; + } + + if(HIRQ & bmCONDETIRQ) { + HIRQ_sendback |= bmCONDETIRQ; + if(!doingreset) condet = true; + busprobe(); + } + +#if 1 + if((HIRQ & bmCONDETIRQ) || (HIRQ & bmBUSEVENTIRQ)) { + MAX_HOST_DEBUG + (PSTR("\r\nAFTER CDIRQ %s BEIRQ %s resetting %s state 0x%2.2x\r\n"), + (HIRQ & bmCONDETIRQ) ? "T" : "F", + (HIRQ & bmBUSEVENTIRQ) ? "T" : "F", + doingreset ? "T" : "F", + usb_task_state + ); + } +#endif + + if(HIRQ & bmFRAMEIRQ) { + HIRQ_sendback |= bmFRAMEIRQ; + if(sof_countdown) { + sof_countdown--; + counted = true; + } + sofevent = false; + } + + //MAX_HOST_DEBUG(PSTR("\r\n%s%s%s\r\n"), + // sof_countdown ? "T" : "F", + // counted ? "T" : "F", + // usb_task_polling_disabled? "T" : "F"); + DDSB(); + regWr(rHIRQ, HIRQ_sendback); +#ifndef SWI_IRQ_NUM + resume_host(); +#if USB_HOST_SHIELD_USE_ISR + // Disable interrupts + noInterrupts(); +#endif +#endif + if(!sof_countdown && !counted && !usb_task_polling_disabled) { + DisablePoll(); + //usb_task_polling_disabled++; +#ifdef USB_HOST_SHIELD_TIMING_PIN + // My counter/timer can't work on an inverted gate signal + // so we gate using a high pulse -- AJK + UHS_PIN_WRITE(USB_HOST_SHIELD_TIMING_PIN, HIGH); +#endif + +#ifdef SWI_IRQ_NUM + // MAX_HOST_DEBUG(PSTR("--------------- Doing SWI ----------------")); + exec_SWI(this); +#else +#if USB_HOST_SHIELD_USE_ISR + // Enable interrupts + interrupts(); +#endif /* USB_HOST_SHIELD_USE_ISR */ + ISRbottom(); +#endif /* SWI_IRQ_NUM */ + } + } +} + +#if 0 +DDSB(); +#endif +#else +#error "Never include USB_HOST_SHIELD_INLINE.h, include UHS_host.h instead" +#endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h new file mode 100644 index 000000000000..114064044d17 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h @@ -0,0 +1,153 @@ +/* + * File: macro_logic.h + * Author: root + * + * Created on December 22, 2018, 4:49 AM + * + * To test: + * gcc -DAJK_TEST_MACRO_LOGIC -E macro_logic.h + * + */ + +#ifndef MACRO_LOGIC_H +#define MACRO_LOGIC_H + +#define AJK_CAT(a, ...) AJK_PRIMITIVE_CAT(a, __VA_ARGS__) +#define AJK_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ + +#define AJK_COMPL(b) AJK_PRIMITIVE_CAT(AJK_COMPL_, b) +#define AJK_COMPL_0 1 +#define AJK_COMPL_1 0 + +#define AJK_BITAND(x) AJK_PRIMITIVE_CAT(AJK_BITAND_, x) +#define AJK_BITAND_0(y) 0 +#define AJK_BITAND_1(y) y + +#define AJK_INC(x) AJK_PRIMITIVE_CAT(AJK_INC_, x) +#define AJK_INC_0 1 +#define AJK_INC_1 2 +#define AJK_INC_2 3 +#define AJK_INC_3 4 +#define AJK_INC_4 5 +#define AJK_INC_5 6 +#define AJK_INC_6 7 +#define AJK_INC_7 8 +#define AJK_INC_8 9 +#define AJK_INC_9 10 +#define AJK_INC_10 10 + +#define AJK_DEC(x) AJK_PRIMITIVE_CAT(AJK_DEC_, x) +#define AJK_DEC_0 0 +#define AJK_DEC_1 0 +#define AJK_DEC_2 1 +#define AJK_DEC_3 2 +#define AJK_DEC_4 3 +#define AJK_DEC_5 4 +#define AJK_DEC_6 5 +#define AJK_DEC_7 6 +#define AJK_DEC_8 7 +#define AJK_DEC_9 8 +#define AJK_DEC_10 9 + +#define AJK_CHECK_N(x, n, ...) n +#define AJK_CHECK(...) AJK_CHECK_N(__VA_ARGS__, 0,) +#define AJK_PROBE(x) x, 1, + +#define AJK_IS_PAREN(x) AJK_CHECK(AJK_IS_PAREN_PROBE x) +#define AJK_IS_PAREN_PROBE(...) AJK_PROBE(~) + +#define AJK_NOT(x) AJK_CHECK(AJK_PRIMITIVE_CAT(AJK_NOT_, x)) +#define AJK_NOT_0 AJK_PROBE(~) + +#define AJK_COMPL(b) AJK_PRIMITIVE_CAT(AJK_COMPL_, b) +#define AJK_COMPL_0 1 +#define AJK_COMPL_1 0 + +#define AJK_BOOL(x) AJK_COMPL(AJK_NOT(x)) + +#define AJK_IIF(c) AJK_PRIMITIVE_CAT(AJK_IIF_, c) +#define AJK_IIF_0(t, ...) __VA_ARGS__ +#define AJK_IIF_1(t, ...) t + +#define AJK_IF(c) AJK_IIF(AJK_BOOL(c)) + +#define AJK_EAT(...) +#define AJK_EXPAND(...) __VA_ARGS__ +#define AJK_WHEN(c) AJK_IF(c)(AJK_EXPAND, AJK_EAT) + +#define AJK_EMPTY() +#define AJK_DEFER(id) id AJK_EMPTY() +#define AJK_OBSTRUCT(id) id AJK_DEFER(AJK_EMPTY)() + +#define AJK_EVAL(...) AJK_EVAL1(AJK_EVAL1(AJK_EVAL1(__VA_ARGS__))) +#define AJK_EVAL1(...) AJK_EVAL2(AJK_EVAL2(AJK_EVAL2(__VA_ARGS__))) +#define AJK_EVAL2(...) AJK_EVAL3(AJK_EVAL3(AJK_EVAL3(__VA_ARGS__))) +#define AJK_EVAL3(...) AJK_EVAL4(AJK_EVAL4(AJK_EVAL4(__VA_ARGS__))) +#define AJK_EVAL4(...) AJK_EVAL5(AJK_EVAL5(AJK_EVAL5(__VA_ARGS__))) +#define AJK_EVAL5(...) __VA_ARGS__ + +#define AJK_REPEAT(AJK_count, AJK_macro, ...) \ + AJK_WHEN(AJK_count) \ + ( \ + AJK_OBSTRUCT(AJK_REPEAT_INDIRECT) () \ + ( \ + AJK_DEC(AJK_count), AJK_macro, __VA_ARGS__ \ + ) \ + AJK_OBSTRUCT(AJK_macro) \ + ( \ + AJK_DEC(AJK_count), __VA_ARGS__ \ + ) \ + ) +#define AJK_REPEAT_INDIRECT() AJK_REPEAT + +#define AJK_WHILE(AJK_pred, AJK_op, ...) \ + IF(AJK_pred(__VA_ARGS__)) \ + ( \ + AJK_OBSTRUCT(AJK_WHILE_INDIRECT) () \ + ( \ + AJK_pred, AJK_op, AJK_op(__VA_ARGS__) \ + ), \ + __VA_ARGS__ \ + ) +#define AJK_WHILE_INDIRECT() AJK_WHILE + +#define AJK_PRIMITIVE_COMPARE(x, y) AJK_IS_PAREN \ +( \ + AJK_COMPARE_ ## x ( AJK_COMPARE_ ## y) (()) \ +) + +#define AJK_IS_COMPARABLE(x) AJK_IS_PAREN( AJK_CAT(AJK_COMPARE_, x) (()) ) + +#define AJK_NOT_EQUAL(x, y) \ +AJK_IIF(AJK_BITAND(AJK_IS_COMPARABLE(x))(AJK_IS_COMPARABLE(y)) ) \ +( \ + AJK_PRIMITIVE_COMPARE, \ + 1 AJK_EAT \ +)(x, y) + +#define AJK_EQUAL(x, y) AJK_COMPL(AJK_NOT_EQUAL(x, y)) + + +#define AJK_COMMA() , + +#define AJK_COMMA_IF(n) AJK_IF(n)(AJK_COMMA, AJK_EAT)() + + +#define AJK_COMMA_VAR(AJK_count, AJK_v) AJK_COMMA_IF(AJK_count) AJK_v ## AJK_count + +#define AJK_MAKE_LIST(AJK_v, AJK_count) AJK_EVAL(AJK_REPEAT(AJK_count, AJK_COMMA_VAR, AJK_v)) + +#define AJK_FUN(AJK_count, AJK_v, AJK_args, AJK_body) AJK_v ## AJK_count (AJK_args) { AJK_body(AJK_count) } +#define AJK_MAKE_FUNS(AJK_v, AJK_args, AJK_count, AJK_body) AJK_EVAL(AJK_REPEAT(AJK_count, AJK_FUN, AJK_v, AJK_args, AJK_body)) +#ifdef AJK_TEST_MACRO_LOGIC + +#define BODY(AJKindex) some(C, statement); contaning(a, test[AJKindex]); +#define ZERO_TIMES_TEST 0 +#define THREE_TIMES_TEST 3 +blank > AJK_MAKE_LIST(VARIABLE_, ZERO_TIMES_TEST) < because zero repeats +Make 3 comma separated indexed variables : AJK_MAKE_LIST(VARIABLE_, THREE_TIMES_TEST) +Make 3 bogus function bodies +AJK_MAKE_FUNS(unsigned Cfunc,(arg1, arg2),3,BODY) +#endif + +#endif /* MACRO_LOGIC_H */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h new file mode 100644 index 000000000000..5408a94ade70 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h @@ -0,0 +1,246 @@ +/* + * File: SWI_INLINE.h + * Author: xxxajk@gmail.com + * + * Created on December 5, 2014, 9:40 AM + * + * This is the actual library. + * There are no 'c' or 'cpp' files. + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifdef DYN_SWI_H +#ifndef SWI_INLINE_H +#define SWI_INLINE_H + +#ifndef SWI_MAXIMUM_ALLOWED +#define SWI_MAXIMUM_ALLOWED 4 +#endif + + + +#if defined(__arm__) || defined(ARDUINO_ARCH_PIC32) +static char dyn_SWI_initied = 0; +static dyn_SWI* dyn_SWI_LIST[SWI_MAXIMUM_ALLOWED]; +static dyn_SWI* dyn_SWI_EXEC[SWI_MAXIMUM_ALLOWED]; +#ifdef __arm__ +#ifdef __USE_CMSIS_VECTORS__ +extern "C" { + void (*_VectorsRam[VECTORTABLE_SIZE])(void)__attribute__((aligned(VECTORTABLE_ALIGNMENT))); +} +#else + +__attribute__((always_inline)) static inline void __DSB() { + __asm__ volatile ("dsb"); +} +#endif // defined(__USE_CMSIS_VECTORS__) +#else // defined(__arm__) +__attribute__((always_inline)) static inline void __DSB() { + __asm__ volatile ("sync" : : : "memory"); +} +#endif // defined(__arm__) + +/** + * Execute queued class ISR routines. + */ +#ifdef ARDUINO_ARCH_PIC32 +static p32_regset *ifs = ((p32_regset *) & IFS0) + (SWI_IRQ_NUM / 32); //interrupt flag register set +static p32_regset *iec = ((p32_regset *) & IEC0) + (SWI_IRQ_NUM / 32); //interrupt enable control reg set +static uint32_t swibit = 1 << (SWI_IRQ_NUM % 32); + +void +#ifdef __PIC32MZXX__ + __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL))) +#else + __attribute__((interrupt(),nomips16)) +#endif + softISR() { +#else +#ifdef ARDUINO_spresense_ast +unsigned int softISR() { +#else +void softISR() { +#endif +#endif + + // + // TO-DO: Perhaps limit to 8, and inline this? + // + + + // Make a working copy, while clearing the queue. + noInterrupts(); +#ifdef ARDUINO_ARCH_PIC32 + //ifs->clr = swibit; +#endif + for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { + dyn_SWI_EXEC[i] = dyn_SWI_LIST[i]; + dyn_SWI_LIST[i] = NULL; + } + __DSB(); + interrupts(); + + // Execute each class SWI + for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { + if(dyn_SWI_EXEC[i]) { +#ifdef __DYN_SWI_DEBUG_LED__ + digitalWrite(__DYN_SWI_DEBUG_LED__, HIGH); +#endif + dyn_SWI_EXEC[i]->dyn_SWISR(); +#ifdef __DYN_SWI_DEBUG_LED__ + digitalWrite(__DYN_SWI_DEBUG_LED__, LOW); +#endif + } + } +#ifdef ARDUINO_ARCH_PIC32 + noInterrupts(); + if(!dyn_SWI_EXEC[0]) ifs->clr = swibit; + interrupts(); +#endif +#ifdef ARDUINO_spresense_ast + return 0; +#endif +} + +#define DDSB() __DSB() +#endif + + +#ifdef __arm__ +#ifndef interruptsStatus +#define interruptsStatus() __interruptsStatus() +static inline unsigned char __interruptsStatus() __attribute__((always_inline, unused)); + +static inline unsigned char __interruptsStatus() { + unsigned int primask; + asm volatile ("mrs %0, primask" : "=r" (primask)); + if(primask) return 0; + return 1; +} +#endif + +/** + * Initialize the Dynamic (class) Software Interrupt + */ +static void Init_dyn_SWI() { + if(!dyn_SWI_initied) { +#ifdef __USE_CMSIS_VECTORS__ + uint32_t *X_Vectors = (uint32_t*)SCB->VTOR; + for(int i = 0; i < VECTORTABLE_SIZE; i++) { + _VectorsRam[i] = reinterpret_cast(X_Vectors[i]); /* copy vector table to RAM */ + } + /* relocate vector table */ + noInterrupts(); + SCB->VTOR = reinterpret_cast(&_VectorsRam); + DDSB(); + interrupts(); +#endif +#ifndef ARDUINO_spresense_ast + for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) dyn_SWI_LIST[i] = NULL; + noInterrupts(); + _VectorsRam[SWI_IRQ_NUM + 16] = reinterpret_cast(softISR); + DDSB(); + interrupts(); + NVIC_SET_PRIORITY(SWI_IRQ_NUM, 255); + NVIC_ENABLE_IRQ(SWI_IRQ_NUM); +#endif +#ifdef __DYN_SWI_DEBUG_LED__ + pinMode(__DYN_SWI_DEBUG_LED__, OUTPUT); + digitalWrite(__DYN_SWI_DEBUG_LED__, LOW); +#endif + dyn_SWI_initied = 1; + } +} + +/** + * + * @param klass class that extends dyn_SWI + * @return 0 on queue full, else returns queue position (ones based) + */ +int exec_SWI(const dyn_SWI* klass) { + int rc = 0; + + uint8_t irestore = interruptsStatus(); + // Allow use from inside a critical section... + // ... and prevent races if also used inside an ISR + noInterrupts(); + for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { + if(!dyn_SWI_LIST[i]) { + rc = 1 + i; // Success! + dyn_SWI_LIST[i] = (dyn_SWI*)klass; +#ifndef ARDUINO_spresense_ast + if(!NVIC_GET_PENDING(SWI_IRQ_NUM)) NVIC_SET_PENDING(SWI_IRQ_NUM); +#else + // Launch 1-shot timer as an emulated SWI + // Hopefully the value of Zero is legal. + // 1 microsecond latency would suck! + attachTimerInterrupt(softISR, 100); +#endif + DDSB(); + break; + } + } + // Restore interrupts, if they were on. + if(irestore) interrupts(); + return rc; +} +#elif defined(ARDUINO_ARCH_PIC32) + +/** + * Initialize the Dynamic (class) Software Interrupt + */ +static void Init_dyn_SWI() { + if(!dyn_SWI_initied) { + uint32_t sreg = disableInterrupts(); + + setIntVector(SWI_VECTOR, softISR); + setIntPriority(SWI_VECTOR, 1, 1); // Lowest priority, ever. + ifs->clr = swibit; + iec->clr = swibit; + iec->set = swibit; + restoreInterrupts(sreg); +#ifdef __DYN_SWI_DEBUG_LED__ + pinMode(__DYN_SWI_DEBUG_LED__, OUTPUT); + UHS_PIN_WRITE(__DYN_SWI_DEBUG_LED__, LOW); +#endif + } +} + +/** + * + * @param klass class that extends dyn_SWI + * @return 0 on queue full, else returns queue position (ones based) + */ +int exec_SWI(const dyn_SWI* klass) { + int rc = 0; + uint32_t sreg = disableInterrupts(); + for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { + if(!dyn_SWI_LIST[i]) { + rc = 1 + i; // Success! + dyn_SWI_LIST[i] = (dyn_SWI*)klass; + if(!(ifs->reg & swibit)) ifs->set = swibit; + ; + break; + } + } + restoreInterrupts(sreg); + return rc; +} + +#endif /* defined(__arm__) */ +#endif /* SWI_INLINE_H */ +#else +#error "Never include SWI_INLINE.h directly, include dyn_SWI.h instead" +#endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h new file mode 100644 index 000000000000..0fdb3ee3db95 --- /dev/null +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h @@ -0,0 +1,172 @@ +/* + * File: dyn_SWI.h + * Author: xxxajk@gmail.com + * + * Created on December 5, 2014, 9:12 AM + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DYN_SWI_H +#define DYN_SWI_H + + +#if defined(__arm__) || defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 +#include +#endif +#ifdef __cplusplus + +#ifdef true +#undef true +#endif + +#ifdef false +#undef false +#endif + +#endif + +#ifdef ARDUINO_spresense_ast +#define SWI_IRQ_NUM 666 // because this board is totally evil. +#elif defined(ARDUINO_ARCH_PIC32) +#ifndef SWI_IRQ_NUM +#ifdef _DSPI0_IPL_ISR +#define SWI_IPL _DSPI0_IPL_ISR +#define SWI_VECTOR _DSPI0_ERR_IRQ +#define SWI_IRQ_NUM _DSPI0_ERR_IRQ +#elif defined(_PMP_ERROR_IRQ) +#define SWI_IRQ_NUM _PMP_ERROR_IRQ +#define SWI_VECTOR _PMP_VECTOR +#else +#error SWI_IRQ_NUM and SWI_VECTOR need a definition +#endif +#ifdef __cplusplus +extern "C" +{ + void +#ifdef __PIC32MZXX__ + __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL))) +#else + __attribute__((interrupt(),nomips16)) +#endif + softISR(); +} +#endif +#endif +#elif !defined(NVIC_NUM_INTERRUPTS) +// Assume CMSIS +#define __USE_CMSIS_VECTORS__ +#ifdef NUMBER_OF_INT_VECTORS +#define NVIC_NUM_INTERRUPTS (NUMBER_OF_INT_VECTORS-16) +#else +#define NVIC_NUM_INTERRUPTS ((int)PERIPH_COUNT_IRQn) +#endif +#define VECTORTABLE_SIZE (NVIC_NUM_INTERRUPTS+16) +#define VECTORTABLE_ALIGNMENT (0x100ul) +#define NVIC_GET_ACTIVE(n) NVIC_GetActive((IRQn_Type)n) +#define NVIC_GET_PENDING(n) NVIC_GetPendingIRQ((IRQn_Type)n) +#define NVIC_SET_PENDING(n) NVIC_SetPendingIRQ((IRQn_Type)n) +#define NVIC_ENABLE_IRQ(n) NVIC_EnableIRQ((IRQn_Type)n) +#define NVIC_SET_PRIORITY(n ,p) NVIC_SetPriority((IRQn_Type)n, (uint32_t) p) +//extern "C" { +// extern uint32_t _VectorsRam[VECTORTABLE_SIZE] __attribute__((aligned(VECTORTABLE_ALIGNMENT))); +//} + +#ifndef SWI_IRQ_NUM +#if defined(__SAM3X8E__) && defined(_VARIANT_ARDUINO_DUE_X_) +// DUE +// Choices available: +// HSMCI_IRQn Multimedia Card Interface (HSMCI) +// EMAC_IRQn Ethernet MAC (EMAC) +// EMAC is not broken out on the official DUE, but is on clones. +// SPI0_IRQn Serial Peripheral Interface (SPI0) +// SPI0_IRQn seems to be the best choice, as long as nobody uses an ISR based master +#define SWI_IRQ_NUM SPI0_IRQn +#elif defined(ARDUINO_SAMD_ZERO) +// Just use sercom4's unused IRQ vector. +#define SWI_IRQ_NUM I2S_IRQn +//#define SWI_IRQ_NUM SERCOM4_IRQn +#endif +#endif + +#ifndef SWI_IRQ_NUM +#error SWI_IRQ_NUM not defined (CMSIS) +#endif + +#elif defined(CORE_TEENSY) + +#ifndef NVIC_GET_ACTIVE +#define NVIC_GET_ACTIVE(n) (*((volatile uint32_t *)0xE000E300 + ((n) >> 5)) & (1 << ((n) & 31))) +#endif +#ifndef NVIC_GET_PENDING +#define NVIC_GET_PENDING(n) (*((volatile uint32_t *)0xE000E200 + ((n) >> 5)) & (1 << ((n) & 31))) +#ifndef SWI_IRQ_NUM +#ifdef __MK20DX256__ +#define SWI_IRQ_NUM 17 +#elif defined(__MK20DX128__) +#define SWI_IRQ_NUM 5 +#elif defined(__MKL26Z64__) +#define SWI_IRQ_NUM 4 +#elif defined(__MK66FX1M0__) +#define SWI_IRQ_NUM 30 +#elif defined(__MK64FX512__) +#define SWI_IRQ_NUM 30 +#elif defined(__IMXRT1052__) || defined(__IMXRT1062__) +#define SWI_IRQ_NUM 71 +#else +#error Do not know how to relocate IRQ vectors for this pjrc product +#endif +#endif +#endif +#else // Not CMSIS or PJRC CORE_TEENSY or PIC32 or SPRESENSE +#error Do not know how to relocate IRQ vectors or perform SWI +#endif // SWI_IRQ_NUM + + +#ifndef SWI_IRQ_NUM +#error SWI_IRQ_NUM not defined +#else +/** + * Use this class to extend your class, in order to provide + * a C++ context callable SWI. + */ +class dyn_SWI { +public: + + /** + * Override this method with your code. + */ + virtual void dyn_SWISR() { + }; +}; + +extern int exec_SWI(const dyn_SWI* klass); + +#include "SWI_INLINE.h" + +// IMPORTANT! Define this so that you do NOT end up with a NULL stub! +#define SWI_NO_STUB +#endif /* SWI_IRQ_NUM */ +#endif /* __arm__ */ + +// if no SWI for CPU (e.g. AVR) make a void stub. +#ifndef SWI_NO_STUB +#define Init_dyn_SWI() (void(0)) +#ifndef DDSB +#define DDSB() (void(0)) +#endif +#endif +#endif /* DYN_SWI_H */ diff --git a/Marlin/src/sd/usb_flashdrive/usb-2.0-host-library-changes.patch b/Marlin/src/sd/usb_flashdrive/usb-2.0-host-library-changes.patch deleted file mode 100644 index c057aaba04d7..000000000000 --- a/Marlin/src/sd/usb_flashdrive/usb-2.0-host-library-changes.patch +++ /dev/null @@ -1,187 +0,0 @@ -diff -Naur /home/aleph/Downloads/USB_Host_Shield_2.0-master/masstorage.cpp lib/masstorage.cpp ---- /home/aleph/Downloads/USB_Host_Shield_2.0-master/masstorage.cpp 2018-09-21 10:19:36.107502252 -0600 -+++ lib/masstorage.cpp 2018-09-21 09:46:19.620175519 -0600 -@@ -24,6 +24,8 @@ - - #include "masstorage.h" - -+#if ENABLED(USB_FLASH_DRIVE_SUPPORT) -+ - const uint8_t BulkOnly::epDataInIndex = 1; - const uint8_t BulkOnly::epDataOutIndex = 2; - const uint8_t BulkOnly::epInterruptInIndex = 3; -@@ -796,6 +798,9 @@ - buf[i] = 0x00; - } - WriteOk[lun] = true; -+ #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && defined(SKIP_WRITE_PROTECT) -+ return 0; -+ #endif - uint8_t rc = ModeSense6(lun, 0, 0x3f, 0, 192, buf); - if(!rc) { - WriteOk[lun] = ((buf[2] & 0x80) == 0); -@@ -1271,3 +1276,5 @@ - return MASS_ERR_NOT_IMPLEMENTED; - #endif - } -+ -+#endif // USB_FLASH_DRIVE_SUPPORT -\ No newline at end of file -diff -Naur /home/aleph/Downloads/USB_Host_Shield_2.0-master/message.cpp lib/message.cpp ---- /home/aleph/Downloads/USB_Host_Shield_2.0-master/message.cpp 2018-09-21 10:20:15.995647957 -0600 -+++ lib/message.cpp 2018-09-19 07:43:46.520339375 -0600 -@@ -23,6 +23,9 @@ - */ - - #include "Usb.h" -+ -+#if ENABLED(USB_FLASH_DRIVE_SUPPORT) -+ - // 0x80 is the default (i.e. trace) to turn off set this global to something lower. - // this allows for 126 other debugging levels. - // TO-DO: Allow assignment to a different serial port by software -@@ -120,4 +123,6 @@ - D_PrintHex (rcode, 0x80); - Notify(PSTR("\r\n"), 0x80); - } --#endif -+#endif // DEBUG_USB_HOST -+ -+#endif // USB_FLASH_DRIVE_SUPPORT -\ No newline at end of file -diff -Naur /home/aleph/Downloads/USB_Host_Shield_2.0-master/parsetools.cpp lib/parsetools.cpp ---- /home/aleph/Downloads/USB_Host_Shield_2.0-master/parsetools.cpp 2018-09-21 10:21:16.215867769 -0600 -+++ lib/parsetools.cpp 2018-09-19 07:43:46.520339375 -0600 -@@ -23,6 +23,8 @@ - */ - #include "Usb.h" - -+#if ENABLED(USB_FLASH_DRIVE_SUPPORT) -+ - bool MultiByteValueParser::Parse(uint8_t **pp, uint16_t *pcntdn) { - if(!pBuf) { - Notify(PSTR("Buffer pointer is NULL!\r\n"), 0x80); -@@ -72,3 +74,5 @@ - } - return true; - } -+ -+#endif // USB_FLASH_DRIVE_SUPPORT -\ No newline at end of file -diff -Naur /home/aleph/Downloads/USB_Host_Shield_2.0-master/settings.h lib/settings.h ---- /home/aleph/Downloads/USB_Host_Shield_2.0-master/settings.h 2018-09-21 10:22:21.792106872 -0600 -+++ lib/settings.h 2018-09-21 10:01:53.383594081 -0600 -@@ -25,7 +25,21 @@ - #ifndef USB_HOST_SHIELD_SETTINGS_H - #define USB_HOST_SHIELD_SETTINGS_H - #include "macros.h" -- -+#if ENABLED(USB_FLASH_DRIVE_SUPPORT) -+ //////////////////////////////////////////////////////////////////////////////// -+ /* Added by Bill Greiman to speed up mass storage initialization with USB -+ * flash drives and simple USB hard drives. -+ * Disable this by defining DELAY(x) to be delay(x). -+ */ -+ #define delay(x) if((x) < 200) safe_delay(x) -+ /* Almost all USB flash drives and simple USB hard drives fail the write -+ * protect test and add 20 - 30 seconds to USB init. Set SKIP_WRITE_PROTECT -+ * to nonzero to skip the test and assume the drive is writable. -+ */ -+ #define SKIP_WRITE_PROTECT 1 -+ /* Since Marlin only cares about USB flash drives, we only need one LUN. */ -+ #define MASS_MAX_SUPPORTED_LUN 1 -+#endif - //////////////////////////////////////////////////////////////////////////////// - // SPI Configuration - //////////////////////////////////////////////////////////////////////////////// -@@ -45,6 +59,10 @@ - * multiple serial ports are available. - * For example Serial3. - */ -+#if ENABLED(USB_FLASH_DRIVE_SUPPORT) -+ #define USB_HOST_SERIAL MYSERIAL0 -+#endif -+ - #ifndef USB_HOST_SERIAL - #define USB_HOST_SERIAL Serial - #endif -@@ -99,7 +117,7 @@ - // No user serviceable parts below this line. - // DO NOT change anything below here unless you are a developer! - --#include "version_helper.h" -+//#include "version_helper.h" - - #if defined(__GNUC__) && defined(__AVR__) - #ifndef GCC_VERSION -@@ -149,7 +167,6 @@ - #else - #define USING_SPI4TEENSY3 0 - #endif -- - #if ((defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)) || defined(__ARDUINO_X86__) || ARDUINO >= 10600) && !USING_SPI4TEENSY3 - #include // Use the Arduino SPI library for the Arduino Due, Intel Galileo 1 & 2, Intel Edison or if the SPI library with transaction is available - #endif -diff -Naur /home/aleph/Downloads/USB_Host_Shield_2.0-master/UsbCore.h lib/UsbCore.h ---- /home/aleph/Downloads/USB_Host_Shield_2.0-master/UsbCore.h 2018-09-21 10:23:09.348280107 -0600 -+++ lib/UsbCore.h 2018-09-19 07:43:46.520339375 -0600 -@@ -32,7 +32,10 @@ - //#define USB_METHODS_INLINE - - /* shield pins. First parameter - SS pin, second parameter - INT pin */ --#ifdef BOARD_BLACK_WIDDOW -+ -+#if defined(__MARLIN_H__) -+typedef MAX3421e MAX3421E; // Marlin redefines this class in "../usb_host.h" -+#elif defined(BOARD_BLACK_WIDDOW) - typedef MAX3421e MAX3421E; // Black Widow - #elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) - #if EXT_RAM -diff -Naur /home/aleph/Downloads/USB_Host_Shield_2.0-master/Usb.cpp lib/Usb.cpp ---- /home/aleph/Downloads/USB_Host_Shield_2.0-master/Usb.cpp 2018-09-21 10:23:20.732321559 -0600 -+++ lib/Usb.cpp 2018-09-19 07:43:46.520339375 -0600 -@@ -25,6 +25,8 @@ - - #include "Usb.h" - -+#if ENABLED(USB_FLASH_DRIVE_SUPPORT) -+ - static uint8_t usb_error = 0; - static uint8_t usb_task_state; - -@@ -825,3 +827,4 @@ - } - - #endif // defined(USB_METHODS_INLINE) -+#endif // USB_FLASH_DRIVE_SUPPORT -diff -Naur /home/aleph/Downloads/USB_Host_Shield_2.0-master/Usb.h lib/Usb.h ---- /home/aleph/Downloads/USB_Host_Shield_2.0-master/Usb.h 2018-09-21 10:23:33.756368972 -0600 -+++ lib/Usb.h 2018-09-19 07:43:46.520339375 -0600 -@@ -25,6 +25,8 @@ - #ifndef _usb_h_ - #define _usb_h_ - -+#include "../../../Marlin.h" -+ - // WARNING: Do not change the order of includes, or stuff will break! - #include - #include -@@ -34,13 +36,15 @@ - #include "settings.h" - #include "printhex.h" - #include "message.h" -+ - #include "hexdump.h" --#include "sink_parser.h" -+//#include "sink_parser.h" - #include "max3421e.h" - #include "address.h" --#include "avrpins.h" -+//#include "avrpins.h" - #include "usb_ch9.h" --#include "usbhost.h" -+//#include "usbhost.h" -+#include "../usb_host.h" - #include "UsbCore.h" - #include "parsetools.h" - #include "confdescparser.h" diff --git a/README.md b/README.md index 01ca70c9676f..b0c93bb01a96 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Marlin 3D Printer Firmware +# Marlin 3D Printer Firmware [![Build Status](https://travis-ci.org/MarlinFirmware/Marlin.svg?branch=bugfix-2.0.x)](https://travis-ci.org/MarlinFirmware/Marlin) ![GitHub](https://img.shields.io/github/license/marlinfirmware/marlin.svg) @@ -49,6 +49,7 @@ Marlin 2.0 introduces a layer of abstraction so that all the existing high-level ----|---------|-----|-----|----|-----|--- [STEVAL-3DP001V1](http://www.st.com/en/evaluation-tools/steval-3dp001v1.html)|[STM32F401VE Arm-Cortex M4](http://www.st.com/en/microcontrollers/stm32f401ve.html)|84MHz|512k|64+32k|3.3-5V|yes [Smoothieboard](http://reprap.org/wiki/Smoothieboard)|LPC1769 ARM-Cortex M3|120MHz|512k|64k|3.3-5V|no + [Adafruit Grand Central M4](https://www.adafruit.com/product/4064)|[SAMD51P20A ARM-Cortex M4](https://www.microchip.com/wwwproducts/en/ATSAMD51P20A)|120MHz|1M|256k|3.3V|yes ## Submitting Patches @@ -64,7 +65,7 @@ Proposed patches should be submitted as a Pull Request against the ([bugfix-2.0. The current Marlin dev team consists of: - - Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - USA   [![Flattr Scott](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=thinkhead&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software) + - Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - USA   [![Flattr Scott](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=thinkyhead&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software) - Roxanne Neufeld [[@Roxy-3D](https://github.com/Roxy-3D)] - USA - Bob Kuhn [[@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn)] - USA - Chris Pepper [[@p3p](https://github.com/p3p)] - UK diff --git a/buildroot/bin/backup_ramps b/buildroot/bin/backup_ramps new file mode 100755 index 000000000000..b376bb74b84b --- /dev/null +++ b/buildroot/bin/backup_ramps @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +PINS="Marlin/src/pins" +RAMPS="$PINS/ramps/pins_RAMPS.h" +BKUP="$PINS/ramps/pins_RAMPS.backup.h" + +[[ -f $RAMPS ]] && cp "$RAMPS" "$BKUP" diff --git a/buildroot/bin/env_clean b/buildroot/bin/env_clean index c352b01b2afd..721aa762df57 100755 --- a/buildroot/bin/env_clean +++ b/buildroot/bin/env_clean @@ -3,6 +3,7 @@ rm -rf .pioenvs rm -rf .piolibdeps rm -rf .piolib +rm -rf .pio if [[ $1 = "--deep" ]]; then rm -rf ~/.platformio/packages/* diff --git a/buildroot/bin/generate_version b/buildroot/bin/generate_version index 5a07ef5b1142..c2bcbdc758a4 100755 --- a/buildroot/bin/generate_version +++ b/buildroot/bin/generate_version @@ -2,10 +2,10 @@ # # generate_version # -# Make a _Version.h file +# Make a Version.h file to accompany CUSTOM_VERSION_FILE # -DIR=${1:-"Marlin/src/inc"} +DIR=${1:-"Marlin"} # MRCC3=$( git merge-base HEAD upstream/bugfix-2.0.x 2>/dev/null ) # MRCC2=$( git merge-base HEAD upstream/bugfix-1.1.x 2>/dev/null ) @@ -44,7 +44,30 @@ SOURCE_CODE_URL=$(awk -F'"' \ WEBSITE_URL=$(awk -F'"' \ '/#define WEBSITE_URL/{ print $2 }' < "${DIR}/Version.h") -cat > "${DIR}/_Version.h" < "${DIR}/Version.h" <. + * + */ +#pragma once + /** * THIS FILE IS AUTOMATICALLY GENERATED DO NOT MANUALLY EDIT IT. * IT DOES NOT GET COMMITTED TO THE REPOSITORY. @@ -53,15 +76,69 @@ cat > "${DIR}/_Version.h" <> ip + + # load a byte into IP + ip = r0[loop_counter] + + # XOR the seed with r7 + xor_seed = xor_seed ^ r7 + + # and then with IP + xor_seed = xor_seed ^ ip + + #Now store the byte back + r1[loop_counter] = xor_seed & 0xFF + + #increment the loop_counter + loop_counter = loop_counter + 1 + + +def encrypt_file(input, output_file, file_length): + input_file = bytearray(input.read()) + block_size = 0x800 + key_length = 0x18 + file_key = 0xDAB27F94 + + xor_crc = 0xef3d4323; + + # the input file is exepcted to be in chunks of 0x800 + # so round the size + while len(input_file) % block_size != 0: + input_file.extend(b'0x0') + + # write the file header + output_file.write(struct.pack(">I", 0x443D2D3F)) + # encrypt the contents using a known file header key + + # write the file_key + output_file.write(struct.pack(">I", 0x947FB2DA)) + + #TODO - how to enforce that the firmware aligns to block boundaries? + block_count = int(len(input_file) / block_size) + print "Block Count is ", block_count + for block_number in range(0, block_count): + block_offset = (block_number * block_size) + block_end = block_offset + block_size + block_array = bytearray(input_file[block_offset: block_end]) + xor_block(block_array, block_array, block_number, block_size, file_key) + for n in range (0, block_size): + input_file[block_offset + n] = block_array[n] + + # update the expected CRC value. + xor_crc = calculate_crc(block_array, xor_crc) + + # write CRC + output_file.write(struct.pack("= 320 and position < 31040: byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') robin.write(byte) position += 1 finally: diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_lite.py b/buildroot/share/PlatformIO/scripts/mks_robin_lite.py new file mode 100644 index 000000000000..2f3ae1fa9a17 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/mks_robin_lite.py @@ -0,0 +1,40 @@ +import os +Import("env") + +# Relocate firmware from 0x08000000 to 0x08005000 +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + env['CPPDEFINES'].remove(define) +env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000")) + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_lite.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + + +# Encrypt ${PROGNAME}.bin and save it as 'mksLite.bin' +def encrypt(source, target, env): + import sys + + key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] + + firmware = open(target[0].path, "rb") + robin = open(target[0].dir.path +'/mksLite.bin', "wb") + length = os.path.getsize(target[0].path) + position = 0 + try: + while position < length: + byte = firmware.read(1) + if position >= 320 and position < 31040: + byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') + robin.write(byte) + position += 1 + finally: + firmware.close() + robin.close() +env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py b/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py new file mode 100644 index 000000000000..67ad442d8212 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py @@ -0,0 +1,40 @@ +import os +Import("env") + +# Relocate firmware from 0x08000000 to 0x08005000 +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + env['CPPDEFINES'].remove(define) +env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000")) + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_lite.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + + +# Encrypt ${PROGNAME}.bin and save it as 'mksLite.bin' +def encrypt(source, target, env): + import sys + + key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] + + firmware = open(target[0].path, "rb") + robin = open(target[0].dir.path +'/mksLite3.bin', "wb") + length = os.path.getsize(target[0].path) + position = 0 + try: + while position < length: + byte = firmware.read(1) + if position >= 320 and position < 31040: + byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') + robin.write(byte) + position += 1 + finally: + firmware.close() + robin.close() +env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py index 2b3ba6f90d45..d38669830158 100755 --- a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py @@ -1,3 +1,4 @@ +import os Import("env") # Relocate firmware from 0x08000000 to 0x08007000 @@ -5,11 +6,18 @@ if define[0] == "VECT_TAB_ADDR": env['CPPDEFINES'].remove(define) env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) -env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld") + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + # Encrypt ${PROGNAME}.bin and save it as 'Robin_mini.bin' def encrypt(source, target, env): - import os + import sys key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] @@ -22,6 +30,8 @@ def encrypt(source, target, env): byte = firmware.read(1) if position >= 320 and position < 31040: byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') robin.write(byte) position += 1 finally: diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_nano.py b/buildroot/share/PlatformIO/scripts/mks_robin_nano.py index eb8bca9b5234..a68fd308d443 100755 --- a/buildroot/share/PlatformIO/scripts/mks_robin_nano.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_nano.py @@ -1,3 +1,4 @@ +import os Import("env") # Relocate firmware from 0x08000000 to 0x08007000 @@ -5,11 +6,18 @@ if define[0] == "VECT_TAB_ADDR": env['CPPDEFINES'].remove(define) env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) -env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld") + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + # Encrypt ${PROGNAME}.bin and save it as 'Robin_nano.bin' def encrypt(source, target, env): - import os + import sys key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] @@ -22,6 +30,8 @@ def encrypt(source, target, env): byte = firmware.read(1) if position >= 320 and position < 31040: byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') robin.write(byte) position += 1 finally: diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_pro.py b/buildroot/share/PlatformIO/scripts/mks_robin_pro.py new file mode 100644 index 000000000000..2ebf1ffb9d74 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/mks_robin_pro.py @@ -0,0 +1,39 @@ +import os +Import("env") + +# Relocate firmware from 0x08000000 to 0x08007000 +for define in env['CPPDEFINES']: + if define[0] == "VECT_TAB_ADDR": + env['CPPDEFINES'].remove(define) +env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) + +custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_pro.ld") +for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script + elif flag == "-T": + env["LINKFLAGS"][i + 1] = custom_ld_script + +# Encrypt ${PROGNAME}.bin and save it as 'Robin.bin' +def encrypt(source, target, env): + import sys + + key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] + + firmware = open(target[0].path, "rb") + robin = open(target[0].dir.path +'/Robin_pro.bin', "wb") + length = os.path.getsize(target[0].path) + position = 0 + try: + while position < length: + byte = firmware.read(1) + if position >= 320 and position < 31040: + byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') + robin.write(byte) + position += 1 + finally: + firmware.close() + robin.close() +env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c new file mode 100644 index 000000000000..2c6bd244a2fc --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c @@ -0,0 +1,340 @@ +/* + ******************************************************************************* + * Copyright (c) 2019, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + * Automatically generated from STM32F407Z(E-G)Tx.xml + */ +#include +#include + +/* ===== + * Note: Commented lines are alternative possibilities which are not used by default. + * If you change them, you should know what you're doing first. + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 E0_DIR + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 BLTOUCH_2 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 BLTOUCH_4 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 E1_EN + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 TF_SS + {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 TF_SCLK + {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 TF_MISO + {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 LED + {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 HEATER2 + {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 HEATER0 + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 Z_EN + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 EXP_14 + {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 Z_DIR + {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 E0_EN + {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 EXP_8 + {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 EXP_7 + + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio, 24 ADC + {PF_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_IN9 TH_0 + {PF_4, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC3_IN14 TH_1 + {PF_5, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC3_IN15 TH_2 + {PF_6, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC3_IN4 TH_3 + {PF_7, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC3_IN5 EXP_13 + {PF_8, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_IN6 EXP_3 + {PF_9, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_IN7 EXP_6 + {PF_10, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC3_IN8 EXP_5 + #endif + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SDA[] = { + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #endif + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SCL[] = { + {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #endif + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +const PinMap PinMap_PWM[] = { + {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 HEATER0 + {PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 HEATER1 + {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 HEATER2 + {PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 BED + {PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 FAN0 + {PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 FAN1 + {PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 FAN2 + {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 EXTENSION1-4 + + //probably unused on SKR-Pro. confirmation needed, please. + //{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + //{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 is bltouch analog? + //{PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 is bltouch analog? + //{PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 + //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 + //{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + //{PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 + //{PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 + //{PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PA_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + //{PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PA_6, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + //{PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + //{PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + //{PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + //{PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + //{PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + //{PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + //{PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + //{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + //{PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + //{PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + //{PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + //{PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + //{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + //{PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + //{PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + //{PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + //{PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + //{PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + //{PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + //{PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + //{PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + //{PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + //{PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + //{PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + //{PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + //{PB_14, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 + //{PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + //{PB_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + //{PB_15, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2 + //{PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PC_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 + //{PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + //{PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 + //{PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + //{PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + //{PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + //{PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + //{PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + //{PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + //{PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + //{PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + //{PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + //{PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + //{PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + //{PF_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + //{PF_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + //{PF_8, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + //{PF_9, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + #endif + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_TX[] = { + {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + {PG_14, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #endif + {NC, NP, 0} +}; + +const PinMap PinMap_UART_RX[] = { + {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + {PG_9, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #endif + {NC, NP, 0} +}; + +const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_12, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + {PG_8, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PG_12, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #endif + {NC, NP, 0} +}; + +const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + {PG_13, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PG_15, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + #endif + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MOSI[] = { + {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +#ifdef HAL_CAN_MODULE_ENABLED +#error "CAN bus isn't available on this board. Driver should be disabled." +#endif + +//*** ETHERNET *** +#ifdef HAL_ETH_MODULE_ENABLED +#error "Ethernet port isn't available on this board. Driver should be disabled." +#endif + +//*** No QUADSPI *** + +//*** USB *** +#ifdef HAL_PCD_MODULE_ENABLED +const PinMap PinMap_USB_OTG_FS[] = { + //{PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF used by LCD + //{PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS available on wifi port, if empty + //{PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID available on UART1_RX if not used + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; + +const PinMap PinMap_USB_OTG_HS[] = { /* + #ifdef USE_USB_HS_IN_FS + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS + {PB_14, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DM + {PB_15, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DP + #else + #error "USB in HS mode isn't supported by the board" + {PA_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D0 + {PB_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D1 + {PB_1, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D2 + {PB_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D7 + {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D3 + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D5 + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D6 + {PC_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_STP + {PC_2, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_DIR + {PC_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_NXT + #endif /* USE_USB_HS_IN_FS */ + {NC, NP, 0} +}; +#endif diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h new file mode 100644 index 000000000000..24248859373b --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h @@ -0,0 +1,50 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = NC, +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_VBUS = PB_13, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, + USB_OTG_HS_ULPI_STP = PC_0, + USB_OTG_HS_ULPI_DIR = PC_2, + USB_OTG_HS_ULPI_NXT = PC_3, +#endif diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h new file mode 100644 index 000000000000..e0e8239aac08 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h @@ -0,0 +1,52 @@ +#pragma once + +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +//#define HAL_RTC_MODULE_ENABLED Real Time Clock...do we use it? +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +//#define HAL_UART_MODULE_ENABLED // by default +//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE) + +#undef HAL_SD_MODULE_ENABLED +#undef HAL_DAC_MODULE_ENABLED +#undef HAL_FLASH_MODULE_ENABLED +#undef HAL_CAN_MODULE_ENABLED +#undef HAL_CAN_LEGACY_MODULE_ENABLED +#undef HAL_CEC_MODULE_ENABLED +#undef HAL_CRYP_MODULE_ENABLED +#undef HAL_DCMI_MODULE_ENABLED +#undef HAL_DMA2D_MODULE_ENABLED +#undef HAL_ETH_MODULE_ENABLED +#undef HAL_NAND_MODULE_ENABLED +#undef HAL_NOR_MODULE_ENABLED +#undef HAL_PCCARD_MODULE_ENABLED +#undef HAL_SRAM_MODULE_ENABLED +#undef HAL_SDRAM_MODULE_ENABLED +#undef HAL_HASH_MODULE_ENABLED +#undef HAL_EXTI_MODULE_ENABLED +#undef HAL_SMBUS_MODULE_ENABLED +#undef HAL_I2S_MODULE_ENABLED +#undef HAL_IWDG_MODULE_ENABLED +#undef HAL_LTDC_MODULE_ENABLED +#undef HAL_DSI_MODULE_ENABLED +#undef HAL_QSPI_MODULE_ENABLED +#undef HAL_RNG_MODULE_ENABLED +#undef HAL_SAI_MODULE_ENABLED +#undef HAL_IRDA_MODULE_ENABLED +#undef HAL_SMARTCARD_MODULE_ENABLED +#undef HAL_WWDG_MODULE_ENABLED +#undef HAL_HCD_MODULE_ENABLED +#undef HAL_FMPI2C_MODULE_ENABLED +#undef HAL_SPDIFRX_MODULE_ENABLED +#undef HAL_DFSDM_MODULE_ENABLED +#undef HAL_LPTIM_MODULE_ENABLED +#undef HAL_MMC_MODULE_ENABLED diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/ldscript.ld b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/ldscript.ld new file mode 100644 index 000000000000..0c060d175180 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/ldscript.ld @@ -0,0 +1,204 @@ +/* +***************************************************************************** +** + +** File : LinkerScript.ld +** +** Abstract : Linker script for STM32F407ZGTx Device with +** 1024KByte FLASH, 128KByte RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2014 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20020000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200;; /* required amount of heap */ +_Min_Stack_Size = 0x400;; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x8008000, LENGTH = 1024K +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text ALIGN(4): + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata ALIGN(4): + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + _siccmram = LOADADDR(.ccmram); + + /* CCM-RAM section + * + * IMPORTANT NOTE! + * If initialized variables will be placed in this section, + * the startup code needs to be modified to copy the init-values. + */ + .ccmram : + { + . = ALIGN(4); + _sccmram = .; /* create a global symbol at ccmram start */ + *(.ccmram) + *(.ccmram*) + + . = ALIGN(4); + _eccmram = .; /* create a global symbol at ccmram end */ + } >CCMRAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(4); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(4); + } >RAM + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.cpp b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.cpp new file mode 100644 index 000000000000..1486b21830a1 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.cpp @@ -0,0 +1,260 @@ +/* + ******************************************************************************* + * Copyright (c) 2017, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ + +#include "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Pin number +// This array allows to wrap Arduino pin number(Dx or x) +// to STM32 PinName (PX_n) +const PinName digitalPin[] = { +#if STM32F4X_PIN_NUM >= 64 //64 pins mcu, 51 gpio + PC_13, //D0 + PC_14, //D1 - OSC32_IN + PC_15, //D2 - OSC32_OUT + PH_0, //D3 - OSC_IN + PH_1, //D4 - OSC_OUT + PB_2, //D5 - BOOT1 + PB_10, //D6 - 1:SPI2_SCK / I2C2_SCL / USART3_TX / TIM2_CH3 + PB_11, //D7 - 1:I2C2_SDA / USART3_RX / TIM2_CH4 + PB_12, //D8 - 1:SPI2_NSS / OTG_HS_ID + PB_13, //D9 - 1:SPI2_SCK 2:OTG_HS_VBUS + PB_14, //D10 - 1:SPI2_MISO / TIM12_CH1 / OTG_HS_DM + PB_15, //D11 - SPI2_MOSI / TIM12_CH2 / OTG_HS_DP + PC_6, //D12 - 1:TIM8_CH1 / SDIO_D6 / USART6_TX / TIM3_CH1 + PC_7, //D13 - 1:TIM8_CH2 / SDIO_D7 / USART6_RX / TIM3_CH2 + PC_8, //D14 - 1:TIM8_CH3 / SDIO_D0 / TIM3_CH3 + PC_9, //D15 - 1:TIM8_CH4 / SDIO_D1 / TIM3_CH4 + PA_8, //D16 - 1:TIM1_CH1 / I2C3_SCL / OTG_FS_SOF + PA_9, //D17 - 1:USART1_TX / TIM1_CH2 2:OTG_FS_VBUS + PA_10, //D18 - 1:USART1_RX / TIM1_CH3 / OTG_FS_ID + PA_11, //D19 - 1:TIM1_CH4 / OTG_FS_DM + PA_12, //D20 - 1:OTG_FS_DP + PA_13, //D21 - 0:JTMS-SWDIO + PA_14, //D22 - 0:JTCK-SWCLK + PA_15, //D23 - 0:JTDI 1:SPI3_NSS / SPI1_NSS + PC_10, //D24 - 1:UART4_TX / SPI3_SCK / SDIO_D2 / USART3_TX + PC_11, //D25 - 1:UART4_RX / SPI3_MISO / SDIO_D3 / USART3_RX + PC_12, //D26 - 1:UART5_TX / SPI3_MOSI / SDIO_CK + PD_2, //D27 - 1:UART5_RX / SDIO_CMD + PB_3, //D28 - 0:JTDO 1:SPI3_SCK / TIM2_CH2 / SPI1_SCK + PB_4, //D29 - 0:NJTRST 1:SPI3_MISO / TIM3_CH1 / SPI1_MISO + PB_5, //D30 - 1:TIM3_CH2 / SPI1_MOSI / SPI3_MOSI + PB_6, //D31 - 1:I2C1_SCL / TIM4_CH1 / USART1_TX + PB_7, //D32 - 1:I2C1_SDA / TIM4_CH2 / USART1_RX + PB_8, //D33 - 1:I2C1_SCL / TIM4_CH3 / SDIO_D4 / TIM10_CH1 + PB_9, //D34 - 1:I2C1_SDA / TIM4_CH4 / SDIO_D5 / TIM11_CH1 / SPI2_NSS + PA_0, //D35/A0 - 1:UART4_TX / TIM5_CH1 2:ADC123_IN0 + PA_1, //D36/A1 - 1:UART4_RX / TIM5_CH2 / TIM2_CH2 2:ADC123_IN1 + PA_2, //D37/A2 - 1:USART2_TX /TIM5_CH3 / TIM9_CH1 / TIM2_CH3 2:ADC123_IN2 + PA_3, //D38/A3 - 1:USART2_RX /TIM5_CH4 / TIM9_CH2 / TIM2_CH4 2:ADC123_IN3 + PA_4, //D39/A4 - NOT FT 1:SPI1_NSS / SPI3_NSS / USART2_CK 2:ADC12_IN4 / DAC_OUT1 + PA_5, //D40/A5 - NOT FT 1:SPI1_SCK 2:ADC12_IN5 / DAC_OUT2 + PA_6, //D41/A6 - 1:SPI1_MISO / TIM13_CH1 / TIM3_CH1 2:ADC12_IN6 + PA_7, //D42/A7 - 1:SPI1_MOSI / TIM14_CH1 / TIM3_CH2 2:ADC12_IN7 + PB_0, //D43/A8 - 1:TIM3_CH3 2:ADC12_IN8 + PB_1, //D44/A9 - 1:TIM3_CH4 2:ADC12_IN9 + PC_0, //D45/A10 - 1: 2:ADC123_IN10 + PC_1, //D46/A11 - 1: 2:ADC123_IN11 + PC_2, //D47/A12 - 1:SPI2_MISO 2:ADC123_IN12 + PC_3, //D48/A13 - 1:SPI2_MOSI 2:ADC123_IN13 + PC_4, //D49/A14 - 1: 2:ADC12_IN14 + PC_5, //D50/A15 - 1: 2:ADC12_IN15 + #if STM32F4X_PIN_NUM >= 144 + PF_3, //D51/A16 - 1:FSMC_A3 2:ADC3_IN9 + PF_4, //D52/A17 - 1:FSMC_A4 2:ADC3_IN14 + PF_5, //D53/A18 - 1:FSMC_A5 2:ADC3_IN15 + PF_6, //D54/A19 - 1:TIM10_CH1 2:ADC3_IN4 + PF_7, //D55/A20 - 1:TIM11_CH1 2:ADC3_IN5 + PF_8, //D56/A21 - 1:TIM13_CH1 2:ADC3_IN6 + PF_9, //D57/A22 - 1;TIM14_CH1 2:ADC3_IN7 + PF_10, //D58/A23 - 2:ADC3_IN8 + #endif +#endif +#if STM32F4X_PIN_NUM >= 100 //100 pins mcu, 82 gpio + PE_2, //D59 - 1:FSMC_A23 + PE_3, //D60 - 1:FSMC_A19 + PE_4, //D61 - 1:FSMC_A20 + PE_5, //D62 - 1:FSMC_A21 + PE_6, //D63 - 1:FSMC_A22 + PE_7, //D64 - 1:FSMC_D4 + PE_8, //D65 - 1:FSMC_D5 + PE_9, //D66 - 1:FSMC_D6 / TIM1_CH1 + PE_10, //D67 - 1:FSMC_D7 + PE_11, //D68 - 1:FSMC_D8 / TIM1_CH2 + PE_12, //D69 - 1:FSMC_D9 + PE_13, //D70 - 1:FSMC_D10 / TIM1_CH3 + PE_14, //D71 - 1:FSMC_D11 / TIM1_CH4 + PE_15, //D72 - 1:FSMC_D12 + PD_8, //D73 - 1:FSMC_D13 / USART3_TX + PD_9, //D74 - 1:FSMC_D14 / USART3_RX + PD_10, //D75 - 1:FSMC_D15 + PD_11, //D76 - 1:FSMC_A16 + PD_12, //D77 - 1:FSMC_A17 / TIM4_CH1 + PD_13, //D78 - 1:FSMC_A18 / TIM4_CH2 + PD_14, //D79 - 1:FSMC_D0 / TIM4_CH3 + PD_15, //D80 - 1:FSMC_D1 / TIM4_CH4 + PD_0, //D81 - 1:FSMC_D2 + PD_1, //D82 - 1:FSMC_D3 + PD_3, //D83 - 1:FSMC_CLK + PD_4, //D84 - 1:FSMC_NOE + PD_5, //D85 - 1:USART2_TX + PD_6, //D86 - 1:USART2_RX + PD_7, //D87 + PE_0, //D88 + PE_1, //D89 +#endif +#if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + PF_0, //D90 - 1:FSMC_A0 / I2C2_SDA + PF_1, //D91 - 1:FSMC_A1 / I2C2_SCL + PF_2, //D92 - 1:FSMC_A2 + PF_11, //D93 + PF_12, //D94 - 1:FSMC_A6 + PF_13, //D95 - 1:FSMC_A7 + PF_14, //D96 - 1:FSMC_A8 + PF_15, //D97 - 1:FSMC_A9 + PG_0, //D98 - 1:FSMC_A10 + PG_1, //D99 - 1:FSMC_A11 + PG_2, //D100 - 1:FSMC_A12 + PG_3, //D101 - 1:FSMC_A13 + PG_4, //D102 - 1:FSMC_A14 + PG_5, //D103 - 1:FSMC_A15 + PG_6, //D104 + PG_7, //D105 + PG_8, //D106 + PG_9, //D107 - 1:USART6_RX + PG_10, //D108 - 1:FSMC_NE3 + PG_11, //D109 + PG_12, //D110 - 1:FSMC_NE4 + PG_13, //D111 - 1:FSMC_A24 + PG_14, //D112 - 1:FSMC_A25 / USART6_TX + PG_15, //D113 +#endif +#if STM32F4X_PIN_NUM >= 176 //176 pins mcu, 140 gpio + PI_8, //D114 + PI_9, //D115 + PI_10, //D116 + PI_11, //D117 + PH_2, //D118 + PH_3, //D119 + PH_4, //D120 - 1:I2C2_SCL + PH_5, //D121 - 1:I2C2_SDA + PH_6, //D122 - 1:TIM12_CH1 + PH_7, //D123 - 1:I2C3_SCL + PH_8, //D124 - 1:I2C3_SDA + PH_9, //D125 - 1:TIM12_CH2 + PH_10, //D126 - 1:TIM5_CH1 + PH_11, //D127 - 1:TIM5_CH2 + PH_12, //D128 - 1:TIM5_CH3 + PH_13, //D129 + PH_14, //D130 + PH_15, //D131 + PI_0, //D132 - 1:TIM5_CH4 / SPI2_NSS + PI_1, //D133 - 1:SPI2_SCK + PI_2, //D134 - 1:TIM8_CH4 /SPI2_MISO + PI_3, //D135 - 1:SPI2_MOS + PI_4, //D136 + PI_5, //D137 - 1:TIM8_CH1 + PI_6, //D138 - 1:TIM8_CH2 + PI_7, //D139 - 1:TIM8_CH3 +#endif +}; + +#ifdef __cplusplus +} +#endif + +// ------------------------ + +#ifdef __cplusplus +extern "C" { +#endif + + /** + * @brief System Clock Configuration + * @param None + * @retval None + */ +WEAK void SystemClock_Config() { + + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + + /**Configure the main internal regulator output voltage + */ + __HAL_RCC_PWR_CLK_ENABLE(); + + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /**Initializes the CPU, AHB and APB busses clocks + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + _Error_Handler(__FILE__, __LINE__); + } + + /**Initializes the CPU, AHB and APB busses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK + | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { + _Error_Handler(__FILE__, __LINE__); + } + + /**Configure the Systick interrupt time + */ + HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); + + /**Configure the Systick + */ + HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); + + /* SysTick_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); +} + +#ifdef __cplusplus +} +#endif diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h new file mode 100644 index 000000000000..55b8a60e1058 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h @@ -0,0 +1,295 @@ +/* + ******************************************************************************* + * Copyright (c) 2017, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +#ifdef STM32F405RX + #define STM32F4X_PIN_NUM 64 //64 pins mcu, 51 gpio + #define STM32F4X_GPIO_NUM 51 + #define STM32F4X_ADC_NUM 16 +#elif defined(STM32F407_5VX) + #define STM32F4X_PIN_NUM 100 //100 pins mcu, 82 gpio + #define STM32F4X_GPIO_NUM 82 + #define STM32F4X_ADC_NUM 16 +#elif defined(STM32F407_5ZX) + #define STM32F4X_PIN_NUM 144 //144 pins mcu, 114 gpio + #define STM32F4X_GPIO_NUM 114 + #define STM32F4X_ADC_NUM 24 +#elif defined(STM32F407IX) + #define STM32F4X_PIN_NUM 176 //176 pins mcu, 140 gpio + #define STM32F4X_GPIO_NUM 140 + #define STM32F4X_ADC_NUM 24 +#else + #error "no match MCU defined" +#endif + +#if STM32F4X_PIN_NUM >= 64 //64 pins mcu, 51 gpio + #define PC13 0 + #define PC14 1 //OSC32_IN + #define PC15 2 //OSC32_OUT + #define PH0 3 //OSC_IN + #define PH1 4 //OSC_OUT + #define PB2 5 //BOOT1 + #define PB10 6 //1:SPI2_SCK / I2C2_SCL / USART3_TX / TIM2_CH3 + #define PB11 7 //1:I2C2_SDA / USART3_RX / TIM2_CH4 + #define PB12 8 //1:SPI2_NSS / OTG_HS_ID + #define PB13 9 //1:SPI2_SCK 2:OTG_HS_VBUS + #define PB14 10 //1:SPI2_MISO / TIM12_CH1 / OTG_HS_DM + #define PB15 11 //SPI2_MOSI / TIM12_CH2 / OTG_HS_DP + #define PC6 12 //1:TIM8_CH1 / SDIO_D6 / USART6_TX / TIM3_CH1 + #define PC7 13 //1:TIM8_CH2 / SDIO_D7 / USART6_RX / TIM3_CH2 + #define PC8 14 //1:TIM8_CH3 / SDIO_D0 / TIM3_CH3 + #define PC9 15 //1:TIM8_CH4 / SDIO_D1 / TIM3_CH4 + #define PA8 16 //1:TIM1_CH1 / I2C3_SCL / OTG_FS_SOF + #define PA9 17 //1:USART1_TX / TIM1_CH2 2:OTG_FS_VBUS + #define PA10 18 //1:USART1_RX / TIM1_CH3 / OTG_FS_ID + #define PA11 19 //1:TIM1_CH4 / OTG_FS_DM + #define PA12 20 //1:OTG_FS_DP + #define PA13 21 //0:JTMS-SWDIO + #define PA14 22 //0:JTCK-SWCLK + #define PA15 23 //0:JTDI 1:SPI3_NSS / SPI1_NSS + #define PC10 24 //1:UART4_TX / SPI3_SCK / SDIO_D2 / USART3_TX + #define PC11 25 //1:UART4_RX / SPI3_MISO / SDIO_D3 / USART3_RX + #define PC12 26 //1:UART5_TX / SPI3_MOSI / SDIO_CK + #define PD2 27 //1:UART5_RX / SDIO_CMD + #define PB3 28 //0:JTDO 1:SPI3_SCK / TIM2_CH2 / SPI1_SCK + #define PB4 29 //0:NJTRST 1:SPI3_MISO / TIM3_CH1 / SPI1_MISO + #define PB5 30 //1:TIM3_CH2 / SPI1_MOSI / SPI3_MOSI + #define PB6 31 //1:I2C1_SCL / TIM4_CH1 / USART1_TX + #define PB7 32 //1:I2C1_SDA / TIM4_CH2 / USART1_RX + #define PB8 33 //1:I2C1_SCL / TIM4_CH3 / SDIO_D4 / TIM10_CH1 + #define PB9 34 //1:I2C1_SDA / TIM4_CH4 / SDIO_D5 / TIM11_CH1 / SPI2_NSS + #define PA0 35 //1:UART4_TX / TIM5_CH1 2:ADC123_IN0 + #define PA1 36 //1:UART4_RX / TIM5_CH2 / TIM2_CH2 2:ADC123_IN1 + #define PA2 37 //1:USART2_TX /TIM5_CH3 / TIM9_CH1 / TIM2_CH3 2:ADC123_IN2 + #define PA3 38 //1:USART2_RX /TIM5_CH4 / TIM9_CH2 / TIM2_CH4 2:ADC123_IN3 + #define PA4 39 //NOT FT 1:SPI1_NSS / SPI3_NSS / USART2_CK 2:ADC12_IN4 / DAC_OUT1 + #define PA5 40 //NOT FT 1:SPI1_SCK 2:ADC12_IN5 / DAC_OUT2 + #define PA6 41 //1:SPI1_MISO / TIM13_CH1 / TIM3_CH1 2:ADC12_IN6 + #define PA7 42 //1:SPI1_MOSI / TIM14_CH1 / TIM3_CH2 2:ADC12_IN7 + #define PB0 43 //1:TIM3_CH3 2:ADC12_IN8 + #define PB1 44 //1:TIM3_CH4 2:ADC12_IN9 + #define PC0 45 //1: 2:ADC123_IN10 + #define PC1 46 //1: 2:ADC123_IN11 + #define PC2 47 //1:SPI2_MISO 2:ADC123_IN12 + #define PC3 48 //1:SPI2_MOSI 2:ADC123_IN13 + #define PC4 49 //1: 2:ADC12_IN14 + #define PC5 50 //1: 2:ADC12_IN15 + #if STM32F4X_PIN_NUM >= 144 + #define PF3 51 //1:FSMC_A3 2:ADC3_IN9 + #define PF4 52 //1:FSMC_A4 2:ADC3_IN14 + #define PF5 53 //1:FSMC_A5 2:ADC3_IN15 + #define PF6 54 //1:TIM10_CH1 2:ADC3_IN4 + #define PF7 55 //1:TIM11_CH1 2:ADC3_IN5 + #define PF8 56 //1:TIM13_CH1 2:ADC3_IN6 + #define PF9 57 //1;TIM14_CH1 2:ADC3_IN7 + #define PF10 58 //2:ADC3_IN8 + #endif +#endif +#if STM32F4X_PIN_NUM >= 100 //100 pins mcu, 82 gpio + #define PE2 (35+STM32F4X_ADC_NUM) //1:FSMC_A23 + #define PE3 (36+STM32F4X_ADC_NUM) //1:FSMC_A19 + #define PE4 (37+STM32F4X_ADC_NUM) //1:FSMC_A20 + #define PE5 (38+STM32F4X_ADC_NUM) //1:FSMC_A21 + #define PE6 (39+STM32F4X_ADC_NUM) //1:FSMC_A22 + #define PE7 (40+STM32F4X_ADC_NUM) //1:FSMC_D4 + #define PE8 (41+STM32F4X_ADC_NUM) //1:FSMC_D5 + #define PE9 (42+STM32F4X_ADC_NUM) //1:FSMC_D6 / TIM1_CH1 + #define PE10 (43+STM32F4X_ADC_NUM) //1:FSMC_D7 + #define PE11 (44+STM32F4X_ADC_NUM) //1:FSMC_D8 / TIM1_CH2 + #define PE12 (45+STM32F4X_ADC_NUM) //1:FSMC_D9 + #define PE13 (46+STM32F4X_ADC_NUM) //1:FSMC_D10 / TIM1_CH3 + #define PE14 (47+STM32F4X_ADC_NUM) //1:FSMC_D11 / TIM1_CH4 + #define PE15 (48+STM32F4X_ADC_NUM) //1:FSMC_D12 + #define PD8 (49+STM32F4X_ADC_NUM) //1:FSMC_D13 / USART3_TX + #define PD9 (50+STM32F4X_ADC_NUM) //1:FSMC_D14 / USART3_RX + #define PD10 (51+STM32F4X_ADC_NUM) //1:FSMC_D15 + #define PD11 (52+STM32F4X_ADC_NUM) //1:FSMC_A16 + #define PD12 (53+STM32F4X_ADC_NUM) //1:FSMC_A17 / TIM4_CH1 + #define PD13 (54+STM32F4X_ADC_NUM) //1:FSMC_A18 / TIM4_CH2 + #define PD14 (55+STM32F4X_ADC_NUM) //1:FSMC_D0 / TIM4_CH3 + #define PD15 (56+STM32F4X_ADC_NUM) //1:FSMC_D1 / TIM4_CH4 + #define PD0 (57+STM32F4X_ADC_NUM) //1:FSMC_D2 + #define PD1 (58+STM32F4X_ADC_NUM) //1:FSMC_D3 + #define PD3 (59+STM32F4X_ADC_NUM) //1:FSMC_CLK + #define PD4 (60+STM32F4X_ADC_NUM) //1:FSMC_NOE + #define PD5 (61+STM32F4X_ADC_NUM) //1:USART2_TX + #define PD6 (62+STM32F4X_ADC_NUM) //1:USART2_RX + #define PD7 (63+STM32F4X_ADC_NUM) + #define PE0 (64+STM32F4X_ADC_NUM) + #define PE1 (65+STM32F4X_ADC_NUM) +#endif +#if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio + #define PF0 (66+STM32F4X_ADC_NUM) //1:FSMC_A0 / I2C2_SDA + #define PF1 (67+STM32F4X_ADC_NUM) //1:FSMC_A1 / I2C2_SCL + #define PF2 (68+STM32F4X_ADC_NUM) //1:FSMC_A2 + #define PF11 (69+STM32F4X_ADC_NUM) + #define PF12 (70+STM32F4X_ADC_NUM) //1:FSMC_A6 + #define PF13 (71+STM32F4X_ADC_NUM) //1:FSMC_A7 + #define PF14 (72+STM32F4X_ADC_NUM) //1:FSMC_A8 + #define PF15 (73+STM32F4X_ADC_NUM) //1:FSMC_A9 + #define PG0 (74+STM32F4X_ADC_NUM) //1:FSMC_A10 + #define PG1 (75+STM32F4X_ADC_NUM) //1:FSMC_A11 + #define PG2 (76+STM32F4X_ADC_NUM) //1:FSMC_A12 + #define PG3 (77+STM32F4X_ADC_NUM) //1:FSMC_A13 + #define PG4 (78+STM32F4X_ADC_NUM) //1:FSMC_A14 + #define PG5 (79+STM32F4X_ADC_NUM) //1:FSMC_A15 + #define PG6 (80+STM32F4X_ADC_NUM) + #define PG7 (81+STM32F4X_ADC_NUM) + #define PG8 (82+STM32F4X_ADC_NUM) + #define PG9 (83+STM32F4X_ADC_NUM) //1:USART6_RX + #define PG10 (84+STM32F4X_ADC_NUM) //1:FSMC_NE3 + #define PG11 (85+STM32F4X_ADC_NUM) + #define PG12 (86+STM32F4X_ADC_NUM) //1:FSMC_NE4 + #define PG13 (87+STM32F4X_ADC_NUM) //1:FSMC_A24 + #define PG14 (88+STM32F4X_ADC_NUM) //1:FSMC_A25 / USART6_TX + #define PG15 (89+STM32F4X_ADC_NUM) +#endif +#if STM32F4X_PIN_NUM >= 176 //176 pins mcu, 140 gpio + #define PI8 (90+STM32F4X_ADC_NUM) + #define PI9 (91+STM32F4X_ADC_NUM) + #define PI10 (92+STM32F4X_ADC_NUM) + #define PI11 (93+STM32F4X_ADC_NUM) + #define PH2 (94+STM32F4X_ADC_NUM) + #define PH3 (95+STM32F4X_ADC_NUM) + #define PH4 (96+STM32F4X_ADC_NUM) //1:I2C2_SCL + #define PH5 (97+STM32F4X_ADC_NUM) //1:I2C2_SDA + #define PH6 (98+STM32F4X_ADC_NUM) //1:TIM12_CH1 + #define PH7 (99+STM32F4X_ADC_NUM) //1:I2C3_SCL + #define PH8 (100+STM32F4X_ADC_NUM) //1:I2C3_SDA + #define PH9 (101+STM32F4X_ADC_NUM) //1:TIM12_CH2 + #define PH10 (102+STM32F4X_ADC_NUM) //1:TIM5_CH1 + #define PH11 (103+STM32F4X_ADC_NUM) //1:TIM5_CH2 + #define PH12 (104+STM32F4X_ADC_NUM) //1:TIM5_CH3 + #define PH13 (105+STM32F4X_ADC_NUM) + #define PH14 (106+STM32F4X_ADC_NUM) + #define PH15 (107+STM32F4X_ADC_NUM) + #define PI0 (108+STM32F4X_ADC_NUM) //1:TIM5_CH4 / SPI2_NSS + #define PI1 (109+STM32F4X_ADC_NUM) //1:SPI2_SCK + #define PI2 (110+STM32F4X_ADC_NUM) //1:TIM8_CH4 /SPI2_MISO + #define PI3 (111+STM32F4X_ADC_NUM) //1:SPI2_MOS + #define PI4 (112+STM32F4X_ADC_NUM) + #define PI5 (113+STM32F4X_ADC_NUM) //1:TIM8_CH1 + #define PI6 (114+STM32F4X_ADC_NUM) //1:TIM8_CH2 + #define PI7 (115+STM32F4X_ADC_NUM) //1:TIM8_CH3 +#endif + + +// This must be a literal +#define NUM_DIGITAL_PINS (STM32F4X_GPIO_NUM) +// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS (STM32F4X_ADC_NUM) +#define NUM_ANALOG_FIRST 35 + +// Below ADC, DAC and PWM definitions already done in the core +// Could be redefined here if needed +// ADC resolution is 12bits +//#define ADC_RESOLUTION 12 +//#define DACC_RESOLUTION 12 + +// PWM resolution +/* + * BEWARE: + * Changing this value from the default (1000) will affect the PWM output value of analogWrite (to a PWM pin) + * Since the pin is toggled on capture, if you change the frequency of the timer you have to adapt the compare value (analogWrite thinks you did) + */ +//#define PWM_FREQUENCY 20000 +//The bottom values are the default and don't need to be redefined +//#define PWM_RESOLUTION 8 +//#define PWM_MAX_DUTY_CYCLE 255 + +// Below SPI and I2C definitions already done in the core +// Could be redefined here if differs from the default one +// SPI Definitions +#define PIN_SPI_MOSI PB15 +#define PIN_SPI_MISO PB14 +#define PIN_SPI_SCK PB13 +#define PIN_SPI_SS PB12 + +// I2C Definitions +#define PIN_WIRE_SDA PB7 +#define PIN_WIRE_SCL PB6 + +// Timer Definitions +//Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c +#define TIMER_TONE TIM2 +#define TIMER_SERIAL TIM7 + +// Do not use basic timer: OC is required +#define TIMER_SERVO TIM6 //TODO: advanced-control timers don't work + +// UART Definitions +// Define here Serial instance number to map on Serial generic name +#define SERIAL_UART_INSTANCE 1 //ex: 2 for Serial2 (USART2) +// DEBUG_UART could be redefined to print on another instance than 'Serial' +//#define DEBUG_UART ((USART_TypeDef *) U(S)ARTX) // ex: USART3 +// DEBUG_UART baudrate, default: 9600 if not defined +//#define DEBUG_UART_BAUDRATE x +// DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART +//#define DEBUG_PINNAME_TX PX_n // PinName used for TX + +// Default pin used for 'Serial' instance (ex: ST-Link) +// Mandatory for Firmata +#define PIN_SERIAL_RX PA10 +#define PIN_SERIAL_TX PA9 + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_HARDWARE Serial1 +#endif diff --git a/buildroot/share/PlatformIO/variants/FYSETC_S6/PeripheralPins.c b/buildroot/share/PlatformIO/variants/FYSETC_S6/PeripheralPins.c new file mode 100644 index 000000000000..1d2238edcb44 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/FYSETC_S6/PeripheralPins.c @@ -0,0 +1,361 @@ +/* + ******************************************************************************* + * Copyright (c) 2016, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + */ +#include "Arduino.h" +#include "PeripheralPins.h" + +// ===== +// Note: Commented lines are alternative possibilities which are not used per default. +// If you change them, you will have to know what you do +// ===== + + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +const PinMap PinMap_ADC[] = { + // {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 + // {PA_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0 + // {PA_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0 + // {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + // {PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 + // {PA_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 + // {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + // {PA_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 + // {PA_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + // {PA_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 + // {PA_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_IN3 + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + // {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 + // {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 + // {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 + // {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + // {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 + // {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + // {PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 + // {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + // {PB_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8 + // {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 + // {PB_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 + // {PC_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 + // {PC_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_IN10 + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 + // {PC_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 + // {PC_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11 + {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 + // {PC_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12 + // {PC_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 + {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 + // {PC_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13 + // {PC_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC3_IN13 + {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 + // {PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14 + // {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 + // {PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15 + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +const PinMap PinMap_DAC[] = { + // {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 + // {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 - LD2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SDA[] = { + // {PB_3, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + // {PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + // {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + // {PC_7, FMPI2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_FMPI2C1)}, + // {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + // {PC_12, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SCL[] = { + // {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + // {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + // {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + // {PC_6, FMPI2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_FMPI2C1)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +const PinMap PinMap_PWM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + // {PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + // {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + // {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - STLink Tx + // {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 - STLink Tx + // {PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - STLink Tx + // {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - STLink Rx + // {PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 - STLink Rx + // {PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - STLink Rx + {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + // {PA_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + {PA_6, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + // {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + // {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + // {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + // {PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + // {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + // {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + // {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // Fan0, TIM8_CH2N + // {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + // {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // Fan1, TIM8_CH3N + {PB_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // Fan2, TIM2_CH4 + {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // E0 Heater, TIM2_CH2 + {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // E1 Heater, TIM3_CH1 + {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // LED G, TIM3_CH2 + {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // LED R, TIM4_CH1 + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // LED B, TIM4_CH2 + // {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + // {PB_8, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + // {PB_9, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + // {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PB_14, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 + // {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + // {PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + {PB_15, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2 + // {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + // {PB_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + // {PC_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 + // {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 + {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + // {PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 + // {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 + {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_TX[] = { + // {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + // {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + // {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + // {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + // {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + // {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PD_2, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + // {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_RX[] = { + // {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + // {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + // {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + // {PC_5, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + // {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + // {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + // {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_RTS[] = { + // {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + // {PA_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + // {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + // {PC_8, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART5)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_CTS[] = { + // {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + // {PB_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + // {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + // {PC_9, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART5)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_0, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)}, + // {PB_2, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)}, + // {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + // {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PC_1, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)}, + // {PC_1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI3)}, + // {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + // {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PA_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + // {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PC_7, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + // {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + // {PB_4, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)}, + // {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + // {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +#ifdef HAL_CAN_MODULE_ENABLED +const PinMap PinMap_CAN_RD[] = { + // {PA_11, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + // {PB_5, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + // {PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + // {PB_12, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_CAN_MODULE_ENABLED +const PinMap PinMap_CAN_TD[] = { + // {PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + // {PB_6, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + // {PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, + // {PB_13, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, + {NC, NP, 0} +}; +#endif + +//*** ETHERNET *** + +//*** No Ethernet *** + +//*** QUADSPI *** + +#ifdef HAL_QSPI_MODULE_ENABLED +const PinMap PinMap_QUADSPI[] = { + // {PA_1, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO3 + // {PB_2, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_CLK + // {PB_6, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QSPI)}, // QUADSPI_BK1_NCS + // {PC_9, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO0 + // {PC_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO1 + // {PC_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK2_NCS + {NC, NP, 0} +}; +#endif + +//*** USB *** + +#ifdef HAL_PCD_MODULE_ENABLED +const PinMap PinMap_USB_OTG_FS[] = { + // {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF + // {PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)}, // USB_OTG_FS_VBUS + // {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; +#endif + +#ifdef HAL_PCD_MODULE_ENABLED +const PinMap PinMap_USB_OTG_HS[] = { + {NC, NP, 0} +}; +#endif + + diff --git a/buildroot/share/PlatformIO/variants/FYSETC_S6/PinNamesVar.h b/buildroot/share/PlatformIO/variants/FYSETC_S6/PinNamesVar.h new file mode 100644 index 000000000000..77f1689b3d76 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/FYSETC_S6/PinNamesVar.h @@ -0,0 +1,30 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 +SYS_WKUP1 = PA_0, /* SYS_WKUP0 */ +#endif +#ifdef PWR_WAKEUP_PIN2 +SYS_WKUP2 = NC, +#endif +#ifdef PWR_WAKEUP_PIN3 +SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 +SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 +SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 +SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 +SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 +SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON +USB_OTG_FS_DM = PA_11, +USB_OTG_FS_DP = PA_12, +#endif diff --git a/buildroot/share/PlatformIO/variants/FYSETC_S6/ldscript.ld b/buildroot/share/PlatformIO/variants/FYSETC_S6/ldscript.ld new file mode 100644 index 000000000000..2a61072cb17e --- /dev/null +++ b/buildroot/share/PlatformIO/variants/FYSETC_S6/ldscript.ld @@ -0,0 +1,187 @@ +/* +***************************************************************************** +** + +** File : LinkerScript.ld +** +** Abstract : Linker script for STM32F407VETx Device with +** 512KByte FLASH, 128KByte RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2014 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20020000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200;; /* required amount of heap */ +_Min_Stack_Size = 0x400;; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x8010000, LENGTH = 512K +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text ALIGN(4): + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata ALIGN(4): + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + /*_siccmram = LOADADDR(.ccmram);*/ + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(4); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(4); + } >RAM + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.cpp b/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.cpp new file mode 100644 index 000000000000..7e3df41f1bf0 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.cpp @@ -0,0 +1,201 @@ +/* + Copyright (c) 2011 Arduino. 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 +*/ + +#include "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Pin number +const PinName digitalPin[] = { + PA_0, //D0 + PA_1, //D1 + PA_2, //D2 + PA_3, //D3 + PA_4, //D4 + PA_5, //D5 + PA_6, //D6 + PA_7, //D7 + PA_8, //D8 + PA_9, //D9 + PA_10, //D10 + PA_11, //D11 + PA_12, //D12 + PA_13, //D13 + PA_14, //D14 + PA_15, //D15 + PB_0, //D16 + PB_1, //D17 + PB_2, //D18 + PB_3, //D19 + PB_4, //D20 + PB_5, //D21 + PB_6, //D22 + PB_7, //D23 + PB_8, //D24 + PB_9, //D25 + PB_10, //D26 + PB_11, //D27 + PB_12, //D28 + PB_13, //D29 + PB_14, //D30 + PB_15, //D31 + PC_0, //D32 + PC_1, //D33 + PC_2, //D34 + PC_3, //D35 + PC_4, //D36 + PC_5, //D37 + PC_6, //D38 + PC_7, //D39 + PC_8, //D40 + PC_9, //D41 + PC_10, //D42 + PC_11, //D43 + PC_12, //D44 + PC_13, //D45 + PC_14, //D46 + PC_15, //D47 + PD_0, //D48 + PD_1, //D49 + PD_2, //D50 + PD_3, //D51 + PD_4, //D52 + PD_5, //D53 + PD_6, //D54 + PD_7, //D55 + PD_8, //D56 + PD_9, //D57 + PD_10, //D58 + PD_11, //D59 + PD_12, //D60 + PD_13, //D61 + PD_14, //D62 + PD_15, //D63 + PE_0, //D64 + PE_1, //D65 + PE_2, //D66 + PE_3, //D67 + PE_4, //D68 + PE_5, //D69 + PE_6, //D70 + PE_7, //D71 + PE_8, //D72 + PE_9, //D73 + PE_10, //D74 + PE_11, //D75 + PE_12, //D76 + PE_13, //D77 + PE_14, //D78 + PE_15, //D79 + + //Duplicated ADC Pins + PA_3, //D80/A0 + PA_4, //D81/A1 + PC_0, //D82/A2 + PC_1, //D83/A3 + PC_2, //D84/A4 + PC_3, //D85/A5 + PC_4 //D86/A6 +}; + +#ifdef __cplusplus +} +#endif + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief System Clock Configuration + * The system Clock is configured as follow : + * System Clock source = PLL (HSE) + * SYSCLK(Hz) = 180000000 + * HCLK(Hz) = 180000000 + * AHB Prescaler = 1 + * APB1 Prescaler = 4 + * APB2 Prescaler = 2 + * HSE Frequency(Hz) = 12000000 + * PLL_M = 6 + * PLL_N = 180 + * PLL_P = 2 + * PLL_Q = 7 + * VDD(V) = 3.3 + * Main regulator output voltage = Scale1 mode + * Flash Latency(WS) = 5 + * @param None + * @retval None + */ +WEAK void SystemClock_Config(void) +{ + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + +#ifdef HAL_PWR_MODULE_ENABLED + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); +#endif + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = 6; + RCC_OscInitStruct.PLL.PLLN = 180; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + RCC_OscInitStruct.PLL.PLLR = 2; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + HAL_PWREx_EnableOverDrive(); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | + RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLRCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); + + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.PLLSAI.PLLSAIM = 6; + PeriphClkInitStruct.PLLSAI.PLLSAIN = 96; + PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; + PeriphClkInitStruct.PLLSAIDivQ = 1; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLSAIP; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); +} + +#ifdef __cplusplus +} +#endif diff --git a/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.h b/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.h new file mode 100644 index 000000000000..d37956e8a25f --- /dev/null +++ b/buildroot/share/PlatformIO/variants/FYSETC_S6/variant.h @@ -0,0 +1,181 @@ +/* + Copyright (c) 2011 Arduino. 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 +*/ + +#ifndef _VARIANT_ARDUINO_STM32_ +#define _VARIANT_ARDUINO_STM32_ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +#define PA0 0 //D0 +#define PA1 1 //D1 +#define PA2 2 //D2 +#define PA3 3 //D3 +#define PA4 4 //D4 +#define PA5 5 //D5 +#define PA6 6 //D6 +#define PA7 7 //D7 +#define PA8 8 //D8 +#define PA9 9 //D9 +#define PA10 10 //D10 +#define PA11 11 //D11 +#define PA12 12 //D12 +#define PA13 13 //D13 +#define PA14 14 //D14 +#define PA15 15 //D15 +#define PB0 16 //D16 +#define PB1 17 //D17 +#define PB2 18 //D18 +#define PB3 19 //D19 +#define PB4 20 //D20 +#define PB5 21 //D21 +#define PB6 22 //D22 +#define PB7 23 //D23 +#define PB8 24 //D24 +#define PB9 25 //D25 +#define PB10 26 //D26 +#define PB11 27 //D27 +#define PB12 28 //D28 +#define PB13 29 //D29 +#define PB14 30 //D30 +#define PB15 31 //D31 +#define PC0 32 //D32 +#define PC1 33 //D33 +#define PC2 34 //D34 +#define PC3 35 //D35 +#define PC4 36 //D36 +#define PC5 37 //D37 +#define PC6 38 //D38 +#define PC7 39 //D39 +#define PC8 40 //D40 +#define PC9 41 //D41 +#define PC10 42 //D42 +#define PC11 43 //D43 +#define PC12 44 //D44 +#define PC13 45 //D45 +#define PC14 46 //D46 +#define PC15 47 //D47 +#define PD0 48 //D48 +#define PD1 49 //D49 +#define PD2 50 //D50 +#define PD3 51 //D51 +#define PD4 52 //D52 +#define PD5 53 //D53 +#define PD6 54 //D54 +#define PD7 55 //D55 +#define PD8 56 //D56 +#define PD9 57 //D57 +#define PD10 58 //D58 +#define PD11 59 //D59 +#define PD12 60 //D60 +#define PD13 61 //D61 +#define PD14 62 //D62 +#define PD15 63 //D63 +#define PE0 64 //D64 +#define PE1 65 //D65 +#define PE2 66 //D66 +#define PE3 67 //D67 +#define PE4 68 //D68 +#define PE5 69 //D69 +#define PE6 70 //D70 +#define PE7 71 //D71 +#define PE8 72 //D72 +#define PE9 73 //D73 +#define PE10 74 //D74 +#define PE11 75 //D75 +#define PE12 76 //D76 +#define PE13 77 //D77 +#define PE14 78 //D78 +#define PE15 79 //D79 + +// This must be a literal with the same value as PEND +#define NUM_DIGITAL_PINS 87 +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS 7 +#define NUM_ANALOG_FIRST 80 + +// PWM resolution +#define PWM_RESOLUTION 8 +#define PWM_FREQUENCY 20000 // >= 20 Khz => inaudible noise for fans +#define PWM_MAX_DUTY_CYCLE 255 + +// SPI Definitions +#define PIN_SPI_SS PA4 +#define PIN_SPI_MOSI PA7 +#define PIN_SPI_MISO PA6 +#define PIN_SPI_SCK PA5 + +// I2C Definitions +#define PIN_WIRE_SDA PB9 +#define PIN_WIRE_SCL PB8 + +// Timer Definitions +// Do not use timer used by PWM pin. See PinMap_PWM. +#define TIMER_TONE TIM6 +#define TIMER_SERVO TIM2 +#define TIMER_SERIAL TIM7 + +// UART Definitions +//#define SERIAL_UART_INSTANCE 1 // Connected to EXP3 header +/* Enable Serial 3 */ +#define HAVE_HWSERIAL1 +#define HAVE_HWSERIAL3 + +// Default pin used for 'Serial' instance (ex: ST-Link) +// Mandatory for Firmata +#define PIN_SERIAL_RX PA10 +#define PIN_SERIAL_TX PA9 + +/* HAL configuration */ +#define HSE_VALUE 12000000U + +#define FLASH_PAGE_SIZE ((uint32_t)(4*1024)) + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_HARDWARE_OPEN Serial +#endif + +#endif /* _VARIANT_ARDUINO_STM32_ */ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/PeripheralPins.c index 4e6a71d80162..6b6cfdbcb0b8 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/PeripheralPins.c +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/PeripheralPins.c @@ -3,8 +3,10 @@ * Copyright (c) 2019, STMicroelectronics * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. @@ -40,58 +42,58 @@ //*** ADC *** #ifdef HAL_ADC_MODULE_ENABLED -const PinMap PinMap_ADC[] = { +WEAK const PinMap PinMap_ADC[] = { {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 - // {PA_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0 - // {PA_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0 + //{PA_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0 + //{PA_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0 {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 - // {PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 - // {PA_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 - // {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + //{PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 + //{PA_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1 + //{PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 {PA_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 - // {PA_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2 - // {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 - // {PA_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 + //{PA_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2 + //{PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + //{PA_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 {PA_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_IN3 {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 - // {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 - // {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 + //{PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 + //{PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 #if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG) - // {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 - // {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 - // {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 - // {PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 - // {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + //{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + //{PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 + //{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + //{PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 + //{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 #endif {PB_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8 {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 - // {PB_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 - // {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 - // {PC_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 + //{PB_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 + //{PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 + //{PC_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 {PC_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_IN10 {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 - // {PC_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 - // {PC_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11 - // {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 + //{PC_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 + //{PC_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11 + //{PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 {PC_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12 - // {PC_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 - // {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 - // {PC_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13 + //{PC_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12 + //{PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 + //{PC_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13 {PC_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC3_IN13 - // {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 + //{PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 {PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14 - // {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 + //{PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 {PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15 #if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG) - // {PF_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_IN9 - // {PF_4, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC3_IN14 - // {PF_5, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC3_IN15 + //{PF_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_IN9 + //{PF_4, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC3_IN14 + //{PF_5, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC3_IN15 {PF_6, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC3_IN4 {PF_7, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC3_IN5 {PF_8, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_IN6 - // {PF_9, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_IN7 - // {PF_10, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC3_IN8 + //{PF_9, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_IN7 + //{PF_10, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC3_IN8 #endif {NC, NP, 0} }; @@ -100,7 +102,7 @@ const PinMap PinMap_ADC[] = { //*** DAC *** #ifdef HAL_DAC_MODULE_ENABLED -const PinMap PinMap_DAC[] = { +WEAK const PinMap PinMap_DAC[] = { {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 {NC, NP, 0} @@ -110,7 +112,7 @@ const PinMap PinMap_DAC[] = { //*** I2C *** #ifdef HAL_I2C_MODULE_ENABLED -const PinMap PinMap_I2C_SDA[] = { +WEAK const PinMap PinMap_I2C_SDA[] = { {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, @@ -123,7 +125,7 @@ const PinMap PinMap_I2C_SDA[] = { #endif #ifdef HAL_I2C_MODULE_ENABLED -const PinMap PinMap_I2C_SCL[] = { +WEAK const PinMap PinMap_I2C_SCL[] = { {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, @@ -138,61 +140,61 @@ const PinMap PinMap_I2C_SCL[] = { //*** PWM *** #ifdef HAL_TIM_MODULE_ENABLED -const PinMap PinMap_PWM[] = { +WEAK const PinMap PinMap_PWM[] = { {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - // {PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + //{PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - // {PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + //{PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - // {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 - // {PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 + //{PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 + //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - // {PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 - // {PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 + //{PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 + //{PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - // {PA_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + //{PA_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - // {PA_6, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 - // {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + //{PA_6, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + //{PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - // {PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N - // {PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + //{PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + //{PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 - // {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - // {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + //{PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 - // {PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N - // {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + //{PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + //{PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - // {PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N - // {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + //{PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + //{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + //{PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + //{PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N - {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N - {PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + //{PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + //{PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N {PB_14, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 - {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N - {PB_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + //{PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + //{PB_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N {PB_15, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2 - {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 {PC_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 - {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + //{PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 {PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 - {PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 - {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + //{PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 + //{PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 {PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 {PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 @@ -220,47 +222,47 @@ const PinMap PinMap_PWM[] = { //*** SERIAL *** #ifdef HAL_UART_MODULE_ENABLED -const PinMap PinMap_UART_TX[] = { +WEAK const PinMap PinMap_UART_TX[] = { {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, - // {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + //{PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, {PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, {PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, #if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG) - // {PG_14, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + //{PG_14, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, #endif {NC, NP, 0} }; #endif #ifdef HAL_UART_MODULE_ENABLED -const PinMap PinMap_UART_RX[] = { +WEAK const PinMap PinMap_UART_RX[] = { {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, - // {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + //{PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, {PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, #if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG) - // {PG_9, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + //{PG_9, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, #endif {NC, NP, 0} }; #endif #ifdef HAL_UART_MODULE_ENABLED -const PinMap PinMap_UART_RTS[] = { +WEAK const PinMap PinMap_UART_RTS[] = { {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, @@ -275,7 +277,7 @@ const PinMap PinMap_UART_RTS[] = { #endif #ifdef HAL_UART_MODULE_ENABLED -const PinMap PinMap_UART_CTS[] = { +WEAK const PinMap PinMap_UART_CTS[] = { {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, @@ -292,9 +294,9 @@ const PinMap PinMap_UART_CTS[] = { //*** SPI *** #ifdef HAL_SPI_MODULE_ENABLED -const PinMap PinMap_SPI_MOSI[] = { +WEAK const PinMap PinMap_SPI_MOSI[] = { {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + //{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, @@ -304,9 +306,9 @@ const PinMap PinMap_SPI_MOSI[] = { #endif #ifdef HAL_SPI_MODULE_ENABLED -const PinMap PinMap_SPI_MISO[] = { +WEAK const PinMap PinMap_SPI_MISO[] = { {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + //{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, @@ -316,9 +318,9 @@ const PinMap PinMap_SPI_MISO[] = { #endif #ifdef HAL_SPI_MODULE_ENABLED -const PinMap PinMap_SPI_SCLK[] = { +WEAK const PinMap PinMap_SPI_SCLK[] = { {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + //{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, @@ -328,10 +330,10 @@ const PinMap PinMap_SPI_SCLK[] = { #endif #ifdef HAL_SPI_MODULE_ENABLED -const PinMap PinMap_SPI_SSEL[] = { +WEAK const PinMap PinMap_SPI_SSEL[] = { {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + //{PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + //{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, @@ -342,7 +344,7 @@ const PinMap PinMap_SPI_SSEL[] = { //*** CAN *** #ifdef HAL_CAN_MODULE_ENABLED -const PinMap PinMap_CAN_RD[] = { +WEAK const PinMap PinMap_CAN_RD[] = { {PA_11, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, {PB_5, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, {PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, @@ -353,7 +355,7 @@ const PinMap PinMap_CAN_RD[] = { #endif #ifdef HAL_CAN_MODULE_ENABLED -const PinMap PinMap_CAN_TD[] = { +WEAK const PinMap PinMap_CAN_TD[] = { {PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, {PB_6, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, {PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, @@ -366,7 +368,7 @@ const PinMap PinMap_CAN_TD[] = { //*** ETHERNET *** #ifdef HAL_ETH_MODULE_ENABLED -const PinMap PinMap_Ethernet[] = { +WEAK const PinMap PinMap_Ethernet[] = { {PA_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS {PA_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_REF_CLK|ETH_RX_CLK {PA_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDIO @@ -401,10 +403,10 @@ const PinMap PinMap_Ethernet[] = { //*** USB *** #ifdef HAL_PCD_MODULE_ENABLED -const PinMap PinMap_USB_OTG_FS[] = { - // {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF - // {PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS - // {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID +WEAK const PinMap PinMap_USB_OTG_FS[] = { + //{PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF + //{PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS + //{PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP {NC, NP, 0} @@ -412,7 +414,7 @@ const PinMap PinMap_USB_OTG_FS[] = { #endif #ifdef HAL_PCD_MODULE_ENABLED -const PinMap PinMap_USB_OTG_HS[] = { +WEAK const PinMap PinMap_USB_OTG_HS[] = { #ifdef USE_USB_HS_IN_FS {PA_4, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_SOF {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID @@ -436,3 +438,21 @@ const PinMap PinMap_USB_OTG_HS[] = { {NC, NP, 0} }; #endif + +//*** SD *** + +#ifdef HAL_SD_MODULE_ENABLED +WEAK const PinMap PinMap_SD[] = { + //{PB_8, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D4 + //{PB_9, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D5 + //{PC_6, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D6 + //{PC_7, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D7 + {PC_8, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D0 + {PC_9, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D1 + {PC_10, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D2 + {PC_11, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D3 + {PC_12, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CK + {PD_2, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CMD + {NC, NP, 0} +}; +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h similarity index 82% rename from buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h rename to buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h index 2e111dff89d5..92e9fecb4d63 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h @@ -17,8 +17,8 @@ */ /* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H +#ifndef __STM32F4xx_HAL_CONF_CUSTOM +#define __STM32F4xx_HAL_CONF_CUSTOM #ifdef __cplusplus extern "C" { @@ -28,7 +28,7 @@ extern "C" { /* Exported constants --------------------------------------------------------*/ /* ########################## Module Selection ############################## */ -/** + /** * @brief This is the list of modules to be used in the HAL driver */ #define HAL_MODULE_ENABLED @@ -73,7 +73,9 @@ extern "C" { /* #define HAL_SMARTCARD_MODULE_ENABLED */ /* #define HAL_WWDG_MODULE_ENABLED */ #define HAL_CORTEX_MODULE_ENABLED -#define HAL_PCD_MODULE_ENABLED +#ifndef HAL_PCD_MODULE_ENABLED + #define HAL_PCD_MODULE_ENABLED //Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE) +#endif /* #define HAL_HCD_MODULE_ENABLED */ /* #define HAL_FMPI2C_MODULE_ENABLED */ /* #define HAL_SPDIFRX_MODULE_ENABLED */ @@ -87,12 +89,12 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) -#define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#ifndef HSE_VALUE +#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ -#if !defined (HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#ifndef HSE_STARTUP_TIMEOUT +#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */ /** @@ -100,27 +102,27 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSI is used as system clock source, directly or through the PLL). */ -#if !defined (HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#ifndef HSI_VALUE +#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ #endif /* HSI_VALUE */ /** * @brief Internal Low Speed oscillator (LSI) value. */ -#if !defined (LSI_VALUE) -#define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#ifndef LSI_VALUE +#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations -in voltage and temperature.*/ +in voltage and temperature. */ /** * @brief External Low Speed oscillator (LSE) value. */ -#if !defined (LSE_VALUE) -#define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#ifndef LSE_VALUE +#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ -#if !defined (LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#ifndef LSE_STARTUP_TIMEOUT +#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ #endif /* LSE_STARTUP_TIMEOUT */ /** @@ -128,8 +130,8 @@ in voltage and temperature.*/ * This value is used by the I2S HAL module to compute the I2S clock source * frequency, this source is inserted directly through I2S_CKIN pad. */ -#if !defined (EXTERNAL_CLOCK_VALUE) -#define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#ifndef EXTERNAL_CLOCK_VALUE +#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ #endif /* EXTERNAL_CLOCK_VALUE */ /* Tip: To avoid modifying this file each time you need to use different HSE, @@ -139,12 +141,24 @@ in voltage and temperature.*/ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#if !defined (VDD_VALUE) +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#endif +#if !defined (TICK_INT_PRIORITY) +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ +#endif +#if !defined (USE_RTOS) #define USE_RTOS 0U +#endif +#if !defined (PREFETCH_ENABLE) #define PREFETCH_ENABLE 1U +#endif +#if !defined (INSTRUCTION_CACHE_ENABLE) #define INSTRUCTION_CACHE_ENABLE 1U +#endif +#if !defined (DATA_CACHE_ENABLE) #define DATA_CACHE_ENABLE 1U +#endif #define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ #define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ @@ -215,32 +229,32 @@ in voltage and temperature.*/ /* DP83848_PHY_ADDRESS Address*/ #define DP83848_PHY_ADDRESS 0x01U /* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +#define PHY_RESET_DELAY 0x000000FFU /* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) +#define PHY_CONFIG_DELAY 0x00000FFFU -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU /* Section 3: Common PHY Registers */ -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ /* Section 4: Extended PHY Registers */ #define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ @@ -251,11 +265,12 @@ in voltage and temperature.*/ /* ################## SPI peripheral configuration ########################## */ /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ +#ifndef USE_SPI_CRC #define USE_SPI_CRC 0U +#endif /* Includes ------------------------------------------------------------------*/ /** @@ -455,10 +470,10 @@ in voltage and temperature.*/ #endif /* HAL_MMC_MODULE_ENABLED */ /* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT +#ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function + * @param expr If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. @@ -475,7 +490,7 @@ void assert_failed(uint8_t *file, uint32_t line); } #endif -#endif /* __STM32F4xx_HAL_CONF_H */ +#endif /* __STM32F4xx_HAL_CONF_CUSTOM_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/ldscript.ld index cdbbfcdcd187..efe2db5cd472 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/ldscript.ld @@ -1,10 +1,11 @@ /* ***************************************************************************** ** -** File : LinkerScript.ld + +** File : lscript.ld ** -** Abstract : Linker script for STM32F407VETx Device with -** 512KByte FLASH, 128KByte RAM +** Abstract : Linker script for STM32F407(VZ)(EG)Tx Device with +** 512/1024KByte FLASH, 128KByte RAM ** ** Set heap size, stack size and stack location according ** to application requirements. @@ -17,13 +18,32 @@ ** Distribution: The file is distributed as is, without any warranty ** of any kind. ** -** (c)Copyright Ac6. -** You may use this file as-is or modify it according to the needs of your -** project. Distribution of this file (unmodified or modified) is not -** permitted. Ac6 permit registered System Workbench for MCU users the -** rights to distribute the assembled, compiled & linked contents of this -** file as part of an application binary file, provided that it is built -** using the System Workbench for MCU toolchain. +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2014 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** ***************************************************************************** */ @@ -32,7 +52,7 @@ ENTRY(Reset_Handler) /* Highest address of the user mode stack */ -_estack = 0x20020000; /* end of RAM */ +_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */ /* Generate a link error if heap and stack don't fit into RAM */ _Min_Heap_Size = 0x200; /* required amount of heap */ _Min_Stack_Size = 0x400; /* required amount of stack */ @@ -40,9 +60,9 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY { -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K +FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET } /* Define output sections */ @@ -57,7 +77,7 @@ SECTIONS } >FLASH /* The program code and other data goes into FLASH */ - .text ALIGN(8): + .text ALIGN(4): { . = ALIGN(4); *(.text) /* .text sections (code) */ @@ -164,12 +184,12 @@ SECTIONS /* User_heap_stack section, used to check that there is enough RAM left */ ._user_heap_stack : { - . = ALIGN(8); + . = ALIGN(4); PROVIDE ( end = . ); PROVIDE ( _end = . ); . = . + _Min_Heap_Size; . = . + _Min_Stack_Size; - . = ALIGN(8); + . = ALIGN(4); } >RAM /* Remove information from the standard libraries */ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp index 01523224e11e..e78718c8a64a 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp @@ -28,12 +28,13 @@ ******************************************************************************* */ -#include "variant.h" +#include "pins_arduino.h" #ifdef __cplusplus extern "C" { #endif +#if defined(ARDUINO_BLACK_F407VE) || defined(ARDUINO_BLACK_F407VG) // Pin number // This array allows to wrap Arduino pin number(Dx or x) // to STM32 PinName (PX_n) @@ -93,6 +94,80 @@ const PinName digitalPin[] = { PB_13, PB_14, PB_4, }; +#endif // ARDUINO_BLACK_F407VE || ARDUINO_BLACK_F407VG + +#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG) +const PinName digitalPin[] = { + // Left Side + //Ext //Int + //GND //5V + //GND //3V3 + PB_12, PB_13, + PB_14, PB_15, + PD_8, PD_9, + PD_10, PD_11, + PD_12, PD_13, + PD_14, PD_15, + PG_2, PG_3, + PG_4, PG_5, + PG_6, PG_7, + PG_8, PC_6, + PC_7, PC_8, + PC_9, PA_8, + PA_9, PA_10, + PA_11, PA_12, // PA_11: USB_DM, PA_12: USB_DP + PA_13, PA_14, + PA_15, PC_10, + PC_11, PC_12, + PD_0, PD_1, + PD_2, PD_3, + PD_4, PD_5, + PD_6, PD_7, + PG_9, PG_10, + PG_11, PG_12, + PG_13, PG_14, + PG_15, PB_3, + PB_4, PB_5, + PB_6, PB_7, + PB_8, PB_9, + + // Right Side + //Int //Ext + //3V3 //3V3 + //BOOT1 //BOOT0 + //GND //GND + //VREF+ //GND + PB_10, PB_11, + PE_14, PE_15, + PE_12, PE_13, + PE_10, PE_11, + PE_8, PE_9, + PG_1, PE_7, + PF_15, PG_0, + PF_13, PF_14, + PF_11, PF_12, + PB_2, // PB1 PB2 Inverted to allow contiguous analog pins + PB_1, + PC_5, PB_0, + PA_7, PC_4, + PA_5, PA_6, + PA_3, PA_4, + PA_1, PA_2, + PC_3, PA_0, // PA_0(WK_UP): BUT K_UP) + PC_1, PC_2, + /*PF_10,*/PC_0, // PF_10: Moved to allow contiguous analog pins + PF_8, /*PF_9,*/ // PF_9: Moved to allow contiguous analog pins + PF_6, PF_7, + PF_10, PF_9, // PF_10: LED D2, PF_9: LED D1 (active low) + PF_4, PF_5, + PF_2, PF_3, + PF_0, PF_1, + PE_6, PC_13, + PE_4, PE_5, // PE_4: BUT K0, PE_5: BUT K1 + PE_2, PE_3, + PE_0, PE_1, +}; +#endif // ARDUINO_BLACK_F407ZE || ARDUINO_BLACK_F407ZG #ifdef __cplusplus } diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h index 9e383114e67f..4e7e299f1c86 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h @@ -30,11 +30,9 @@ #ifndef _VARIANT_ARDUINO_STM32_ #define _VARIANT_ARDUINO_STM32_ - /*---------------------------------------------------------------------------- * Headers *----------------------------------------------------------------------------*/ -#include "PeripheralPins.h" #ifdef __cplusplus extern "C" { @@ -43,7 +41,7 @@ extern "C" { /*---------------------------------------------------------------------------- * Pins *----------------------------------------------------------------------------*/ -extern const PinName digitalPin[]; +#if defined(ARDUINO_BLACK_F407VE) || defined(ARDUINO_BLACK_F407VG) // Right Side #define PE1 0 #define PE0 1 @@ -135,9 +133,9 @@ extern const PinName digitalPin[]; //#define DACC_RESOLUTION 12 // PWM resolution -#define PWM_RESOLUTION 8 -#define PWM_FREQUENCY 20000 -#define PWM_MAX_DUTY_CYCLE 255 +//#define PWM_RESOLUTION 8 +//#define PWM_FREQUENCY 20000 +//#define PWM_MAX_DUTY_CYCLE 255 // On-board LED pin number #define LED_D2 PA6 @@ -146,6 +144,138 @@ extern const PinName digitalPin[]; // Board specific button #define BTN_K_UP PA0 +#endif // ARDUINO_BLACK_F407VE || ARDUINO_BLACK_F407VG + +#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG) +// Left Side +#define PB12 0 +#define PB13 1 +#define PB14 2 +#define PB15 3 +#define PD8 4 +#define PD9 5 +#define PD10 6 +#define PD11 7 +#define PD12 8 +#define PD13 9 +#define PD14 10 +#define PD15 11 +#define PG2 12 +#define PG3 13 +#define PG4 14 +#define PG5 15 +#define PG6 16 +#define PG7 17 +#define PG8 18 +#define PC6 19 +#define PC7 20 +#define PC8 21 +#define PC9 22 +#define PA8 23 +#define PA9 24 +#define PA10 25 +#define PA11 26 // USB_DM +#define PA12 27 // USB_DP +#define PA13 28 +#define PA14 29 +#define PA15 30 +#define PC10 31 +#define PC11 32 +#define PC12 33 +#define PD0 34 +#define PD1 35 +#define PD2 36 +#define PD3 37 +#define PD4 38 +#define PD5 39 +#define PD6 40 +#define PD7 41 +#define PG9 42 +#define PG10 43 +#define PG11 44 +#define PG12 45 +#define PG13 46 +#define PG14 47 +#define PG15 48 +#define PB3 49 +#define PB4 50 +#define PB5 51 +#define PB6 52 +#define PB7 53 +#define PB8 54 +#define PB9 55 + +// Right Side +#define PB10 56 +#define PB11 57 +#define PE14 58 +#define PE15 59 +#define PE12 60 +#define PE13 61 +#define PE10 62 +#define PE11 63 +#define PE8 64 +#define PE9 65 +#define PG1 66 +#define PE7 67 +#define PF15 68 +#define PG0 69 +#define PF13 70 +#define PF14 71 +#define PF11 72 +#define PF12 73 +#define PB2 74 +#define PB1 75 // A0 +#define PC5 76 // A1 +#define PB0 77 // A2 +#define PA7 78 // A3 +#define PC4 79 // A4 +#define PA5 80 // A5 +#define PA6 81 // A6 +#define PA3 82 // A7 +#define PA4 83 // A8 +#define PA1 84 // A9 +#define PA2 85 // A10 +#define PC3 86 // A11 +#define PA0 87 // A12/PA_0(WK_UP): BUT K_UP) +#define PC1 88 // A13 +#define PC2 89 // A14 +#define PC0 90 // A15 +#define PF8 91 // A16 +#define PF6 92 // A17 +#define PF7 93 // A18 +#define PF9 94 // LED D1 (active low) +#define PF10 95 // LED D2 (active low) +#define PF4 96 +#define PF5 97 +#define PF2 98 +#define PF3 99 +#define PF0 100 +#define PF1 101 +#define PE6 102 +#define PC13 103 +#define PE4 104 // BUT K0 +#define PE5 105 // BUT K1 +#define PE2 106 +#define PE3 107 +#define PE0 108 +#define PE1 109 + +// This must be a literal +#define NUM_DIGITAL_PINS 110 +// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS 19 +#define NUM_ANALOG_FIRST 75 + +// On-board LED pin number +#define LED_D2 PF10 +#define LED_D1 PF9 + +// Board specific button +#define BTN_WK_UP PA0 + +#endif // ARDUINO_BLACK_F407ZE || ARDUINO_BLACK_F407ZG + #define LED_BUILTIN LED_D2 #define LED_GREEN LED_D2 @@ -189,6 +319,10 @@ extern const PinName digitalPin[]; #define PIN_SERIAL_RX PA10 #define PIN_SERIAL_TX PA9 +/* Extra HAL modules */ +#define HAL_DAC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED + #ifdef __cplusplus } // extern "C" #endif diff --git a/buildroot/share/atom/auto_build.py b/buildroot/share/atom/auto_build.py index cca690e2e273..a256590d48e1 100644 --- a/buildroot/share/atom/auto_build.py +++ b/buildroot/share/atom/auto_build.py @@ -24,7 +24,7 @@ ####################################### # -# Revision: 2.0.1 +# Revision: 2.1.0 # # Description: script to automate PlatformIO builds # CLI: python auto_build.py build_option @@ -75,10 +75,10 @@ import sys import os -pwd = os.getcwd() # make sure we're executing from the correct directory level +pwd = os.getcwd() # make sure we're executing from the correct directory level pwd = pwd.replace('\\', '/') if 0 <= pwd.find('buildroot/share/atom'): - pwd = pwd[ : pwd.find('buildroot/share/atom')] + pwd = pwd[:pwd.find('buildroot/share/atom')] os.chdir(pwd) print('pwd: ', pwd) @@ -93,14 +93,9 @@ print('\nWorking\n') -python_ver = sys.version_info[0] # major version - 2 or 3 +python_ver = sys.version_info[0] # major version - 2 or 3 -if python_ver == 2: - print("python version " + str(sys.version_info[0]) + "." + str(sys.version_info[1]) + "." + str(sys.version_info[2])) -else: - print("python version " + str(sys.version_info[0])) - print("This script only runs under python 2") - exit() +print("python version " + str(sys.version_info[0]) + "." + str(sys.version_info[1]) + "." + str(sys.version_info[2])) import platform current_OS = platform.system() @@ -123,8 +118,6 @@ # reboot ######### - - ########################################################################################## # # popup to get input from user @@ -133,78 +126,83 @@ def get_answer(board_name, cpu_label_txt, cpu_a_txt, cpu_b_txt): + if python_ver == 2: + import Tkinter as tk + else: + import tkinter as tk - if python_ver == 2: - import Tkinter as tk - else: - import tkinter as tk - - def CPU_exit_3(): # forward declare functions - - CPU_exit_3_() - def CPU_exit_4(): - - CPU_exit_4_() - def kill_session(): - kill_session_() + def CPU_exit_3(): # forward declare functions + CPU_exit_3_() - root_get_answer = tk.Tk() + def got_answer(): + got_answer_() - root_get_answer.chk_state_1 = 1 # declare variables used by TK and enable + def kill_session(): + kill_session_() - chk_state_1 = 0 # set initial state of check boxes + root_get_answer = tk.Tk() + root_get_answer.title('') + root_get_answer.withdraw() + root_get_answer.deiconify() + def disable_event(): + pass - global get_answer_val - get_answer_val = 2 # return get_answer_val, set default to match chk_state_1 default + root_get_answer.protocol("WM_DELETE_WINDOW", disable_event) + root_get_answer.resizable(False, False) + root_get_answer.radio_state = 1 # declare variables used by TK and enable - l1 = tk.Label(text=board_name, - fg = "light green", - bg = "dark green", - font = "Helvetica 12 bold").grid(row=1) + global get_answer_val + get_answer_val = 2 # return get_answer_val, set default to match radio_state default - l2 = tk.Label(text=cpu_label_txt, - fg = "light green", - bg = "dark green", - font = "Helvetica 16 bold italic").grid(row=2) + radio_state = tk.IntVar() + radio_state.set(get_answer_val) - b4 = tk.Checkbutton(text=cpu_a_txt, - fg = "black", - font = "Times 20 bold ", - variable=chk_state_1, onvalue=1, offvalue=0, + l1 = tk.Label(text=board_name, fg="light green", bg="dark green", + font="default 14 bold").grid(row=0, columnspan=2, sticky='EW', ipadx=2, ipady=2) - command = CPU_exit_3).grid(row=3) + l2 = tk.Label(text=cpu_label_txt).grid(row=1, pady=4, columnspan=2, sticky='EW') - b5 = tk.Checkbutton(text=cpu_b_txt, - fg = "black", - font = "Times 20 bold ", - variable=chk_state_1, onvalue=0, offvalue=1, + b4 = tk.Radiobutton( + text=cpu_a_txt, + fg="black", + bg="lightgray", + relief=tk.SUNKEN, + selectcolor="green", + variable=radio_state, + value=1, + indicatoron=0, + command=CPU_exit_3 + ).grid(row=2, pady=1, ipady=2, ipadx=10, columnspan=2) - command = CPU_exit_4).grid(row=4) # use same variable but inverted so they will track - b6 = tk.Button(text="CONFIRM", - fg = "blue", - font = "Times 20 bold ", - command = root_get_answer.destroy).grid(row=5, pady=4) + b5 = tk.Radiobutton( + text=cpu_b_txt, + fg="black", + bg="lightgray", + relief=tk.SUNKEN, + selectcolor="green", + variable=radio_state, + value=2, + indicatoron=0, + command=CPU_exit_3 + ).grid(row=3, pady=1, ipady=2, ipadx=10, columnspan=2) # use same variable but inverted so they will track - b7 = tk.Button(text="CANCEL", - fg = "red", - font = "Times 12 bold ", - command = kill_session).grid(row=6, pady=4) + b6 = tk.Button(text="Cancel", fg="red", command=kill_session).grid(row=4, column=0, padx=4, pady=4, ipadx=2, ipady=2) + b7 = tk.Button(text="Continue", fg="green", command=got_answer).grid(row=4, column=1, padx=4, pady=4, ipadx=2, ipady=2) - def CPU_exit_3_(): - global get_answer_val - get_answer_val = 1 + def got_answer_(): + root_get_answer.destroy() - def CPU_exit_4_(): - global get_answer_val - get_answer_val = 2 + def CPU_exit_3_(): + global get_answer_val + get_answer_val = radio_state.get() - def kill_session_(): - raise SystemExit(0) # kill everything + def kill_session_(): + raise SystemExit(0) # kill everything - root_get_answer.mainloop() + root_get_answer.mainloop() # end - get answer @@ -213,102 +211,101 @@ def kill_session_(): # move custom board definitions from project folder to PlatformIO # def resolve_path(path): - import os - - # turn the selection into a partial path - - if 0 <= path.find('"'): - path = path[ path.find('"') : ] - if 0 <= path.find(', line '): - path = path.replace(', line ', ':') - path = path.replace('"', '') - - #get line and column numbers - line_num = 1 - column_num = 1 - line_start = path.find(':', 2) # use 2 here so don't eat Windows full path - column_start = path.find(':', line_start + 1) - if column_start == -1: - column_start = len(path) - column_end = path.find(':', column_start + 1) - if column_end == -1: - column_end = len(path) - if 0 <= line_start: - line_num = path[ line_start + 1 : column_start] - if line_num == '': - line_num = 1 - if not(column_start == column_end): - column_num = path[ column_start + 1 : column_end] - if column_num == '': - column_num = 0 - - index_end = path.find(',') - if 0 <= index_end: - path = path[ : index_end] # delete comma and anything after - index_end = path.find(':', 2) - if 0 <= index_end: - path = path[ : path.find(':', 2)] # delete the line number and anything after - - path = path.replace('\\','/') - - if 1 == path.find(':') and current_OS == 'Windows': - return path, line_num, column_num # found a full path - no need for further processing - elif 0 == path.find('/') and (current_OS == 'Linux' or current_OS == 'Darwin'): - return path, line_num, column_num # found a full path - no need for further processing + import os + + # turn the selection into a partial path + + if 0 <= path.find('"'): + path = path[path.find('"'):] + if 0 <= path.find(', line '): + path = path.replace(', line ', ':') + path = path.replace('"', '') + + # get line and column numbers + line_num = 1 + column_num = 1 + line_start = path.find(':', 2) # use 2 here so don't eat Windows full path + column_start = path.find(':', line_start + 1) + if column_start == -1: + column_start = len(path) + column_end = path.find(':', column_start + 1) + if column_end == -1: + column_end = len(path) + if 0 <= line_start: + line_num = path[line_start + 1:column_start] + if line_num == '': + line_num = 1 + if column_start != column_end: + column_num = path[column_start + 1:column_end] + if column_num == '': + column_num = 0 + + index_end = path.find(',') + if 0 <= index_end: + path = path[:index_end] # delete comma and anything after + index_end = path.find(':', 2) + if 0 <= index_end: + path = path[:path.find(':', 2)] # delete the line number and anything after + + path = path.replace('\\', '/') + + if 1 == path.find(':') and current_OS == 'Windows': + return path, line_num, column_num # found a full path - no need for further processing + elif 0 == path.find('/') and (current_OS == 'Linux' or current_OS == 'Darwin'): + return path, line_num, column_num # found a full path - no need for further processing + + else: + + # resolve as many '../' as we can + while 0 <= path.find('../'): + end = path.find('../') - 1 + start = path.find('/') + while 0 <= path.find('/', start) and end > path.find('/', start): + start = path.find('/', start) + 1 + path = path[0:start] + path[end + 4:] + + # this is an alternative to the above - it just deletes the '../' section + # start_temp = path.find('../') + # while 0 <= path.find('../',start_temp): + # start = path.find('../',start_temp) + # start_temp = start + 1 + # if 0 <= start: + # path = path[start + 2 : ] + + start = path.find('/') + if start != 0: # make sure path starts with '/' + while 0 == path.find(' '): # eat any spaces at the beginning + path = path[1:] + path = '/' + path + + if current_OS == 'Windows': + search_path = path.replace('/', '\\') # os.walk uses '\' in Windows + else: + search_path = path - else: + start_path = os.path.abspath('') + + # search project directory for the selection + found = False + full_path = '' + for root, directories, filenames in os.walk(start_path): + for filename in filenames: + if 0 <= root.find('.git'): # don't bother looking in this directory + break + full_path = os.path.join(root, filename) + if 0 <= full_path.find(search_path): + found = True + break + if found: + break - # resolve as many '../' as we can - while 0 <= path.find('../'): - end = path.find('../') - 1 - start = path.find('/') - while 0 <= path.find('/',start) and end > path.find('/',start): - start = path.find('/',start) + 1 - path = path[0:start] + path[end + 4: ] - - # this is an alternative to the above - it just deletes the '../' section - # start_temp = path.find('../') - # while 0 <= path.find('../',start_temp): - # start = path.find('../',start_temp) - # start_temp = start + 1 - # if 0 <= start: - # path = path[start + 2 : ] - - - start = path.find('/') - if not(0 == start): # make sure path starts with '/' - while 0 == path.find(' '): # eat any spaces at the beginning - path = path[ 1 : ] - path = '/' + path - - if current_OS == 'Windows': - search_path = path.replace('/', '\\') # os.walk uses '\' in Windows - else: - search_path = path - - start_path = os.path.abspath('') - - # search project directory for the selection - found = False - full_path = '' - for root, directories, filenames in os.walk(start_path): - for filename in filenames: - if 0 <= root.find('.git'): # don't bother looking in this directory - break - full_path = os.path.join(root,filename) - if 0 <= full_path.find(search_path): - found = True - break - if found: - break - - return full_path, line_num, column_num + return full_path, line_num, column_num # end - resolve_path # -# Opens the file in the preferred editor at the line & column number +# Open the file in the preferred editor at the line & column number # If the preferred editor isn't already running then it tries the next. # If none are open then the system default is used. # @@ -319,314 +316,335 @@ def resolve_path(path): # 4. System default (opens at line 1, column 1 only) # def open_file(path): - import subprocess - file_path, line_num, column_num = resolve_path(path) - - if file_path == '' : - return - - if current_OS == 'Windows': - - editor_note = subprocess.check_output('wmic process where "name=' + "'notepad++.exe'" + '" get ExecutablePath') - editor_sublime = subprocess.check_output('wmic process where "name=' + "'sublime_text.exe'" + '" get ExecutablePath') - editor_atom = subprocess.check_output('wmic process where "name=' + "'atom.exe'" + '" get ExecutablePath') - - if 0 <= editor_note.find('notepad++.exe'): - start = editor_note.find('\n') + 1 - end = editor_note.find('\n',start + 5) -4 - editor_note = editor_note[ start : end] - command = file_path , ' -n' + str(line_num) , ' -c' + str(column_num) - subprocess.Popen([editor_note, command]) - - elif 0 <= editor_sublime.find('sublime_text.exe'): - start = editor_sublime.find('\n') + 1 - end = editor_sublime.find('\n',start + 5) -4 - editor_sublime = editor_sublime[ start : end] - command = file_path + ':' + line_num + ':' + column_num - subprocess.Popen([editor_sublime, command]) - - elif 0 <= editor_atom.find('atom.exe'): - start = editor_atom.find('\n') + 1 - end = editor_atom.find('\n',start + 5) -4 - editor_atom = editor_atom[ start : end] - command = file_path + ':' + str(line_num) + ':' + str(column_num) - subprocess.Popen([editor_atom, command]) - - else: - os.startfile(resolve_path(path)) # open file with default app - - elif current_OS == 'Linux': - - command = file_path + ':' + str(line_num) + ':' + str(column_num) - index_end = command.find(',') - if 0 <= index_end: - command = command[ : index_end] # sometimes a comma magically appears, don't want it - running_apps = subprocess.Popen('ps ax -o cmd', stdout=subprocess.PIPE, shell=True) - (output, err) = running_apps.communicate() - temp = output.split('\n') - - def find_editor_linux(name, search_obj): - for line in search_obj: - if 0 <= line.find(name): - path = line - return True, path - return False , '' - - (success_sublime, editor_path_sublime) = find_editor_linux('sublime_text',temp) - (success_atom, editor_path_atom) = find_editor_linux('atom',temp) - - if success_sublime: - subprocess.Popen([editor_path_sublime, command]) - - elif success_atom: - subprocess.Popen([editor_path_atom, command]) - - else: - os.system('xdg-open ' + file_path ) - - elif current_OS == 'Darwin': # MAC - - command = file_path + ':' + str(line_num) + ':' + str(column_num) - index_end = command.find(',') - if 0 <= index_end: - command = command[ : index_end] # sometimes a comma magically appears, don't want it - running_apps = subprocess.Popen('ps axwww -o command', stdout=subprocess.PIPE, shell=True) - (output, err) = running_apps.communicate() - temp = output.split('\n') - - def find_editor_mac(name, search_obj): - for line in search_obj: - if 0 <= line.find(name): - path = line - if 0 <= path.find('-psn'): - path = path[ : path.find('-psn') - 1 ] - return True, path - return False , '' - - (success_sublime, editor_path_sublime) = find_editor_mac('Sublime',temp) - (success_atom, editor_path_atom) = find_editor_mac('Atom',temp) - - if success_sublime: - subprocess.Popen([editor_path_sublime, command]) - - elif success_atom: - subprocess.Popen([editor_path_atom, command]) - - else: - os.system('open ' + file_path ) + import subprocess + file_path, line_num, column_num = resolve_path(path) + + if file_path == '': + return + + if current_OS == 'Windows': + + editor_note = subprocess.check_output('wmic process where "name=' + "'notepad++.exe'" + '" get ExecutablePath') + editor_sublime = subprocess.check_output('wmic process where "name=' + "'sublime_text.exe'" + '" get ExecutablePath') + editor_atom = subprocess.check_output('wmic process where "name=' + "'atom.exe'" + '" get ExecutablePath') + + if 0 <= editor_note.find('notepad++.exe'): + start = editor_note.find('\n') + 1 + end = editor_note.find('\n', start + 5) - 4 + editor_note = editor_note[start:end] + command = file_path, ' -n' + str(line_num), ' -c' + str(column_num) + subprocess.Popen([editor_note, command]) + + elif 0 <= editor_sublime.find('sublime_text.exe'): + start = editor_sublime.find('\n') + 1 + end = editor_sublime.find('\n', start + 5) - 4 + editor_sublime = editor_sublime[start:end] + command = file_path + ':' + line_num + ':' + column_num + subprocess.Popen([editor_sublime, command]) + + elif 0 <= editor_atom.find('atom.exe'): + start = editor_atom.find('\n') + 1 + end = editor_atom.find('\n', start + 5) - 4 + editor_atom = editor_atom[start:end] + command = file_path + ':' + str(line_num) + ':' + str(column_num) + subprocess.Popen([editor_atom, command]) + + else: + os.startfile(resolve_path(path)) # open file with default app + + elif current_OS == 'Linux': + + command = file_path + ':' + str(line_num) + ':' + str(column_num) + index_end = command.find(',') + if 0 <= index_end: + command = command[:index_end] # sometimes a comma magically appears, don't want it + running_apps = subprocess.Popen('ps ax -o cmd', stdout=subprocess.PIPE, shell=True) + (output, err) = running_apps.communicate() + temp = output.split('\n') + + def find_editor_linux(name, search_obj): + for line in search_obj: + if 0 <= line.find(name): + path = line + return True, path + return False, '' + + (success_sublime, editor_path_sublime) = find_editor_linux('sublime_text', temp) + (success_atom, editor_path_atom) = find_editor_linux('atom', temp) + + if success_sublime: + subprocess.Popen([editor_path_sublime, command]) + + elif success_atom: + subprocess.Popen([editor_path_atom, command]) + + else: + os.system('xdg-open ' + file_path) + + elif current_OS == 'Darwin': # MAC + + command = file_path + ':' + str(line_num) + ':' + str(column_num) + index_end = command.find(',') + if 0 <= index_end: + command = command[:index_end] # sometimes a comma magically appears, don't want it + running_apps = subprocess.Popen('ps axwww -o command', stdout=subprocess.PIPE, shell=True) + (output, err) = running_apps.communicate() + temp = output.split('\n') + + def find_editor_mac(name, search_obj): + for line in search_obj: + if 0 <= line.find(name): + path = line + if 0 <= path.find('-psn'): + path = path[:path.find('-psn') - 1] + return True, path + return False, '' + + (success_sublime, editor_path_sublime) = find_editor_mac('Sublime', temp) + (success_atom, editor_path_atom) = find_editor_mac('Atom', temp) + + if success_sublime: + subprocess.Popen([editor_path_sublime, command]) + + elif success_atom: + subprocess.Popen([editor_path_atom, command]) + + else: + os.system('open ' + file_path) + # end - open_file -# gets the last build environment +# Get the last build environment def get_build_last(): - env_last = '' - DIR_PWD = os.listdir('.') - if '.pioenvs' in DIR_PWD: - date_last = 0.0 - DIR__pioenvs = os.listdir('.pioenvs') - for name in DIR__pioenvs: - if 0 <= name.find('.') or 0 <= name.find('-'): # skip files in listing - continue - DIR_temp = os.listdir('.pioenvs/' + name) - for names_temp in DIR_temp: - - if 0 == names_temp.find('firmware.'): - date_temp = os.path.getmtime('.pioenvs/' + name + '/' + names_temp) - if date_temp > date_last: - date_last = date_temp - env_last = name - return env_last - - -# gets the board being built from the Configuration.h file -# returns: board name, major version of Marlin being used (1 or 2) + env_last = '' + DIR_PWD = os.listdir('.') + if '.pio' in DIR_PWD: + date_last = 0.0 + DIR__pioenvs = os.listdir('.pio') + for name in DIR__pioenvs: + if 0 <= name.find('.') or 0 <= name.find('-'): # skip files in listing + continue + DIR_temp = os.listdir('.pio/build/' + name) + for names_temp in DIR_temp: + + if 0 == names_temp.find('firmware.'): + date_temp = os.path.getmtime('.pio/build/' + name + '/' + names_temp) + if date_temp > date_last: + date_last = date_temp + env_last = name + return env_last + + +# Get the board being built from the Configuration.h file +# return: board name, major version of Marlin being used (1 or 2) def get_board_name(): - board_name = '' - # get board name - - with open('Marlin/Configuration.h', 'r') as myfile: - Configuration_h = myfile.read() - - Configuration_h = Configuration_h.split('\n') - Marlin_ver = 0 # set version to invalid number - for lines in Configuration_h: - if 0 == lines.find('#define CONFIGURATION_H_VERSION 01'): - Marlin_ver = 1 - if 0 == lines.find('#define CONFIGURATION_H_VERSION 02'): - Marlin_ver = 2 - board = lines.find(' BOARD_') + 1 - motherboard = lines.find(' MOTHERBOARD ') + 1 - define = lines.find('#define ') - comment = lines.find('//') - if (comment == -1 or comment > board) and \ - board > motherboard and \ - motherboard > define and \ - define >= 0 : - spaces = lines.find(' ', board) # find the end of the board substring - if spaces == -1: - board_name = lines[board : ] - else: - board_name = lines[board : spaces] - break - + board_name = '' + # get board name + + with open('Marlin/Configuration.h', 'r') as myfile: + Configuration_h = myfile.read() + + Configuration_h = Configuration_h.split('\n') + Marlin_ver = 0 # set version to invalid number + for lines in Configuration_h: + if 0 == lines.find('#define CONFIGURATION_H_VERSION 01'): + Marlin_ver = 1 + if 0 == lines.find('#define CONFIGURATION_H_VERSION 02'): + Marlin_ver = 2 + board = lines.find(' BOARD_') + 1 + motherboard = lines.find(' MOTHERBOARD ') + 1 + define = lines.find('#define ') + comment = lines.find('//') + if (comment == -1 or comment > board) and \ + board > motherboard and \ + motherboard > define and \ + define >= 0 : + spaces = lines.find(' ', board) # find the end of the board substring + if spaces == -1: + board_name = lines[board:] + else: + board_name = lines[board:spaces] + break - return board_name, Marlin_ver + return board_name, Marlin_ver -# extract first environment name it finds after the start position -# returns: environment name and position to start the next search from +# extract first environment name found after the start position +# return: environment name and position to start the next search from def get_env_from_line(line, start_position): - env = '' - next_position = -1 - env_position = line.find('env:', start_position) - if 0 < env_position: - next_position = line.find(' ', env_position + 4) - if 0 < next_position: - env = line[env_position + 4 : next_position] - else: - env = line[env_position + 4 : ] # at the end of the line - return env, next_position - + env = '' + next_position = -1 + env_position = line.find('env:', start_position) + if 0 < env_position: + next_position = line.find(' ', env_position + 4) + if 0 < next_position: + env = line[env_position + 4:next_position] + else: + env = line[env_position + 4:] # at the end of the line + return env, next_position -#scans pins.h for board name and returns the environment(s) it finds +# scan pins.h for board name and return the environment(s) found def get_starting_env(board_name_full, version): - # get environment starting point - - if version == 1: - path = 'Marlin/pins.h' - if version == 2: - path = 'Marlin/src/pins/pins.h' - with open(path, 'r') as myfile: - pins_h = myfile.read() - - env_A = '' - env_B = '' - env_C = '' - - board_name = board_name_full[ 6 : ] # only use the part after "BOARD_" since we're searching the pins.h file - pins_h = pins_h.split('\n') - environment = '' - board_line = '' - cpu_A = '' - cpu_B = '' - i = 0 - list_start_found = False - for lines in pins_h: - i = i + 1 # i is always one ahead of the index into pins_h - if 0 < lines.find("Unknown MOTHERBOARD value set in Configuration.h"): - break # no more - if 0 < lines.find('1280'): - list_start_found = True - if list_start_found == False: # skip lines until find start of CPU list - continue - board = lines.find(board_name) - comment_start = lines.find('// ') - cpu_A_loc = comment_start - cpu_B_loc = 0 - if board > 0: # need to look at the next line for environment info - cpu_line = pins_h[i] - comment_start = cpu_line.find('// ') - env_A, next_position = get_env_from_line(cpu_line, comment_start) # get name of environment & start of search for next - env_B, next_position = get_env_from_line(cpu_line, next_position) # get next environment, if it exists - env_C, next_position = get_env_from_line(cpu_line, next_position) # get next environment, if it exists - break - return env_A, env_B, env_C - - -# scans input string for CPUs that the users may need to select from -# returns: CPU name + # get environment starting point + + if version == 1: + path = 'Marlin/pins.h' + if version == 2: + path = 'Marlin/src/pins/pins.h' + with open(path, 'r') as myfile: + pins_h = myfile.read() + + env_A = '' + env_B = '' + env_C = '' + + board_name = board_name_full[6:] # only use the part after "BOARD_" since we're searching the pins.h file + pins_h = pins_h.split('\n') + environment = '' + board_line = '' + cpu_A = '' + cpu_B = '' + i = 0 + list_start_found = False + for lines in pins_h: + i = i + 1 # i is always one ahead of the index into pins_h + if 0 < lines.find("Unknown MOTHERBOARD value set in Configuration.h"): + break # no more + if 0 < lines.find('1280'): + list_start_found = True + if list_start_found == False: # skip lines until find start of CPU list + continue + board = lines.find(board_name) + comment_start = lines.find('// ') + cpu_A_loc = comment_start + cpu_B_loc = 0 + if board > 0: # need to look at the next line for environment info + cpu_line = pins_h[i] + comment_start = cpu_line.find('// ') + env_A, next_position = get_env_from_line(cpu_line, comment_start) # get name of environment & start of search for next + env_B, next_position = get_env_from_line(cpu_line, next_position) # get next environment, if it exists + env_C, next_position = get_env_from_line(cpu_line, next_position) # get next environment, if it exists + break + return env_A, env_B, env_C + + +# Scan input string for CPUs that users may need to select from +# return: CPU name def get_CPU_name(environment): - CPU_list = ('1280', '2560','644', '1284', 'LPC1768', 'DUE') - CPU_name = '' - for CPU in CPU_list: - if 0 < environment.find(CPU): - return CPU + CPU_list = ('1280', '2560', '644', '1284', 'LPC1768', 'DUE') + CPU_name = '' + for CPU in CPU_list: + if 0 < environment.find(CPU): + return CPU # get environment to be used for the build -# returns: environment +# return: environment def get_env(board_name, ver_Marlin): - def no_environment(): - print('ERROR - no environment for this board') - print(board_name) - raise SystemExit(0) # no environment so quit - def invalid_board(): - print('ERROR - invalid board') - print(board_name) - raise SystemExit(0) # quit if unable to find board + def no_environment(): + print('ERROR - no environment for this board') + print(board_name) + raise SystemExit(0) # no environment so quit + def invalid_board(): + print('ERROR - invalid board') + print(board_name) + raise SystemExit(0) # quit if unable to find board - CPU_question = ( ('1280', '2560', " 1280 or 2560 CPU? "), ('644', '1284', " 644 or 1284 CPU? ") ) + CPU_question = (('1280', '2560', '1280 or 2560 CPU?'), ('644', '1284', '644 or 1284 CPU?')) + + if 0 < board_name.find('MELZI'): + get_answer( + board_name, " Which flavor of Melzi? ", "Melzi (Optiboot bootloader)", "Melzi " + ) + if 1 == get_answer_val: + target_env = 'melzi_optiboot' + else: + target_env = 'melzi' + else: + env_A, env_B, env_C = get_starting_env(board_name, ver_Marlin) + + if env_A == '': + no_environment() + if env_B == '': + return env_A # only one environment so finished + + CPU_A = get_CPU_name(env_A) + CPU_B = get_CPU_name(env_B) + + for item in CPU_question: + if CPU_A == item[0]: + get_answer(board_name, item[2], item[0], item[1]) + if 2 == get_answer_val: + target_env = env_B + else: + target_env = env_A + return target_env - if 0 < board_name.find('MELZI') : - get_answer(' ' + board_name + ' ', " Which flavor of Melzi? ", "Melzi (Optiboot bootloader)", "Melzi ") - if 1 == get_answer_val: - target_env = 'melzi_optiboot' - else: - target_env = 'melzi' + if env_A == 'LPC1768': + if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'LPC1768_debug_and_upload'): + target_env = 'LPC1768_debug_and_upload' else: - env_A, env_B, env_C = get_starting_env(board_name, ver_Marlin) - - if env_A == '': - no_environment() - if env_B == '': - return env_A # only one environment so finished - - CPU_A = get_CPU_name(env_A) - CPU_B = get_CPU_name(env_B) - - for item in CPU_question: - if CPU_A == item[0]: - get_answer(' ' + board_name + ' ', item[2], item[0], item[1]) - if 2 == get_answer_val: - target_env = env_B - else: - target_env = env_A - return target_env - - if env_A == 'LPC1768': - if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'LPC1768_debug_and_upload'): - target_env = 'LPC1768_debug_and_upload' - else: - target_env = 'LPC1768' - elif env_A == 'DUE': - target_env = 'DUE' - if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'DUE_debug'): - target_env = 'DUE_debug' - elif env_B == 'DUE_USB': - get_answer(' ' + board_name + ' ', " DUE: need download port ", "USB (native USB) port", "Programming port ") - if 1 == get_answer_val: - target_env = 'DUE_USB' - else: - target_env = 'DUE' - else: - invalid_board() - - if build_type == 'traceback' and not(target_env == 'LPC1768_debug_and_upload' or target_env == 'DUE_debug') and Marlin_ver == 2: - print("ERROR - this board isn't setup for traceback") - print('board_name: ', board_name) - print('target_env: ', target_env) - raise SystemExit(0) - - return target_env + target_env = 'LPC1768' + elif env_A == 'DUE': + target_env = 'DUE' + if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'DUE_debug'): + target_env = 'DUE_debug' + elif env_B == 'DUE_USB': + get_answer(board_name, 'DUE Download Port?', '(Native) USB port', 'Programming port') + if 1 == get_answer_val: + target_env = 'DUE_USB' + else: + target_env = 'DUE' + elif env_A == 'STM32F103RC_bigtree' or env_A == 'STM32F103RE_bigtree': + if env_A == 'STM32F103RE_bigtree': + get_answer(board_name, 'MCU Type?', 'STM32F103RC', 'STM32F103RE') + if 1 == get_answer_val: + env_A = 'STM32F103RC_bigtree' + target_env = env_A + if env_A == 'STM32F103RC_bigtree': + get_answer(board_name, 'RCT6 Flash Size?', '512K', '256K') + if 1 == get_answer_val: + target_env += '_512K' + get_answer(board_name, 'USB Support?', 'USB', 'No USB') + if 1 == get_answer_val: + target_env += '_USB' + else: + invalid_board() + + if build_type == 'traceback' and target_env != 'LPC1768_debug_and_upload' and target_env != 'DUE_debug' and Marlin_ver == 2: + print("ERROR - this board isn't setup for traceback") + print('board_name: ', board_name) + print('target_env: ', target_env) + raise SystemExit(0) + + return target_env + # end - get_env + # puts screen text into queue so that the parent thread can fetch the data from this thread -import Queue -IO_queue = Queue.Queue() -PIO_queue = Queue.Queue() -def write_to_screen_queue(text, format_tag = 'normal'): - double_in = [text, format_tag] - IO_queue.put(double_in, block = False) +if python_ver == 2: + import Queue as queue +else: + import queue as queue +IO_queue = queue.Queue() + + +#PIO_queue = queue.Queue() not used! +def write_to_screen_queue(text, format_tag='normal'): + double_in = [text, format_tag] + IO_queue.put(double_in, block=False) # # send one line to the terminal screen with syntax highlighting # # input: unformatted text, flags from previous run -# returns: formatted text ready to go to the terminal, flags from this run +# return: formatted text ready to go to the terminal, flags from this run # # This routine remembers the status from call to call because previous # lines can affect how the current line is highlighted @@ -642,604 +660,643 @@ def write_to_screen_queue(text, format_tag = 'normal'): warning_continue = False line_counter = 0 + def line_print(line_input): - global warning - global warning_FROM - global error - global standard - global prev_line_COM - global next_line_warning - global warning_continue - global line_counter - - - - - # all '0' elements must precede all '1' elements or they'll be skipped - platformio_highlights = [ - ['Environment', 0, 'highlight_blue'], - ['[SKIP]', 1, 'warning'], - ['[ERROR]', 1, 'error'], - ['[SUCCESS]', 1, 'highlight_green'] - ] - - def write_to_screen_with_replace(text, highlights): # search for highlights & split line accordingly - did_something = False - for highlight in highlights: - found = text.find(highlight[0]) - if did_something == True: - break - if found >= 0 : - did_something = True - if 0 == highlight[1]: - found_1 = text.find(' ') - found_tab = text.find('\t') - if found_1 < 0 or found_1 > found_tab: - found_1 = found_tab - write_to_screen_queue(text[ : found_1 + 1 ]) - for highlight_2 in highlights: - if highlight[0] == highlight_2[0] : - continue - found = text.find(highlight_2[0]) - if found >= 0 : - found_space = text.find(' ', found_1 + 1) - found_tab = text.find('\t', found_1 + 1) - if found_space < 0 or found_space > found_tab: - found_space = found_tab - found_right = text.find(']', found + 1) - write_to_screen_queue(text[found_1 + 1 : found_space + 1 ], highlight[2]) - write_to_screen_queue(text[found_space + 1 : found + 1 ]) - write_to_screen_queue(text[found + 1 : found_right], highlight_2[2]) - write_to_screen_queue(text[found_right : ] + '\n') - break - break - if 1 == highlight[1]: + global warning + global warning_FROM + global error + global standard + global prev_line_COM + global next_line_warning + global warning_continue + global line_counter + + # all '0' elements must precede all '1' elements or they'll be skipped + platformio_highlights = [ + ['Environment', 0, 'highlight_blue'], ['[SKIP]', 1, 'warning'], ['[IGNORED]', 1, 'warning'], ['[ERROR]', 1, 'error'], + ['[FAILED]', 1, 'error'], ['[SUCCESS]', 1, 'highlight_green'] + ] + + def write_to_screen_with_replace(text, highlights): # search for highlights & split line accordingly + did_something = False + for highlight in highlights: + found = text.find(highlight[0]) + if did_something == True: + break + if found >= 0: + did_something = True + if 0 == highlight[1]: + found_1 = text.find(' ') + found_tab = text.find('\t') + if found_1 < 0 or found_1 > found_tab: + found_1 = found_tab + write_to_screen_queue(text[:found_1 + 1]) + for highlight_2 in highlights: + if highlight[0] == highlight_2[0]: + continue + found = text.find(highlight_2[0]) + if found >= 0: + found_space = text.find(' ', found_1 + 1) + found_tab = text.find('\t', found_1 + 1) + if found_space < 0 or found_space > found_tab: + found_space = found_tab found_right = text.find(']', found + 1) - write_to_screen_queue(text[ : found + 1 ]) - write_to_screen_queue(text[found + 1 : found_right ], highlight[2]) - write_to_screen_queue(text[found_right : ] + '\n') - break - if did_something == False: - r_loc = text.find('\r') + 1 - if r_loc > 0 and r_loc < len(text): # need to split this line - text = text.split('\r') - for line in text: - write_to_screen_queue(line + '\n') - else: - write_to_screen_queue(text + '\n') - # end - write_to_screen_with_replace - - - - # scan the line - line_counter = line_counter + 1 - max_search = len(line_input) - if max_search > 3 : - max_search = 3 - beginning = line_input[:max_search] - - # set flags - if 0 < line_input.find(': warning: '): # start of warning block - warning = True - warning_FROM = False - error = False - standard = False - prev_line_COM = False - prev_line_COM = False - warning_continue = True - if 0 < line_input.find('Thank you') or 0 < line_input.find('SUMMARY') : - warning = False #standard line found - warning_FROM = False - error = False - standard = True - prev_line_COM = False - warning_continue = False - elif beginning == 'War' or \ - beginning == '#er' or \ - beginning == 'In ' or \ - (beginning != 'Com' and prev_line_COM == True and not(beginning == 'Arc' or beginning == 'Lin' or beginning == 'Ind') or \ - next_line_warning == True): - warning = True #warning found - warning_FROM = False - error = False - standard = False - prev_line_COM = False - elif beginning == 'Com' or \ - beginning == 'Ver' or \ - beginning == ' [E' or \ - beginning == 'Rem' or \ - beginning == 'Bui' or \ - beginning == 'Ind' or \ - beginning == 'PLA': - warning = False #standard line found - warning_FROM = False - error = False - standard = True - prev_line_COM = False - warning_continue = False - elif beginning == '***': - warning = False # error found - warning_FROM = False - error = True - standard = False - prev_line_COM = False - elif 0 < line_input.find(': error:') or \ - 0 < line_input.find(': fatal error:'): # start of warning /error block - warning = False # error found - warning_FROM = False - error = True - standard = False - prev_line_COM = False - warning_continue = True - elif beginning == 'fro' and warning == True or \ - beginning == '.pi' : # start of warning /error block - warning_FROM = True - prev_line_COM = False - warning_continue = True - elif warning_continue == True: - warning = True - warning_FROM = False # keep the warning status going until find a standard line or an error - error = False - standard = False - prev_line_COM = False - warning_continue = True - + write_to_screen_queue(text[found_1 + 1:found_space + 1], highlight[2]) + write_to_screen_queue(text[found_space + 1:found + 1]) + write_to_screen_queue(text[found + 1:found_right], highlight_2[2]) + write_to_screen_queue(text[found_right:] + '\n') + break + break + if 1 == highlight[1]: + found_right = text.find(']', found + 1) + write_to_screen_queue(text[:found + 1]) + write_to_screen_queue(text[found + 1:found_right], highlight[2]) + write_to_screen_queue(text[found_right:] + '\n' + '\n') + break + if did_something == False: + r_loc = text.find('\r') + 1 + if r_loc > 0 and r_loc < len(text): # need to split this line + text = text.split('\r') + for line in text: + if line != '': + write_to_screen_queue(line + '\n') else: - warning = False # unknown so assume standard line - warning_FROM = False - error = False - standard = True - prev_line_COM = False - warning_continue = False - - if beginning == 'Com': - prev_line_COM = True - - # print based on flags - if standard == True: - write_to_screen_with_replace(line_input, platformio_highlights) #print white on black with substitutions - if warning == True: - write_to_screen_queue(line_input + '\n', 'warning') - if error == True: - write_to_screen_queue(line_input + '\n', 'error') -# end - line_print - - - -def run_PIO(dummy): - - ########################################################################## - # # - # run Platformio # - # # - ########################################################################## - - - # build platformio run -e target_env - # clean platformio run --target clean -e target_env - # upload platformio run --target upload -e target_env - # traceback platformio run --target upload -e target_env - # program platformio run --target program -e target_env - # test platformio test upload -e target_env - # remote platformio remote run --target upload -e target_env - # debug platformio debug -e target_env - - - global build_type - global target_env - global board_name - print('build_type: ', build_type) + write_to_screen_queue(text + '\n') + + # end - write_to_screen_with_replace + +# scan the line + line_counter = line_counter + 1 + max_search = len(line_input) + if max_search > 3: + max_search = 3 + beginning = line_input[:max_search] + + # set flags + if 0 < line_input.find(': warning: '): # start of warning block + warning = True + warning_FROM = False + error = False + standard = False + prev_line_COM = False + prev_line_COM = False + warning_continue = True + if 0 < line_input.find('Thank you') or 0 < line_input.find('SUMMARY'): + warning = False #standard line found + warning_FROM = False + error = False + standard = True + prev_line_COM = False + warning_continue = False + elif beginning == 'War' or \ + beginning == '#er' or \ + beginning == 'In ' or \ + (beginning != 'Com' and prev_line_COM == True and not(beginning == 'Arc' or beginning == 'Lin' or beginning == 'Ind') or \ + next_line_warning == True): + warning = True #warning found + warning_FROM = False + error = False + standard = False + prev_line_COM = False + elif beginning == 'Com' or \ + beginning == 'Ver' or \ + beginning == ' [E' or \ + beginning == 'Rem' or \ + beginning == 'Bui' or \ + beginning == 'Ind' or \ + beginning == 'PLA': + warning = False #standard line found + warning_FROM = False + error = False + standard = True + prev_line_COM = False + warning_continue = False + elif beginning == '***': + warning = False # error found + warning_FROM = False + error = True + standard = False + prev_line_COM = False + elif 0 < line_input.find(': error:') or \ + 0 < line_input.find(': fatal error:'): # start of warning /error block + warning = False # error found + warning_FROM = False + error = True + standard = False + prev_line_COM = False + warning_continue = True + elif beginning == 'fro' and warning == True or \ + beginning == '.pi' : # start of warning /error block + warning_FROM = True + prev_line_COM = False + warning_continue = True + elif warning_continue == True: + warning = True + warning_FROM = False # keep the warning status going until find a standard line or an error + error = False + standard = False + prev_line_COM = False + warning_continue = True + + else: + warning = False # unknown so assume standard line + warning_FROM = False + error = False + standard = True + prev_line_COM = False + warning_continue = False + + if beginning == 'Com': + prev_line_COM = True + +# print based on flags + if standard == True: + write_to_screen_with_replace(line_input, platformio_highlights) #print white on black with substitutions + if warning == True: + write_to_screen_queue(line_input + '\n', 'warning') + if error == True: + write_to_screen_queue(line_input + '\n', 'error') - import subprocess - import sys - - print('starting platformio') - - if build_type == 'build': - # platformio run -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen(['platformio', 'run', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - - - elif build_type == 'clean': - # platformio run --target clean -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen(['platformio', 'run', '--target', 'clean', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - - - elif build_type == 'upload': - # platformio run --target upload -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen(['platformio', 'run', '--target', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) +# end - line_print - elif build_type == 'traceback': - # platformio run --target upload -e target_env - select the debug environment if there is one - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen(['platformio', 'run', '--target', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) +########################################################################## +# # +# run Platformio # +# # +########################################################################## +# build platformio run -e target_env +# clean platformio run --target clean -e target_env +# upload platformio run --target upload -e target_env +# traceback platformio run --target upload -e target_env +# program platformio run --target program -e target_env +# test platformio test upload -e target_env +# remote platformio remote run --target upload -e target_env +# debug platformio debug -e target_env - elif build_type == 'program': - # platformio run --target program -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen(['platformio', 'run', '--target', 'program', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) +def sys_PIO(): - elif build_type == 'test': - #platformio test upload -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen(['platformio', 'test', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + ########################################################################## + # # + # run Platformio inside the same shell as this Python script # + # # + ########################################################################## + global build_type + global target_env + + import os + + print('build_type: ', build_type) + print('starting platformio') + + if build_type == 'build': + # pio_result = os.system("echo -en '\033c'") + pio_result = os.system('platformio run -e ' + target_env) + elif build_type == 'clean': + pio_result = os.system('platformio run --target clean -e ' + target_env) + elif build_type == 'upload': + pio_result = os.system('platformio run --target upload -e ' + target_env) + elif build_type == 'traceback': + pio_result = os.system('platformio run --target upload -e ' + target_env) + elif build_type == 'program': + pio_result = os.system('platformio run --target program -e ' + target_env) + elif build_type == 'test': + pio_result = os.system('platformio test upload -e ' + target_env) + elif build_type == 'remote': + pio_result = os.system('platformio remote run --target program -e ' + target_env) + elif build_type == 'debug': + pio_result = os.system('platformio debug -e ' + target_env) + else: + print('ERROR - unknown build type: ', build_type) + raise SystemExit(0) # kill everything - elif build_type == 'remote': - # platformio remote run --target upload -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen(['platformio', 'remote', 'run', '--target', 'program', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + # stream output from subprocess and split it into lines + #for line in iter(pio_subprocess.stdout.readline, ''): + # line_print(line.replace('\n', '')) + # append info used to run PlatformIO + # write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen + # write_to_screen_queue('Build type: ' + build_type + '\n') + # write_to_screen_queue('Environment used: ' + target_env + '\n') + # write_to_screen_queue(str(datetime.now()) + '\n') - elif build_type == 'debug': - # platformio debug -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen(['platformio', 'debug', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) +# end - sys_PIO - else: - print('ERROR - unknown build type: ', build_type) - raise SystemExit(0) # kill everything +def run_PIO(dummy): - # stream output from subprocess and split it into lines + global build_type + global target_env + global board_name + print('build_type: ', build_type) + + import subprocess + import sys + + print('starting platformio') + + if build_type == 'build': + # platformio run -e target_env + # combine stdout & stderr so all compile messages are included + pio_subprocess = subprocess.Popen( + ['platformio', 'run', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + + elif build_type == 'clean': + # platformio run --target clean -e target_env + # combine stdout & stderr so all compile messages are included + pio_subprocess = subprocess.Popen( + ['platformio', 'run', '--target', 'clean', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + + elif build_type == 'upload': + # platformio run --target upload -e target_env + # combine stdout & stderr so all compile messages are included + pio_subprocess = subprocess.Popen( + ['platformio', 'run', '--target', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + + elif build_type == 'traceback': + # platformio run --target upload -e target_env - select the debug environment if there is one + # combine stdout & stderr so all compile messages are included + pio_subprocess = subprocess.Popen( + ['platformio', 'run', '--target', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + + elif build_type == 'program': + # platformio run --target program -e target_env + # combine stdout & stderr so all compile messages are included + pio_subprocess = subprocess.Popen( + ['platformio', 'run', '--target', 'program', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + + elif build_type == 'test': + #platformio test upload -e target_env + # combine stdout & stderr so all compile messages are included + pio_subprocess = subprocess.Popen( + ['platformio', 'test', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + + elif build_type == 'remote': + # platformio remote run --target upload -e target_env + # combine stdout & stderr so all compile messages are included + pio_subprocess = subprocess.Popen( + ['platformio', 'remote', 'run', '--target', 'program', '-e', target_env], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT + ) + + elif build_type == 'debug': + # platformio debug -e target_env + # combine stdout & stderr so all compile messages are included + pio_subprocess = subprocess.Popen( + ['platformio', 'debug', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + + else: + print('ERROR - unknown build type: ', build_type) + raise SystemExit(0) # kill everything + +# stream output from subprocess and split it into lines + if python_ver == 2: for line in iter(pio_subprocess.stdout.readline, ''): - line_print(line.replace('\n', '')) - - - # append info used to run PlatformIO - write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen - write_to_screen_queue('Build type: ' + build_type + '\n') - write_to_screen_queue('Environment used: ' + target_env + '\n') - write_to_screen_queue(str(datetime.now()) + '\n') + line_print(line.replace('\n', '')) + else: + for line in iter(pio_subprocess.stdout.readline, b''): + line = line.decode('utf-8') + line_print(line.replace('\n', '')) + +# append info used to run PlatformIO + write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen + write_to_screen_queue('Build type: ' + build_type + '\n') + write_to_screen_queue('Environment used: ' + target_env + '\n') + write_to_screen_queue(str(datetime.now()) + '\n') # end - run_PIO - ######################################################################## import time import threading -import Tkinter as tk -import ttk -import Queue +if python_ver == 2: + import Tkinter as tk + import Queue as queue + import ttk + from Tkinter import Tk, Frame, Text, Scrollbar, Menu + #from tkMessageBox import askokcancel this is not used: removed + import tkFileDialog as fileDialog +else: + import tkinter as tk + import queue as queue + from tkinter import ttk, Tk, Frame, Text, Menu import subprocess import sys -que = Queue.Queue() -#IO_queue = Queue.Queue() - -from Tkinter import Tk, Frame, Text, Scrollbar, Menu -from tkMessageBox import askokcancel +que = queue.Queue() +#IO_queue = queue.Queue() -import tkFileDialog -from tkMessageBox import askokcancel -import tkFileDialog +class output_window(Text): + # based on Super Text + global continue_updates + continue_updates = True + + global search_position + search_position = '' # start with invalid search position + + global error_found + error_found = False # are there any errors? + + def __init__(self): + + self.root = tk.Tk() + self.root.attributes("-topmost", True) + self.frame = tk.Frame(self.root) + self.frame.pack(fill='both', expand=True) + + # text widget + #self.text = tk.Text(self.frame, borderwidth=3, relief="sunken") + Text.__init__(self, self.frame, borderwidth=3, relief="sunken") + self.config(tabs=(400, )) # configure Text widget tab stops + self.config(background='black', foreground='white', font=("consolas", 12), wrap='word', undo='True') + #self.config(background = 'black', foreground = 'white', font= ("consolas", 12), wrap = 'none', undo = 'True') + self.config(height=24, width=100) + self.config(insertbackground='pale green') # keyboard insertion point + self.pack(side='left', fill='both', expand=True) + + self.tag_config('normal', foreground='white') + self.tag_config('warning', foreground='yellow') + self.tag_config('error', foreground='red') + self.tag_config('highlight_green', foreground='green') + self.tag_config('highlight_blue', foreground='cyan') + self.tag_config('error_highlight_inactive', background='dim gray') + self.tag_config('error_highlight_active', background='light grey') + + self.bind_class("Text", "", self.select_all) # required in windows, works in others + self.bind_all("", self.scroll_errors) + self.bind_class("", self.rebuild) + + # scrollbar + + scrb = tk.Scrollbar(self.frame, orient='vertical', command=self.yview) + self.config(yscrollcommand=scrb.set) + scrb.pack(side='right', fill='y') + + #self.scrb_Y = tk.Scrollbar(self.frame, orient='vertical', command=self.yview) + #self.scrb_Y.config(yscrollcommand=self.scrb_Y.set) + #self.scrb_Y.pack(side='right', fill='y') + + #self.scrb_X = tk.Scrollbar(self.frame, orient='horizontal', command=self.xview) + #self.scrb_X.config(xscrollcommand=self.scrb_X.set) + #self.scrb_X.pack(side='bottom', fill='x') + + #scrb_X = tk.Scrollbar(self, orient=tk.HORIZONTAL, command=self.xview) # tk.HORIZONTAL now have a horizsontal scroll bar BUT... shrinks it to a postage stamp and hides far right behind the vertical scroll bar + #self.config(xscrollcommand=scrb_X.set) + #scrb_X.pack(side='bottom', fill='x') + + #scrb= tk.Scrollbar(self, orient='vertical', command=self.yview) + #self.config(yscrollcommand=scrb.set) + #scrb.pack(side='right', fill='y') + + #self.config(height = 240, width = 1000) # didn't get the size baCK TO NORMAL + #self.pack(side='left', fill='both', expand=True) # didn't get the size baCK TO NORMAL + + # pop-up menu + self.popup = tk.Menu(self, tearoff=0) + + self.popup.add_command(label='Copy', command=self._copy) + self.popup.add_command(label='Paste', command=self._paste) + self.popup.add_separator() + self.popup.add_command(label='Cut', command=self._cut) + self.popup.add_separator() + self.popup.add_command(label='Select All', command=self._select_all) + self.popup.add_command(label='Clear All', command=self._clear_all) + self.popup.add_separator() + self.popup.add_command(label='Save As', command=self._file_save_as) + self.popup.add_separator() + #self.popup.add_command(label='Repeat Build(CTL-shift-r)', command=self._rebuild) + self.popup.add_command(label='Repeat Build', command=self._rebuild) + self.popup.add_separator() + self.popup.add_command(label='Scroll Errors (CTL-shift-e)', command=self._scroll_errors) + self.popup.add_separator() + self.popup.add_command(label='Open File at Cursor', command=self._open_selected_file) + + if current_OS == 'Darwin': # MAC + self.bind('', self._show_popup) # macOS only + else: + self.bind('', self._show_popup) # Windows & Linux +# threading & subprocess section -class output_window(Text): - # based on Super Text + def start_thread(self, ): global continue_updates + # create then start a secondary thread to run an arbitrary function + # must have at least one argument + self.secondary_thread = threading.Thread(target=lambda q, arg1: q.put(run_PIO(arg1)), args=(que, '')) + self.secondary_thread.start() continue_updates = True + # check the Queue in 50ms + self.root.after(50, self.check_thread) + self.root.after(50, self.update) - global search_position - search_position = '' # start with invalid search position - - global error_found - error_found = False # are there any errors? - - - def __init__(self): - - - self.root = tk.Tk() - self.frame = tk.Frame(self.root) - self.frame.pack(fill='both', expand=True) - - # text widget - #self.text = tk.Text(self.frame, borderwidth=3, relief="sunken") - Text.__init__(self, self.frame, borderwidth=3, relief="sunken") - self.config(tabs=(400,)) # configure Text widget tab stops - self.config(background = 'black', foreground = 'white', font= ("consolas", 12), wrap = 'word', undo = 'True') -# self.config(background = 'black', foreground = 'white', font= ("consolas", 12), wrap = 'none', undo = 'True') - self.config(height = 24, width = 100) - self.config(insertbackground = 'pale green') # keyboard insertion point - self.pack(side='left', fill='both', expand=True) - - self.tag_config('normal', foreground = 'white') - self.tag_config('warning', foreground = 'yellow' ) - self.tag_config('error', foreground = 'red') - self.tag_config('highlight_green', foreground = 'green') - self.tag_config('highlight_blue', foreground = 'cyan') - self.tag_config('error_highlight_inactive', background = 'dim gray') - self.tag_config('error_highlight_active', background = 'light grey') - - self.bind_class("Text","", self.select_all) # required in windows, works in others - self.bind_all("", self.scroll_errors) - self.bind_class("", self.rebuild) - - # scrollbar - - scrb = tk.Scrollbar(self.frame, orient='vertical', command=self.yview) - self.config(yscrollcommand=scrb.set) - scrb.pack(side='right', fill='y') - -# self.scrb_Y = tk.Scrollbar(self.frame, orient='vertical', command=self.yview) -# self.scrb_Y.config(yscrollcommand=self.scrb_Y.set) -# self.scrb_Y.pack(side='right', fill='y') -# -# self.scrb_X = tk.Scrollbar(self.frame, orient='horizontal', command=self.xview) -# self.scrb_X.config(xscrollcommand=self.scrb_X.set) -# self.scrb_X.pack(side='bottom', fill='x') - -# scrb_X = tk.Scrollbar(self, orient=tk.HORIZONTAL, command=self.xview) # tk.HORIZONTAL now have a horizsontal scroll bar BUT... shrinks it to a postage stamp and hides far right behind the vertical scroll bar -# self.config(xscrollcommand=scrb_X.set) -# scrb_X.pack(side='bottom', fill='x') -# -# scrb= tk.Scrollbar(self, orient='vertical', command=self.yview) -# self.config(yscrollcommand=scrb.set) -# scrb.pack(side='right', fill='y') - -# self.config(height = 240, width = 1000) # didn't get the size baCK TO NORMAL -# self.pack(side='left', fill='both', expand=True) # didn't get the size baCK TO NORMAL - - - # pop-up menu - self.popup = tk.Menu(self, tearoff=0) - - self.popup.add_command(label='Copy', command=self._copy) - self.popup.add_command(label='Paste', command=self._paste) - self.popup.add_separator() - self.popup.add_command(label='Cut', command=self._cut) - self.popup.add_separator() - self.popup.add_command(label='Select All', command=self._select_all) - self.popup.add_command(label='Clear All', command=self._clear_all) - self.popup.add_separator() - self.popup.add_command(label='Save As', command=self._file_save_as) - self.popup.add_separator() - # self.popup.add_command(label='Repeat Build(CTL-shift-r)', command=self._rebuild) - self.popup.add_command(label='Repeat Build', command=self._rebuild) - self.popup.add_separator() - self.popup.add_command(label='Scroll Errors (CTL-shift-e)', command=self._scroll_errors) - self.popup.add_separator() - self.popup.add_command(label='Open File at Cursor', command=self._open_selected_file) - - if current_OS == 'Darwin': # MAC - self.bind('', self._show_popup) # macOS only - else: - self.bind('', self._show_popup) # Windows & Linux - - - # threading & subprocess section - - def start_thread(self, ): - global continue_updates - # create then start a secondary thread to run an arbitrary function - # must have at least one argument - self.secondary_thread = threading.Thread(target = lambda q, arg1: q.put(run_PIO(arg1)), args=(que, '')) - self.secondary_thread.start() - continue_updates = True - # check the Queue in 50ms - self.root.after(50, self.check_thread) - self.root.after(50, self.update) - + def check_thread(self): # wait for user to kill the window + global continue_updates + if continue_updates == True: + self.root.after(10, self.check_thread) - def check_thread(self): # wait for user to kill the window - global continue_updates - if continue_updates == True: - self.root.after(10, self.check_thread) + def update(self): + global continue_updates + if continue_updates == True: + self.root.after(10, self.update) #method is called every 50ms + temp_text = ['0', '0'] + if IO_queue.empty(): + if not (self.secondary_thread.is_alive()): + continue_updates = False # queue is exhausted and thread is dead so no need for further updates + else: + try: + temp_text = IO_queue.get(block=False) + except Queue.Empty: + continue_updates = False # queue is exhausted so no need for further updates + else: + self.insert('end', temp_text[0], temp_text[1]) + self.see("end") # make the last line visible (scroll text off the top) +# text editing section - def update(self): - global continue_updates - if continue_updates == True: - self.root.after(10, self.update)#method is called every 50ms - temp_text = ['0','0'] - if IO_queue.empty(): - if not(self.secondary_thread.is_alive()): - continue_updates = False # queue is exhausted and thread is dead so no need for further updates + def _scroll_errors(self): + global search_position + global error_found + if search_position == '': # first time so highlight all errors + countVar = tk.IntVar() + search_position = '1.0' + search_count = 0 + while search_position != '' and search_count < 100: + search_position = self.search("error", search_position, stopindex="end", count=countVar, nocase=1) + search_count = search_count + 1 + if search_position != '': + error_found = True + end_pos = '{}+{}c'.format(search_position, 5) + self.tag_add("error_highlight_inactive", search_position, end_pos) + search_position = '{}+{}c'.format(search_position, 1) # point to the next character for new search else: - try: - temp_text = IO_queue.get(block = False) - except Queue.Empty: - continue_updates = False # queue is exhausted so no need for further updates - else: - self.insert('end', temp_text[0], temp_text[1]) - self.see("end") # make the last line visible (scroll text off the top) - - - # text editing section - - - def _scroll_errors(self): - global search_position - global error_found - if search_position == '': # first time so highlight all errors - countVar = tk.IntVar() - search_position = '1.0' - search_count = 0 - while not(search_position == '') and search_count < 100: - search_position = self.search("error", search_position, stopindex="end", count=countVar, nocase=1) - search_count = search_count + 1 - if not(search_position == ''): - error_found = True - end_pos = '{}+{}c'.format(search_position, 5) - self.tag_add("error_highlight_inactive", search_position, end_pos) - search_position = '{}+{}c'.format(search_position, 1) # point to the next character for new search - else: - break - - if error_found: - if search_position == '': - search_position = self.search("error", '1.0', stopindex="end", nocase=1) # new search - else: # remove active highlight - end_pos = '{}+{}c'.format(search_position, 5) - start_pos = '{}+{}c'.format(search_position, -1) - self.tag_remove("error_highlight_active", start_pos, end_pos) - search_position = self.search("error", search_position, stopindex="end", nocase=1) # finds first occurrence AGAIN on the first time through - if search_position == "": # wrap around - search_position = self.search("error", '1.0', stopindex="end", nocase=1) - end_pos = '{}+{}c'.format(search_position, 5) - self.tag_add("error_highlight_active", search_position, end_pos) # add active highlight - self.see(search_position) - search_position = '{}+{}c'.format(search_position, 1) # point to the next character for new search - - def scroll_errors(self, event): - self._scroll_errors() - - - def _rebuild(self): - #global board_name - #global Marlin_ver - #global target_env - #board_name, Marlin_ver = get_board_name() - #target_env = get_env(board_name, Marlin_ver) - self.start_thread() - - def rebuild(self, event): - print("event happened") - self._rebuild() - - - def _open_selected_file(self): - current_line = self.index('insert') - line_start = current_line[ : current_line.find('.')] + '.0' - line_end = current_line[ : current_line.find('.')] + '.200' - self.mark_set("path_start", line_start) - self.mark_set("path_end", line_end) - path = self.get("path_start", "path_end") - from_loc = path.find('from ') - colon_loc = path.find(': ') - if 0 <= from_loc and ((colon_loc == -1) or (from_loc < colon_loc)) : - path = path [ from_loc + 5 : ] - if 0 <= colon_loc: - path = path [ : colon_loc ] - if 0 <= path.find('\\') or 0 <= path.find('/'): # make sure it really contains a path - open_file(path) - - - def _file_save_as(self): - self.filename = tkFileDialog.asksaveasfilename(defaultextension = '.txt') - f = open(self.filename, 'w') - f.write(self.get('1.0', 'end')) - f.close() - - - - def copy(self, event): - try: - selection = self.get(*self.tag_ranges('sel')) - self.clipboard_clear() - self.clipboard_append(selection) - except TypeError: - pass - - def cut(self, event): - - try: - selection = self.get(*self.tag_ranges('sel')) - self.clipboard_clear() - self.clipboard_append(selection) - self.delete(*self.tag_ranges('sel')) - except TypeError: - pass - - def _show_popup(self, event): - '''right-click popup menu''' - - if self.root.focus_get() != self: - self.root.focus_set() - - try: - self.popup.tk_popup(event.x_root, event.y_root, 0) - finally: - self.popup.grab_release() - - def _cut(self): - - try: - selection = self.get(*self.tag_ranges('sel')) - self.clipboard_clear() - self.clipboard_append(selection) - self.delete(*self.tag_ranges('sel')) - except TypeError: - pass - - def cut(self, event): - self._cut() - - def _copy(self): - - try: - selection = self.get(*self.tag_ranges('sel')) - self.clipboard_clear() - self.clipboard_append(selection) - except TypeError: - pass - - def copy(self, event): - self._copy() - - def _paste(self): - - self.insert('insert', self.selection_get(selection='CLIPBOARD')) - - def _select_all(self): - self.tag_add('sel', '1.0', 'end') - - - def select_all(self, event): - self.tag_add('sel', '1.0', 'end') - - - def _clear_all(self): - '''erases all text''' - - isok = askokcancel('Clear All', 'Erase all text?', frame=self, - default='ok') - if isok: - self.delete('1.0', 'end') + break + if error_found: + if search_position == '': + search_position = self.search("error", '1.0', stopindex="end", nocase=1) # new search + else: # remove active highlight + end_pos = '{}+{}c'.format(search_position, 5) + start_pos = '{}+{}c'.format(search_position, -1) + self.tag_remove("error_highlight_active", start_pos, end_pos) + search_position = self.search( + "error", search_position, stopindex="end", nocase=1 + ) # finds first occurrence AGAIN on the first time through + if search_position == "": # wrap around + search_position = self.search("error", '1.0', stopindex="end", nocase=1) + end_pos = '{}+{}c'.format(search_position, 5) + self.tag_add("error_highlight_active", search_position, end_pos) # add active highlight + self.see(search_position) + search_position = '{}+{}c'.format(search_position, 1) # point to the next character for new search + + def scroll_errors(self, event): + self._scroll_errors() + + def _rebuild(self): + #global board_name + #global Marlin_ver + #global target_env + #board_name, Marlin_ver = get_board_name() + #target_env = get_env(board_name, Marlin_ver) + self.start_thread() + + def rebuild(self, event): + print("event happened") + self._rebuild() + + def _open_selected_file(self): + current_line = self.index('insert') + line_start = current_line[:current_line.find('.')] + '.0' + line_end = current_line[:current_line.find('.')] + '.200' + self.mark_set("path_start", line_start) + self.mark_set("path_end", line_end) + path = self.get("path_start", "path_end") + from_loc = path.find('from ') + colon_loc = path.find(': ') + if 0 <= from_loc and ((colon_loc == -1) or (from_loc < colon_loc)): + path = path[from_loc + 5:] + if 0 <= colon_loc: + path = path[:colon_loc] + if 0 <= path.find('\\') or 0 <= path.find('/'): # make sure it really contains a path + open_file(path) + + def _file_save_as(self): + self.filename = fileDialog.asksaveasfilename(defaultextension='.txt') + f = open(self.filename, 'w') + f.write(self.get('1.0', 'end')) + f.close() + + def copy(self, event): + try: + selection = self.get(*self.tag_ranges('sel')) + self.clipboard_clear() + self.clipboard_append(selection) + except TypeError: + pass + + def cut(self, event): + try: + selection = self.get(*self.tag_ranges('sel')) + self.clipboard_clear() + self.clipboard_append(selection) + self.delete(*self.tag_ranges('sel')) + except TypeError: + pass + + def _show_popup(self, event): + '''right-click popup menu''' + + if self.root.focus_get() != self: + self.root.focus_set() + + try: + self.popup.tk_popup(event.x_root, event.y_root, 0) + finally: + self.popup.grab_release() + + def _cut(self): + try: + selection = self.get(*self.tag_ranges('sel')) + self.clipboard_clear() + self.clipboard_append(selection) + self.delete(*self.tag_ranges('sel')) + except TypeError: + pass + + def cut(self, event): + self._cut() + + def _copy(self): + + try: + selection = self.get(*self.tag_ranges('sel')) + self.clipboard_clear() + self.clipboard_append(selection) + except TypeError: + pass + + def copy(self, event): + self._copy() + + def _paste(self): + self.insert('insert', self.selection_get(selection='CLIPBOARD')) + + def _select_all(self): + self.tag_add('sel', '1.0', 'end') + + def select_all(self, event): + self.tag_add('sel', '1.0', 'end') + + def _clear_all(self): + #'''erases all text''' + # + #isok = askokcancel('Clear All', 'Erase all text?', frame=self, + # default='ok') + #if isok: + # self.delete('1.0', 'end') + self.delete('1.0', 'end') # end - output_window - def main(): - ########################################################################## # # # main program # # # ########################################################################## - global build_type - global target_env - global board_name - - board_name, Marlin_ver = get_board_name() - - target_env = get_env(board_name, Marlin_ver) - - os.environ["BUILD_TYPE"] = build_type # let sub processes know what is happening - os.environ["TARGET_ENV"] = target_env - os.environ["BOARD_NAME"] = board_name + global build_type + global target_env + global board_name - auto_build = output_window() - auto_build.start_thread() # executes the "run_PIO" function + board_name, Marlin_ver = get_board_name() - auto_build.root.mainloop() + target_env = get_env(board_name, Marlin_ver) + # Re-use the VSCode terminal, if possible + if os.environ.get('PLATFORMIO_CALLER', '') == 'vscode': + sys_PIO() + else: + auto_build = output_window() + auto_build.start_thread() # executes the "run_PIO" function + auto_build.root.mainloop() if __name__ == '__main__': - main() + main() diff --git a/buildroot/share/atom/create_custom_upload_command_CDC.py b/buildroot/share/atom/create_custom_upload_command_CDC.py index 484842f778e0..4d6fdf558526 100644 --- a/buildroot/share/atom/create_custom_upload_command_CDC.py +++ b/buildroot/share/atom/create_custom_upload_command_CDC.py @@ -70,7 +70,7 @@ def get_com_port(com_search_text, descr_search_text, start): com_CDC = com_last description_CDC = description_last - if com_CDC == '' and not(com_first == ''): + if com_CDC == '' and com_first != '': com_CDC = com_first description_CDC = description_first elif com_CDC == '': @@ -97,7 +97,7 @@ def get_com_port(com_search_text, descr_search_text, start): avrdude_exe_path = 'buildroot\\share\\atom\\avrdude_5.10.exe' # source_path = env.get("PROJECTBUILD_DIR") + '\\' + env.get("PIOENV") + '\\firmware.hex' - source_path = '.pioenvs\\' + env.get("PIOENV") + '\\firmware.hex' + source_path = '.pio\\build\\' + env.get("PIOENV") + '\\firmware.hex' upload_string = avrdude_exe_path + ' -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i' @@ -113,7 +113,7 @@ def get_com_port(com_search_text, descr_search_text, start): avrdude_exe_path = 'buildroot/share/atom/avrdude_5.10_macOS' # source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex' - source_path = '.pioenvs/' + env.get("PIOENV") + '/firmware.hex' + source_path = '.pio/build/' + env.get("PIOENV") + '/firmware.hex' # upload_string = 'avrdude -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i' @@ -132,7 +132,7 @@ def get_com_port(com_search_text, descr_search_text, start): avrdude_exe_path = 'buildroot/share/atom/avrdude_5.10_linux' # source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex' - source_path = '.pioenvs/' + env.get("PIOENV") + '/firmware.hex' + source_path = '.pio/build/' + env.get("PIOENV") + '/firmware.hex' # upload_string = 'avrdude -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i' upload_string = avrdude_exe_path + ' -p usb1286 -c avr109 -P ' + com_CDC + ' -C ' + avrdude_conf_path + ' -U flash:w:' + source_path + ':i' diff --git a/buildroot/share/fonts/genallfont.sh b/buildroot/share/fonts/genallfont.sh index b88c9040ddea..d95d203b5a64 100755 --- a/buildroot/share/fonts/genallfont.sh +++ b/buildroot/share/fonts/genallfont.sh @@ -62,7 +62,7 @@ OLDWD=`pwd` # # By default loop through all languages # -LANGS_DEFAULT="an bg ca cz da de el el-gr en es eu fi fr gl hr it jp-kana ko_KR nl pl pt pt-br ru sk tr uk zh_CN zh_TW test" +LANGS_DEFAULT="an bg ca cz da de el el_gr en es eu fi fr gl hr it jp_kana ko_KR nl pl pt pt_br ru sk tr uk vi zh_CN zh_TW test" # # Generate data for language list MARLIN_LANGS or all if not provided @@ -105,9 +105,6 @@ if [ 1 = 1 ]; then * Marlin 3D Printer Firmware * Copyright (c) 2019 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 diff --git a/buildroot/share/fonts/get-bdf2u8g.sh b/buildroot/share/fonts/get-bdf2u8g.sh index e7dca2bef456..5851bf93e3a4 100755 --- a/buildroot/share/fonts/get-bdf2u8g.sh +++ b/buildroot/share/fonts/get-bdf2u8g.sh @@ -12,6 +12,10 @@ HERE=$(pwd) +for CMD in curl unzip patch make; do + which $CMD >/dev/null || { echo "'$CMD' is required for this script." ; exit 1 ; } +done + [[ $HERE =~ 'buildroot/share/fonts'$ ]] || { echo "Change to buildroot/share/fonts to run $(basename $0)" ; exit 1; } # Download u8glib diff --git a/buildroot/share/fonts/marlin-6x12-3.bdf b/buildroot/share/fonts/marlin-6x12-3.bdf index 30f2a4fcdfb7..ef90656eba1b 100644 --- a/buildroot/share/fonts/marlin-6x12-3.bdf +++ b/buildroot/share/fonts/marlin-6x12-3.bdf @@ -1,9 +1,10 @@ STARTFONT 2.1 -FONT -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1 +FONT -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1 SIZE 12 75 75 -FONTBOUNDINGBOX 6 12 0 -2 +FONTBOUNDINGBOX 12 15 0 -2 +COMMENT "Generated by fontforge, http://fontforge.sourceforge.net" COMMENT "Marlin 6x12 Fixed, for menu display" -COMMENT "This font is base on the X Windows' 6x12 '-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1', added Marlin symbols at position 1-9, added jp-kana data, the other missing char data were from wqy-bitmapsong-bdf-1.0.0-RC1; some chars were tweak for display on LCD screen, such as ',;c69' etc." +COMMENT "This font is based on the X Windows' 6x12 '-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1'. Marlin symbols added at position 1-9. Added jp-kana data. Other missing char data from wqy-bitmapsong-bdf-1.0.0-RC1. Some chars tweaked for LCD display, such as ',;c69' etc." STARTPROPERTIES 23 FONTNAME_REGISTRY "" FOUNDRY "Marlin" @@ -13,9 +14,9 @@ SLANT "R" SETWIDTH_NAME "SemiCondensed" ADD_STYLE_NAME "" PIXEL_SIZE 12 -POINT_SIZE 120 -RESOLUTION_X 75 -RESOLUTION_Y 75 +POINT_SIZE 90 +RESOLUTION_X 100 +RESOLUTION_Y 100 SPACING "C" AVERAGE_WIDTH 60 CHARSET_REGISTRY "ISO10646" @@ -29,8 +30,7 @@ DEFAULT_CHAR 0 FONT_DESCENT 2 FONT_ASCENT 10 ENDPROPERTIES -CHARS 33727 - +CHARS 33809 STARTCHAR uni0001 ENCODING 1 SWIDTH 545 0 @@ -19348,7 +19348,6 @@ BITMAP 48 90 ENDCHAR - STARTCHAR U_1100 ENCODING 4352 SWIDTH 1000 0 @@ -19681,7 +19680,6 @@ BITMAP 5220 89C0 ENDCHAR - STARTCHAR uni1680 ENCODING 5760 SWIDTH 480 0 @@ -22359,6 +22357,1402 @@ BITMAP 40 80 ENDCHAR +STARTCHAR uni1EA0 +ENCODING 7840 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 -2 +BITMAP +20 +50 +88 +88 +F8 +88 +88 +00 +20 +ENDCHAR +STARTCHAR uni1EA1 +ENCODING 7841 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 7 0 -2 +BITMAP +70 +08 +78 +88 +78 +00 +20 +ENDCHAR +STARTCHAR uni1EA2 +ENCODING 7842 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +18 +08 +10 +20 +50 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EA3 +ENCODING 7843 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 0 +BITMAP +30 +10 +20 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EA4 +ENCODING 7844 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 10 0 0 +BITMAP +04 +28 +50 +20 +50 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EA5 +ENCODING 7845 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 10 0 0 +BITMAP +04 +08 +30 +48 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EA6 +ENCODING 7846 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 10 0 0 +BITMAP +08 +24 +50 +20 +50 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EA7 +ENCODING 7847 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +10 +08 +30 +48 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EA8 +ENCODING 7848 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +0C +04 +28 +50 +20 +50 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EA9 +ENCODING 7849 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +0C +04 +08 +30 +48 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EAA +ENCODING 7850 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +28 +50 +20 +50 +00 +70 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EAB +ENCODING 7851 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +28 +50 +00 +30 +48 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EAC +ENCODING 7852 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 -1 +BITMAP +20 +50 +00 +70 +88 +88 +F8 +88 +88 +20 +ENDCHAR +STARTCHAR uni1EAD +ENCODING 7853 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 -2 +BITMAP +30 +48 +00 +70 +08 +78 +88 +78 +00 +20 +ENDCHAR +STARTCHAR uni1EAE +ENCODING 7854 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +10 +20 +88 +70 +00 +70 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EAF +ENCODING 7855 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +08 +10 +48 +30 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EB0 +ENCODING 7856 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +40 +20 +88 +70 +00 +70 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EB1 +ENCODING 7857 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +40 +20 +48 +30 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EB2 +ENCODING 7858 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +30 +10 +A8 +70 +00 +70 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EB3 +ENCODING 7859 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +18 +08 +10 +48 +30 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EB4 +ENCODING 7860 +SWIDTH 500 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +28 +50 +88 +70 +00 +70 +88 +88 +F8 +88 +88 +ENDCHAR +STARTCHAR uni1EB5 +ENCODING 7861 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +14 +28 +00 +48 +30 +00 +70 +08 +78 +88 +78 +ENDCHAR +STARTCHAR uni1EB6 +ENCODING 7862 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 -1 +BITMAP +88 +70 +00 +70 +88 +88 +F8 +88 +88 +20 +ENDCHAR +STARTCHAR uni1EB7 +ENCODING 7863 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 -2 +BITMAP +48 +30 +00 +70 +08 +78 +88 +78 +00 +20 +ENDCHAR +STARTCHAR uni1EB8 +ENCODING 7864 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 -2 +BITMAP +F8 +80 +80 +F0 +80 +80 +F8 +00 +20 +ENDCHAR +STARTCHAR uni1EB9 +ENCODING 7865 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 7 0 -2 +BITMAP +70 +88 +F0 +80 +78 +00 +20 +ENDCHAR +STARTCHAR uni1EBA +ENCODING 7866 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +30 +10 +20 +00 +F8 +80 +80 +F0 +80 +80 +F8 +ENDCHAR +STARTCHAR uni1EBB +ENCODING 7867 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 0 +BITMAP +30 +10 +20 +00 +70 +88 +F0 +80 +78 +ENDCHAR +STARTCHAR uni1EBC +ENCODING 7868 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +28 +50 +00 +F8 +80 +80 +F0 +80 +80 +F8 +ENDCHAR +STARTCHAR uni1EBD +ENCODING 7869 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 8 0 0 +BITMAP +28 +50 +00 +70 +88 +F0 +80 +78 +ENDCHAR +STARTCHAR uni1EBE +ENCODING 7870 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 7 11 0 0 +BITMAP +02 +24 +50 +00 +F8 +80 +80 +F0 +80 +80 +F8 +ENDCHAR +STARTCHAR uni1EBF +ENCODING 7871 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 10 0 0 +BITMAP +04 +08 +20 +50 +00 +70 +88 +F0 +80 +78 +ENDCHAR +STARTCHAR uni1EC0 +ENCODING 7872 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +08 +24 +50 +00 +F8 +80 +80 +F0 +80 +80 +F8 +ENDCHAR +STARTCHAR uni1EC1 +ENCODING 7873 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +10 +08 +20 +50 +00 +70 +88 +F0 +80 +78 +ENDCHAR +STARTCHAR uni1EC2 +ENCODING 7874 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +0C +24 +58 +00 +F8 +80 +80 +F0 +80 +80 +F8 +ENDCHAR +STARTCHAR uni1EC3 +ENCODING 7875 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +18 +08 +10 +60 +90 +00 +60 +90 +F0 +80 +70 +ENDCHAR +STARTCHAR uni1EC4 +ENCODING 7876 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 7 11 0 0 +BITMAP +0A +14 +20 +50 +00 +F8 +80 +F0 +80 +80 +F8 +ENDCHAR +STARTCHAR uni1EC5 +ENCODING 7877 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +28 +50 +00 +20 +50 +00 +70 +88 +F0 +80 +78 +ENDCHAR +STARTCHAR uni1EC6 +ENCODING 7878 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 12 0 -2 +BITMAP +20 +50 +00 +F8 +80 +80 +F0 +80 +80 +F8 +00 +20 +ENDCHAR +STARTCHAR uni1EC7 +ENCODING 7879 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 -2 +BITMAP +20 +50 +00 +70 +88 +F0 +80 +78 +00 +20 +ENDCHAR +STARTCHAR uni1EC8 +ENCODING 7880 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +30 +10 +20 +00 +F8 +20 +20 +20 +20 +20 +F8 +ENDCHAR +STARTCHAR uni1EC9 +ENCODING 7881 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 3 9 2 0 +BITMAP +60 +20 +40 +00 +C0 +40 +40 +40 +E0 +ENDCHAR +STARTCHAR uni1ECA +ENCODING 7882 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 -2 +BITMAP +F8 +20 +20 +20 +20 +20 +F8 +00 +20 +ENDCHAR +STARTCHAR uni1ECB +ENCODING 7883 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 3 9 2 -2 +BITMAP +40 +00 +C0 +40 +40 +40 +E0 +00 +40 +ENDCHAR +STARTCHAR uni1ECC +ENCODING 7884 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 -2 +BITMAP +70 +88 +88 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1ECD +ENCODING 7885 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 7 0 -2 +BITMAP +70 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1ECE +ENCODING 7886 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +30 +10 +20 +00 +70 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ECF +ENCODING 7887 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 0 +BITMAP +30 +10 +20 +00 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED0 +ENCODING 7888 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 7 10 0 0 +BITMAP +22 +54 +00 +70 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED1 +ENCODING 7889 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 10 0 0 +BITMAP +04 +08 +20 +50 +00 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED2 +ENCODING 7890 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +08 +24 +50 +00 +70 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED3 +ENCODING 7891 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +10 +08 +20 +50 +00 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED4 +ENCODING 7892 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +0C +24 +58 +00 +70 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED5 +ENCODING 7893 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +18 +08 +30 +50 +00 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED6 +ENCODING 7894 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +28 +50 +20 +50 +00 +70 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED7 +ENCODING 7895 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +28 +50 +00 +20 +50 +00 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1ED8 +ENCODING 7896 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 12 0 -2 +BITMAP +20 +50 +00 +70 +88 +88 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1ED9 +ENCODING 7897 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 -2 +BITMAP +20 +50 +00 +70 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1EDA +ENCODING 7898 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +20 +40 +10 +08 +70 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EDB +ENCODING 7899 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 0 +BITMAP +20 +40 +10 +08 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EDC +ENCODING 7900 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +80 +50 +08 +70 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EDD +ENCODING 7901 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 0 +BITMAP +80 +40 +10 +08 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EDE +ENCODING 7902 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +60 +20 +50 +08 +70 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EDF +ENCODING 7903 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +60 +20 +40 +10 +08 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EE0 +ENCODING 7904 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 0 +BITMAP +50 +A0 +10 +08 +70 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EE1 +ENCODING 7905 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 0 +BITMAP +50 +A0 +10 +08 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EE2 +ENCODING 7906 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 11 0 -2 +BITMAP +10 +08 +70 +88 +88 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1EE3 +ENCODING 7907 +SWIDTH 0 0 +DWIDTH 0 0 +BBX 5 9 0 -2 +BITMAP +10 +08 +70 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1EE4 +ENCODING 7908 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 9 0 -2 +BITMAP +88 +88 +88 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1EE5 +ENCODING 7909 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 7 0 -2 +BITMAP +88 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1EE6 +ENCODING 7910 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +30 +10 +20 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EE7 +ENCODING 7911 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 5 10 0 0 +BITMAP +30 +10 +20 +00 +00 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EE8 +ENCODING 7912 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 10 0 0 +BITMAP +10 +2C +04 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EE9 +ENCODING 7913 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 9 0 0 +BITMAP +10 +20 +0C +04 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EEA +ENCODING 7914 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 10 0 0 +BITMAP +40 +2C +04 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EEB +ENCODING 7915 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 9 0 0 +BITMAP +40 +20 +0C +04 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EEC +ENCODING 7916 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +30 +10 +2C +04 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EED +ENCODING 7917 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 10 0 0 +BITMAP +30 +10 +20 +0C +04 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EEE +ENCODING 7918 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 0 +BITMAP +28 +50 +0C +04 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EEF +ENCODING 7919 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 9 0 0 +BITMAP +28 +50 +0C +04 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR uni1EF0 +ENCODING 7920 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 11 0 -2 +BITMAP +0C +04 +88 +88 +88 +88 +88 +88 +70 +00 +20 +ENDCHAR +STARTCHAR uni1EF1 +ENCODING 7921 +SWIDTH 583 0 +DWIDTH 7 0 +BBX 6 9 0 -2 +BITMAP +0C +04 +88 +88 +88 +88 +70 +00 +20 +ENDCHAR STARTCHAR Ygrave ENCODING 7922 SWIDTH 480 0 @@ -64462,8 +65856,6 @@ B8 D4 D4 ENDCHAR - - STARTCHAR U_2E80 ENCODING 11904 SWIDTH 1000 0 @@ -71683,8 +73075,8 @@ ENDCHAR STARTCHAR U_3099 ENCODING 12441 SWIDTH 1000 0 -DWIDTH 12 0 -BBX 4 3 0 7 +DWIDTH 6 0 +BBX 4 3 0 5 BITMAP 20 90 @@ -71693,8 +73085,8 @@ ENDCHAR STARTCHAR U_309B ENCODING 12443 SWIDTH 1000 0 -DWIDTH 12 0 -BBX 4 3 0 6 +DWIDTH 6 0 +BBX 4 3 0 5 BITMAP 20 90 @@ -71703,20 +73095,18 @@ ENDCHAR STARTCHAR U_309C ENCODING 12444 SWIDTH 1000 0 -DWIDTH 12 0 -BBX 3 3 0 6 +DWIDTH 6 0 +BBX 3 3 0 5 BITMAP 40 A0 40 ENDCHAR - - STARTCHAR u30A0 ENCODING 12448 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 3 0 1 +BBX 5 3 0 3 BITMAP F8 00 @@ -71726,43 +73116,47 @@ STARTCHAR u30A1 ENCODING 12449 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 4 0 0 +BBX 4 5 0 0 BITMAP F0 10 60 40 +80 ENDCHAR STARTCHAR u30A2 ENCODING 12450 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP F8 08 28 30 20 +20 40 ENDCHAR STARTCHAR u30A3 ENCODING 12451 SWIDTH 545 0 DWIDTH 6 0 -BBX 3 4 1 0 +BBX 4 5 0 0 BITMAP +10 +20 +60 +A0 20 -40 -C0 -40 ENDCHAR STARTCHAR u30A4 ENCODING 12452 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 6 0 0 +BBX 5 7 0 0 BITMAP +08 10 20 60 @@ -71774,31 +73168,33 @@ STARTCHAR u30A5 ENCODING 12453 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 4 0 0 +BBX 4 5 0 0 BITMAP 20 F0 90 +10 20 ENDCHAR STARTCHAR u30A6 ENCODING 12454 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 20 F8 88 +88 08 10 -20 +60 ENDCHAR STARTCHAR u30A7 ENCODING 12455 SWIDTH 545 0 DWIDTH 6 0 -BBX 3 4 1 0 +BBX 3 4 0 0 BITMAP E0 40 @@ -71809,22 +73205,24 @@ STARTCHAR u30A8 ENCODING 12456 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP F8 20 20 20 +20 F8 ENDCHAR STARTCHAR u30A9 ENCODING 12457 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 4 0 0 +BBX 4 5 0 0 BITMAP 20 F0 +20 60 A0 ENDCHAR @@ -71832,10 +73230,11 @@ STARTCHAR u30AA ENCODING 12458 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 10 F8 +10 30 50 90 @@ -71845,92 +73244,101 @@ STARTCHAR u30AB ENCODING 12459 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 40 F8 48 48 48 -90 +48 +98 ENDCHAR STARTCHAR u30AC ENCODING 12460 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 40 F8 48 48 48 -90 +48 +98 ENDCHAR STARTCHAR u30AD ENCODING 12461 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 20 F8 20 -F8 -20 20 +F8 +10 +10 ENDCHAR STARTCHAR u30AE ENCODING 12462 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 -20 -F8 +08 20 F8 20 20 +F8 +10 +10 ENDCHAR STARTCHAR u30AF ENCODING 12463 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 5 0 0 +BBX 5 7 0 0 BITMAP -70 -90 +40 +78 +48 +88 +08 10 -20 -C0 +60 ENDCHAR STARTCHAR u30B0 ENCODING 12464 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 -00 -70 -90 +08 +40 +78 +48 +88 +08 10 -20 -C0 +60 ENDCHAR STARTCHAR u30B1 ENCODING 12465 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP -40 -78 +80 +F8 +90 90 10 10 @@ -71940,12 +73348,13 @@ STARTCHAR u30B2 ENCODING 12466 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 -40 -78 +28 +80 +F8 +90 90 10 10 @@ -71955,65 +73364,71 @@ STARTCHAR u30BB3 ENCODING 12467 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP F8 08 08 08 +08 F8 ENDCHAR STARTCHAR u30B4 ENCODING 12468 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 F8 08 08 08 +08 F8 ENDCHAR STARTCHAR u30BB5 ENCODING 12469 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 50 F8 50 +50 +50 10 20 -40 ENDCHAR STARTCHAR u30B6 ENCODING 12470 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 50 F8 50 +50 +50 10 20 -40 ENDCHAR STARTCHAR u30B7 ENCODING 12471 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP C0 08 C8 +08 10 E0 ENDCHAR @@ -72021,13 +73436,19 @@ STARTCHAR u30B8 ENCODING 12472 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 7 13 0 0 BITMAP +02 +00 +00 +00 +28 28 00 C0 08 C8 +08 10 E0 ENDCHAR @@ -72035,9 +73456,10 @@ STARTCHAR u30B9 ENCODING 12473 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP -F8 +70 +10 10 20 50 @@ -72047,11 +73469,13 @@ STARTCHAR u30BA ENCODING 12474 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 -F8 +70 +10 10 20 50 @@ -72061,9 +73485,10 @@ STARTCHAR u30BB ENCODING 12475 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 40 +40 F8 48 50 @@ -72074,10 +73499,11 @@ STARTCHAR u30BC ENCODING 12476 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 +40 40 F8 48 @@ -72089,37 +73515,42 @@ STARTCHAR u30BD ENCODING 12477 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP 88 -88 +48 48 10 -60 +10 +20 ENDCHAR STARTCHAR u30BE ENCODING 12478 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 88 -88 +48 48 10 -60 +10 +20 ENDCHAR STARTCHAR u30BF ENCODING 12479 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 7 0 0 BITMAP +40 78 48 A8 +18 10 60 ENDCHAR @@ -72127,13 +73558,15 @@ STARTCHAR u30C0 ENCODING 12480 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 +40 78 48 A8 +18 10 60 ENDCHAR @@ -72141,28 +73574,30 @@ STARTCHAR u30C1 ENCODING 12481 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 10 -E0 +60 20 F8 20 +20 40 ENDCHAR STARTCHAR u30C2 ENCODING 12482 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 10 -E0 +60 20 F8 20 +20 40 ENDCHAR STARTCHAR u30C3 @@ -72180,66 +73615,72 @@ STARTCHAR u30C4 ENCODING 12484 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP A8 A8 +A8 08 10 -20 +60 ENDCHAR STARTCHAR u30C5 ENCODING 12485 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 A8 A8 +A8 08 10 -20 +60 ENDCHAR STARTCHAR u30C6 ENCODING 12486 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 70 00 F8 20 20 +20 40 ENDCHAR STARTCHAR u30C7 ENCODING 12487 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 70 00 F8 20 20 +20 40 ENDCHAR STARTCHAR u30C8 ENCODING 12488 SWIDTH 545 0 DWIDTH 6 0 -BBX 3 6 1 0 +BBX 4 7 1 0 BITMAP 80 80 C0 A0 +90 80 80 ENDCHAR @@ -72247,14 +73688,15 @@ STARTCHAR u30C9 ENCODING 12489 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 8 1 0 +BBX 4 9 1 0 BITMAP 50 -00 +10 80 80 C0 A0 +90 80 80 ENDCHAR @@ -72262,9 +73704,10 @@ STARTCHAR u30CA ENCODING 12490 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 20 +20 F8 20 20 @@ -72275,38 +73718,41 @@ STARTCHAR u30CB ENCODING 12491 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP 70 00 00 00 +00 F8 ENDCHAR STARTCHAR u30CC ENCODING 12492 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP -F8 +78 08 -50 -20 -D0 +28 +10 +28 +C0 ENDCHAR STARTCHAR u30CD ENCODING 12493 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 20 -F8 +70 10 20 70 A8 +20 ENDCHAR STARTCHAR u30CE ENCODING 12494 @@ -72317,7 +73763,7 @@ BITMAP 20 20 20 -20 +40 40 80 ENDCHAR @@ -72325,11 +73771,12 @@ STARTCHAR u30CF ENCODING 12495 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP 10 -88 -88 +50 +50 +48 88 88 ENDCHAR @@ -72337,13 +73784,15 @@ STARTCHAR u30D0 ENCODING 12496 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 10 -88 -88 +50 +50 +48 88 88 ENDCHAR @@ -72351,14 +73800,15 @@ STARTCHAR u30D1 ENCODING 12497 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 18 18 00 10 -88 -88 +50 +50 +48 88 88 ENDCHAR @@ -72366,52 +73816,57 @@ STARTCHAR u30D2 ENCODING 12498 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 4 6 0 0 BITMAP 80 -80 -F8 +90 +E0 80 80 -78 +70 ENDCHAR STARTCHAR u30D3 ENCODING 12499 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 +00 80 -80 -F8 +90 +E0 80 80 -78 +70 ENDCHAR STARTCHAR u30D4 ENCODING 12500 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 18 -98 +18 +00 80 -F8 +90 +E0 80 80 -78 +70 ENDCHAR STARTCHAR u30D5 ENCODING 12501 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP F8 08 08 +08 10 60 ENDCHAR @@ -72419,13 +73874,15 @@ STARTCHAR u30D6 ENCODING 12502 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 F8 08 08 +08 10 60 ENDCHAR @@ -72433,7 +73890,7 @@ STARTCHAR u30D7 ENCODING 12503 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 18 18 @@ -72441,6 +73898,7 @@ BITMAP F8 08 08 +08 10 60 ENDCHAR @@ -72448,72 +73906,79 @@ STARTCHAR u30D8 ENCODING 12504 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 4 0 1 +BBX 5 5 0 1 BITMAP -40 +60 A0 10 +10 08 ENDCHAR STARTCHAR u30D9 ENCODING 12505 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 1 +BBX 5 8 0 1 BITMAP 28 +28 00 -40 +60 A0 10 +10 08 ENDCHAR STARTCHAR u30DA ENCODING 12506 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 1 +BBX 5 8 0 1 BITMAP 18 18 -40 +00 +60 A0 10 +10 08 ENDCHAR STARTCHAR u30DB ENCODING 12507 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 20 F8 20 A8 A8 +A8 20 ENDCHAR STARTCHAR u30DC ENCODING 12508 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 20 F8 20 A8 A8 +A8 20 ENDCHAR STARTCHAR u30DD ENCODING 12509 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 18 18 @@ -72522,16 +73987,18 @@ F8 20 A8 A8 +A8 20 ENDCHAR STARTCHAR u30DE ENCODING 12510 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP F8 08 +08 50 20 10 @@ -72540,23 +74007,26 @@ STARTCHAR u30DF ENCODING 12511 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 5 1 0 +BBX 4 6 1 0 BITMAP E0 00 E0 00 -F0 +C0 +30 ENDCHAR STARTCHAR u30E0 ENCODING 12512 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 7 0 0 BITMAP 20 +20 +20 40 -88 +48 F8 08 ENDCHAR @@ -72564,10 +74034,11 @@ STARTCHAR u30E1 ENCODING 12513 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP 08 -28 +48 +30 10 28 C0 @@ -72576,22 +74047,24 @@ STARTCHAR u30E2 ENCODING 12514 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP -F8 +F0 40 F8 40 +40 38 ENDCHAR STARTCHAR u30E3 ENCODING 12515 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 4 0 0 +BBX 5 5 0 0 BITMAP 40 F8 +48 50 40 ENDCHAR @@ -72599,9 +74072,10 @@ STARTCHAR u30E4 ENCODING 12516 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 40 +40 F8 48 50 @@ -72612,23 +74086,25 @@ STARTCHAR u30E5 ENCODING 12517 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 4 0 0 +BBX 4 5 0 0 BITMAP 60 20 20 +20 F0 ENDCHAR STARTCHAR u30E6 ENCODING 12518 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP 70 10 10 10 +10 F8 ENDCHAR STARTCHAR u30E7 @@ -72647,47 +74123,52 @@ STARTCHAR u30E8 ENCODING 12520 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP F8 08 F8 08 +08 F8 ENDCHAR STARTCHAR u30E9 ENCODING 12521 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 70 00 F8 08 +08 10 -20 +60 ENDCHAR STARTCHAR u30EA ENCODING 12522 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 6 0 0 +BBX 4 7 0 0 BITMAP +10 90 90 90 90 10 -20 +60 ENDCHAR STARTCHAR u30EB ENCODING 12523 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 7 0 0 BITMAP 20 +20 +A0 A0 A8 A8 @@ -72697,54 +74178,58 @@ STARTCHAR u30EC ENCODING 12524 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 5 0 0 +BBX 5 6 0 0 BITMAP 80 80 -90 -A0 +80 +88 +B0 C0 ENDCHAR STARTCHAR u30ED ENCODING 12525 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP F8 88 88 88 +88 F8 ENDCHAR STARTCHAR u30EE ENCODING 12526 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 4 0 0 +BBX 4 5 0 0 BITMAP F0 90 10 -20 +10 +60 ENDCHAR STARTCHAR u30EF ENCODING 12527 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP F8 88 +88 08 10 -20 +60 ENDCHAR STARTCHAR u30F0 ENCODING 12528 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 6 0 0 +BBX 5 7 0 0 BITMAP 10 F8 @@ -72752,16 +74237,18 @@ F8 50 F8 10 +10 ENDCHAR STARTCHAR u30F1 ENCODING 12529 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP -F8 -08 -30 +70 +10 +20 +20 20 F8 ENDCHAR @@ -72769,23 +74256,25 @@ STARTCHAR u30F2 ENCODING 12530 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP F8 08 F8 08 -30 +10 +60 ENDCHAR STARTCHAR u30F3 ENCODING 12531 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 0 +BBX 5 6 0 0 BITMAP C0 08 08 +08 10 E0 ENDCHAR @@ -72793,36 +74282,39 @@ STARTCHAR u30F4 ENCODING 12532 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 20 F8 88 +88 08 10 -20 +60 ENDCHAR STARTCHAR u30F5 ENCODING 12533 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 4 0 0 +BBX 4 5 0 0 BITMAP 40 F0 50 -A0 +50 +B0 ENDCHAR STARTCHAR u30F6 ENCODING 12534 SWIDTH 545 0 DWIDTH 6 0 -BBX 4 4 0 0 +BBX 4 5 0 0 BITMAP -40 +80 F0 +A0 20 40 ENDCHAR @@ -72830,12 +74322,14 @@ STARTCHAR u30F7 ENCODING 12535 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 F8 88 +88 08 10 60 @@ -72844,28 +74338,31 @@ STARTCHAR u30F8 ENCODING 12536 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 8 0 0 +BBX 5 9 0 0 BITMAP 28 -00 +08 10 F8 50 50 F8 10 +10 ENDCHAR STARTCHAR u30F9 ENCODING 12537 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 -F8 -08 -30 +70 +10 +20 +20 20 F8 ENDCHAR @@ -72873,21 +74370,23 @@ STARTCHAR u30FA ENCODING 12538 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 7 0 0 +BBX 5 9 0 0 BITMAP 28 +28 00 F8 08 F8 08 -30 +10 +60 ENDCHAR STARTCHAR u30FB ENCODING 12539 SWIDTH 545 0 DWIDTH 6 0 -BBX 2 2 2 2 +BBX 2 2 2 3 BITMAP C0 C0 @@ -72896,15 +74395,16 @@ STARTCHAR u30FC ENCODING 12540 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 1 0 2 +BBX 5 2 0 3 BITMAP -F8 +80 +78 ENDCHAR STARTCHAR u30FD ENCODING 12541 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 4 0 1 +BBX 5 4 0 2 BITMAP 80 60 @@ -72915,9 +74415,11 @@ STARTCHAR u30FE ENCODING 12542 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 5 0 1 +BBX 5 7 0 2 BITMAP 28 +28 +00 80 60 10 @@ -72936,8 +74438,6 @@ F8 08 08 ENDCHAR - - STARTCHAR U_3105 ENCODING 12549 SWIDTH 1000 0 @@ -584361,8 +585861,6 @@ FFE0 2140 C620 ENDCHAR - - STARTCHAR ff ENCODING 64256 SWIDTH 480 0 @@ -584497,8 +585995,6 @@ BITMAP 08 F0 ENDCHAR - - STARTCHAR U_FE30 ENCODING 65072 SWIDTH 0 0 @@ -586727,7 +588223,6 @@ E380 0800 1C00 ENDCHAR - STARTCHAR uniFFFD ENCODING 65533 SWIDTH 480 0 diff --git a/buildroot/share/git/firstpush b/buildroot/share/git/firstpush index 443166088c5c..132795b617d6 100755 --- a/buildroot/share/git/firstpush +++ b/buildroot/share/git/firstpush @@ -16,13 +16,15 @@ BRANCH=${INFO[5]} git push --set-upstream origin $BRANCH -TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }') +which xdg-open >/dev/null && TOOL=xdg-open +which gnome-open >/dev/null && TOOL=gnome-open +which open >/dev/null && TOOL=open URL="https://github.com/$FORK/$REPO/commits/$BRANCH" -if [ -z "$TOOL" ]; then +if [ -z "$OPEN" ]; then echo "Can't find a tool to open the URL:" echo $URL else echo "Viewing commits on $BRANCH..." - "$TOOL" "$URL" + "$OPEN" "$URL" fi diff --git a/buildroot/share/git/mfdoc b/buildroot/share/git/mfdoc index eba599c612c5..f2a2b08204b6 100755 --- a/buildroot/share/git/mfdoc +++ b/buildroot/share/git/mfdoc @@ -16,14 +16,16 @@ BRANCH=${INFO[5]} [[ $ORG == "MarlinFirmware" && $REPO == "MarlinDocumentation" ]] || { echo "Wrong repository." 1>&2; exit 1; } opensite() { - TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }') + which xdg-open >/dev/null && TOOL=xdg-open + which gnome-open >/dev/null && TOOL=gnome-open + which open >/dev/null && TOOL=open URL="http://127.0.0.1:4000/" - if [ -z "$TOOL" ]; then + if [ -z "$OPEN" ]; then echo "Can't find a tool to open the URL:" echo $URL else echo "Opening preview site in the browser..." - "$TOOL" "$URL" + "$OPEN" "$URL" fi } diff --git a/buildroot/share/git/mfhelp b/buildroot/share/git/mfhelp new file mode 100755 index 000000000000..1afc4c686b81 --- /dev/null +++ b/buildroot/share/git/mfhelp @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# mfhelp +# + +cat <&2 ; exit 1 ; } +[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2] [branch]" 1>&2 ; exit 1 ; } echo "$ORG $FORK $REPO $TARG $BRANCH $CURR $MORE" diff --git a/buildroot/share/git/mfpr b/buildroot/share/git/mfpr index 73af049ab1b3..0220c0aa8e16 100755 --- a/buildroot/share/git/mfpr +++ b/buildroot/share/git/mfpr @@ -23,15 +23,17 @@ OLDBRANCH=${INFO[5]} # See if it's been pushed yet if [ -z "$(git branch -vv | grep ^\* | grep \\[origin)" ]; then firstpush; fi -TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }') +which xdg-open >/dev/null && TOOL=xdg-open +which gnome-open >/dev/null && TOOL=gnome-open +which open >/dev/null && TOOL=open URL="https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1" -if [ -z "$TOOL" ]; then +if [ -z "$OPEN" ]; then echo "Can't find a tool to open the URL:" echo $URL else echo "Opening a New PR Form..." - "$TOOL" "$URL" + "$OPEN" "$URL" fi [[ $BRANCH != $OLDBRANCH ]] && git checkout $OLDBRANCH diff --git a/buildroot/share/git/mfpub b/buildroot/share/git/mfpub index 29eb0543d7e1..f77b9236566d 100755 --- a/buildroot/share/git/mfpub +++ b/buildroot/share/git/mfpub @@ -77,15 +77,17 @@ else git push -f origin fi - TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }') + which xdg-open >/dev/null && TOOL=xdg-open + which gnome-open >/dev/null && TOOL=gnome-open + which open >/dev/null && TOOL=open URL="https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1" - if [ -z "$TOOL" ]; then + if [ -z "$OPEN" ]; then echo "Can't find a tool to open the URL:" echo $URL else echo "Opening a New PR Form..." - "$TOOL" "$URL" + "$OPEN" "$URL" fi fi @@ -116,14 +118,16 @@ git checkout gh-pages || { echo "Something went wrong!"; exit 1; } rsync -av ${TMPFOLDER}/ ./ opensite() { - TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }') + which xdg-open >/dev/null && TOOL=xdg-open + which gnome-open >/dev/null && TOOL=gnome-open + which open >/dev/null && TOOL=open URL="http://marlinfw.org/" - if [ -z "$TOOL" ]; then + if [ -z "$OPEN" ]; then echo "Can't find a tool to open the URL:" echo $URL else echo "Opening the site in the browser..." - "$TOOL" "$URL" + "$OPEN" "$URL" fi } diff --git a/buildroot/share/git/mfqp b/buildroot/share/git/mfqp index efc76fb3e938..7f950da59d16 100755 --- a/buildroot/share/git/mfqp +++ b/buildroot/share/git/mfqp @@ -24,7 +24,7 @@ done [[ ${INFO[4]} =~ [0-9] ]] && USAGE=1 -[[ $USAGE ]] && { echo "usage: `basename $0` [-hq] [1|2]" 1>&2 ; exit 1 ; } +[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [-hq] [1|2]" 1>&2 ; exit 1 ; } git add . git commit -m "patch" diff --git a/buildroot/share/git/mfrb b/buildroot/share/git/mfrb index a3b4ce267c02..e09dd87cdaab 100755 --- a/buildroot/share/git/mfrb +++ b/buildroot/share/git/mfrb @@ -21,7 +21,7 @@ while [ $IND -lt ${#INFO[@]} ]; do let IND+=1 done -[[ $USAGE ]] && { echo "usage: `basename $0` [1|2]" 1>&2 ; exit 1 ; } +[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2]" 1>&2 ; exit 1 ; } # If the branch isn't currently the PR target if [[ $TARG != $CURR ]]; then diff --git a/buildroot/share/git/mftest b/buildroot/share/git/mftest new file mode 100755 index 000000000000..a83a309bd91b --- /dev/null +++ b/buildroot/share/git/mftest @@ -0,0 +1,158 @@ +#!/usr/bin/env bash +# +# mftest [name] [index] +# +# Set configuration options based on a test +# By default it will do megaatmega2560 +# Use 'mftest -' to pick from the list. +# + +MFINFO=$(mfinfo) || exit 1 +[[ -d Marlin/src ]] || { echo "Please 'cd' up to repo root." ; exit 1 ; } + +TESTPATH=buildroot/share/tests +STATE_FILE=$( echo ./.pio/.mftestrc ) + +shopt -s extglob nocasematch + +# Get the environment and test number from the command +TESTENV=${1:-'-'} +CHOICE=${2:-0} + +# Allow shorthand for test name +case $TESTENV in + tree) platformio run --project-dir . -e include_tree ; exit 1 ;; + due) TESTENV='DUE' ;; + esp) TESTENV='esp32' ;; + lin*) TESTENV='linux_native' ;; + lpc?(8)) TESTENV='LPC1768' ;; + lpc9) TESTENV='LPC1769' ;; + m128) TESTENV='megaatmega1280' ;; + m256) TESTENV='megaatmega2560' ;; + mega) TESTENV='megaatmega2560' ;; + stm) TESTENV='STM32F103RE' ;; + f1) TESTENV='STM32F103RE' ;; + f4) TESTENV='STM32F4' ;; + f7) TESTENV='STM32F7' ;; + teensy) TESTENV='teensy31' ;; + t31) TESTENV='teensy31' ;; + t32) TESTENV='teensy31' ;; + t35) TESTENV='teensy35' ;; + t36) TESTENV='teensy35' ;; + # Build with the last-built env + -r) [[ -f "$STATE_FILE" ]] || { echo "No previous (-r) build state found." ; exit 1 ; } + read TESTENV <"$STATE_FILE" + platformio run --project-dir . -e $TESTENV + exit + ;; + # A -y may come first + -y) TESTENV=${2:-'-'} ; CHOICE=${3:-0} ;; + -[a-z]) echo "Unknown flag $TESTENV" ; exit 1 ;; + -) ;; +esac + +# Matching patterns +ISNUM='^[0-9]+$' +ISCMD='^(restore|opt|exec|use|pins|env)_' +ISEXEC='^exec_' +ISCONT='\\ *$' + +# List available tests and ask for selection +if [[ $TESTENV == '-' ]]; then + IND=0 + NAMES=() + for FILE in $( ls -1 $TESTPATH/*-tests ) + do + let IND++ + TNAME=${FILE/-tests/} + TNAME=${TNAME/$TESTPATH\//} + NAMES+=($TNAME) + (( IND < 10 )) && echo -n " " + echo " $IND) $TNAME" + done + + echo + for (( ; ; )) + do + read -p "Select a test to apply (1-$IND) : " NAMEIND + [[ -z "$NAMEIND" ]] && { echo '(canceled)' ; exit 1 ; } + [[ $NAMEIND =~ $ISNUM ]] && ((NAMEIND >= 1 && NAMEIND <= IND)) && { TESTENV=${NAMES[$NAMEIND-1]} ; echo ; break ; } + echo "Invalid selection." + done +fi + +# Get the contents of the test file +OUT=$( cat $TESTPATH/$TESTENV-tests 2>/dev/null ) || { echo "Can't find test '$TESTENV'." ; exit 1 ; } + +# Count up the number of tests +# TODO: List test descriptions with numbers +TESTCOUNT=$( awk "/$ISEXEC/{a++}END{print a}" <<<"$OUT" ) + +# User entered a number? +(( CHOICE && CHOICE > TESTCOUNT )) && { echo "Invalid test index '$CHOICE' (1-$TESTCOUNT)." ; exit 1 ; } + +if [[ $CHOICE == 0 ]]; then + # List test descriptions with numbers + echo "Available '$TESTENV' tests:" ; echo "$OUT" | { + IND=0 + SED=$(which gsed || which sed) + while IFS= read -r LINE + do + if [[ $LINE =~ $ISEXEC ]]; then + DESC=$( "$SED" -E 's/^.+"(.*)".*$/\1/g' <<<"$LINE" ) + (( ++IND < 10 )) && echo -n " " + echo " $IND) $DESC" + fi + done + } + CHOICE=1 + if [[ $TESTCOUNT > 1 ]]; then + for (( ; ; )) + do + read -p "Select a '$TESTENV' test (1-$TESTCOUNT) : " CHOICE + [[ -z "$CHOICE" ]] && { echo '(canceled)' ; exit 1 ; } + [[ $CHOICE =~ $ISNUM ]] && ((CHOICE >= 1 && CHOICE <= TESTCOUNT)) && break + echo ">>> Invalid test index '$CHOICE'." + done + fi +fi + +# Finally, run the specified test lines +echo "$OUT" | { + IND=0 + GOTX=0 + CMD="" + while IFS= read -r LINE + do + if [[ $LINE =~ $ISCMD || $GOTX == 1 ]]; then + ((!IND)) && let IND++ + if [[ $LINE =~ $ISEXEC ]]; then + ((IND++ > CHOICE)) && break + else + ((!HEADER)) && { + HEADER=1 + echo -e "\n#\n# Test $TESTENV ($CHOICE) $DESC\n#" + } + ((IND == CHOICE)) && { + GOTX=1 + [[ $CMD == "" ]] && CMD="$LINE" || CMD=$( echo -e "$CMD$LINE" | sed -e 's/\\//g' ) + [[ $LINE =~ $ISCONT ]] || { echo $CMD ; eval "$CMD" ; CMD="" ; } + } + fi + fi + done +} + +# Get a -y parameter the lazy way +[[ "$2" == "-y" || "$3" == "-y" ]] && BUILD_YES='Y' + +# Build the test too? +if [[ $BUILD_YES != 'Y' ]]; then + echo + read -p "Build $TESTENV test #$CHOICE (y/N) ? " BUILD_YES +fi + +[[ $BUILD_YES == 'Y' || $BUILD_YES == 'Yes' ]] && { + platformio run --project-dir . -e $TESTENV + echo "$TESTENV" >"$STATE_FILE" +} diff --git a/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino b/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino index 39545aa7cbbc..6dcfb67c5434 100644 --- a/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino +++ b/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino @@ -5,7 +5,7 @@ #undef digitalPinToPCICR #define digitalPinToPCICR(p) ( ((p) >= 10 && (p) <= 15) || \ ((p) >= 50 && (p) <= 53) || \ - ((p) >= 62 && (p) <= 69) ? &PCICR : nullptr) + ((p) >= 62 && (p) <= 69) ? (&PCICR) : nullptr) #endif void setup() { diff --git a/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu b/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu index b1c34930b435..cd9718bfb746 100644 --- a/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu +++ b/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu @@ -63,4 +63,4 @@ "id": "AutoBuild", "mnemonic": "A" } -] \ No newline at end of file +] diff --git a/buildroot/share/tests/ARMED-tests b/buildroot/share/tests/ARMED-tests new file mode 100644 index 000000000000..44af749a4827 --- /dev/null +++ b/buildroot/share/tests/ARMED-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 ARMED +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs ArmEd +exec_test $1 $2 "ArmEd Example Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/BIGTREE_BTT002-tests b/buildroot/share/tests/BIGTREE_BTT002-tests new file mode 100644 index 000000000000..45366e3f5a5d --- /dev/null +++ b/buildroot/share/tests/BIGTREE_BTT002-tests @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F407VET6 BigTreeTech BTT002 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BIGTREE_BTT002_V1_0 +opt_set SERIAL_PORT 1 +exec_test $1 $2 "BigTreeTech BTT002 Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/BIGTREE_SKR_PRO-tests b/buildroot/share/tests/BIGTREE_SKR_PRO-tests new file mode 100644 index 000000000000..ef4dc606107a --- /dev/null +++ b/buildroot/share/tests/BIGTREE_SKR_PRO-tests @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F407ZG BigTreeTech SKR Pro +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BIGTREE_SKR_PRO_V1_1 +opt_set SERIAL_PORT 1 +exec_test $1 $2 "BigTreeTech SKR Pro Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/DUE-tests b/buildroot/share/tests/DUE-tests index f793237cfba9..756e7a949263 100755 --- a/buildroot/share/tests/DUE-tests +++ b/buildroot/share/tests/DUE-tests @@ -6,29 +6,55 @@ # exit on first failure set -e +backup_ramps # pins_set is used below... + restore_configs -opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB EXTENSIBLE_UI EXTUI_EXAMPLE -opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS +opt_set LCD_LANGUAGE bg +opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB +opt_set TEMP_SENSOR_0 -2 +opt_set TEMP_SENSOR_BED 2 +opt_set GRID_MAX_POINTS_X 16 +opt_set FANMUX0_PIN 53 +opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \ + PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \ + EEPROM_SETTINGS SDSUPPORT BINARY_FILE_TRANSFER \ + BLINKM PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ + NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ + NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_DISTANCE_MM FILAMENT_RUNOUT_SENSOR \ + AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ + SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE CALIBRATION_GCODE \ + BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \ + FWRETRACT ARC_SUPPORT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ + PSU_CONTROL AUTO_POWER_CONTROL \ + SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER \ + PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL \ + EXTENSIBLE_UI +opt_add EXTUI_EXAMPLE opt_set E0_AUTO_FAN_PIN 8 opt_set EXTRUDER_AUTO_FAN_SPEED 100 -exec_test $1 $2 "RAMPS4DUE_EFB with S_CURVE_ACCELERATION, EEPROM_SETTINGS, GCODE_MACROS" +opt_set TEMP_SENSOR_CHAMBER 3 +opt_set HEATER_CHAMBER_PIN 45 +exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), EXTENSIBLE_UI, S-Curve, many options." restore_configs opt_set MOTHERBOARD BOARD_RADDS -opt_enable USE_XMAX_PLUG USE_YMAX_PLUG BLTOUCH AUTO_BED_LEVELING_BILINEAR \ - Z_TRIPLE_STEPPER_DRIVERS Z_TRIPLE_ENDSTOPS Z_STEPPER_AUTO_ALIGN ENDSTOPPULLUPS +opt_enable USE_XMAX_PLUG USE_YMAX_PLUG ENDSTOPPULLUPS BLTOUCH AUTO_BED_LEVELING_BILINEAR \ + Z_TRIPLE_STEPPER_DRIVERS Z_TRIPLE_ENDSTOPS Z_STEPPER_AUTO_ALIGN \ + Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #TOUCH_UI_FTDI_EVE LCD_ALEPHOBJECTS_CLCD_UI OTHER_PIN_LAYOUT opt_add Z2_MAX_ENDSTOP_INVERTING false opt_add Z3_MAX_ENDSTOP_INVERTING false -pins_set RAMPS X_MAX_PIN -1 -pins_set RAMPS Y_MAX_PIN -1 +pins_set ramps/RAMPS X_MAX_PIN -1 +pins_set ramps/RAMPS Y_MAX_PIN -1 opt_add Z2_MAX_PIN 2 opt_add Z3_MAX_PIN 3 -exec_test $1 $2 "RADDS with Z_TRIPLE_STEPPER_DRIVERS and Z_STEPPER_AUTO_ALIGN" +exec_test $1 $2 "RADDS with ABL (Bilinear), Z_TRIPLE_STEPPER_DRIVERS and Z_STEPPER_AUTO_ALIGN" # # Test SWITCHING_EXTRUDER # restore_configs +opt_set LCD_LANGUAGE fi opt_set MOTHERBOARD BOARD_RAMPS4DUE_EEF opt_set EXTRUDERS 2 opt_set NUM_SERVOS 1 diff --git a/buildroot/share/tests/FYSETC_F6_13-tests b/buildroot/share/tests/FYSETC_F6_13-tests new file mode 100644 index 000000000000..5ddbac554e73 --- /dev/null +++ b/buildroot/share/tests/FYSETC_F6_13-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega FYSETC F6 1.3 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_FYSETC_F6_13 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/LPC1768-tests b/buildroot/share/tests/LPC1768-tests index bff465760bcb..e66087a00c59 100755 --- a/buildroot/share/tests/LPC1768-tests +++ b/buildroot/share/tests/LPC1768-tests @@ -6,21 +6,22 @@ # exit on first failure set -e -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -exec_test $1 $2 "Build Re-ARM Default Configuration" +# +# Build with the default configurations +# +#restore_configs +#opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB +#exec_test $1 $2 "Default Configuration" restore_configs opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -opt_enable VIKI2 SDSUPPORT -opt_enable SERIAL_PORT2 -opt_enable NEOPIXEL_LED +opt_enable VIKI2 SDSUPPORT SERIAL_PORT2 NEOPIXEL_LED BAUD_RATE_GCODE opt_set NEOPIXEL_PIN P1_16 exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" -restore_configs -use_example_configs Mks/Sbase -exec_test $1 $2 "MKS SBASE Example Config" +#restore_configs +#use_example_configs Mks/Sbase +#exec_test $1 $2 "MKS SBASE Example Config" restore_configs opt_set MOTHERBOARD BOARD_MKS_SBASE @@ -46,21 +47,5 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_ opt_set GRID_MAX_POINTS_X 16 exec_test $1 $2 "Re-ARM with Many Features" -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ - REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ - AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ - FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ - SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ - SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWRETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS \ - MENU_ADDAUTOSTART SDCARD_SORT_ALPHA -opt_set FAN_MIN_PWM 50 -opt_set FAN_KICKSTART_TIME 100 -opt_set XY_FREQUENCY_LIMIT 15 -exec_test $1 $2 "Re-ARM with Many less common options" - # clean up restore_configs diff --git a/buildroot/share/tests/LPC1769-tests b/buildroot/share/tests/LPC1769-tests index ca8be167b3a1..641c50f3e326 100755 --- a/buildroot/share/tests/LPC1769-tests +++ b/buildroot/share/tests/LPC1769-tests @@ -6,9 +6,11 @@ # exit on first failure set -e -restore_configs +# +# Build with the default configurations +# use_example_configs Azteeg/X5GT -exec_test $1 $2 "Azteeg X5GT Example Config" +exec_test $1 $2 "Azteeg X5GT Example Configuration" restore_configs opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD @@ -19,37 +21,37 @@ opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ - Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ + Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE BAUD_RATE_GCODE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Smoothieboard Many Features" +exec_test $1 $2 "Smoothieboard with many features" -restore_configs -opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI -opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ - REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ - AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ - FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ - SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ - SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA -opt_set FAN_MIN_PWM 50 -opt_set FAN_KICKSTART_TIME 100 -opt_set XY_FREQUENCY_LIMIT 15 -exec_test $1 $2 "Azteeg X5 MINI WIFI Many less common options" +#restore_configs +#opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI +#opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ +# REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ +# AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ +# FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ +# SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ +# SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS BAUD_RATE_GCODE \ +# VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ +# EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA +#opt_set FAN_MIN_PWM 50 +#opt_set FAN_KICKSTART_TIME 100 +#opt_set XY_FREQUENCY_LIMIT 15 +#exec_test $1 $2 "Azteeg X5 MINI WIFI Many less common options" restore_configs use_example_configs delta/generic opt_set MOTHERBOARD BOARD_COHESION3D_REMIX -opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT -opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130 -opt_enable TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD TMC_DEBUG \ - SENSORLESS_PROBING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY -exec_test $1 $2 "Delta Config (generic) + BOARD_COHESION3D_REMIX + UBL + EEPROM_SETTINGS + SENSORLESS_PROBING" +opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT BAUD_RATE_GCODE \ + TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD \ + SENSORLESS_PROBING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY TMC_DEBUG +opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN PSU_CONTROL +exec_test $1 $2 "Cohesion3D Remix DELTA + ABL Bilinear + EEPROM + SENSORLESS_PROBING" # clean up restore_configs diff --git a/buildroot/share/tests/SAMD51_grandcentral_m4-tests b/buildroot/share/tests/SAMD51_grandcentral_m4-tests new file mode 100644 index 000000000000..898a58560472 --- /dev/null +++ b/buildroot/share/tests/SAMD51_grandcentral_m4-tests @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# +# Build tests for Adafruit Grand Central M4 (ATMEL ARM Cortex-M4) +# + +# exit on first failure +set -e + +# clean up +restore_configs diff --git a/buildroot/share/tests/STM32F103CB_malyan-tests b/buildroot/share/tests/STM32F103CB_malyan-tests new file mode 100644 index 000000000000..fced4d5d2404 --- /dev/null +++ b/buildroot/share/tests/STM32F103CB_malyan-tests @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103CB Malyan M200 +# + +# exit on first failure +set -e + +use_example_configs Malyan/M200 +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/STM32F103RC_bigtree-tests b/buildroot/share/tests/STM32F103RC_bigtree-tests new file mode 100644 index 000000000000..653614f375aa --- /dev/null +++ b/buildroot/share/tests/STM32F103RC_bigtree-tests @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103RC Bigtreetech (SKR Mini E3) +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 +opt_set SERIAL_PORT 1 +opt_set SERIAL_PORT_2 -1 +exec_test $1 $2 "Bigtreetech SKR Mini E3 - Basic Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/STM32F103RC_bigtree_USB-tests b/buildroot/share/tests/STM32F103RC_bigtree_USB-tests new file mode 100644 index 000000000000..50c37e36de83 --- /dev/null +++ b/buildroot/share/tests/STM32F103RC_bigtree_USB-tests @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103RC Bigtreetech (SKR Mini v1.1) +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BIGTREE_SKR_MINI_V1_1 +opt_set SERIAL_PORT 1 +opt_set SERIAL_PORT_2 -1 +exec_test $1 $2 "Bigtreetech SKR Mini v1.1 - Basic Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/STM32F103RC_fysetc-tests b/buildroot/share/tests/STM32F103RC_fysetc-tests new file mode 100644 index 000000000000..7d08fb7c5862 --- /dev/null +++ b/buildroot/share/tests/STM32F103RC_fysetc-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103RC FYSETC +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs "FYSETC/Cheetah 1.2/base" +exec_test $1 $2 "Cheetah 1.2 Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/STM32F1-tests b/buildroot/share/tests/STM32F103RE-tests similarity index 75% rename from buildroot/share/tests/STM32F1-tests rename to buildroot/share/tests/STM32F103RE-tests index 4b6c77ec5c01..63fe5ba393b8 100755 --- a/buildroot/share/tests/STM32F1-tests +++ b/buildroot/share/tests/STM32F103RE-tests @@ -6,13 +6,16 @@ # exit on first failure set -e +# +# Build with the default configurations +# restore_configs -opt_set MOTHERBOARD BOARD_STM32F1R +opt_set MOTHERBOARD BOARD_STM32F103RE opt_set EXTRUDERS 2 opt_set SERIAL_PORT -1 opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT \ PAREN_COMMENTS GCODE_MOTION_MODES SINGLENOZZLE TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_PARK \ - GCODE_MACROS NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE + BAUD_RATE_GCODE GCODE_MACROS NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT PAREN_COMMENTS GCODE_MOTION_MODES" # cleanup diff --git a/buildroot/share/tests/STM32F103RE_bigtree-tests b/buildroot/share/tests/STM32F103RE_bigtree-tests new file mode 100644 index 000000000000..196bc4259321 --- /dev/null +++ b/buildroot/share/tests/STM32F103RE_bigtree-tests @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103RE Bigtreetech (SKR E3 DIP v1.0) +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BIGTREE_SKR_E3_DIP +opt_set SERIAL_PORT 1 +opt_set SERIAL_PORT_2 -1 +exec_test $1 $2 "Bigtreetech SKR E3 DIP v1.0 - Basic Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/STM32F103RE_bigtree_USB-tests b/buildroot/share/tests/STM32F103RE_bigtree_USB-tests new file mode 100644 index 000000000000..196bc4259321 --- /dev/null +++ b/buildroot/share/tests/STM32F103RE_bigtree_USB-tests @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103RE Bigtreetech (SKR E3 DIP v1.0) +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BIGTREE_SKR_E3_DIP +opt_set SERIAL_PORT 1 +opt_set SERIAL_PORT_2 -1 +exec_test $1 $2 "Bigtreetech SKR E3 DIP v1.0 - Basic Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/STM32F103VE_longer-tests b/buildroot/share/tests/STM32F103VE_longer-tests new file mode 100755 index 000000000000..85b22c1284dd --- /dev/null +++ b/buildroot/share/tests/STM32F103VE_longer-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103VET6 +# + +# exit on first failure +set -e + +use_example_configs Alfawise/U20 +opt_set MOTHERBOARD BOARD_LONGER3D_LK +opt_set SERIAL_PORT 1 +opt_enable BAUD_RATE_GCODE +exec_test $1 $2 "Full-featured U20 config" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/STM32F4-tests b/buildroot/share/tests/STM32F4-tests new file mode 100644 index 000000000000..b5beb7366377 --- /dev/null +++ b/buildroot/share/tests/STM32F4-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F4 disco_f407vg +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs STM32/STM32F4 +exec_test $1 $2 "STM32F4 Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/STM32F407VE_black-tests b/buildroot/share/tests/STM32F407VE_black-tests new file mode 100755 index 000000000000..c35b279b0f58 --- /dev/null +++ b/buildroot/share/tests/STM32F407VE_black-tests @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F407VET6 +# + +# exit on first failure +set -e + +use_example_configs STM32/Black_STM32F407VET6 +opt_enable BAUD_RATE_GCODE +exec_test $1 $2 "Full-featured Sample Black STM32F407VET6 config" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/STM32F7-tests b/buildroot/share/tests/STM32F7-tests new file mode 100644 index 000000000000..281222f15634 --- /dev/null +++ b/buildroot/share/tests/STM32F7-tests @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F7 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_REMRAM_V1 +opt_set SERIAL_PORT 1 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/at90usb1286_cdc-tests b/buildroot/share/tests/at90usb1286_cdc-tests new file mode 100644 index 000000000000..812e2ebcae32 --- /dev/null +++ b/buildroot/share/tests/at90usb1286_cdc-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AT90USB1286 ARMED +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BRAINWAVE_PRO +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/at90usb1286_dfu-tests b/buildroot/share/tests/at90usb1286_dfu-tests new file mode 100644 index 000000000000..7571994ec47e --- /dev/null +++ b/buildroot/share/tests/at90usb1286_dfu-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AT90USB1286 ARMED +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_PRINTRBOARD +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/esp32-tests b/buildroot/share/tests/esp32-tests index 6bffdf50f866..9d44b14343f5 100755 --- a/buildroot/share/tests/esp32-tests +++ b/buildroot/share/tests/esp32-tests @@ -1,14 +1,17 @@ #!/usr/bin/env bash # -# Build tests for esp32 +# Build tests for ESP32 # # exit on first failure set -e +# +# Build with the default configurations +# restore_configs -opt_set MOTHERBOARD BOARD_ESP32 -opt_enable WIFISUPPORT GCODE_MACROS +opt_set MOTHERBOARD BOARD_ESPRESSIF_ESP32 +opt_enable WIFISUPPORT GCODE_MACROS BAUD_RATE_GCODE opt_set "WIFI_SSID \"ssid\"" opt_set "WIFI_PWD \"password\"" opt_set TX_BUFFER_SIZE 64 diff --git a/buildroot/share/tests/jgaurora_a5s_a1-tests b/buildroot/share/tests/jgaurora_a5s_a1-tests new file mode 100644 index 000000000000..c6cc9e3f9c9e --- /dev/null +++ b/buildroot/share/tests/jgaurora_a5s_a1-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103ZE JGAurora A5S A1 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs JGAurora/A5S +exec_test $1 $2 "JGAurora/A5S Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/linux_native-tests b/buildroot/share/tests/linux_native-tests index cc45f5c29be4..38f531dadc4d 100755 --- a/buildroot/share/tests/linux_native-tests +++ b/buildroot/share/tests/linux_native-tests @@ -6,10 +6,13 @@ # exit on first failure set -e +# +# Build with the default configurations +# restore_configs opt_set MOTHERBOARD BOARD_LINUX_RAMPS opt_set TEMP_SENSOR_BED 1 -opt_enable PIDTEMPBED EEPROM_SETTINGS +opt_enable PIDTEMPBED EEPROM_SETTINGS BAUD_RATE_GCODE exec_test $1 $2 "Linux with EEPROM" # cleanup diff --git a/buildroot/share/tests/megaatmega1280-tests b/buildroot/share/tests/megaatmega1280-tests new file mode 100644 index 000000000000..05e262f6e73f --- /dev/null +++ b/buildroot/share/tests/megaatmega1280-tests @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega1280 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +#restore_configs +#exec_test $1 $2 "Default Configuration" + +# +# Test MESH_BED_LEVELING feature, with LCD +# +restore_configs +opt_set LCD_LANGUAGE an +opt_enable SPINDLE_FEATURE ULTIMAKERCONTROLLER LCD_BED_LEVELING \ + MESH_BED_LEVELING ENABLE_LEVELING_FADE_HEIGHT MESH_G28_REST_ORIGIN \ + G26_MESH_VALIDATION MESH_EDIT_MENU +exec_test $1 $2 "Spindle, MESH_BED_LEVELING, and LCD" + + +# clean up +restore_configs diff --git a/buildroot/share/tests/megaatmega2560-tests b/buildroot/share/tests/megaatmega2560-tests index 2e2bc4442d00..1e53b7e9e252 100755 --- a/buildroot/share/tests/megaatmega2560-tests +++ b/buildroot/share/tests/megaatmega2560-tests @@ -1,27 +1,23 @@ #!/usr/bin/env bash # -# Build tests for AVR +# Build tests for AVR ATmega2560 # # exit on first failure set -e -# -# Backup pins_RAMPS.h -# -cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup - # # Build with the default configurations # -restore_configs -exec_test $1 $2 "Default Configuration" +#restore_configs +#exec_test $1 $2 "Default Configuration" # # Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4 # Test a "Fix Mounted" Probe with Safe Homing, some arc options, # linear bed leveling, M48, leveling debug, and firmware retraction. # +restore_configs opt_set MOTHERBOARD BOARD_RAMPS_14_EEB opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_0 -2 @@ -29,20 +25,26 @@ opt_set TEMP_SENSOR_1 1 opt_set TEMP_SENSOR_BED 2 opt_set GRID_MAX_POINTS_X 16 opt_set FANMUX0_PIN 53 -opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING EEPROM_SETTINGS \ - REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \ - NEOPIXEL_LED BLINKM PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN \ +opt_disable USE_WATCHDOG +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \ + PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \ + EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \ + BLINKM PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ + NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ + PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU LCD_SHOW_E_TOTAL \ + PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LEVEL_BED_CORNERS \ NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \ - AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ + ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \ + AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DISTINCT_E_FACTORS \ SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \ - FWRETRACT ARC_P_CIRCLES ADVANCED_PAUSE_FEATURE CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ + BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \ + FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ PSU_CONTROL AUTO_POWER_CONTROL POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE \ - LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST PINS_DEBUGGING \ - MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING BACKLASH_COMPENSATION BACKLASH_GCODE -opt_enable SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER + SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE \ + HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL opt_set TEMP_SENSOR_CHAMBER 3 opt_set HEATER_CHAMBER_PIN 45 -exec_test $1 $2 "RAMPS with 2 extruders, RepRap LCD, Linear ABL, LEDs, and many options" +exec_test $1 $2 "RAMPS | EXTRUDERS 2 | CHAR LCD + SD | FIX Probe | ABL-Linear | Advanced Pause | PLR | LEDs ..." # # Test a probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders @@ -50,82 +52,101 @@ exec_test $1 $2 "RAMPS with 2 extruders, RepRap LCD, Linear ABL, LEDs, and many use_example_configs AnimationExample opt_set SHOW_CUSTOM_BOOTSCREEN opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO +opt_set LCD_LANGUAGE fr 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 1000 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 \ - EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT GCODE_MACROS \ - USB_FLASH_DRIVE_SUPPORT SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES LIGHTWEIGHT_UI \ - CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING BABYSTEP_XY LIN_ADVANCE NANODLP_Z_SYNC QUICK_HOME JUNCTION_DEVIATION MULTI_NOZZLE_DUPLICATION -exec_test $1 $2 "Azteeg X3 with 5 extruders, RRDFGSC, probeless UBL, Linear Advance, and more" +opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ + REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING BOOT_MARLIN_LOGO_SMALL \ + SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES CANCEL_OBJECTS \ + EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_USER_MENUS \ + MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE QUICK_HOME \ + LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \ + BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL +exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE ..." # # Add a Sled Z Probe, use UBL Cartesian moves, use Japanese language # -opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE -opt_set LCD_LANGUAGE jp-kana +use_example_configs AnimationExample +opt_set SHOW_CUSTOM_BOOTSCREEN +opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO +opt_set LCD_LANGUAGE fr +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 1000 +opt_set TEMP_SENSOR_BED 1 +opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ + REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING BOOT_MARLIN_LOGO_SMALL \ + SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES CANCEL_OBJECTS \ + EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_USER_MENUS \ + MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE QUICK_HOME \ + LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \ + BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL \ + Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE +opt_set LCD_LANGUAGE jp_kana opt_disable SEGMENT_LEVELED_MOVES -opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET BABYSTEP_DISPLAY_TOTAL -exec_test $1 $2 "... Sled Z Probe, Skew, UBL Cartesian moves, Japanese, and Z probe BABYSTEPPING" +opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET BABYSTEP_DISPLAY_TOTAL M114_DETAIL +exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sled Probe | Skew | JP-Kana | Babystep offsets ..." # # Test a Servo Probe # ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES # restore_configs -opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \ - AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT +opt_set LCD_LANGUAGE zh_CN +opt_set EXTRUDERS 5 opt_set NUM_SERVOS 1 -opt_enable NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET -exec_test $1 $2 "RAMPS with ZONESTAR_LCD, Servo Probe, 3-Point ABL, DEBUG_LEVELING_FEATURE, EEPROM, G38, and more" - -# -# Test MESH_BED_LEVELING feature, with LCD -# -restore_configs -opt_enable SPINDLE_FEATURE MESH_BED_LEVELING G26_MESH_EDITING MESH_G28_REST_ORIGIN LCD_BED_LEVELING MESH_EDIT_MENU ULTIMAKERCONTROLLER -exec_test $1 $2 "Spindle, MESH_BED_LEVELING, and LCD" +opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ + AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ + NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ + PRUSA_MMU2 MMU2_MENUS NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE +exec_test $1 $2 "RAMPS | ZONESTAR_LCD | MMU2 | Servo Probe | ABL 3-Pt | Debug Leveling | EEPROM | G38 ..." # # Test MINIRAMBO with PWM_MOTOR_CURRENT and many features # restore_configs opt_set MOTHERBOARD BOARD_MINIRAMBO -opt_enable PROBE_MANUALLY AUTO_BED_LEVELING_BILINEAR G26_MESH_EDITING LCD_BED_LEVELING MESH_EDIT_MENU \ - EEPROM_SETTINGS EEPROM_CHITCHAT \ +opt_set LCD_LANGUAGE de +opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT \ + ULTIMAKERCONTROLLER SDSUPPORT PCA9632 LCD_INFO_MENU \ + AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY LCD_BED_LEVELING G26_MESH_VALIDATION MESH_EDIT_MENU \ M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR \ - INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ - ULTIMAKERCONTROLLER SDSUPPORT \ - PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PCA9632 \ - BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS \ - ADVANCED_PAUSE_FEATURE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE \ - LCD_INFO_MENU M114_DETAIL + INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT EXPERIMENTAL_I2CBUS \ + NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE \ + ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES \ + PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 M114_DETAIL opt_set PWM_MOTOR_CURRENT "{ 1300, 1300, 1250 }" opt_set I2C_SLAVE_ADDRESS 63 -exec_test $1 $2 "MINIRAMBO for PWM_MOTOR_CURRENT etc" +exec_test $1 $2 "MINIRAMBO | Ultimaker LCD | M100 | PWM_MOTOR_CURRENT | PRINTCOUNTER | Advanced Pause ..." # # Mixing Extruder with 5 steppers, Cyrillic # restore_configs opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO +opt_set LCD_LANGUAGE el_gr opt_enable MIXING_EXTRUDER GRADIENT_MIX GRADIENT_VTOOL CR10_STOCKDISPLAY opt_set MIXING_STEPPERS 5 opt_set LCD_LANGUAGE ru -exec_test $1 $2 "Mixing Extruder with 5 steppers, Cyrillic" +exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Cyrillic" # # Test DUAL_X_CARRIAGE # restore_configs opt_set MOTHERBOARD BOARD_RUMBA +opt_set LCD_LANGUAGE pt opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_1 1 opt_enable USE_XMAX_PLUG DUAL_X_CARRIAGE -exec_test $1 $2 "DUAL_X_CARRIAGE" +exec_test $1 $2 "Rumba | DUAL_X_CARRIAGE" # # Test SPEAKER with BOARD_BQ_ZUM_MEGA_3D and BQ_LCD_SMART_CONTROLLER @@ -147,23 +168,23 @@ exec_test $1 $2 "DUAL_X_CARRIAGE" # Test many less common options # restore_configs -opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO -opt_set EXTRUDERS 2 -opt_set TEMP_SENSOR_1 -4 +opt_set MOTHERBOARD BOARD_MEGATRONICS_32 +opt_set LCD_LANGUAGE it +opt_set MIXING_STEPPERS 2 opt_set SERVO_DELAY "{ 300, 300, 300 }" -opt_enable COREYX USE_XMAX_PLUG \ - REPRAP_DISCOUNT_SMART_CONTROLLER BABYSTEPPING BABYSTEP_DISPLAY_TOTAL DAC_MOTOR_CURRENT_DEFAULT \ - FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR \ - ENDSTOP_INTERRUPTS_FEATURE ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM SDSUPPORT \ - SWITCHING_TOOLHEAD NUM_SERVOS DEBUG_LEVELING_FEATURE \ +opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \ + BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY \ + REPRAP_DISCOUNT_SMART_CONTROLLER MENU_ADDAUTOSTART SDSUPPORT SDCARD_SORT_ALPHA \ + ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM \ + FIX_MOUNTED_PROBE AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE FILAMENT_WIDTH_SENSOR \ SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ - SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA + SD_ABORT_ON_ENDSTOP_HIT HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT ADVANCED_OK M114_DETAIL \ + VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL EXTRA_FAN_SPEED FWRETRACT opt_set FAN_MIN_PWM 50 opt_set FAN_KICKSTART_TIME 100 -opt_set XY_FREQUENCY_LIMIT 15 -exec_test $1 $2 "Many less common options" +opt_set XY_FREQUENCY_LIMIT 15 +opt_add FILWIDTH_PIN 5 +exec_test $1 $2 "Megatronics 3.2 | Gradient Mix | Endstop Int. | Home Y > X | FW Retract ..." ######## Other Standard LCD/Panels ############## # @@ -251,11 +272,11 @@ exec_test $1 $2 "Many less common options" # #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 ..."; exec_test $1 $2 "Stuff"; done +#for lang in an bg ca 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 vi zh_CN zh_TW test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff"; done # #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 ..."; exec_test $1 $2 "Stuff"; done +#for lang in an bg ca 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 vi zh_CN zh_TW test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff"; done ######## Example Configurations ############## # @@ -263,65 +284,78 @@ exec_test $1 $2 "Many less common options" # use_example_configs Creality/CR-10S exec_test $1 $2 "Full-featured CR-10S config" + # # BQ Hephestos 2 #restore_configs #use_example_configs Hephestos_2 #exec_test $1 $2 "Stuff" + # # Delta Config (generic) + ABL bilinear + BLTOUCH use_example_configs delta/generic +opt_set LCD_LANGUAGE cz opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR BLTOUCH BLTOUCH_FORCE_5V_MODE -exec_test $1 $2 "Delta Config (generic) + ABL bilinear + BLTOUCH" +exec_test $1 $2 "RAMPS | DELTA | RRD LCD | ABL Bilinear | BLTOUCH" + # # Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS # use_example_configs delta/generic +opt_set LCD_LANGUAGE ko_KR opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 Z_PROBE_ALLEN_KEY EEPROM_SETTINGS EEPROM_CHITCHAT \ OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY -exec_test $1 $2 "Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS" +exec_test $1 $2 "RAMPS | DELTA | OLED_PANEL_TINYBOY2 | UBL | Allen Key | EEPROM" + # # Delta Config (FLSUN AC because it's complex) # use_example_configs delta/FLSUN/auto_calibrate -exec_test $1 $2 "Delta Config (FLSUN AC because it's complex)" +exec_test $1 $2 "RAMPS 1.3 | DELTA | FLSUN AC Config" + # # Makibox Config need to check board type for Teensy++ 2.0 # #use_example_configs makibox #exec_test $1 $2 "Stuff" + # # SCARA with TMC2130 # -use_example_configs SCARA +use_example_configs SCARA/Morgan +opt_set LCD_LANGUAGE es opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \ - EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER \ + MKS_12864OLED EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING SQUARE_WAVE_STEPPING opt_set X_MAX_ENDSTOP_INVERTING false opt_set X_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130 opt_set E0_DRIVER_TYPE TMC2660 -exec_test $1 $2 "SCARA with TMC2130, TMC2209, and TMC2660" +exec_test $1 $2 "RAMPS | SCARA | Mixed TMC | EEPROM" + # # Test mixed TMC config # restore_configs +opt_set LCD_LANGUAGE vi opt_set X_DRIVER_TYPE TMC2160 opt_set Y_DRIVER_TYPE TMC5160 opt_set Z_DRIVER_TYPE TMC2208 opt_set E0_DRIVER_TYPE TMC2130 opt_set X_MIN_ENDSTOP_INVERTING true opt_set Y_MIN_ENDSTOP_INVERTING true -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD USE_ZMIN_PLUG SENSORLESS_HOMING TMC_DEBUG -exec_test $1 $2 "Mixed TMC configuration" +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ + MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \ + MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD \ + USE_ZMIN_PLUG SENSORLESS_HOMING TMC_DEBUG M114_DETAIL +exec_test $1 $2 "RAMPS | Mixed TMC | Sensorless | RRDFGSC | Games" + # # tvrrug Config need to check board type for sanguino atmega644p # #use_example_configs tvrrug/Round2 #exec_test $1 $2 "Stuff" -# -# # clean up restore_configs diff --git a/buildroot/share/tests/mks_robin-tests b/buildroot/share/tests/mks_robin-tests new file mode 100644 index 000000000000..99d41ef4ad56 --- /dev/null +++ b/buildroot/share/tests/mks_robin-tests @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 genericSTM32F103ZE +# + +# exit on first failure +set -e + +use_example_configs Mks/Robin +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/mks_robin_lite-tests b/buildroot/share/tests/mks_robin_lite-tests new file mode 100644 index 000000000000..a50d7347f5b7 --- /dev/null +++ b/buildroot/share/tests/mks_robin_lite-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 genericSTM32F103RC +# + +# exit on first failure +set -e + +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_LITE +opt_set EXTRUDERS 1 +opt_set TEMP_SENSOR_1 0 +opt_disable FSMC_GRAPHICAL_TFT +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/mks_robin_mini-tests b/buildroot/share/tests/mks_robin_mini-tests new file mode 100644 index 000000000000..c8ba5a5a4870 --- /dev/null +++ b/buildroot/share/tests/mks_robin_mini-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 genericSTM32F103VE +# + +# exit on first failure +set -e + +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_MINI +opt_set EXTRUDERS 1 +opt_set TEMP_SENSOR_1 0 +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/mks_robin_nano-tests b/buildroot/share/tests/mks_robin_nano-tests new file mode 100644 index 000000000000..809fd6e6f503 --- /dev/null +++ b/buildroot/share/tests/mks_robin_nano-tests @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 genericSTM32F103VE +# + +# exit on first failure +set -e + +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/rambo-tests b/buildroot/share/tests/rambo-tests new file mode 100644 index 000000000000..3f741fcba6b3 --- /dev/null +++ b/buildroot/share/tests/rambo-tests @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega2560 RAMBo +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_EINSY_RAMBO +opt_set X_DRIVER_TYPE TMC2130 +opt_set Y_DRIVER_TYPE TMC2130 +opt_set Z_DRIVER_TYPE TMC2130 +opt_set E0_DRIVER_TYPE TMC2130 +exec_test $1 $2 "Default Configuration" + +# +# Full size Rambo Dual Endstop CNC +# +restore_configs +opt_set MOTHERBOARD BOARD_RAMBO +opt_set EXTRUDERS 0 +opt_set TEMP_SENSOR_0 999 +opt_set DUMMY_THERMISTOR_999_VALUE 170 +opt_set DIGIPOT_MOTOR_CURRENT '{ 120, 120, 120, 120, 120 }' +opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \ + REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER REVERSE_ENCODER_DIRECTION SDSUPPORT EEPROM_SETTINGS \ + S_CURVE_ACCELERATION X_DUAL_STEPPER_DRIVERS X_DUAL_ENDSTOPS Y_DUAL_STEPPER_DRIVERS Y_DUAL_ENDSTOPS \ + ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES +opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS +exec_test $1 $2 "Rambo CNC Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/sanguino_atmega1284p-tests b/buildroot/share/tests/sanguino_atmega1284p-tests new file mode 100644 index 000000000000..7181f961c483 --- /dev/null +++ b/buildroot/share/tests/sanguino_atmega1284p-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega 1284p +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_SANGUINOLOLU_12 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/sanguino_atmega644p-tests b/buildroot/share/tests/sanguino_atmega644p-tests new file mode 100644 index 000000000000..41626b23f705 --- /dev/null +++ b/buildroot/share/tests/sanguino_atmega644p-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega 644p +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_SANGUINOLOLU_12 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/teensy31-tests b/buildroot/share/tests/teensy31-tests new file mode 100755 index 000000000000..a847d6f57266 --- /dev/null +++ b/buildroot/share/tests/teensy31-tests @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# +# Build tests for Teensy 3.1/3.2 (ARM Cortex-M4) +# + +# exit on first failure +set -e + +backup_ramps + +restore_configs +opt_set MOTHERBOARD BOARD_TEENSY31_32 +exec_test $1 $2 "Teensy3.1 with default config" + +# +# Test many features together +# +restore_configs +opt_set MOTHERBOARD BOARD_TEENSY31_32 +opt_set TEMP_SENSOR_0 1 +opt_set TEMP_SENSOR_BED 1 +opt_enable EEPROM_SETTINGS FILAMENT_WIDTH_SENSOR CALIBRATION_GCODE BAUD_RATE_GCODE \ + FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR DEBUG_LEVELING_FEATURE Z_MIN_PROBE_REPEATABILITY_TEST \ + BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET PRINTCOUNTER SLOW_PWM_HEATERS PIDTEMPBED \ + INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER \ + NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PARK_HEAD_ON_PAUSE \ + ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES \ + PHOTO_GCODE PHOTO_POSITION PHOTO_SWITCH_POSITION PHOTO_SWITCH_MS PHOTO_DELAY_MS PHOTO_RETRACT_MM \ + HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT +opt_set I2C_SLAVE_ADDRESS 63 +opt_set GRID_MAX_POINTS_X 16 +exec_test $1 $2 "Teensy3.1 with many features" diff --git a/buildroot/share/tests/teensy35-tests b/buildroot/share/tests/teensy35-tests index 6539bf98549e..9661666c4a1a 100755 --- a/buildroot/share/tests/teensy35-tests +++ b/buildroot/share/tests/teensy35-tests @@ -6,9 +6,10 @@ # exit on first failure set -e +backup_ramps + restore_configs opt_set MOTHERBOARD BOARD_TEENSY35_36 -cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup exec_test $1 $2 "Teensy3.5 with default config" # @@ -21,7 +22,7 @@ opt_set TEMP_SENSOR_0 1 opt_set TEMP_SENSOR_1 5 opt_set TEMP_SENSOR_BED 1 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LCD_INFO_MENU SDSUPPORT SDCARD_SORT_ALPHA \ - FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY CALIBRATION_GCODE \ + FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY CALIBRATION_GCODE BAUD_RATE_GCODE \ FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER \ @@ -106,7 +107,7 @@ exec_test $1 $2 "COREXZ" restore_configs opt_set MOTHERBOARD BOARD_TEENSY35_36 opt_enable Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS -pins_set RAMPS X_MAX_PIN -1 +pins_set ramps/RAMPS X_MAX_PIN -1 opt_add Z2_MAX_PIN 2 opt_enable USE_XMAX_PLUG exec_test $1 $2 "Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS" diff --git a/buildroot/share/vscode/AutoBuildMarlin/README.md b/buildroot/share/vscode/AutoBuildMarlin/README.md index e3e9323f527a..bb2080d564a4 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/README.md +++ b/buildroot/share/vscode/AutoBuildMarlin/README.md @@ -1,52 +1,40 @@ -# Auto Build support for Visual Studio Code -This `Visual Studio Code` extension provides access to the `Auto Build` script. +# Auto Build Marlin -## Installation +"AutoBuildMarlin" is a *Visual Studio Code* extension that provides a one-button interface to build and upload Marlin Firmware to your selected `MOTHERBOARD`, removing the need to edit your `platformio.ini` file or scroll through a long list of Marlin environments. -Get the MarlinFirmware repository from GitHub. Open the directory `buildroot/share/vscode` and copy the `AutoBuildMarlin` folder to the `Visual Studio Code` extension directory. Relaunch `Visual Studio Code` to complete the installation. +## Get PlatformIO -To find the `Visual Studio Code` extension directory: +Before you install AutoBuildMarlin you'll first need to [Install PlatformIO in VSCode](http://marlinfw.org/docs/basics/install_platformio_vscode.html). Once you have followed these instructions, continue below. -- Windows - Use Windows Explorer's address bar to open `C:/Users/USERNAME/.vscode/extensions`. -- Mac - Use the Finder's `Go` menu to open `~/.vscode/extensions`. -- Linux - In the Terminal type `open ~/.vscode/extensions`. +## Installing This Extension -### 3. Install the PlatformIO extension -Click on `View` > `Command Palette...` +- [Download Marlin Firmware](http://marlinfw.org/meta/download/) and unzip it to your documents folder. +- Open the directory `buildroot/share/vscode` and copy the "`AutoBuildMarlin`" folder to **the *Visual Studio Code* `extensions` directory**. +- Relaunch *Visual Studio Code* to complete the installation. -![](./resources/view_command_palette.png) +### To find your `extensions` directory: -Find and click on `Extensions: Install Extensions` - -![](./resources/install_extensions.png) - -Type `platformio` into the search box and click on `Install` under `PlatformIO IDE`. - -![](./resources/platformio_install.png) +- **Windows** - Use Windows Explorer's address bar to open `C:/Users/USERNAME/.vscode/extensions`. +- **Mac** - Use the Finder's `Go` menu to open `~/.vscode/extensions`. +- **Linux** - In the Terminal type `open ~/.vscode/extensions`. ## Usage -This extension adds the Auto Build icon ![](./media/AB.svg) to the Activities bar. - -### 1. Open the Marlin folder -Click on `File` > `Open Folder...` - -![](./resources/Open_Folder.png) +- Open up the downloaded *Marlin Firmware* project folder (***NOT the "Marlin" folder within***) in *Visual Studio Code*. (You may also use the **Import Project…** option from the "PlaformIO Home" page.) -This brings up the `Open Folder` dialog. Select the folder that has the `platformio.ini` file in it. +- With Marlin open, the "File Explorer" should be firmly rooted in your Marlin Firmware folder: -![](./resources/Open_Marlin.png) + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/Activity_bar.png) -You should see something like the following. If not, click on the Explorer icon in the Activities bar. +- Click the **Marlin Auto Build** icon ![AutoBuild Icon](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/AB_icon.png) in the Activities Bar (on the left side of *Visual Studio Code* window) to bring up the **Marlin Auto Build** options bar. -![](./resources/Activity_bar.png) + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/AB_menu.png) -### 2. Click on the Auto Build Icon ![](./media/AB.svg) -This brings up the Auto Build menu icon bar. -![](./resources/AB_menu.png) +- Click one of the four icons -### 3. Click on one of the four icons -- ![](./resources/B_small.svg) - Clicking on it starts `PIO Build` -- ![](./resources/C_small.svg) - Clicking on it starts `PIO Clean` -- ![](./resources/U_small.svg) - Clicking on it starts `PIO Upload` -- ![](./resources/Ut_small.svg) - Clicking on it starts `PIO Upload (traceback)` + Icon|Action + ----|------ + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png)|Start **Marlin Build** to test your Marlin build + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png)|Start **Marlin Upload** to install Marlin on your board + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png)|Start **Marlin Upload (traceback)** to install Marlin with debugging + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png)|Start **Marlin Clean** to delete old build files diff --git a/buildroot/share/vscode/AutoBuildMarlin/extension.js b/buildroot/share/vscode/AutoBuildMarlin/extension.js index 01198a62bbf3..15b0b121e3de 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/extension.js +++ b/buildroot/share/vscode/AutoBuildMarlin/extension.js @@ -7,34 +7,34 @@ function activate(context) { console.log('Extension "AutoBuildMarlin" is now active!'); var NEXT_TERM_ID = 1; - var pio_build = vscode.commands.registerCommand('piobuild', function () { + var mf_build = vscode.commands.registerCommand('mfbuild', function () { vscode.commands.executeCommand('workbench.action.files.saveAll'); - const terminal = vscode.window.createTerminal(`AB Build #${NEXT_TERM_ID++}`); + const terminal = vscode.window.createTerminal(`Marlin Build #${NEXT_TERM_ID++}`); terminal.show(true); terminal.sendText("python buildroot/share/atom/auto_build.py build"); }); - var pio_clean = vscode.commands.registerCommand('pioclean', function () { - const terminal = vscode.window.createTerminal(`AB Clean #${NEXT_TERM_ID++}`); - terminal.show(true); - terminal.sendText("python buildroot/share/atom/auto_build.py clean"); - }); - var pio_upload = vscode.commands.registerCommand('pioupload', function () { + var mf_upload = vscode.commands.registerCommand('mfupload', function () { vscode.commands.executeCommand('workbench.action.files.saveAll'); - const terminal = vscode.window.createTerminal(`AB Upload #${NEXT_TERM_ID++}`); + const terminal = vscode.window.createTerminal(`Marlin Upload #${NEXT_TERM_ID++}`); terminal.show(true); terminal.sendText("python buildroot/share/atom/auto_build.py upload"); }); - var pio_traceback = vscode.commands.registerCommand('piotraceback', function () { + var mf_traceback = vscode.commands.registerCommand('mftraceback', function () { vscode.commands.executeCommand('workbench.action.files.saveAll'); - const terminal = vscode.window.createTerminal(`AB Traceback #${NEXT_TERM_ID++}`); + const terminal = vscode.window.createTerminal(`Marlin Traceback #${NEXT_TERM_ID++}`); terminal.show(true); terminal.sendText("python buildroot/share/atom/auto_build.py traceback"); }); + var mf_clean = vscode.commands.registerCommand('mfclean', function () { + const terminal = vscode.window.createTerminal(`Marlin Clean #${NEXT_TERM_ID++}`); + terminal.show(true); + terminal.sendText("python buildroot/share/atom/auto_build.py clean"); + }); - context.subscriptions.push(pio_build); - context.subscriptions.push(pio_clean); - context.subscriptions.push(pio_upload); - context.subscriptions.push(pio_traceback); + context.subscriptions.push(mf_build); + context.subscriptions.push(mf_upload); + context.subscriptions.push(mf_traceback); + context.subscriptions.push(mf_clean); } exports.activate = activate; diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/AB_icon.png b/buildroot/share/vscode/AutoBuildMarlin/img/AB_icon.png new file mode 100644 index 000000000000..951fee8db659 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/AB_icon.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/AB_menu.png b/buildroot/share/vscode/AutoBuildMarlin/img/AB_menu.png new file mode 100644 index 000000000000..39afa92261f1 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/AB_menu.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/Activity_bar.png b/buildroot/share/vscode/AutoBuildMarlin/img/Activity_bar.png new file mode 100644 index 000000000000..db049a853011 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/Activity_bar.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png b/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png new file mode 100644 index 000000000000..840d06e11e57 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png b/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png new file mode 100644 index 000000000000..9f5630e4280f Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png b/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png new file mode 100644 index 000000000000..70af1ca3910d Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png b/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png new file mode 100644 index 000000000000..35c87b1c6cce Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/logo.svg b/buildroot/share/vscode/AutoBuildMarlin/logo.svg new file mode 100644 index 000000000000..54956b4f15ca --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/logo.svg @@ -0,0 +1,111 @@ + + + +Marlin Firmware image/svg+xmlMarlin Firmware Ahmet Cem TURANJoão BrázioMarlinFirmwaremarlin-logo-new + + \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/media/AB.svg b/buildroot/share/vscode/AutoBuildMarlin/media/AB.svg deleted file mode 100644 index ac6dbb8a9af4..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/media/AB.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - VScode view icon - - Layer 2 - AB - - - Layer 1 - - - \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/package-lock.json b/buildroot/share/vscode/AutoBuildMarlin/package-lock.json index 69338349843a..9b333093a49e 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/package-lock.json +++ b/buildroot/share/vscode/AutoBuildMarlin/package-lock.json @@ -1,6 +1,6 @@ { "name": "auto-build", - "version": "0.1.0", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/buildroot/share/vscode/AutoBuildMarlin/package.json b/buildroot/share/vscode/AutoBuildMarlin/package.json index 3bff1098d798..9c00085a0679 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/package.json +++ b/buildroot/share/vscode/AutoBuildMarlin/package.json @@ -2,79 +2,100 @@ "name": "auto-build", "displayName": "Auto Build Marlin", "description": "Auto Build Marlin for VS code", - "version": "0.1.0", + "version": "2.0.0", "publisher": "marlinfirmware", + "icon": "logo.svg", "engines": { - "vscode": "^1.23.0" + "vscode": "^1.32.0" }, "enableProposedApi": true, "categories": [ "Other" ], "activationEvents": [ - "onCommand:piobuild", - "onCommand:pioclean", - "onCommand:pioupload", - "onCommand:piotraceback" + "onCommand:mfbuild", + "onCommand:mfclean", + "onCommand:mfupload", + "onCommand:mftraceback" ], "main": "./extension", "contributes": { "viewsContainers": { "activitybar": [ { - "id": "auto-build", - "title": "Auto Build Marlin", - "icon": "media/AB.svg" + "id": "autoBuildVC", + "title": "Marlin Build", + "icon": "resources/AB.svg" } ] }, "views": { - "auto-build": [ + "autoBuildVC": [ { - "id": "autobuild", - "name": " " + "id": "autoBuildView", + "name": "Build…" + }, + { + "id": "marlinView", + "name": "Marlin Info" } ] }, "commands": [ { - "command": "piobuild", - "title": "PIO Build", - "icon": "resources/B32x32_white.svg" + "command": "mfbuild", + "title": "Build", + "icon": { + "light": "resources/B48x48_light.svg", + "dark": "resources/B48x48_dark.svg" + } }, { - "command": "pioclean", - "title": "PIO Clean", - "icon": "resources/C32x32_white.svg" + "command": "mfupload", + "title": "Upload", + "icon": { + "light": "resources/U48x48_light.svg", + "dark": "resources/U48x48_dark.svg" + } }, { - "command": "pioupload", - "title": "PIO Upload", - "icon": "resources/U32x32_white.svg" + "command": "mftraceback", + "title": "Upload (traceback)", + "icon": { + "light": "resources/T48x48_light.svg", + "dark": "resources/T48x48_dark.svg" + } }, { - "command": "piotraceback", - "title": "PIO Upload (traceback)", - "icon": "resources/Ut32x32_white.svg" + "command": "mfclean", + "title": "Clean", + "icon": { + "light": "resources/C48x48_light.svg", + "dark": "resources/C48x48_dark.svg" + } } ], "menus": { "view/title": [ { - "command": "piobuild", - "group": "navigation@1" + "command": "mfbuild", + "group": "navigation@1", + "when": "view == autoBuildView || view == marlinView" }, { - "command": "pioclean", - "group": "navigation@2" + "command": "mfupload", + "group": "navigation@2", + "when": "view == autoBuildView || view == marlinView" }, { - "command": "pioupload", - "group": "navigation@3" + "command": "mftraceback", + "group": "navigation@3", + "when": "view == autoBuildView || view == marlinView" }, { - "command": "piotraceback", - "group": "navigation@4" + "command": "mfclean", + "group": "navigation@4", + "when": "view == autoBuildView || view == marlinView" } ] } @@ -87,10 +108,10 @@ "test": "npm run compile && node ./node_modules/vscode/bin/test" }, "devDependencies": { - "vscode": "^1.1.17", - "typescript": "^2.6.1", - "tslint": "^5.8.0", - "@types/node": "^7.0.43", + "@types/vscode": "^1.34.0", + "typescript": "^3.5.1", + "tslint": "^5.16.0", + "@types/node": "^10.14.17", "@types/mocha": "^2.2.42" } } diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/AB.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/AB.svg new file mode 100644 index 000000000000..79572763455f --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/AB.svg @@ -0,0 +1,23 @@ + + + + AutoBuildMarlin View + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/AB_menu.png b/buildroot/share/vscode/AutoBuildMarlin/resources/AB_menu.png deleted file mode 100644 index 2cb282c918c6..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/AB_menu.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Activity_bar.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Activity_bar.png deleted file mode 100644 index d78e2c82f4c8..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Activity_bar.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B24x24_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B24x24_white.svg deleted file mode 100644 index 1d6c6672337c..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/B24x24_white.svg +++ /dev/null @@ -1 +0,0 @@ -B \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B32x32_white.svg deleted file mode 100644 index 375b6f5f03a9..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/B32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -B \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_dark.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_dark.svg new file mode 100644 index 000000000000..e3b0a4eada4f --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_dark.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_light.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_light.svg new file mode 100644 index 000000000000..adb6c43add18 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_light.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B_small.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B_small.svg deleted file mode 100644 index c830b2713a91..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/B_small.svg +++ /dev/null @@ -1 +0,0 @@ -B \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Build.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Build.png deleted file mode 100644 index 86ed4782bed6..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Build.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/C32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/C32x32_white.svg deleted file mode 100644 index 43f93ce040b6..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/C32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -C \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_dark.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_dark.svg new file mode 100644 index 000000000000..9cb0e4e0a8e1 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_dark.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_light.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_light.svg new file mode 100644 index 000000000000..815ccf2e9a60 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_light.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/C_small.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/C_small.svg deleted file mode 100644 index f8ee33d7ade6..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/C_small.svg +++ /dev/null @@ -1 +0,0 @@ -C \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Clean.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Clean.png deleted file mode 100644 index 6ce41877a66c..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Clean.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Folder.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Folder.png deleted file mode 100644 index b8ae9ac90267..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Folder.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Marlin.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Marlin.png deleted file mode 100644 index aa22232a8e5d..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Marlin.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/T32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/T32x32_white.svg deleted file mode 100644 index fb3e249e8d40..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/T32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -T \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_dark.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_dark.svg new file mode 100644 index 000000000000..b395ac858424 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_dark.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_light.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_light.svg new file mode 100644 index 000000000000..2b8ade1fa7ca --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_light.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Traceback.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Traceback.png deleted file mode 100644 index 4ee9f976fb6a..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Traceback.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/U32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/U32x32_white.svg deleted file mode 100644 index 028c9e54743e..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/U32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -U \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_dark.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_dark.svg new file mode 100644 index 000000000000..c1865b7353dc --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_dark.svg @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_light.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_light.svg new file mode 100644 index 000000000000..54943240fcc6 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_light.svg @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/U_small.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/U_small.svg deleted file mode 100644 index eb3a431b9d36..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/U_small.svg +++ /dev/null @@ -1 +0,0 @@ -U \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Upload.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Upload.png deleted file mode 100644 index 8de383e5d104..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Upload.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Ut32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/Ut32x32_white.svg deleted file mode 100644 index fc8858ea182a..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/Ut32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -Ut \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Ut_small.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/Ut_small.svg deleted file mode 100644 index accc458a4255..000000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/Ut_small.svg +++ /dev/null @@ -1 +0,0 @@ -Ut \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/install_extensions.png b/buildroot/share/vscode/AutoBuildMarlin/resources/install_extensions.png deleted file mode 100644 index 4904c1d758b8..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/install_extensions.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/platformio_install.png b/buildroot/share/vscode/AutoBuildMarlin/resources/platformio_install.png deleted file mode 100644 index e1ff7fd3b352..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/platformio_install.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/view_command_palette.png b/buildroot/share/vscode/AutoBuildMarlin/resources/view_command_palette.png deleted file mode 100644 index 6fa3e9b01629..000000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/view_command_palette.png and /dev/null differ diff --git a/config/default/Configuration.h b/config/default/Configuration.h index f0a826ac6d1c..2004fbd82072 100644 --- a/config/default/Configuration.h +++ b/config/default/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/default/Configuration_adv.h b/config/default/Configuration_adv.h index 5a0677f409f8..da002090121e 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/3DFabXYZ/Migbot/Configuration.h b/config/examples/3DFabXYZ/Migbot/Configuration.h index e89fce346c2c..ff1b6d2b9430 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration.h @@ -70,13 +70,10 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "AJMartel" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) +#define WEBSITE_URL "http://3DFabXYZ.com" /** * *** VENDORS PLEASE READ *** @@ -89,10 +86,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +129,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_BASE_14 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "3DFabXYZ i3" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +275,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +326,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +354,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +379,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +405,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -519,7 +528,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -713,7 +722,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } #define DEFAULT_AXIS_STEPS_PER_UNIT { 79.9738621, 80.2429911, 399.7264854 , 99.4696994 } @@ -721,18 +730,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 225, 225, 3, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1590, 1590, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -746,35 +765,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1590 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.0 #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.016 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -888,11 +910,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -904,10 +925,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 21 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 61 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 21, 61, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -941,7 +962,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1199,12 +1220,6 @@ #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_PROBE_OFFSET_FROM_EXTRUDER - #define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (X_PROBE_OFFSET_FROM_EXTRUDER) + MIN_PROBE_EDGE) - #define FRONT_PROBE_BED_POSITION Y_PROBE_OFFSET_FROM_EXTRUDER - #define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1258,19 +1273,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1544,7 +1546,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1554,8 +1556,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1600,10 +1605,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1712,6 +1717,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1939,31 +1952,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1997,6 +1991,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2007,16 +2036,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2032,6 +2059,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2043,27 +2076,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2149,8 +2189,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2189,7 +2231,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h index d91dc27060b8..29567f4e7b2e 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -277,11 +327,12 @@ * The fan will turn on automatically whenever any stepper is enabled * and turn off after a set period after all steppers are turned off. */ -//#define USE_CONTROLLER_FAN +#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - #define CONTROLLER_FAN_PIN 9 // 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 + #define CONTROLLER_FAN_PIN 7 // 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 127 // 255 == full speed + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #define CASE_LIGHT_DEFAULT_ON false // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) + //#define CASE_LIGHT_MAX_PWM 128 // Limit pwm #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2292,13 +2589,22 @@ */ #define CUSTOM_USER_MENUS #if ENABLED(CUSTOM_USER_MENUS) - #define CUSTOM_USER_MENU_TITLE "Test" - #define USER_SCRIPT_DONE "M117 Script Done" + #define CUSTOM_USER_MENU_TITLE "Tools" + #define USER_SCRIPT_DONE "M117 Done" #define USER_SCRIPT_AUDIBLE_FEEDBACK //#define USER_SCRIPT_RETURN // Return to status screen after a script - #define USER_DESC_1 "Test Print" - #define USER_GCODE_1 "G28\nG29\nG26" + #define USER_DESC_1 "Probe Mesh&Save" + #define USER_GCODE_1 "G28\nG29 P1\nG29 P3 T0\nG29 S0 A F10\nG29 J2\nM500" + + #define USER_DESC_2 "Manual Mesh&Save" + #define USER_GCODE_2 "G28\nG29 P4 R999 T\nG29 S0 A F10\nM500" + + #define USER_DESC_3 "Print Test Pattern" + #define USER_GCODE_3 "G26 C P O2.25" //Do a typical test sequence + + #define USER_DESC_4 "Move Bed Forward" + #define USER_GCODE_4 "G28 X0 Y0\nG1 X0 Y180 F3000\nM84" //move X/Y to min endstops & Feed the bed forward & steppers off /* #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL @@ -2334,9 +2640,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2727,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2761,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/3DFabXYZ/Migbot/Readme.md b/config/examples/3DFabXYZ/Migbot/Readme.md index 67959e4ef05b..708b3fe6327e 100644 --- a/config/examples/3DFabXYZ/Migbot/Readme.md +++ b/config/examples/3DFabXYZ/Migbot/Readme.md @@ -1,3 +1,4 @@ -Personalized config files for the "Electron"\"Tevo 3D" i3 6th gen -https://www.3dprintersbay.com/electron3d-reprap-prusa-i3-kit -https://reprap.org/wiki/Migbot_Prusa_i3 +Personalized config files for the "Electron" "Tevo 3D" i3 6th gen + +- https://www.3dprintersbay.com/electron3d-reprap-prusa-i3-kit +- https://reprap.org/wiki/Migbot_Prusa_i3 diff --git a/config/examples/ADIMLab/Gantry v1/Configuration.h b/config/examples/ADIMLab/Gantry v1/Configuration.h new file mode 100644 index 000000000000..3945a1a832ab --- /dev/null +++ b/config/examples/ADIMLab/Gantry v1/Configuration.h @@ -0,0 +1,2212 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(ETE-Design, Gantry v1)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_HJC2560C_REV1 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "ADIMLab Gantry v1" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 1 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 1 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 120 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Ultimaker + #define DEFAULT_Kp 22.2 + #define DEFAULT_Ki 1.08 + #define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 1300 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80.4, 80.4, 400, 94 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 2000, 2000, 50, 2000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 20.0 + #define DEFAULT_YJERK 20.0 + #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.16 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 325 +#define Y_BED_SIZE 325 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 415 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#define FILAMENT_RUNOUT_SENSOR +#define FIL_RUNOUT_PIN 24 +#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 5 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 195 +#define PREHEAT_1_TEMP_BED 55 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 230 +#define PREHEAT_2_TEMP_BED 70 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 60 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/ADIMLab/Gantry v1/Configuration_adv.h b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h new file mode 100644 index 000000000000..e6afef16a222 --- /dev/null +++ b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 360 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 8 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + #define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 75 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 160 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 28 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK true // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 0 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/ADIMLab/Gantry v1/_Bootscreen.h b/config/examples/ADIMLab/Gantry v1/_Bootscreen.h new file mode 100644 index 000000000000..ebb0ad9a81f2 --- /dev/null +++ b/config/examples/ADIMLab/Gantry v1/_Bootscreen.h @@ -0,0 +1,86 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Made with Marlin Bitmap Converter + * http://marlinfw.org/tools/u8glib/converter.html + */ +#define CUSTOM_BOOTSCREEN_BMPWIDTH 88 + +const unsigned char custom_start_bmp[] PROGMEM = { + B00000000,B00000000,B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00111111,B11111000,B00000000,B01000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011110,B01111111,B11111111,B00000000,B10000100,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00111111,B11111111,B11111111,B11111111,B00000100,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00111111,B11111111,B11111111,B11111110,B00001100,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01111111,B11111111,B11111111,B11110000,B00001000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001111,B11111111,B11100000,B00000000,B00011000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B11111111,B11100011,B10000000,B00111000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00010011,B11111111,B11100001,B10000000,B01111000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011111,B10001111,B11100011,B10000000,B11110000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011110,B00001111,B11111111,B10000001,B11110000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000110,B00011111,B11111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B11111111,B11111110,B00001111,B11100000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000111,B11111111,B11110000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001111,B11111100,B00000011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011111,B11000000,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00111110,B00011111,B11111111,B11111110,B00111111,B11000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01111100,B11111111,B11111111,B11111100,B00001111,B11100000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11111001,B11111111,B11111111,B11110000,B00001111,B11110000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11110011,B11111111,B11111111,B11111000,B00011111,B11111000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11100111,B11111111,B11111111,B11111111,B11111111,B11111100,B00000000,B00000000,B00000000, + B00000000,B00000001,B11101111,B11111111,B11111111,B11111111,B11111111,B11111110,B00000000,B00000000,B00000000, + B00000000,B00000001,B11101111,B11111110,B00001111,B11111111,B11111111,B11101111,B10000000,B00000000,B00000000, + B00000000,B00000001,B11001111,B11110000,B00000001,B11111111,B11111111,B11110011,B11111000,B00000000,B00000000, + B00000000,B00000000,B11101111,B11100000,B00000000,B11111111,B11111111,B11111000,B01100000,B00000000,B00000000, + B00000000,B00000000,B11101111,B11100000,B00000000,B00111111,B11111111,B11111000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11101111,B11000000,B00000000,B00011111,B11111111,B11111000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01100111,B11100100,B00000000,B00001111,B11111111,B11111100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00110011,B11111100,B00000000,B00000111,B11111111,B11111100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011001,B11111100,B00000000,B00000011,B11100000,B11111100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001100,B01111000,B00000000,B00000001,B11100000,B00111100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000111,B00000000,B00000000,B00000000,B01110000,B00011100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000011,B10000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B11100000,B00000000,B00000000,B00000000,B00001111,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B11110000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B11111000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B11111100,B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000, + B00000000,B00000000,B00000011,B11111100,B00000000,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000, + B00000000,B00000000,B00000111,B11111100,B00000000,B00000000,B00000000,B00001111,B11100000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000001,B11111111,B10000111,B10011111,B00000111,B10011110,B00000000,B00000000,B00111000,B00000000, + B00000111,B10000001,B11111111,B11000011,B10011111,B00000111,B10001110,B00000000,B00000000,B00111000,B00000000, + B00000111,B10000001,B11000011,B11100011,B10011111,B00000111,B10001110,B00000000,B00000000,B00111000,B00000000, + B00001111,B11000001,B11000000,B11100011,B10011111,B10001111,B10001110,B00000000,B00111100,B00111011,B00000000, + B00001111,B11000001,B11000000,B11100011,B10011111,B10001111,B10001110,B00000000,B11111110,B00111111,B10000000, + B00011101,B11000001,B11000000,B01110011,B10011111,B10011111,B10001110,B00000000,B11111111,B00111111,B10000000, + B00011100,B11100001,B11000000,B01110011,B10011101,B11011011,B10001110,B00000000,B01101111,B00111011,B11000000, + B00011100,B11100001,B11000000,B01110011,B10011101,B11111011,B10001110,B00000000,B00111111,B00111011,B11000000, + B00111111,B11110001,B11000000,B11100011,B10011100,B11111011,B10001110,B00000000,B11111111,B00111011,B11000000, + B00111111,B11110001,B11000000,B11100011,B10011100,B11110011,B10001110,B00000000,B11101111,B00111011,B11000000, + B01111000,B01110001,B11000001,B11100011,B10011100,B11110011,B10001110,B00000001,B11101111,B00111011,B11000000, + B01110000,B01111001,B11111111,B11000011,B10011100,B01100011,B10001111,B11111111,B11101111,B00111111,B10000000, + B01110000,B00111001,B11111111,B10000011,B10011100,B01100011,B10001111,B11111110,B11110111,B00111111,B10000000, + B11110000,B01111101,B11111111,B00000111,B10011110,B00000011,B11011111,B11111100,B01100111,B00100111,B00000000 +}; diff --git a/config/examples/ADIMLab/Gantry v2/Configuration.h b/config/examples/ADIMLab/Gantry v2/Configuration.h new file mode 100644 index 000000000000..47fb03b002e5 --- /dev/null +++ b/config/examples/ADIMLab/Gantry v2/Configuration.h @@ -0,0 +1,2212 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(ETE-Design, Gantry v2)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_HJC2560C_REV2 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "ADIMLab Gantry v2" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Ultimaker + #define DEFAULT_Kp 22.2 + #define DEFAULT_Ki 1.08 + #define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 100 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 3000 // 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 + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 310 +#define Y_BED_SIZE 310 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -5 +#define Y_MIN_POS -10 +#define Z_MIN_POS -3 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 410 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +//#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +//#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#define FILAMENT_RUNOUT_SENSOR +#define FIL_RUNOUT_PIN 24 +#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 60 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/ADIMLab/Gantry v2/Configuration_adv.h b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h new file mode 100644 index 000000000000..2f7699618abb --- /dev/null +++ b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + #define CASE_LIGHT_PIN 8 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/ADIMLab/Gantry v2/_Bootscreen.h b/config/examples/ADIMLab/Gantry v2/_Bootscreen.h new file mode 100644 index 000000000000..ebb0ad9a81f2 --- /dev/null +++ b/config/examples/ADIMLab/Gantry v2/_Bootscreen.h @@ -0,0 +1,86 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Made with Marlin Bitmap Converter + * http://marlinfw.org/tools/u8glib/converter.html + */ +#define CUSTOM_BOOTSCREEN_BMPWIDTH 88 + +const unsigned char custom_start_bmp[] PROGMEM = { + B00000000,B00000000,B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00111111,B11111000,B00000000,B01000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011110,B01111111,B11111111,B00000000,B10000100,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00111111,B11111111,B11111111,B11111111,B00000100,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00111111,B11111111,B11111111,B11111110,B00001100,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01111111,B11111111,B11111111,B11110000,B00001000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001111,B11111111,B11100000,B00000000,B00011000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B11111111,B11100011,B10000000,B00111000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00010011,B11111111,B11100001,B10000000,B01111000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011111,B10001111,B11100011,B10000000,B11110000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011110,B00001111,B11111111,B10000001,B11110000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000110,B00011111,B11111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B11111111,B11111110,B00001111,B11100000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000111,B11111111,B11110000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001111,B11111100,B00000011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011111,B11000000,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00111110,B00011111,B11111111,B11111110,B00111111,B11000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01111100,B11111111,B11111111,B11111100,B00001111,B11100000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11111001,B11111111,B11111111,B11110000,B00001111,B11110000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11110011,B11111111,B11111111,B11111000,B00011111,B11111000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11100111,B11111111,B11111111,B11111111,B11111111,B11111100,B00000000,B00000000,B00000000, + B00000000,B00000001,B11101111,B11111111,B11111111,B11111111,B11111111,B11111110,B00000000,B00000000,B00000000, + B00000000,B00000001,B11101111,B11111110,B00001111,B11111111,B11111111,B11101111,B10000000,B00000000,B00000000, + B00000000,B00000001,B11001111,B11110000,B00000001,B11111111,B11111111,B11110011,B11111000,B00000000,B00000000, + B00000000,B00000000,B11101111,B11100000,B00000000,B11111111,B11111111,B11111000,B01100000,B00000000,B00000000, + B00000000,B00000000,B11101111,B11100000,B00000000,B00111111,B11111111,B11111000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11101111,B11000000,B00000000,B00011111,B11111111,B11111000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01100111,B11100100,B00000000,B00001111,B11111111,B11111100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00110011,B11111100,B00000000,B00000111,B11111111,B11111100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011001,B11111100,B00000000,B00000011,B11100000,B11111100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001100,B01111000,B00000000,B00000001,B11100000,B00111100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000111,B00000000,B00000000,B00000000,B01110000,B00011100,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000011,B10000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B11100000,B00000000,B00000000,B00000000,B00001111,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B11110000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B11111000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B11111100,B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000, + B00000000,B00000000,B00000011,B11111100,B00000000,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000, + B00000000,B00000000,B00000111,B11111100,B00000000,B00000000,B00000000,B00001111,B11100000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000001,B11111111,B10000111,B10011111,B00000111,B10011110,B00000000,B00000000,B00111000,B00000000, + B00000111,B10000001,B11111111,B11000011,B10011111,B00000111,B10001110,B00000000,B00000000,B00111000,B00000000, + B00000111,B10000001,B11000011,B11100011,B10011111,B00000111,B10001110,B00000000,B00000000,B00111000,B00000000, + B00001111,B11000001,B11000000,B11100011,B10011111,B10001111,B10001110,B00000000,B00111100,B00111011,B00000000, + B00001111,B11000001,B11000000,B11100011,B10011111,B10001111,B10001110,B00000000,B11111110,B00111111,B10000000, + B00011101,B11000001,B11000000,B01110011,B10011111,B10011111,B10001110,B00000000,B11111111,B00111111,B10000000, + B00011100,B11100001,B11000000,B01110011,B10011101,B11011011,B10001110,B00000000,B01101111,B00111011,B11000000, + B00011100,B11100001,B11000000,B01110011,B10011101,B11111011,B10001110,B00000000,B00111111,B00111011,B11000000, + B00111111,B11110001,B11000000,B11100011,B10011100,B11111011,B10001110,B00000000,B11111111,B00111011,B11000000, + B00111111,B11110001,B11000000,B11100011,B10011100,B11110011,B10001110,B00000000,B11101111,B00111011,B11000000, + B01111000,B01110001,B11000001,B11100011,B10011100,B11110011,B10001110,B00000001,B11101111,B00111011,B11000000, + B01110000,B01111001,B11111111,B11000011,B10011100,B01100011,B10001111,B11111111,B11101111,B00111111,B10000000, + B01110000,B00111001,B11111111,B10000011,B10011100,B01100011,B10001111,B11111110,B11110111,B00111111,B10000000, + B11110000,B01111101,B11111111,B00000111,B10011110,B00000011,B11011111,B11111100,B01100111,B00100111,B00000000 +}; diff --git a/config/examples/AlephObjects/TAZ4/Configuration.h b/config/examples/AlephObjects/TAZ4/Configuration.h index 67d81e9822c3..e8bbdb1e2514 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/config/examples/AlephObjects/TAZ4/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Aleph Objects Inc, TAZ)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMBO #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "TAZ" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 7 #define TEMP_SENSOR_1 0 @@ -523,7 +531,7 @@ #define MAX_BED_POWER 206 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //24V 360W silicone heater from NPH on 3mm borosilicate (TAZ 2.2+) @@ -728,25 +736,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100.5, 100.5, 400, 850 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 800, 800, 8, 50 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -760,35 +778,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.0 #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 10.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.051 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -902,11 +923,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -918,10 +938,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -955,7 +975,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1213,12 +1233,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1272,19 +1286,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1533,7 +1534,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1543,8 +1544,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1589,10 +1593,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1701,6 +1705,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1928,31 +1940,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1986,6 +1979,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1996,16 +2024,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2021,6 +2047,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2032,27 +2064,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2138,8 +2177,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2178,7 +2219,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 4853f9c753a8..9655ea4ca8f8 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ #define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - #define CONTROLLER_FAN_PIN 2 // 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 130 // 255 == full speed + #define CONTROLLER_FAN_PIN 2 // 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 130 // 255 == full speed + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Alfawise/U20-bltouch/Configuration.h b/config/examples/Alfawise/U20-bltouch/Configuration.h new file mode 100644 index 000000000000..90fb583ba4ba --- /dev/null +++ b/config/examples/Alfawise/U20-bltouch/Configuration.h @@ -0,0 +1,2312 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +//=========================================================================== +//============================= Alfawise Printer ============================ +//=========================================================================== + +// Forum link to help with a tutorial, in French! : +// https://www.lesimprimantes3d.fr/forum/topic/18260-alfawise-u20x-u30-marlin-2x-firmware-alternatif/ +// +// 1 - Select your Alfawise U30 or U20 or U20+ printer (NO MORE REQUIRED HERE) +// and the touchscreen version, either 1.1 or 1.2. Most recent in France are v1.2 (blue pcb) +// These defines are set in platformio.ini build parameters, sample for U20 -DU20 -DTS_V12 +// U20_PLUS was not tested, as we do not have a printer to test. Print bed PID settings MUST be tuned for it. + +// Valid platformio.ini submodel values are U20_PLUS U20 U30 LK1 LK2 LK4 + +// Valid platformio.ini touchscreens are TS_V11 TS_V12 TS_V19 + +// 2 - Select the screen controller type. Most common is ILI9341 - First option. If your screen remains white, +// Try the alternate setting - this should enable ST7789V or ILI9328. For other LCDs... code is needed +// with the proper boot sequence to be developped. + +#define LCD_READ_ID 0xD3 // Read display identification information in reg ID4 0xD3, for ILI9341 screens +//#define LCD_READ_ID 0x04 // Read display identification information in reg ID1 0x04 - ST7789V / ILI9328 or others + +//=========================================================================== + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "Hobi, tpruvot" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 2 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_LONGER3D_LK +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" +#ifdef U20 +#define CUSTOM_MACHINE_NAME "Alfawise U20" +#elif defined(U30) +#define CUSTOM_MACHINE_NAME "Alfawise U30" +#elif defined(U20_PLUS) +#define CUSTOM_MACHINE_NAME "Alfawise U20+" +#elif defined(LK1) +#define CUSTOM_MACHINE_NAME "Longer3D LK1" +#elif defined(LK2) +#define CUSTOM_MACHINE_NAME "Longer3D LK2" +#elif defined(LK4) +#define CUSTOM_MACHINE_NAME "Longer3D LK4" +#endif + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +#define PSU_NAME "360W 24V/15A" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Alfawise U30/U20 + // Please refine the PID settings for your own machine to avoid the E1 hotend error. These a basic settings allowing first startups. + // Use the command M303 E0 S200 C8 each time you make any changes to your extruder + + #define DEFAULT_Kp 17.22 + #define DEFAULT_Ki 1.00 + #define DEFAULT_Kd 74.22 + + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + //#define DEFAULT_bedKp 10.00 + //#define DEFAULT_bedKi .023 + //#define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + +#if defined(U30) || defined(LK2) || defined(LK4) + //From M303 command for Alfawise U30 : + #define DEFAULT_bedKp 338.46 + #define DEFAULT_bedKi 63.96 + #define DEFAULT_bedKd 447.78 +#endif + +#if defined(U20) || defined(LK1) + //From M303 command for Alfawise U20 : + #define DEFAULT_bedKp 841.68 + #define DEFAULT_bedKi 152.12 + #define DEFAULT_bedKd 1164.25 +#endif + +#ifdef U20_PLUS + // These PID setting MUST be updated. + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. + #define DEFAULT_bedKp 841.68 + #define DEFAULT_bedKi 152.12 + #define DEFAULT_bedKd 1164.25 +#endif + +#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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +//#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + #define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 200, 200, 100, 25 } + +#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 250, 250, 200, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 200, 200, 100, 3000 } + +#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 600, 600, 400, 6000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 200 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 200 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.4 + + #define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.10 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #undef PROBE_MANUALLY + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -35, -6, -0.5 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +#if defined(U30) || defined(LK2) || defined(LK4) +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 +#define Z_MACHINE_MAX 250 +#endif + +#if defined(U20) || defined(LK1) +#define X_BED_SIZE 300 +#define Y_BED_SIZE 300 +#define Z_MACHINE_MAX 400 +#endif + +#ifdef U20_PLUS +#define X_BED_SIZE 400 +#define Y_BED_SIZE 400 +#define Z_MACHINE_MAX 500 +#endif + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS Z_MACHINE_MAX + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#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 true // Set to true to invert the logic of the sensor. + //#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 4 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.2 // (mm) Z height of nozzle at leveling points + #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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + //#define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT 4 +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (40*60) +#define HOMING_FEEDRATE_Z (7*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 250 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT +#define SDIO_SUPPORT // Note from Hobi : Added as was not present in the file... + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 250 +//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CALIBRATION // Include user calibration widget in menus (Alfawise) + + #define BUTTON_DELAY_EDIT 75 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 100 // (ms) Button repeat delay for menus + + #if ENABLED(TS_V11) + // Alfawise U20 ILI9341 2.8 TP Ver 1.1 / Green PCB on the back of touchscreen + #define XPT2046_X_CALIBRATION 12000 + #define XPT2046_Y_CALIBRATION 9000 + #define XPT2046_X_OFFSET -24 + #define XPT2046_Y_OFFSET -17 + #endif + + #if ENABLED(TS_V12) + // Alfawise U30 ILI9341 2.8 TP Ver 1.2 / Blue PCB on the back of touchscreen + #define XPT2046_X_CALIBRATION 12000 + #define XPT2046_Y_CALIBRATION -9000 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 + #endif + + #if ENABLED(TS_V19) + // Longer LK4/U30 2.8" Ver 2019 / Blue PCB, SID240x320-8PCB-D + #define XPT2046_X_CALIBRATION -12000 + #define XPT2046_Y_CALIBRATION 9000 + #define XPT2046_X_OFFSET 320 + #define XPT2046_Y_OFFSET 0 + #endif +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Alfawise/U20-bltouch/Configuration_adv.h b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h new file mode 100644 index 000000000000..702e3b64f007 --- /dev/null +++ b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h @@ -0,0 +1,2869 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 10 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 60 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 2 +#define HOMING_BUMP_DIVISOR { 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + #undef PROBE_MANUALLY + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + #define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + #define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28X" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE true // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + #define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + // see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html + #define TFT_MARLINUI_COLOR COLOR_WHITE + #define TFT_MARLINBG_COLOR COLOR_BLACK + #define TFT_DISABLED_COLOR 0x10A2 // almost black + #define TFT_BTCANCEL_COLOR COLOR_RED + #define TFT_BTARROWS_COLOR COLOR_WHITE + #define TFT_BTOKMENU_COLOR COLOR_BLUE +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 32 +#else + #define BLOCK_BUFFER_SIZE 16 // Marlin default +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 8 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 25 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Alfawise/U20-bltouch/_Statusscreen.h b/config/examples/Alfawise/U20-bltouch/_Statusscreen.h new file mode 100644 index 000000000000..519c0d06f416 --- /dev/null +++ b/config/examples/Alfawise/U20-bltouch/_Statusscreen.h @@ -0,0 +1,77 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Custom Status Screen bitmap + * + * Place this file in the root with your configuration files + * and enable CUSTOM_STATUS_SCREEN_IMAGE in Configuration.h. + * + * Use the Marlin Bitmap Converter to make your own: + * http://marlinfw.org/tools/u8glib/converter.html + */ + +#pragma once + +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 0 +#define STATUS_LOGO_WIDTH 38 + +static unsigned char status_logo_bmp[] PROGMEM = { + B11111111,B11111111,B11111111,B11111111,B11111100, + B10000000,B00000000,B00010000,B00000111,B11111100, + B10000000,B00000000,B00010000,B00000000,B11111100, + B10000000,B00000000,B00110000,B00000000,B01111100, + B10000000,B00000000,B00110000,B00000000,B00111100, + B10000000,B00000000,B01110000,B00000000,B00011100, + B11111111,B10000000,B01110000,B00000000,B00001100, + B11111111,B10000000,B11110000,B11100000,B00001100, + B11111111,B00000000,B11110000,B11111000,B00001100, + B11111111,B00000001,B11110000,B11111100,B00000100, + B11111110,B00000001,B11110000,B11010010,B00000100, + B11111110,B00000011,B11110000,B10101110,B00000100, + B11111100,B00000000,B11110000,B10101111,B00000100, + B11111100,B00000000,B00110000,B10000011,B00000100, + B11111000,B00000000,B00110000,B11111111,B00000100, + B11111000,B00000000,B00010000,B11111111,B00000100, + B11111111,B11100000,B00010000,B10111111,B00000100, + B11111111,B11110000,B00010000,B10101111,B00000100, + B11111111,B11110000,B00010000,B10101110,B00000100, + B11111111,B11110000,B00010000,B10000010,B00000100, + B10000011,B11110000,B00010000,B11111100,B00000100, + B10000001,B11110000,B00010000,B11111000,B00001100, + B10000001,B11100000,B00010000,B11100000,B00001100, + B10000000,B00000000,B00010000,B00000000,B00001100, + B10000000,B00000000,B00110000,B00000000,B00011100, + B11000000,B00000000,B00110000,B00000000,B00111100, + B11000000,B00000000,B01110000,B00000000,B01111100, + B11100000,B00000000,B11110000,B00000000,B11111100, + B11111000,B00000011,B11110000,B00000111,B11111100 +}; + +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_LOGO_X 0 +#define STATUS_HEATERS_X 50 +#define STATUS_BED_X 74 diff --git a/config/examples/Alfawise/U20/Configuration.h b/config/examples/Alfawise/U20/Configuration.h new file mode 100644 index 000000000000..c4fa702ccdbb --- /dev/null +++ b/config/examples/Alfawise/U20/Configuration.h @@ -0,0 +1,2311 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +//=========================================================================== +//============================= Alfawise Printer ============================ +//=========================================================================== + +// Forum link to help with a tutorial, in French! : +// https://www.lesimprimantes3d.fr/forum/topic/18260-alfawise-u20x-u30-marlin-2x-firmware-alternatif/ +// +// 1 - Select your Alfawise U30 or U20 or U20+ printer (NO MORE REQUIRED HERE) +// and the touchscreen version, either 1.1 or 1.2. Most recent in France are v1.2 (blue pcb) +// These defines are set in platformio.ini build parameters, sample for U20 -DU20 -DTS_V12 +// U20_PLUS was not tested, as we do not have a printer to test. Print bed PID settings MUST be tuned for it. + +// Valid platformio.ini submodel values are U20_PLUS U20 U30 LK1 LK2 LK4 + +// Valid platformio.ini touchscreens are TS_V11 TS_V12 TS_V19 + +// 2 - Select the screen controller type. Most common is ILI9341 - First option. If your screen remains white, +// Try the alternate setting - this should enable ST7789V or ILI9328. For other LCDs... code is needed +// with the proper boot sequence to be developped. + +#define LCD_READ_ID 0xD3 // Read display identification information in reg ID4 0xD3, for ILI9341 screens +//#define LCD_READ_ID 0x04 // Read display identification information in reg ID1 0x04 - ST7789V / ILI9328 or others + +//=========================================================================== + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "Hobi, tpruvot" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 2 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_LONGER3D_LK +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" +#ifdef U20 +#define CUSTOM_MACHINE_NAME "Alfawise U20" +#elif defined(U30) +#define CUSTOM_MACHINE_NAME "Alfawise U30" +#elif defined(U20_PLUS) +#define CUSTOM_MACHINE_NAME "Alfawise U20+" +#elif defined(LK1) +#define CUSTOM_MACHINE_NAME "Longer3D LK1" +#elif defined(LK2) +#define CUSTOM_MACHINE_NAME "Longer3D LK2" +#elif defined(LK4) +#define CUSTOM_MACHINE_NAME "Longer3D LK4" +#endif + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +#define PSU_NAME "360W 24V/15A" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Alfawise U30/U20 + // Please refine the PID settings for your own machine to avoid the E1 hotend error. These a basic settings allowing first startups. + // Use the command M303 E0 S200 C8 each time you make any changes to your extruder + + #define DEFAULT_Kp 17.22 + #define DEFAULT_Ki 1.00 + #define DEFAULT_Kd 74.22 + + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + //#define DEFAULT_bedKp 10.00 + //#define DEFAULT_bedKi .023 + //#define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + +#if defined(U30) || defined(LK2) || defined(LK4) + //From M303 command for Alfawise U30 : + #define DEFAULT_bedKp 338.46 + #define DEFAULT_bedKi 63.96 + #define DEFAULT_bedKd 447.78 +#endif + +#if defined(U20) || defined(LK1) + //From M303 command for Alfawise U20 : + #define DEFAULT_bedKp 841.68 + #define DEFAULT_bedKi 152.12 + #define DEFAULT_bedKd 1164.25 +#endif + +#ifdef U20_PLUS + // These PID setting MUST be updated. + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. + #define DEFAULT_bedKp 841.68 + #define DEFAULT_bedKi 152.12 + #define DEFAULT_bedKd 1164.25 +#endif + +#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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +//#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 200, 200, 100, 25 } + +#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 250, 250, 200, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 200, 200, 100, 3000 } + +#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 600, 600, 400, 6000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 200 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 200 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.4 + + #define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.10 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #undef PROBE_MANUALLY + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +#if defined(U30) || defined(LK2) || defined(LK4) +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 +#define Z_MACHINE_MAX 250 +#endif + +#if defined(U20) || defined(LK1) +#define X_BED_SIZE 300 +#define Y_BED_SIZE 300 +#define Z_MACHINE_MAX 400 +#endif + +#ifdef U20_PLUS +#define X_BED_SIZE 400 +#define Y_BED_SIZE 400 +#define Z_MACHINE_MAX 500 +#endif + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS Z_MACHINE_MAX + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#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 true // Set to true to invert the logic of the sensor. + //#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.2 // (mm) Z height of nozzle at leveling points + #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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT 4 // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (40*60) +#define HOMING_FEEDRATE_Z (7*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 250 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT +#define SDIO_SUPPORT // Note from Hobi : Added as was not present in the file... + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 250 +//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CALIBRATION // Include user calibration widget in menus (Alfawise) + + #define BUTTON_DELAY_EDIT 75 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 100 // (ms) Button repeat delay for menus + + #if ENABLED(TS_V11) + // Alfawise U20 ILI9341 2.8 TP Ver 1.1 / Green PCB on the back of touchscreen + #define XPT2046_X_CALIBRATION 12000 + #define XPT2046_Y_CALIBRATION 9000 + #define XPT2046_X_OFFSET -24 + #define XPT2046_Y_OFFSET -17 + #endif + + #if ENABLED(TS_V12) + // Alfawise U30 ILI9341 2.8 TP Ver 1.2 / Blue PCB on the back of touchscreen + #define XPT2046_X_CALIBRATION 12000 + #define XPT2046_Y_CALIBRATION -9000 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 + #endif + + #if ENABLED(TS_V19) + // Longer LK4/U30 2.8" Ver 2019 / Blue PCB, SID240x320-8PCB-D + #define XPT2046_X_CALIBRATION -12000 + #define XPT2046_Y_CALIBRATION 9000 + #define XPT2046_X_OFFSET 320 + #define XPT2046_Y_OFFSET 0 + #endif +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Alfawise/U20/Configuration_adv.h b/config/examples/Alfawise/U20/Configuration_adv.h new file mode 100644 index 000000000000..9a7b9d5c8ff5 --- /dev/null +++ b/config/examples/Alfawise/U20/Configuration_adv.h @@ -0,0 +1,2868 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 10 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 60 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 2 +#define HOMING_BUMP_DIVISOR { 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + #define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28X" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE true // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + #define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + // see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html + #define TFT_MARLINUI_COLOR COLOR_WHITE + #define TFT_MARLINBG_COLOR COLOR_BLACK + #define TFT_DISABLED_COLOR 0x10A2 // almost black + #define TFT_BTCANCEL_COLOR COLOR_RED + #define TFT_BTARROWS_COLOR COLOR_WHITE + #define TFT_BTOKMENU_COLOR COLOR_BLUE +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 32 +#else + #define BLOCK_BUFFER_SIZE 16 // Marlin default +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 8 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 25 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Alfawise/U20/_Statusscreen.h b/config/examples/Alfawise/U20/_Statusscreen.h new file mode 100644 index 000000000000..519c0d06f416 --- /dev/null +++ b/config/examples/Alfawise/U20/_Statusscreen.h @@ -0,0 +1,77 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Custom Status Screen bitmap + * + * Place this file in the root with your configuration files + * and enable CUSTOM_STATUS_SCREEN_IMAGE in Configuration.h. + * + * Use the Marlin Bitmap Converter to make your own: + * http://marlinfw.org/tools/u8glib/converter.html + */ + +#pragma once + +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 0 +#define STATUS_LOGO_WIDTH 38 + +static unsigned char status_logo_bmp[] PROGMEM = { + B11111111,B11111111,B11111111,B11111111,B11111100, + B10000000,B00000000,B00010000,B00000111,B11111100, + B10000000,B00000000,B00010000,B00000000,B11111100, + B10000000,B00000000,B00110000,B00000000,B01111100, + B10000000,B00000000,B00110000,B00000000,B00111100, + B10000000,B00000000,B01110000,B00000000,B00011100, + B11111111,B10000000,B01110000,B00000000,B00001100, + B11111111,B10000000,B11110000,B11100000,B00001100, + B11111111,B00000000,B11110000,B11111000,B00001100, + B11111111,B00000001,B11110000,B11111100,B00000100, + B11111110,B00000001,B11110000,B11010010,B00000100, + B11111110,B00000011,B11110000,B10101110,B00000100, + B11111100,B00000000,B11110000,B10101111,B00000100, + B11111100,B00000000,B00110000,B10000011,B00000100, + B11111000,B00000000,B00110000,B11111111,B00000100, + B11111000,B00000000,B00010000,B11111111,B00000100, + B11111111,B11100000,B00010000,B10111111,B00000100, + B11111111,B11110000,B00010000,B10101111,B00000100, + B11111111,B11110000,B00010000,B10101110,B00000100, + B11111111,B11110000,B00010000,B10000010,B00000100, + B10000011,B11110000,B00010000,B11111100,B00000100, + B10000001,B11110000,B00010000,B11111000,B00001100, + B10000001,B11100000,B00010000,B11100000,B00001100, + B10000000,B00000000,B00010000,B00000000,B00001100, + B10000000,B00000000,B00110000,B00000000,B00011100, + B11000000,B00000000,B00110000,B00000000,B00111100, + B11000000,B00000000,B01110000,B00000000,B01111100, + B11100000,B00000000,B11110000,B00000000,B11111100, + B11111000,B00000011,B11110000,B00000111,B11111100 +}; + +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_LOGO_X 0 +#define STATUS_HEATERS_X 50 +#define STATUS_BED_X 74 diff --git a/config/examples/AliExpress/CL-260/Configuration.h b/config/examples/AliExpress/CL-260/Configuration.h index 27fb4e25c347..534c1d603cca 100644 --- a/config/examples/AliExpress/CL-260/Configuration.h +++ b/config/examples/AliExpress/CL-260/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, CL-260)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CL-260" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 160.6 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/AliExpress/UM2pExt/Configuration.h b/config/examples/AliExpress/UM2pExt/Configuration.h index e78d7833d908..e20348b2a8cf 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration.h +++ b/config/examples/AliExpress/UM2pExt/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ULTIMAIN_2 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 20 #define TEMP_SENSOR_1 20 @@ -525,7 +533,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -719,25 +727,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 200, 355 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 40, 45} +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -751,35 +769,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -893,11 +914,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -909,10 +929,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -946,7 +966,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1204,12 +1224,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1263,19 +1277,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1524,7 +1525,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1534,8 +1535,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1580,10 +1584,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1692,6 +1696,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1919,31 +1931,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // #define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1977,6 +1970,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1987,16 +2015,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2012,6 +2038,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2023,27 +2055,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2129,8 +2168,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2169,7 +2210,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/AliExpress/UM2pExt/Configuration_adv.h b/config/examples/AliExpress/UM2pExt/Configuration_adv.h index 3c2a17463423..6d85a4989624 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) #define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ #define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Anet/A2/Configuration.h b/config/examples/Anet/A2/Configuration.h index d958224023a1..da4e6db01e3e 100644 --- a/config/examples/Anet/A2/Configuration.h +++ b/config/examples/Anet/A2/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Modmike, Anet A2)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ANET_10 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Anet A2" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -//#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges //#define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1910,31 +1922,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1968,6 +1961,41 @@ // #define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1978,16 +2006,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2003,6 +2029,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2014,27 +2046,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2120,8 +2159,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2160,7 +2201,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A2/Configuration_adv.h b/config/examples/Anet/A2/Configuration_adv.h index 084dbc79e837..46e0b32f60ee 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Anet/A2plus/Configuration.h b/config/examples/Anet/A2plus/Configuration.h index c3e7e28402f7..05b6c399970b 100644 --- a/config/examples/Anet/A2plus/Configuration.h +++ b/config/examples/Anet/A2plus/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Modmike, Anet A2 Plus)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ANET_10 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Anet A2+" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -//#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges //#define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1910,31 +1922,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1968,6 +1961,41 @@ // #define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1978,16 +2006,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2003,6 +2029,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2014,27 +2046,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2120,8 +2159,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2160,7 +2201,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A2plus/Configuration_adv.h b/config/examples/Anet/A2plus/Configuration_adv.h index 084dbc79e837..46e0b32f60ee 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Anet/A6/Configuration.h b/config/examples/Anet/A6/Configuration.h index 0c51b283bfaf..66fba3e0c5c9 100644 --- a/config/examples/Anet/A6/Configuration.h +++ b/config/examples/Anet/A6/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Ralf_E, ANET A6 config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ANET_10 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Anet A6" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 11 #define TEMP_SENSOR_1 0 @@ -525,7 +533,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -728,7 +736,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } @@ -740,7 +748,7 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } @@ -750,11 +758,16 @@ //#define DEFAULT_MAX_FEEDRATE { 400, 400, 20, 50 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } @@ -763,6 +776,11 @@ #define DEFAULT_MAX_ACCELERATION { 9000, 5000, 50, 10000 } //#define DEFAULT_MAX_ACCELERATION { 10000, 10000, 200, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -771,51 +789,48 @@ * M204 R Retract Acceleration * M204 T Travel Acceleration */ -//#define DEFAULT_ACCELERATION 3000 // 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 // ANET A6 Firmware V2.0 defaults: // Accel: 1000 A-retract: 1000 #define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves #define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves -//#define DEFAULT_ACCELERATION 2000 // X, Y, Z and E acceleration for printing moves -//#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts -//#define DEFAULT_TRAVEL_ACCELERATION 4000 // X, Y, Z acceleration for travel (non printing) moves - -/** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -// ANET A6 Firmware V2.0 defaults (jerk): -// Vxy-jerk: 10, Vz-jerk: +000.30, Ve-jerk: 5 -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + // ANET A6 Firmware V2.0 defaults: + // XY: 10, Z: +000.30, E: 5 #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -929,11 +944,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -945,31 +959,23 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -//#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // ANET A8: FRONT-MOUNTED SENSOR WITH 3D PRINTED MOUNT -//#define X_PROBE_OFFSET_FROM_EXTRUDER -28 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER -45 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { -28, -45, 0 } // THESE ARE FOR THE OFFICIAL ANET REAR-MOUNTED SENSOR -//#define X_PROBE_OFFSET_FROM_EXTRUDER -1 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 3 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { -1, 3, 0 } // ANET A6 with BLTouch/3D-Touch mounted right to the nozzle -#define X_PROBE_OFFSET_FROM_EXTRUDER 39 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 39, 0, 0 } //ANET A6 with BLTouch/3D-Touch betwen Fan and Belt // (mount: https://github.com/ralf-e/ANET_A6_modifications/tree/master/A6_X-Axis) -//#define X_PROBE_OFFSET_FROM_EXTRUDER -30 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.75 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { -30, 15, 0.75 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1004,7 +1010,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1306,36 +1312,6 @@ #define GRID_MAX_POINTS_X 4 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // 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) - - // ANET A6 - //#define LEFT_PROBE_BED_POSITION 20 - //#define RIGHT_PROBE_BED_POSITION 190 - //#define FRONT_PROBE_BED_POSITION 20 - //#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 - - // ANET A6 with new X-Axis and modded Y-Axis - //#define LEFT_PROBE_BED_POSITION 20 - //#define RIGHT_PROBE_BED_POSITION 205 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 205 - - // ANET A6 with new X-Axis and modded Y-Axis, X0/Y0 front left bed edge - //#define LEFT_PROBE_BED_POSITION 20 - //#define RIGHT_PROBE_BED_POSITION 194 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 194 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1389,19 +1365,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1664,7 +1627,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1674,8 +1637,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1720,10 +1686,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1832,6 +1798,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2061,31 +2035,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2119,6 +2074,41 @@ // #define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2129,16 +2119,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2154,6 +2142,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2165,27 +2159,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2271,8 +2272,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2311,7 +2314,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A6/Configuration_adv.h b/config/examples/Anet/A6/Configuration_adv.h index acf404e649e3..e795fd9d8a76 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Anet/A6/_Statusscreen.h b/config/examples/Anet/A6/_Statusscreen.h new file mode 100755 index 000000000000..4547f3fd4485 --- /dev/null +++ b/config/examples/Anet/A6/_Statusscreen.h @@ -0,0 +1,56 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Custom Status Screen bitmap + * + * Place this file in the root with your configuration files + * and enable CUSTOM_STATUS_SCREEN_IMAGE in Configuration.h. + * + * Use the Marlin Bitmap Converter to make your own: + * http://marlinfw.org/tools/u8glib/converter.html + */ + +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 10 +#define STATUS_LOGO_WIDTH 40 + +const unsigned char status_logo_bmp[] PROGMEM = { + B01110000,B00000000,B00001000,B00000011,B10001110, + B10001000,B00000000,B00001000,B00000100,B01010000, + B10001010,B11000111,B00111110,B00000100,B01010000, + B11111011,B00101000,B10001000,B00000111,B11001110, + B10001010,B00101111,B00001000,B00000100,B01010001, + B10001010,B00101000,B00001000,B00000100,B01010001, + B10001010,B00100111,B00000110,B00000100,B01001110 +}; + +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_HEATERS_X 48 +#define STATUS_BED_X 74 diff --git a/config/examples/Anet/A8/Configuration.h b/config/examples/Anet/A8/Configuration.h index d5da9d25697e..a522a0dd2a55 100644 --- a/config/examples/Anet/A8/Configuration.h +++ b/config/examples/Anet/A8/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Bob Kuhn, Anet config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ANET_10 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Anet A8" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -278,7 +275,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -322,9 +326,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -349,17 +354,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -371,13 +379,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -395,8 +405,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -521,7 +529,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -721,25 +729,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 100 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 8, 50 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -753,35 +771,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.10 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -895,11 +916,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +931,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +968,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1206,12 +1226,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1526,7 +1540,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1536,8 +1550,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1582,10 +1599,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1694,6 +1711,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1923,31 +1948,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1981,6 +1987,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1991,16 +2032,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2016,6 +2055,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2027,27 +2072,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2133,8 +2185,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2173,7 +2227,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A8/Configuration_adv.h b/config/examples/Anet/A8/Configuration_adv.h index 90625a9baad9..0aa0ae102afd 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Anet/A8/_Statusscreen.h b/config/examples/Anet/A8/_Statusscreen.h new file mode 100755 index 000000000000..ddd62ea53299 --- /dev/null +++ b/config/examples/Anet/A8/_Statusscreen.h @@ -0,0 +1,56 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Custom Status Screen bitmap + * + * Place this file in the root with your configuration files + * and enable CUSTOM_STATUS_SCREEN_IMAGE in Configuration.h. + * + * Use the Marlin Bitmap Converter to make your own: + * http://marlinfw.org/tools/u8glib/converter.html + */ + +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 10 +#define STATUS_LOGO_WIDTH 40 + +const unsigned char status_logo_bmp[] PROGMEM = { + B01110000,B00000000,B00001000,B00000011,B10001110, + B10001000,B00000000,B00001000,B00000100,B01010001, + B10001010,B11000111,B00111110,B00000100,B01010001, + B11111011,B00101000,B10001000,B00000111,B11001110, + B10001010,B00101111,B00001000,B00000100,B01010001, + B10001010,B00101000,B00001000,B00000100,B01010001, + B10001010,B00100111,B00000110,B00000100,B01001110 +}; + +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_HEATERS_X 48 +#define STATUS_BED_X 74 diff --git a/config/examples/Anet/A8plus/Configuration.h b/config/examples/Anet/A8plus/Configuration.h index 13dffd5c6b84..685f1af9364b 100644 --- a/config/examples/Anet/A8plus/Configuration.h +++ b/config/examples/Anet/A8plus/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Martin Zeman - Zemistr, Anet A8 Plus)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ANET_10 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Anet A8 plus" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -278,7 +275,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -322,9 +326,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -349,17 +354,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -371,13 +379,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -395,8 +405,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -520,7 +528,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -719,25 +727,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 50, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -751,35 +769,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.10 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -893,11 +914,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -909,10 +929,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -946,7 +966,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1204,12 +1224,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1263,19 +1277,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1524,7 +1525,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1534,8 +1535,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1580,10 +1584,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1692,6 +1696,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1919,31 +1931,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1977,6 +1970,41 @@ // #define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1987,16 +2015,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2012,6 +2038,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2023,27 +2055,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2129,8 +2168,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2169,7 +2210,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A8plus/Configuration_adv.h b/config/examples/Anet/A8plus/Configuration_adv.h index f1d6421a9aaf..54aa0fa6d8f9 100644 --- a/config/examples/Anet/A8plus/Configuration_adv.h +++ b/config/examples/Anet/A8plus/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ #define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Anet/A8plus/_Statusscreen.h b/config/examples/Anet/A8plus/_Statusscreen.h new file mode 100755 index 000000000000..1235997b7929 --- /dev/null +++ b/config/examples/Anet/A8plus/_Statusscreen.h @@ -0,0 +1,66 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Custom Status Screen bitmap + * + * Place this file in the root with your configuration files + * and enable CUSTOM_STATUS_SCREEN_IMAGE in Configuration.h. + * + * Use the Marlin Bitmap Converter to make your own: + * http://marlinfw.org/tools/u8glib/converter.html + */ + +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 6 +#define STATUS_LOGO_WIDTH 40 + +const unsigned char status_logo_bmp[] PROGMEM = { + B01110000,B00000000,B00001000,B00000011,B10001110, + B10001000,B00000000,B00001000,B00000100,B01010001, + B10001010,B11000111,B00111110,B00000100,B01010001, + B11111011,B00101000,B10001000,B00000111,B11001110, + B10001010,B00101111,B00001000,B00000100,B01010001, + B10001010,B00101000,B00001000,B00000100,B01010001, + B10001010,B00100111,B00000110,B00000100,B01001110, + B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00001110,B01000000,B00000000,B00000000, + B00000000,B00010001,B01000000,B00000000,B00000000, + B00000000,B00010001,B01010001,B00111000,B00000000, + B00000000,B00011110,B01010001,B01000000,B00000000, + B00000000,B00010000,B01010001,B00111000,B00000000, + B00000000,B00010000,B01010001,B00000100,B00000000, + B00000000,B00010000,B01001110,B00111000,B00000000 +}; + +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_HEATERS_X 48 +#define STATUS_BED_X 74 diff --git a/config/examples/Anet/E16/Configuration.h b/config/examples/Anet/E16/Configuration.h index 031fe518d48c..08a462d4607f 100644 --- a/config/examples/Anet/E16/Configuration.h +++ b/config/examples/Anet/E16/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "InsanityAutomation" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ANET_10 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "AnetE16V1.3" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -520,7 +528,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -720,25 +728,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 100 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 50, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -752,35 +770,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -894,11 +915,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -910,10 +930,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -947,7 +967,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1205,12 +1225,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1264,19 +1278,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1525,7 +1526,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1535,8 +1536,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1581,10 +1585,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1693,6 +1697,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1920,31 +1932,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1978,6 +1971,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1988,16 +2016,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2013,6 +2039,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2024,27 +2056,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2130,8 +2169,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2170,7 +2211,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/E16/Configuration_adv.h b/config/examples/Anet/E16/Configuration_adv.h index ea25ceebfa2c..c35f2bb179f6 100644 --- a/config/examples/Anet/E16/Configuration_adv.h +++ b/config/examples/Anet/E16/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1129,15 +1232,115 @@ //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar - #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ #define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ #define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/AnimationExample/_Bootscreen.h b/config/examples/AnimationExample/_Bootscreen.h index 2c1d31e445c1..07d1d7ffd28d 100644 --- a/config/examples/AnimationExample/_Bootscreen.h +++ b/config/examples/AnimationExample/_Bootscreen.h @@ -25,315 +25,169 @@ * Animated boot screen example */ -#define ANIMATED_BOOTSCREEN +#define CUSTOM_BOOTSCREEN_ANIMATED #define CUSTOM_BOOTSCREEN_FRAME_TIME 100 // (ms) -#define CUSTOM_BOOTSCREEN_BMPWIDTH 128 +#define CUSTOM_BOOTSCREEN_BMPWIDTH 120 const unsigned char custom_start_bmp[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, - B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, - B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, - B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, - B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, - B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, - B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, - B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010001,B11110000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B01000000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B01000011,B00110111,B00011100,B11110011,B10000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B01000100,B10100100,B10000101,B10010100,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B01000100,B10100100,B10011101,B00010100,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B01000100,B10100100,B10100101,B00010100,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B01000011,B00100100,B10011100,B11110011,B10000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B11110000,B10010000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B10000000,B10000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B10000111,B10011110,B10111001,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B11101100,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B10001000,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B10001100,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B11110111,B10010110,B10111001,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + 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 }; -#if ENABLED(ANIMATED_BOOTSCREEN) +#if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED) const unsigned char custom_start_bmp1[] PROGMEM = { - B11111001,B11111111,B11111111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00011011,B00000000,B00000000,B00000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010010,B00000000,B00000000,B00000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00110100,B00000000,B00000000,B00000000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00101100,B00000000,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01001000,B00000000,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010000,B00111100,B00000111,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B01101000,B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B01001000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B10110000,B11010000,B00010100,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B10010000,B10110000,B00100100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01011001,B00100000,B01101000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01101001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100110,B01000000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00110110,B10000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010000,B10000001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001001,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001111,B00000010,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000110,B10000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000101,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B10000000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11000000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01100000,B00101000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B00101000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B10010000,B00100100,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11010000,B00110100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01001000,B00010010,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01101100,B00001011,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100100,B00001101,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00011010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11011000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + 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, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; const unsigned char custom_start_bmp2[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + 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,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000111, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000011, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; const unsigned char custom_start_bmp3[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, - B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, - B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, - B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, - B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, - B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, - B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, - B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + 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,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000000,B00000000,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000000,B00000000,B00000000,B00000011, + B10001100,B00110000,B11011100,B11100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11010000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011100,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11001111,B01110000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000111,B01110000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; const unsigned char custom_start_bmp4[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, - B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, - B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, - B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, - B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, - B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, - B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, - B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010001,B11110000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B01000000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B01000011,B00110111,B00011100,B11110011,B10000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B01000100,B10100100,B10000101,B10010010,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B01000100,B10100100,B10011101,B00010100,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B01000100,B10100100,B10100101,B00010010,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B01000011,B00100100,B10011100,B11110011,B10000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + 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,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10000000,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000111,B11000000,B00000000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11100000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01100000,B00000000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char custom_start_bmp5[] 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,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00001100,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10001100,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000111,B11001100,B00000000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11101100,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01101100,B00000000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00001100,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00001100,B00000000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00001110,B00000000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000111,B10000000,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000011,B10000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char custom_start_bmp6[] 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,B00000111, + B10001100,B00110000,B11001111,B11000111,B11001100,B00110000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11101100,B00110000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01101100,B00110000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00001100,B00110000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00001100,B00110000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00001110,B00111000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000111,B10011100,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000011,B10001100,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; const unsigned char * const custom_bootscreen_animation[] PROGMEM = { - custom_start_bmp1, custom_start_bmp2, custom_start_bmp3, custom_start_bmp4, custom_start_bmp + custom_start_bmp1, custom_start_bmp2, custom_start_bmp3, custom_start_bmp4, custom_start_bmp5, custom_start_bmp6, custom_start_bmp }; #endif diff --git a/config/examples/AnyCubic/i3/Configuration.h b/config/examples/AnyCubic/i3/Configuration.h index ba2792fbbcaf..5ecac7cf32bf 100644 --- a/config/examples/AnyCubic/i3/Configuration.h +++ b/config/examples/AnyCubic/i3/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_TRIGORILLA_14 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Anycubic i3" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -718,25 +726,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 96.2 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 6, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1500, 1500, 50, 8000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -750,35 +768,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 5.0 #define DEFAULT_YJERK 2.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 2.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.002 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -892,11 +913,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +928,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 75 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -2 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 75, 5, -2 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +965,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1223,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1276,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1523,7 +1524,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1533,8 +1534,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1579,10 +1583,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1691,6 +1695,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1918,31 +1930,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1976,6 +1969,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1986,16 +2014,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2011,6 +2037,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2022,27 +2054,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2128,8 +2167,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2168,7 +2209,7 @@ */ #define NUM_SERVOS 1 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/AnyCubic/i3/Configuration_adv.h b/config/examples/AnyCubic/i3/Configuration_adv.h index ce84ca0a771a..0e82c07f2ae2 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ #define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - #define CONTROLLER_FAN_PIN 7 // 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 + #define CONTROLLER_FAN_PIN 7 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/ArmEd/Configuration.h b/config/examples/ArmEd/Configuration.h index 1c74b9ca0fa0..d032ec4318e8 100644 --- a/config/examples/ArmEd/Configuration.h +++ b/config/examples/ArmEd/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ARMED #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -709,25 +717,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 156.84 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 20, 120 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 1000, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -741,35 +759,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.0 #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 1.5 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.026 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -883,11 +904,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -899,10 +919,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -936,7 +956,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1194,12 +1214,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1253,19 +1267,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1514,7 +1515,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1524,8 +1525,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1570,10 +1574,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1682,6 +1686,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1909,31 +1921,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1967,6 +1960,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1977,16 +2005,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2002,6 +2028,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2013,27 +2045,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2119,8 +2158,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2159,7 +2200,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/ArmEd/Configuration_adv.h b/config/examples/ArmEd/Configuration_adv.h index 043aaaefafe1..c3ad42cf69b9 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -201,6 +201,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -218,7 +268,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -283,9 +333,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -293,6 +344,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -382,6 +436,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -605,25 +660,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -650,20 +717,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -741,8 +796,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +894,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -853,8 +917,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -868,6 +959,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -879,23 +982,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -928,8 +1014,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1009,17 +1098,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1041,7 +1144,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1134,14 +1237,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1172,7 +1375,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1221,6 +1425,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1281,7 +1521,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1293,7 +1533,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1368,6 +1609,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1425,19 +1669,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1511,8 +1755,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1640,81 +1884,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1753,6 +2017,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1844,17 +2111,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1869,8 +2148,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1892,8 +2175,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1924,7 +2207,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1932,7 +2215,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1940,7 +2223,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1948,7 +2231,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1956,7 +2239,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1964,7 +2247,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1972,7 +2255,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1980,7 +2263,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1988,7 +2271,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1996,7 +2279,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2004,7 +2287,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2012,7 +2295,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2020,7 +2303,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2225,6 +2508,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2279,6 +2569,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2336,9 +2633,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2420,6 +2720,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2438,6 +2754,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Azteeg/X5GT/Configuration.h b/config/examples/Azteeg/X5GT/Configuration.h index 1fa040695e1a..bc07a249a931 100644 --- a/config/examples/Azteeg/X5GT/Configuration.h +++ b/config/examples/Azteeg/X5GT/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_AZTEEG_X5_GT #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration.h b/config/examples/BIBO/TouchX/cyclops/Configuration.h index 89e46bea9949..fbc7098bc0e6 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_GEN_L #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "BIBO2 Touch X" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 400} /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 350, 350, 10, 50 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1100, 1100, 300, 2500 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1100 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 7.0 #define DEFAULT_YJERK 7.0 #define DEFAULT_ZJERK 0.65 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.018 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION 170 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 170 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index 42f0c8c6902c..fda8740b979d 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/BIBO/TouchX/default/Configuration.h b/config/examples/BIBO/TouchX/default/Configuration.h index c144505dc5f0..6fb49056fc58 100644 --- a/config/examples/BIBO/TouchX/default/Configuration.h +++ b/config/examples/BIBO/TouchX/default/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_GEN_L #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "BIBO2 Touch X" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 5 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 93.6 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 350, 350, 10, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1100, 1100, 300, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1100 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 7.0 #define DEFAULT_YJERK 7.0 #define DEFAULT_ZJERK 0.65 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.018 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION 170 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 170 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BIBO/TouchX/default/Configuration_adv.h b/config/examples/BIBO/TouchX/default/Configuration_adv.h index 5e96edcc8acc..cf4eb071a7c7 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/BQ/Hephestos/Configuration.h b/config/examples/BQ/Hephestos/Configuration.h index bc7e212da8fc..db921c9fb059 100644 --- a/config/examples/BQ/Hephestos/Configuration.h +++ b/config/examples/BQ/Hephestos/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "HEPHESTOS" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -502,7 +510,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -696,25 +704,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 100.47095761381482 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 3.3, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1100, 1100, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -728,35 +746,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.062 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -870,11 +891,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -886,10 +906,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -923,7 +943,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1181,12 +1201,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1240,19 +1254,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1501,7 +1502,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1511,8 +1512,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1557,10 +1561,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1669,6 +1673,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1896,31 +1908,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1954,6 +1947,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1964,16 +1992,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1989,6 +2015,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2000,27 +2032,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2106,8 +2145,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2146,7 +2187,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BQ/Hephestos/Configuration_adv.h b/config/examples/BQ/Hephestos/Configuration_adv.h index 4e4c26ee127c..514688d5c298 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 120*60, 120*60, 18*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 120*60, 120*60, 18*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/BQ/Hephestos_2/Configuration.h b/config/examples/BQ/Hephestos_2/Configuration.h index ab241ac0fabf..6e6c68cf4d6f 100644 --- a/config/examples/BQ/Hephestos_2/Configuration.h +++ b/config/examples/BQ/Hephestos_2/Configuration.h @@ -78,13 +78,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "@jbrazio" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -97,10 +93,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -137,18 +136,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_BQ_ZUM_MEGA_3D #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "BQ Hephestos 2" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 #define MACHINE_UUID "8d083632-40c5-4649-85b8-43d9ae6c5d55" // BQ Hephestos 2 standard config // @section extruder @@ -285,7 +282,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -329,9 +333,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -356,17 +361,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -378,13 +386,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -402,8 +412,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 70 #define TEMP_SENSOR_1 0 @@ -515,7 +523,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -709,25 +717,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 160, 160, 8000, 218.77 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 3, 120 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 3000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -741,35 +759,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 5.0 #define DEFAULT_YJERK 5.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 10.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.011 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -883,11 +904,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -899,10 +919,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 34, 15, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -936,7 +956,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1086,6 +1106,7 @@ #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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. // Set one or more commands to execute on filament runout. // (After 'M412 H' Marlin will ask the host to handle the process.) @@ -1193,12 +1214,6 @@ #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 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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1267,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1515,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1525,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1574,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1686,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1921,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1960,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2005,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2028,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2045,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2158,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2200,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BQ/Hephestos_2/Configuration_adv.h b/config/examples/BQ/Hephestos_2/Configuration_adv.h index eb368caee66d..68e6cc60d7c3 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) #define FAN_KICKSTART_TIME 800 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ #define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - //#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -843,6 +898,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + //#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -857,8 +921,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -872,6 +963,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -883,23 +986,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -932,8 +1018,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1013,17 +1102,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1045,7 +1148,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1138,14 +1241,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1176,7 +1379,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 2 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 2 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1225,6 +1429,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1285,7 +1525,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1297,7 +1537,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1372,6 +1613,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1429,19 +1673,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1515,8 +1759,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1644,81 +1888,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1757,6 +2021,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1848,17 +2115,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1873,8 +2152,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1896,8 +2179,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1928,7 +2211,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1936,7 +2219,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1944,7 +2227,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1952,7 +2235,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1960,7 +2243,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1968,7 +2251,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1976,7 +2259,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1984,7 +2267,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1992,7 +2275,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -2000,7 +2283,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2008,7 +2291,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2016,7 +2299,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2024,7 +2307,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2229,6 +2512,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2283,6 +2573,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2340,9 +2637,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2424,6 +2724,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2442,6 +2758,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/BQ/WITBOX/Configuration.h b/config/examples/BQ/WITBOX/Configuration.h index 34856d92465c..9124baf4da1d 100644 --- a/config/examples/BQ/WITBOX/Configuration.h +++ b/config/examples/BQ/WITBOX/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(bq Witbox)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "WITBOX" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -502,7 +510,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -696,25 +704,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 600.0*8/3, 102.073 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 350, 350, 7.2, 80 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 10, 1000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -728,35 +746,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -870,11 +891,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -886,10 +906,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -923,7 +943,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1181,12 +1201,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1240,19 +1254,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1501,7 +1502,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1511,8 +1512,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1557,10 +1561,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1669,6 +1673,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1896,31 +1908,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1954,6 +1947,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1964,16 +1992,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1989,6 +2015,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2000,27 +2032,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2106,8 +2145,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2146,7 +2187,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BQ/WITBOX/Configuration_adv.h b/config/examples/BQ/WITBOX/Configuration_adv.h index 4e4c26ee127c..514688d5c298 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 120*60, 120*60, 18*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 120*60, 120*60, 18*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h b/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h new file mode 100644 index 000000000000..e0d2419367f7 --- /dev/null +++ b/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h @@ -0,0 +1,2200 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Ender-3)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 2 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Ender-3" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 125 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + // Creality Ender-3 + #define DEFAULT_Kp 21.73 + #define DEFAULT_Ki 1.54 + #define DEFAULT_Kd 76.55 + +#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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 600 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE TMC2209 +#define Y_DRIVER_TYPE TMC2209 +#define Z_DRIVER_TYPE TMC2209 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE TMC2209 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +//#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 235 +#define Y_BED_SIZE 235 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 250 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + #define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (20*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 185 +#define PREHEAT_1_TEMP_BED 45 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 WESTERN + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h b/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h new file mode 100644 index 000000000000..ed3069a8d563 --- /dev/null +++ b/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + #define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #define LIN_ADVANCE_K 0.0 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +//#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 400 // (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 350 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 580 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 580 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 2 + #define Z_SLAVE_ADDRESS 1 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 3 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + #define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h b/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h new file mode 100644 index 000000000000..9950f993fe18 --- /dev/null +++ b/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h @@ -0,0 +1,2200 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Ender-3)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 2 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_2 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Ender-3" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 125 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + // Creality Ender-3 + #define DEFAULT_Kp 21.73 + #define DEFAULT_Ki 1.54 + #define DEFAULT_Kd 76.55 + +#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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 600 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE TMC2209 +#define Y_DRIVER_TYPE TMC2209 +#define Z_DRIVER_TYPE TMC2209 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE TMC2209 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +//#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 235 +#define Y_BED_SIZE 235 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 250 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + #define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (20*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 185 +#define PREHEAT_1_TEMP_BED 45 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 WESTERN + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h b/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h new file mode 100644 index 000000000000..9c4d683c6e08 --- /dev/null +++ b/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + #define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #define LIN_ADVANCE_K 0.0 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +//#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 400 // (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 350 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 580 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 580 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + #define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Cartesio/Configuration.h b/config/examples/Cartesio/Configuration.h index d8b2f4fcaa9e..6eac30efd318 100644 --- a/config/examples/Cartesio/Configuration.h +++ b/config/examples/Cartesio/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(MaukCC, CartesioE)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,19 +128,17 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD //#define MOTHERBOARD BOARD_CNCONTROLS_11 #define MOTHERBOARD BOARD_CNCONTROLS_12 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CartesioE" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -278,7 +275,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -322,9 +326,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -349,17 +354,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -371,13 +379,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -395,8 +405,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 -1 @@ -515,7 +523,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //24V 500W silicone heater on to 4mm glass CartesioW @@ -707,25 +715,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 71.128, 71.128, 640, 152 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 20, 20 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -739,35 +757,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -881,11 +902,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -897,10 +917,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -934,7 +954,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1192,12 +1212,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1251,19 +1265,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1512,7 +1513,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1522,8 +1523,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1568,10 +1572,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1680,6 +1684,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1907,31 +1919,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1965,6 +1958,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1975,16 +2003,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2000,6 +2026,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2011,27 +2043,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2117,8 +2156,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2157,7 +2198,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Cartesio/Configuration_adv.h b/config/examples/Cartesio/Configuration_adv.h index 7a116cfb76f0..0173c6356781 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/CR-10/Configuration.h b/config/examples/Creality/CR-10/Configuration.h index eab96aa71d5b..14c5738aa13a 100644 --- a/config/examples/Creality/CR-10/Configuration.h +++ b/config/examples/Creality/CR-10/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Creality CR-10)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI_CREALITY #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CR-10" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -403,7 +411,7 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_5 0 -#define TEMP_SENSOR_BED 5 +#define TEMP_SENSOR_BED 1 #define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //Stock CR-10 Bed Tuned for 70C @@ -718,25 +726,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 15, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -750,35 +768,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 2.7 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -892,11 +913,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +928,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +965,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1223,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1276,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1523,7 +1524,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1533,8 +1534,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1579,10 +1583,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1691,6 +1695,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1918,31 +1930,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1976,6 +1969,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1986,16 +2014,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2011,6 +2037,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2022,27 +2054,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2128,8 +2167,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2168,7 +2209,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-10/Configuration_adv.h b/config/examples/Creality/CR-10/Configuration_adv.h index 4fbb6261ed60..d2b8554fbe6b 100644 --- a/config/examples/Creality/CR-10/Configuration_adv.h +++ b/config/examples/Creality/CR-10/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 10 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 650 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 650 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 580 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2224,6 +2507,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2278,6 +2568,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2335,9 +2632,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2419,6 +2719,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2437,6 +2753,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/CR-10S/Configuration.h b/config/examples/Creality/CR-10S/Configuration.h index fb53d1e996e9..531b053533ac 100644 --- a/config/examples/Creality/CR-10S/Configuration.h +++ b/config/examples/Creality/CR-10S/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(printedsolid.com, CR-10S)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_CREALITY #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CR-10S" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -403,7 +411,7 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_5 0 -#define TEMP_SENSOR_BED 5 +#define TEMP_SENSOR_BED 1 #define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 2500, 2500, 100, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 800 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.067 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1194,12 +1214,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1253,19 +1267,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1514,7 +1515,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1524,8 +1525,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1570,10 +1574,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1682,6 +1686,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1909,31 +1921,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1967,6 +1960,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1977,16 +2005,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2002,6 +2028,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2013,27 +2045,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2119,8 +2158,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2159,7 +2200,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-10S/Configuration_adv.h b/config/examples/Creality/CR-10S/Configuration_adv.h index b415180b8bd8..6126682bcd57 100644 --- a/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 5 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 5 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 5 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 4 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_RETRACT 4 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract. #define FILAMENT_UNLOAD_PURGE_LENGTH 0 // (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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 650 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 650 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 580 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/CR-10_5S/Configuration.h b/config/examples/Creality/CR-10_5S/Configuration.h index 1f993b4111c9..0215b54550ad 100644 --- a/config/examples/Creality/CR-10_5S/Configuration.h +++ b/config/examples/Creality/CR-10_5S/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Evgeny-SPB, CR-10 S5)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_CREALITY #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CR-10 S5" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -403,7 +411,7 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_5 0 -#define TEMP_SENSOR_BED 5 +#define TEMP_SENSOR_BED 1 #define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,7 +716,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } // Stock Creality //#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 415 } // Creality with Bondtech extruder @@ -716,18 +724,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 300, 300, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -741,35 +759,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 5.0 #define DEFAULT_YJERK 5.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -883,11 +904,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -899,10 +919,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -936,7 +956,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1196,12 +1216,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1255,19 +1269,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1516,7 +1517,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1526,8 +1527,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1572,10 +1576,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1684,6 +1688,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1911,31 +1923,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1969,6 +1962,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1979,16 +2007,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2004,6 +2030,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2015,27 +2047,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2121,8 +2160,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2161,7 +2202,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-10_5S/Configuration_adv.h b/config/examples/Creality/CR-10_5S/Configuration_adv.h index eee21c5363a4..ba65980f6058 100644 --- a/config/examples/Creality/CR-10_5S/Configuration_adv.h +++ b/config/examples/Creality/CR-10_5S/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 10 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 10 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_RETRACT 10 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract. #define FILAMENT_UNLOAD_PURGE_LENGTH 0 // (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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/CR-10mini/Configuration.h b/config/examples/Creality/CR-10mini/Configuration.h index 08a46ec9ef55..ba7791c3ccd1 100644 --- a/config/examples/Creality/CR-10mini/Configuration.h +++ b/config/examples/Creality/CR-10mini/Configuration.h @@ -79,13 +79,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -98,10 +94,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -138,18 +137,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI_CREALITY #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CR-10 Mini" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -286,7 +283,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -330,9 +334,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -357,17 +362,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -379,13 +387,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -403,8 +413,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -412,7 +420,7 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_5 0 -#define TEMP_SENSOR_BED 5 +#define TEMP_SENSOR_BED 1 #define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -528,7 +536,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //Stock CR-10 Bed Tuned for 70C @@ -727,25 +735,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 79.60, 80, 400, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 15, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -759,35 +777,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.067 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -901,11 +922,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -917,10 +937,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -954,7 +974,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1212,12 +1232,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1271,19 +1285,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1532,7 +1533,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1542,8 +1543,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1588,10 +1592,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1700,6 +1704,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1927,31 +1939,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1985,6 +1978,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1995,16 +2023,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2020,6 +2046,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2031,27 +2063,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2137,8 +2176,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2177,7 +2218,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-10mini/Configuration_adv.h b/config/examples/Creality/CR-10mini/Configuration_adv.h index 22eb0ed525e1..356d349a611d 100644 --- a/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 580 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 580 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/CR-20 Pro/Configuration.h b/config/examples/Creality/CR-20 Pro/Configuration.h index c284920f0519..32b779e7c742 100644 --- a/config/examples/Creality/CR-20 Pro/Configuration.h +++ b/config/examples/Creality/CR-20 Pro/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(CR-20 Pro)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CR-20 Pro" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -712,25 +720,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 97 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -743,30 +761,39 @@ #define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -851,12 +878,13 @@ * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. * * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, - * MIN_PROBE_EDGE, and a minimum Z_HOMING_HEIGHT of 10. + * and a minimum Z_HOMING_HEIGHT of 10. */ //#define TOUCH_MI_PROBE #if ENABLED(TOUCH_MI_PROBE) #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) #endif // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) @@ -879,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -895,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -932,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1190,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1249,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1510,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1520,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1566,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1678,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1905,31 +1924,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1963,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1973,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1998,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2009,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2115,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2155,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-20 Pro/Configuration_adv.h b/config/examples/Creality/CR-20 Pro/Configuration_adv.h index 6ab4f005ac6d..c7d0cf9d4cd0 100644 --- a/config/examples/Creality/CR-20 Pro/Configuration_adv.h +++ b/config/examples/Creality/CR-20 Pro/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/CR-20 Pro/_Statusscreen.h b/config/examples/Creality/CR-20 Pro/_Statusscreen.h index e7ab39d4bfe6..e88e5fefa195 100644 --- a/config/examples/Creality/CR-20 Pro/_Statusscreen.h +++ b/config/examples/Creality/CR-20 Pro/_Statusscreen.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/config/examples/Creality/CR-20/Configuration.h b/config/examples/Creality/CR-20/Configuration.h index 9ca659e5b93c..657247480de8 100644 --- a/config/examples/Creality/CR-20/Configuration.h +++ b/config/examples/Creality/CR-20/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(m0oml)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CR-20" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -712,25 +720,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 97 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -743,30 +761,39 @@ #define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -851,12 +878,13 @@ * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. * * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, - * MIN_PROBE_EDGE, and a minimum Z_HOMING_HEIGHT of 10. + * and a minimum Z_HOMING_HEIGHT of 10. */ //#define TOUCH_MI_PROBE #if ENABLED(TOUCH_MI_PROBE) #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) #endif // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) @@ -879,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -895,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -932,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1190,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1249,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1510,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1520,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1566,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1678,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1905,31 +1924,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1963,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1973,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1998,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2009,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2115,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2155,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-20/Configuration_adv.h b/config/examples/Creality/CR-20/Configuration_adv.h index c75a664d60ef..2bc4a9cee7a5 100644 --- a/config/examples/Creality/CR-20/Configuration_adv.h +++ b/config/examples/Creality/CR-20/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/CR-8/Configuration.h b/config/examples/Creality/CR-8/Configuration.h index 62695f0ba7b4..a9a09b40ea0d 100644 --- a/config/examples/Creality/CR-8/Configuration.h +++ b/config/examples/Creality/CR-8/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(D-side, CR-8)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_ENDER_4 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CR-8" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // Ender-4 @@ -718,25 +726,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 92.60 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -750,35 +768,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -892,11 +913,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +928,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +965,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1223,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1276,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1523,7 +1524,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1533,8 +1534,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1579,10 +1583,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1691,6 +1695,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1918,31 +1930,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1976,6 +1969,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1986,16 +2014,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2011,6 +2037,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2022,27 +2054,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2128,8 +2167,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2168,7 +2209,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-8/Configuration_adv.h b/config/examples/Creality/CR-8/Configuration_adv.h index 7b1741f637b4..bc5523c9b6f5 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 5 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 5 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 5 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/Ender-2/Configuration.h b/config/examples/Creality/Ender-2/Configuration.h index 84528aa9e630..c6dfa24e1381 100644 --- a/config/examples/Creality/Ender-2/Configuration.h +++ b/config/examples/Creality/Ender-2/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(tommie, Ender 2/4)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI_CREALITY #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Ender 3D" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -712,25 +720,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -744,35 +762,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -886,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -902,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -939,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1197,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1256,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1517,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1527,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1573,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1685,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1881,7 +1893,7 @@ // MakerLab Mini Panel with graphic // controller and SD support - http://reprap.org/wiki/Mini_panel // -#define MINIPANEL +//#define MINIPANEL // // MaKr3d Makr-Panel with graphic controller and SD support. @@ -1912,36 +1924,17 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 // -//#define MKS_MINI_12864 +#define MKS_MINI_12864 // // FYSETC variant of the MINI12864 graphic controller with SD support @@ -1970,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1980,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2005,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2016,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2122,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2162,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/Ender-2/Configuration_adv.h b/config/examples/Creality/Ender-2/Configuration_adv.h index dd7ccd00657b..c1b2893143e5 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 0 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 0 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/Ender-3/Configuration.h b/config/examples/Creality/Ender-3/Configuration.h index 32637c7ea8c7..99bb6660e3ca 100644 --- a/config/examples/Creality/Ender-3/Configuration.h +++ b/config/examples/Creality/Ender-3/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Ender-3)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI_CREALITY #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Ender-3" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -712,25 +720,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -744,35 +762,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -886,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -902,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -939,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1197,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1256,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1517,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1527,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1573,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1685,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1912,31 +1924,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1970,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1980,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2005,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2016,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2122,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2162,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/Ender-3/Configuration_adv.h b/config/examples/Creality/Ender-3/Configuration_adv.h index 6ab4f005ac6d..7c320151d7b0 100644 --- a/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 580 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 580 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1795,7 +2062,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V /** * Monitor Trinamic drivers for error conditions, @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/Ender-3/README.md b/config/examples/Creality/Ender-3/README.md deleted file mode 100644 index e64f3ec3d298..000000000000 --- a/config/examples/Creality/Ender-3/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Creality Ender Support - -This branch is a reverse-engineered version based on the unpublished firmware from Creality. It is **not** the authoritative source, but has been carefully re-built by looking at their firmware and inferring the base version and configuration they used. The basis is the firmware version from "Jul 31 2017 10:16:30". It is based on Marlin 1.0.1, because - -* 1.0.0 had very different serial output in `setup()` and overall code structure. -* 1.0.2 changed the `VERSION_STRING` to include a leading space, and `lcd_init` uses `SET_INPUT` instead of `pinMode`. - -Configurations were found by seeing what code was compiled into the firmware, and constants used there. - -For U8Glib, at least version 1.14 and at most 1.17 is used, because - -* 1.12 didn't have the extra speed argument to u8g_InitCom. -* 1.13 didn't have the soft reset instruction for UC1701 initialization. -* 1.18 has a new directory structure. - -## Bitmaps - -The bootscreen and custom status screens come from Creality's firmware. diff --git a/config/examples/Creality/Ender-3/_Statusscreen.h b/config/examples/Creality/Ender-3/_Statusscreen.h index bf3934729a5d..025801f4fc0f 100644 --- a/config/examples/Creality/Ender-3/_Statusscreen.h +++ b/config/examples/Creality/Ender-3/_Statusscreen.h @@ -34,6 +34,7 @@ // // Status Screen Logo bitmap // +#define STATUS_LOGO_Y 8 #define STATUS_LOGO_WIDTH 39 const unsigned char status_logo_bmp[] PROGMEM = { diff --git a/config/examples/Creality/Ender-4/Configuration.h b/config/examples/Creality/Ender-4/Configuration.h index b133785a1492..a6157c9a1aa1 100644 --- a/config/examples/Creality/Ender-4/Configuration.h +++ b/config/examples/Creality/Ender-4/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Skorpi, Creality Ender-4, brandstaetter)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_ENDER_4 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Ender-4" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // Ender-4 @@ -718,25 +726,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 100 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 15, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -750,35 +768,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 2.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -892,11 +913,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +928,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +965,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1223,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1276,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1523,7 +1524,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1533,8 +1534,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1579,10 +1583,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1691,6 +1695,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1918,31 +1930,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1976,6 +1969,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1986,16 +2014,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2011,6 +2037,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2022,27 +2054,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2128,8 +2167,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2168,7 +2209,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/Ender-4/Configuration_adv.h b/config/examples/Creality/Ender-4/Configuration_adv.h index 311b32b04e55..88025d9b27a7 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #define CASE_LIGHT_DEFAULT_ON false // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) + //#define CASE_LIGHT_MAX_PWM 128 // Limit pwm #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 5 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 2 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 2 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/Ender-5/Configuration.h b/config/examples/Creality/Ender-5/Configuration.h index fd0021b77de3..dffc3c249576 100644 --- a/config/examples/Creality/Ender-5/Configuration.h +++ b/config/examples/Creality/Ender-5/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Ender-5)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI_CREALITY #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Ender-5" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -712,25 +720,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -743,30 +761,39 @@ #define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -851,12 +878,13 @@ * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. * * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, - * MIN_PROBE_EDGE, and a minimum Z_HOMING_HEIGHT of 10. + * and a minimum Z_HOMING_HEIGHT of 10. */ //#define TOUCH_MI_PROBE #if ENABLED(TOUCH_MI_PROBE) #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) #endif // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) @@ -879,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -895,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -932,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -999,7 +1026,7 @@ // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR true #define INVERT_Y_DIR true -#define INVERT_Z_DIR false +#define INVERT_Z_DIR true // @section extruder @@ -1029,8 +1056,8 @@ // @section machine // The size of the print bed -#define X_BED_SIZE 235 -#define Y_BED_SIZE 235 +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 @@ -1190,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1249,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1510,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1520,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1566,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1678,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1905,31 +1924,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1963,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1973,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1998,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2009,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2115,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2155,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/Ender-5/Configuration_adv.h b/config/examples/Creality/Ender-5/Configuration_adv.h index 6ab4f005ac6d..03f7ae411a68 100644 --- a/config/examples/Creality/Ender-5/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -638,7 +705,7 @@ #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_Z false // 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 @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 650 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 580 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1795,7 +2062,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V /** * Monitor Trinamic drivers for error conditions, @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Creality/Ender-5/_Bootscreen.h b/config/examples/Creality/Ender-5/_Bootscreen.h index c0cbe560c654..52119ce6be3d 100644 --- a/config/examples/Creality/Ender-5/_Bootscreen.h +++ b/config/examples/Creality/Ender-5/_Bootscreen.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/config/examples/Creality/Ender-5/_Statusscreen.h b/config/examples/Creality/Ender-5/_Statusscreen.h index 0dc08537235a..3da18ade4b0a 100755 --- a/config/examples/Creality/Ender-5/_Statusscreen.h +++ b/config/examples/Creality/Ender-5/_Statusscreen.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration.h b/config/examples/Dagoma/Disco Ultimate/Configuration.h index 7ffeb6ff623d..d4c66873430a 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "InsanityAutomation" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_DAGOMA #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "DiscoUltimate" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 18 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 160, 160, 1600, 196 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 4, 170 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 1000, 20, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 20 #define DEFAULT_YJERK 20 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.053 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 21 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 21, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h index e10ddaed6447..bbe63bc71717 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) #define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING #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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ #define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ #define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h old mode 100755 new mode 100644 index 9a788a0b3997..44068b89e57f --- a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h +++ b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Sidewinder X1)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +//#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_GEN_L #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Sidewinder X1" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // Sidewinder X1 @@ -713,25 +721,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80.121, 80.121, 399.778, 445 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 50, 40 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -745,35 +763,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 2000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.0 #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.032 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -887,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -903,10 +923,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -940,7 +960,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1198,12 +1218,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1257,19 +1271,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1518,7 +1519,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1528,8 +1529,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1574,10 +1578,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1686,6 +1690,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1913,31 +1925,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1971,6 +1964,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1981,16 +2009,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2006,6 +2032,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2017,27 +2049,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2123,8 +2162,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2163,7 +2204,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h index 6ec2a2147fb2..9e2a11163d08 100755 --- a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h +++ b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/EXP3D/Imprimante multifonction/Configuration.h b/config/examples/EXP3D/Imprimante multifonction/Configuration.h new file mode 100644 index 000000000000..ed2576643dac --- /dev/null +++ b/config/examples/EXP3D/Imprimante multifonction/Configuration.h @@ -0,0 +1,2211 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(Vertabreaker)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_RAMPS_13_EEB +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +#define MACHINE_UUID "00000000-1337-1337-1337-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 5 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 5 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 0 +#define HEATER_1_MINTEMP 0 +#define HEATER_2_MINTEMP 0 +#define HEATER_3_MINTEMP 0 +#define HEATER_4_MINTEMP 0 +#define HEATER_5_MINTEMP 0 +#define BED_MINTEMP 0 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Ultimaker + #define DEFAULT_Kp 11.21//36.59//9.29//8.34//22.2 + #define DEFAULT_Ki 0.44//3.02//0.6//0.34//1.08 + #define DEFAULT_Kd 71.37//110.92//68.17//51.75//114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //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 150//10.00 + #define DEFAULT_bedKi 1.41//.023 + #define DEFAULT_bedKd 1675.16//305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 100 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 1000 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 800, 140 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 8.0 + #define DEFAULT_YJERK 8.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.01 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 0 + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED HOMING_FEEDRATE_XY + +// Feedrate (mm/m) 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 +#define Z_PROBE_SPEED_SLOW HOMING_FEEDRATE_Z + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 4 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 4 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 4 // Z Clearance between multiple probes +#define Z_AFTER_PROBING 4 // 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 0 + +// Enable the M48 repeatability test to test probe accuracy +#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR true +#define INVERT_E2_DIR true +#define INVERT_E3_DIR true +#define INVERT_E4_DIR true +#define INVERT_E5_DIR true + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 300 +#define Y_BED_SIZE 210 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 185 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 2 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + #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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (40*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 250 +#define PREHEAT_2_TEMP_BED 70 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 0), (Y_MIN_POS + 0), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 50 +#define LCD_FEEDBACK_FREQUENCY_HZ 10 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300, 300, 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h b/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h new file mode 100644 index 000000000000..ae51a062a33d --- /dev/null +++ b/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h @@ -0,0 +1,2863 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 5 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 60 // Seconds + #define WATCH_TEMP_INCREASE 5 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 5 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 5 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 5 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 5 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + #define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + #define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 10 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +#define MILLISECONDS_PREHEAT_TIME 30000 + +// @section extruder + +// 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 +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// Homing hits each endstop, retracts by these distances, then does a slower bump. +#define X_HOME_BUMP_MM 4 +#define Y_HOME_BUMP_MM 4 +#define Z_HOME_BUMP_MM 4 +#define HOMING_BUMP_DIVISOR { 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 600 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 60000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + #define BACKLASH_SMOOTHING_MM 10 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + #define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 40 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + #define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +#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 + +// Show the E position (filament used) during printing +#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + #define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + #define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + #define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing + #if ENABLED(LCD_PROGRESS_BAR) + #define PROGRESS_BAR_BAR_TIME 0 // (ms) Amount of time to show the bar + #define PROGRESS_BAR_MSG_TIME 5000 // (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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + #define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + #define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + #define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + //#define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + //#define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + //#define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) + #define DOUBLECLICK_MAX_INTERVAL 2000 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + #define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + #define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + #define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. + #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + #define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + #define CUSTOM_USER_MENU_TITLE "Lin Adv Presets" + #define USER_SCRIPT_DONE "M117 Set & Saved" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + #define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "K0 Off" + #define USER_GCODE_1 "M900 K0\nM500" + + #define USER_DESC_2 "K0.2" + #define USER_GCODE_2 "M900 K0.2\nM500" + + #define USER_DESC_3 "K0.3" + #define USER_GCODE_3 "M900 K0.3\nM500" + + #define USER_DESC_4 "K0.4" + #define USER_GCODE_4 "M900 K0.4\nM500" + + #define USER_DESC_5 "K0.5" + #define USER_GCODE_5 "M900 K0.5\nM500" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + #define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Einstart-S/Configuration.h b/config/examples/Einstart-S/Configuration.h index 35b61755f353..a848ff0edca2 100644 --- a/config/examples/Einstart-S/Configuration.h +++ b/config/examples/Einstart-S/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "elsie tech corp" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_EINSTART_S #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "The Shining" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 666 #define TEMP_SENSOR_1 0 @@ -520,7 +528,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -718,25 +726,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 80, 96.337120 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -750,35 +768,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 2000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -892,11 +913,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +928,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +965,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1223,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1276,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1523,7 +1524,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1533,8 +1534,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1579,10 +1583,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1691,6 +1695,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1918,31 +1930,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - #define U8GLIB_SSD1306 - //#define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1976,6 +1969,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1986,16 +2014,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2012,42 +2038,50 @@ //#define MALYAN_LCD // -// Third-party or vendor-customized controller interfaces. -// Sources should be installed in 'src/lcd/extensible_ui'. +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. // -//#define EXTENSIBLE_UI +//#define TOUCH_UI_FTDI_EVE // -// Einstart S OLED SSD1306 +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. // -#define U8GLIB_SH1106_EINSTART +//#define EXTENSIBLE_UI //============================================================================= //=============================== Graphical TFTs ============================== //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2133,8 +2167,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2173,7 +2209,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Einstart-S/Configuration_adv.h b/config/examples/Einstart-S/Configuration_adv.h index 515add46d610..545da0298833 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_DIR_DELAY 0 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Einstart-S/readme.md b/config/examples/Einstart-S/readme.md index 22e7d8e662a4..f6da66f9cdfe 100644 --- a/config/examples/Einstart-S/readme.md +++ b/config/examples/Einstart-S/readme.md @@ -87,7 +87,7 @@ XS X-Endstop (Min) PS SPST Switch to enable DC 24v BT Bed Thermistor (header not populated) ET Extruder Thermistor -PT1 PT100 Thermocouple (not populated) +PT1 Pt100 Thermocouple (not populated) TC Thermocouple (not populated) VBRG LED Output from PCA5933 BUTTONS @@ -149,4 +149,4 @@ With this modification you no longer need the reset button and you can program d ### Power notes during flashing. You do NOT need power connected when flashing via ISP. -You DO need power when flashing via USB Serial but you MUST time the release of the reset line to allow the upload unless you've performed the permanent modification. \ No newline at end of file +You DO need power when flashing via USB Serial but you MUST time the release of the reset line to allow the upload unless you've performed the permanent modification. diff --git a/config/examples/Fysetc/AIO_II/Configuration.h b/config/examples/FYSETC/AIO_II/Configuration.h similarity index 91% rename from config/examples/Fysetc/AIO_II/Configuration.h rename to config/examples/FYSETC/AIO_II/Configuration.h index 6fd40430e60b..0164f5911947 100644 --- a/config/examples/Fysetc/AIO_II/Configuration.h +++ b/config/examples/FYSETC/AIO_II/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -104,7 +103,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 1 // fzl:由于libmaple 0 用的是USB,1才是串口 old:0 +#define SERIAL_PORT 1 // libmaple 0 for USB ,1 for serial /** * Select a secondary serial port on the board to use for communication with the host. @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_FYSETC_AIO_II #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -150,7 +147,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 3.0 +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -467,10 +475,15 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + // Makerlab J-head + #define DEFAULT_Kp 21.73 + #define DEFAULT_Ki 1.54 + #define DEFAULT_Kd 76.55 + // 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 @@ -514,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +721,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 640, 640, 3200, 800 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -739,30 +762,39 @@ #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -876,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -892,10 +923,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -929,7 +960,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -994,14 +1025,14 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR false -#define INVERT_Y_DIR false -#define INVERT_Z_DIR true +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR false +#define INVERT_E0_DIR true #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false @@ -1026,8 +1057,8 @@ // @section machine // The size of the print bed -#define X_BED_SIZE 200 -#define Y_BED_SIZE 200 +#define X_BED_SIZE 235 +#define Y_BED_SIZE 235 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 @@ -1035,7 +1066,7 @@ #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE -#define Z_MAX_POS 200 +#define Z_MAX_POS 260 /** * Software Endstops @@ -1187,12 +1218,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1246,19 +1271,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1394,7 +1406,7 @@ * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) */ -//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 //#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! #define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. #if ENABLED(EEPROM_SETTINGS) @@ -1507,7 +1519,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1517,8 +1529,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1563,10 +1578,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1675,6 +1690,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1902,31 +1925,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1939,7 +1943,7 @@ // //#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default //#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) -//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight //#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight // @@ -1960,6 +1964,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1970,16 +2009,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1995,6 +2032,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2006,27 +2049,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2098,22 +2148,24 @@ * LED Type. Enable only one of the following two options. * */ -//#define RGB_LED +#define RGB_LED //#define RGBW_LED #if EITHER(RGB_LED, RGBW_LED) - //#define RGB_LED_R_PIN 34 - //#define RGB_LED_G_PIN 43 - //#define RGB_LED_B_PIN 35 - //#define RGB_LED_W_PIN -1 + #define RGB_LED_R_PIN PB0 + #define RGB_LED_G_PIN PB6 + #define RGB_LED_B_PIN PB7 + #define RGB_LED_W_PIN -1 #endif // Support for Adafruit Neopixel LED driver //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2152,7 +2204,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Fysetc/AIO_II/Configuration_adv.h b/config/examples/FYSETC/AIO_II/Configuration_adv.h similarity index 82% rename from config/examples/Fysetc/AIO_II/Configuration_adv.h rename to config/examples/FYSETC/AIO_II/Configuration_adv.h index 1a5cff30fb4f..fe842b23aa7a 100644 --- a/config/examples/Fysetc/AIO_II/Configuration_adv.h +++ b/config/examples/FYSETC/AIO_II/Configuration_adv.h @@ -165,13 +165,13 @@ * Thermal Protection parameters for the bed are just as above for hotends. */ #if ENABLED(THERMAL_PROTECTION_BED) - #define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius /** * As described above, except for the bed (M140/M190/M303). */ - #define WATCH_BED_TEMP_PERIOD 100 // Seconds + #define WATCH_BED_TEMP_PERIOD 60 // Seconds #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius #endif @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + #define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -966,8 +1055,8 @@ #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) - #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. - #define SDSORT_DYNAMIC_RAM true // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 650 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1808,7 +2075,7 @@ * M912 - Clear stepper driver overtemperature pre-warn condition flag. * M122 - Report driver parameters (Requires TMC_DEBUG) */ - //#define MONITOR_DRIVER_STATUS + #define MONITOR_DRIVER_STATUS #if ENABLED(MONITOR_DRIVER_STATUS) #define CURRENT_STEP_DOWN 50 // [mA] @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h new file mode 100644 index 000000000000..8267ec520825 --- /dev/null +++ b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h @@ -0,0 +1,2216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 // libmaple 0 for USB ,1 for serial + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_FYSETC_CHEETAH_V12 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + //PID for Makerlab J-head + #define DEFAULT_Kp 21.73 + #define DEFAULT_Ki 1.54 + #define DEFAULT_Kd 76.55 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE TMC2208 +#define Y_DRIVER_TYPE TMC2208 +#define Z_DRIVER_TYPE TMC2208 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE TMC2208 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -44, -6, -3.9 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 15 // 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 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 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 235 +#define Y_BED_SIZE 235 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 260 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Fysetc/CHEETAH/Configuration_adv.h b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h similarity index 83% rename from config/examples/Fysetc/CHEETAH/Configuration_adv.h rename to config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h index 9aca20d7f94d..d8d9a0046b52 100644 --- a/config/examples/Fysetc/CHEETAH/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -906,13 +992,13 @@ // 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 + //#define SDCARD_RATHERRECENTFIRST #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files - #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + #define EVENT_GCODE_SD_STOP "M21" // G-code to run on Stop Print (e.g., "G28XY" or "G27") /** * Continue after Power-Loss (Creality3D) @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 650 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 650 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 500 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 650 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 1 @@ -1795,7 +2062,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V /** * Monitor Trinamic drivers for error conditions, @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h b/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h new file mode 100644 index 000000000000..599a83d21931 --- /dev/null +++ b/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h @@ -0,0 +1,2216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 // libmaple 0 for USB ,1 for serial + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_FYSETC_CHEETAH_V12 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + //PID for Makerlab J-head + #define DEFAULT_Kp 21.73 + #define DEFAULT_Ki 1.54 + #define DEFAULT_Kd 76.55 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE TMC2208 +#define Y_DRIVER_TYPE TMC2208 +#define Z_DRIVER_TYPE TMC2208 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE TMC2208 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 235 +#define Y_BED_SIZE 235 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 260 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h b/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h new file mode 100644 index 000000000000..d8d9a0046b52 --- /dev/null +++ b/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 120 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 100 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "M21" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 500 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 1 + #define Z_SLAVE_ADDRESS 2 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 3 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + #define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h b/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h new file mode 100644 index 000000000000..a9db01a9b67a --- /dev/null +++ b/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h @@ -0,0 +1,2216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 // libmaple 0 for USB ,1 for serial + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_FYSETC_CHEETAH +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + //PID for Makerlab J-head + #define DEFAULT_Kp 21.73 + #define DEFAULT_Ki 1.54 + #define DEFAULT_Kd 76.55 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE TMC2209 +#define Y_DRIVER_TYPE TMC2209 +#define Z_DRIVER_TYPE TMC2209 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE TMC2209 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -44, -6, -3.9 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 15 // 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 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 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 235 +#define Y_BED_SIZE 235 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 260 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h b/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h new file mode 100644 index 000000000000..d8d9a0046b52 --- /dev/null +++ b/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 120 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 100 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "M21" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 500 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 1 + #define Z_SLAVE_ADDRESS 2 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 3 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + #define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/FYSETC/Cheetah/base/Configuration.h b/config/examples/FYSETC/Cheetah/base/Configuration.h new file mode 100644 index 000000000000..8221dc3825d6 --- /dev/null +++ b/config/examples/FYSETC/Cheetah/base/Configuration.h @@ -0,0 +1,2216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 // libmaple 0 for USB ,1 for serial + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_FYSETC_CHEETAH +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + //PID for Makerlab J-head + #define DEFAULT_Kp 21.73 + #define DEFAULT_Ki 1.54 + #define DEFAULT_Kd 76.55 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE TMC2209 +#define Y_DRIVER_TYPE TMC2209 +#define Z_DRIVER_TYPE TMC2209 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE TMC2209 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 235 +#define Y_BED_SIZE 235 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 260 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/FYSETC/Cheetah/base/Configuration_adv.h b/config/examples/FYSETC/Cheetah/base/Configuration_adv.h new file mode 100644 index 000000000000..d8d9a0046b52 --- /dev/null +++ b/config/examples/FYSETC/Cheetah/base/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 120 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 100 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "M21" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 500 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 650 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 1 + #define Z_SLAVE_ADDRESS 2 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 3 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + #define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Fysetc/F6_13/Configuration.h b/config/examples/FYSETC/F6_13/Configuration.h similarity index 92% rename from config/examples/Fysetc/F6_13/Configuration.h rename to config/examples/FYSETC/F6_13/Configuration.h index 9e314b867218..1a57d5cf3068 100644 --- a/config/examples/Fysetc/F6_13/Configuration.h +++ b/config/examples/FYSETC/F6_13/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,20 +128,18 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD //#define MOTHERBOARD BOARD_RAMPS_14_EFB //#define MOTHERBOARD BOARD_FYSETC_AIO_II #define MOTHERBOARD BOARD_FYSETC_F6_13 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -279,7 +276,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -323,9 +327,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -350,17 +355,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -372,13 +380,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -396,8 +406,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -516,7 +524,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -710,25 +718,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 1280, 1280, 6400, 1600 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -741,30 +759,39 @@ #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -878,11 +905,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -894,10 +920,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -931,7 +957,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1189,12 +1215,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1248,19 +1268,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1509,7 +1516,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1519,8 +1526,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1565,10 +1575,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1677,6 +1687,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1904,31 +1922,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1962,6 +1961,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1972,16 +2006,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1997,6 +2029,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2008,27 +2046,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2163,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2205,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Fysetc/F6_13/Configuration_adv.h b/config/examples/FYSETC/F6_13/Configuration_adv.h similarity index 83% rename from config/examples/Fysetc/F6_13/Configuration_adv.h rename to config/examples/FYSETC/F6_13/Configuration_adv.h index f16f1268b5a4..6972c89e3667 100644 --- a/config/examples/Fysetc/F6_13/Configuration_adv.h +++ b/config/examples/FYSETC/F6_13/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ #define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1478,14 +1722,14 @@ * Requires NOZZLE_PARK_FEATURE. * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. */ -//#define ADVANCED_PAUSE_FEATURE +#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. + #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 100 // (mm) The length of filament for a complete unload. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 0 // (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. @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Fysetc/CHEETAH/Configuration.h b/config/examples/FYSETC/S6/Configuration.h similarity index 91% rename from config/examples/Fysetc/CHEETAH/Configuration.h rename to config/examples/FYSETC/S6/Configuration.h index ad7a948c915f..9572ddcc0373 100644 --- a/config/examples/Fysetc/CHEETAH/Configuration.h +++ b/config/examples/FYSETC/S6/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -104,7 +103,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 1 // libmaple USB 1, old:0 +#define SERIAL_PORT -1 /** * Select a secondary serial port on the board to use for communication with the host. @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_FYSETC_CHEETAH + #define MOTHERBOARD BOARD_FYSETC_S6 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -403,7 +411,7 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_5 0 -#define TEMP_SENSOR_BED 1 +#define TEMP_SENSOR_BED 0 #define TEMP_SENSOR_CHAMBER 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -653,14 +661,14 @@ * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -#define X_DRIVER_TYPE TMC2209 -#define Y_DRIVER_TYPE TMC2209 -#define Z_DRIVER_TYPE TMC2209 +#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 Z3_DRIVER_TYPE A4988 -#define E0_DRIVER_TYPE TMC2209 +#define E0_DRIVER_TYPE A4988 //#define E1_DRIVER_TYPE A4988 //#define E2_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988 @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 400 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -739,30 +757,39 @@ #define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -876,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -892,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -929,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -994,14 +1020,14 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR true +#define INVERT_X_DIR false #define INVERT_Y_DIR true #define INVERT_Z_DIR false // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR true +#define INVERT_E0_DIR false #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false @@ -1026,8 +1052,8 @@ // @section machine // The size of the print bed -#define X_BED_SIZE 235 -#define Y_BED_SIZE 235 +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 @@ -1035,7 +1061,7 @@ #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE -#define Z_MAX_POS 250 +#define Z_MAX_POS 200 /** * Software Endstops @@ -1187,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1246,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1394,7 +1401,7 @@ * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) */ -//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 //#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! #define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. #if ENABLED(EEPROM_SETTINGS) @@ -1507,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1517,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1563,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1675,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1851,7 +1869,7 @@ // RepRapDiscount FULL GRAPHIC Smart Controller // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller // -#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER // // ReprapWorld Graphical LCD @@ -1902,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1960,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1970,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1995,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2006,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2098,7 +2143,7 @@ * LED Type. Enable only one of the following two options. * */ -#define RGB_LED +//#define RGB_LED //#define RGBW_LED #if EITHER(RGB_LED, RGBW_LED) @@ -2112,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2152,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/FYSETC/S6/Configuration_adv.h b/config/examples/FYSETC/S6/Configuration_adv.h new file mode 100644 index 000000000000..da002090121e --- /dev/null +++ b/config/examples/FYSETC/S6/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Felix/DUAL/Configuration.h b/config/examples/Felix/DUAL/Configuration.h index 25b549fa3b7c..ca0d10a56796 100644 --- a/config/examples/Felix/DUAL/Configuration.h +++ b/config/examples/Felix/DUAL/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, Felix/DUAL)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_FELIX2 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Felix Dual" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,9 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - #define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + #define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +352,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +377,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +403,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -502,7 +509,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // Felix Foil Heater @@ -690,25 +697,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 76.190476, 76.190476, 1600, 164 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 5000, 5000, 100, 80000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -722,35 +739,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.023 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -864,11 +884,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -880,10 +899,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -917,7 +936,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1175,12 +1194,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1234,19 +1247,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1495,7 +1495,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1505,8 +1505,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1551,10 +1554,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1663,6 +1666,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1890,31 +1901,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1948,6 +1940,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1958,16 +1985,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1983,6 +2008,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -1994,27 +2025,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2100,8 +2138,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2140,7 +2180,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Felix/Configuration_adv.h b/config/examples/Felix/DUAL/Configuration_adv.h similarity index 83% rename from config/examples/Felix/Configuration_adv.h rename to config/examples/Felix/DUAL/Configuration_adv.h index 70743ab611d8..75c43394a69e 100644 --- a/config/examples/Felix/Configuration_adv.h +++ b/config/examples/Felix/DUAL/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Felix/README.md b/config/examples/Felix/DUAL/README.md similarity index 100% rename from config/examples/Felix/README.md rename to config/examples/Felix/DUAL/README.md diff --git a/config/examples/Felix/Configuration.h b/config/examples/Felix/Single/Configuration.h similarity index 92% rename from config/examples/Felix/Configuration.h rename to config/examples/Felix/Single/Configuration.h index 710143f88022..1b75473654df 100644 --- a/config/examples/Felix/Configuration.h +++ b/config/examples/Felix/Single/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, Felix)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_FELIX2 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Felix" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,9 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - #define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + #define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +352,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +377,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +403,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -502,7 +509,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // Felix Foil Heater @@ -690,25 +697,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 76.190476, 76.190476, 1600, 164 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 5000, 5000, 100, 80000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -722,35 +739,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.023 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -864,11 +884,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -880,10 +899,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -917,7 +936,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1175,12 +1194,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1234,19 +1247,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1495,7 +1495,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1505,8 +1505,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1551,10 +1554,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1663,6 +1666,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1890,31 +1901,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1948,6 +1940,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1958,16 +1985,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1983,6 +2008,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -1994,27 +2025,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2100,8 +2138,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2140,7 +2180,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Felix/Single/Configuration_adv.h b/config/examples/Felix/Single/Configuration_adv.h new file mode 100644 index 000000000000..75c43394a69e --- /dev/null +++ b/config/examples/Felix/Single/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 3 +#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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 60 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + //#define USER_DESC_5 "Home & Info" + //#define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Felix/Single/README.md b/config/examples/Felix/Single/README.md new file mode 100644 index 000000000000..48fe099151bb --- /dev/null +++ b/config/examples/Felix/Single/README.md @@ -0,0 +1,60 @@ +# Felix 2.0/3.0 Configuration for Marlin Firmware + +Bringing silky smooth prints to Felix. + +## Build HOWTO + + - Install the latest non-beta Arduino software IDE/toolset: http://www.arduino.cc/en/Main/Software + - Download the Marlin firmware + - [Latest developement version](https://github.com/MarlinFirmware/Marlin/tree/Development) + - [Stable version](https://github.com/MarlinFirmware/Marlin/tree/Development) + - In both cases use the "Download Zip" button on the right. + +``` +cd Marlin/src +cp config/examples/Felix/Configuration_adv.h . +``` + +The next step depends on your setup: + +### Single Extruder Configuration + + cp config/examples/Felix/Configuration.h . + +### Dual Extruder Configuration + + cp config/examples/Felix/DUAL/Configuration.h Configuration.h + +### Compile Firmware + + - Start the Arduino IDE. + - Select Tools -> Board -> Arduino Mega 2560 + - Select the correct serial port in Tools -> Serial Port (usually /dev/ttyUSB0) + - Open Marlin.pde or .ino + - Click the Verify/Compile button + +### Flash Firmware + +#### Connected directly via USB + + - Click the Upload button. If all goes well the firmware is uploading + +#### Remote update + +Find the latest Arduino build: + + ls -altr /tmp/ + drwxr-xr-x 5 chrono users 12288 Mar 3 21:41 build6072035599686630843.tmp + +Copy the firmware to your printer host: + + scp /tmp/build6072035599686630843.tmp/Marlin.cpp.hex a.b.c.d:/tmp/ + +Connect to your printer host via ssh, stop Octoprint or any other service that may block your USB device and make sure you have avrdude installed, then run: + + avrdude -C/etc/avrdude.conf -v -v -v -patmega2560 -cwiring -P/dev/ttyUSB0 \ + -b115200 -D -Uflash:w:/tmp/Marlin.cpp.hex:i + +## Acknowledgements + +Mashed together and tested on https://apollo.open-resource.org/mission:resources:picoprint based on collaborative teamwork of @andrewsil1 and @thinkyhead. diff --git a/config/examples/FlashForge/CreatorPro/Configuration.h b/config/examples/FlashForge/CreatorPro/Configuration.h index cdc0feba23f8..d566ccd21c38 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration.h +++ b/config/examples/FlashForge/CreatorPro/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "M. Baker" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MIGHTYBOARD_REVE #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CreatorPro" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 -2 #define TEMP_SENSOR_1 -2 @@ -504,7 +512,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -698,7 +706,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //really Sailfish... got enough precision on that float for an 8 bit system? //I'm leaving this in for posterior's sake @@ -707,18 +715,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 250, 250, 20, 100 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -732,35 +750,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 20.0 #define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 2.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.64 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -874,11 +895,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -890,10 +910,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -927,7 +947,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1186,12 +1206,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1245,19 +1259,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1275,6 +1276,8 @@ #if ENABLED(LEVEL_BED_CORNERS) #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling + #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points //#define LEVEL_CENTER_TOO // Move to the center after the last corner #endif @@ -1504,7 +1507,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1514,8 +1517,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1560,10 +1566,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1672,6 +1678,14 @@ // #define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1899,31 +1913,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1957,6 +1952,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1967,16 +1997,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1992,6 +2020,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2003,27 +2037,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2109,8 +2150,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2149,7 +2192,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/FlashForge/CreatorPro/Configuration_adv.h b/config/examples/FlashForge/CreatorPro/Configuration_adv.h index 096c72c9f82b..41afc348ef67 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - //#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -834,6 +889,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + //#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -848,8 +912,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + #define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 255 // User defined GREEN value + #define LED_USER_PRESET_BLUE 255 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -863,6 +954,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -874,23 +977,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 255 // User defined GREEN value - #define LED_USER_PRESET_BLUE 255 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -923,8 +1009,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1004,17 +1093,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1036,7 +1139,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1129,14 +1232,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1167,7 +1370,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1216,6 +1420,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,7 +1516,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1288,7 +1528,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1363,6 +1604,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1420,19 +1664,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1506,8 +1750,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1635,81 +1879,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1748,6 +2012,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1839,17 +2106,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1864,8 +2143,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1887,8 +2170,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1919,7 +2202,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1927,7 +2210,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1935,7 +2218,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1943,7 +2226,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1951,7 +2234,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1959,7 +2242,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1967,7 +2250,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1975,7 +2258,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1983,7 +2266,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1991,7 +2274,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -1999,7 +2282,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2007,7 +2290,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2015,7 +2298,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2220,6 +2503,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2274,6 +2564,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2331,9 +2628,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2415,6 +2715,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2433,6 +2749,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/FolgerTech/i3-2020/Configuration.h b/config/examples/FolgerTech/i3-2020/Configuration.h index 3261d4a679d1..f57c507a66c4 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/config/examples/FolgerTech/i3-2020/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "FT-2020 v9" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -713,7 +721,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#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 @@ -721,18 +729,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 250, 250, 2, 17 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 4, 750 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -746,35 +764,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 400 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.5 #define DEFAULT_YJERK 8.5 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 4.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.058 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -888,11 +909,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -904,10 +924,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#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] +#define NOZZLE_TO_PROBE_OFFSET { 38, -7, -10.75 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 0 @@ -941,7 +961,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1199,12 +1219,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1519,7 +1533,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1529,8 +1543,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1575,10 +1592,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1687,6 +1704,14 @@ // #define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1914,31 +1939,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1972,6 +1978,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1982,16 +2023,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2007,6 +2046,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2018,27 +2063,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2124,8 +2176,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2164,7 +2218,7 @@ */ #define NUM_SERVOS 2 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 500, 500 } diff --git a/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 754b4bd6d343..701491c328e4 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 2 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 2 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2442,6 +2758,7 @@ #define MAX7219_ROTATE -90 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Formbot/Raptor/Configuration.h b/config/examples/Formbot/Raptor/Configuration.h index 27185602bdb6..32115fb5e516 100644 --- a/config/examples/Formbot/Raptor/Configuration.h +++ b/config/examples/Formbot/Raptor/Configuration.h @@ -82,11 +82,11 @@ * If a UART connection is used to configure the driver, please select that as well in Configuration_adv.h. */ //#define X_2208 -//#define X_SpreadCycle +//#define X_SPREADCYCLE //#define Y_2208 -//#define Y_SpreadCycle +//#define Y_SPREADCYCLE //#define E_2208 -//#define E_SpreadCycle +//#define E_SPREADCYCLE /** @@ -111,13 +111,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Tinymachines3D" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -130,10 +126,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -170,18 +169,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_FORMBOT_RAPTOR #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "TM3D RaPtOr" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -318,7 +315,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -362,9 +366,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -389,17 +394,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -411,13 +419,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -435,8 +445,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -475,6 +483,7 @@ #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 #define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 #define BED_MINTEMP 5 // Above this temperature the heater will be switched off. @@ -485,6 +494,7 @@ #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 #define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 #if ENABLED(BED_AC) #define BED_MAXTEMP 150 #else @@ -566,7 +576,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -760,7 +770,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #if ENABLED(Y_2208) #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 1600, 96 } @@ -771,36 +781,46 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 250, 150, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #if ENABLED(X_2208) - #if ENABLED(X_SpreadCycle) - #define x_accel 1750 + #if ENABLED(X_SPREADCYCLE) + #define X_ACCEL 1750 #else - #define x_accel 1000 + #define X_ACCEL 1000 #endif #else - #define x_accel 1500 + #define X_ACCEL 1500 #endif #if ENABLED(Y_2208) - #if ENABLED(Y_SpreadCycle) - #define y_accel 500 + #if ENABLED(Y_SPREADCYCLE) + #define Y_ACCEL 500 #else - #define y_accel 300 + #define Y_ACCEL 300 #endif #else - #define y_accel 500 + #define Y_ACCEL 500 +#endif +#define DEFAULT_MAX_ACCELERATION { X_ACCEL, Y_ACCEL, 400, 4000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits #endif -#define DEFAULT_MAX_ACCELERATION { x_accel, y_accel, 400, 4000 } /** * Default Acceleration (change/s) change = mm/s @@ -815,43 +835,46 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) - #if ENABLED(X_SpreadCycle) || DISABLED(X_2208) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #if ENABLED(X_SPREADCYCLE) || DISABLED(X_2208) #define DEFAULT_XJERK 20.0 #else #define DEFAULT_XJERK 10.0 #endif - #if ENABLED(Y_SpreadCycle) || DISABLED(Y_2208) + #if ENABLED(Y_SPREADCYCLE) || DISABLED(Y_2208) #define DEFAULT_YJERK 10.0 #else #define DEFAULT_YJERK 5.0 #endif #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM (.4 * DEFAULT_YJERK * DEFAULT_YJERK / DEFAULT_ACCELERATION) // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -965,11 +988,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -981,10 +1003,12 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -22 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -22, 0, -1.5 } + +// 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 @@ -1016,7 +1040,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1295,15 +1319,6 @@ #define GRID_MAX_POINTS_X 6 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION 30 - #define RIGHT_PROBE_BED_POSITION 365 - #define FRONT_PROBE_BED_POSITION 30 - #define BACK_PROBE_BED_POSITION 365 - - // 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 @@ -1618,7 +1633,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1628,8 +1643,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1674,10 +1692,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1786,6 +1804,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2013,31 +2039,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2071,6 +2078,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2081,16 +2123,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2106,6 +2146,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2117,27 +2163,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2223,8 +2276,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2263,7 +2318,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Formbot/Raptor/Configuration_adv.h b/config/examples/Formbot/Raptor/Configuration_adv.h index 0f9c68ff1e79..6ab022714247 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) #define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 25 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 25 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 25 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1279,7 +1519,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ #define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2336,9 +2633,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2420,6 +2720,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2438,6 +2754,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Formbot/T_Rex_2+/Configuration.h b/config/examples/Formbot/T_Rex_2+/Configuration.h index 2c4911259a86..335fa16cd661 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration.h @@ -73,13 +73,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Formbot-3D" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -92,10 +88,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -132,18 +131,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_FORMBOT_TREX2PLUS #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "T-Rex 2+" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -280,7 +277,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -330,9 +334,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -357,17 +362,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -379,13 +387,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -403,8 +413,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -536,7 +544,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. #ifdef ROXYs_TRex @@ -737,25 +745,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 800, 93 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 100, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1500, 500, 400, 4000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -769,35 +787,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 12.0 // More conservative numbers. #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.017 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -911,11 +932,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -927,10 +947,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -3 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 31 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.25 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -3, 31, -1.25 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 0 @@ -964,7 +984,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1222,12 +1242,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1547,7 +1561,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1557,8 +1571,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1603,10 +1620,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1715,6 +1732,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1942,31 +1967,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2000,6 +2006,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2010,16 +2051,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2035,6 +2074,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2046,27 +2091,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2152,8 +2204,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2192,7 +2246,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index 1bfb3dac506b..9faa9003b999 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) #define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -382,6 +436,7 @@ #else #define CASE_LIGHT_DEFAULT_BRIGHTNESS 255 // Set default power-up brightness (0-255, requires PWM pin) #endif + //#define CASE_LIGHT_MAX_PWM 128 // Limit pwm #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -605,25 +660,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -650,20 +717,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -741,8 +796,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +894,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -853,8 +917,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -868,7 +959,19 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#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 @@ -879,23 +982,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -928,8 +1014,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1009,17 +1098,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1041,7 +1144,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1134,14 +1237,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1172,7 +1375,8 @@ #define BABYSTEP_WITHOUT_HOMING #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 40 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 40 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 40 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1221,6 +1425,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X 4 @@ -1281,7 +1521,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1293,7 +1533,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1368,6 +1609,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1425,19 +1669,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1511,8 +1755,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 0 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 500 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_RETRACT 0 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_DELAY 500 // (ms) Delay for the filament to cool after retract. #define FILAMENT_UNLOAD_PURGE_LENGTH 0 // (mm) An unretract is done, then this length is purged. #define PAUSE_PARK_NOZZLE_TIMEOUT (3*60) // (seconds) Time limit before the nozzle is turned off for safety. @@ -1640,81 +1884,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1753,6 +2017,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1844,17 +2111,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1869,8 +2148,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1892,8 +2175,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1924,7 +2207,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1932,7 +2215,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1940,7 +2223,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1948,7 +2231,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1956,7 +2239,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1964,7 +2247,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1972,7 +2255,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1980,7 +2263,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1988,7 +2271,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1996,7 +2279,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2004,7 +2287,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2012,7 +2295,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2020,7 +2303,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2225,6 +2508,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2279,6 +2569,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2336,9 +2633,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2420,6 +2720,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2447,7 +2763,8 @@ #define MAX7219_NUMBER_UNITS 3 // 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 - #define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + #define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Formbot/T_Rex_3/Configuration.h b/config/examples/Formbot/T_Rex_3/Configuration.h index be198e7f4c65..0c2f80ba4d37 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration.h +++ b/config/examples/Formbot/T_Rex_3/Configuration.h @@ -74,13 +74,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Formbot-3D" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -93,10 +89,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -133,18 +132,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_FORMBOT_TREX3 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "T-Rex 3" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -281,7 +278,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -325,9 +329,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -352,17 +357,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -374,13 +382,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -398,8 +408,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -523,7 +531,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -717,7 +725,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 160, 1600, 93 } #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 800, 93 } @@ -725,19 +733,29 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_MAX_FEEDRATE { 250, 150, 5, 25 } #define DEFAULT_MAX_FEEDRATE { 250, 100, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1500, 500, 400, 4000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -747,44 +765,43 @@ * M204 T Travel Acceleration */ -//#define DEFAULT_ACCELERATION 3000 // 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 - #define DEFAULT_ACCELERATION 1500 // X, Y, Z and E acceleration for printing moves #define DEFAULT_RETRACT_ACCELERATION 1500 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 12.0 // More conservative numbers. #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.017 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -898,11 +915,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -914,10 +930,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -3 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 31 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.25 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -3, 31, -1.25 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 0 @@ -951,7 +967,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1218,12 +1234,6 @@ #define GRID_MAX_POINTS_X 3 #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1538,7 +1548,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1548,8 +1558,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1594,10 +1607,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1709,6 +1722,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1936,31 +1957,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1994,6 +1996,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2004,16 +2041,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2029,6 +2064,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2040,27 +2081,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2146,8 +2194,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2186,7 +2236,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/config/examples/Formbot/T_Rex_3/Configuration_adv.h index 0e8b28f95f3b..c1f6ea4fd6d2 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) #define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -382,6 +436,7 @@ #else #define CASE_LIGHT_DEFAULT_BRIGHTNESS 255 // Set default power-up brightness (0-255, requires PWM pin) #endif + //#define CASE_LIGHT_MAX_PWM 128 // Limit pwm #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -605,25 +660,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -650,20 +717,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -741,8 +796,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +894,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -853,8 +917,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -868,6 +959,18 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -879,23 +982,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -928,8 +1014,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1009,17 +1098,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1041,7 +1144,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1134,14 +1237,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1172,7 +1375,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 40 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 40 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 40 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1221,6 +1425,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X 4 @@ -1281,7 +1521,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1293,7 +1533,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1368,6 +1609,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1425,19 +1669,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1511,8 +1755,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 0 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 500 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_RETRACT 0 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_DELAY 500 // (ms) Delay for the filament to cool after retract. #define FILAMENT_UNLOAD_PURGE_LENGTH 0 // (mm) An unretract is done, then this length is purged. #define PAUSE_PARK_NOZZLE_TIMEOUT (3*60) // (seconds) Time limit before the nozzle is turned off for safety. @@ -1640,81 +1884,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1753,6 +2017,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1844,17 +2111,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1869,8 +2148,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1892,8 +2175,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1924,7 +2207,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1932,7 +2215,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1940,7 +2223,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1948,7 +2231,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1956,7 +2239,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1964,7 +2247,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1972,7 +2255,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1980,7 +2263,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1988,7 +2271,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1996,7 +2279,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2004,7 +2287,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2012,7 +2295,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2020,7 +2303,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2225,6 +2508,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2279,6 +2569,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2331,9 +2628,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2415,6 +2715,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2443,6 +2759,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Geeetech/A10/Configuration.h b/config/examples/Geeetech/A10/Configuration.h index 1038ab96918e..ce6fa1807381 100644 --- a/config/examples/Geeetech/A10/Configuration.h +++ b/config/examples/Geeetech/A10/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, Geeetech A10 default)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_V3 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Geeetech A10" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -504,7 +512,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // MeCreator2 generated by Autotune @@ -691,25 +699,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -723,35 +741,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -865,11 +886,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -881,10 +901,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -37 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.6 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -918,7 +938,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -990,12 +1010,12 @@ // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR false -#define INVERT_E1_DIR false -#define INVERT_E2_DIR false -#define INVERT_E3_DIR false -#define INVERT_E4_DIR false -#define INVERT_E5_DIR false +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false // unused, the A10 only has one extruder by default +#define INVERT_E2_DIR false // unused, the A10 only has one extruder by default +#define INVERT_E3_DIR false // unused, the A10 only has one extruder by default +#define INVERT_E4_DIR false // unused, the A10 only has one extruder by default +#define INVERT_E5_DIR false // unused, the A10 only has one extruder by default // @section homing @@ -1178,12 +1198,6 @@ #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 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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1237,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1498,7 +1499,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1508,8 +1509,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1554,10 +1558,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1666,6 +1670,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1893,31 +1905,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1951,6 +1944,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1961,16 +1989,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1986,6 +2012,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -1997,27 +2029,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2103,8 +2142,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2143,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/A10/Configuration_adv.h b/config/examples/Geeetech/A10/Configuration_adv.h index b9e680bc11e0..ed289e06b157 100644 --- a/config/examples/Geeetech/A10/Configuration_adv.h +++ b/config/examples/Geeetech/A10/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Geeetech/A10D/Configuration.h b/config/examples/Geeetech/A10D/Configuration.h new file mode 100644 index 000000000000..03ac8faf34ed --- /dev/null +++ b/config/examples/Geeetech/A10D/Configuration.h @@ -0,0 +1,2195 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(default)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_GT2560_V3 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#define EXTRUDERS 2 + +// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + #define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + #define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 1 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + +#define DEFAULT_Kp 226.93 //11.93 +#define DEFAULT_Ki 0.43 //0.59 +#define DEFAULT_Kd 854.89 //59.89 + +#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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + // MeCreator2 generated by Autotune + #define DEFAULT_bedKp 182.46 // 175.68 189.95 + #define DEFAULT_bedKi 35.92 // 34.59 37.40 + #define DEFAULT_bedKd 231.70 // 223.07 241.19 + + // 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! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 100 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 1000 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 2 // 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 -10 +#define Z_PROBE_OFFSET_RANGE_MAX 0 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 100 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR true +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 260 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#define FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define NUM_RUNOUT_SENSORS 2 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT_PIN 66 + #define FIL_RUNOUT2_PIN 67 + //#define FIL_RUNOUT2_PIN 67 + #define FIL_RUNOUT_INVERTING true // Set to true to invert the logic of the sensors. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, 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 + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 GRID_MAX_POINTS_X 5 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #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 0 // 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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + #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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (40*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 90 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { 3, (Y_MAX_POS - 3), 10 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 2 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +#define ULTIPANEL +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Geeetech/A10D/Configuration_adv.h b/config/examples/Geeetech/A10D/Configuration_adv.h new file mode 100644 index 000000000000..b4d2836fd4b4 --- /dev/null +++ b/config/examples/Geeetech/A10D/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G27" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Geeetech/A10M/Configuration.h b/config/examples/Geeetech/A10M/Configuration.h index 6c976b084036..9a79f9c74d89 100644 --- a/config/examples/Geeetech/A10M/Configuration.h +++ b/config/examples/Geeetech/A10M/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_V3 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Geeetech A10M" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -504,7 +512,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // MeCreator2 generated by Autotune @@ -691,25 +699,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 430 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -723,35 +741,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -865,11 +886,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -881,10 +901,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -37 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.6 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -918,7 +938,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1178,12 +1198,6 @@ #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 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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1237,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1498,7 +1499,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1508,8 +1509,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1554,10 +1558,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1666,6 +1670,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1893,31 +1905,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1951,6 +1944,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1961,16 +1989,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1986,6 +2012,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -1997,27 +2029,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2103,8 +2142,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2143,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/A10M/Configuration_adv.h b/config/examples/Geeetech/A10M/Configuration_adv.h index 00c93e334a82..6db75d1cf848 100644 --- a/config/examples/Geeetech/A10M/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ #define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) #define POWER_LOSS_PIN 69 // Pin to detect power loss #define POWER_LOSS_STATE LOW // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ #define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames #define STATUS_HEAT_PERCENT // Show heating in a progress bar #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Geeetech/A10T/Configuration.h b/config/examples/Geeetech/A10T/Configuration.h new file mode 100644 index 000000000000..55054f985b81 --- /dev/null +++ b/config/examples/Geeetech/A10T/Configuration.h @@ -0,0 +1,2197 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_GT2560_V3 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Geeetech A10M" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 3 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + #define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + #define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // A10M [@thinkyhead] + #define DEFAULT_Kp 45.80 + #define DEFAULT_Ki 3.61 + #define DEFAULT_Kd 145.39 + +#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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + // MeCreator2 generated by Autotune + #define DEFAULT_bedKp 182.46 // 175.68 189.95 + #define DEFAULT_bedKi 35.92 // 34.59 37.40 + #define DEFAULT_bedKd 231.70 // 223.07 241.19 + + // 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 450 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 430 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 2 // 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 -5 +#define Z_PROBE_OFFSET_RANGE_MAX -0.2 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +#define DELAY_BEFORE_PROBING 100 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 230 +#define Y_BED_SIZE 230 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -10 +#define Y_MIN_POS -5 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 260 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#define FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define NUM_RUNOUT_SENSORS 3 + #define FIL_RUNOUT_PIN 66 + #define FIL_RUNOUT2_PIN 67 + #define FIL_RUNOUT3_PIN 68 + #define FIL_RUNOUT_INVERTING true // Set to true to invert the logic of the sensors. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, 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 + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (80*60) +#define HOMING_FEEDRATE_Z (20*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 190 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 90 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { 3, (Y_MAX_POS - 3), 10 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 2 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Geeetech/A10T/Configuration_adv.h b/config/examples/Geeetech/A10T/Configuration_adv.h new file mode 100644 index 000000000000..6db75d1cf848 --- /dev/null +++ b/config/examples/Geeetech/A10T/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + #define BLTOUCH_DELAY 200 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + #define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 10 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 50 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + #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 180000 // (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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G27" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + #define POWER_LOSS_PIN 69 // Pin to detect power loss + #define POWER_LOSS_STATE LOW // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK true // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + #define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + #define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + #define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 5 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 18 // (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 450 // (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 12 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 450 // (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 40 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Geeetech/A20/Configuration.h b/config/examples/Geeetech/A20/Configuration.h new file mode 100644 index 000000000000..21f8d1294099 --- /dev/null +++ b/config/examples/Geeetech/A20/Configuration.h @@ -0,0 +1,2197 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_GT2560_V3_A20 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Geeetech A20M" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + #define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + #define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // A20M [@thinkyhead] + #define DEFAULT_Kp 45.80 + #define DEFAULT_Ki 3.61 + #define DEFAULT_Kd 145.39 + +#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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + // MeCreator2 generated by Autotune + #define DEFAULT_bedKp 182.46 // 175.68 189.95 + #define DEFAULT_bedKi 35.92 // 34.59 37.40 + #define DEFAULT_bedKd 231.70 // 223.07 241.19 + + // 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 400 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 2 // 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 -5 +#define Z_PROBE_OFFSET_RANGE_MAX -0.2 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +#define DELAY_BEFORE_PROBING 100 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 255 +#define Y_BED_SIZE 255 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -10 +#define Y_MIN_POS -5 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 250 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#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_PIN 66 + #define FIL_RUNOUT_INVERTING true // Set to true to invert the logic of the sensors. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, 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 + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + #define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (80*60) +#define HOMING_FEEDRATE_Z (20*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 190 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 90 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { 3, (Y_MAX_POS - 3), 10 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 2 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 +#define ST7920_DELAY_1 DELAY_NS(125) +#define ST7920_DELAY_2 DELAY_NS(125) +#define ST7920_DELAY_3 DELAY_NS(125) + +// +// 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Geeetech/A20/Configuration_adv.h b/config/examples/Geeetech/A20/Configuration_adv.h new file mode 100644 index 000000000000..0e117405ed61 --- /dev/null +++ b/config/examples/Geeetech/A20/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + #define BLTOUCH_DELAY 200 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + #define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 10 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 50 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + #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 180000 // (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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G27" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + #define POWER_LOSS_PIN 69 // Pin to detect power loss + #define POWER_LOSS_STATE LOW // State of pin indicating power loss + #define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK true // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + #define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + #define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + #define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + #define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + #define MARLIN_BRICKOUT + #define MARLIN_INVADERS + #define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 5 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + #define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 400 // (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 400 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Geeetech/A20M/Configuration.h b/config/examples/Geeetech/A20M/Configuration.h index 6a3ecfa18c64..88bcc7c1d5aa 100644 --- a/config/examples/Geeetech/A20M/Configuration.h +++ b/config/examples/Geeetech/A20M/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_V3_A20 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Geeetech A20M" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -504,7 +512,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // MeCreator2 generated by Autotune @@ -691,25 +699,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 430 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -723,35 +741,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -760,7 +781,7 @@ * * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained */ -//#define S_CURVE_ACCELERATION +#define S_CURVE_ACCELERATION //=========================================================================== //============================= Z Probe Options ============================= @@ -865,11 +886,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -881,10 +901,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -37 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.6 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -918,7 +938,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1178,12 +1198,6 @@ #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 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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1237,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1275,7 +1276,7 @@ * 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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" +#define Z_PROBE_END_SCRIPT "G1 Z5 F6000\nG1 X10 Y10\nG1 Z0.2" // @section homing @@ -1444,7 +1445,7 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z_raise } - #define NOZZLE_PARK_POINT { 3, (Y_MAX_POS - 3), 10 } + #define NOZZLE_PARK_POINT { X_MIN_POS, Y_MIN_POS, 6 } #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) #endif @@ -1497,7 +1498,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1507,8 +1508,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1553,10 +1557,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1665,6 +1669,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1717,7 +1729,7 @@ // // ULTIPANEL as seen on Thingiverse. // -#define ULTIPANEL +//#define ULTIPANEL // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) @@ -1895,31 +1907,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1953,6 +1946,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1963,16 +1991,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1988,6 +2014,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -1999,27 +2031,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2105,8 +2144,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2145,7 +2186,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/A20M/Configuration_adv.h b/config/examples/Geeetech/A20M/Configuration_adv.h index 31bc5d0e52ff..0e117405ed61 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ #define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) #define POWER_LOSS_PIN 69 // Pin to detect power loss #define POWER_LOSS_STATE LOW // State of pin indicating power loss + #define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -976,7 +1065,7 @@ //#define LONG_FILENAME_HOST_SUPPORT // Enable this option to scroll long filenames in the SD card menu - //#define SCROLL_LONG_FILENAMES + #define SCROLL_LONG_FILENAMES // Leave the heaters on after Stop Print (not recommended!) //#define SD_ABORT_NO_COOLDOWN @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ #define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames #define STATUS_HEAT_PERCENT // Show heating in a progress bar #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + #define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options - //#define MARLIN_BRICKOUT - //#define MARLIN_INVADERS - //#define MARLIN_SNAKE + #define MARLIN_BRICKOUT + #define MARLIN_INVADERS + #define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1181,7 +1385,7 @@ #endif #endif - //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + #define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping #if ENABLED(BABYSTEP_ZPROBE_OFFSET) @@ -1208,15 +1412,51 @@ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. * Mention @Sebastianv650 on GitHub to alert the author of any issues. */ -//#define LIN_ADVANCE +#define LIN_ADVANCE #if ENABLED(LIN_ADVANCE) //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed + #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. #endif // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2244,7 +2534,7 @@ * - M206 and M428 are disabled. * - G92 will revert to its behavior from Marlin 1.0. */ -#define NO_WORKSPACE_OFFSETS +//#define NO_WORKSPACE_OFFSETS /** * Set the number of proportional font spaces required to fill up a typical character space. @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Geeetech/A20T/Configuration.h b/config/examples/Geeetech/A20T/Configuration.h new file mode 100644 index 000000000000..2ef0c0b52af6 --- /dev/null +++ b/config/examples/Geeetech/A20T/Configuration.h @@ -0,0 +1,2199 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_GT2560_V3_A20 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Geeetech A20M" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 3 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + #define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + #define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // A20M [@thinkyhead] + #define DEFAULT_Kp 45.80 + #define DEFAULT_Ki 3.61 + #define DEFAULT_Kd 145.39 + +#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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + // MeCreator2 generated by Autotune + #define DEFAULT_bedKp 182.46 // 175.68 189.95 + #define DEFAULT_bedKi 35.92 // 34.59 37.40 + #define DEFAULT_bedKd 231.70 // 223.07 241.19 + + // 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 400 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 430 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 2 // 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 -5 +#define Z_PROBE_OFFSET_RANGE_MAX -0.2 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +#define DELAY_BEFORE_PROBING 100 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 255 +#define Y_BED_SIZE 255 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -10 +#define Y_MIN_POS -5 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 250 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#define FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define NUM_RUNOUT_SENSORS 3 + #define FIL_RUNOUT_PIN 66 + #define FIL_RUNOUT2_PIN 67 + #define FIL_RUNOUT3_PIN 68 + #define FIL_RUNOUT_INVERTING true // Set to true to invert the logic of the sensors. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, 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 + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + #define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (80*60) +#define HOMING_FEEDRATE_Z (20*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 190 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 90 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { 3, (Y_MAX_POS - 3), 10 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 2 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 +#define ST7920_DELAY_1 DELAY_NS(125) +#define ST7920_DELAY_2 DELAY_NS(125) +#define ST7920_DELAY_3 DELAY_NS(125) + +// +// 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Geeetech/A20T/Configuration_adv.h b/config/examples/Geeetech/A20T/Configuration_adv.h new file mode 100644 index 000000000000..0e117405ed61 --- /dev/null +++ b/config/examples/Geeetech/A20T/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + #define BLTOUCH_DELAY 200 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + #define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 10 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 50 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + #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 180000 // (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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G27" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + #define POWER_LOSS_PIN 69 // Pin to detect power loss + #define POWER_LOSS_STATE LOW // State of pin indicating power loss + #define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK true // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + #define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + #define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + #define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + #define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + #define MARLIN_BRICKOUT + #define MARLIN_INVADERS + #define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 5 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + #define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 400 // (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 400 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Geeetech/A30/Configuration.h b/config/examples/Geeetech/A30/Configuration.h new file mode 100644 index 000000000000..1803a032f011 --- /dev/null +++ b/config/examples/Geeetech/A30/Configuration.h @@ -0,0 +1,2199 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_GTM32_MINI_A30 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 5 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 5 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 0 +#define HEATER_1_MINTEMP 0 +#define HEATER_2_MINTEMP 0 +#define HEATER_3_MINTEMP 0 +#define HEATER_4_MINTEMP 0 +#define HEATER_5_MINTEMP 0 +#define BED_MINTEMP 0 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + //FIND YOUR OWN: "M303 C8 S200 U" HOTEND PID + + #define DEFAULT_Kp 45.80 + #define DEFAULT_Ki 3.61 + #define DEFAULT_Kd 145.39 + +#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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + #define DEFAULT_bedKp 369.610 + #define DEFAULT_bedKi 54.132 + #define DEFAULT_bedKd 602.870 + + // FIND YOUR OWN: "M303 E-1 C8 S60" +#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! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 100 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 1000 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 0 + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED HOMING_FEEDRATE_XY + +// Feedrate (mm/m) 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 +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR true +#define INVERT_E2_DIR true +#define INVERT_E3_DIR true +#define INVERT_E4_DIR true +#define INVERT_E5_DIR true + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 320 +#define Y_BED_SIZE 320 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -10 +#define Y_MIN_POS -5 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 420 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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_PIN 66 + #define FIL_RUNOUT_INVERTING true // set to true to invert the logic of the sensors. - some of the geeetech filament sensors are false + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, 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 + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 GRID_MAX_POINTS_X 5 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #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 0 // 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 0 // Set Mesh bounds as an inset region of the bed + #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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 250 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 20), (Y_MIN_POS + 20),Z_MIN_POS + 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT +#define SDIO_SUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 50 +#define LCD_FEEDBACK_FREQUENCY_HZ 10 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 +//#define ST7920_DELAY_1 DELAY_NS(125) +//#define ST7920_DELAY_2 DELAY_NS(125) +//#define ST7920_DELAY_3 DELAY_NS(125) + +// +// 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Geeetech/A30/Configuration_adv.h b/config/examples/Geeetech/A30/Configuration_adv.h new file mode 100644 index 000000000000..a4257e52489e --- /dev/null +++ b/config/examples/Geeetech/A30/Configuration_adv.h @@ -0,0 +1,2866 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + #define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + #define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 10 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 30000 + +// @section extruder + +// 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 +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 5 +#define HOMING_BUMP_DIVISOR { 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) + #define DOUBLECLICK_MAX_INTERVAL 2000 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + #define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + #define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + #define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. - unused by most slicers +#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define ADVANCED_PAUSE_FEATURE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #define PAUSE_PARK_RETRACT_FEEDRATE 10 // (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 450 // (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 5 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 300 // (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 10 // (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 300 // (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 5 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_LENGTH 25 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 1 // (mm) Extra distance to prime nozzle after returning from park. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 20 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_LENGTH 10 // (mm) An unretract is done, then this length is purged. + + #define PAUSE_PARK_NOZZLE_TIMEOUT 60 // (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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + #define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Geeetech/E180/Configuration.h b/config/examples/Geeetech/E180/Configuration.h new file mode 100644 index 000000000000..46e6babe949c --- /dev/null +++ b/config/examples/Geeetech/E180/Configuration.h @@ -0,0 +1,2195 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_GTM32_MINI +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 5 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 5 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 0 +#define HEATER_1_MINTEMP 0 +#define HEATER_2_MINTEMP 0 +#define HEATER_3_MINTEMP 0 +#define HEATER_4_MINTEMP 0 +#define HEATER_5_MINTEMP 0 +#define BED_MINTEMP 0 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + //FIND YOUR OWN: "M303 C8 S200 U" HOTEND PID + + #define DEFAULT_Kp 45.80 + #define DEFAULT_Ki 3.61 + #define DEFAULT_Kd 145.39 + +#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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + // FIND YOUR OWN: "M303 E-1 C8 S60" +#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! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 100 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 1000 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_ZMAX_PLUG +#define USE_XMIN_PLUG +#define USE_YMAX_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 0 + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED HOMING_FEEDRATE_XY + +// Feedrate (mm/m) 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 +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR true +#define INVERT_E2_DIR true +#define INVERT_E3_DIR true +#define INVERT_E4_DIR true +#define INVERT_E5_DIR true + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR 1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 130 +#define Y_BED_SIZE 130 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 130 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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_PIN 66 + #define FIL_RUNOUT_INVERTING true // set to true to invert the logic of the sensors. - some of the geeetech filament sensors are false + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, 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 + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 GRID_MAX_POINTS_X 5 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #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 0 // 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 0 // Set Mesh bounds as an inset region of the bed + #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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 250 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 20), (Y_MIN_POS + 20),Z_MIN_POS + 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT +#define SDIO_SUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 50 +#define LCD_FEEDBACK_FREQUENCY_HZ 10 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 +//#define ST7920_DELAY_1 DELAY_NS(125) +//#define ST7920_DELAY_2 DELAY_NS(125) +//#define ST7920_DELAY_3 DELAY_NS(125) + +// +// 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Geeetech/E180/Configuration_adv.h b/config/examples/Geeetech/E180/Configuration_adv.h new file mode 100644 index 000000000000..a4257e52489e --- /dev/null +++ b/config/examples/Geeetech/E180/Configuration_adv.h @@ -0,0 +1,2866 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + #define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + #define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 10 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 30000 + +// @section extruder + +// 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 +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 5 +#define HOMING_BUMP_DIVISOR { 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) + #define DOUBLECLICK_MAX_INTERVAL 2000 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + #define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + #define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + #define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. - unused by most slicers +#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define ADVANCED_PAUSE_FEATURE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #define PAUSE_PARK_RETRACT_FEEDRATE 10 // (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 450 // (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 5 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 300 // (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 10 // (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 300 // (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 5 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_LENGTH 25 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 1 // (mm) Extra distance to prime nozzle after returning from park. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 20 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_LENGTH 10 // (mm) An unretract is done, then this length is purged. + + #define PAUSE_PARK_NOZZLE_TIMEOUT 60 // (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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + #define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Geeetech/GT2560/Configuration.h b/config/examples/Geeetech/GT2560/Configuration.h index 3da73e70cd3e..d312ed066438 100644 --- a/config/examples/Geeetech/GT2560/Configuration.h +++ b/config/examples/Geeetech/GT2560/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_REV_A #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -524,7 +532,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#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) @@ -723,25 +731,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 78.74, 78.74, 2560, 105 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 2, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 5000, 5000, 50, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -755,35 +773,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 4.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -897,11 +918,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -913,10 +933,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -950,7 +970,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1208,12 +1228,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1267,19 +1281,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1528,7 +1529,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1538,8 +1539,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1584,10 +1588,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1696,6 +1700,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1923,31 +1935,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1981,6 +1974,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1991,16 +2019,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2016,6 +2042,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2027,27 +2059,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2133,8 +2172,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2173,7 +2214,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h index 886c86b18d80..263aa9eecb9f 100644 --- a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(R. de Weerd, I3 Pro X)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_REV_A_PLUS #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "RdW i3 Pro X" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 2560, 93 } // MXL, Z M8=1.25, MK8 /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 2, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 4000, 4000, 40, 4000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 5.0 #define DEFAULT_YJERK 5.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 4.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.01 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 8 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ #define NUM_SERVOS 1 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/MeCreator2/Configuration.h b/config/examples/Geeetech/MeCreator2/Configuration.h index 69ed2d490b39..8bcdf87c31d6 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration.h +++ b/config/examples/Geeetech/MeCreator2/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, MeCreator2)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_V3_MC2 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "MeCreator2" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //MeCreator2 generated by Autotune #define DEFAULT_bedKp 182.46 // 175.68 189.95 @@ -715,25 +723,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 250, 250, 400, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -747,35 +765,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 2000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) - #define DEFAULT_XJERK 0 - #define DEFAULT_YJERK 0 +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 2 + #define DEFAULT_YJERK 2 #define DEFAULT_ZJERK 0.6 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 50.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.001 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -889,11 +910,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -905,10 +925,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -942,7 +962,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1200,12 +1220,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1259,19 +1273,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1520,7 +1521,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1530,8 +1531,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1576,10 +1580,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1688,6 +1692,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1915,31 +1927,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1973,6 +1966,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1983,16 +2011,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2008,6 +2034,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2019,27 +2051,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2125,8 +2164,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2165,7 +2206,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/config/examples/Geeetech/MeCreator2/Configuration_adv.h index 96db80d4197c..54f6161a4347 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -902,7 +988,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. + #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. @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1216,6 +1420,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,7 +1516,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1288,7 +1528,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1363,6 +1604,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1420,19 +1664,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1506,8 +1750,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1635,81 +1879,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1748,6 +2012,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1839,17 +2106,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1864,8 +2143,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1887,8 +2170,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1919,7 +2202,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1927,7 +2210,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1935,7 +2218,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1943,7 +2226,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1951,7 +2234,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1959,7 +2242,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1967,7 +2250,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1975,7 +2258,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1983,7 +2266,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1991,7 +2274,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -1999,7 +2282,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2007,7 +2290,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2015,7 +2298,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2220,6 +2503,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2274,6 +2564,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2331,9 +2628,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2415,6 +2715,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2433,6 +2749,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Geeetech/PI3A PRO/Configuration.h b/config/examples/Geeetech/PI3A PRO/Configuration.h new file mode 100644 index 000000000000..cbfa5abf2064 --- /dev/null +++ b/config/examples/Geeetech/PI3A PRO/Configuration.h @@ -0,0 +1,2232 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_GT2560_REV_A_PLUS +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 125 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // Geeetech MK8 Extruder + #define DEFAULT_Kp 22.2 + #define DEFAULT_Ki 1.08 + #define DEFAULT_Kd 114 + + + // CTC MK8 Extruder + //#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 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#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 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + //#define DEFAULT_bedKp 10.00 + //#define DEFAULT_bedKi .023 + //#define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 100 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 1000 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define PRO_B_WITH_LEADSCREW +#if ENABLED(PRO_A_WITH_LEADSCREW) // M8 leadscrew version + #define DEFAULT_AXIS_STEPS_PER_UNIT { 78.74, 78.74, 400, 105 } +#else // M8 threaded rod version + #define DEFAULT_AXIS_STEPS_PER_UNIT { 78.74, 78.74, 2560, 105 } +#endif + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 400, 400, 2, 45 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 5000, 5000, 75, 5000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST (20*60) + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR true +#define INVERT_E2_DIR true +#define INVERT_E3_DIR true +#define INVERT_E4_DIR true +#define INVERT_E5_DIR true + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS (-X_MIN_POS+X_BED_SIZE) +#define Y_MAX_POS (-Y_MIN_POS+Y_BED_SIZE) +#define Z_MAX_POS 200 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 true // Set to true to invert the logic of the sensor. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 4 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 GRID_MAX_POINTS_X 5 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #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 0 // 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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + #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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (40*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 281.8196945719 + #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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 170 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 170 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Geeetech/PI3A PRO/Configuration_adv.h b/config/examples/Geeetech/PI3A PRO/Configuration_adv.h new file mode 100644 index 000000000000..9bd66da9b4de --- /dev/null +++ b/config/examples/Geeetech/PI3A PRO/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +//#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G27" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index 43d7306b125a..5edbfeceb189 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(1138-4EB, Geeetech Prusa i3 Pro B BLTouch config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_REV_A_PLUS #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "i3 Pro B" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -524,7 +532,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#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) @@ -723,7 +731,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define PRO_B_WITH_LEADSCREW #if ENABLED(PRO_B_WITH_LEADSCREW) // M8 leadscrew version @@ -735,18 +743,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 2, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 5000, 5000, 75, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -760,35 +778,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -903,11 +924,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -919,10 +939,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 4 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -44 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.4 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 4, -44, -1.4 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -956,7 +976,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1214,12 +1234,6 @@ #define GRID_MAX_POINTS_X 4 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 10 - //#define RIGHT_PROBE_BED_POSITION (X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER - 14) - //#define FRONT_PROBE_BED_POSITION 15 - //#define BACK_PROBE_BED_POSITION (Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1273,19 +1287,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1534,7 +1535,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1544,8 +1545,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1590,10 +1594,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1702,6 +1706,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1929,31 +1941,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1987,6 +1980,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1997,16 +2025,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2022,6 +2048,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2033,27 +2065,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2139,8 +2178,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2179,7 +2220,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/Prusa i3 Pro B/README.md b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/README.md similarity index 100% rename from config/examples/Geeetech/Prusa i3 Pro B/README.md rename to config/examples/Geeetech/Prusa i3 Pro B/bltouch/README.md diff --git a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index 53597ea4416e..1a9f96caca6a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(1138-4EB, Geeetech Prusa i3 Pro B config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_REV_A_PLUS #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "i3 Pro B" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -524,7 +532,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#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) @@ -723,7 +731,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define PRO_B_WITH_LEADSCREW #if ENABLED(PRO_B_WITH_LEADSCREW) // M8 leadscrew version @@ -735,18 +743,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 2, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 5000, 5000, 75, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -760,35 +778,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -902,11 +923,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -918,10 +938,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -955,7 +975,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1213,12 +1233,6 @@ #define GRID_MAX_POINTS_X 4 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 10 - //#define RIGHT_PROBE_BED_POSITION (X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER - 14) - //#define FRONT_PROBE_BED_POSITION 15 - //#define BACK_PROBE_BED_POSITION (Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1272,19 +1286,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1533,7 +1534,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1543,8 +1544,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1589,10 +1593,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1701,6 +1705,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1928,31 +1940,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1986,6 +1979,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1996,16 +2024,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2021,6 +2047,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2032,27 +2064,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2138,8 +2177,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2178,7 +2219,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/README.md b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/README.md new file mode 100644 index 000000000000..30fcf2e443ce --- /dev/null +++ b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/README.md @@ -0,0 +1,54 @@ +These are example configurations for the low-cost [Acrylic Prusa I3 pro B 3D Printer DIY kit](http://www.geeetech.com/acrylic-geeetech-prusa-i3-pro-b-3d-printer-diy-kit-p-917.html) and the [3DTouch auto bed leveling sensor](http://www.geeetech.com/geeetech-3dtouch-auto-bed-leveling-sensor-for-3d-printer-p-1010.html) based on: + +- `../GT2560/` +- [Marlin 1.1.4 With 3DTouch / BLTouch for i3 Pro B](https://www.geeetech.com/forum/viewtopic.php?t=19846) + +The main characteristics of these configurations are: + +- The defined motherboard is `BOARD_GT2560_REV_A_PLUS`. +- Travel limits are adjusted to the printer bed size and position. +- An example `SKEW_CORRECTION` for a particular printer is enabled. See comments below about how to adjust it to a particular printer. +- Using the LCD controller for bed leveling is enabled. + - `PROBE_MANUALLY` is enabled, which *provides a means to do "Auto" Bed Leveling without a probe*. + - The `LEVEL_BED_CORNERS` option for manual bed adjustment is enabled. + - Bilinear bed leveling is enabled, the boundaries for probing are adjusted to the glass size, and extrapolation is enabled. +- `PRINTCOUNTER` is enabled, in order to track statistical data. +- `INDIVIDUAL_AXIS_HOMING_MENU` is enabled, which adds individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +- The speaker is enabled for the UI feedback. +- `bltouch` variant: + - `USE_ZMAX_PLUG` is enabled. See comments about connections below. + - Heaters and fans are turned off when probing. + - Multiple probing is set to 3. + +# First-time configuration + +## Skew factor + +The skew factor must be adjusted for each printer: + +- First, uncomment `#define XY_SKEW_FACTOR 0.0`, compile and upload the firmware. +- Then, print [YACS (Yet Another Calibration Square)](https://www.thingiverse.com/thing:2563185). Hint, scale it considering a margin for brim (if used). The larger, the better to make error measurements. +- Measure the printed part according to the comments in the example configuration file, and set `XY_DIAG_AC`, `XY_DIAG_BD` and `Y_SIDE_AD`. +- Last, comment `#define XY_SKEW_FACTOR 0.0` again, compile and upload. + +## 3DTouch auto leveling sensor + +- Print a suitable mount to attach the sensor to the printer. The example configuration file is adjusted to http://www.geeetech.com/wiki/images/6/61/3DTouch_auto_leveling_sensor-1.zip +- Unlike suggested in [geeetech.com/wiki/index.php/3DTouch_Auto_Leveling_Sensor](https://www.geeetech.com/wiki/index.php/3DTouch_Auto_Leveling_Sensor), the existing end stop switch is expected to be kept connected to Z_MIN. So, the sensor is to be connected to Z_MAX, according to Marlin's default settings. Furthermore, GT2560-A+ provides a connector for the servo next to thermistor connectors (see [GT2560](https://www.geeetech.com/wiki/images/thumb/4/45/GT2560_wiring.jpg/700px-GT2560_wiring.jpg) and [GT2560-A+](http://i.imgur.com/E0t34VU.png)). +- Be careful to respect the polarity of the sensor when connecting it to the GT2560-A+. Unlike end stops, reversing the connection will prevent the sensor from working properly. +- [Test](http://www.geeetech.com/wiki/index.php/3DTouch_Auto_Leveling_Sensor#Testing) and [calibrate](https://www.geeetech.com/wiki/index.php/3DTouch_Auto_Leveling_Sensor#Calibration) the sensor. +- If using the GT2560-A+ and with the sensor connected to Z_MAX and an endstop connected to Z_MIN use the following calibration routine instead. + +## 3DTouch Calibration with Z_MAX + +- Home the printer with `G28` command. +- Disable the Z axis software endstop with `M211 S0 Z0` +- Reset the probe Z_OFFSET with `M851 Z0` +- Move to the center of the bed with `G1 X100 Y100` +- Move Z incrementally until the nozzle is the correct height from the bed using a shim or piece of paper, record this Z movement, for example -0.2. +- Do a single probe at the current point in the middle of the bed using `G30` and not the returned value, for example 1.9. Invert this value, i.e. -1.9, and add it to the Z offset above, i.e. -0.2 in this example giving -2.1. +- Update the probe Z_OFFSET to this value using `M851` i.e. `M851 Z-2.1`. +- Re-enable software end-stops with `M211 S1 Z0` +- Save this value to the EEPROM with `M500`. +- Update the start G-Code in your slicer software to insert a `G29` after the last `G28`. +- Carefully test that the offset is correct in the first print. diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h index 3fb2e1e5faa0..f0e4a32c98b5 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_REV_A #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "i3 Pro C" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 2560, 95, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index b9e680bc11e0..ed289e06b157 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h index 4fcc8fc5bbe9..3c073455bb58 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GT2560_REV_A_PLUS #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "i3 Pro W" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 2560, 95 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index b9e680bc11e0..ed289e06b157 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/HMS434/Configuration.h b/config/examples/HMS434/Configuration.h new file mode 100644 index 000000000000..3ca2c5006dff --- /dev/null +++ b/config/examples/HMS434/Configuration.h @@ -0,0 +1,2200 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(Scheepers, MaukCC)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_CNCONTROLS_15 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +#define MACHINE_UUID "75083866-86ea-42b2-b475-7b3a7855e716" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 -1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 0 +#define TEMP_SENSOR_BED 331 +#define TEMP_SENSOR_CHAMBER 331 + +// Dummy thermistor constant temperature readings, for use with 998 and 999 +#define DUMMY_THERMISTOR_998_VALUE 25 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 410 +#define HEATER_1_MAXTEMP 410 +#define HEATER_2_MAXTEMP 410 +#define HEATER_3_MAXTEMP 410 +#define HEATER_4_MAXTEMP 410 +#define HEATER_5_MAXTEMP 410 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX 170 // 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 +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 20 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + #define DEFAULT_Kp 11.3 + #define DEFAULT_Ki 0.61 + #define DEFAULT_Kd 52.77 + +#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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 18 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 53.45, 71.19, 160, 169.05 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 1000, 1000, 40, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // 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 + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -21, 22, -1.54 } + +// 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 12000 + +// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +#define Z_PROBE_SPEED_FAST 900 + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW 100 + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 1 // 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 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 450 +#define Y_BED_SIZE 325 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -72 +#define Y_MIN_POS -84 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 400 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 5 + #define GRID_MAX_POINTS_Y 3 + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (6000) +#define HOMING_FEEDRATE_Z (900) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { 225, -50, 5 } + #define NOZZLE_PARK_XY_FEEDRATE 150 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 15 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 4 + + // Default number of triangles + #define NOZZLE_CLEAN_TRIANGLES 2 + + // Specify positions as { X, Y, Z } . Leave Z blank to not change the Z position + #define NOZZLE_CLEAN_START_POINT { -37, -67, } + #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 8 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + #define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/HMS434/Configuration_adv.h b/config/examples/HMS434/Configuration_adv.h new file mode 100644 index 000000000000..f4d9d3c0e15e --- /dev/null +++ b/config/examples/HMS434/Configuration_adv.h @@ -0,0 +1,2859 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 18 + #define CHAMBER_MAXTEMP 75 + #define TEMP_CHAMBER_HYSTERESIS 2 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 900 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 900 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 2.0 // compensate for 3V3 ref voltage +#define TEMP_SENSOR_AD8495_OFFSET 0.0 +#define TEMP_SENSOR_AD8495_GAIN 1.0 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 35 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 28 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 16 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 16 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #define LIN_ADVANCE_K 0.02 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 8 // SD,LCD,Buttons take more memory, block buffer needs to be smaller +#else + #define BLOCK_BUFFER_SIZE 8 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 32 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#define ADVANCED_PAUSE_FEATURE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #define PAUSE_PARK_RETRACT_FEEDRATE 30 // (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 30 // (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 0 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + #define SERVICE_NAME_1 "Lubricate axis" + #define SERVICE_INTERVAL_1 100 // print hours + #define SERVICE_NAME_2 "Change X an Y belt" + #define SERVICE_INTERVAL_2 300 // print hours + #define SERVICE_NAME_3 "Change Z belt" + #define SERVICE_INTERVAL_3 1000 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Infitary/i3-M508/Configuration.h b/config/examples/Infitary/i3-M508/Configuration.h index ecf3d1927b09..707b5dbd823a 100644 --- a/config/examples/Infitary/i3-M508/Configuration.h +++ b/config/examples/Infitary/i3-M508/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(tjclement, Infitary M508)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Infitary M508" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -712,25 +720,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 92.6 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -744,35 +762,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -886,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -902,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -939,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1197,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1256,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1517,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1527,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1573,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1685,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1912,31 +1924,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1970,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1980,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2005,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2016,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2122,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2162,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Infitary/i3-M508/Configuration_adv.h b/config/examples/Infitary/i3-M508/Configuration_adv.h index 55bf70e5df7d..650e0cda43aa 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ //#define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/JGAurora/A1/Configuration.h b/config/examples/JGAurora/A1/Configuration.h index d6fe90c1798e..02c14b2e6182 100644 --- a/config/examples/JGAurora/A1/Configuration.h +++ b/config/examples/JGAurora/A1/Configuration.h @@ -70,13 +70,14 @@ // @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. +// Author info of this build printed to the host during boot and M115 + +// ╦╔═╗╔═╗┬ ┬┬─┐┌─┐┬─┐┌─┐╔═╗┌─┐┬─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┬┐ +// ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││ +// ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴ + #define STRING_CONFIG_H_AUTHOR "(Roberto Mariani & Samuel Pinches)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 "Marlin 2b6 (10/6/19)" // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 "JGAuroraForum.com" // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +90,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +133,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_JGAURORA_A5S_A1 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "JGAurora A1" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +279,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +330,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +358,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +383,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +409,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -710,25 +723,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 160, 160, 1600, 202 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_FEEDRATE { 360, 150, 15, 25 } +#define DEFAULT_MAX_FEEDRATE { 360, 150, 30, 40 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1200, 350, 100, 500 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -741,30 +764,39 @@ #define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 13.0 #define DEFAULT_YJERK 5.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -878,11 +910,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -894,10 +925,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -909,7 +940,7 @@ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Feedrate (mm/m) for the "accurate" probe of each point -#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 4) /** * Multiple Probing @@ -931,7 +962,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1189,12 +1220,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1248,19 +1273,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1318,7 +1330,7 @@ #endif // Homing speeds (mm/m) -#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_XY (90*60) #define HOMING_FEEDRATE_Z (12*60) // Validate that endstops are triggered on homing moves @@ -1509,7 +1521,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1519,8 +1531,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1565,10 +1580,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1678,6 +1693,14 @@ // #define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1905,31 +1928,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1963,6 +1967,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1973,16 +2012,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1998,6 +2035,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2009,27 +2052,36 @@ //============================================================================= // -// MKS Robin 320x240 color display -// Also used for JGAurora A5S & A1 TFT LCD's (16-bit Parallel LCD via FSMC) -#define MKS_ROBIN_TFT +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +#define FSMC_GRAPHICAL_TFT +//#define PRINTER_EVENT_LEDS //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 + #define XPT2046_Z1_THRESHOLD 1 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2115,8 +2167,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2155,7 +2209,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/JGAurora/A1/Configuration_adv.h b/config/examples/JGAurora/A1/Configuration_adv.h index 46fc4740cd15..f3366d33ae56 100644 --- a/config/examples/JGAurora/A1/Configuration_adv.h +++ b/config/examples/JGAurora/A1/Configuration_adv.h @@ -202,6 +202,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -219,7 +269,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -284,9 +334,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -294,6 +345,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -306,7 +360,7 @@ * * Define one or both of these to override the default 0-255 range. */ -//#define FAN_MIN_PWM 50 +#define FAN_MIN_PWM 30 //#define FAN_MAX_PWM 128 /** @@ -383,6 +437,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -522,9 +577,9 @@ #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 2 -#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) -//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially -//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing +#define HOMING_BUMP_DIVISOR { 5, 5, 5 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +#define HOMING_BACKOFF_MM { 1, 1, 0 } // (mm) Move away from the endstops after homing // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X @@ -606,25 +661,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -651,20 +718,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -742,8 +797,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -840,6 +895,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 60*60, 60*60, 10*60, 10*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -854,21 +918,60 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view -//#define STATUS_MESSAGE_SCROLLING +#define STATUS_MESSAGE_SCROLLING // On the Info Screen, display XY with one decimal place when possible -//#define LCD_DECIMAL_SMALL_XY +#define LCD_DECIMAL_SMALL_XY // The timeout (in ms) to return to the status screen from sub-menus -//#define LCD_TIMEOUT_TO_STATUS 15000 +#define LCD_TIMEOUT_TO_STATUS 15000 // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -880,23 +983,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 0 // User defined RED value - #define LED_USER_PRESET_GREEN 255 // User defined GREEN value - #define LED_USER_PRESET_BLUE 255 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -904,7 +990,7 @@ // as SD_DETECT_PIN in your board's pins definitions. // This setting should be disabled unless you are using a push button, pulling the pin to ground. // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). - //#define SD_DETECT_INVERTED + #define SD_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. @@ -929,8 +1015,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -978,10 +1067,10 @@ #endif // 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 + #define SCROLL_LONG_FILENAMES // Leave the heaters on after Stop Print (not recommended!) //#define SD_ABORT_NO_COOLDOWN @@ -1010,17 +1099,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1042,7 +1145,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1077,13 +1180,13 @@ */ #if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT + #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 + //#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. @@ -1133,16 +1236,116 @@ //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames - //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + #define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1173,20 +1376,21 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 25 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 25 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 25 - #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). - #define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. #if ENABLED(MOVE_Z_WHEN_IDLE) - #define MOVE_Z_IDLE_MULTIPLICATOR 10 // Multiply 1mm by this factor for the move step size. + #define MOVE_Z_IDLE_MULTIPLICATOR 10 // Multiply 1mm by this factor for the move step size. #endif #endif - //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + #define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping #if ENABLED(BABYSTEP_ZPROBE_OFFSET) @@ -1222,6 +1426,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1282,7 +1522,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1294,7 +1534,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1369,6 +1610,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1426,19 +1670,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1483,23 +1727,23 @@ * Requires NOZZLE_PARK_FEATURE. * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. */ -//#define ADVANCED_PAUSE_FEATURE +#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_FEEDRATE 40 // (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. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 820 // (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. + #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 40 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 730 // (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. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 75 // (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. @@ -1512,18 +1756,18 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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 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_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) #endif @@ -1641,81 +1885,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1754,6 +2018,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1845,17 +2112,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1870,8 +2149,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1893,8 +2176,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1925,7 +2208,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1933,7 +2216,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1941,7 +2224,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1949,7 +2232,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1957,7 +2240,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1965,7 +2248,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1973,7 +2256,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1981,7 +2264,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1989,7 +2272,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1997,7 +2280,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2005,7 +2288,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2013,7 +2296,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2021,7 +2304,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2226,6 +2509,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2280,6 +2570,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2337,9 +2634,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2421,6 +2721,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2439,6 +2755,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/JGAurora/A5/Configuration.h b/config/examples/JGAurora/A5/Configuration.h index 777ccc93bba8..9387713ebdbd 100644 --- a/config/examples/JGAurora/A5/Configuration.h +++ b/config/examples/JGAurora/A5/Configuration.h @@ -75,13 +75,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Telli Mantelli, Kris Waclawski, Samuel Pinches & Michael Gilardi, 21 Jan 2018)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -94,10 +90,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -134,18 +133,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_GEN_L #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "JGAurora A5" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -282,7 +279,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -326,9 +330,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -353,17 +358,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -375,13 +383,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -399,8 +409,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 15 // manual calibration of thermistor in JGAurora A5 hotend #define TEMP_SENSOR_1 0 @@ -524,7 +532,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -720,25 +728,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 800, 100 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 15, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 500, 100, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -752,35 +770,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.0 #define DEFAULT_YJERK 3.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.005 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -894,11 +915,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -910,10 +930,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -947,7 +967,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1205,12 +1225,6 @@ #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 15 - //#define RIGHT_PROBE_BED_POSITION 170 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 170 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1264,19 +1278,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1525,7 +1526,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1535,8 +1536,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1581,10 +1585,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1693,6 +1697,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1920,31 +1932,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1978,6 +1971,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1988,16 +2016,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2013,6 +2039,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2024,27 +2056,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2130,8 +2169,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2170,7 +2211,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/JGAurora/A5/Configuration_adv.h b/config/examples/JGAurora/A5/Configuration_adv.h index d2546f819261..9af88da082aa 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 80*60, 80*60, 12*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 80*60, 80*60, 12*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 5 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 5 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 5 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/JGAurora/A5S/Configuration.h b/config/examples/JGAurora/A5S/Configuration.h index c1a5f6de0d2f..e916a180a81a 100644 --- a/config/examples/JGAurora/A5S/Configuration.h +++ b/config/examples/JGAurora/A5S/Configuration.h @@ -70,13 +70,14 @@ // @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. +// Author info of this build printed to the host during boot and M115 + +// ╦╔═╗╔═╗┬ ┬┬─┐┌─┐┬─┐┌─┐╔═╗┌─┐┬─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┬┐ +// ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││ +// ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴ + #define STRING_CONFIG_H_AUTHOR "(Roberto Mariani & Samuel Pinches)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 "Marlin 2b6 (10/6/19)" // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 "JGAuroraForum.com" // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +90,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +133,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_JGAURORA_A5S_A1 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "JGAurora A5S" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +279,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +330,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +358,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +383,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +409,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -710,25 +723,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 160, 160, 1600, 202 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_FEEDRATE { 360, 150, 15, 25 } +#define DEFAULT_MAX_FEEDRATE { 360, 150, 30, 40 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1200, 350, 100, 500 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -741,30 +764,39 @@ #define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 13.0 #define DEFAULT_YJERK 5.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -878,11 +910,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -894,10 +925,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -909,7 +940,7 @@ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Feedrate (mm/m) for the "accurate" probe of each point -#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 4) /** * Multiple Probing @@ -931,7 +962,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1189,12 +1220,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1248,19 +1273,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1318,7 +1330,7 @@ #endif // Homing speeds (mm/m) -#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_XY (90*60) #define HOMING_FEEDRATE_Z (12*60) // Validate that endstops are triggered on homing moves @@ -1509,7 +1521,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1519,8 +1531,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1565,10 +1580,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1678,6 +1693,14 @@ // #define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1905,31 +1928,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1963,6 +1967,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1973,16 +2012,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1998,6 +2035,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2009,28 +2052,36 @@ //============================================================================= // -// MKS Robin 320x240 color display -// Also used for JGAurora A5S & A1 TFT LCD's (16-bit Parallel LCD via FSMC) -#define MKS_ROBIN_TFT -#define PRINTER_EVENT_LEDS +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +#define FSMC_GRAPHICAL_TFT +//#define PRINTER_EVENT_LEDS //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 + #define XPT2046_Z1_THRESHOLD 1 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2116,8 +2167,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2156,7 +2209,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/JGAurora/A5S/Configuration_adv.h b/config/examples/JGAurora/A5S/Configuration_adv.h index 46fc4740cd15..f3366d33ae56 100644 --- a/config/examples/JGAurora/A5S/Configuration_adv.h +++ b/config/examples/JGAurora/A5S/Configuration_adv.h @@ -202,6 +202,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -219,7 +269,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -284,9 +334,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -294,6 +345,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -306,7 +360,7 @@ * * Define one or both of these to override the default 0-255 range. */ -//#define FAN_MIN_PWM 50 +#define FAN_MIN_PWM 30 //#define FAN_MAX_PWM 128 /** @@ -383,6 +437,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -522,9 +577,9 @@ #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 2 -#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) -//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially -//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing +#define HOMING_BUMP_DIVISOR { 5, 5, 5 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +#define HOMING_BACKOFF_MM { 1, 1, 0 } // (mm) Move away from the endstops after homing // When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X @@ -606,25 +661,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -651,20 +718,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -742,8 +797,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -840,6 +895,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 60*60, 60*60, 10*60, 10*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -854,21 +918,60 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view -//#define STATUS_MESSAGE_SCROLLING +#define STATUS_MESSAGE_SCROLLING // On the Info Screen, display XY with one decimal place when possible -//#define LCD_DECIMAL_SMALL_XY +#define LCD_DECIMAL_SMALL_XY // The timeout (in ms) to return to the status screen from sub-menus -//#define LCD_TIMEOUT_TO_STATUS 15000 +#define LCD_TIMEOUT_TO_STATUS 15000 // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -880,23 +983,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 0 // User defined RED value - #define LED_USER_PRESET_GREEN 255 // User defined GREEN value - #define LED_USER_PRESET_BLUE 255 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -904,7 +990,7 @@ // as SD_DETECT_PIN in your board's pins definitions. // This setting should be disabled unless you are using a push button, pulling the pin to ground. // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). - //#define SD_DETECT_INVERTED + #define SD_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. @@ -929,8 +1015,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -978,10 +1067,10 @@ #endif // 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 + #define SCROLL_LONG_FILENAMES // Leave the heaters on after Stop Print (not recommended!) //#define SD_ABORT_NO_COOLDOWN @@ -1010,17 +1099,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1042,7 +1145,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1077,13 +1180,13 @@ */ #if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar - //#define DOGM_SD_PERCENT + #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 + //#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. @@ -1133,16 +1236,116 @@ //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames - //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + #define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1173,20 +1376,21 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 25 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 25 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 25 - #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). - #define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. #if ENABLED(MOVE_Z_WHEN_IDLE) - #define MOVE_Z_IDLE_MULTIPLICATOR 10 // Multiply 1mm by this factor for the move step size. + #define MOVE_Z_IDLE_MULTIPLICATOR 10 // Multiply 1mm by this factor for the move step size. #endif #endif - //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + #define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping #if ENABLED(BABYSTEP_ZPROBE_OFFSET) @@ -1222,6 +1426,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1282,7 +1522,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1294,7 +1534,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1369,6 +1610,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1426,19 +1670,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1483,23 +1727,23 @@ * Requires NOZZLE_PARK_FEATURE. * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. */ -//#define ADVANCED_PAUSE_FEATURE +#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_FEEDRATE 40 // (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. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 820 // (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. + #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 40 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 730 // (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. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 75 // (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. @@ -1512,18 +1756,18 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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 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_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) #endif @@ -1641,81 +1885,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1754,6 +2018,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1845,17 +2112,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1870,8 +2149,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1893,8 +2176,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1925,7 +2208,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1933,7 +2216,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1941,7 +2224,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1949,7 +2232,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1957,7 +2240,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1965,7 +2248,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1973,7 +2256,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1981,7 +2264,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1989,7 +2272,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1997,7 +2280,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2005,7 +2288,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2013,7 +2296,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2021,7 +2304,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2226,6 +2509,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2280,6 +2570,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2337,9 +2634,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2421,6 +2721,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2439,6 +2755,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/MakerParts/Configuration.h b/config/examples/MakerParts/Configuration.h index 8a36536bae21..44e17f90bb90 100644 --- a/config/examples/MakerParts/Configuration.h +++ b/config/examples/MakerParts/Configuration.h @@ -38,26 +38,6 @@ */ #define CONFIGURATION_H_VERSION 020000 -//=========================================================================== -//===== Pololus calibration ================================================= -//=========================================================================== - -// Voltage reference on potentiometer on Green Pololus in millivolts -#define Vref_mV 800UL - -// Rsc value used on PCB of the Green Pololus -#define Rsc_mOhms 100UL - -// Estimated maximum acceleration for X and Y axis -#define MAX_XYAXIS_ACCEL (3UL * (Vref_mV) * 100UL / (Rsc_mOhms)) - -// Notes: -// If we could use 1.65A as motor current, then 3000 mm/s^2 as acceleration -// if perfectly achievable. Using 1A as motor current, 2400 mm/s^2 acceleration -// is perfectly possible without losing any steps -// On A4988 drivers, maximum current can be calculated as I_TripMax= Vref/(8*Rs) -// - //=========================================================================== //============================= Getting Started ============================= //=========================================================================== @@ -90,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "ejtagle" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -109,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -149,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_DUO_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "MakerParts 3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 #define MACHINE_UUID "4250d842-4943-4601-acca-95ef77b8a4f1" // @section extruder @@ -297,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -341,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -368,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -390,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -414,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -534,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -728,24 +716,34 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 97 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 2, 30 } // For 300mm/s printing +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_ACCELERATION { MAX_XYAXIS_ACCEL, MAX_XYAXIS_ACCEL, 10, 200 } +#define DEFAULT_MAX_ACCELERATION { 2400, 2400, 10, 200 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif /** * Default Acceleration (change/s) change = mm/s @@ -755,40 +753,43 @@ * M204 R Retract Acceleration * M204 T Travel Acceleration */ -#define DEFAULT_ACCELERATION MAX_XYAXIS_ACCEL // X, Y, Z and E acceleration for printing moves +#define DEFAULT_ACCELERATION 2400 // X, Y, Z and E acceleration for printing moves #define DEFAULT_RETRACT_ACCELERATION 100 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION MAX_XYAXIS_ACCEL // X, Y, Z acceleration for travel (non printing) moves - -/** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif +#define DEFAULT_TRAVEL_ACCELERATION 2400 // X, Y, Z acceleration for travel (non printing) moves /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 2.0 #define DEFAULT_YJERK 2.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 8.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.001 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -902,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -918,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -955,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1213,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1272,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1533,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1543,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1589,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1701,6 +1685,14 @@ // #define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1928,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1986,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1996,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2021,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2032,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2138,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2178,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/MakerParts/Configuration_adv.h b/config/examples/MakerParts/Configuration_adv.h index 2eb03a3ea6c6..0eec6b537273 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ #define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Malyan/M150/Configuration.h b/config/examples/Malyan/M150/Configuration.h index 6b3bab02ea25..07950bdfb806 100644 --- a/config/examples/Malyan/M150/Configuration.h +++ b/config/examples/Malyan/M150/Configuration.h @@ -75,13 +75,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -94,10 +90,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -134,18 +133,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI_MALYAN #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Malyan M150" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -282,7 +279,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -326,9 +330,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -353,17 +358,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -375,13 +383,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -399,8 +409,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -522,7 +530,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -721,7 +729,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // Standard M150 17T MXL on X and Y #define DEFAULT_AXIS_STEPS_PER_UNIT { 3200/34.544, 3200/34.544, 1600, 103.00 } @@ -735,18 +743,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 700, 700, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -760,35 +778,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 700 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.0 #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.037 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -902,11 +923,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -918,14 +938,14 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ // Set for HoolyHoo's probe mount // http://www.thingiverse.com/thing:1960419 // Note: HoolyHoo mount is X=35, Y=-50. -//#define X_PROBE_OFFSET_FROM_EXTRUDER 35 // X offset: -left +right [of the nozzle] -//#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] +//#define NOZZLE_TO_PROBE_OFFSET { 35, -50, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -959,7 +979,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1221,12 +1241,6 @@ #define GRID_MAX_POINTS_X 3 #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 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1541,7 +1555,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1551,8 +1565,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1597,10 +1614,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1709,6 +1726,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1936,31 +1961,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1994,6 +2000,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2004,16 +2045,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2029,6 +2068,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2040,27 +2085,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2146,8 +2198,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2186,7 +2240,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Malyan/M150/Configuration_adv.h b/config/examples/Malyan/M150/Configuration_adv.h index 62164ca37415..30911ae4305f 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Malyan/M200/Configuration.h b/config/examples/Malyan/M200/Configuration.h index dedb485e16a6..bcc7a3cf880f 100644 --- a/config/examples/Malyan/M200/Configuration.h +++ b/config/examples/Malyan/M200/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(xC0000005, Malyan M200 build)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MALYAN_M200 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Malyan M200" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -150,7 +147,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 3.0 +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 // For Cyclops or any "multi-extruder" that shares a single nozzle. //#define SINGLENOZZLE @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 11 #define TEMP_SENSOR_1 0 @@ -468,9 +476,10 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker - #define DEFAULT_Kp 26.15 - #define DEFAULT_Ki 2.74 - #define DEFAULT_Kd 62.35 + //#define DEFAULT_Kp 26.15 + //#define DEFAULT_Ki 2.74 + //#define DEFAULT_Kd 62.35 + // MakerGear //#define DEFAULT_Kp 7.0 //#define DEFAULT_Ki 0.1 @@ -481,6 +490,11 @@ //#define DEFAULT_Ki 2.25 //#define DEFAULT_Kd 440 + // Malyan M200 + #define DEFAULT_Kp 20.0 + #define DEFAULT_Ki 2.02 + #define DEFAULT_Kd 100.00 + #endif // PIDTEMP //=========================================================================== @@ -500,7 +514,7 @@ * 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. */ -//#define PIDTEMPBED +#define PIDTEMPBED //#define BED_LIMIT_SWITCHING @@ -513,14 +527,14 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //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 231.09 - #define DEFAULT_bedKi 45.21 - #define DEFAULT_bedKd 295.34 + //#define DEFAULT_bedKp 231.09 + //#define DEFAULT_bedKi 45.21 + //#define DEFAULT_bedKd 295.34 //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //from pidautotune @@ -528,6 +542,11 @@ //#define DEFAULT_bedKi 1.41 //#define DEFAULT_bedKd 1675.16 + // Malyan M200 + #define DEFAULT_bedKp 14.00 + #define DEFAULT_bedKi 0.9 + #define DEFAULT_bedKd 120.4 + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED @@ -707,25 +726,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 93, 93, 1097.5, 97 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -739,35 +768,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -881,11 +913,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -897,10 +928,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -934,7 +965,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1031,8 +1062,8 @@ // @section machine // The size of the print bed -#define X_BED_SIZE 200 -#define Y_BED_SIZE 200 +#define X_BED_SIZE 120 +#define Y_BED_SIZE 120 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 @@ -1040,7 +1071,7 @@ #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE -#define Z_MAX_POS 200 +#define Z_MAX_POS 120 /** * Software Endstops @@ -1192,12 +1223,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1251,19 +1276,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1277,7 +1289,7 @@ #endif // Add a menu item to move between bed corners for manual bed adjustment -#define LEVEL_BED_CORNERS +//#define LEVEL_BED_CORNERS #if ENABLED(LEVEL_BED_CORNERS) #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling @@ -1512,7 +1524,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1522,8 +1534,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1568,10 +1583,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1623,7 +1638,7 @@ */ //#define SPI_SPEED SPI_HALF_SPEED //#define SPI_SPEED SPI_QUARTER_SPEED -#define SPI_SPEED SPI_EIGHTH_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED /** * SD CARD: ENABLE CRC @@ -1680,6 +1695,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1907,31 +1930,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1965,6 +1969,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1975,16 +2014,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1998,7 +2035,13 @@ // // Touch-screen LCD for Malyan M200 printers // -//#define MALYAN_LCD +#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE // // Third-party or vendor-customized controller interfaces. @@ -2011,36 +2054,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Standalone / Serial +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus -// -// LCD for Malyan M200 printers. -// -#define MALYAN_LCD - -// -// CONTROLLER TYPE: Keypad / Add-on -// + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2126,8 +2167,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2166,7 +2209,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Malyan/M200/Configuration_adv.h b/config/examples/Malyan/M200/Configuration_adv.h index 9b992ab431a7..daeb52b88080 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -277,11 +327,12 @@ * The fan will turn on automatically whenever any stepper is enabled * and turn off after a set period after all steppers are turned off. */ -//#define USE_CONTROLLER_FAN +#define USE_CONTROLLER_FAN // Malyan M200: uncomment if you use FAN2 to cool the board (original) #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + #define CONTROLLER_FAN_PIN MALYAN_FAN2_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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -345,7 +399,9 @@ * Multiple extruders can be assigned to the same pin in which case * the fan will turn on when any selected extruder is above the threshold. */ -//#define E0_AUTO_FAN_PIN -1 +//#define FAN_PIN MALYAN_FAN1_PIN // Malyan M200: uncomment if you use FAN1 to cool the part and FAN2 to cool the extruder +//#define E0_AUTO_FAN_PIN MALYAN_FAN2_PIN // Malyan M200: uncomment if you use FAN1 to cool the part and FAN2 to cool the extruder +#define E0_AUTO_FAN_PIN MALYAN_FAN1_PIN // Malyan M200: uncomment if you use FAN1 to cool the extruder and the part (original) #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 @@ -378,6 +434,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +658,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +715,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +794,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +892,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1519,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Malyan/M200/README.md b/config/examples/Malyan/M200/README.md new file mode 100644 index 000000000000..8129650dc74c --- /dev/null +++ b/config/examples/Malyan/M200/README.md @@ -0,0 +1,33 @@ +### Malyan M200 Build Instructions + +Malyan M200 series firmware currently builds using the Arduino IDE. These instructions should +guide you through the configuration and compilation. + +1. Install the Arduino IDE from your favorite source (arduino.cc, windows store, app store) +2. Launch the IDE to add the ST boards manager: + - Open the **Preferences** dialog. + - Add this link in the "*Additional Boards Managers URLs*" field: + https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json + - Select "**Show verbose ouptut during: compilation**." +3. Select **Tools** > **Board** > **Boards Manager**. +4. Type "Malyan" into the Search field. +5. The only board listed will be "**STM32 Cores by STMicroelectronics**." Any version from 1.6.0 up is fine. Choose install. This will download many tools and packages, be patient. +6. Open the **Tools** > **Board** submenu, scroll all the way down, and select **3D Printer Boards**. +7. From the **Tools** menu, select a board part number: + - If you own a M200 V1 or early run (black V2), choose **Malyan M200 V1**. + - If you own a M200 V2 later run (white/black) or V3 (Pro), choose **Malyan M200 V2** (The V2 and V3 both share an STM32F070 MCU). Note that the V3 pinout is not complete (autolevel doesn't work as of this writing). +8. From the **Tools** menu, choose **USB Support** > **CDC No Generic Serial**. +9. Download the latest Marlin source (from the [bugfix-2.0.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x) branch) and unzip it. +10. Look in the `Marlin` subdirectory for the `Configuration.h` and `Configuration_adv.h` files. Replace these files with the configurations in the `config\examples\Malyan\M200` folder. +11. If you have an early-run V2, the steps-per-mm are roughly half. Consult the [mpminipro.com wiki](https://mpminipro.com/) for the steps that apply to your unit. Modify `Configuration.h`. +12. Inverting Axis. There's no pattern to axes will need to be inverted. The only way to know is to test your particular printer. If you *do* know, go ahead and invert the correct axes. +13. Open the `Marlin/Marlin.ino` file in Arduino IDE. +14. From the **Sketch** menu, select **File** > **Export Compiled Binary**. +15. When compilation is done you've built the firmware. The next stage is to flash it to the board. To do this look for a line like this: `"path/to/bin/arm-none-eabi-objcopy" -O binary "/path/to/Marlin.ino.elf" "/path/to/Marlin.ino.bin"` + The file `Marlin.ino.bin` is your firmware binary. M200 (v1-3) and M300 printers require flashing via SD card. Use the SD card that came with the printer if possible. The bootloader is very picky about SD cards. Copy `Marlin.ino.bin` to your SD card under three names: `firmware.bin`, `update.bin`, and `fcupdate.flg`. +16. Insert the SD card into your printer. Make sure the X and Y axes are centered in the middle of the bed. (When X and Y endstops are closed this signals a UI upgrade to the bootloader.) +17. Power-cycle the printer. The first flash may take longer. Don't be surprised if the .99 version number doesn't show up until after the UI has launched the default screen. +18. Remove the SD card and delete the `fcupdate.flg` file from the card to prevent an accidental re-flash. +19. Test the endstops and homing directions, run M303 PID autotune, and verify all features are working correctly. + +Welcome to Marlin 2.x... diff --git a/config/examples/Micromake/C1/basic/Configuration.h b/config/examples/Micromake/C1/basic/Configuration.h index 936fd7292909..f1a72ea51cbd 100644 --- a/config/examples/Micromake/C1/basic/Configuration.h +++ b/config/examples/Micromake/C1/basic/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(MetalSearch, Micromake C1 factory settings)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MAKEBOARD_MINI #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Micromake C1" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,7 +716,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // choose your micro step per step configuration ( 16 factory settings ) #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 100, 150 } // 16 steps per unit for Micromake C1 - Factory Settings - ( MS1 : closed ; MS2 : closed on MAKEBOARD Mini) @@ -719,18 +727,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 200, 30 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 3000, 4000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -744,35 +762,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -886,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -902,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -939,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1197,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1256,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1517,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1527,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1573,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1685,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1912,31 +1924,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1970,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1980,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2005,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2016,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2122,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2162,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Micromake/C1/README.md b/config/examples/Micromake/C1/basic/README.md similarity index 100% rename from config/examples/Micromake/C1/README.md rename to config/examples/Micromake/C1/basic/README.md diff --git a/config/examples/Micromake/C1/enhanced/Configuration.h b/config/examples/Micromake/C1/enhanced/Configuration.h index e16c1ba62dc8..d81d75540e48 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/config/examples/Micromake/C1/enhanced/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(MetalSearch, Micromake C1 enhanced)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MAKEBOARD_MINI #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Micromake C1" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,7 +716,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // choose your micro step per step configuration ( 16 factory settings ) //#define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 100, 150 } // 16 steps per unit for Micromake C1 - Factory Settings - ( MS1 : closed ; MS2 : closed on MAKEBOARD Mini) @@ -719,18 +727,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 200, 30 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 3000, 4000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -744,35 +762,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -886,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -902,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -939,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1197,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1256,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1517,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1527,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1573,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1685,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1912,31 +1924,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1970,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1980,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2005,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2016,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2122,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2162,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/config/examples/Micromake/C1/enhanced/Configuration_adv.h index 912af92621b9..e475887e4878 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Micromake/C1/enhanced/README.md b/config/examples/Micromake/C1/enhanced/README.md new file mode 100644 index 000000000000..0111f6f00a0e --- /dev/null +++ b/config/examples/Micromake/C1/enhanced/README.md @@ -0,0 +1,15 @@ +# Micromake C1 + +### In the folder "basic" +Configuration files for Micromake C1 without mods + - English LCD 2X16 Characters + - Motors 16 STEPS + - No heated bed + - No probe, etc. + - Like a standard C1 as shipped by Micromake. + +### In the folder "enhanced" +Configuration files for Micromake C1 with… + - 128 STEPS configured with jumper on the motherboard (all open for 128 Steps). + - Capacitive Probe (Adjust offsets at your convenience) + - French language with no accents for Japanese LCD. diff --git a/config/examples/Mks/Robin/Configuration.h b/config/examples/Mks/Robin/Configuration.h index 96a6bb7fbdd7..2942690a4317 100644 --- a/config/examples/Mks/Robin/Configuration.h +++ b/config/examples/Mks/Robin/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -130,18 +129,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_ROBIN #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "MKS Robin" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -278,7 +275,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -322,9 +326,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -349,17 +354,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -371,13 +379,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -395,8 +405,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -515,7 +523,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -709,25 +717,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -741,35 +759,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -883,11 +904,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -899,10 +919,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -936,7 +956,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1194,12 +1214,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1253,19 +1267,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1514,7 +1515,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1524,8 +1525,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1570,10 +1574,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1683,6 +1687,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1910,31 +1922,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1968,6 +1961,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1978,16 +2006,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2003,6 +2029,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2014,27 +2046,41 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -#define MKS_ROBIN_TFT +#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 75 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 100 // (ms) Button repeat delay for menus + + /* MKS Robin TFT v2.0 */ + #define XPT2046_X_CALIBRATION 12013 + #define XPT2046_Y_CALIBRATION -8711 + #define XPT2046_X_OFFSET -32 + #define XPT2046_Y_OFFSET 256 + + /* MKS Robin TFT v1.1 */ + //#define XPT2046_X_CALIBRATION -11792 + //#define XPT2046_Y_CALIBRATION 8947 + //#define XPT2046_X_OFFSET 342 + //#define XPT2046_Y_OFFSET -19 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2120,8 +2166,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2160,7 +2208,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Mks/Robin/Configuration_adv.h b/config/examples/Mks/Robin/Configuration_adv.h index 354fcb95c3a6..c331b85bc0a9 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Mks/Robin_Lite3/Configuration.h b/config/examples/Mks/Robin_Lite3/Configuration.h new file mode 100644 index 000000000000..ae5644deaf0e --- /dev/null +++ b/config/examples/Mks/Robin_Lite3/Configuration.h @@ -0,0 +1,2218 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +//#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT -1 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//MKS Robin Lite3 AUX-1 and USB Use UART1(PA9-TX,PA10-RX) #define SERIAL_PORT_2 1 +//MKS Robin Pro USB Use UART3(PB10-TX,PB11-RX) #define SERIAL_PORT_2 3 +//MKS RUMBA32 AUX-1 Use UART1(PA9-TX,PA10-RX) #define SERIAL_PORT_2 1 +//MKS SBASE AUX-1 Use UART0(P0.2-TXD0,P0.3-RXD0) #define SERIAL_PORT_2 0 +//MKS SGEN AUX-1 Use UART0(P0.2-TXD0,P0.3-RXD0) #define SERIAL_PORT_2 0 +//MKS SGEN_L AUX-1 Use UART0(P0.2-TXD0,P0.3-RXD0) #define SERIAL_PORT_2 0 +//MKS Robin Nano USB Use UART3(PB10-TX,PB11-RX) #define SERIAL_PORT_2 3 +#define SERIAL_PORT_2 1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_MKS_ROBIN_LITE3 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 3.0 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Ultimaker + #define DEFAULT_Kp 22.2 + #define DEFAULT_Ki 1.08 + #define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 3000 // 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 + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 200 +#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 Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 200 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Mks/Robin_Lite3/ReadMe.txt b/config/examples/Mks/Robin_Lite3/ReadMe.txt new file mode 100644 index 000000000000..d8919f43cd55 --- /dev/null +++ b/config/examples/Mks/Robin_Lite3/ReadMe.txt @@ -0,0 +1,5 @@ +1. MKS Robin Lite3 is a powerful 32-bit 3D printer control board with STM32F103RCT6. +2. Support Marlin2.0. +3. Support MKS LCD12864B/MINI12864/LCD2004/12864 and MKS TFT Touch Screens. +4. The main board integrates 5 AXIS interface, BLTOUCH interface, hot bed, 2 heating heads, 3 NTC100K and LCD screen SD card supports firmware update. +https://www.aliexpress.com/item/4000295949948.html?spm=2114.12010615.8148356.1.596183361yB18D diff --git a/config/examples/Mks/Robin_Pro/Configuration.h b/config/examples/Mks/Robin_Pro/Configuration.h new file mode 100644 index 000000000000..98a23ab47b39 --- /dev/null +++ b/config/examples/Mks/Robin_Pro/Configuration.h @@ -0,0 +1,2217 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT -1 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//MKS Robin Lite3 AUX-1 and USB Use UART1(PA9-TX,PA10-RX) #define SERIAL_PORT_2 1 +//MKS Robin Pro USB Use UART3(PB10-TX,PB11-RX) #define SERIAL_PORT_2 3 +//MKS SBASE AUX-1 Use UART0(P0.2-TXD0,P0.3-RXD0) #define SERIAL_PORT_2 0 +//MKS SGEN AUX-1 Use UART0(P0.2-TXD0,P0.3-RXD0) #define SERIAL_PORT_2 0 +//MKS SGEN_L AUX-1 Use UART0(P0.2-TXD0,P0.3-RXD0) #define SERIAL_PORT_2 0 +//MKS Robin Nano USB Use UART3(PB10-TX,PB11-RX) #define SERIAL_PORT_2 3 +#define SERIAL_PORT_2 3 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_MKS_ROBIN_PRO +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 3.0 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Ultimaker + #define DEFAULT_Kp 22.2 + #define DEFAULT_Ki 1.08 + #define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 3000 // 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 + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 200 +#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 Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 200 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Mks/Robin_Pro/ReadMe.txt b/config/examples/Mks/Robin_Pro/ReadMe.txt new file mode 100644 index 000000000000..8d5241b5d0e6 --- /dev/null +++ b/config/examples/Mks/Robin_Pro/ReadMe.txt @@ -0,0 +1,4 @@ +1. MKS Robin Pro is a powerful 32-bit 3D printer control board with STM32F103ZET6. +2. Support Marlin2.0. Support LCD2004/12864 and MKS Robin TFT24/28/32... Screens. +3. The motherboard integrates 6 AXIS interface, BLTOUCH interface, hot bed, 3 heating heads, 4 NTC100K, 2 MAX31855, integrates SPI / UART interface and works with MKS TMC2130/TMC2208 V2.0/TMC +https://www.aliexpress.com/item/4000444286159.html?spm=2114.12010615.8148356.1.4158721an5TnW9 diff --git a/config/examples/Mks/Sbase/Configuration.h b/config/examples/Mks/Sbase/Configuration.h index f004854d6c16..9826be5512ca 100644 --- a/config/examples/Mks/Sbase/Configuration.h +++ b/config/examples/Mks/Sbase/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_SBASE #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,9 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - #define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + #define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +352,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +377,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +403,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -514,7 +521,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +715,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 200, 200, 800, 280 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +757,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +902,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +917,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 32 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 32, 5, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +954,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1212,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1265,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1513,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1523,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1572,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1684,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1919,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1958,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2003,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2026,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2043,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2156,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2198,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Mks/Sbase/Configuration_adv.h b/config/examples/Mks/Sbase/Configuration_adv.h index 7f21aef03eaa..7b34655886dd 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +891,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -850,8 +914,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -865,6 +956,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -876,23 +979,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -925,8 +1011,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1006,17 +1095,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1038,7 +1141,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1131,14 +1234,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1169,7 +1372,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1218,6 +1422,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1278,7 +1518,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1290,7 +1530,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1365,6 +1606,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1422,19 +1666,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1508,8 +1752,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1637,81 +1881,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1750,6 +2014,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1841,17 +2108,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1866,8 +2145,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1889,8 +2172,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1921,7 +2204,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1929,7 +2212,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1937,7 +2220,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1945,7 +2228,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1953,7 +2236,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1961,7 +2244,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1969,7 +2252,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1977,7 +2260,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1985,7 +2268,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1993,7 +2276,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2001,7 +2284,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2009,7 +2292,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2017,7 +2300,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2222,6 +2505,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2276,6 +2566,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2333,9 +2630,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2417,6 +2717,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2435,6 +2751,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Mks/Sbase/000-README_RepRap_Discount_Full_Graphic_Smart_Controller.txt b/config/examples/Mks/Sbase/README.txt similarity index 100% rename from config/examples/Mks/Sbase/000-README_RepRap_Discount_Full_Graphic_Smart_Controller.txt rename to config/examples/Mks/Sbase/README.txt diff --git a/config/examples/Modix/Big60/Configuration.h b/config/examples/Modix/Big60/Configuration.h new file mode 100644 index 000000000000..4d1d3fb3b9b9 --- /dev/null +++ b/config/examples/Modix/Big60/Configuration.h @@ -0,0 +1,2210 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "3DXtech" // Who made the changes. +#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_MKS_GEN_L +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "ModixBig60" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + + //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#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_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 315 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // 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 59.50 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING 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 X_MAX_ENDSTOP_INVERTING false // 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 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 200, 100, 2000, 418.50 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 200, 200, 5, 70 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 2000, 2000, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.06 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -34, 26, 0 } + +// 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 5000 + +// Feedrate (mm/m) 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 +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 -3 // 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 + +// Enable the M48 repeatability test to test probe accuracy +#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 600 +#define Y_BED_SIZE 600 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 600 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +#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 true // Set to true to invert the logic of the sensor. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + #define FILAMENT_RUNOUT_DISTANCE_MM 100 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 GRID_MAX_POINTS_X 15 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #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 0.0 // 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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + #define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + #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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (6*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 50), (Y_MIN_POS + 50), 10 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Modix/Big60/Configuration_adv.h b/config/examples/Modix/Big60/Configuration_adv.h new file mode 100644 index 000000000000..cd73548cda2d --- /dev/null +++ b/config/examples/Modix/Big60/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 10 // Degrees Celsius + + #define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + #define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 40 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + #define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + #define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + #define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #define LIN_ADVANCE_K 0.0 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 3 // (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 50 // (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 25 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + #define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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 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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + #define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Modix/Big60/_Bootscreen.h b/config/examples/Modix/Big60/_Bootscreen.h new file mode 100644 index 000000000000..6285bcd1a464 --- /dev/null +++ b/config/examples/Modix/Big60/_Bootscreen.h @@ -0,0 +1,91 @@ +/** + * 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 . + * + */ +#pragma once + +#define CUSTOM_BOOTSCREEN_BMPWIDTH 128 + +const unsigned char custom_start_bmp[] PROGMEM = { + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11100111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01110001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111000,B00000000,B10000111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00001100,B00000000,B10000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00001100,B00000000,B10000001,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00001100,B00000110,B00000000,B10000000,B11100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00011000,B00000110,B00000000,B10000000,B01101111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00011100,B00111000,B00000010,B00000000,B10000000,B00111100,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00011111,B00110000,B00000011,B00000000,B11000000,B00111100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01110111,B10110000,B00000010,B11111111,B01100000,B00111100,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B11100000,B11111000,B00000110,B11111111,B10110000,B00111100,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B11000000,B11011000,B00001101,B10000001,B10011000,B00011100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000011,B10000000,B11011000,B00001001,B10000000,B11011100,B11111100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000010,B00000000,B11011000,B00011011,B00000000,B01101111,B11100100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000010,B00000000,B11011111,B11111011,B00000000,B00110111,B00000110,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000110,B00000000,B11100111,B11110110,B00000000,B00011000,B00000011,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000110,B00000000,B11100000,B00001110,B00000000,B00011000,B00001111,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000110,B00000000,B11000000,B00101110,B00000000,B00011011,B11111111,B11000110,B00000000,B00000000,B00000000,B00000000,B00000000, + B00111111,B11111100,B00011111,B11110110,B01111101,B10000001,B11100110,B00000000,B00011011,B11000111,B11000110,B00000000,B00000000,B00000000,B00000000,B00000000, + B01111111,B11111110,B00111111,B11111111,B00011111,B10001111,B11000011,B11111111,B11111111,B11111111,B11111100,B00011111,B11111111,B00111000,B00000011,B11000000, + B11111111,B11111111,B11111111,B11111111,B10001111,B00011111,B11000111,B11111111,B11111111,B11111111,B11111000,B11111111,B11111111,B00111100,B00000011,B11100000, + B00010000,B00001111,B11110000,B00001111,B10001111,B11111111,B10000011,B11111111,B11110111,B11111111,B11111000,B11111111,B11111100,B00111100,B00000011,B11100000, + B00000000,B00001111,B11110000,B00000111,B11111111,B11111111,B00000001,B10011110,B00100111,B11111100,B11000010,B11111000,B00000000,B00111110,B00000011,B11100000, + B00001111,B11111111,B11110000,B00000011,B11011111,B11111110,B00000001,B11001110,B01101100,B11111100,B01000111,B11111000,B00000000,B00111111,B11111111,B11100000, + B00011111,B11111111,B11110000,B00000011,B11000011,B11111100,B00000000,B11111111,B11001100,B11111111,B11111111,B11110000,B00000000,B00111111,B11111111,B11100000, + B00011111,B11111111,B11110000,B00000011,B11000011,B11111100,B00000000,B00001110,B00011100,B11111111,B11111001,B11100000,B00000000,B00111111,B11111111,B11100000, + B00000000,B00001111,B11110000,B00001111,B11000111,B11111100,B00000000,B00001110,B00011100,B11111111,B11110001,B11100000,B00000000,B00111111,B11111111,B11100000, + B00000000,B00001111,B11111000,B00001111,B10000111,B11111110,B00000000,B00001110,B00001100,B11111000,B11110000,B11110000,B00000000,B00111100,B00000011,B11100000, + B01111111,B11111111,B11111111,B11111111,B10111111,B10001111,B00000000,B00111111,B11100110,B11111000,B11100000,B11111100,B00000000,B00111100,B00000011,B11100000, + B01111111,B11111111,B11111111,B11111111,B11111111,B00000111,B11000000,B11111111,B11100111,B11111111,B11111100,B11111111,B11111111,B00111100,B00000011,B11100000, + B11111111,B11111111,B11111111,B11111111,B11111110,B00000011,B11100000,B10001110,B00110011,B11111111,B11111100,B00011111,B11111111,B00111100,B00000011,B11100000, + B01111111,B11111100,B00111111,B11110000,B00111100,B00000001,B11110001,B10011110,B00110001,B11111111,B11111001,B00001111,B11111110,B00111100,B00000011,B11000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00011001,B11111111,B11000001,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00001100,B11100000,B11000001,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000000,B00001100,B00000000,B01000010,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000000,B00000110,B00000001,B01100010,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001100,B00000000,B00000110,B00111111,B01100010,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001110,B00000000,B00001101,B11111101,B11101110,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11100110,B00000000,B00011001,B10000001,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B11101111,B11110111,B00000000,B00011011,B00000001,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B11000000,B00110011,B00000000,B00110011,B00000001,B11001000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B10000000,B00011011,B00000000,B00110110,B00000001,B10011000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000001,B10000000,B00001101,B11111111,B11101100,B00000001,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000001,B00000000,B00001110,B11111111,B11011000,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B11110001,B10000000,B00000110,B01100000,B00111000,B00000111,B10100000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B11111101,B10000000,B00000011,B00000000,B00011000,B00000101,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B10001111,B11000000,B00000110,B11111111,B11011100,B00001010,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B10000001,B11100000,B00001100,B11111111,B11001100,B00011111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B10000001,B11110000,B00001101,B10000000,B01101100,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B11111110,B00011011,B00000000,B01100111,B10001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11110110,B00000000,B00100000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00010000,B00110000,B01101110,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000100,B00110000,B00001110,B00000000,B11111111,B10100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000011,B00110000,B00000110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000001,B11110000,B00000011,B00000011,B11100010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B10001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, +}; diff --git a/config/examples/Modix/Big60/_Statusscreen.h b/config/examples/Modix/Big60/_Statusscreen.h new file mode 100644 index 000000000000..e9ee8b9857f6 --- /dev/null +++ b/config/examples/Modix/Big60/_Statusscreen.h @@ -0,0 +1,60 @@ +/** + * 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 . + * + */ +#pragma once + +#define STATUS_LOGO_Y 1 +#define STATUS_LOGO_WIDTH 32 + +const unsigned char status_logo_bmp[] PROGMEM = { + B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00010000,B00000000, + B00000000,B00000000,B00000110,B00000000, + B00000000,B00000000,B00000000,B00000000, + B00000001,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000001,B00000000, + B00000001,B00000000,B01000001,B00000000, + B00000001,B00000000,B00000010,B00000000, + B00000000,B11100000,B00000000,B00000000, + B10000000,B00001000,B00010000,B10000000, + B00000100,B00000000,B00000000,B01000000, + B00001000,B00000000,B00001000,B00000000, + B00010000,B00000100,B00000000,B00000000, + B00000000,B00000000,B00000000,B00110000, + B00000000,B00000000,B00000000,B00100000, + B00000000,B00000001,B11101000,B00100000, + B00000000,B00000000,B00000000,B01100000, + B00000000,B00000000,B00000010,B00000000, + B00000000,B00001000,B00000000,B00000000, + B00000000,B00000000,B00000001,B00100000, + B00000010,B11101000,B00010000,B01100000, + B00000000,B00000000,B00000000,B01000000, + B00000000,B00000011,B11000000,B01100000, + B01100100,B00000000,B00010000,B00000000, + B00000100,B00000011,B11000000,B00000000, + B00000010,B00000000,B00100000,B00000000, + B00000000,B00101000,B00000000,B00000000, + B00000000,B00001000,B00100000,B00000000, + B00000000,B00000000,B01000000,B00000000, + B00000000,B00000000,B00000000,B00000000 +}; diff --git a/config/examples/Printrbot/PrintrboardG2/Configuration.h b/config/examples/Printrbot/PrintrboardG2/Configuration.h index 7dbe27cd2708..ff0d5ff411b0 100644 --- a/config/examples/Printrbot/PrintrboardG2/Configuration.h +++ b/config/examples/Printrbot/PrintrboardG2/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -104,7 +103,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 0 +#define SERIAL_PORT -1 /** * Select a secondary serial port on the board to use for communication with the host. @@ -130,18 +129,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_PRINTRBOARD_G2 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -278,7 +275,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -322,9 +326,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -349,17 +354,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -371,13 +379,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -395,8 +405,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -515,7 +523,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -709,7 +717,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 80, 80 } @@ -717,20 +725,30 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } #define DEFAULT_MAX_FEEDRATE { 30, 30,30,30 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ //#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } #define DEFAULT_MAX_ACCELERATION { 100, 100, 100, 100 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -739,44 +757,44 @@ * M204 R Retract Acceleration * M204 T Travel Acceleration */ -//#define DEFAULT_ACCELERATION 3000 // 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 #define DEFAULT_ACCELERATION 100 // X, Y, Z and E acceleration for printing moves #define DEFAULT_RETRACT_ACCELERATION 100 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 100 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 1.0 #define DEFAULT_YJERK 1.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.004 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -890,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +923,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +960,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1218,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1271,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1521,7 +1519,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1531,8 +1529,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1577,10 +1578,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1689,6 +1690,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1916,31 +1925,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1974,6 +1964,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1984,16 +2009,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2009,6 +2032,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2020,27 +2049,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2128,6 +2164,8 @@ #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) #define NEOPIXEL_PIN 20 // LED driving pin #define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) #define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2166,7 +2204,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RapideLite/RL200/Configuration.h b/config/examples/RapideLite/RL200/Configuration.h index ded24473d29d..c66827b97a83 100644 --- a/config/examples/RapideLite/RL200/Configuration.h +++ b/config/examples/RapideLite/RL200/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(platon42)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RL200 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Rapide Lite 200" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 157, 157, 800, 195 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RapideLite/RL200/Configuration_adv.h b/config/examples/RapideLite/RL200/Configuration_adv.h index ab597a258b19..9e24c92a7838 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Renkforce/RF100/Configuration.h b/config/examples/Renkforce/RF100/Configuration.h new file mode 100644 index 000000000000..7af92053b629 --- /dev/null +++ b/config/examples/Renkforce/RF100/Configuration.h @@ -0,0 +1,2219 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_RAMPS_14_EFB +#endif + +#define FAN_PIN -1 +#define KILL_PIN 64 + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "RF100" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Renkforce RF100 + #define DEFAULT_Kp 19.0 + #define DEFAULT_Ki 1.30 + #define DEFAULT_Kd 70.1 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING 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_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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 78.82, 78.82, 800, 115 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 20, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 105 +#define Y_BED_SIZE 110 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 105 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 230 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Renkforce/RF100/Configuration_adv.h b/config/examples/Renkforce/RF100/Configuration_adv.h new file mode 100644 index 000000000000..7fade8767799 --- /dev/null +++ b/config/examples/Renkforce/RF100/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN 9 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 100 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 100 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 10 + //#define PROBE_PT_2_X 90 + //#define PROBE_PT_2_Y 10 + //#define PROBE_PT_3_X 55 + //#define PROBE_PT_3_Y 100 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 0 + +/** + * 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Renkforce/RF100XL/Configuration.h b/config/examples/Renkforce/RF100XL/Configuration.h new file mode 100644 index 000000000000..30816dfb8494 --- /dev/null +++ b/config/examples/Renkforce/RF100XL/Configuration.h @@ -0,0 +1,2219 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_RAMPS_14_EFB +#endif + +#define FAN_PIN -1 +#define KILL_PIN 64 + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "RF100" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Renkforce RF100 + #define DEFAULT_Kp 19.0 + #define DEFAULT_Ki 1.30 + #define DEFAULT_Kd 70.1 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING 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_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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 78.82, 78.82, 800, 115 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 20, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 200 +#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 Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 200 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 230 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Renkforce/RF100XL/Configuration_adv.h b/config/examples/Renkforce/RF100XL/Configuration_adv.h new file mode 100644 index 000000000000..7fade8767799 --- /dev/null +++ b/config/examples/Renkforce/RF100XL/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN 9 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 100 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 100 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 10 + //#define PROBE_PT_2_X 90 + //#define PROBE_PT_2_Y 10 + //#define PROBE_PT_3_X 55 + //#define PROBE_PT_3_Y 100 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 0 + +/** + * 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Renkforce/RF100v2/Configuration.h b/config/examples/Renkforce/RF100v2/Configuration.h new file mode 100644 index 000000000000..571324709c05 --- /dev/null +++ b/config/examples/Renkforce/RF100v2/Configuration.h @@ -0,0 +1,2219 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 115200 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_RAMPS_14_EFB +#endif + +#define FAN_PIN -1 +#define KILL_PIN 64 + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "RF100" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Renkforce RF100 + #define DEFAULT_Kp 19.0 + #define DEFAULT_Ki 1.30 + #define DEFAULT_Kd 70.1 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 false // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING 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_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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 78.82, 78.82, 800, 115 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 20, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 120 +#define Y_BED_SIZE 120 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 120 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 230 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Renkforce/RF100v2/Configuration_adv.h b/config/examples/Renkforce/RF100v2/Configuration_adv.h new file mode 100644 index 000000000000..7fade8767799 --- /dev/null +++ b/config/examples/Renkforce/RF100v2/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN 9 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 100 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 100 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 10 + //#define PROBE_PT_2_X 90 + //#define PROBE_PT_2_Y 10 + //#define PROBE_PT_3_X 55 + //#define PROBE_PT_3_Y 100 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 0 + +/** + * 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/RepRapPro/Huxley/Configuration.h b/config/examples/RepRapPro/Huxley/Configuration.h index 11f5e394abde..6a9c7830fc53 100644 --- a/config/examples/RepRapPro/Huxley/Configuration.h +++ b/config/examples/RepRapPro/Huxley/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(indazoo, Huxley v1)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_SANGUINOLOLU_12 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Huxley" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -747,26 +755,36 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { XY_STEPS, XY_STEPS, Z_STEPS, E_STEPS } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_Z_FEEDRATE 3.3 // older Huxley has problem with speeds > 3.3 mm/s on Z axis #define DEFAULT_MAX_FEEDRATE { 200, 200, DEFAULT_MAX_Z_FEEDRATE, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 50, 1000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -780,35 +798,38 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -922,11 +943,10 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -938,10 +958,10 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -975,7 +995,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1242,12 +1262,6 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1301,19 +1315,6 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1562,7 +1563,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1572,8 +1573,11 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1618,10 +1622,10 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1730,6 +1734,14 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1957,31 +1969,12 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2015,6 +2008,41 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2025,16 +2053,14 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2050,6 +2076,12 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2061,27 +2093,34 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2167,8 +2206,10 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2207,7 +2248,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RepRapWorld/Megatronics/Configuration.h b/config/examples/RepRapWorld/Megatronics/Configuration.h index 354f62b614ec..5fa11ecc98e3 100644 --- a/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "RepRapWorld.com" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MEGATRONICS_3 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 78.7402*2, 78.7402*2, 5120.00, 760*1*1.5 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RigidBot/Configuration.h b/config/examples/RigidBot/Configuration.h index 74db97820b8e..e99f731768d4 100644 --- a/config/examples/RigidBot/Configuration.h +++ b/config/examples/RigidBot/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, RigidBot)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,8 +128,7 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup // for Rigidbot version 1 : #define MOTHERBOARD BOARD_RIGIDBOARD // for Rigidbot Version 2 : #define MOTHERBOARD BOARD_RIGIDBOARD_V2 @@ -138,12 +136,11 @@ #define MOTHERBOARD BOARD_RIGIDBOARD_V2 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Rigidbot" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -280,7 +277,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -324,9 +328,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -351,17 +356,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -373,13 +381,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -397,8 +407,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 // DGlass3D = 5; RigidBot = 1; 3DSv6 = 5 #define TEMP_SENSOR_1 0 @@ -517,7 +525,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //RigidBot, from pid autotune @@ -704,7 +712,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // default steps per unit for RigidBot with standard hardware #define DEFAULT_AXIS_STEPS_PER_UNIT { 44.3090, 22.1545, 1600, 53.5 } @@ -713,18 +721,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 800, 800, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -738,35 +756,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.0 #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.043 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -880,11 +901,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -896,10 +916,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -933,7 +953,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1191,12 +1211,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1250,19 +1264,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1511,7 +1512,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1521,8 +1522,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1567,10 +1571,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1679,6 +1683,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RigidBot/Configuration_adv.h b/config/examples/RigidBot/Configuration_adv.h index b3c2379d58fb..df7c45cb145f 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ #define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - #define CONTROLLER_FAN_PIN 4 // 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 + #define CONTROLLER_FAN_PIN 4 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/SCARA/MP_SCARA/Configuration.h b/config/examples/SCARA/MP_SCARA/Configuration.h new file mode 100644 index 000000000000..598774991d45 --- /dev/null +++ b/config/examples/SCARA/MP_SCARA/Configuration.h @@ -0,0 +1,2245 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== + +/** + * MORGAN_SCARA was developed by QHARLEY in South Africa in 2012-2013. + * Implemented and slightly reworked by JCERNY in June, 2014. + */ +//#define MORGAN_SCARA + +/** + * Mostly Printed SCARA is an open source design by Tyler Williams. See: + * https://www.thingiverse.com/thing:2487048 + * https://www.thingiverse.com/thing:1241491 + */ +#define MP_SCARA + +#if EITHER(MORGAN_SCARA, MP_SCARA) + // If movement is choppy try lowering this value + #define SCARA_SEGMENTS_PER_SECOND 200 + + // Length of inner and outer support arms. Measure arm lengths precisely. + #define SCARA_LINKAGE_1 98.41 // (mm) + #define SCARA_LINKAGE_2 100.66 // (mm) + + // SCARA tower offset (position of Tower relative to bed zero position) + // This needs to be reasonably accurate as it defines the printbed position in the SCARA space. + #define SCARA_OFFSET_X 0 // (mm) + #define SCARA_OFFSET_Y 0 // (mm) + + #if ENABLED(MORGAN_SCARA) + + //#define DEBUG_SCARA_KINEMATICS + #define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly + + // Radius around the center where the arm cannot reach + #define MIDDLE_DEAD_ZONE_R 0 // (mm) + + #define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See http://reprap.harleystudio.co.za/?page_id=1073 + #define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See http://reprap.harleystudio.co.za/?page_id=1073 + + #elif ENABLED(MP_SCARA) + + #define SCARA_OFFSET_THETA1 12 // degrees + #define SCARA_OFFSET_THETA2 131 // degrees + + #endif + +#endif + +//=========================================================================== +//==================== END ==== SCARA Printer ==== END ====================== +//=========================================================================== + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_RAMPS_14_EFB +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "SCARA" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 3.0 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + + //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * 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 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 3 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_HYSTERESIS 2 // (°C) Temperature proximity considered "close enough" to the target +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer + +#define TEMP_BED_RESIDENCY_TIME 0 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 20 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // Merlin Hotend: From Autotune + #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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //12v Heatbed Mk3 12V in parallel + //from pidautotune + #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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 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 true // 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 28.6738351, 28.6738351, 1600, 93 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 2.5, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_ACCELERATION { 1000, 1000, 10, 20000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 5.0 + #define DEFAULT_YJERK 5.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 3.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.025 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR 1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 200 +#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 Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS X_BED_SIZE +#define Z_MAX_POS 100 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +#define MANUAL_X_HOME_POS 0 +#define MANUAL_Y_HOME_POS 199.07 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (20*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +//#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// LulzBot Color Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define LULZBOT_TOUCH_UI + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/SCARA/Configuration_adv.h b/config/examples/SCARA/MP_SCARA/Configuration_adv.h similarity index 88% rename from config/examples/SCARA/Configuration_adv.h rename to config/examples/SCARA/MP_SCARA/Configuration_adv.h index 3a47fef12fa8..6e41ccdc4a13 100644 --- a/config/examples/SCARA/Configuration_adv.h +++ b/config/examples/SCARA/MP_SCARA/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -601,8 +652,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -619,7 +670,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +697,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 10*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full //#define SLOWDOWN @@ -737,8 +776,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +874,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 10*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +897,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -875,23 +950,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,6 +984,7 @@ #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 + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1064,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1110,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1203,87 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Lulzbot Touch UI +// +#if ENABLED(LULZBOT_TOUCH_UI) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // Enable UTF8 rendering capabilities. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #endif + + // When labels do not fit buttons, use smaller font + #define TOUCH_UI_FIT_TEXT + + // Runtime language selection (otherwise LCD_LANGUAGE) + //#define TOUCH_UI_LANGUAGE_MENU + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1277,7 +1423,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1435,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1511,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1571,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 35 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 35 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1657,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1639,78 +1789,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1749,6 +1912,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2006,27 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2041,11 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -2221,6 +2400,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2461,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,10 +2525,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2416,6 +2605,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2639,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/SCARA/Configuration.h b/config/examples/SCARA/Morgan/Configuration.h similarity index 91% rename from config/examples/SCARA/Configuration.h rename to config/examples/SCARA/Morgan/Configuration.h index a563b4e2d6d6..5b5400d3e40d 100644 --- a/config/examples/SCARA/Configuration.h +++ b/config/examples/SCARA/Morgan/Configuration.h @@ -62,32 +62,45 @@ * MORGAN_SCARA was developed by QHARLEY in South Africa in 2012-2013. * Implemented and slightly reworked by JCERNY in June, 2014. */ - -// Specify the specific SCARA model #define MORGAN_SCARA -#if ENABLED(MORGAN_SCARA) - - //#define DEBUG_SCARA_KINEMATICS - #define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly +/** + * Mostly Printed SCARA is an open source design by Tyler Williams. See: + * https://www.thingiverse.com/thing:2487048 + * https://www.thingiverse.com/thing:1241491 + */ +//#define MP_SCARA +#if EITHER(MORGAN_SCARA, MP_SCARA) // If movement is choppy try lowering this value #define SCARA_SEGMENTS_PER_SECOND 200 // Length of inner and outer support arms. Measure arm lengths precisely. - #define SCARA_LINKAGE_1 150 //mm - #define SCARA_LINKAGE_2 150 //mm + #define SCARA_LINKAGE_1 150 // (mm) + #define SCARA_LINKAGE_2 150 // (mm) // SCARA tower offset (position of Tower relative to bed zero position) // This needs to be reasonably accurate as it defines the printbed position in the SCARA space. - #define SCARA_OFFSET_X 100 //mm - #define SCARA_OFFSET_Y -56 //mm + #define SCARA_OFFSET_X 100 // (mm) + #define SCARA_OFFSET_Y -56 // (mm) + + #if ENABLED(MORGAN_SCARA) + + //#define DEBUG_SCARA_KINEMATICS + #define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly + + // Radius around the center where the arm cannot reach + #define MIDDLE_DEAD_ZONE_R 0 // (mm) - // Radius around the center where the arm cannot reach - #define MIDDLE_DEAD_ZONE_R 0 //mm + #define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See http://reprap.harleystudio.co.za/?page_id=1073 + #define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See http://reprap.harleystudio.co.za/?page_id=1073 - #define THETA_HOMING_OFFSET 0 //calculatated from Calibration Guide and command M360 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073 - #define PSI_HOMING_OFFSET 0 //calculatated from Calibration Guide and command M364 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073 + #elif ENABLED(MP_SCARA) + + #define SCARA_OFFSET_THETA1 12 // degrees + #define SCARA_OFFSET_THETA2 131 // degrees + + #endif #endif @@ -97,13 +110,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -116,10 +125,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -156,18 +168,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "SCARA" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -304,7 +314,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -348,9 +365,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -375,17 +393,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -397,13 +418,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -421,8 +444,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -529,7 +550,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //12v Heatbed Mk3 12V in parallel @@ -717,25 +738,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 103.69, 106.65, 200/1.25, 1000 } // default steps per unit for SCARA /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 30, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 300, 300, 20, 1000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -749,35 +780,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 400 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 5.0 #define DEFAULT_YJERK 5.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 3.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.025 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -891,11 +925,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -907,10 +940,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -944,7 +977,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1202,12 +1235,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1261,19 +1288,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1522,7 +1536,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1532,8 +1546,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1578,10 +1595,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1690,6 +1707,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1917,31 +1942,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1975,6 +1981,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1985,16 +2026,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2010,6 +2049,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2021,27 +2066,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2127,8 +2179,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2167,7 +2221,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/SCARA/Morgan/Configuration_adv.h b/config/examples/SCARA/Morgan/Configuration_adv.h new file mode 100644 index 000000000000..8e6c7b337ae2 --- /dev/null +++ b/config/examples/SCARA/Morgan/Configuration_adv.h @@ -0,0 +1,2864 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 3000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #define EXTRUDER_RUNOUT_SPEED 180 // (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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// Homing hits each endstop, retracts by these distances, then does a slower bump. +#define X_HOME_BUMP_MM 3 +#define Y_HOME_BUMP_MM 3 +#define Z_HOME_BUMP_MM 3 +#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 240 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +//#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 10*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + //#define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 35 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + //#define USER_DESC_5 "Home & Info" + //#define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration.h b/config/examples/STM32/Black_STM32F407VET6/Configuration.h index 706db8c9a22d..ee646cde9f8c 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_BLACK_STM32F407VE #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 1 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ #define NUM_SERVOS 2 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300, 300 } diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h index 9af92091bd22..8afcd4ec6cd2 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/STM32/STM32F10/Configuration.h b/config/examples/STM32/STM32F103RE/Configuration.h similarity index 92% rename from config/examples/STM32/STM32F10/Configuration.h rename to config/examples/STM32/STM32F103RE/Configuration.h index 6e2a08abc86c..250237cd4b0a 100644 --- a/config/examples/STM32/STM32F10/Configuration.h +++ b/config/examples/STM32/STM32F103RE/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Victor Perez" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION "STM32F103RET6 board" // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_STM32F1R + #define MOTHERBOARD BOARD_STM32F103RE #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CTC i3 Pro B" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #warning temp_sensor set to 998/999 (fake) #define TEMP_SENSOR_0 999 @@ -515,7 +523,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -710,25 +718,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 78.74, 78.74, 2560, 105.0 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 2, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1400, 1400, 100, 80000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -742,35 +760,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 13.0 #define DEFAULT_YJERK 13.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.048 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -884,11 +905,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -900,10 +920,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -937,7 +957,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1195,12 +1215,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1254,19 +1268,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1515,7 +1516,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1525,8 +1526,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1571,10 +1575,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1683,6 +1687,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1910,31 +1922,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1968,6 +1961,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1978,16 +2006,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2003,6 +2029,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2014,27 +2046,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2120,8 +2159,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2160,7 +2201,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/STM32/STM32F4/Configuration.h b/config/examples/STM32/STM32F4/Configuration.h index 92715a362cce..7628d3dcd9c3 100644 --- a/config/examples/STM32/STM32F4/Configuration.h +++ b/config/examples/STM32/STM32F4/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_STM32F4 + #define MOTHERBOARD BOARD_GENERIC_STM32F4 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/STM32/stm32f103ret6/Configuration.h b/config/examples/STM32/stm32f103ret6/Configuration.h index 607ca8cb4b58..e457962562ff 100644 --- a/config/examples/STM32/stm32f103ret6/Configuration.h +++ b/config/examples/STM32/stm32f103ret6/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Victor Perez" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION "STM32F103RET6 board" // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_STM32F1R + #define MOTHERBOARD BOARD_STM32F103RE #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "CTC i3 Pro B" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #warning temp_sensor set to 998/999 (fake) #define TEMP_SENSOR_0 999 @@ -515,7 +523,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -710,25 +718,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 78.74, 78.74, 2560, 105.0 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 2, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1400, 1400, 100, 80000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -742,35 +760,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 13.0 #define DEFAULT_YJERK 13.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.048 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -884,11 +905,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -900,10 +920,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -937,7 +957,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1195,12 +1215,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1254,19 +1268,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1515,7 +1516,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1525,8 +1526,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1571,10 +1575,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1683,6 +1687,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1910,31 +1922,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1968,6 +1961,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1978,16 +2006,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2003,6 +2029,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2014,27 +2046,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2120,8 +2159,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2160,7 +2201,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Sanguinololu/Configuration.h b/config/examples/Sanguinololu/Configuration.h index 38746e2b7db5..765d71572d67 100644 --- a/config/examples/Sanguinololu/Configuration.h +++ b/config/examples/Sanguinololu/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thinkyhead, Sanguinololu)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_SANGUINOLOLU_12 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Sanguinololu" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -739,25 +747,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { XY_STEPS, XY_STEPS, Z_STEPS, E_STEPS } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 8, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -771,35 +789,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -913,11 +934,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -929,10 +949,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -966,7 +986,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1224,12 +1244,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1283,19 +1297,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1544,7 +1545,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1554,8 +1555,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1600,10 +1604,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1712,6 +1716,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1939,31 +1951,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1997,6 +1990,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2007,16 +2035,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2032,6 +2058,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2043,27 +2075,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2149,8 +2188,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2189,7 +2230,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Sanguinololu/Configuration_adv.h b/config/examples/Sanguinololu/Configuration_adv.h index 27fcf3d2dc59..886f203e4bb2 100644 --- a/config/examples/Sanguinololu/Configuration_adv.h +++ b/config/examples/Sanguinololu/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Tevo/Michelangelo/Configuration.h b/config/examples/Tevo/Michelangelo/Configuration.h new file mode 100644 index 000000000000..5c1aeb7b7cd8 --- /dev/null +++ b/config/examples/Tevo/Michelangelo/Configuration.h @@ -0,0 +1,2216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Tevo Michelangelo)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_MKS_GEN_L +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Michelangelo" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 5 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 5 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 285 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + +// Tevo Michelangelo + #define DEFAULT_Kp 19.71 + #define DEFAULT_Ki 1.39 + #define DEFAULT_Kd 69.81 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 300 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80.165, 80.165, 399.2901, 408 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 60, 55 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 10000, 10000, 400, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 2000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 10000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 5000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 150 +#define Y_BED_SIZE 150 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -10 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 160 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (120*60) +#define HOMING_FEEDRATE_Z (30*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "PETG" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 WESTERN + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Tevo/Michelangelo/Configuration_adv.h b/config/examples/Tevo/Michelangelo/Configuration_adv.h new file mode 100644 index 000000000000..54d8bf3e656d --- /dev/null +++ b/config/examples/Tevo/Michelangelo/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN 7 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Tevo/Michelangelo/_Bootscreen.h b/config/examples/Tevo/Michelangelo/_Bootscreen.h new file mode 100644 index 000000000000..b3d74daf48c9 --- /dev/null +++ b/config/examples/Tevo/Michelangelo/_Bootscreen.h @@ -0,0 +1,83 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Made with Marlin Bitmap Converter + * http://marlinfw.org/tools/u8glib/converter.html + */ +#define CUSTOM_BOOTSCREEN_BMPWIDTH 128 + +const unsigned char custom_start_bmp[] PROGMEM = { + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111, + B00000000,B00000000,B00000000,B00001111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, + B00000000,B00000000,B00000000,B00111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, + B00000000,B00000000,B00000001,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111,B11111111, + B00000000,B00000000,B00000111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,B11111111, + B00000000,B00000000,B00011111,B11111111,B11111111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11111111,B11111111, + B00000000,B00000000,B01111111,B11111111,B11111111,B11111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,B11111111,B11111111, + B00000000,B00000011,B11111111,B11111111,B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111,B11111111,B11111111,B11111111, + B00000000,B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000111,B11111111,B11111111,B11111111,B11111111,B11111111, + B00000000,B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11100000,B00000000,B00000000,B00011111,B11111111,B11111111,B11111111,B11111111,B11111111, + B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,B00000000,B00000111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B11111111,B11111111,B11111111,B11111111,B00111111,B11111011,B11111111,B11110000,B00000011,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B11111111,B11111111,B11111111,B11111100,B00011111,B11111101,B11111111,B11111000,B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B11111111,B11111111,B11111111,B11111000,B00001111,B11111110,B11111111,B11111000,B01111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B11111111,B11111111,B11111111,B11110000,B00000011,B11111111,B01101111,B11011100,B01111111,B10111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B11111111,B11111111,B11111111,B11100000,B00000000,B00111111,B11100111,B11001110,B00000000,B00000011,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B11111111,B11111111,B11111111,B11000000,B00000000,B00001111,B11000111,B11000110,B00000000,B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B11111111,B11111111,B11111111,B11000000,B00000000,B00000011,B11100011,B11100000,B00000000,B00000001,B11111111,B11111111,B11000000,B11111111,B11111111,B11111111, + B11111111,B11111111,B11111111,B10000000,B00000000,B00000001,B11110011,B11100000,B00000000,B00000111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000, + B11111111,B11111111,B11111110,B00000000,B00000000,B00000000,B01110001,B11100000,B00000000,B00011111,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000, + B11111111,B11111111,B11111100,B00000000,B00000000,B00000000,B00110001,B11100000,B00000000,B00011111,B11111111,B11111100,B00000000,B00000000,B00000000,B00000000, + B11111111,B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000, + B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000, + B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11101110,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,B11101110,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001101,B11001110,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11001110,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001101,B11001110,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001101,B10000100,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111000,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,B01100000,B11000110,B00000000,B01110000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000, + B00000000,B00000000,B11110001,B11100110,B00000000,B01110000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000, + B00000000,B00000000,B11110001,B11100000,B00000000,B01110000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000, + B00000000,B00000000,B11111011,B11100000,B00000000,B01110000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000111,B00000000,B00000000,B00000000, + B00000000,B00000000,B11111111,B11100110,B00011111,B01110111,B00001111,B10001110,B11111100,B01111111,B00011111,B11100111,B11000111,B00011111,B00000000,B00000000, + B00000000,B00000000,B11111111,B11100110,B00111111,B01111111,B10011111,B11001110,B11111110,B01111111,B00111111,B11101111,B11100111,B00111111,B10000000,B00000000, + B00000000,B00000000,B11101110,B11100110,B01111011,B01111111,B10011000,B11001110,B11001110,B01111111,B10111101,B11101100,B01100111,B01111011,B11000000,B00000000, + B00000000,B00000000,B11101110,B11100110,B01110000,B01110011,B10111111,B11101110,B00111110,B01110011,B10110000,B11011111,B11110111,B01110001,B11000000,B00000000, + B00000000,B00000000,B11100100,B11100110,B01100000,B01110011,B10111111,B11101110,B11111110,B01110011,B10110000,B11011111,B11110111,B01110001,B11000000,B00000000, + B00000000,B00000000,B11100100,B11100110,B01100000,B01110011,B10011000,B00001110,B11001110,B01110011,B10110000,B11001100,B00000111,B01110001,B11000000,B00000000, + B00000000,B00000000,B11100000,B11100110,B01110000,B01110011,B10011000,B00001110,B11001110,B01110011,B10111001,B11001100,B00000111,B01110001,B11000000,B00000000, + B00000000,B00000000,B11100000,B11100110,B01111111,B01110011,B10011111,B11001110,B11111110,B01110011,B10111111,B11101111,B11100111,B01111111,B11000000,B00000000, + B00000000,B00000000,B11100000,B11100110,B00111111,B01110011,B10001111,B11001110,B11111110,B01110011,B10011111,B11100111,B11100111,B00111111,B10000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00001110,B00110001,B10000111,B00001100,B01110110,B01100011,B00111001,B11000011,B10000110,B00001110,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B10000000,B00000000,B00000000,B00000000,B00000000 +}; diff --git a/config/examples/Tevo/Tarantula Pro/Configuration.h b/config/examples/Tevo/Tarantula Pro/Configuration.h index 0995a15e69d6..dd3152e8033d 100644 --- a/config/examples/Tevo/Tarantula Pro/Configuration.h +++ b/config/examples/Tevo/Tarantula Pro/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Tevo Tarantula Pro)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_GEN_L #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Tarantula Pro" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -506,7 +514,7 @@ * 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. */ -#define PIDTEMPBED +//#define PIDTEMPBED //#define BED_LIMIT_SWITCHING @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -713,25 +721,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80.058, 80.058, 399.2901, 408 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 50, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -744,30 +762,39 @@ #define DEFAULT_RETRACT_ACCELERATION 10000 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves -// -// 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 - /** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -881,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -897,10 +923,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 18 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 18, -1.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -914,10 +940,17 @@ // Feedrate (mm/m) 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. -// Set to 2 for a fast/slow probe, using the second probe result. -// Set to 3 or more for slow probes, averaging the results. +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ //#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 /** * Z probes require clearance when deploying, stowing, and moving between @@ -927,7 +960,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1185,12 +1218,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1244,19 +1271,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1505,7 +1519,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1515,8 +1529,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1561,10 +1578,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1673,6 +1690,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1900,31 +1925,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1958,6 +1964,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1968,16 +2009,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1993,6 +2032,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2004,27 +2049,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2110,8 +2162,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2150,7 +2204,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h index 36b433ff4f1a..4a071c7cda3e 100755 --- a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h +++ b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) #define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,21 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -642,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -733,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -831,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -845,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -860,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -871,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -920,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1001,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1033,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1126,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1164,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1213,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1273,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1285,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1360,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1417,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1503,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1632,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1745,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1791,7 +2062,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V /** * Monitor Trinamic drivers for error conditions, @@ -1836,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1861,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1884,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1916,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1924,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1932,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1940,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1948,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1956,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1964,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1972,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1980,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1988,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -1996,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2004,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2012,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2217,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2271,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2328,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2412,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2430,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h new file mode 100644 index 000000000000..8e5147bf8f3a --- /dev/null +++ b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h @@ -0,0 +1,2216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Tevo Tornado V1)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_MKS_BASE_15 +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Tornado" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 5 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 5 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 285 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Tevo Tornado V1 + #define DEFAULT_Kp 20.37 + #define DEFAULT_Ki 1.50 + #define DEFAULT_Kd 69.26 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //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 128.82 + #define DEFAULT_bedKi 16.91 + #define DEFAULT_bedKd 245.36 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 600 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 79.765, 79.765, 399.2901, 400 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 250, 250, 30, 55 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 2000, 2000, 120, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 10000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 8.0 + #define DEFAULT_YJERK 8.0 + #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.026 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -45, -12, -2.77 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 320 +#define Y_BED_SIZE 300 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 400 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 WESTERN + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h new file mode 100755 index 000000000000..70aaebdfc54c --- /dev/null +++ b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN 7 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 75 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 160 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +//#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h new file mode 100644 index 000000000000..a72f84bbabc5 --- /dev/null +++ b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h @@ -0,0 +1,2216 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Tevo Tornado V2)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_MKS_GEN_L +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Tornado" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 5 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 5 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 285 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Tevo Tornado V2 + #define DEFAULT_Kp 20.37 + #define DEFAULT_Ki 1.50 + #define DEFAULT_Kd 69.26 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //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 128.82 + #define DEFAULT_bedKi 16.91 + #define DEFAULT_bedKd 245.36 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 600 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 79.765, 79.765, 399.2901, 400 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 250, 250, 30, 55 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 2000, 2000, 120, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 10000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 8.0 + #define DEFAULT_YJERK 8.0 + #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.026 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -45, -12, -2.77 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 320 +#define Y_BED_SIZE 300 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 400 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 WESTERN + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h new file mode 100755 index 000000000000..70aaebdfc54c --- /dev/null +++ b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN 7 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 75 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 160 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +//#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Tevo/Tornado/_Bootscreen.h b/config/examples/Tevo/Tornado/_Bootscreen.h new file mode 100644 index 000000000000..ebec255674e5 --- /dev/null +++ b/config/examples/Tevo/Tornado/_Bootscreen.h @@ -0,0 +1,85 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Made with Marlin Bitmap Converter + * http://marlinfw.org/tools/u8glib/converter.html + */ +#define CUSTOM_BOOTSCREEN_TIMEOUT 1500 +#define CUSTOM_BOOTSCREEN_BMPWIDTH 112 + +const unsigned char custom_start_bmp[] PROGMEM = { + B00000000,B00000000,B00011111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00011111,B11111111,B11111111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001111,B11111110,B00000000,B00001111,B11111111,B11111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00111111,B00000000,B00000000,B00000000,B00000011,B11111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01111000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11100000,B01111111,B11000000,B00000000,B00000000,B00000000,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11001111,B11110000,B00000000,B00000000,B00000000,B00000000,B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01111100,B00000000,B00000000,B00000000,B00000000,B00011110,B00000111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00011110,B00000000,B00000000,B00000000,B00000000,B00000111,B11001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000000,B00000000,B00000111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010000,B11111100,B00000000,B00000000,B00000000,B00011111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010000,B00011111,B11111000,B00000000,B00000011,B11111110,B00111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00011000,B00000000,B01111111,B11111111,B11111111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00011100,B00000000,B00000000,B00000000,B00000000,B00000011,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001110,B00000000,B00000000,B00000000,B00000000,B00011111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000011,B10000000,B00000000,B00000000,B00000010,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B11100000,B00000000,B00000000,B00001111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00111000,B00000000,B00000000,B11111111,B11100111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000100,B00000000,B00000011,B11100000,B00000111,B00000000,B00000000,B00000000,B00000000,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,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B01100000,B00000000,B00000000,B00000000,B01111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00110000,B00000000,B00000000,B00000001,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00011100,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000111,B10000000,B00000000,B11111110,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01000000,B00000001,B00000000,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000011,B11110110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B10000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000000,B00000000, + B00000000,B00000000,B01110000,B00000000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11100000,B00000000, + B00000000,B00000000,B00111000,B00000000,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11000000,B00000000, + B00000000,B00000000,B00001100,B00000111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B10000000,B00000000, + B00000000,B00000000,B00000000,B00001100,B00110000,B00000000,B00000000,B10000000,B00000000,B00110000,B00000000,B11111000,B00000111,B11000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01110000,B00011111,B11011111,B11111110,B11111110,B01111000,B00110011,B11111000,B01100111,B11000011,B11111000, + B00000000,B00000000,B00000000,B00000000,B11100000,B01111111,B11111111,B11111111,B01111110,B11111000,B11111111,B11110001,B11111111,B11000111,B11111100, + B00000000,B00000000,B00000000,B00000011,B11000001,B11111111,B11111111,B11011111,B10111111,B11111101,B11111111,B11110011,B11111111,B11001111,B11111110, + B00000000,B00000000,B00000000,B00000111,B01100001,B11111111,B11100111,B10111111,B10111111,B11111101,B11111111,B11110111,B11111111,B11011111,B11111110, + B00000000,B00000000,B00000000,B00000000,B01100001,B11100000,B01100111,B10111111,B10111111,B11111111,B11111111,B11110111,B11111111,B11111110,B00001110, + B00000000,B00000000,B00000000,B00000001,B11000001,B11000000,B01100111,B10111111,B00111111,B01111011,B10000001,B11100111,B00000111,B10111000,B00001110, + B00000000,B00000000,B00000000,B00011111,B10000001,B10000001,B11100111,B11000000,B00111110,B01111011,B11101111,B11100111,B11111111,B10111000,B00011100, + B00000000,B00000000,B00000000,B00001111,B00000001,B11111111,B11100111,B11100000,B00011110,B01111011,B11111111,B11111111,B11111111,B11111111,B11111100, + B00000000,B00000000,B00000000,B00111111,B10000000,B11111111,B11001111,B11111000,B01111110,B01111011,B11111111,B11111111,B11111111,B11111111,B11111100, + B00000000,B00000000,B00000000,B00111111,B00000000,B01111111,B10011111,B11111000,B01111110,B01111001,B11111111,B11111011,B11110111,B11101111,B11111000, + B00000000,B00000000,B00000000,B00011111,B00000000,B00111111,B00011110,B00000000,B00000010,B01111111,B11110001,B00000000,B00000100,B00000011,B11110000, + B00000000,B00000000,B00000000,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000 +}; diff --git a/config/examples/TheBorg/Configuration.h b/config/examples/TheBorg/Configuration.h index f0adb0908bfe..cdcbe3870cfc 100644 --- a/config/examples/TheBorg/Configuration.h +++ b/config/examples/TheBorg/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Spawn32, The_Borg)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_THE_BORG #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 200, 200, 800, 280 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 32 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.3 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 32, 5, -1.3 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/TheBorg/Configuration_adv.h b/config/examples/TheBorg/Configuration_adv.h index a77c234ee63f..ef9d14cf16e5 100644 --- a/config/examples/TheBorg/Configuration_adv.h +++ b/config/examples/TheBorg/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/TinyBoy2/Configuration.h b/config/examples/TinyBoy2/Configuration.h index e810771811e1..aba12b90ade3 100644 --- a/config/examples/TinyBoy2/Configuration.h +++ b/config/examples/TinyBoy2/Configuration.h @@ -86,13 +86,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(StefanB, TinyBoy2)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -105,10 +101,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -145,14 +144,12 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #if ENABLED(TB2_L10) #define CUSTOM_MACHINE_NAME "TinyBoy2 L10" #elif ENABLED(TB2_L16) @@ -161,8 +158,8 @@ #error "Please select TB2_L10 or TB2_L16" #endif -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -299,7 +296,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -343,9 +347,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -370,17 +375,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -392,13 +400,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -416,8 +426,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -551,7 +559,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -759,25 +767,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 6400, 88.16 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 7, 35 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -791,35 +809,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -933,11 +954,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -949,10 +969,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 34, 15, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -986,7 +1006,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1249,12 +1269,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1308,19 +1322,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1569,7 +1570,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1579,8 +1580,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1625,10 +1629,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1737,6 +1741,14 @@ // #define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1964,31 +1976,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2022,6 +2015,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2032,16 +2060,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2057,6 +2083,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2068,27 +2100,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2174,8 +2213,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2214,7 +2255,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/TinyBoy2/Configuration_adv.h b/config/examples/TinyBoy2/Configuration_adv.h index 739f7ce78a5a..6e886516a5d8 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. +#define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Tronxy/X1/Configuration.h b/config/examples/Tronxy/X1/Configuration.h index 6979cde44ae1..9ef921927e89 100644 --- a/config/examples/Tronxy/X1/Configuration.h +++ b/config/examples/Tronxy/X1/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Claus Naeveke, 0.1)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Tronxy X1" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 11 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 1600, 90 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 2, 50 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 400, 400, 40, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 20.0 #define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.053 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tronxy/X3A/Configuration.h b/config/examples/Tronxy/X3A/Configuration.h index 6b39b8d13fa1..65bf292bc1f3 100644 --- a/config/examples/Tronxy/X3A/Configuration.h +++ b/config/examples/Tronxy/X3A/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Schullebernd, Tronxy X3A)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI //63 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Tronxy X3A" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 6 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 90 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 4, 50 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 1500, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 15.0 #define DEFAULT_YJERK 15.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.09 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -32 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -0.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -32, -10, -0.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 50 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1197,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1256,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1517,7 +1518,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1527,8 +1528,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1573,10 +1577,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1685,6 +1689,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1912,31 +1924,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1970,6 +1963,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1980,16 +2008,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2005,6 +2031,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2016,27 +2048,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2122,8 +2161,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2162,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tronxy/X3A/Configuration_adv.h b/config/examples/Tronxy/X3A/Configuration_adv.h index cb44fb88a055..ef71105b1547 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Tronxy/X5S-2E/Configuration.h b/config/examples/Tronxy/X5S-2E/Configuration.h index caa7d9dee853..5ad389bb12d9 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration.h +++ b/config/examples/Tronxy/X5S-2E/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Anthony Rich, OEM stock config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_TRONXY_V3_1_0 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Tronxy X5S-2E" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -279,7 +276,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -323,9 +327,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -350,17 +355,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -372,13 +380,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -396,8 +406,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -527,7 +535,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. // //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -729,25 +737,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 94 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 100, 1000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -761,35 +779,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 20.0 #define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.16 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -903,11 +924,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -919,10 +939,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -956,7 +976,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1214,12 +1234,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1273,19 +1287,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1534,7 +1535,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1544,8 +1545,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1590,10 +1594,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1702,6 +1706,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1929,31 +1941,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1987,6 +1980,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1997,16 +2025,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2022,6 +2048,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2033,27 +2065,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2139,8 +2178,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2179,7 +2220,7 @@ */ #define NUM_SERVOS 2 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300, 300 } diff --git a/config/examples/Tronxy/X5S-2E/Configuration_adv.h b/config/examples/Tronxy/X5S-2E/Configuration_adv.h index 5a4c32f8cdce..e4433ddf0015 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Tronxy/X5S/Configuration.h b/config/examples/Tronxy/X5S/Configuration.h index 0f57f8222399..556c8fea7d81 100644 --- a/config/examples/Tronxy/X5S/Configuration.h +++ b/config/examples/Tronxy/X5S/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI_TRONXY #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Tronxy X5S" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 90 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 4, 150 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1000, 1000, 1000, 1000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 18.0 #define DEFAULT_YJERK 18.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.13 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -45 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -55 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -45, -55, -0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION 270 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 260 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tronxy/XY100/Configuration.h b/config/examples/Tronxy/XY100/Configuration.h index bca3d4195d5c..447a721b0688 100644 --- a/config/examples/Tronxy/XY100/Configuration.h +++ b/config/examples/Tronxy/XY100/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Rob Griffiths, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MELZI #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "TronXY XY100" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -525,7 +533,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -719,25 +727,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 1600, 90 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 400, 400, 4, 50 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 1000, 5000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -751,35 +769,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 20.0 #define DEFAULT_YJERK 20.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.16 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -893,11 +914,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -909,10 +929,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -946,7 +966,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1204,12 +1224,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1263,19 +1277,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1524,7 +1525,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1534,8 +1535,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1580,10 +1584,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1692,6 +1696,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1919,31 +1931,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1977,6 +1970,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1987,16 +2015,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2012,6 +2038,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2023,27 +2055,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2129,8 +2168,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2169,7 +2210,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/UltiMachine/Archim1/Configuration.h b/config/examples/UltiMachine/Archim1/Configuration.h index 16e6662b26d1..8ff732ac5b70 100644 --- a/config/examples/UltiMachine/Archim1/Configuration.h +++ b/config/examples/UltiMachine/Archim1/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ARCHIM1 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 200, 200, 800, 500 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/UltiMachine/Archim1/Configuration_adv.h b/config/examples/UltiMachine/Archim1/Configuration_adv.h index d711c6b6de15..8f896a49d781 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/UltiMachine/Archim2/Configuration.h b/config/examples/UltiMachine/Archim2/Configuration.h index b0b32750e16d..01fbe0728c2b 100644 --- a/config/examples/UltiMachine/Archim2/Configuration.h +++ b/config/examples/UltiMachine/Archim2/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ARCHIM2 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/UltiMachine/Archim2/Configuration_adv.h b/config/examples/UltiMachine/Archim2/Configuration_adv.h index e0c128b3362e..39ad47fd67df 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/VORONDesign/Configuration.h b/config/examples/VORONDesign/Configuration.h index 8585a8010968..f591ec3bed8f 100644 --- a/config/examples/VORONDesign/Configuration.h +++ b/config/examples/VORONDesign/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_VORON #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "VORON 2.0" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 5 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 205 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -717,25 +725,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 608, 608 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 75, 75 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 , 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -749,35 +767,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 20.0 #define DEFAULT_YJERK 15.0 #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.03 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -891,11 +912,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -907,10 +927,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -944,7 +964,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1202,12 +1222,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION 15 - #define RIGHT_PROBE_BED_POSITION 200 - #define FRONT_PROBE_BED_POSITION 15 - #define BACK_PROBE_BED_POSITION 200 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1261,19 +1275,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1522,7 +1523,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1532,8 +1533,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1578,10 +1582,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1690,6 +1694,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1917,31 +1929,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1975,6 +1968,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1985,16 +2013,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2010,6 +2036,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2021,27 +2053,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2127,8 +2166,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2167,7 +2208,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/VORONDesign/Configuration_adv.h b/config/examples/VORONDesign/Configuration_adv.h index cfda48dc9820..33ce34ea9b05 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Velleman/K8200/Configuration.h b/config/examples/Velleman/K8200/Configuration.h index 4efe30bc467e..5cc25d630e4e 100644 --- a/config/examples/Velleman/K8200/Configuration.h +++ b/config/examples/Velleman/K8200/Configuration.h @@ -86,13 +86,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(K8200, @CONSULitAS)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -105,10 +101,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -145,18 +144,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_K8200 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "K8200" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 #if ENABLED(K8200_VM8201) #define MACHINE_UUID "2b7dea3b-844e-4ab1-aa96-bb6406607d6e" // K8200 standard config with VM8201 (Display) #else @@ -297,7 +294,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -341,9 +345,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -368,17 +373,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -390,13 +398,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -414,8 +424,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -538,7 +546,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -738,24 +746,34 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 64.25, 64.25, 2560, 600 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -769,35 +787,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.04 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -911,11 +932,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -927,10 +947,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -964,7 +984,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1223,12 +1243,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1282,19 +1296,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1543,7 +1544,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1553,8 +1554,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1602,10 +1606,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1714,6 +1718,14 @@ // #define REVERSE_MENU_DIRECTION // K8200: for Display VM8201 encoder on right side +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1941,31 +1953,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1999,6 +1992,43 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +#endif // K8200_VM8201 + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2009,18 +2039,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER - -#endif // K8200_VM8201 +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2036,6 +2062,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2047,27 +2079,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2153,8 +2192,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2193,7 +2234,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Velleman/K8200/Configuration_adv.h b/config/examples/Velleman/K8200/Configuration_adv.h index 746378856603..d59df21f08a3 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/Configuration_adv.h @@ -210,6 +210,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -227,7 +277,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -292,9 +342,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -302,6 +353,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) #define FAN_KICKSTART_TIME 500 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -391,6 +445,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -614,25 +669,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -659,20 +726,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -750,8 +805,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -848,6 +903,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -862,8 +926,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -877,6 +968,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -888,23 +991,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -937,8 +1023,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1018,17 +1107,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1050,7 +1153,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1143,14 +1246,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1181,7 +1384,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1230,6 +1434,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1290,7 +1530,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1302,7 +1542,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1377,6 +1618,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1434,19 +1678,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1520,8 +1764,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1649,81 +1893,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1762,6 +2026,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1853,17 +2120,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1878,8 +2157,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1901,8 +2184,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1933,7 +2216,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1941,7 +2224,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1949,7 +2232,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1957,7 +2240,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1965,7 +2248,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1973,7 +2256,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1981,7 +2264,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1989,7 +2272,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1997,7 +2280,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -2005,7 +2288,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2013,7 +2296,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2021,7 +2304,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2029,7 +2312,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2234,6 +2517,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2288,6 +2578,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2345,9 +2642,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2429,6 +2729,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2447,6 +2763,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Velleman/K8400/Dual-head/Configuration.h b/config/examples/Velleman/K8400/Dual-head/Configuration.h index 7e41e8ba8770..5e1f8182c2ad 100644 --- a/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_K8400 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 5 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 134.74, 134.74, 4266.66, 148.7 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 160, 160, 10, 10000 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.007 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // #define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2119,8 +2158,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2159,7 +2200,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Velleman/K8400/Configuration_adv.h b/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h similarity index 83% rename from config/examples/Velleman/K8400/Configuration_adv.h rename to config/examples/Velleman/K8400/Dual-head/Configuration_adv.h index b50662fc5ba9..79a2633df902 100644 --- a/config/examples/Velleman/K8400/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ #define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - #define CONTROLLER_FAN_PIN 2 // 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 + #define CONTROLLER_FAN_PIN 2 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Velleman/K8400/README.md b/config/examples/Velleman/K8400/Dual-head/README.md similarity index 100% rename from config/examples/Velleman/K8400/README.md rename to config/examples/Velleman/K8400/Dual-head/README.md diff --git a/config/examples/Velleman/K8400/Configuration.h b/config/examples/Velleman/K8400/Single-head/Configuration.h similarity index 92% rename from config/examples/Velleman/K8400/Configuration.h rename to config/examples/Velleman/K8400/Single-head/Configuration.h index 1e6550e5d713..729f240ad225 100644 --- a/config/examples/Velleman/K8400/Configuration.h +++ b/config/examples/Velleman/K8400/Single-head/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_K8400 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 134.74, 134.74, 4266.66, 148.7 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 160, 160, 10, 10000 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.5 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 20.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.007 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // #define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2119,8 +2158,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2159,7 +2200,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Velleman/K8400/Single-head/Configuration_adv.h b/config/examples/Velleman/K8400/Single-head/Configuration_adv.h new file mode 100644 index 000000000000..79a2633df902 --- /dev/null +++ b/config/examples/Velleman/K8400/Single-head/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 1000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 1 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + #define CONTROLLER_FAN_PIN 2 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// Homing hits each endstop, retracts by these distances, then does a slower bump. +#define X_HOME_BUMP_MM 10 +#define Y_HOME_BUMP_MM 10 +#define Z_HOME_BUMP_MM 3 +#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 26 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + //#define USER_DESC_5 "Home & Info" + //#define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Velleman/K8400/Single-head/README.md b/config/examples/Velleman/K8400/Single-head/README.md new file mode 100644 index 000000000000..1ebdd16ef214 --- /dev/null +++ b/config/examples/Velleman/K8400/Single-head/README.md @@ -0,0 +1,15 @@ +# Configuration for Velleman K8400 Vertex +http://www.k8400.eu/ + +Configuration files for the K8400, ported upstream from the official Velleman firmware. +Like 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. + +**NOTE: This configuration includes the community sourced feed rate fix. Use 100% feed rate in Repetier!** + +For implementation and updated K8400 firmware, see https://github.com/birkett/Velleman-K8400-Firmware + +### Original Sources +Credit to Velleman for the original 1.0.x based code:
+http://www.vertex3dprinter.eu/downloads/files/vertex/firmware/vertex-m1-v1.4-h2.zip diff --git a/config/examples/WASP/PowerWASP/Configuration.h b/config/examples/WASP/PowerWASP/Configuration.h index 937e1ef51a7a..925c73d00c91 100644 --- a/config/examples/WASP/PowerWASP/Configuration.h +++ b/config/examples/WASP/PowerWASP/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Julian + Jason)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -148,18 +147,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ULTIMAKER #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message -#define CUSTOM_MACHINE_NAME " PowerWASP is " +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "PowerWASP" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -296,7 +293,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -340,9 +344,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -367,17 +372,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -389,13 +397,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -413,8 +423,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 0 @@ -533,7 +541,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -727,25 +735,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 85.48,85.48,533.33,104.7 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 150, 150, 15, 20 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 10000, 10000, 50, 500 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -759,35 +777,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 15.0 #define DEFAULT_YJERK 15.0 #define DEFAULT_ZJERK 0.5 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 1.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.023 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -901,11 +922,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -917,10 +937,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -954,7 +974,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1212,12 +1232,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1271,19 +1285,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1532,7 +1533,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1542,8 +1543,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1588,10 +1592,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1700,6 +1704,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1927,31 +1939,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1985,6 +1978,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1995,16 +2023,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2020,6 +2046,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2031,27 +2063,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2137,8 +2176,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2177,7 +2218,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/WASP/PowerWASP/Configuration_adv.h b/config/examples/WASP/PowerWASP/Configuration_adv.h index 178f02d96f73..2d046bff594d 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ #define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) #define POWER_LOSS_PIN 65 // Pin to detect power loss #define POWER_LOSS_STATE LOW // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 10 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Wanhao/Duplicator 6/Configuration.h b/config/examples/Wanhao/Duplicator 6/Configuration.h index ca6554229d9e..d2228e42023a 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Rob Mendon, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_ULTIMAIN_2 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Duplicator 6" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 20 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -718,25 +726,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80.0395, 80.0395, 400.48, 99.1 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 500 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -750,35 +768,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 1.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.027 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -892,11 +913,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +928,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +965,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1223,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1276,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1523,7 +1524,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1533,8 +1534,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1579,10 +1583,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1691,6 +1695,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1743,7 +1755,7 @@ // // ULTIPANEL as seen on Thingiverse. // -#define ULTIPANEL +//#define ULTIPANEL // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) @@ -1918,34 +1930,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -#define U8GLIB_SSD1306 -#define LCD_WIDTH 22 -#define LCD_HEIGHT 5 -#define LCD_RESET_PIN 5 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1979,6 +1969,42 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +#define OLED_PANEL_TINYBOY2 +#define LCD_RESET_PIN 5 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1989,16 +2015,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2014,6 +2038,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2025,27 +2055,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2131,8 +2168,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2171,7 +2210,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 868ebec1f99a..6a941729a84e 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ #define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 70*60, 70*60, 15*60, 6*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +892,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 70*60, 70*60, 15*60, 6*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1279,7 +1519,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/Wanhao/Duplicator i3 2.1/Chippy_Bootscreen.h b/config/examples/Wanhao/Duplicator i3 2.1/Chippy_Bootscreen.h new file mode 100644 index 000000000000..1407c6f1734d --- /dev/null +++ b/config/examples/Wanhao/Duplicator i3 2.1/Chippy_Bootscreen.h @@ -0,0 +1,74 @@ +/** + * Made with Marlin Bitmap Converter + * http://marlinfw.org/tools/u8glib/converter.html + * + * This bitmap from 128x64 pasted image + */ +#define CUSTOM_BOOTSCREEN_BMPWIDTH 128 + +const unsigned char custom_start_bmp[] PROGMEM = { + B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B00000000,B00000000,B00000000,B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000,B00000000,B00001111,B00000000,B00000001,B00000000,B00000000,B00001111,B00000000,B00000000, + B00000000,B00000001,B11111111,B11111111,B11111110,B00000000,B00000000,B00000000,B00001000,B10000000,B10000001,B00000000,B00000000,B00001000,B10000000,B00000000, + B00000000,B00000011,B11111111,B11111111,B11111111,B11111111,B11000000,B00000000,B00001000,B10111101,B11000001,B00111100,B00011110,B00001000,B10111101,B00100000, + B00000000,B00000011,B00000000,B00000000,B00000011,B11111100,B01000000,B00000000,B00001111,B00100100,B10000001,B00100100,B00000010,B00001111,B00100101,B00100000, + B00000000,B00000011,B00000000,B00000000,B00000000,B00000100,B01111000,B00000000,B00001000,B10100100,B10011101,B00100101,B11011110,B11101000,B10100100,B11000000, + B00000000,B00000011,B00000000,B00000000,B00000000,B00000100,B00001000,B00000000,B00001000,B10100100,B10000001,B00100100,B00010010,B00001000,B10100101,B00100000, + B00000000,B00000011,B00111111,B11111111,B00000000,B00000100,B00001000,B00000000,B00001111,B00111100,B11000001,B00100100,B00011110,B00001111,B00111101,B00100000, + B00000000,B00000011,B00111111,B11111111,B11111111,B10000100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00110000,B00000111,B11111111,B11000100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00110000,B00000000,B00000000,B11000100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00110011,B11000000,B00000000,B11000100,B00001000,B10000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00110011,B11000000,B00000000,B11000100,B00001001,B10000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00110011,B11000000,B00000000,B11000100,B00001011,B10000000,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00110011,B11000001,B11111100,B11000100,B00001011,B10000000,B11100011,B11000010,B00000000,B00000000,B00000010,B00000000,B00000000,B00100000, + B00000000,B00000011,B00110011,B11000001,B11111100,B11000100,B00001011,B11100011,B11100010,B00000010,B00000000,B00000000,B00100000,B00000000,B00000000,B00100000, + B00000000,B00000011,B00110011,B11000001,B11111100,B11000100,B00001011,B11100011,B11100010,B00001110,B01001000,B11101111,B01110100,B11110011,B11001111,B00100000, + B00000000,B00000011,B00110011,B11000000,B00000000,B11000100,B00001001,B11111111,B11000011,B11010010,B01001001,B00000001,B00100100,B10010010,B01000001,B00100000, + B00000000,B00000011,B00110000,B00000000,B00000000,B11000100,B00001000,B11111111,B10000010,B00010010,B01001001,B00001111,B00100100,B10010010,B01001111,B00100000, + B00000111,B11111111,B00110000,B00000000,B00000000,B11000100,B00001000,B01111111,B00000010,B00010010,B01001001,B00001001,B00100100,B10010010,B01001001,B00100000, + B00001111,B11111111,B00110000,B00000000,B00000000,B11000100,B00001000,B00111100,B00000011,B11001110,B01111000,B11101111,B00110100,B11110010,B01001111,B00100000, + B00001111,B11111111,B00110000,B00000000,B00000000,B11000100,B00001000,B00111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001111,B10000111,B00110001,B11000000,B00011100,B11000100,B01111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B00000111,B00110001,B11100000,B00111100,B11000100,B01111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00011111,B10000011,B00110000,B11111111,B11111000,B11000100,B01111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00111111,B11000011,B00110000,B00111111,B11100000,B11001100,B01111111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01111111,B11100011,B00111111,B11000000,B00000000,B11001100,B01111111,B11111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11111000,B11110011,B00011111,B11111111,B00000000,B11001100,B00001000,B00000000,B00000000,B00000111,B00000000,B01000000,B00000000,B01000000,B00000000,B00000000, + B11111000,B01110011,B00000000,B11111111,B11111111,B11001100,B00001000,B00000000,B00000000,B00000100,B10000000,B01000000,B00000100,B00000000,B00000000,B00000000, + B11110000,B01110011,B00000000,B00000001,B11111111,B10001100,B00001000,B00000000,B00000000,B00000100,B10011110,B01110001,B11101110,B10001101,B11000000,B00000000, + B01110000,B01100011,B00000000,B00000000,B00000000,B00001100,B00001000,B00000000,B00000000,B00000111,B00010010,B01001001,B00100100,B10010001,B00000000,B00000000, + B00100000,B01000011,B00000000,B00000000,B00000000,B00001100,B00001000,B00000000,B00000000,B00000100,B10010010,B01001001,B00100100,B10010000,B11000000,B00000000, + B00000000,B00000011,B00011111,B00000000,B00000000,B00001100,B00001000,B00000000,B00000000,B00000100,B10010010,B01001001,B00100100,B10010000,B01000000,B00000000, + B00000000,B00000011,B00010001,B00000000,B00000000,B00001100,B00001000,B00000000,B00000000,B00000100,B10011110,B01110001,B11100110,B10001101,B11000000,B00000000, + B00000000,B00000011,B00010001,B00000000,B00000000,B00001100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00010001,B00000111,B00000000,B00001100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00011111,B00000111,B11111000,B00001100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00000000,B00000000,B01111111,B00001100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00000000,B00000000,B00000111,B00001100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B00000000,B00000000,B00000000,B00001100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000011,B11110000,B00000000,B00000000,B00001100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B11111111,B10000000,B00000000,B00001100,B00010000,B00100000,B00000000,B00100000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B11111111,B11111000,B00000000,B00001100,B01100000,B00100000,B00000010,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B11111111,B11111111,B11000000,B00001100,B11100000,B00111000,B11110111,B01001111,B00111100,B11100011,B11010010,B00000111,B01111000,B00000000, + B00000000,B00000001,B11111111,B11111111,B11111110,B00001101,B11100000,B00100100,B10010010,B01001001,B00000100,B10010010,B01010010,B00001000,B00001000,B00000000, + B00000000,B00000001,B11111111,B11111111,B11111111,B11111111,B11100000,B00100100,B10010010,B01001001,B00111100,B10010010,B01001100,B00001000,B01111000,B00000000, + B00000000,B00000000,B11111111,B11111111,B11111111,B11111111,B11100000,B00100100,B10010010,B01001001,B00100100,B10010010,B01010010,B00001000,B01001000,B00000000, + B00000000,B00000000,B00001111,B11111111,B11111111,B11111111,B11100000,B00111000,B11110011,B01001001,B00111100,B11100011,B11010010,B01000111,B01111000,B00000000, + B00000000,B00000000,B00000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B00000001,B10110110,B11011011,B01101101,B10110110,B11011011,B01101101,B10110110,B11011011,B00000000, + B00000000,B00000000,B00000000,B00000000,B00001111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100 +}; diff --git a/config/examples/Wanhao/Duplicator i3 2.1/Configuration.h b/config/examples/Wanhao/Duplicator i3 2.1/Configuration.h new file mode 100644 index 000000000000..9aeb394313e5 --- /dev/null +++ b/config/examples/Wanhao/Duplicator i3 2.1/Configuration.h @@ -0,0 +1,2222 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(Matthew Piercey, Bot-In-a-Box Educational Robotics)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN +#define STRING_SPLASH_LINE2 "https://botinabox.ca" + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_MELZI +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Wanhao i3" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 99 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 0 +#define TEMP_SENSOR_BED 99 +#define TEMP_SENSOR_CHAMBER 0 + +// Dummy thermistor constant temperature readings, for use with 998 and 999 +#define DUMMY_THERMISTOR_998_VALUE 25 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 260 +#define HEATER_1_MAXTEMP 260 +#define HEATER_2_MAXTEMP 260 +#define HEATER_3_MAXTEMP 260 +#define HEATER_4_MAXTEMP 260 +#define HEATER_5_MAXTEMP 260 +#define BED_MAXTEMP 100 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // 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 + + // Wanhao Duplicator i3 + #define DEFAULT_Kp 29 + #define DEFAULT_Ki 2.00 + #define DEFAULT_Kd 97 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //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 + + // Wanhao Duplicator i3 + #define DEFAULT_bedKp 249.52 + #define DEFAULT_bedKi 47.89 + #define DEFAULT_bedKd 325.03 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 100 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 700, 700, 100, 10000 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 700 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 700 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 8.0 + #define DEFAULT_YJERK 8.0 + #define DEFAULT_ZJERK 0.4 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 200 +#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 Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 150 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 205 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h new file mode 100644 index 000000000000..6e76d1bbd935 --- /dev/null +++ b/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 32 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 32 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Wanhao/Duplicator i3 2.1/README.md b/config/examples/Wanhao/Duplicator i3 2.1/README.md new file mode 100644 index 000000000000..d2a7ea6401fa --- /dev/null +++ b/config/examples/Wanhao/Duplicator i3 2.1/README.md @@ -0,0 +1,21 @@ +Configuration for the Wanhao Duplicator i3 v2.1 + +[Made by Bot-In-a-Box Educational Robotics](https://botinabox.ca) +[See original configuration repo](https://github.com/BotInABoxER/marlin2-for-wanhao-i3) + +Notes: +- YMMV, but the included thermistor table has been tested to work with a 100k bed thermistor with a 10K pull-up resistor +- The smaller Marlin logo is used to save memory +- You may have a 4.7K pull-up resistor, in which case the included thermistor table will be off +- The included thermistor table was generated with `buildroot/share/scripts/createTemperatureLookupMarlin.py --rp=10000` +- Includes an optional custom Wanhao logo bootscreen designed to fit the stock LCD +- Includes an optional custom Chippy from Bot-In-a-Box bootscreen designed to fit the stock LCD + +Inspirations: +- https://www.thingiverse.com/thing:3378807 (Custom firmware 1.x by Nitrogen777) +- https://www.thingiverse.com/thing:3378807 (Custom firmware 2.x by Remotheman) + +Instructions: +- Copy the `Configuration.h`, `_Bootscreen.h` (or `Chippy_Bootscreen.h`; rename it `_Bootscreen.h`), and `Configuration_adv.h` to the `Marlin/ directory` +- Copy the `thermistor_99.h` and `thermistors.h` files to the `Marlin/src/modules/thermistors` directory +- Flash the firmware onto your Melzi (https://www.fission3d.com/guides/flash-bootloader-and-install-firmware-with-raspberry-pi might help) diff --git a/config/examples/Wanhao/Duplicator i3 2.1/_Bootscreen.h b/config/examples/Wanhao/Duplicator i3 2.1/_Bootscreen.h new file mode 100644 index 000000000000..34686deeaa74 --- /dev/null +++ b/config/examples/Wanhao/Duplicator i3 2.1/_Bootscreen.h @@ -0,0 +1,72 @@ +/** + * Made with Marlin Bitmap Converter + * http://marlinfw.org/tools/u8glib/converter.html + * + * This bitmap from 128x64 pasted image + */ +#define CUSTOM_BOOTSCREEN_BMPWIDTH 104 + +const unsigned char custom_start_bmp[] PROGMEM = { + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B00000000,B00000011,B11111111,B10111000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10111111,B10000000,B01111111,B11111111,B00111111,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B10111111,B11111111,B11111111,B11111111,B01111111,B11100000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B10111111,B11111111,B11111111,B11111110,B01111111,B11110000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B00111111,B11111111,B11111111,B11111100,B11111111,B11111000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B01111111,B11111111,B11111111,B11111101,B11111111,B11111110,B00111100,B00000000, + B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B01111111,B11111111,B11111111,B11111101,B11111111,B11111111,B11111111,B11000000, + B00000000,B00000000,B00000000,B00000000,B01111111,B11111110,B01111111,B11111111,B11111111,B11111101,B11111111,B11111111,B10000001,B11100000, + B00000000,B00000000,B00000000,B00000001,B11111111,B11111110,B11111111,B11111111,B11111111,B11111101,B11111111,B11111110,B00000000,B11111000, + B00000000,B00000000,B00000000,B00000011,B11111111,B11111110,B11111111,B11111111,B11111111,B11111101,B11111111,B11111110,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001111,B11111111,B11111110,B11111111,B11111111,B11111111,B11111101,B11111111,B11111110,B00000000,B00000000, + B00000000,B00000000,B00000000,B01101111,B11111111,B11111110,B11111111,B11111111,B11111111,B11111101,B11111111,B11111111,B00000000,B00000000, + B00000000,B00000000,B00000001,B11101111,B11111111,B11111110,B11111111,B11111111,B11111111,B11111101,B11111111,B11111111,B00000000,B00000000, + B00000000,B00000000,B01100111,B11001111,B11111111,B11111110,B01111111,B11111111,B11111111,B11111101,B11111111,B11111111,B00000000,B00000000, + B00000000,B00000111,B01111111,B11011111,B11111111,B11111111,B01111111,B11111111,B11111111,B11111100,B11111111,B11111111,B00000000,B00000000, + B00000000,B00000111,B11111111,B11011111,B11111111,B11111111,B01111111,B11111111,B11111111,B11111110,B11111111,B11111111,B00000000,B00000000, + B00000000,B00000011,B11111111,B11011111,B11111111,B11111111,B00111111,B11111111,B11111111,B11111110,B11111111,B11111111,B10000000,B00000000, + B00000000,B00000011,B11111111,B11001111,B11111111,B11111111,B10111111,B11111111,B11111111,B11111110,B01111111,B11111111,B10000000,B00000000, + B00000000,B00000001,B11111111,B11101111,B11111111,B11111111,B10111111,B11111111,B11111111,B11111111,B01111111,B11111111,B11000000,B00000000, + B00000000,B00000001,B11111111,B11101111,B11111111,B11111111,B10011111,B11111111,B11111111,B11111111,B01111111,B11111111,B11000000,B00000000, + B00000000,B00000001,B11111111,B11101111,B11111111,B11111111,B11011111,B11111111,B11111111,B11111111,B01111111,B11111111,B11000000,B00000000, + B00000000,B00000001,B11111111,B11100111,B11111111,B11111111,B11011111,B11111111,B11111111,B11111111,B00111111,B11111111,B11000000,B00000000, + B00000000,B00000001,B11111111,B11110111,B11111111,B11111111,B11011111,B11111111,B11111111,B11111111,B10111111,B11111111,B11000000,B00000000, + B00000000,B01000001,B11111111,B11110011,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10111111,B11111111,B10000000,B00000000, + B00000000,B01100001,B11111111,B11111001,B11111111,B11111111,B11101111,B11111111,B11111111,B11111111,B10111111,B11111111,B10100000,B00000000, + B00000000,B01111001,B11111111,B11111101,B11111111,B11111111,B11101111,B11111111,B11111111,B11111111,B00111111,B11111111,B00110000,B00000000, + B00001000,B01111111,B11111111,B11111100,B11111111,B11111111,B11101111,B11111111,B11111111,B11111111,B01111111,B11111110,B01110000,B00000000, + B00001100,B00111111,B11111111,B11111110,B01111111,B11111111,B11101111,B11111111,B11111111,B11111100,B00111111,B11111100,B11111000,B00000000, + B00001111,B00111111,B11111111,B11111111,B00000000,B00111111,B11101111,B11111111,B11111111,B11110001,B10001111,B11111001,B11111100,B00000000, + B00000111,B11111111,B11111111,B11111111,B00111111,B10001111,B11100111,B11111111,B11111111,B11000011,B11100011,B11111011,B11111110,B00000000, + B00000111,B11111111,B11111111,B11111110,B00111111,B11100011,B11000000,B11111111,B11111110,B00000001,B11111000,B11110011,B11111111,B00000000, + B00000011,B11111111,B11111111,B11111000,B00011111,B11111000,B00000000,B00001111,B11110000,B00000001,B11111110,B00000111,B11111111,B00000000, + B00000011,B11111111,B11111111,B11100000,B00001111,B11111101,B11000000,B00000000,B00000000,B00000001,B11111111,B11101111,B11111111,B00000000, + B00000001,B11111111,B11111111,B11000000,B00001111,B11111101,B11111100,B00000000,B00000000,B00000111,B11111111,B11100111,B11111110,B00000000, + B00000000,B11111111,B11111111,B10000000,B00000111,B11111101,B11111110,B00000000,B00000000,B00001111,B11111111,B11100011,B11111100,B00000000, + B00000000,B01111111,B11111111,B00000000,B00000011,B11111101,B11111111,B00000000,B00000000,B00011111,B11111111,B10000011,B11111100,B00000000, + B00000000,B00111111,B11111110,B00000000,B00000011,B11111001,B11111111,B00000000,B00000000,B00011111,B11111110,B00000111,B11111000,B00000000, + B00000000,B00011111,B11111100,B00000000,B00000011,B11111011,B11111111,B10000000,B00000000,B00111111,B11111100,B00000111,B11111000,B00000000, + B00000000,B00011111,B11110000,B00000000,B00000011,B11110001,B11111111,B11000000,B00000000,B01111111,B11100000,B00001111,B11111000,B00000000, + B00000000,B00001111,B11110000,B00000000,B00000111,B11110000,B00001111,B11000000,B00000000,B11111111,B10000000,B00011111,B11110000,B00000000, + B00000000,B00000011,B11000000,B00000000,B00001111,B11110000,B00000001,B11000000,B00000000,B11111111,B10000000,B00011111,B11100000,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,B00000000, + B00000111,B10000111,B10000111,B10000001,B11110000,B00011110,B00000111,B10001111,B00000011,B11000000,B01111100,B00000000,B11111111,B00000000, + B00000111,B10000111,B10000111,B10000001,B11110000,B00011111,B00000111,B10001111,B00000011,B11000000,B01111100,B00000001,B11111111,B10000000, + B00000111,B10000111,B10000111,B10000011,B11111000,B00011111,B00000111,B10001111,B00000011,B11000000,B11111110,B00000011,B11111111,B11000000, + B00000111,B10000111,B10000111,B10000011,B11111000,B00011111,B10000111,B10001111,B00000011,B11000000,B11111110,B00000111,B11111111,B11100000, + B00000111,B10000111,B10000111,B10000111,B10111100,B00011111,B11000111,B10001111,B00000011,B11000001,B11101111,B00000111,B11000011,B11100000, + B00000111,B10000111,B10000111,B10000111,B00011100,B00011111,B11100111,B10001111,B00000011,B11000001,B11000111,B00001111,B10000001,B11110000, + B00000111,B10000111,B10000111,B10000111,B00011100,B00011111,B11110111,B10001111,B11111111,B11000001,B11000111,B00001111,B00000000,B11110000, + B00000111,B11001111,B11001111,B10001111,B00011110,B00011111,B11111111,B10001111,B11111111,B11000011,B11000111,B10001111,B00000000,B11110000, + B00000011,B11001111,B11001111,B00001110,B00001110,B00011111,B11111111,B10001111,B11111111,B11000011,B10000011,B10001111,B00000000,B11110000, + B00000011,B11101111,B11011111,B00001111,B11111110,B00011110,B11111111,B10001111,B00000011,B11000011,B11111111,B10001111,B00000000,B11110000, + B00000001,B11111111,B11111110,B00011111,B11111111,B00011110,B01111111,B10001111,B00000011,B11000111,B11111111,B11001111,B10000001,B11110000, + B00000001,B11111100,B11111110,B00011111,B11111111,B00011110,B00111111,B10001111,B00000011,B11000111,B11111111,B11000111,B11000011,B11100000, + B00000000,B11111100,B11111100,B00011111,B11111111,B00011110,B00011111,B10001111,B00000011,B11000111,B11111111,B11000111,B11111111,B11100000, + B00000000,B01111100,B11111000,B00111110,B00001111,B10011110,B00001111,B10001111,B00000011,B11001111,B10000011,B11100011,B11111111,B11000000, + B00000000,B01111000,B01111000,B00111100,B00000111,B10011110,B00001111,B10001111,B00000011,B11001111,B00000001,B11100001,B11111111,B10000000, + B00000000,B00111000,B01110000,B00111100,B00000111,B10011110,B00000111,B10001111,B00000011,B11001111,B00000001,B11100000,B01111110,B00000000 +}; diff --git a/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h b/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h new file mode 100755 index 000000000000..e2010622e138 --- /dev/null +++ b/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h @@ -0,0 +1,2211 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Wanhao i3 Mini)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_WANHAO_ONEPLUS +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "i3 Mini" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 13 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Wanhao Duplicator i3 Mini & rebrands + #define DEFAULT_Kp 22.2 + #define DEFAULT_Ki 1.08 + #define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 94 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 400, 400, 15, 50 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 3000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 800 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 800 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.05 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + +// 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) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +//#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#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 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR 1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 125 +#define Y_BED_SIZE 140 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 100 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + #define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "PETG" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 80 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 WESTERN + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h new file mode 100644 index 000000000000..48f9b6c61f6c --- /dev/null +++ b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h @@ -0,0 +1,2867 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 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 +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) + #define DOUBLECLICK_MAX_INTERVAL 2500 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Wanhao/Duplicator i3 Mini/_Bootscreen.h b/config/examples/Wanhao/Duplicator i3 Mini/_Bootscreen.h new file mode 100755 index 000000000000..b647f46339b1 --- /dev/null +++ b/config/examples/Wanhao/Duplicator i3 Mini/_Bootscreen.h @@ -0,0 +1,53 @@ +/** + * Made with Marlin Bitmap Converter + * http://marlinfw.org/tools/u8glib/converter.html + */ +#define CUSTOM_BOOTSCREEN_BMPWIDTH 80 +#define CUSTOM_BOOTSCREEN_Y 3 + +const unsigned char custom_start_bmp[] PROGMEM = { + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00110111,B00000000,B01111111,B10111100,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11111111,B10111111,B10000000,B00000000, + B00000000,B00000000,B00000000,B00000111,B11111111,B11111111,B11111111,B01111111,B11000000,B00000000, + B00000000,B00000000,B00000000,B00011111,B11101111,B11111111,B11111111,B01111111,B11111111,B00000000, + B00000000,B00000000,B00000000,B00111111,B11101111,B11111111,B11111111,B11111111,B11111111,B11100000, + B00000000,B00000000,B00000000,B11111111,B11101111,B11111111,B11111111,B11111111,B11100000,B00110000, + B00000000,B00000000,B00000011,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,B00000000, + B00000000,B00000000,B00000111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000,B00000000, + B00000000,B00000000,B00110111,B11111111,B11111111,B11111111,B11111111,B01111111,B11110000,B00000000, + B00000000,B00010111,B11110111,B11111111,B11101111,B11111111,B11111111,B01111111,B11110000,B00000000, + B00000000,B00011111,B11110111,B11111111,B11101111,B11111111,B11111111,B01111111,B11110000,B00000000, + B00000000,B00001111,B11110111,B11111111,B11111111,B11111111,B11111111,B10111111,B11111000,B00000000, + B00000000,B00001111,B11110111,B11111111,B11110111,B11111111,B11111111,B10111111,B11111000,B00000000, + B00000000,B00001111,B11111111,B11111111,B11110111,B11111111,B11111111,B10111111,B11111100,B00000000, + B00000000,B00001111,B11111011,B11111111,B11110111,B11111111,B11111111,B10111111,B11111100,B00000000, + B00000000,B00001111,B11111011,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100,B00000000, + B00000000,B10001111,B11111101,B11111111,B11111011,B11111111,B11111111,B11011111,B11111000,B00000000, + B00000000,B11111111,B11111100,B11111111,B11111011,B11111111,B11111111,B10111111,B11110110,B00000000, + B00000100,B01111111,B11111110,B11111111,B11111011,B11111111,B11111111,B00011111,B11101111,B00000000, + B00000110,B01111111,B11111111,B00100101,B11111011,B11111111,B11111100,B11101111,B11011111,B10000000, + B00000111,B11111111,B11111111,B00111110,B01110000,B11111111,B11110000,B11110011,B11011111,B11000000, + B00000011,B11111111,B11111100,B00111111,B10000000,B00001111,B10000000,B01111101,B10111111,B11000000, + B00000001,B11111111,B11111000,B00011111,B11011000,B00000000,B00000000,B11111111,B10111111,B10000000, + B00000001,B11111111,B11100000,B00001111,B11011111,B00000000,B00000001,B11111111,B00011111,B10000000, + B00000000,B01111111,B11000000,B00001111,B11111111,B10000000,B00000011,B11111110,B00011111,B00000000, + B00000000,B00111111,B10000000,B00001111,B10111111,B10000000,B00000011,B11111000,B00111111,B00000000, + B00000000,B00111111,B00000000,B00001111,B10011111,B11000000,B00000111,B11000000,B00111110,B00000000, + B00000000,B00011100,B00000000,B00011111,B00000000,B11000000,B00001111,B11000000,B01111110,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, + B00000011,B10001100,B01110000,B11100000,B11100000,B11001100,B00011100,B00011000,B00000111,B11000000, + B00000011,B10011100,B01110000,B11110000,B11110001,B11001110,B00011100,B00111100,B00001111,B11100000, + B00000011,B10011100,B01110001,B11110000,B11110001,B11001110,B00011100,B00111100,B00011111,B11110000, + B00000011,B10011100,B01110001,B11110000,B11111001,B11001110,B00011100,B01111110,B00111100,B01111000, + B00000011,B10011100,B01110001,B11111000,B11111101,B11001111,B11111100,B01111110,B00111000,B00111000, + B00000001,B10011110,B11100011,B10111000,B11111111,B11001111,B11111100,B01100111,B00111000,B00011000, + B00000001,B11011110,B11100011,B10111000,B11101111,B11001111,B11111100,B11100111,B00111000,B00111000, + B00000001,B11111111,B11000011,B11111100,B11100111,B11001110,B00011100,B11111111,B00111100,B00111000, + B00000000,B11110111,B11000111,B11111100,B11100011,B11001110,B00011100,B11111111,B10011111,B11110000, + B00000000,B11110011,B10000111,B00011110,B11100011,B11001110,B00011101,B11100011,B10001111,B11110000, + B00000000,B01110011,B10000111,B00001110,B11100001,B11001110,B00011101,B11000011,B11000111,B11000000 +}; diff --git a/config/examples/adafruit/ST7565/Configuration.h b/config/examples/adafruit/ST7565/Configuration.h index bca7de92ddbc..7dffe3c8250f 100644 --- a/config/examples/adafruit/ST7565/Configuration.h +++ b/config/examples/adafruit/ST7565/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -708,25 +716,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -740,35 +758,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -882,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1193,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1252,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1513,7 +1514,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1523,8 +1524,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1569,10 +1573,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1681,6 +1685,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1908,31 +1920,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1966,6 +1959,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1976,16 +2004,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2001,6 +2027,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2012,27 +2044,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2118,8 +2157,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2158,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Anycubic/Kossel/Configuration.h b/config/examples/delta/Anycubic/Kossel/Configuration.h index 919f5ce2345c..ba84c99103eb 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration.h @@ -85,13 +85,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "@brandstaetter, @grbd" // 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 "Welcome to ANYCUBIC" // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -104,10 +100,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -144,18 +143,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_TRIGORILLA_14 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "ANYCUBIC Kossel" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -292,7 +289,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -336,9 +340,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -363,17 +368,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -385,13 +393,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -409,8 +419,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -662,8 +670,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes - #define DELTA_CALIBRATION_RADIUS DELTA_PRINTABLE_RADIUS - MIN_PROBE_EDGE // (mm) // Set the steprate for papertest probing #define PROBE_MANUALLY_STEP 0.05 // (mm) #endif @@ -830,7 +836,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -845,18 +851,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 100, 100, 100, 100} +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 3000, 3000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -870,35 +886,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 5.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.003 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -1022,50 +1041,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1077,16 +1081,15 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] - #if ANYCUBIC_PROBE_VERSION == 2 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -16.8 // Z offset: -below +above [the nozzle] + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, -16.8 } #elif ANYCUBIC_PROBE_VERSION == 1 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -19.0 // Z offset: -below +above [the nozzle] + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, -19.0 } #else - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } #endif // Certain types of probes need to stay away from edges @@ -1121,18 +1124,18 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * 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. */ -#define Z_CLEARANCE_DEPLOY_PROBE 30 // Z Clearance for Deploy/Stow +#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_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 +#define Z_PROBE_LOW_POINT -5 // 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 -40 @@ -1145,6 +1148,9 @@ // Before deploy/stow pause for user confirmation #define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif /** * Enable one or more of the following if probing seems unreliable. @@ -1382,12 +1388,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1441,19 +1441,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - #define PROBE_PT_1_X -40 - #define PROBE_PT_1_Y 60 - #define PROBE_PT_2_X 40 - #define PROBE_PT_2_Y 60 - #define PROBE_PT_3_X 0 - #define PROBE_PT_3_Y -70 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1701,7 +1688,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1711,8 +1698,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1757,10 +1747,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1869,6 +1859,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2096,31 +2094,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2154,6 +2133,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2164,16 +2178,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2189,6 +2201,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2200,27 +2218,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2306,8 +2331,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2346,7 +2373,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index 997f42aca179..7f307177daa0 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -644,23 +711,10 @@ #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINTRAVELFEEDRATE 0.0 -//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated +#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view #define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/Dreammaker/Overlord/Configuration.h b/config/examples/delta/Dreammaker/Overlord/Configuration.h new file mode 100644 index 000000000000..80d51f32403f --- /dev/null +++ b/config/examples/delta/Dreammaker/Overlord/Configuration.h @@ -0,0 +1,2318 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(Team Overlord/TimMoore)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_OVERLORD +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Overlord" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +#define PSU_CONTROL +#define PSU_NAME "OVERLORD" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH true // Set 'false' for ATX, 'true' for X-Box + + #define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + + #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 AUTO_POWER_CHAMBER_FAN + #define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 201 +#define TEMP_SENSOR_1 201 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 245 // lower max temp since updated nozzle is a E3D V6 lite clone +#define HEATER_1_MAXTEMP 245 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 160 // 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 +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Overlord with new nozzle with integrated probe, update using M303 + #define DEFAULT_Kp 8.62 + #define DEFAULT_Ki 0.55 + #define DEFAULT_Kd 33.89 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +//#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //Overlord Pro heater into 5.5mm aluminium bed, update using M303 + #define DEFAULT_bedKp 253.16 + #define DEFAULT_bedKi 24.14 + #define DEFAULT_bedKd 663.66 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + //#define DEFAULT_bedKp 10.00 + //#define DEFAULT_bedKi .023 + //#define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Delta Settings ============================= +//=========================================================================== +// Enable DELTA kinematics and most of the default configuration for Deltas +#define DELTA + +#if ENABLED(DELTA) + + // Make delta curves from many straight lines (linear interpolation). + // This is a trade-off between visible corners (not enough segments) + // and processor overload (too many expensive sqrt calls). + #define DELTA_SEGMENTS_PER_SECOND 200 + + // After homing move down to a height where XY movement is unconstrained + #define DELTA_HOME_TO_SAFE_ZONE + + // Delta calibration menu + // uncomment to add three points calibration menu option. + // See http://minow.blogspot.com/index.html#4918805519571907051 + #define DELTA_CALIBRATION_MENU + + // uncomment to add G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results) + #define DELTA_AUTO_CALIBRATION + + // NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them + + #if ENABLED(DELTA_AUTO_CALIBRATION) + // set the default number of probe points : n*n (1 -> 7) + #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + #endif + + #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) + // Set the steprate for papertest probing + #define PROBE_MANUALLY_STEP 0.05 // (mm) + #endif + + // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). + #define DELTA_PRINTABLE_RADIUS 75.0 // (mm) Overlord + + // Center-to-center distance of the holes in the diagonal push rods. + #define DELTA_DIAGONAL_ROD 206.0 // (mm) Overlord + + // Distance between bed and nozzle Z home position + #define DELTA_HEIGHT 186.14 // (mm) Overlord - Update this value using G33 auto calibrate + + #define DELTA_ENDSTOP_ADJ { -0.33, 0.0, -0.85 } // Update these values using G33 auto calibrate + + // Horizontal distance bridged by diagonal push rods when effector is centered. + #define DELTA_RADIUS 100.63 // (mm) Overlord - Update this value using G33 auto calibrate + + // Trim adjustments for individual towers + // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0 + // measured in degrees anticlockwise looking from above the printer + #define DELTA_TOWER_ANGLE_TRIM { 0.69, 0.0, -0.70 } // Update these values using G33 auto calibrate + + // Delta radius and diagonal rod adjustments (mm) + #define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 } + #define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 } + +#endif + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE DRV8825 +#define Y_DRIVER_TYPE DRV8825 +#define Z_DRIVER_TYPE DRV8825 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE DRV8825 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +// variables to calculate steps +#define XYZ_FULL_STEPS_PER_ROTATION 100 +#define XYZ_MICROSTEPS 32 +#define XYZ_BELT_PITCH 2.03 +#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)) + // Extruder steps per unit from calibration +#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 67.394} + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 100, 100, 100, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 1000, 1000, 1000, 3000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 3000 // 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 + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK DEFAULT_XJERK + #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN // Overlord with Nozzle upgrade with integrated probe + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ +//#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + +#endif // Z_PROBE_ALLEN_KEY + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.65 } + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 5 + +// 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) +#define Z_PROBE_SPEED_FAST (HOMING_FEEDRATE_Z / 2) + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 10) // Slow 2nd probe down a lot, seems to give better results with the Overlord nozzle probe + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 15 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 15 // Z Clearance between multiple probes +#define Z_AFTER_PROBING 15 // Z position after probing is done + +#define Z_PROBE_LOW_POINT -4 // 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 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR 1 // deltas always home to max +#define Y_HOME_DIR 1 +#define Z_HOME_DIR 1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) +#define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) +#define Z_MIN_POS 0 +#define X_MAX_POS DELTA_PRINTABLE_RADIUS +#define Y_MAX_POS DELTA_PRINTABLE_RADIUS +#define Z_MAX_POS MANUAL_Z_HOME_POS + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS DELTA_HEIGHT // Distance between the nozzle to printbed after homing + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +//#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (100*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h new file mode 100644 index 000000000000..6da51ce3185c --- /dev/null +++ b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h @@ -0,0 +1,2868 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 5 // deltas need the same for all three axes +#define HOMING_BUMP_DIVISOR { 10, 10, 10 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +// (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) +//#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 3 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + #define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 35 // User defined RED value + #define LED_USER_PRESET_GREEN 35 // User defined GREEN value + #define LED_USER_PRESET_BLUE 35 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + #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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss (optional) + #define POWER_LOSS_STATE LOW // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + #define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 10 + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + #define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 1 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + #define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/delta/Dreammaker/Overlord/_Bootscreen.h b/config/examples/delta/Dreammaker/Overlord/_Bootscreen.h new file mode 100644 index 000000000000..0079deae3159 --- /dev/null +++ b/config/examples/delta/Dreammaker/Overlord/_Bootscreen.h @@ -0,0 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#define CUSTOM_BOOTSCREEN_BMPWIDTH 80 + +const uint8_t custom_start_bmp[] PROGMEM = { + B00000011,B10000011,B00001101,B11111101,B11111000,B11000000,B00011100,B00011111,B10001111,B11000000, + B00011111,B11100011,B00001101,B11111101,B11111110,B11000000,B11111111,B00011111,B11001111,B11110000, + B00011100,B01100011,B00001101,B10000001,B10001110,B11000000,B11100011,B00011001,B11001100,B01110000, + B00011100,B01110011,B00001101,B10000001,B10001110,B11000000,B11100011,B10011000,B11001100,B00111000, + B00011000,B01110001,B10011001,B11111001,B10001110,B11000000,B11000011,B10011001,B11001100,B00011000, + B00011000,B01110001,B10011001,B11111001,B11111100,B11000000,B11000011,B10011111,B11001100,B00011000, + B00011000,B01110001,B11111001,B10000001,B11111000,B11000000,B11000011,B10011111,B10001100,B00111000, + B00011111,B11100000,B11110001,B11111101,B10001100,B11111100,B11111111,B00011001,B11001111,B11110000, + B00001111,B11000000,B11110001,B11111101,B10001100,B11111100,B01111110,B00011001,B11001111,B11100000, + B00000011,B10000000,B01100001,B11111101,B10001110,B11111100,B00011100,B00011000,B11001111,B11000000 +}; diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h new file mode 100644 index 000000000000..c8b378eb1f69 --- /dev/null +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h @@ -0,0 +1,2329 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(Team Overlord/TimMoore)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_OVERLORD +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "Overlord Pro" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +#define PSU_CONTROL +#define PSU_NAME "OVERLORD" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH true // Set 'false' for ATX, 'true' for X-Box + + #define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + + #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 AUTO_POWER_CHAMBER_FAN + #define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 201 +#define TEMP_SENSOR_1 201 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 245 // lower max temp since updated nozzle is a E3D V6 lite clone +#define HEATER_1_MAXTEMP 245 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 115 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 160 // 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 +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Overlord Pro with new nozzle with integrated probe, update using M303 + #define DEFAULT_Kp 8.62 + #define DEFAULT_Ki 0.55 + #define DEFAULT_Kd 33.89 + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * 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. + */ +#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 +#if TEMP_SENSOR_BED != 0 + /* + * For Overlord Pro, the default PSU isn't powerful to run hotend/bed/etc. + * Problem is Hotend heater is 24V 60W, Bed is 24V 160W, Standard Overlord Pro PSU is 24V 220.8W + * Hotend and bed are PWMed to keep their average power less than the max power but they can both be on at the same time. + * If both are on at the same time, then there is no power available for anything else + * and power supply will shutdown if steppers are moving while both hotend and bed are on + * Recommend upgrade PSU + * A Meanwell RSP-500-24 works, a RSP-350-24 should work but has not been tested + */ + #error "Overlord Pro needs larger PSU than stock PSU, comment out this line if you have a larger PSU, otherwise set TEMP_SENSOR_BED to 0" +#endif + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //Overlord Pro heater into 5.5mm aluminium bed, update using M303 + #define DEFAULT_bedKp 253.16 + #define DEFAULT_bedKi 24.14 + #define DEFAULT_bedKd 663.66 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + //#define DEFAULT_bedKp 10.00 + //#define DEFAULT_bedKi .023 + //#define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Delta Settings ============================= +//=========================================================================== +// Enable DELTA kinematics and most of the default configuration for Deltas +#define DELTA + +#if ENABLED(DELTA) + + // Make delta curves from many straight lines (linear interpolation). + // This is a trade-off between visible corners (not enough segments) + // and processor overload (too many expensive sqrt calls). + #define DELTA_SEGMENTS_PER_SECOND 200 + + // After homing move down to a height where XY movement is unconstrained + #define DELTA_HOME_TO_SAFE_ZONE + + // Delta calibration menu + // uncomment to add three points calibration menu option. + // See http://minow.blogspot.com/index.html#4918805519571907051 + #define DELTA_CALIBRATION_MENU + + // uncomment to add G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results) + #define DELTA_AUTO_CALIBRATION + + // NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them + + #if ENABLED(DELTA_AUTO_CALIBRATION) + // set the default number of probe points : n*n (1 -> 7) + #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + #endif + + #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) + // Set the steprate for papertest probing + #define PROBE_MANUALLY_STEP 0.05 // (mm) + #endif + + // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). + #define DELTA_PRINTABLE_RADIUS 85.0 // (mm) Overlord Pro + + // Center-to-center distance of the holes in the diagonal push rods. + #define DELTA_DIAGONAL_ROD 206.0 // (mm) Overlord Pro + + // Distance between bed and nozzle Z home position + #define DELTA_HEIGHT 286.14 // (mm) Overlord Pro - Update this value using G33 auto calibrate + + #define DELTA_ENDSTOP_ADJ { -0.33, 0.0, -0.85 } // Update these values using G33 auto calibrate + + // Horizontal distance bridged by diagonal push rods when effector is centered. + #define DELTA_RADIUS 100.63 // (mm) Overlord Pro - Update this value using G33 auto calibrate + + // Trim adjustments for individual towers + // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0 + // measured in degrees anticlockwise looking from above the printer + #define DELTA_TOWER_ANGLE_TRIM { 0.69, 0.0, -0.70 } // Update these values using G33 auto calibrate + + // Delta radius and diagonal rod adjustments (mm) + #define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 } + #define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 } + +#endif + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE DRV8825 +#define Y_DRIVER_TYPE DRV8825 +#define Z_DRIVER_TYPE DRV8825 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE DRV8825 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +// variables to calculate steps +#define XYZ_FULL_STEPS_PER_ROTATION 100 +#define XYZ_MICROSTEPS 32 +#define XYZ_BELT_PITCH 2.03 +#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)) + // Extruder steps per unit from calibration +#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 67.394} + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 100, 100, 100, 25 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 1000, 1000, 1000, 3000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 3000 // 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 + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK DEFAULT_XJERK + #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN // Overlord Pro with Nozzle upgrade with integrated probe + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ +//#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + +#endif // Z_PROBE_ALLEN_KEY + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.65 } + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 5 + +// 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) +#define Z_PROBE_SPEED_FAST (HOMING_FEEDRATE_Z / 2) + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 10) // Slow 2nd probe down a lot, seems to give better results with the Overlord nozzle probe + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 15 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 15 // Z Clearance between multiple probes +#define Z_AFTER_PROBING 15 // Z position after probing is done + +#define Z_PROBE_LOW_POINT -4 // 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 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR 1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR 1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) +#define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) +#define Z_MIN_POS 0 +#define X_MAX_POS DELTA_PRINTABLE_RADIUS +#define Y_MAX_POS DELTA_PRINTABLE_RADIUS +#define Z_MAX_POS MANUAL_Z_HOME_POS + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS DELTA_HEIGHT + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Delta only homes to Z +#define HOMING_FEEDRATE_Z (100*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +//#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h new file mode 100644 index 000000000000..123b17593aed --- /dev/null +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h @@ -0,0 +1,2869 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 5 // deltas need the same for all three axes +#define HOMING_BUMP_DIVISOR { 10, 10, 10 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +// (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) +//#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 3 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + #define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 35 // User defined RED value + #define LED_USER_PRESET_GREEN 35 // User defined GREEN value + #define LED_USER_PRESET_BLUE 35 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + #define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + #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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss (optional) + #define POWER_LOSS_STATE LOW // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + #define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 10 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 10 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + #define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 1 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + #define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/_Bootscreen.h b/config/examples/delta/Dreammaker/Overlord_Pro/_Bootscreen.h new file mode 100644 index 000000000000..0079deae3159 --- /dev/null +++ b/config/examples/delta/Dreammaker/Overlord_Pro/_Bootscreen.h @@ -0,0 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#define CUSTOM_BOOTSCREEN_BMPWIDTH 80 + +const uint8_t custom_start_bmp[] PROGMEM = { + B00000011,B10000011,B00001101,B11111101,B11111000,B11000000,B00011100,B00011111,B10001111,B11000000, + B00011111,B11100011,B00001101,B11111101,B11111110,B11000000,B11111111,B00011111,B11001111,B11110000, + B00011100,B01100011,B00001101,B10000001,B10001110,B11000000,B11100011,B00011001,B11001100,B01110000, + B00011100,B01110011,B00001101,B10000001,B10001110,B11000000,B11100011,B10011000,B11001100,B00111000, + B00011000,B01110001,B10011001,B11111001,B10001110,B11000000,B11000011,B10011001,B11001100,B00011000, + B00011000,B01110001,B10011001,B11111001,B11111100,B11000000,B11000011,B10011111,B11001100,B00011000, + B00011000,B01110001,B11111001,B10000001,B11111000,B11000000,B11000011,B10011111,B10001100,B00111000, + B00011111,B11100000,B11110001,B11111101,B10001100,B11111100,B11111111,B00011001,B11001111,B11110000, + B00001111,B11000000,B11110001,B11111101,B10001100,B11111100,B01111110,B00011001,B11001111,B11100000, + B00000011,B10000000,B01100001,B11111101,B10001110,B11111100,B00011100,B00011000,B11001111,B11000000 +}; diff --git a/config/examples/delta/FLSUN/QQ-S/Configuration.h b/config/examples/delta/FLSUN/QQ-S/Configuration.h new file mode 100644 index 000000000000..d7f72b8b350d --- /dev/null +++ b/config/examples/delta/FLSUN/QQ-S/Configuration.h @@ -0,0 +1,2321 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(AndersSahlman, QQ-S config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) + +/** + * *** 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. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// 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. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 3 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT_2 1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_MKS_ROBIN_MINI +#endif + +// Name displayed in the LCD "Ready" message and Info menu +#define CUSTOM_MACHINE_NAME "FLSUN QQ-S" + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#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 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" 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). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box + + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power + + //#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 AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) + * -4 : thermocouple with AD8495 + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 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 + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 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. + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 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 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 110 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Ultimaker + //#define DEFAULT_Kp 22.2 + //#define DEFAULT_Ki 1.08 + //#define DEFAULT_Kd 114 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + + // FLSUN QQ-S, 200 C with 100% part cooling + #define DEFAULT_Kp 28.16 + #define DEFAULT_Ki 3.38 + #define DEFAULT_Kd 58.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. + */ +#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 + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + //#define DEFAULT_bedKp 10.00 + //#define DEFAULT_bedKi .023 + //#define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FLSUN QQ-S stock 1.6mm aluminium heater with 4mm lattice glass + #define DEFAULT_bedKp 325.10 + #define DEFAULT_bedKi 63.35 + #define DEFAULT_bedKd 417.10 + + // 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! *** + */ +#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. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 800 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Delta Settings ============================= +//=========================================================================== +// Enable DELTA kinematics and most of the default configuration for Deltas +#define DELTA + +#if ENABLED(DELTA) + + // Make delta curves from many straight lines (linear interpolation). + // This is a trade-off between visible corners (not enough segments) + // and processor overload (too many expensive sqrt calls). + #define DELTA_SEGMENTS_PER_SECOND 200 + + // After homing move down to a height where XY movement is unconstrained + //#define DELTA_HOME_TO_SAFE_ZONE + + // Delta calibration menu + // uncomment to add three points calibration menu option. + // See http://minow.blogspot.com/index.html#4918805519571907051 + #define DELTA_CALIBRATION_MENU + + // uncomment to add G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results) + #define DELTA_AUTO_CALIBRATION + + // NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them + + #if ENABLED(DELTA_AUTO_CALIBRATION) + // set the default number of probe points : n*n (1 -> 7) + #define DELTA_CALIBRATION_DEFAULT_POINTS 7 + #endif + + #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) + // Set the steprate for papertest probing + #define PROBE_MANUALLY_STEP 0.05 // (mm) + #endif + + // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). + #define DELTA_PRINTABLE_RADIUS 130.0 // (mm) + + // Center-to-center distance of the holes in the diagonal push rods. + #define DELTA_DIAGONAL_ROD 280.0 // (mm) + + // Distance between bed and nozzle Z home position + #define DELTA_HEIGHT 372.00 // (mm) Get this value from G33 auto calibrate + + #define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } // Get these values from G33 auto calibrate + + // Horizontal distance bridged by diagonal push rods when effector is centered. + #define DELTA_RADIUS 140.8 // (mm) Get this value from G33 auto calibrate + + // Trim adjustments for individual towers + // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0 + // measured in degrees anticlockwise looking from above the printer + #define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } // Get these values from G33 auto calibrate + + // Delta radius and diagonal rod adjustments (mm) + //#define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 } + //#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 } + +#endif + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG // a Z probe +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + +// 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 + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// 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 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, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_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 Z3_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 E5_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 Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +// delta speeds must be the same on xyz +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2...]] + */ +// 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, 393 } // default steps per unit + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_FEEDRATE { 200, 200, 200, 200 } + +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2...]] + */ +#define DEFAULT_MAX_ACCELERATION { 1000, 1000, 1000, 1000 } + +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Default Jerk limits (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK DEFAULT_XJERK + #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + +/** + * 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 ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * 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. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +#define FIX_MOUNTED_PROBE + +/** + * 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_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ +//#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + +#endif // Z_PROBE_ALLEN_KEY + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } + +// 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 4000 + +// Feedrate (mm/m) 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 +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 10) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 3 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * 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. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 30 // 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 30 // 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 + +// Enable the M48 repeatability test to test probe accuracy +#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * 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 PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR true +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#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 // (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 +// :[-1,1] +#define X_HOME_DIR 1 // deltas always home to max +#define Y_HOME_DIR 1 +#define Z_HOME_DIR 1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) +#define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) +#define Z_MIN_POS 0 +#define X_MAX_POS DELTA_PRINTABLE_RADIUS +#define Y_MAX_POS DELTA_PRINTABLE_RADIUS +#define Z_MAX_POS MANUAL_Z_HOME_POS + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, 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. + * + * 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. + */ +//#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 FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +#define AUTO_BED_LEVELING_BILINEAR +//#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'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + //#define ENABLE_LEVELING_FADE_HEIGHT + + // 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 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 + #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 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, 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 + + // 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. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#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 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_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 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 + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// 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_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + //#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 "G0 Z30 F12000\n G0 X0 Y0 Z30" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS DELTA_HEIGHT // Distance between the nozzle to printbed after homing + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Delta only homes to Z +#define HOMING_FEEDRATE_Z (50*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @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 =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +//#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +//#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +//#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "PETG" +#define PREHEAT_2_TEMP_HOTEND 235 +#define PREHEAT_2_TEMP_BED 80 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * 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 + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { 0, 0, 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #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) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT +#define SDIO_SUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * 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 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#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 +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#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 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// 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 + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= 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 + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// 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). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 1 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET 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 + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#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 + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h b/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h new file mode 100644 index 000000000000..833fa9220489 --- /dev/null +++ b/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h @@ -0,0 +1,2869 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// 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 + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #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 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +#define FAN_KICKSTART_TIME 100 + +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + +/** + * 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. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * 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 + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#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 + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #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. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 0 : (FULL_CONTROL) The slicer has full control over both X-carriages and can achieve optimal travel + * results as long as it supports dual X-carriages. (M605 S0) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// 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 5 // deltas need the same for all three axes +#define HOMING_BUMP_DIVISOR { 10, 10, 10 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// 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 + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 60 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// If defined the movements slow down when the look ahead buffer is only half full +// (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) +//#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#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 + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#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) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// 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 { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// 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 + +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#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 + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // 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 + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * 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 BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // 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 + + // 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 + + // 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 + + // 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. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * 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. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#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_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 + + #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_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_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * 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. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #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. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#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 MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 1 + +/** + * Minimum delay before and 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 + * 400 : Minimum for A5984 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_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 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 + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 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 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (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 +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// 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 + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#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 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#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 40 // (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 800 // (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 40 // (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 700 // (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 150 // (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. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 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. + * + * 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 the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * 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 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * 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 + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS -1 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS -1 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#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_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 + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #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_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * 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. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * 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. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#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 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * 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_PLANNER_QUEUE 0 // Show the current planner 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 + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index cf250bc3f39f..012075cf4580 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(LVD, FLSUN-AC)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "FLSUN Kossel" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -629,8 +637,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -782,7 +788,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -797,18 +803,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 200, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 4000, 4000, 4000, 4000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -822,35 +838,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -969,52 +988,37 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) - - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1026,10 +1030,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.10 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 20 @@ -1063,7 +1067,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1322,12 +1326,6 @@ #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1381,19 +1379,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1641,7 +1626,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1651,8 +1636,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1697,10 +1685,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1809,6 +1797,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2036,31 +2032,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2094,6 +2071,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2104,16 +2116,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2129,6 +2139,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2140,27 +2156,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2246,8 +2269,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2286,7 +2311,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 913c93c64598..8e595b022142 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/FLSUN/kossel/Configuration.h b/config/examples/delta/FLSUN/kossel/Configuration.h index e749f0def981..0018d7366539 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/config/examples/delta/FLSUN/kossel/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(LVD, FLSUN-AC)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "FLSUN Kossel" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -629,8 +637,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes - #define DELTA_CALIBRATION_RADIUS 63 // (mm) // Set the steprate for papertest probing #define PROBE_MANUALLY_STEP 0.05 // (mm) #endif @@ -782,7 +788,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -797,18 +803,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 200, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 4000, 4000, 4000, 4000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -822,35 +838,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -969,51 +988,36 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #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 - #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 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) - - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1025,10 +1029,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.10 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 20 @@ -1062,7 +1066,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1321,12 +1325,6 @@ #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1380,19 +1378,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1640,7 +1625,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1650,8 +1635,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1696,10 +1684,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1808,6 +1796,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2035,31 +2031,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2093,6 +2070,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2103,16 +2115,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2128,6 +2138,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2139,27 +2155,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2245,8 +2268,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2285,7 +2310,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/config/examples/delta/FLSUN/kossel/Configuration_adv.h index 913c93c64598..8e595b022142 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/config/examples/delta/FLSUN/kossel_mini/Configuration.h index e472a9889f5b..4d5183f7779f 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Michael Henke, flsun Kossel Mini)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Mini Kossel" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -629,8 +637,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -782,7 +788,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -797,18 +803,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 200, 200 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 4000, 4000, 4000, 4000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -822,35 +838,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.016 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -969,51 +988,36 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #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 - #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 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) - - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1025,10 +1029,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.25 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1062,7 +1066,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1321,12 +1325,6 @@ #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1380,19 +1378,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1640,7 +1625,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1650,8 +1635,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1696,10 +1684,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1808,6 +1796,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2035,31 +2031,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2093,6 +2070,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2103,16 +2115,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2128,6 +2138,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2139,27 +2155,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2245,8 +2268,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2285,7 +2310,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index 3e242444737e..e845a3eae2ca 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration.h b/config/examples/delta/Geeetech/Rostock 301/Configuration.h index 364264804aac..a45978e923af 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, Geeetech Rostock 301)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_GTM32_PRO_VB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Rostock 301" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -619,8 +627,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -772,7 +778,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -787,18 +793,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 500, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -812,35 +828,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -958,50 +977,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1013,10 +1017,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, -10, -3.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1050,7 +1054,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1309,12 +1313,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1368,19 +1366,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1628,7 +1613,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1638,8 +1623,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1684,10 +1672,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1797,6 +1785,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2024,31 +2020,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2082,6 +2059,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2092,16 +2104,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2117,6 +2127,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2128,27 +2144,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2234,8 +2257,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2274,7 +2299,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index 554f4d68f394..a6f858a04442 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/Hatchbox_Alpha/Configuration.h b/config/examples/delta/Hatchbox_Alpha/Configuration.h index a93d2edb74d0..4d19421b9e18 100644 --- a/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -75,13 +75,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -94,10 +90,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -134,18 +133,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_GEN_13 #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Hatchbox Alpha" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -282,7 +279,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -326,9 +330,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -353,17 +358,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -375,13 +383,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -399,8 +409,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -524,7 +532,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -634,8 +642,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -787,7 +793,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -802,18 +808,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 500, 200 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -827,35 +843,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 20.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.053 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -973,50 +992,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1028,10 +1032,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#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] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1065,7 +1069,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1324,12 +1328,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1643,7 +1641,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1653,8 +1651,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1699,10 +1700,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1811,6 +1812,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2038,31 +2047,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2096,6 +2086,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2106,16 +2131,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2131,6 +2154,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2142,27 +2171,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2248,8 +2284,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2288,7 +2326,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/MKS/SBASE/Configuration.h b/config/examples/delta/MKS/SBASE/Configuration.h index df2d9558a268..35846af58f06 100644 --- a/config/examples/delta/MKS/SBASE/Configuration.h +++ b/config/examples/delta/MKS/SBASE/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_SBASE #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Deltabot" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,9 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - #define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + #define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +352,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +377,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +403,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 0 @@ -514,7 +521,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -619,8 +626,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -772,7 +777,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 426.67 @@ -787,18 +792,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 500, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -812,35 +827,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -958,50 +976,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1013,10 +1016,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, -10, -3.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1050,7 +1053,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1309,12 +1312,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1368,19 +1365,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1628,7 +1612,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1638,8 +1622,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1684,10 +1671,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1796,6 +1783,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2023,31 +2018,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2081,6 +2057,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2091,16 +2102,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2116,6 +2125,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2127,27 +2142,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2233,8 +2255,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2273,7 +2297,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/MKS/SBASE/Configuration_adv.h b/config/examples/delta/MKS/SBASE/Configuration_adv.h index d7705ad05757..769ef13f311a 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/Tevo Little Monster/Configuration.h b/config/examples/delta/Tevo Little Monster/Configuration.h index e134b4dc2fcd..08639402183a 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration.h +++ b/config/examples/delta/Tevo Little Monster/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(HEINRICHS)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MKS_GEN_L #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "TEVO Little Monster" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -623,8 +631,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes - #define DELTA_CALIBRATION_RADIUS 140 // (mm) // Set the steprate for papertest probing #define PROBE_MANUALLY_STEP 0.05 // (mm) #endif @@ -776,7 +782,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -791,18 +797,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 25000, 25000, 25000, 5000 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -816,35 +832,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 5000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.008 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -962,50 +981,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1017,10 +1021,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 20 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.10 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 20, -1.10 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 20 @@ -1054,7 +1058,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1313,12 +1317,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1372,19 +1370,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1632,7 +1617,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1642,8 +1627,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1688,10 +1676,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1800,6 +1788,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2027,31 +2023,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2085,6 +2062,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2095,16 +2107,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2120,6 +2130,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2131,27 +2147,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2237,8 +2260,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2277,7 +2302,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/config/examples/delta/Tevo Little Monster/Configuration_adv.h index 847e4aa71424..2e7bc1790e77 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/generic/Configuration.h b/config/examples/delta/generic/Configuration.h index f7eb796d088e..85a4ca2505bc 100644 --- a/config/examples/delta/generic/Configuration.h +++ b/config/examples/delta/generic/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Deltabot" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -619,8 +627,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -772,7 +778,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -787,18 +793,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 500, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -812,35 +828,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -958,50 +977,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1013,10 +1017,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, -10, -3.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1050,7 +1054,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1309,12 +1313,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1368,19 +1366,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1628,7 +1613,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1638,8 +1623,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1684,10 +1672,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1796,6 +1784,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2023,31 +2019,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2081,6 +2058,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2091,16 +2103,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2116,6 +2126,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2127,27 +2143,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2233,8 +2256,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2273,7 +2298,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/generic/Configuration_adv.h b/config/examples/delta/generic/Configuration_adv.h index 3e242444737e..e845a3eae2ca 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/kossel_mini/Configuration.h b/config/examples/delta/kossel_mini/Configuration.h index 103cfe52f1a8..b9344b7b6c95 100644 --- a/config/examples/delta/kossel_mini/Configuration.h +++ b/config/examples/delta/kossel_mini/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Mini Kossel" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 7 #define TEMP_SENSOR_1 0 @@ -514,7 +522,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -619,8 +627,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -772,7 +778,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -787,18 +793,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 500, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -812,35 +828,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -959,51 +978,36 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #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 - #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 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) - - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 + + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1015,10 +1019,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, -10, -3.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1052,7 +1056,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1311,12 +1315,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1370,19 +1368,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1630,7 +1615,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1640,8 +1625,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1686,10 +1674,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1798,6 +1786,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2025,31 +2021,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2083,6 +2060,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2093,16 +2105,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2118,6 +2128,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2129,27 +2145,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2235,8 +2258,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2275,7 +2300,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/kossel_mini/Configuration_adv.h b/config/examples/delta/kossel_mini/Configuration_adv.h index 3e242444737e..e845a3eae2ca 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/delta/kossel_pro/Configuration.h b/config/examples/delta/kossel_pro/Configuration.h index ad56cf4fd0ec..6353e6593c01 100644 --- a/config/examples/delta/kossel_pro/Configuration.h +++ b/config/examples/delta/kossel_pro/Configuration.h @@ -74,13 +74,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -93,10 +89,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -133,18 +132,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_BRAINWAVE_PRO #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Kossel Pro" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -281,7 +278,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -325,9 +329,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -352,17 +357,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -374,13 +382,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -398,8 +408,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -506,7 +514,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //Kossel Pro heated bed plate with borosilicate glass @@ -605,8 +613,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -765,7 +771,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -780,18 +786,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 200, 200 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 9000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -805,35 +821,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -952,55 +971,38 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Pro - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { -105.00, 0.00, 100.0 } // Move left but not quite so far that we'll bump the belt #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { -110.00, -125.00, 100.0 } // Move outward to position deploy pin to the left of the arm #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { -110.00 * 0.75, -125.00 * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X 45.00 // Move right to trigger deploy pin - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z Z_PROBE_ALLEN_KEY_DEPLOY_3_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_4 { 45.00, -125.00, 100.0 } // Move right to trigger deploy pin #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip - #define Z_PROBE_ALLEN_KEY_STOW_1_Y -125.00 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { 36.00, -125.00, 75.0 } // Line up with bed retaining clip #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X // move down to retract probe - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { 36.00, -125.00, 0.0 } // move down to retract probe #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { 0.0, 0.0, 100.0 } // return to 0,0,100 #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 100.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1012,14 +1014,15 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -23 // KosselPro actual: -22.919 -#define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // KosselPro actual: -6.304 +#define NOZZLE_TO_PROBE_OFFSET { -23, -6, -17.25 } // KosselPro actual: -22.919, -6.304, -17.45 /** * Kossel Pro note: The correct value is likely -17.45 but I'd rather err on the side of * not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed. */ -#define Z_PROBE_OFFSET_FROM_EXTRUDER -17.25 // Increase this if the first layer is too thin (remember: it's a negative number so increase means closer to zero). + // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1052,7 +1055,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1312,12 +1315,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1371,19 +1368,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1631,7 +1615,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1641,8 +1625,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1687,10 +1674,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1799,6 +1786,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2026,31 +2021,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2084,6 +2060,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2094,16 +2105,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2119,6 +2128,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2130,27 +2145,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2236,8 +2258,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2276,7 +2300,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/kossel_xl/Configuration.h b/config/examples/delta/kossel_xl/Configuration.h index 16fc46fd4ac1..8107a8b3df12 100644 --- a/config/examples/delta/kossel_xl/Configuration.h +++ b/config/examples/delta/kossel_xl/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(oxivanisher)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "Kossel k800XL" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH true // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH true // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -518,7 +526,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -623,8 +631,6 @@ #endif #if EITHER(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - // Set the radius for the calibration probe points - max 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) #endif @@ -775,7 +781,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ // variables to calculate steps #define XYZ_FULL_STEPS_PER_ROTATION 200 @@ -790,18 +796,28 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 200, 200, 200, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -815,35 +831,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK DEFAULT_XJERK #define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 20.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -961,50 +980,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1016,10 +1020,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle X offset: -left +right -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle Y offset: -front +behind -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.3 // Z probe to nozzle Z offset: -below (always!) +#define NOZZLE_TO_PROBE_OFFSET { 0.0, 0.0, 0.3 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1053,7 +1057,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1312,12 +1316,6 @@ #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) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1371,19 +1369,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1631,7 +1616,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1641,8 +1626,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1687,10 +1675,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1799,6 +1787,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -2026,31 +2022,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -2084,6 +2061,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -2094,16 +2106,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2119,6 +2129,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2130,27 +2146,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2236,8 +2259,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2276,7 +2301,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/kossel_xl/Configuration_adv.h b/config/examples/delta/kossel_xl/Configuration_adv.h index 614d1ea5252b..9db572042e46 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,21 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full // (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) @@ -739,8 +793,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +891,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -851,8 +915,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -866,6 +957,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -877,23 +980,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -926,8 +1012,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1007,17 +1096,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1039,7 +1142,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1132,14 +1235,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1170,7 +1373,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1219,6 +1423,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1276,10 +1516,10 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1291,7 +1531,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1366,6 +1607,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1423,19 +1667,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1509,8 +1753,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1638,81 +1882,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1751,6 +2015,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1842,17 +2109,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1867,8 +2146,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1890,8 +2173,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1922,7 +2205,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1930,7 +2213,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1938,7 +2221,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1946,7 +2229,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1954,7 +2237,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1962,7 +2245,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1970,7 +2253,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1978,7 +2261,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1986,7 +2269,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1994,7 +2277,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2002,7 +2285,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2010,7 +2293,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2018,7 +2301,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2223,6 +2506,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2277,6 +2567,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2334,9 +2631,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2418,6 +2718,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2436,6 +2752,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/gCreate/gMax1.5+/Configuration.h b/config/examples/gCreate/gMax1.5+/Configuration.h index f9870b6967d9..5751d05d4274 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/config/examples/gCreate/gMax1.5+/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,8 +128,7 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD //#define MOTHERBOARD BOARD_RAMPS_14_EEF #define MOTHERBOARD BOARD_RAMPS_14_EFB // gMax users please note: This is a Roxy modification. I print on glass and @@ -140,12 +138,11 @@ // temp. #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "gMax" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -282,7 +279,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -326,9 +330,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -353,17 +358,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -375,13 +383,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -399,8 +409,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -527,7 +535,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -721,25 +729,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 96 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 25, 25 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 800, 800, 700, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -753,35 +771,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 400 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.5 #define DEFAULT_YJERK 8.5 #define DEFAULT_ZJERK 0.7 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 4.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.058 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -895,11 +916,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +931,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -17 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -0.25 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -17, -10, -0.25 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 45 @@ -948,7 +968,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1207,12 +1227,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1527,7 +1541,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1537,8 +1551,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1583,10 +1600,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1695,6 +1712,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1922,31 +1947,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1980,6 +1986,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1990,16 +2031,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2015,6 +2054,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2026,27 +2071,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2132,8 +2184,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2172,7 +2226,7 @@ */ #define NUM_SERVOS 2 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300, 300 } diff --git a/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 97422d1e12da..6b2688587263 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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 3 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_Z 3 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 3 #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/makibox/Configuration.h b/config/examples/makibox/Configuration.h index 09a9cc3aeef1..cee762270057 100644 --- a/config/examples/makibox/Configuration.h +++ b/config/examples/makibox/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_5DPRINT #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu #define CUSTOM_MACHINE_NAME "MakiBox" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -517,7 +525,7 @@ // drawing too much current from the power supply. #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -711,25 +719,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 400, 400, 400, 163 } // default steps per unit for ***** MakiBox A6 ***** /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 60, 60, 20, 45 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 2000, 2000, 30, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -743,35 +761,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -846,7 +867,7 @@ /** * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ -//#define BLTOUCH +#define BLTOUCH /** * Touch-MI Probe by hotends.fr @@ -885,11 +906,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -901,10 +921,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -938,7 +958,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1196,12 +1216,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1255,19 +1269,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1516,7 +1517,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1526,8 +1527,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1572,10 +1576,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1684,6 +1688,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1911,31 +1923,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1969,6 +1962,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1979,16 +2007,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2004,6 +2030,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2015,27 +2047,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2121,8 +2160,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2161,7 +2202,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/makibox/Configuration_adv.h b/config/examples/makibox/Configuration_adv.h index e2c9d81bcefc..79ad5222e145 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/tvrrug/Round2/Configuration.h b/config/examples/tvrrug/Round2/Configuration.h index c19a99136583..b8938da0075c 100644 --- a/config/examples/tvrrug/Round2/Configuration.h +++ b/config/examples/tvrrug/Round2/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_OMCA #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 5 #define TEMP_SENSOR_1 0 @@ -503,7 +511,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -697,7 +705,7 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 71.1, 71.1, 2560, 600 } // David TVRR @@ -708,20 +716,30 @@ /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 45 } // David TVRR +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 9000, 9000, 100, 10000 } /* MICHEL: This has an impact on the "ripples" in print walls */ +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -735,35 +753,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -877,11 +898,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -893,10 +913,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -930,7 +950,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1188,12 +1208,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1247,19 +1261,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1508,7 +1509,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1518,8 +1519,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1564,10 +1568,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1676,6 +1680,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1903,31 +1915,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1961,6 +1954,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1971,16 +1999,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -1996,6 +2022,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2007,27 +2039,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2113,8 +2152,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2153,7 +2194,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/tvrrug/Round2/Configuration_adv.h b/config/examples/tvrrug/Round2/Configuration_adv.h index 398f5f28313e..c62c717449d6 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ #define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - #define CONTROLLER_FAN_PIN 23 // 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 + #define CONTROLLER_FAN_PIN 23 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -835,6 +890,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -849,8 +913,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + //#define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -864,6 +955,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -875,23 +978,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -924,8 +1010,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1005,17 +1094,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1037,7 +1140,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1130,14 +1233,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1168,7 +1371,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1217,6 +1421,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1277,7 +1517,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1289,7 +1529,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1364,6 +1605,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1421,19 +1665,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1507,8 +1751,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1636,81 +1880,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1749,6 +2013,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1840,17 +2107,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1865,8 +2144,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1888,8 +2171,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1920,7 +2203,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1928,7 +2211,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1936,7 +2219,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1944,7 +2227,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1952,7 +2235,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1960,7 +2243,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1968,7 +2251,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1976,7 +2259,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1984,7 +2267,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1992,7 +2275,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2000,7 +2283,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2008,7 +2291,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2016,7 +2299,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2221,6 +2504,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2275,6 +2565,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2332,9 +2629,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2416,6 +2716,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2434,6 +2750,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/config/examples/wt150/Configuration.h b/config/examples/wt150/Configuration.h index a144fe7a9b5d..08f377ed29a8 100644 --- a/config/examples/wt150/Configuration.h +++ b/config/examples/wt150/Configuration.h @@ -70,13 +70,9 @@ // @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. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, wt150)" // 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) /** * *** VENDORS PLEASE READ *** @@ -89,10 +85,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +128,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_MIGHTYBOARD_REVE #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "Weistek WT150" -// 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) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "5f0bb7a3-0e14-428c-812b-15ab0d3ecc71" // @section extruder @@ -277,7 +274,14 @@ #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis - #define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #endif @@ -321,9 +325,10 @@ //#define PSU_NAME "Power Supply" #if ENABLED(PSU_CONTROL) - #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box - //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) @@ -348,17 +353,20 @@ * * Temperature sensors available: * + * -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1) + * -3 : thermocouple with MAX31855 (only for sensors 0-1) + * -2 : thermocouple with MAX6675 (only for sensors 0-1) * -4 : thermocouple with AD8495 - * -3 : thermocouple with MAX31855 (only for sensor 0) - * -2 : thermocouple with MAX6675 (only for sensor 0) * -1 : thermocouple with AD595 * 0 : not used * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) * 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 + * 512 : 100k RPW-Ultra hotend thermistor (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) @@ -370,13 +378,15 @@ * 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 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 66 : 4.7M High Temperature thermistor from Dyze Design * 67 : 450C thermistor from SliceEngineering * 70 : the 100K thermistor found in the bq Hephestos 2 * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines) * * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. * (but gives greater accuracy and more stable PID) @@ -394,8 +404,6 @@ * Use these for Testing or Development purposes. NEVER for production machine. * 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'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '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", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C 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", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 -2 #define TEMP_SENSOR_1 0 @@ -519,7 +527,7 @@ #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #if ENABLED(PIDTEMPBED) - + //#define MIN_BED_POWER 0 //#define PID_BED_DEBUG // Sends debug data to the serial port. //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) @@ -713,25 +721,35 @@ /** * Default Axis Steps Per Unit (steps/mm) * Override with M92 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_AXIS_STEPS_PER_UNIT { 71.699959, 71.699959, 71.699959, 100.470955 } /** * Default Max Feed Rate (mm/s) * Override with M203 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_FEEDRATE { 83.333333, 83.333333, 19.5, 26.666666 } +//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 +#if ENABLED(LIMITED_MAX_FR_EDITING) + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits +#endif + /** * Default Max Acceleration (change/s) change = mm/s * (Maximum start speed for accelerated moves) * Override with M201 - * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + * X, Y, Z, E0 [, E1[, E2...]] */ #define DEFAULT_MAX_ACCELERATION { 1200, 1200, 100, 10000 } +//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 +#if ENABLED(LIMITED_MAX_ACCEL_EDITING) + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits +#endif + /** * Default Acceleration (change/s) change = mm/s * Override with M204 @@ -745,35 +763,38 @@ #define DEFAULT_TRAVEL_ACCELERATION 1200 // X, Y, Z acceleration for travel (non printing) moves /** - * Junction Deviation - * - * Use Junction Deviation instead of traditional Jerk Limiting - * - * See: - * https://reprap.org/forum/read.php?1,739819 - * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html - */ -//#define JUNCTION_DEVIATION -#if ENABLED(JUNCTION_DEVIATION) - #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge -#endif - -/** - * Default Jerk (mm/s) + * Default Jerk limits (mm/s) * Override with M205 X Y Z E * * "Jerk" specifies the minimum speed change that requires acceleration. * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if DISABLED(JUNCTION_DEVIATION) +//#define CLASSIC_JERK +#if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 8.0 #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.3 + + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 + #if ENABLED(LIMITED_JERK_EDITING) + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #endif #endif #define DEFAULT_EJERK 5.0 // May be used by Linear Advance +/** + * Junction Deviation Factor + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +#if DISABLED(CLASSIC_JERK) + #define JUNCTION_DEVIATION_MM 0.021 // (mm) Distance from real junction edge +#endif + /** * S-Curve Acceleration * @@ -887,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -903,10 +923,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -940,7 +960,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1198,12 +1218,6 @@ #define GRID_MAX_POINTS_X 3 #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)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1257,19 +1271,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, 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. @@ -1518,7 +1519,7 @@ #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_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1528,8 +1529,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1574,10 +1578,10 @@ * * Select the language to display on the LCD. These languages are available: * - * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, - * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, + * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * - * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } */ #define LCD_LANGUAGE en @@ -1686,6 +1690,14 @@ // //#define REVERSE_MENU_DIRECTION +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + // // Individual Axis Homing // @@ -1913,31 +1925,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1971,6 +1964,41 @@ // //#define ANET_FULL_GRAPHICS_LCD +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/item/32837222770.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER // http://reprap.org/wiki/MKS_12864OLED @@ -1981,16 +2009,14 @@ //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller // -// AZSMZ 12864 LCD with SD -// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// Einstart S OLED SSD1306 // -//#define AZSMZ_12864 +//#define U8GLIB_SH1106_EINSTART // -// Silvergate GLCD controller -// http://github.com/android444/Silvergate +// Overlord OLED display/controller with i2c buzzer and LEDs // -//#define SILVER_GATE_GLCD_CONTROLLER +//#define OVERLORD_OLED //============================================================================= //========================== Extensible UI Displays =========================== @@ -2006,6 +2032,12 @@ // //#define MALYAN_LCD +// +// Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define TOUCH_UI_FTDI_EVE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extensible_ui'. @@ -2017,27 +2049,34 @@ //============================================================================= // -// MKS Robin 320x240 color display +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // -//#define MKS_ROBIN_TFT +//#define FSMC_GRAPHICAL_TFT //============================================================================= //============================ Other Controllers ============================ //============================================================================= // -// CONTROLLER TYPE: Keypad / Add-on +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // +//#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 +#endif // // 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 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2123,8 +2162,10 @@ //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - #define NEOPIXEL_PIN 4 // LED driving pin - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup @@ -2163,7 +2204,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/wt150/Configuration_adv.h b/config/examples/wt150/Configuration_adv.h index 1364fd27d192..4af852d18ad8 100644 --- a/config/examples/wt150/Configuration_adv.h +++ b/config/examples/wt150/Configuration_adv.h @@ -197,6 +197,56 @@ #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) #define LPQ_MAX_LEN 50 #endif + + /** + * Add an experimental additional term to the heater power, proportional to the fan speed. + * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. + * You can either just add a constant compensation with the DEFAULT_Kf value + * or follow the instruction below to get speed-dependent compensation. + * + * Constant compensation (use only with fanspeeds of 0% and 100%) + * --------------------------------------------------------------------- + * A good starting point for the Kf-value comes from the calculation: + * kf = (power_fan * eff_fan) / power_heater * 255 + * where eff_fan is between 0.0 and 1.0, based on fan-efficiency and airflow to the nozzle / heater. + * + * Example: + * Heater: 40W, Fan: 0.1A * 24V = 2.4W, eff_fan = 0.8 + * Kf = (2.4W * 0.8) / 40W * 255 = 12.24 + * + * Fan-speed dependent compensation + * -------------------------------- + * 1. To find a good Kf value, set the hotend temperature, wait for it to settle, and enable the fan (100%). + * Make sure PID_FAN_SCALING_LIN_FACTOR is 0 and PID_FAN_SCALING_ALTERNATIVE_DEFINITION is not enabled. + * If you see the temperature drop repeat the test, increasing the Kf value slowly, until the temperature + * drop goes away. If the temperature overshoots after enabling the fan, the Kf value is too big. + * 2. Note the Kf-value for fan-speed at 100% + * 3. Determine a good value for PID_FAN_SCALING_MIN_SPEED, which is around the speed, where the fan starts moving. + * 4. Repeat step 1. and 2. for this fan speed. + * 5. Enable PID_FAN_SCALING_ALTERNATIVE_DEFINITION and enter the two identified Kf-values in + * PID_FAN_SCALING_AT_FULL_SPEED and PID_FAN_SCALING_AT_MIN_SPEED. Enter the minimum speed in PID_FAN_SCALING_MIN_SPEED + */ + //#define PID_FAN_SCALING + #if ENABLED(PID_FAN_SCALING) + //#define PID_FAN_SCALING_ALTERNATIVE_DEFINITION + #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) + // The alternative definition is used for an easier configuration. + // Just figure out Kf at fullspeed (255) and PID_FAN_SCALING_MIN_SPEED. + // DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly. + + #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf + #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf + #define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING + + #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) + #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 + + #else + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define DEFAULT_Kf 10 // A constant value added to the PID-tuner + #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING + #endif + #endif #endif /** @@ -214,7 +264,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -279,9 +329,10 @@ */ //#define USE_CONTROLLER_FAN #if ENABLED(USE_CONTROLLER_FAN) - //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLER_FAN_PIN -1 // 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 + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled #endif // When first starting the main fan, run it at full speed for the @@ -289,6 +340,9 @@ // before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) //#define FAN_KICKSTART_TIME 100 +// Some coolers may require a non-zero "off" state. +//#define FAN_OFF_PWM 1 + /** * PWM Fan Scaling * @@ -378,6 +432,7 @@ #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #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 CASE_LIGHT_MAX_PWM 128 // Limit pwm //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. @@ -601,25 +656,37 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } } + + // Provide Z stepper positions for more rapid convergence in bed alignment. + // Currently requires triple stepper drivers. + //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + // Define Stepper XY positions for Z1, Z2, Z3 corresponding to + // the Z screw positions in the bed carriage. + // Define one position per Z stepper in stepper driver order. + #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + #else + // Amplification factor. Used to scale the correction step up or down. + // In case the stepper (spindle) position is further out than the test point. + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + #endif + // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation #define RESTORE_LEVELING_AFTER_G34 // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle - // Use the amplification factor to de-/increase correction step. - // In case the stepper (spindle) position is further out than the test point - // Use a value > 1. NOTE: This may cause instability - #define Z_STEPPER_ALIGN_AMP 1.0 // Stop criterion. If the accuracy is better than this stop iterating early #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -646,20 +713,8 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - -// minimum time in microseconds that a movement needs to take if the buffer is emptied. -#define DEFAULT_MINSEGMENTTIME 20000 +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) // If defined the movements slow down when the look ahead buffer is only half full #define SLOWDOWN @@ -737,8 +792,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +891,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -850,8 +914,35 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -// Include a page of printer information in the LCD Main Menu -#define LCD_INFO_MENU +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -865,6 +956,18 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY +// Show the E position (filament used) during printing +//#define LCD_SHOW_E_TOTAL + +#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS + //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits + //#define SHOW_REMAINING_TIME // Display estimated time to completion + #if ENABLED(SHOW_REMAINING_TIME) + //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation + //#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time + #endif +#endif + #if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) @@ -876,23 +979,6 @@ #endif #endif -/** - * LED Control Menu - * Enable this feature to add LED Control to the LCD menu - */ -//#define LED_CONTROL_MENU -#if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif -#endif // LED_CONTROL_MENU - #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work @@ -925,8 +1011,11 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -1006,17 +1095,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1038,7 +1141,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1131,14 +1234,114 @@ //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options //#define MARLIN_BRICKOUT //#define MARLIN_INVADERS //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD +// +// Touch UI for the FTDI Embedded Video Engine (EVE) +// +#if ENABLED(TOUCH_UI_FTDI_EVE) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG + + // Developer menu (accessed by touching "About Printer" copyright text) + //#define TOUCH_UI_DEVELOPER_MENU +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1169,7 +1372,8 @@ //#define BABYSTEP_WITHOUT_HOMING //#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_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR_XY 1 //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) @@ -1218,6 +1422,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, 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 + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1278,7 +1518,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and 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 @@ -1290,7 +1530,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1365,6 +1606,9 @@ //#define SERIAL_XON_XOFF #endif +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + #if ENABLED(SDSUPPORT) // Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. @@ -1422,19 +1666,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion - #endif - #define RETRACT_LENGTH 3 // Default retract length (positive mm) - #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change - #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) - #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) - #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1508,8 +1752,8 @@ //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. // 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_RETRACT 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_PURGE_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. @@ -1637,81 +1881,101 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. - #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.11 + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #endif #if AXIS_IS_TMC(X2) - #define X2_CURRENT 800 - #define X2_MICROSTEPS 16 - #define X2_RSENSE 0.11 + #define X2_CURRENT 800 + #define X2_CURRENT_HOME X2_CURRENT + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 - #define Y_MICROSTEPS 16 - #define Y_RSENSE 0.11 + #define Y_CURRENT 800 + #define Y_CURRENT_HOME Y_CURRENT + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Y2) - #define Y2_CURRENT 800 - #define Y2_MICROSTEPS 16 - #define Y2_RSENSE 0.11 + #define Y2_CURRENT 800 + #define Y2_CURRENT_HOME Y2_CURRENT + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 - #define Z_MICROSTEPS 16 - #define Z_RSENSE 0.11 + #define Z_CURRENT 800 + #define Z_CURRENT_HOME Z_CURRENT + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z2) - #define Z2_CURRENT 800 - #define Z2_MICROSTEPS 16 - #define Z2_RSENSE 0.11 + #define Z2_CURRENT 800 + #define Z2_CURRENT_HOME Z2_CURRENT + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(Z3) - #define Z3_CURRENT 800 - #define Z3_MICROSTEPS 16 - #define Z3_RSENSE 0.11 + #define Z3_CURRENT 800 + #define Z3_CURRENT_HOME Z3_CURRENT + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 - #define E0_MICROSTEPS 16 - #define E0_RSENSE 0.11 + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E1) - #define E1_CURRENT 800 - #define E1_MICROSTEPS 16 - #define E1_RSENSE 0.11 + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E2) - #define E2_CURRENT 800 - #define E2_MICROSTEPS 16 - #define E2_RSENSE 0.11 + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E3) - #define E3_CURRENT 800 - #define E3_MICROSTEPS 16 - #define E3_RSENSE 0.11 + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E4) - #define E4_CURRENT 800 - #define E4_MICROSTEPS 16 - #define E4_RSENSE 0.11 + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS -1 #endif #if AXIS_IS_TMC(E5) - #define E5_CURRENT 800 - #define E5_MICROSTEPS 16 - #define E5_RSENSE 0.11 + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS -1 #endif /** @@ -1750,6 +2014,9 @@ * 1 | HIGH | LOW * 2 | LOW | HIGH * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 0 @@ -1841,17 +2108,29 @@ #define E5_HYBRID_THRESHOLD 30 /** + * Use StallGuard2 to home / probe X, Y, Z. + * * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only - * Use StallGuard2 to sense an obstacle and trigger an endstop. * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_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 + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + * + * TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING */ //#define SENSORLESS_HOMING // StallGuard capable drivers only @@ -1866,8 +2145,12 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define HOME_USING_SPREADCYCLE + //#define IMPROVE_HOMING_RELIABILITY #endif /** @@ -1889,8 +2172,8 @@ * * Example: * #define TMC_ADV() { \ - * stepperX.diag0_temp_prewarn(1); \ - * stepperY.interpolate(0); \ + * stepperX.diag0_otpw(1); \ + * stepperY.intpol(0); \ * } */ #define TMC_ADV() { } @@ -1921,7 +2204,7 @@ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI) #endif #if AXIS_DRIVER_TYPE_X2(L6470) @@ -1929,7 +2212,7 @@ #define X2_OVERCURRENT 2000 #define X2_STALLCURRENT 1500 #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS 0 + #define X2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y(L6470) @@ -1937,7 +2220,7 @@ #define Y_OVERCURRENT 2000 #define Y_STALLCURRENT 1500 #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS 0 + #define Y_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Y2(L6470) @@ -1945,7 +2228,7 @@ #define Y2_OVERCURRENT 2000 #define Y2_STALLCURRENT 1500 #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS 0 + #define Y2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z(L6470) @@ -1953,7 +2236,7 @@ #define Z_OVERCURRENT 2000 #define Z_STALLCURRENT 1500 #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS 0 + #define Z_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z2(L6470) @@ -1961,7 +2244,7 @@ #define Z2_OVERCURRENT 2000 #define Z2_STALLCURRENT 1500 #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS 0 + #define Z2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_Z3(L6470) @@ -1969,7 +2252,7 @@ #define Z3_OVERCURRENT 2000 #define Z3_STALLCURRENT 1500 #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS 0 + #define Z3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E0(L6470) @@ -1977,7 +2260,7 @@ #define E0_OVERCURRENT 2000 #define E0_STALLCURRENT 1500 #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS 0 + #define E0_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E1(L6470) @@ -1985,7 +2268,7 @@ #define E1_OVERCURRENT 2000 #define E1_STALLCURRENT 1500 #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS 0 + #define E1_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E2(L6470) @@ -1993,7 +2276,7 @@ #define E2_OVERCURRENT 2000 #define E2_STALLCURRENT 1500 #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS 0 + #define E2_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E3(L6470) @@ -2001,7 +2284,7 @@ #define E3_OVERCURRENT 2000 #define E3_STALLCURRENT 1500 #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS 0 + #define E3_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E4(L6470) @@ -2009,7 +2292,7 @@ #define E4_OVERCURRENT 2000 #define E4_STALLCURRENT 1500 #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS 0 + #define E4_CHAIN_POS -1 #endif #if AXIS_DRIVER_TYPE_E5(L6470) @@ -2017,7 +2300,7 @@ #define E5_OVERCURRENT 2000 #define E5_STALLCURRENT 1500 #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS 0 + #define E5_CHAIN_POS -1 #endif /** @@ -2222,6 +2505,13 @@ */ #define EXTENDED_CAPABILITIES_REPORT +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + /** * Disable all Volumetric extrusion options */ @@ -2276,6 +2566,13 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + /** * G-code Macros * @@ -2333,9 +2630,12 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== +/** + * Cancel Objects + * + * Implement M486 to allow Marlin to skip objects + */ +//#define CANCEL_OBJECTS /** * I2C position encoders for closed loop control. @@ -2417,6 +2717,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * @@ -2435,6 +2751,7 @@ #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side /** * Sample debug features diff --git a/platformio.ini b/platformio.ini index 78b7fd2c446c..c860abf802e4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,20 +25,26 @@ env_default = LPC1768 [common] default_src_filter = + - - + -build_flags = -fmax-errors=5 - -g - -ggdb +extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py +build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants lib_deps = - https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip LiquidCrystal@1.3.4 - TMCStepper@<1.0.0 - Adafruit NeoPixel@1.1.3 - https://github.com/lincomatic/LiquidTWI2/archive/30aa480.zip - https://github.com/ameyer/Arduino-L6470/archive/dev.zip - https://github.com/trinamic/TMC26XStepper/archive/c1921b4.zip - https://github.com/mikeshub/SailfishLCD.git - https://github.com/mikeshub/SailfishRGB_LED.git - https://github.com/mikeshub/SlowSoftI2CMaster.git + TMCStepper@>=0.5.2,<1.0.0 + Adafruit NeoPixel@1.2.5 + Adafruit_MAX31865=https://github.com/adafruit/Adafruit_MAX31865/archive/master.zip + LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip + Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/dev.zip + SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip + SailfishRGB_LED=https://github.com/mikeshub/SailfishRGB_LED/archive/master.zip + SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip + +# Globally defined properties +# inherited by all environments +[env] +framework = arduino +build_flags = ${common.build_flags} +lib_deps = ${common.lib_deps} ################################# # # @@ -55,11 +61,10 @@ lib_deps = # [env:megaatmega2560] platform = atmelavr -framework = arduino board = megaatmega2560 -build_flags = ${common.build_flags} board_build.f_cpu = 16000000L lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = ${common.default_src_filter} + monitor_speed = 250000 @@ -68,14 +73,87 @@ monitor_speed = 250000 # [env:megaatmega1280] platform = atmelavr -framework = arduino board = megaatmega1280 -build_flags = ${common.build_flags} board_build.f_cpu = 16000000L lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 + +# +# RAMBo +# +[env:rambo] +platform = atmelavr +board = reprap_rambo +board_build.f_cpu = 16000000L +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = ${common.default_src_filter} + monitor_speed = 250000 +# +# FYSETC F6 V1.3 +# +[env:FYSETC_F6_13] +platform = atmelavr +board = fysetc_f6_13 +board_build.f_cpu = 16000000L +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 + +# +# Sanguinololu (ATmega644p) +# +[env:sanguino_atmega644p] +platform = atmelavr +board = sanguino_atmega644p +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 + +# +# Sanguinololu (ATmega1284p) +# +[env:sanguino_atmega1284p] +platform = atmelavr +board = sanguino_atmega1284p +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 + +# +# Melzi and clones (ATmega1284p) +# +[env:melzi] +platform = atmelavr +board = sanguino_atmega1284p +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 +build_flags = ${common.build_flags} +lib_ignore = TMCStepper +upload_speed = 57600 + +# +# Melzi and clones (Optiboot bootloader) +# +[env:melzi_optiboot] +platform = atmelavr +board = sanguino_atmega1284p +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 +build_flags = ${common.build_flags} +lib_ignore = TMCStepper +upload_speed = 115200 + # # AT90USB1286 boards using CDC bootloader # - BRAINWAVE @@ -85,12 +163,10 @@ monitor_speed = 250000 # [env:at90usb1286_cdc] platform = teensy -framework = arduino board = at90usb1286 -build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = ${common.default_src_filter} + -extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_CDC.py monitor_speed = 250000 # @@ -101,12 +177,10 @@ monitor_speed = 250000 # [env:at90usb1286_dfu] platform = teensy -framework = arduino board = at90usb1286 -build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = ${common.default_src_filter} + -extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_DFU.py monitor_speed = 250000 # @@ -117,43 +191,33 @@ monitor_speed = 250000 # [env:DUE] platform = atmelsam -framework = arduino board = due -build_flags = ${common.build_flags} -lib_deps = ${common.lib_deps} -lib_ignore = c1921b4 src_filter = ${common.default_src_filter} + monitor_speed = 250000 + [env:DUE_USB] platform = atmelsam -framework = arduino board = dueUSB -build_flags = ${common.build_flags} -lib_deps = ${common.lib_deps} -lib_ignore = c1921b4 src_filter = ${common.default_src_filter} + monitor_speed = 250000 + [env:DUE_debug] # Used when WATCHDOG_RESET_MANUAL is enabled platform = atmelsam -framework = arduino board = due +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 build_flags = ${common.build_flags} -funwind-tables -mpoke-function-name -lib_deps = ${common.lib_deps} -lib_ignore = c1921b4 -src_filter = ${common.default_src_filter} + -monitor_speed = 250000 # # NXP LPC176x ARM Cortex-M3 # [env:LPC1768] -platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/master.zip -framework = arduino +platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.2.zip board = nxp_lpc1768 -build_flags = -DTARGET_LPC1768 -DU8G_HAL_LINKS -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags} +build_flags = -DU8G_HAL_LINKS -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags} # debug options for backtrace # -funwind-tables # -mpoke-function-name @@ -164,16 +228,15 @@ src_filter = ${common.default_src_filter} + monitor_speed = 250000 lib_deps = Servo LiquidCrystal - U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip - TMCStepper@<1.0.0 - Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/master.zip - https://github.com/mikeshub/SailfishLCD.git + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip + TMCStepper@>=0.6.1,<1.0.0 + Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/release.zip + SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip [env:LPC1769] -platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/master.zip -framework = arduino +platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.2.zip board = nxp_lpc1769 -build_flags = -DTARGET_LPC1768 -DLPC1769 -DU8G_HAL_LINKS -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags} +build_flags = -DU8G_HAL_LINKS -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags} # debug options for backtrace # -funwind-tables # -mpoke-function-name @@ -184,277 +247,436 @@ src_filter = ${common.default_src_filter} + monitor_speed = 250000 lib_deps = Servo LiquidCrystal - U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip - TMCStepper@<1.0.0 - Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/master.zip + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip + TMCStepper@>=0.6.1,<1.0.0 + Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/release.zip + SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip # -# Melzi and clones (ATmega1284p) +# STM32F103RC # -[env:melzi] -platform = atmelavr -framework = arduino -board = sanguino_atmega1284p -build_flags = ${common.build_flags} -upload_speed = 57600 -lib_deps = ${common.lib_deps} -lib_ignore = TMCStepper, TMC26XStepper -src_filter = ${common.default_src_filter} + -monitor_speed = 250000 +[env:STM32F103RC] +platform = ststm32 +board = genericSTM32F103RC +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 +build_unflags = -std=gnu++11 +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 115200 # -# Melzi and clones (Optiboot bootloader) +# STM32F103RC_fysetc # -[env:melzi_optiboot] -platform = atmelavr -framework = arduino -board = sanguino_atmega1284p -build_flags = ${common.build_flags} -upload_speed = 115200 -lib_deps = ${common.lib_deps} -lib_ignore = TMCStepper, TMC26XStepper -src_filter = ${common.default_src_filter} + -monitor_speed = 250000 +[env:STM32F103RC_fysetc] +platform = ststm32 +board = genericSTM32F103RC +#board_build.core = maple +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 -DDEBUG_LEVEL=0 -DHAVE_SW_SERIAL +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +lib_ldf_mode = chain +debug_tool = stlink +upload_protocol = serial +monitor_speed = 250000 # -# RAMBo +# BigTree SKR Mini V1.1 / SKR mini E3 / SKR E3 DIP (STM32F103RCT6 ARM Cortex-M3) # -[env:rambo] -platform = atmelavr -framework = arduino -board = reprap_rambo -build_flags = ${common.build_flags} -board_build.f_cpu = 16000000L +# STM32F103RC_bigtree ............. RCT6 with 256K +# STM32F103RC_bigtree_USB ......... RCT6 with 256K (USB mass storage) +# STM32F103RC_bigtree_512K ........ RCT6 with 512K +# STM32F103RC_bigtree_512K_USB .... RCT6 with 512K (USB mass storage) +# + +[env:STM32F103RC_bigtree] +platform = ststm32 +board = genericSTM32F103RC +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py +src_filter = ${common.default_src_filter} + lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + -monitor_speed = 250000 + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 115200 + +[env:STM32F103RC_bigtree_USB] +platform = ststm32 +board = genericSTM32F103RC +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DUSE_USB_COMPOSITE +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 115200 + +[env:STM32F103RC_bigtree_512K] +platform = ststm32 +board = genericSTM32F103RC +board_upload.maximum_size=524288 +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512 +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 115200 + +[env:STM32F103RC_bigtree_512K_USB] +platform = ststm32 +board = genericSTM32F103RC +board_upload.maximum_size=524288 +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512 -DUSE_USB_COMPOSITE +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 115200 # -# Sanguinololu (ATmega644p) +# STM32F103RE # -[env:sanguino_atmega644p] -platform = atmelavr -framework = arduino -board = sanguino_atmega644p -build_flags = ${common.build_flags} -lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + +[env:STM32F103RE] +platform = ststm32 +board = genericSTM32F103RE +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 +build_unflags = -std=gnu++11 +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 115200 + +# +# STM32F103RE_bigtree ............. RET6 +# STM32F103RE_bigtree_USB ......... RET6 (USB mass storage) +# +[env:STM32F103RE_bigtree] +platform = ststm32 +board = genericSTM32F103RE +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +debug_tool = stlink +upload_protocol = stlink +monitor_speed = 115200 + +[env:STM32F103RE_bigtree_USB] +platform = ststm32 +board = genericSTM32F103RE +platform_packages = tool-stm32duino +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DUSE_USB_COMPOSITE +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py +src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip +lib_ignore = Adafruit NeoPixel, SPI +debug_tool = stlink +upload_protocol = stlink +monitor_speed = 115200 + +# +# STM32F4 with STM32GENERIC +# +[env:STM32F4] +platform = ststm32 +board = disco_f407vg +build_flags = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F4 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED +lib_ignore = Adafruit NeoPixel, TMCStepper +src_filter = ${common.default_src_filter} + - monitor_speed = 250000 # -# Sanguinololu (ATmega1284p) +# STM32F7 with STM32GENERIC # -[env:sanguino_atmega1284p] -platform = atmelavr -framework = arduino -board = sanguino_atmega1284p -build_flags = ${common.build_flags} -lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + +[env:STM32F7] +platform = ststm32 +board = remram_v1 +build_flags = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F7 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED +lib_ignore = Adafruit NeoPixel, TMCStepper +src_filter = ${common.default_src_filter} + - monitor_speed = 250000 # -# STM32F103RE +# ARMED (STM32) # -[env:STM32F1] +[env:ARMED] platform = ststm32 -framework = arduino -board = genericSTM32F103RE -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py - ${common.build_flags} -std=gnu++14 -build_unflags = -std=gnu++11 -lib_deps = ${common.lib_deps} -lib_ignore = U8glib-HAL - c1921b4 - libf3c - lib066 - Adafruit NeoPixel_ID28 - Adafruit NeoPixel - libf3e - TMC26XStepper -#lib_ldf_mode = 1 -src_filter = ${common.default_src_filter} + +board = armed_v1 +build_flags = ${common.build_flags} + -DUSBCON -DUSBD_VID=0x0483 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="ARMED_V1"' -DUSBD_USE_CDC + -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -std=gnu11 -std=gnu++11 + -IMarlin/src/HAL/HAL_STM32 +lib_ignore = Adafruit NeoPixel, SoftwareSerial +src_filter = ${common.default_src_filter} + monitor_speed = 250000 # -# fysetc_STM32F1 +# Longer 3D board in Alfawise U20 (STM32F103VET6) # -[env:fysetc_STM32F1] +[env:STM32F103VE_longer] platform = ststm32 -framework = arduino -board = genericSTM32F103RC -#board_build.core = maple -extra_scripts = buildroot/share/PlatformIO/scripts/fysetc_STM32F1.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py - ${common.build_flags} -lib_deps = ${common.lib_deps} -lib_ignore = - c1921b4 - libf3c - lib066 - Adafruit NeoPixel_ID28 - Adafruit NeoPixel - libf3e - TMC26XStepper -lib_ldf_mode = 1 +board = genericSTM32F103VE +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 -USERIAL_USB + -DSTM32F1xx -DU20 -DTS_V12 +build_unflags = -std=gnu++11 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py src_filter = ${common.default_src_filter} + +lib_ignore = Adafruit NeoPixel, LiquidTWI2, SPI monitor_speed = 250000 -debug_tool = stlink -upload_protocol = serial # -# BIGTREE_SKR_MINI +# MKS Robin (STM32F103ZET6) # -[env:BIGTREE_SKR_MINI] +[env:mks_robin] platform = ststm32 -framework = arduino -board = genericSTM32F103RC -extra_scripts = buildroot/share/PlatformIO/scripts/STM32F1_SKR_MINI.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py - ${common.build_flags} -std=gnu++14 +board = genericSTM32F103ZE +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 -DSTM32_XL_DENSITY build_unflags = -std=gnu++11 -lib_deps = ${common.lib_deps} -lib_ignore = - c1921b4 - libf3c - lib066 - Adafruit NeoPixel_ID28 - Adafruit NeoPixel - libf3e - TMC26XStepper -#lib_ldf_mode = 1 +extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin.py src_filter = ${common.default_src_filter} + -monitor_speed = 115200 -upload_protocol = stlink -debug_tool = stlink +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 250000 + # -# STM32F4 +# MKS Robin Pro (STM32F103ZET6) # -[env:STM32F4] +[env:mks_robin_pro] platform = ststm32 -framework = arduino -board = disco_f407vg -build_flags = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB +board = genericSTM32F103ZE +extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_pro.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 -DSTM32_XL_DENSITY +build_unflags = -std=gnu++11 +src_filter = ${common.default_src_filter} + lib_deps = ${common.lib_deps} -lib_ignore = Adafruit NeoPixel, c1921b4, TMCStepper -src_filter = ${common.default_src_filter} + -monitor_speed = 250000 +lib_ignore = Adafruit NeoPixel, SPI, TMCStepper # -# ARMED (STM32) +# MKS Robin Lite/Lite2 (STM32F103RCT6) # -[env:ARMED] -platform = ststm32 -framework = arduino -board = armed_v1 -build_flags = ${common.build_flags} -DUSBCON -DUSBD_VID=0x0483 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="ARMED_V1"' -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -std=gnu11 -std=gnu++11 -lib_deps = ${common.lib_deps} -lib_ignore = Adafruit NeoPixel, c1921b4 -src_filter = ${common.default_src_filter} + +[env:mks_robin_lite] +platform = ststm32 +board = genericSTM32F103RC +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_lite.py +src_filter = ${common.default_src_filter} + +lib_ignore = Adafruit NeoPixel, SPI monitor_speed = 250000 # -# MKS Robin (STM32F103ZET6) +# MKS ROBIN LITE3 (STM32F103RCT6) # -[env:mks_robin] +[env:mks_robin_lite3] platform = ststm32 -framework = arduino -board = genericSTM32F103ZE -extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +board = genericSTM32F103RC +extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_lite3.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + lib_deps = ${common.lib_deps} -lib_ignore = c1921b4 - libf3c - lib066 - Adafruit NeoPixel_ID28 - Adafruit NeoPixel - libf3e - TMC26XStepper - U8glib-HAL +lib_ignore = Adafruit NeoPixel, SPI + # # MKS Robin Mini (STM32F103VET6) # [env:mks_robin_mini] platform = ststm32 -framework = arduino board = genericSTM32F103VE -extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_mini.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_mini.py src_filter = ${common.default_src_filter} + -lib_deps = ${common.lib_deps} -lib_ignore = c1921b4 - libf3c - lib066 - Adafruit NeoPixel_ID28 - Adafruit NeoPixel - libf3e - TMC26XStepper +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 250000 # # MKS Robin Nano (STM32F103VET6) # [env:mks_robin_nano] platform = ststm32 -framework = arduino board = genericSTM32F103VE -extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano.py src_filter = ${common.default_src_filter} + -lib_deps = ${common.lib_deps} -lib_ignore = c1921b4 - libf3c - lib066 - Adafruit NeoPixel_ID28 - Adafruit NeoPixel - libf3e - TMC26XStepper +lib_ignore = Adafruit NeoPixel, SPI +monitor_speed = 250000 # # JGAurora A5S A1 (STM32F103ZET6) # -[env:JGAURORA_A5S_A1] -platform = ststm32@5.3.0 -framework = arduino +[env:jgaurora_a5s_a1] +platform = ststm32 board = genericSTM32F103ZE +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DSTM32F1xx -std=gnu++14 -DSTM32_XL_DENSITY +build_unflags = -std=gnu++11 extra_scripts = buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py - ${common.build_flags} src_filter = ${common.default_src_filter} + -lib_deps = ${common.lib_deps} -lib_ignore = c1921b4 - libf3c - lib066 - Adafruit NeoPixel_ID28 - Adafruit NeoPixel - libf3e - TMC26XStepper -lib_ldf_mode = 1 +lib_ignore = Adafruit NeoPixel, SPI monitor_speed = 250000 +# +# Malyan M200 (STM32F103CB) +# +[env:STM32F103CB_malyan] +platform = ststm32 +board = malyanM200 +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -D MOTHERBOARD="BOARD_MALYAN_M200" -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections + -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__ +src_filter = ${common.default_src_filter} + +lib_ignore = Adafruit NeoPixel, LiquidCrystal, LiquidTWI2, TMCStepper, U8glib-HAL, SPI + +# +# Chitu boards like Tronxy X5s (STM32F103ZET6) +# +[env:chitu_f103] +platform = ststm32 +board = genericSTM32F103ZE +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DSTM32F1xx -std=gnu++14 -DSTM32_XL_DENSITY +build_unflags = -std=gnu++11 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG= -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 +extra_scripts = buildroot/share/PlatformIO/scripts/chitu_crypt.py +src_filter = ${common.default_src_filter} + +lib_ignore = Adafruit NeoPixel +monitor_speed = 250000 + +# +# FYSETC S6 (STM32F446VET6 ARM Cortex-M4) +# +[env:FYSETC_S6] +platform = ststm32 +board = fysetc_s6 +platform_packages = tool-stm32duino +build_flags = ${common.build_flags} + -DTARGET_STM32F4 -std=gnu++14 + -DVECT_TAB_OFFSET=0x10000 + -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED -DUSBD_VID=0x0483 '-DUSB_PRODUCT="FYSETC_S6"' +build_unflags = -std=gnu++11 +extra_scripts = buildroot/share/PlatformIO/scripts/fysetc_STM32S6.py +src_filter = ${common.default_src_filter} + +lib_ignore = Arduino-L6470 +debug_tool = stlink +#upload_protocol = stlink +upload_protocol = serial +monitor_speed = 250000 + # # STM32F407VET6 with RAMPS-like shield # 'Black' STM32F407VET6 board - http://wiki.stm32duino.com/index.php?title=STM32F407 # Shield - https://github.com/jmz52/Hardware # -[env:black_stm32f407ve] -platform = ststm32 -framework = arduino -board = blackSTM32F407VET6 -extra_scripts = pre:buildroot/share/PlatformIO/scripts/black_stm32f407vet6.py -build_flags = ${common.build_flags} - -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"BLACK_F407VE\" -lib_deps = ${common.lib_deps} -lib_ignore = Adafruit NeoPixel, c1921b4, TMCStepper, TMC26XStepper, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster -src_filter = ${common.default_src_filter} + +[env:STM32F407VE_black] +platform = ststm32 +board = blackSTM32F407VET6 +platform_packages = framework-arduinoststm32@>=3.10700.191028 +build_flags = ${common.build_flags} + -DTARGET_STM32F4 -DARDUINO_BLACK_F407VE + -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"BLACK_F407VE\" + -IMarlin/src/HAL/HAL_STM32 +build_unflags = -std=gnu++11 +extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py +lib_ignore = Adafruit NeoPixel, TMCStepper, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster, SoftwareSerial +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 + +# +# Bigtreetech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) +# +[env:BIGTREE_SKR_PRO] +platform = ststm32 +board = BigTree_SKR_Pro +platform_packages = framework-arduinoststm32@>=3.10700.191028 +build_flags = ${common.build_flags} + -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407ZG\" + -DTARGET_STM32F4 -DSTM32F407_5ZX -DVECT_TAB_OFFSET=0x8000 + -DHAVE_HWSERIAL6 + -IMarlin/src/HAL/HAL_STM32 +build_unflags = -std=gnu++11 +extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py +lib_deps = + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip + LiquidCrystal + TMCStepper@>=0.5.2,<1.0.0 + Adafruit NeoPixel + LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip + Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/dev.zip +lib_ignore = SoftwareSerial, SoftwareSerialM +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 + +# +# Bigtreetech SKR BTT002 (STM32F407VET6 ARM Cortex-M4) +# +[env:BIGTREE_BTT002] +platform = ststm32@5.6.0 +board = BigTree_Btt002 +build_flags = ${common.build_flags} + -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407VE\" + -DTARGET_STM32F4 -DSTM32F407_5VX -DVECT_TAB_OFFSET=0x8000 + -DHAVE_HWSERIAL2 + -DHAVE_HWSERIAL3 + -DPIN_SERIAL2_RX=PD_6 + -DPIN_SERIAL2_TX=PD_5 +build_unflags = -std=gnu++11 +extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py +lib_ignore = Adafruit NeoPixel, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 + +# +# Teensy 3.1 / 3.2 (ARM Cortex-M4) +# +[env:teensy31] +platform = teensy +board = teensy31 +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +lib_ignore = Adafruit NeoPixel +src_filter = ${common.default_src_filter} + monitor_speed = 250000 # @@ -462,73 +684,27 @@ monitor_speed = 250000 # [env:teensy35] platform = teensy -framework = arduino board = teensy35 -build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip lib_ignore = Adafruit NeoPixel src_filter = ${common.default_src_filter} + monitor_speed = 250000 -# -# Malyan M200 (STM32F1) -# -[env:malyanm200] -platform = ststm32 -framework = arduino -board = malyanM200 -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -D MOTHERBOARD="BOARD_MALYAN_M200" -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections -src_filter = ${common.default_src_filter} + -#- -lib_ignore = - U8glib - LiquidCrystal_I2C - LiquidCrystal - NewliquidCrystal - LiquidTWI2 - Adafruit NeoPixel - TMCStepper - Servo(STM32F1) - TMC26XStepper - U8glib-HAL - c1921b4 - # # Espressif ESP32 # [env:esp32] platform = espressif32 board = esp32dev -framework = arduino upload_speed = 115200 monitor_speed = 115200 -upload_port = /dev/ttyUSB0 -lib_deps = - https://github.com/me-no-dev/AsyncTCP.git - https://github.com/me-no-dev/ESPAsyncWebServer.git -lib_ignore = - LiquidCrystal_I2C - LiquidCrystal - NewliquidCrystal - LiquidTWI2 - TMC26XStepper - c1921b4 - SailfishLCD - SailfishRGB_LED -src_filter = ${common.default_src_filter} + - -# -# FYSETC F6 V1.3 -# -[env:fysetc_f6_13] -platform = atmelavr -framework = arduino -board = fysetc_f6_13 -build_flags = ${common.build_flags} -board_build.f_cpu = 16000000L -lib_deps = ${common.lib_deps} -src_filter = ${common.default_src_filter} + -monitor_speed = 250000 +upload_port = /dev/ttyUSB0 +lib_deps = + AsyncTCP=https://github.com/me-no-dev/AsyncTCP/archive/master.zip + ESPAsyncWebServer=https://github.com/me-no-dev/ESPAsyncWebServer/archive/master.zip +lib_ignore = LiquidCrystal, LiquidTWI2, SailfishLCD, SailfishRGB_LED +src_filter = ${common.default_src_filter} + # # Native @@ -536,10 +712,34 @@ monitor_speed = 250000 # [env:linux_native] platform = native -build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread +framework = +build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined src_build_flags = -Wall -IMarlin/src/HAL/HAL_LINUX/include build_unflags = -Wall lib_ldf_mode = off lib_deps = extra_scripts = src_filter = ${common.default_src_filter} + + +# +# Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4) +# +[env:SAMD51_grandcentral_m4] +platform = atmelsam +board = adafruit_grandcentral_m4 +build_flags = ${common.build_flags} -std=gnu++17 +extra_scripts = ${common.extra_scripts} +build_unflags = -std=gnu++11 +src_filter = ${common.default_src_filter} + +debug_tool = jlink + +# +# Just print the dependency tree +# +[env:include_tree] +platform = atmelavr +board = megaatmega2560 +build_flags = -c -H -std=gnu++11 -Wall -Os -D__MARLIN_FIRMWARE__ +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +src_filter = +